Commit 0bcda9e7 authored by yanzhongrong's avatar yanzhongrong

bugfix

parent 4f587a88
...@@ -77,13 +77,14 @@ export default { ...@@ -77,13 +77,14 @@ export default {
}, },
], ],
data: [], data: [],
isOpen: false, isOpen: true,
openOrNot: true, openOrNot: true,
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label", label: "label",
}, },
loading: false, loading: false,
treeClickCount: 0
}; };
}, },
name: "org-tree", name: "org-tree",
...@@ -101,8 +102,22 @@ export default { ...@@ -101,8 +102,22 @@ export default {
this.openOrNot = true; this.openOrNot = true;
}, 10); }, 10);
}, },
handleClick(data) { handleClick(data, node) {
this.$emit("selectItem", data); this.treeClickCount++;
if (this.treeClickCount >= 2) {
return
}
this.timer = window.setTimeout(() => {
if (this.treeClickCount == 1) {
this.treeClickCount = 0;
this.$emit("selectItem", data);
} else if (this.treeClickCount > 1) {
//把次数归零
this.treeClickCount = 0;
this.$emit('dblClick', data, node)
}
}, 300)
}, },
getInit() { getInit() {
this.loading = true; this.loading = true;
......
...@@ -105,5 +105,5 @@ ...@@ -105,5 +105,5 @@
.el-scrollbar__wrap { .el-scrollbar__wrap {
overflow: scroll; overflow: scroll;
width: 110%; width: 110%;
height: 100%; height: 98%;
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import store from '@/store' ...@@ -4,6 +4,7 @@ import store from '@/store'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import socket from "@/utils/websocket"; import socket from "@/utils/websocket";
import Vue from 'vue' import Vue from 'vue'
import EventBus from '@/utils/bus'
// create an axios instance // create an axios instance
const service = axios.create({ const service = axios.create({
......
...@@ -51,23 +51,29 @@ ...@@ -51,23 +51,29 @@
prop="alarmInfo" prop="alarmInfo"
label="告警信息" label="告警信息"
align="center" align="center"
width="200"
> >
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.alarmInfo" :key="index">
<span>距离:{{ item.distance }}</span>
<span>驻波比:{{ item.value }}</span>
</div>
<div>漏缆百米损耗: {{ scope.row.lossValue }}</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="lateUploadTime" prop="lateUploadTime"
label="最新上传时间" label="最新上传时间"
align="center" align="center"
width="105" width="200"
/> />
<el-table-column <el-table-column
prop="statusTimeChange" prop="statusTimeChange"
label="状态变化时间" label="状态变化时间"
align="center" align="center"
width="105" width="200"
/> />
<el-table-column prop="confirmPerson" label="确认人" align="center" /> <el-table-column prop="confirmPerson" label="确认人" width="100" align="center" />
<el-table-column prop="confirmTime" label="确认时间" align="center" /> <el-table-column prop="confirmTime" label="确认时间" width="180" align="center" />
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -177,12 +183,11 @@ import { cableTimeList, cableConfirm, cableCancel } from "../api"; ...@@ -177,12 +183,11 @@ import { cableTimeList, cableConfirm, cableCancel } from "../api";
import { exportLeakyCable } from "@/api/export"; import { exportLeakyCable } from "@/api/export";
import search from "@/views/monitor/leakageCable/components/search.vue"; import search from "@/views/monitor/leakageCable/components/search.vue";
import download from "@/utils/download"; import download from "@/utils/download";
import socket from "@/utils/websocket";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
data() { data() {
return { return {
confirmStatus: 2, confirmStatus: 1,
dialogInfo: [], dialogInfo: [],
centerDialogVisible: false, centerDialogVisible: false,
params: { params: {
...@@ -192,11 +197,6 @@ export default { ...@@ -192,11 +197,6 @@ export default {
total: 10, total: 10,
tableData: [], tableData: [],
tabs: [ tabs: [
// 1:已确认,0:未确认
{
label: "全部",
key: 2,
},
{ {
label: "已确认", label: "已确认",
key: 1, key: 1,
...@@ -210,7 +210,6 @@ export default { ...@@ -210,7 +210,6 @@ export default {
istrue: 0, istrue: 0,
searchOption: {}, searchOption: {},
exids: [], exids: [],
wsUrl: "ws://8.142.143.40:8885/websocket/1/1",
}; };
}, },
components: { search }, components: { search },
...@@ -246,14 +245,19 @@ export default { ...@@ -246,14 +245,19 @@ export default {
this.getTableData(); this.getTableData();
}, },
getTableData() { getTableData() {
let type = this.confirmStatus == 2 ? "" : this.confirmStatus;
let param = { let param = {
confirmStatus: type, confirmStatus: this.confirmStatus,
...this.params, ...this.params,
...this.searchOption, ...this.searchOption,
}; };
cableTimeList(param).then((res) => { cableTimeList(param).then((res) => {
let list = res.records || []; let list = res.records || [];
list.forEach(item => {
if(item.alarmInfo != '') {
item.alarmInfo = JSON.parse(item.alarmInfo)
item.lossValue = eval(item.alarmInfo.map(k => k.lossValue).join('+'))
}
});
this.tableData = list; this.tableData = list;
this.total = res.total; this.total = res.total;
this.exids = list.map((i) => i.id); this.exids = list.map((i) => i.id);
...@@ -298,12 +302,6 @@ export default { ...@@ -298,12 +302,6 @@ export default {
}, },
exportList() { exportList() {
let type = this.confirmStatus == 2 ? "" : this.confirmStatus;
let param = {
confirmStatus: type,
...this.params,
...this.searchOption,
};
if (this.exids.length == 0) { if (this.exids.length == 0) {
this.$message.warning("暂无数据"); this.$message.warning("暂无数据");
return false; return false;
...@@ -315,29 +313,13 @@ export default { ...@@ -315,29 +313,13 @@ export default {
}, },
}, },
computed: { computed: {
// getWsMsg:{
// get(){
// return this.$store.state.websocket.webSocketMsg
// },
// set(a){
// this.$store.state.websocket.webSocketMsg=a
// }
// },
}, },
watch: { watch: {
// getWsMsg: {
// handler(newVal) {
// this.getWsMsg=!!newVal
// console.log(newVal);
// // alert("接收到webSocket推送" + newVal);
// },
// },
}, },
mounted() { mounted() {
this.getTableData(); this.getTableData();
}, },
created() { created() {
// socket({socketUrl:this.wsUrl});
}, },
}; };
</script> </script>
......
...@@ -138,7 +138,6 @@ import { deviceList, deviceConfirm, deviceCancel } from "../api"; ...@@ -138,7 +138,6 @@ import { deviceList, deviceConfirm, deviceCancel } from "../api";
import { exportConnet } from "@/api/export"; import { exportConnet } from "@/api/export";
import search from "./components/search.vue"; import search from "./components/search.vue";
import download from "@/utils/download"; import download from "@/utils/download";
import socket from "@/utils/websocket";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
export default { export default {
data() { data() {
...@@ -146,7 +145,7 @@ export default { ...@@ -146,7 +145,7 @@ export default {
alarmInfo: "", alarmInfo: "",
dialogInfo: [], dialogInfo: [],
centerDialogVisible: false, centerDialogVisible: false,
confirmStatus: 2, confirmStatus: 1,
params: { params: {
current: 1, current: 1,
size: 10, size: 10,
...@@ -154,10 +153,6 @@ export default { ...@@ -154,10 +153,6 @@ export default {
total: 10, total: 10,
tableData: [], tableData: [],
tabs: [ tabs: [
{
label: "全部",
key: 2,
},
{ {
label: "已确认", label: "已确认",
key: 1, key: 1,
...@@ -171,7 +166,6 @@ export default { ...@@ -171,7 +166,6 @@ export default {
istrue: 0, istrue: 0,
searchOption: {}, searchOption: {},
exids: [], exids: [],
wsUrl: "ws://8.142.143.40:8885/websocket/1/2",
}; };
}, },
components: { search }, components: { search },
...@@ -211,16 +205,14 @@ export default { ...@@ -211,16 +205,14 @@ export default {
this.getTableData(); this.getTableData();
}, },
getTableData() { getTableData() {
let type = this.confirmStatus == 2 ? "" : this.confirmStatus;
let param = { let param = {
confirmStatus: type, confirmStatus: this.confirmStatus,
...this.params, ...this.params,
...this.searchOption, ...this.searchOption,
}; };
deviceList(param).then((res) => { deviceList(param).then((res) => {
let list = res.records || []; let list = res.records || [];
this.tableData = list; this.tableData = list;
console.log(this.tableData);
this.total = res.total; this.total = res.total;
this.exids = list.map((i) => i.id); this.exids = list.map((i) => i.id);
if (this.istrue == 1) { if (this.istrue == 1) {
...@@ -265,12 +257,6 @@ export default { ...@@ -265,12 +257,6 @@ export default {
}, },
exportList() { exportList() {
let type = this.confirmStatus == 2 ? "" : this.confirmStatus;
let param = {
confirmStatus: type,
...this.params,
...this.searchOption,
};
if (this.exids.length == 0) { if (this.exids.length == 0) {
this.$message.warning("暂无数据"); this.$message.warning("暂无数据");
return false; return false;
...@@ -285,7 +271,6 @@ export default { ...@@ -285,7 +271,6 @@ export default {
this.getTableData(); this.getTableData();
}, },
created() { created() {
// socket({socketUrl:this.wsUrl});
}, },
}; };
</script> </script>
......
...@@ -12,20 +12,25 @@ ...@@ -12,20 +12,25 @@
</div> </div>
<div> <div>
<el-row class="text" :gutter="24"> <el-row class="text" :gutter="24">
<el-col :span="10"> <el-col :span="7">
<div class="item_name">历史记录</div> <div class="item_name">历史记录</div>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="7">
<div class="item_data">{{ form.log.all }}</div> <div class="item_data">{{ form.log.all }}</div>
</el-col> </el-col>
<el-col :span="7">
<el-button type="success" size="middle">趋势分析图形</el-button>
</el-col>
</el-row> </el-row>
<el-row class="text" :gutter="24"> <el-row class="text" :gutter="24">
<el-col :span="10"> <el-col :span="7">
<div class="item_name">维修记录</div> <div class="item_name">维修记录</div>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="7">
<div class="item_data">{{ form.log.monitor }}</div> <div class="item_data">{{ form.log.monitor }}</div>
</el-col> </el-col>
<el-col :span="7">
</el-col>
</el-row> </el-row>
</div> </div>
</el-card> </el-card>
...@@ -281,7 +286,6 @@ export default { ...@@ -281,7 +286,6 @@ export default {
methods: { methods: {
savebtn() { savebtn() {
this.flag = true; this.flag = true;
console.log(this.info());
leakyCableOpen(this.info()).then((res) => { leakyCableOpen(this.info()).then((res) => {
console.log("漏缆"); console.log("漏缆");
}); });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="dashboard-container"> <div class="dashboard-container">
<!-- 首页 --> <!-- 首页 -->
<div> <div>
<orgTree style="float:left" @selectItem="selectItem" @defaultSite="defaultSite"/> <orgTree ref="tree" style="float:left" @selectItem="selectItem" @defaultSite="defaultSite" @dblClick="dblClick"/>
<div class="ml300"> <div class="ml300">
<type :type="type" :curInfo="curInfo" /> <type :type="type" :curInfo="curInfo" />
</div> </div>
...@@ -29,17 +29,29 @@ export default { ...@@ -29,17 +29,29 @@ export default {
computed: { computed: {
}, },
mounted() { mounted() {
// this.defaultSite()
// this.getDetailNode(30)
}, },
methods: { methods: {
defaultSite(data){ defaultSite(data){
this.getDetailNode(data) this.getDetailNode(data)
}, },
selectItem(data) { selectItem(data) {
this.type = data.type this.type = data.type
this.getDetailNode(data.id) this.getDetailNode(data.id)
}, },
dblClick(data, node) {
this.changeTreeNodeStatus(node)
},
changeTreeNodeStatus (node) {
node.expanded = true
for (let i = 0; i < node.childNodes.length; i++) {
// 改变节点的自身expanded状态
node.childNodes[i].expanded = true
// 遍历子节点
if (node.childNodes[i].childNodes.length > 0) {
this.changeTreeNodeStatus(node.childNodes[i])
}
}
},
getDetailNode(data) { getDetailNode(data) {
let param = { let param = {
type: this.type, type: this.type,
...@@ -53,7 +65,6 @@ export default { ...@@ -53,7 +65,6 @@ export default {
}) })
} }
this.curInfo = res this.curInfo = res
console.log(res);
}) })
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment