20230224
This commit is contained in:
		
							parent
							
								
									5b6f5db431
								
							
						
					
					
						commit
						4a2589d11e
					
				|  | @ -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.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: { | ||||
|  |  | |||
|  | @ -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,8 +233,6 @@ 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) => { | ||||
|                         // console.log("classify",ele) | ||||
|                         if (ele.trigger == undefined && ele.timeMode == '触发') { | ||||
|  | @ -247,7 +240,6 @@ export default { | |||
|                         } | ||||
|                         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 { | |||
| 
 | ||||
|                         }); | ||||
|                     }); | ||||
|                     } | ||||
|                     | ||||
| 
 | ||||
| 
 | ||||
|                 } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue