fix: 扎线 数据看板 Bug
This commit is contained in:
parent
d3cbd004a8
commit
b687772308
@ -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<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>
|
||||
|
Loading…
Reference in New Issue
Block a user