This commit is contained in:
chengdandan 2023-02-22 15:56:46 +08:00
commit 17de0fe53e
2 changed files with 78 additions and 137 deletions

View File

@ -14,7 +14,7 @@
</div> </div>
<div> <div>
<div> <div>
{{ typeValue.time }} {{ typeValue.time ? typeValue.time : '' }}
</div> </div>
</div> </div>
</el-card> </el-card>
@ -55,7 +55,7 @@
</div> </div>
<div> <div>
<div> <div>
{{ dataArr[0].time }} {{ dataArr[0].time ? dataArr[0].time : '' }}
</div> </div>
</div> </div>
</div> </div>
@ -73,7 +73,7 @@
<span style="font-size:18px;">{{ this.chartName + '-' + this.componentName + '-' + '表格' + '-' + triggerType }}</span> <span style="font-size:18px;">{{ this.chartName + '-' + this.componentName + '-' + '表格' + '-' + triggerType }}</span>
</div> </div>
<div class="tableTime"> <div class="tableTime">
{{ dataArr[0].time }} {{ dataArr[0].time ? dataArr[0].time : '' }}
</div> </div>
</div> </div>
<div v-if="pageType == '断面'" style="margin-bottom: 20px; border: 1px solid #e4e7ed"> <div v-if="pageType == '断面'" style="margin-bottom: 20px; border: 1px solid #e4e7ed">
@ -180,7 +180,7 @@ export default {
// //
dataArr: { dataArr: {
handler(newVal) { handler(newVal) {
console.log("dataArr",newVal) console.log('dataArr', newVal);
}, },
immediate: true immediate: true

View File

@ -3,11 +3,15 @@
<el-empty v-show="componentList.length == 0" :image-size="400"></el-empty> <el-empty v-show="componentList.length == 0" :image-size="400"></el-empty>
<!-- <p class="title" style="margin-bottom: 20px;font-size: 20px;font-weight: 400;">数据看板</p> --> <!-- <p class="title" style="margin-bottom: 20px;font-size: 20px;font-weight: 400;">数据看板</p> -->
<el-scrollbar class="scrollbar"> <el-scrollbar class="scrollbar">
<div class="dataBoard" ref='dataBoard' v-if="activeName == 'second'"> <div class="dataBoard" ref="dataBoard" v-if="activeName == 'second'">
<!-- 断面 --> <!-- 断面 -->
<div class="plate1" ref="plate1"> <div class="plate1" ref="plate1">
<div :class="sectionData.length <= 2 ? 'sectionBox' : 'section'" ref="section" <div
v-for="(s, i) in sectionData" :key="s.analogAreaComponentId"> :class="sectionData.length <= 2 ? 'sectionBox' : 'section'"
ref="section"
v-for="(s, i) in sectionData"
:key="s.analogAreaComponentId"
>
<template> <template>
<div ref="sectionContent" > <div ref="sectionContent" >
<div> <div>
@ -99,10 +103,11 @@ export default {
default() { default() {
return []; return [];
} }
}, }
}, },
data() { data() {
return { return {
acticveName: [],
title1: '01断面', title1: '01断面',
title2: '01区域', title2: '01区域',
dialogVisible: false, dialogVisible: false,
@ -321,8 +326,6 @@ export default {
} }
], ],
idVal: '', idVal: '',
// //
componentList: [], componentList: [],
@ -331,16 +334,12 @@ export default {
sectionData: [], sectionData: [],
// //
tableList: [], tableList: [],
// 线 // 线
headWay: [], headWay: [],
tripData: [], tripData: [],
sectionArr: [], sectionArr: [],
@ -349,62 +348,32 @@ export default {
typeTimeMode: {}, typeTimeMode: {},
// //
typeCycleTimeData: {}, typeCycleTimeData: {},
typeCycleStatistics: {}, typeCycleStatistics: {}
nw:'1'
}; };
}, },
created() { created() {
this.idVal = this.$route.query.id; this.idVal = this.$route.query.id;
this.sectionData=[] getComponentSection({ VideoId: this.idVal }).then(res => {
this.sectionArr=[]
// if(this.nw=='second'){
// }
// this.getNEW()
},
methods: {
getNEW(){
getComponentSection({ VideoId: this.$route.query.id }).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.componentList = res.data.data this.componentList = res.data.data;
this.siftData() this.siftData();
//
// this.componentList.forEach((val) => {
// this.sectionArr.push(val.combinationName);
// this.sectionArr = Array.from(new Set(this.sectionArr));
// });
// this.sectionData = this.sectionArr.map((item) => {
// item = { title: item, children: [] };
// this.componentList.forEach((val) => {
// if (item.title == val.combinationName) {
// item.children.push(val);
// }
// });
// return item;
// });
console.log(this.sectionData, '455');
} else if (res.data.code == 404) {
} }
}); });
}, },
methods: {
siftData() { siftData() {
this.sectionArr=[] this.componentList.forEach(val => {
this.sectionData=[]
this.componentList.forEach((val) => {
this.sectionArr.push(val.combinationName); this.sectionArr.push(val.combinationName);
this.sectionArr = Array.from(new Set(this.sectionArr)); this.sectionArr = Array.from(new Set(this.sectionArr));
}); });
this.sectionData = this.sectionArr.map(item => {
this.sectionData = this.sectionArr.map((item) => {
if (item.children == undefined) {
item = { title: item, children: [] }; item = { title: item, children: [] };
} this.acticveName=[]
this.componentList.forEach(val => {
this.componentList.forEach((val) => {
if (item.title == val.combinationName) { if (item.title == val.combinationName) {
item.children.push(val); item.children.push(val);
} }
this.acticveName.push(val.analogAreaComponentId)
}); });
return item; return item;
}); });
@ -416,93 +385,58 @@ export default {
let downPulls1 = document.querySelectorAll('.downPull1'); let downPulls1 = document.querySelectorAll('.downPull1');
// //
downPulls1[i].dataset.num++; downPulls1[i].dataset.num++;
if (downPulls1[i].dataset.num % 2 == 0) { if (downPulls1[i].dataset.num % 2 == 0) {
downPulls1[i].style.cssText = 'transform: rotate(180deg);transition: all 0.5s linear;'; downPulls1[i].style.cssText = 'transform: rotate(180deg);transition: all 0.5s linear;';
sections[i].style.height = 'auto'; // sections[i].style.height = 'auto';
if (sectionBox[i] != undefined) { if (sectionBox[i] != undefined) {
sectionBox[i].style.height = 'auto'; // sectionBox[i].style.height = 'auto';
} }
} else { } else {
downPulls1[i].style.cssText = 'transition: all 0.5s linear;'; downPulls1[i].style.cssText = 'transition: all 0.5s linear;';
sections[i].style.height = '500px'; // sections[i].style.height = '500px';
if (sectionBox[i] != undefined) { if (sectionBox[i] != undefined) {
sectionBox[i].style.height = '48vh' // sectionBox[i].style.height = '48vh';
} }
}
},
channge(oldVal,newVal){
if (newVal == "second") {
this.getNEW()
}else if(oldVal == "second"){
this.getNEW()
} }
} }
// //
},
mounted() {
}, },
mounted() {},
watch: { watch: {
// activeName: {
// handler(newVal) {
// console.log("newVal",newVal)
// if (newVal == "second") {
// // getComponentSection({ VideoId: this.$route.query.id }).then(res => {
// // if (res.data.code == 200) {
// // this.componentList = res.data.data;
// // this.siftData();
// // } else if (res.data.code == 404) {
// // }
// // });
// // this.nw=newVal
// this.getNEW()
// }
// },
// immediate: true
// },
activeName:'channge',
// //
triggerData: { triggerData: {
handler(newVal, oldVal) { handler(newVal, oldVal) {},
},
immediate: true immediate: true
}, },
// //
triggerListData: { triggerListData: {
handler(newVal) { handler(newVal) {
this.triggerList = newVal this.triggerList = newVal;
// //
// console.log(newVal, 'triggerlistData'); // console.log(newVal, 'triggerlistData');
this.componentList.forEach(ele => { this.componentList.forEach(ele => {
if (ele.trigger == undefined && ele.timeMode == '触发') { if (ele.trigger == undefined && ele.timeMode == '触发') {
ele.trigger = [] ele.trigger = [];
} }
newVal.forEach(item => { newVal.forEach(item => {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') { if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
if (ele.trigger.length == 10) { if (ele.trigger.length == 10) {
ele.trigger.pop() ele.trigger.pop();
} else { } else {
item.time = item.time.split('.')[0] item.time = item.time.split('.')[0];
// //
if (item.type_data != null) { if (item.type_data != null) {
// console.log(item,'461461'); // console.log(item,'461461');
this.typeTimeMode = item this.typeTimeMode = item
} }
ele.trigger.unshift(item) ele.trigger.unshift(item);
} }
} }
}) });
}) });
// console.log(this.sectionData, '');
}, },
immediate: true immediate: true
}, },
@ -514,24 +448,27 @@ export default {
if (newVal.length != 0) { if (newVal.length != 0) {
this.componentList.forEach(ele => { this.componentList.forEach(ele => {
if (ele.cycleTimeData == undefined && ele.timeMode == '周期时刻') { if (ele.cycleTimeData == undefined && ele.timeMode == '周期时刻') {
ele.cycleTimeData = [] ele.cycleTimeData = [];
} }
newVal.forEach(item => { newVal.forEach(item => {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期时刻' && ele.analogAreaGraphId == item.graphical_id) { if (
ele.analogAreaComponentId == item.component_id &&
ele.timeMode == '周期时刻' &&
ele.analogAreaGraphId == item.graphical_id
) {
if (ele.cycleTimeData.length == 10) { if (ele.cycleTimeData.length == 10) {
ele.cycleTimeData.slice(ele.cycleTimeData.length - 1, 0) ele.cycleTimeData.slice(ele.cycleTimeData.length - 1, 0);
} else { } else {
item.time = item.time.split('.')[0] item.time = item.time.split('.')[0];
if (item.type_data != null) { if (item.type_data != null) {
// //
this.typeCycleTimeData = item this.typeCycleTimeData = item;
} }
ele.cycleTimeData.unshift(item) ele.cycleTimeData.unshift(item);
} }
} }
}) });
}) });
console.log(this.sectionData, '455');
} }
}, },
immediate: true immediate: true
@ -552,19 +489,14 @@ export default {
ele.cycleStatistics = []; ele.cycleStatistics = [];
} }
newVal.forEach(item => { newVal.forEach(item => {
if ( if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期统计') {
ele.analogAreaComponentId == item.component_id &&
ele.timeMode == '周期统计'
) {
if (ele.cycleStatistics.length == 10) { if (ele.cycleStatistics.length == 10) {
ele.cycleStatistics.pop(); ele.cycleStatistics.pop();
} else { } else {
item.time = item.time.split('.')[0] item.time = item.time.split('.')[0];
if (item.type_data != null) { if (item.type_data != null) {
// //
this.typeCycleStatistics = item; this.typeCycleStatistics = item;
} }
ele.cycleStatistics.unshift(item); ele.cycleStatistics.unshift(item);
} }
@ -572,14 +504,24 @@ export default {
}); });
}); });
} }
console.log(this.sectionData, '周期统计筛选数据');
} }
}, }
// activeName: {
}, // handler(newVal) {
// if (newVal == "second") {
// getComponentSection({ VideoId: this.$route.query.id }).then(res => {
// if (res.data.code == 200) {
// this.componentList = res.data.data;
// this.siftData();
// } else if (res.data.code == 404) {
// }
// });
// }
// },
// immediate: true
// }
}
}; };
</script> </script>
@ -599,7 +541,7 @@ export default {
/deep/ .el-scrollbar__view { /deep/ .el-scrollbar__view {
display: inline-block !important; display: inline-block !important;
width: 100% width: 100%;
} }
/deep/ .el-scrollbar__wrap { /deep/ .el-scrollbar__wrap {
@ -613,7 +555,6 @@ export default {
.dataBoard { .dataBoard {
height: 100%; height: 100%;
} }
} }
.dataBoard .region, .dataBoard .region,
@ -622,7 +563,7 @@ export default {
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 15px;
height: 500px; height: auto;
position: relative; position: relative;
transition: all 1s; transition: all 1s;
overflow: hidden; overflow: hidden;
@ -630,7 +571,7 @@ export default {
.dataBoard .sectionBox { .dataBoard .sectionBox {
width: 100%; width: 100%;
height: 48vh; height: auto;
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 15px;