|
@@ -91,11 +91,21 @@
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- // this.getChart1()
|
|
|
+ this.getTimeFn()
|
|
|
this.getChart1()
|
|
|
},
|
|
|
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ getTimeFn() {
|
|
|
+ const that = this
|
|
|
+ const start = new Date()
|
|
|
+ const end = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
+ end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
|
|
|
+ that.startTime = parseTime(start, '{y}-{m}-{d}')
|
|
|
+ that.endTime = parseTime(end, '{y}-{m}-{d}')
|
|
|
+ that.inputDatetime = [start, end]
|
|
|
+ },
|
|
|
handleBefore() {
|
|
|
if (this.inputDatetime !== '' && this.inputDatetime !== null) {
|
|
|
var start = new Date(this.inputDatetime[0].setDate(this.inputDatetime[0].getDate() - 1))
|