fix: 扎线 数据看板 Bug

This commit is contained in:
Zxuyoubin 2024-06-06 09:34:44 +08:00
parent d3cbd004a8
commit b687772308

View File

@ -137,6 +137,7 @@
device:'250精轧4号辊' device:'250精轧4号辊'
}, },
], ],
cachedDates:{},
topList: [ topList: [
{ {
name: "设备异常预警", name: "设备异常预警",
@ -184,6 +185,7 @@
this.initChart1(); this.initChart1();
this.initChart2(); this.initChart2();
this.initChart3(); this.initChart3();
this.getTime()
}, },
methods: { methods: {
initChart1() { 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<this.dataList.length;i++){
//
// //
// // let daysInMonth = new Date(currentYear, randomMonth, 0).getDate();
// timeArr.push(`${currentYear}-${randomMonth}-${randomDay}`)
// }
// console.log(timeArr,'timeARRRRRRRRRR13412')
// this.dataList=this.dataList.map((item,index)=>{
// return {
// ...item,
// time:timeArr[index]
// }
// })
},
}, },
}; };
</script> </script>