From 90a72b2d62aeba237aa9fd73f71aed7b96429738 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Tue, 10 Jun 2025 15:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=B5=81=E7=BB=9F=E8=AE=A13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/passenger/flowDetail.vue | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/pages/passenger/flowDetail.vue b/pages/passenger/flowDetail.vue index 62db51c..8367841 100644 --- a/pages/passenger/flowDetail.vue +++ b/pages/passenger/flowDetail.vue @@ -174,17 +174,31 @@ export default { }, initChart(){ if(this.flowData.presentFlowVOList&&this.flowData.presentFlowVOList.length>0){ - //this.flowData.presentFlowVOList[0].exitList let xData = [] let line1=[] let line2=[] - this.flowData.presentFlowVOList[0].presentList.forEach((item,index)=>{ - if(Number(item)>0){ - xData.push((index+1)+"点") - line1.push(this.flowData.presentFlowVOList[0].enterList[index]) - line2.push(this.flowData.presentFlowVOList[0].exitList[index]) - } - }) + let xIndex = 0 + let index1 = this.flowData.presentFlowVOList[0].enterList.findIndex(v=>Number(v)>0) + let index2 = this.flowData.presentFlowVOList[0].exitList.findIndex(v=>Number(v)>0) + console.log(index1) + console.log(index2) + if(index1<=index2){ + this.flowData.presentFlowVOList[0].enterList.forEach((item,index)=>{ + if(index>=index1){ + xData.push((index+1)+"点") + line1.push(this.flowData.presentFlowVOList[0].enterList[index]) + line2.push(this.flowData.presentFlowVOList[0].exitList[index]) + } + }) + }else{ + this.flowData.presentFlowVOList[0].exitList.forEach((item,index)=>{ + if(index>=index2){ + xData.push((index+1)+"点") + line1.push(this.flowData.presentFlowVOList[0].enterList[index]) + line2.push(this.flowData.presentFlowVOList[0].exitList[index]) + } + }) + } console.log(xData) var lineData = { categories: xData,