This commit is contained in:
chengdandan 2023-02-24 15:10:22 +08:00
parent 5b6f5db431
commit 4a2589d11e
2 changed files with 43 additions and 32 deletions

View File

@ -31,23 +31,23 @@
<div style="font-size: 30px; font-weight: bold" v-if="title == '速度'">
<span style="font-size: 15px;">速度</span><br />
<!-- <span style="font-size: 30px; font-weight: bold">{{ typeValue.speed }}</span> -->
<span style="font-size: 30px; font-weight: bold">{{ dataArr[0].speed }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArrNew[0].speed }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '流量'">
<span style="font-size: 15px;">流量</span><br />
<span style="font-size: 30px; font-weight: bold">{{ dataArr[0].flow }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArrNew[0].flow }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '车头时距'">
<span style="font-size: 15px;">车头时距</span><br />
<span style="font-size: 30px; font-weight: bold">{{ dataArr[0].headway }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArrNew[0].headway }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '排队数'">
<span style="font-size: 15px;">排队数</span><br />
<span style="font-size: 30px; font-weight: bold">{{ queue }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArrNew[0].queue }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '检测数'">
<span style="font-size: 15px;">检测数</span><br />
<span style="font-size: 30px; font-weight: bold">{{ dataArr[0].n_stay }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArrNew[0].n_stay }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '延误'">
<span style="font-size: 15px;">延误</span><br />
@ -139,6 +139,22 @@ export default {
valueShow: {},
//
queue:'',
dataArrNew:[{
//
//
speed:0,
//
flow:0 ,
//
headway:0,
//
queue:0,
//
n_stay:0,
//
ave_delay:0,
time:'2023-02-24 15:07:14'
}]
};
},
created() {
@ -156,9 +172,9 @@ export default {
// }
if(dataArr[0].n_queue){
this.queue = dataArr[0].n_queue
this.dataArrNew.queue = dataArr[0].n_queue
}else if(dataArr[0].ave_queue){
this.queue = dataArr[0].ave_queue
this.dataArrNew.queue = dataArr[0].ave_queue
}else if(dataArr[0].timeMode=='周期时刻'){
}
@ -177,9 +193,14 @@ export default {
watch: {
//
dataArr: {
handler(newVal) {
handler(oldVal,newVal) {
console.log('oldValdataArr', oldVal);
console.log('dataArr', newVal);
this.getNewQueue(newVal)
this.dataArrNew = newVal
if(newVal!=undefined&&newVal.length!=0){
this.getNewQueue(newVal)
}
},
immediate: true
@ -188,11 +209,11 @@ export default {
handler(newVal) {
this.total = 0;
if (this.title == '类型') {
newVal.type_data.forEach(ele => {
this.total += ele.quantity;
});
}
// if (this.title == '') {
// newVal.type_data.forEach(ele => {
// this.total += ele.quantity;
// });
// }
}
}
// cycleTimeData: {

View File

@ -147,23 +147,20 @@ export default {
this.componentList = res.data.data;
this.sectionArr=[]
this.sectionData=[]
this.$nextTick(() => {
this.siftData(this.componentList);
});
this.siftData();
}
});
},
siftData(newComponentList) {
siftData() {
newComponentList.forEach(val => {
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.acticveName = [];
newComponentList.forEach(val => {
this.componentList.forEach(val => {
if (item.title == val.combinationName) {
this.classify.push(val)
item.children.push(val);
@ -172,9 +169,7 @@ export default {
});
return item;
});
console.log("this.classify",this.classify)
// console.log("this.sectionData",this.sectionData[0].children[0].trigger)
console.log("this.sectionData",this.sectionData[0].children[0])
},
//
sectionHandle(i) {
@ -238,16 +233,13 @@ export default {
console.log(newVal, 'triggerlistData');
var _this = this
if (newVal.length != 0 && _this.sectionData) {
console.log("classify",_this.classify)
if(_this.classify.length!=0){
_this.classify.forEach((ele, index) => {
_this.classify.forEach((ele, index) => {
// console.log("classify",ele)
if (ele.trigger == undefined && ele.timeMode == '触发') {
ele.trigger = [];
}
newVal.forEach((item) => {
// console.log("ele",ele)
// console.log("newVal",newVal)
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
if (ele.trigger.length == 10) {
ele.trigger.splice(newVal.length - 1, 1);
@ -258,10 +250,10 @@ export default {
_this.typeTimeMode = item
}
ele.trigger.unshift(item);
console.log("ele.trigger",ele.trigger)
// console.log("ele.trigger",ele.trigger)
_this.$nextTick(() => {
if (_this.$refs.typeChartRef[index] != undefined) {
console.log(_this.$refs.typeChartRef[index].trigger, '数据');
// console.log(_this.$refs.typeChartRef[index].dataArr, '');
_this.$refs.typeChartRef[index].$refs.lineChartRef.drawLine(ele.trigger, ele.componentName.split('_')[0])
}
@ -271,8 +263,6 @@ export default {
});
});
}
}