2023022402

This commit is contained in:
chengdandan 2023-02-24 15:37:14 +08:00
parent 72b4fea524
commit 4fb23054c4
2 changed files with 34 additions and 62 deletions

View File

@ -16,6 +16,7 @@
<div>
{{ dataArr[0].time ? dataArr[0].time : '' }}
</div>
</div>
</el-card>
</div>
@ -25,29 +26,29 @@
<div v-if="title == '类型'">
<span style="font-size: 15px;">类型数量总和</span><br />
<span style="font-size: 30px; font-weight: bold">
{{ }}
{{ getTotal(dataArr) }}
</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">{{ typeValue.speed }}</span> -->
<span style="font-size: 30px; font-weight: bold">{{ dataArrNew[0].speed }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArr[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">{{ dataArrNew[0].flow }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArr[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">{{ dataArrNew[0].headway }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArr[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">{{ dataArrNew[0].queue }}</span>
<span style="font-size: 30px; font-weight: bold">{{ 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">{{ dataArrNew[0].n_stay }}</span>
<span style="font-size: 30px; font-weight: bold">{{ dataArr[0].n_stay }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '延误'">
<span style="font-size: 15px;">延误</span><br />
@ -91,7 +92,7 @@
<div class="border" v-if="echartArr.includes('饼状图')">
<detailDialog />
<pieChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
:status="triggerType" :title="title" :typeValue="typeValue" />
:status="triggerType" :title="title" :typeValue="typeValue" ref="pieChartRef"/>
</div>
<div class="border" v-if="echartArr.includes('均值图')">
<detailDialog />
@ -101,7 +102,7 @@
<div class="border" v-if="echartArr.includes('直方图')">
<detailDialog />
<barChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
:status="triggerType" :title="title" :typeValue="typeValue" />
:status="triggerType" :title="title" :typeValue="typeValue" ref="barChartRef"/>
</div>
</div>
</template>
@ -139,31 +140,26 @@ 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() {
console.log(this.title + 'TYPECHARTdataArr', this.dataArr)
// console.log(this.title + 'TYPECHARTdataArr', this.dataArr)
},
methods: {
getTotal(dataArr) {
console.log(dataArr[0], 150);
return dataArr[0].type_data.reduce(function(prev, cur) {
return cur.quantity + prev
}, 0)
// return dataArr[0].type_data((pre, cur) => {
// return pre + cur
// }, 0)
},
//
getNewQueue(dataArr) {
console.log("计算类型的数值",dataArr)
// console.log("",dataArr)
// if(dataArr[0].timeMode==''){
// this.queue = dataArr[0].n_queue
// }else if(dataArr[0].timeMode==''){
@ -172,9 +168,9 @@ export default {
// }
if (dataArr[0].n_queue) {
this.dataArrNew.queue = dataArr[0].n_queue
this.queue = dataArr[0].n_queue
} else if (dataArr[0].ave_queue) {
this.dataArrNew.queue = dataArr[0].ave_queue
this.queue = dataArr[0].ave_queue
} else if (dataArr[0].timeMode == '周期时刻') {
}
@ -183,39 +179,19 @@ export default {
computed: {
//
getTotal() {
return this.dataArr[0].type_data((pre, cur) => {
return pre + cur
}, 0)
}
},
mounted() { },
watch: {
//
dataArr: {
handler(oldVal,newVal) {
console.log('oldValdataArr', oldVal);
console.log('dataArr', newVal);
this.dataArrNew = newVal
if(newVal!=undefined&&newVal.length!=0){
handler(newVal) {
// console.log('dataArr', newVal);
this.getNewQueue(newVal)
}
},
immediate: true
},
typeValue: {
handler(newVal) {
this.total = 0;
// if (this.title == '') {
// newVal.type_data.forEach(ele => {
// this.total += ele.quantity;
// });
// }
}
}
// cycleTimeData: {
// handler(newVal) {
// console.log(newVal);

View File

@ -145,8 +145,6 @@ export default {
if (res.data.code == 200) {
console.log(res.data.data, '组件的数据');
this.componentList = res.data.data;
this.sectionArr=[]
this.sectionData=[]
this.siftData();
}
});
@ -235,12 +233,11 @@ export default {
var _this = this
if (newVal.length != 0 && _this.sectionData) {
_this.classify.forEach((ele, index) => {
// console.log("classify",ele)
if (ele.trigger == undefined && ele.timeMode == '触发') {
ele.trigger = [];
}
newVal.forEach((item) => {
// console.log("ele",ele)
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
if (ele.trigger.length == 10) {
ele.trigger.splice(newVal.length - 1, 1);
@ -251,7 +248,6 @@ export default {
_this.typeTimeMode = item
}
ele.trigger.unshift(item);
// console.log("ele.trigger",ele.trigger)
_this.$nextTick(() => {
for (let i = 0; i < _this.$refs.typeChartRef.length; i++) {