From b68777230814b1504116036a01199204534474c0 Mon Sep 17 00:00:00 2001 From: Zxuyoubin Date: Thu, 6 Jun 2024 09:34:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E6=89=8E=E7=BA=BF=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9C=8B=E6=9D=BF=20Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- god-ui/src/views/integration/index.vue | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/god-ui/src/views/integration/index.vue b/god-ui/src/views/integration/index.vue index 0133f12d..93258687 100644 --- a/god-ui/src/views/integration/index.vue +++ b/god-ui/src/views/integration/index.vue @@ -137,6 +137,7 @@ device:'250精轧4号辊' }, ], + cachedDates:{}, topList: [ { name: "设备异常预警", @@ -184,6 +185,7 @@ this.initChart1(); this.initChart2(); this.initChart3(); + this.getTime() }, methods: { initChart1() { @@ -381,6 +383,53 @@ }) ); }, + //获取时间 + getTime(){ + // // 获取当前年份 + let year = new Date().getFullYear(); + // //获取当前月份 + let month =new Date().getMonth()+1 + let day=new Date().getDay() + if(month-5<1){ + this.dataList[0].time=`${year}-${month}-${day}` + this.dataList[1].time=`${year}-${month-2==0?'1':month-2}-15` + this.dataList[2].time=`${year}-${month-1==0?'1':month-1}-20` + this.dataList[3].time=`${year-1}-${12-1}-11` + this.dataList[4].time=`${year-1}-${12}-9` + this.dataList[5].time=`${year-1}-${12-2}-25` + + }else{ + this.dataList[0].time=`${year}-${month}-${day}` + this.dataList[1].time=`${year}-${month-1}-5` + this.dataList[2].time=`${year}-${month-3}-10` + this.dataList[3].time=`${year}-${month-2}-25` + this.dataList[4].time=`${year}-${month-4}-18` + this.dataList[5].time=`${year}-${month-3}-20` + } + console.log(this.dataList,'this.dataList') + + // //存储时间数组 + // let timeArr=[] + // for(let i = 0;i{ + // return { + // ...item, + // time:timeArr[index] + // } + // }) + }, + + + }, };