|
@@ -23,7 +23,11 @@
|
|
|
ref="tree"
|
|
|
@node-click="handleNodeClick"
|
|
|
v-if="deviceType=='0'"
|
|
|
- ></el-tree>
|
|
|
+ >
|
|
|
+ <span class="span-ellipsis" slot-scope="{ node, data }">
|
|
|
+ <span :title="node.label">{{ node.label }}</span>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
<el-tree
|
|
|
:highlight-current="true"
|
|
|
:data="elecTree"
|
|
@@ -35,7 +39,11 @@
|
|
|
ref="tree"
|
|
|
@node-click="handleNodeClick"
|
|
|
v-if="deviceType=='1'"
|
|
|
- ></el-tree>
|
|
|
+ >
|
|
|
+ <span class="span-ellipsis" slot-scope="{ node, data }">
|
|
|
+ <span :title="node.label">{{ node.label }}</span>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -235,7 +243,12 @@
|
|
|
defaultProps: {
|
|
|
children: 'children',
|
|
|
label: 'name'
|
|
|
- }
|
|
|
+ },
|
|
|
+ clickFlag:false,
|
|
|
+ onlineList: [],
|
|
|
+ offlineList : [],
|
|
|
+ reportList: [],
|
|
|
+ nowArr:[]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -412,19 +425,22 @@
|
|
|
},
|
|
|
//分页查询本地数据
|
|
|
getCurrentList() {
|
|
|
+ this.page=1
|
|
|
this.total = 0
|
|
|
this.offline = 0
|
|
|
this.online = 0
|
|
|
this.report = 0
|
|
|
let arr1 = []
|
|
|
this.originData.forEach((i) => {
|
|
|
- if(this.belongLineId){
|
|
|
- // 根据支路查询
|
|
|
+ if(this.clickFlag){
|
|
|
+ if(this.belongLineId&&this.belongLineId.length>0){
|
|
|
+ // 根据支路查询
|
|
|
if (i.deviceType == this.deviceType) {
|
|
|
- if (i.belongLineId == this.belongLineId) {
|
|
|
+ if (this.belongLineId.includes(i.id)) {
|
|
|
arr1.push(i)
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}else{
|
|
|
//根据设备类型
|
|
|
if (i.deviceType == this.deviceType) {
|
|
@@ -448,49 +464,58 @@
|
|
|
|
|
|
})
|
|
|
|
|
|
- let onlineList = []
|
|
|
- let offlineList = []
|
|
|
- let reportList = []
|
|
|
+ this.onlineList = []
|
|
|
+ this.offlineList = []
|
|
|
+ this.reportList = []
|
|
|
arr1.forEach((i) => {
|
|
|
if (i.offline) {
|
|
|
this.offline++
|
|
|
- offlineList.push(i)
|
|
|
+ this.offlineList.push(i)
|
|
|
}
|
|
|
if (i.report && i.offline == false) {
|
|
|
this.report++
|
|
|
- reportList.push(i)
|
|
|
+ this.reportList.push(i)
|
|
|
}
|
|
|
if (i.offline == false && i.report == false) {
|
|
|
this.online++
|
|
|
- onlineList.push(i)
|
|
|
+ this.onlineList.push(i)
|
|
|
}
|
|
|
})
|
|
|
+ this.nowArr=arr1
|
|
|
+ this.getStatusList()
|
|
|
+ },
|
|
|
+ handleSelect(e) {
|
|
|
+ this.page=1
|
|
|
+ this.select = e
|
|
|
+ this.getStatusList()
|
|
|
+ // if (e == 1) {
|
|
|
+ // this.queryScadaData()
|
|
|
+ // } else {
|
|
|
+ // this.getCurrentList()
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ getStatusList(){
|
|
|
if (this.select == 1) {
|
|
|
- this.currentList = arr1.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
- this.total = arr1.length
|
|
|
+ this.currentList = this.nowArr.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
+ this.total = this.nowArr.length
|
|
|
} else if (this.select == 2) {
|
|
|
- this.currentList = onlineList.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
- this.total = onlineList.length
|
|
|
+ this.currentList = this.onlineList.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
+ this.total = this.onlineList.length
|
|
|
} else if (this.select == 3) {
|
|
|
- this.currentList = reportList.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
- this.total = reportList.length
|
|
|
+ this.currentList = this.reportList.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
+ this.total = this.reportList.length
|
|
|
} else if (this.select == 4) {
|
|
|
- this.currentList = offlineList.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
- this.total = offlineList.length
|
|
|
+ this.currentList = this.offlineList.slice(this.size * (this.page - 1), this.size * this.page)
|
|
|
+ this.total = this.offlineList.length
|
|
|
}
|
|
|
this.loading=false
|
|
|
- },
|
|
|
- handleSelect(e) {
|
|
|
- this.select = e
|
|
|
- if (e == 1) {
|
|
|
- this.queryScadaData()
|
|
|
- } else {
|
|
|
- this.getCurrentList()
|
|
|
- }
|
|
|
+ this.clickFlag=false
|
|
|
},
|
|
|
handleNodeClick(data) {
|
|
|
+ // 点击查询标志
|
|
|
+ this.clickFlag=true
|
|
|
console.log(data)
|
|
|
- this.belongLineId=data.id
|
|
|
+ this.belongLineId=data.deviceIds
|
|
|
this.getCurrentList()
|
|
|
|
|
|
|
|
@@ -515,12 +540,12 @@
|
|
|
// 页数
|
|
|
changeSize(data) {
|
|
|
this.size = data
|
|
|
- this.getCurrentList()
|
|
|
+ this.getStatusList()
|
|
|
},
|
|
|
// 翻页改变
|
|
|
changecurrent(data) {
|
|
|
this.page = data
|
|
|
- this.getCurrentList()
|
|
|
+ this.getStatusList()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -554,27 +579,8 @@
|
|
|
.left-bottom {
|
|
|
height: 100%;
|
|
|
background: #f8f8f8;
|
|
|
- overflow-y: auto;
|
|
|
- overflow-x: auto;
|
|
|
- &::-webkit-scrollbar {
|
|
|
- width: 4px;
|
|
|
- background: white;
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-corner,
|
|
|
- &::-webkit-scrollbar-thumb,
|
|
|
- &::-webkit-scrollbar-track {
|
|
|
- border-radius: 4px;
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-corner,
|
|
|
- &::-webkit-scrollbar-track {
|
|
|
- /* 滚动条轨道 */
|
|
|
- background-color: rgba(180, 160, 120, 0.1);
|
|
|
- box-shadow: inset 0 0 1px rgba(180, 160, 120, 0.5);
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-thumb {
|
|
|
- /* 滚动条手柄 */
|
|
|
- background-color: #cccccc;
|
|
|
- }
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
.el-input {
|
|
|
width: 215px;
|
|
|
height: 34px;
|
|
@@ -583,6 +589,27 @@
|
|
|
.building-info {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+ overflow-x: auto;
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ width: 4px;
|
|
|
+ background: white;
|
|
|
+ }
|
|
|
+ &::-webkit-scrollbar-corner,
|
|
|
+ &::-webkit-scrollbar-thumb,
|
|
|
+ &::-webkit-scrollbar-track {
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ &::-webkit-scrollbar-corner,
|
|
|
+ &::-webkit-scrollbar-track {
|
|
|
+ /* 滚动条轨道 */
|
|
|
+ background-color: rgba(180, 160, 120, 0.1);
|
|
|
+ box-shadow: inset 0 0 1px rgba(180, 160, 120, 0.5);
|
|
|
+ }
|
|
|
+ &::-webkit-scrollbar-thumb {
|
|
|
+ /* 滚动条手柄 */
|
|
|
+ background-color: #cccccc;
|
|
|
+ }
|
|
|
.el-tree {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
@@ -757,4 +784,10 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .span-ellipsis {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
</style>
|