修改树结构界面

master
夜笙歌 3 months ago
parent 62fc330ee3
commit 2556df6294

@ -107,35 +107,35 @@
</div> </div>
<div class="table1"> <div class="table1">
<div class="h1"> <div class="h1" style="line-height: 1vw">
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
设备名称 设备名称
</div> </div>
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
A相电流 A相电流
</div> </div>
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
B相电流 B相电流
</div> </div>
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
C相电流 C相电流
</div> </div>
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
A相电压 A相电压
</div> </div>
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
B相电压 B相电压
</div> </div>
<div class="scrollTable" style="font-weight: bold;width: calc(100% / 7);"> <div class="scrollTable" style="line-height: 1vw;font-weight: bold;width: calc(100% / 7);">
C相电压 C相电压
</div> </div>
</div> </div>
<vue-seamless-scroll <vue-seamless-scroll
:class-option="{...chart1TableOption,limitMoveNum:4}" :class-option="{...chart1TableOption,limitMoveNum:6}"
:data="table1Data" :data="table1Data"
:key="scrollKey1" :key="scrollKey1"
class="case-item" class="case-item"
style="height: 84%;overflow: hidden;" style="height: calc(100% - 1vw);overflow: hidden;"
> >
<div <div
v-for="(item, index) in table1Data" v-for="(item, index) in table1Data"
@ -180,7 +180,7 @@
</div> </div>
</div> </div>
<vue-seamless-scroll <vue-seamless-scroll
:class-option="{...chart1TableOption,limitMoveNum:10}" :class-option="{...chart1TableOption,limitMoveNum:6}"
:data="realTimeAlarmData" :data="realTimeAlarmData"
:key="scrollKey2" :key="scrollKey2"
class="case-item" class="case-item"
@ -262,6 +262,7 @@ export default {
}, },
data() { data() {
return { return {
selectData: 'year', selectData: 'year',
typeData: "2", typeData: "2",
colors: ['#30A0FB', '#00FF89', '#F9E435', '#FB5C2D', '#73c0de'], colors: ['#30A0FB', '#00FF89', '#F9E435', '#FB5C2D', '#73c0de'],

@ -1,10 +1,35 @@
<template> <template>
<div> <div>
<div class="bg"> <div class="bg">
<div class="typeSelect">
<el-select v-model="typeData" placeholder="请选择" @change="getData" style="width: 120px">
<el-option
label="电"
value="2">
</el-option>
<el-option
label="水"
value="3">
</el-option>
<el-option
label="压缩空气"
value="4">
</el-option>
<el-option
label="蒸汽"
value="5">
</el-option>
<el-option
label="氮气"
value="6">
</el-option>
</el-select>
</div>
<div class="title">正道能源监控系统</div> <div class="title">正道能源监控系统</div>
<div class="content"> <div class="content">
<div class="list" v-for="item in list" :key="item.name"> <div class="list" v-for="item in list" :key="item.name">
<ListItem :itemData="item" :isRoot="true"></ListItem> <ListItem v-if="isShow" :itemData="item" :isRoot="true"></ListItem>
</div> </div>
</div> </div>
</div> </div>
@ -24,6 +49,14 @@ export default {
}, },
data() { data() {
return { return {
isShow: true,
typeData: '2',
fieldUnits: {
vA: 'V', vB: 'V', vC: 'V',
iA: 'A', iB: 'A', iC: 'A',
zxyg: '', fxyg: '',
},
fieldFilter: ['vA', 'vB', 'vC', 'iA', 'iB', 'iC', 'zxyg', 'fxyg'],
list1: [ list1: [
{ {
"name": "root", "name": "root",
@ -157,22 +190,7 @@ export default {
} }
}, },
async mounted() { async mounted() {
const fieldUnits = { this.getData()
vA: 'V', vB: 'V', vC: 'V',
iA: 'A', iB: 'A', iC: 'A',
zxyg: '', fxyg: '',
};
const fieldFilter = ['vA', 'vB', 'vC', 'iA', 'iB', 'iC', 'zxyg', 'fxyg'];
realTimeData({
monitorType: 2
}).then(res => {
console.log(res)
const tree = this.buildTree(res.data, fieldUnits, fieldFilter);
this.list = tree
console.log(tree)
})
}, },
methods: { methods: {
buildTree(data, fieldUnits, fieldFilter) { buildTree(data, fieldUnits, fieldFilter) {
@ -211,6 +229,16 @@ export default {
}); });
return tree; return tree;
},
getData() {
this.isShow = false
realTimeData({
monitorType: this.typeData
}).then(res => {
const tree = this.buildTree(res.data, this.fieldUnits, this.fieldFilter);
this.list = tree
this.isShow = true
})
} }
} }
} }
@ -255,4 +283,15 @@ export default {
.list { .list {
} }
} }
.typeSelect {
position: absolute;
top: 6%;
left: 2%;
/deep/ .el-input__inner {
background-color: #0000;
color: #fff;
}
}
</style> </style>
Loading…
Cancel
Save