默认时间修改

This commit is contained in:
hongchao 2025-07-15 18:01:52 +08:00
parent 2689f0cde1
commit d7abfbd519
1 changed files with 10 additions and 0 deletions

View File

@ -199,10 +199,20 @@ export default {
} }
}, },
created() { created() {
const end = new Date()
let start = new Date()
start.setFullYear(start.getFullYear() - 1); //
this.queryParams.time = [this.format(start), this.format(end)]
this.initSelectData() this.initSelectData()
this.getList() this.getList()
}, },
methods: { methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
initSelectData() { initSelectData() {
this.GetUnitData() this.GetUnitData()
this.GetProData() this.GetProData()