添加时间

This commit is contained in:
2024-01-18 14:05:39 +08:00
parent 2e5ba8a891
commit e1015e382f
26 changed files with 477 additions and 99 deletions

View File

@@ -53,6 +53,7 @@ export default {
handler(newVal, oldVal) {
if (this.chartTime === '周' && this.chartType === '电耗能') {
this.updateChart()
this.$emit('emitFun')
}
}
},
@@ -60,6 +61,7 @@ export default {
handler(newVal, oldVal) {
if (this.chartTime === '月' && this.chartType === '电耗能') {
this.updateChart()
this.$emit('emitFun')
}
}
},
@@ -67,6 +69,7 @@ export default {
handler(newVal, oldVal) {
if (this.chartTime === '年' && this.chartType === '电耗能') {
this.updateChart()
this.$emit('emitFun')
}
}
},
@@ -74,6 +77,7 @@ export default {
handler(newVal, oldVal) {
if (this.chartType === '天然气I' || this.chartType === '天然气II') {
this.updateChart()
this.$emit('emitFun')
}
}
},
@@ -242,7 +246,7 @@ export default {
.map((_, index) => {
const today = new Date();
const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
return `${currentMonth < 10?'0'+currentMonth:currentMonth }.${new Date(
dtimestamp
).getDate()}`;}).reverse()
}else if (this.chartTime == "月") {
@@ -259,7 +263,7 @@ export default {
return Array(12)
.fill(1)
.map((_, index) => {
return `${currentYear}.${12 - index}`;}).reverse()
return `${12 - index}`;}).reverse()
}
},
isLeapYear(year) {