默认时间修改
This commit is contained in:
parent
2689f0cde1
commit
d7abfbd519
|
|
@ -199,10 +199,20 @@ export default {
|
|||
}
|
||||
},
|
||||
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.getList()
|
||||
},
|
||||
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() {
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
|
|
|
|||
Loading…
Reference in New Issue