| | |
| | | |
| | | pickerOptions: { |
| | | shortcuts: [{ |
| | | text: '近1天', |
| | | text: '今天', |
| | | onClick (picker) { |
| | | const end = dayjs().subtract(1, 'hour') |
| | | const start = new Date(dayjs().startOf('day')) |
| | | picker.$emit('pick', [new Date(start), new Date(end)]) |
| | | } |
| | | }, { |
| | | text: '近1天', |
| | | onClick (picker) { |
| | | const end = dayjs() |
| | | const start = dayjs().subtract(1, 'day') |
| | | picker.$emit('pick', [new Date(start), new Date(end)]) |
| | | } |
| | | }, { |
| | | text: '近3天', |
| | | onClick (picker) { |
| | | const end = dayjs().subtract(1, 'hour') |
| | | const end = dayjs() |
| | | const start = dayjs().subtract(3, 'day') |
| | | picker.$emit('pick', [new Date(start), new Date(end)]) |
| | | } |
| | | }, { |
| | | text: '近5天', |
| | | onClick (picker) { |
| | | const end = dayjs().subtract(1, 'hour') |
| | | const end = dayjs() |
| | | const start = dayjs().subtract(5, 'day') |
| | | picker.$emit('pick', [new Date(start), new Date(end)]) |
| | | } |
| | | }, { |
| | | text: '近7天', |
| | | onClick (picker) { |
| | | const end = dayjs().subtract(1, 'hour') |
| | | const end = dayjs() |
| | | const start = dayjs().subtract(7, 'day') |
| | | picker.$emit('pick', [new Date(start), new Date(end)]) |
| | | } |
| | |
| | | }, |
| | | mounted () { |
| | | this.title = `${this.macDate.name}详情` |
| | | this.startTime = this.macDate.startTime |
| | | this.endTime = this.macDate.endTime |
| | | this.startTime = dayjs(this.macDate.startTime).format('YYYY-MM-DD HH:mm') |
| | | this.endTime = dayjs(this.macDate.endTime).format('YYYY-MM-DD HH:mm') |
| | | this.$set(this.selectTime, 0, new Date(this.macDate.startTime)) |
| | | this.$set(this.selectTime, 1, new Date(this.macDate.endTime)) |
| | | this.getLineData() |
| | |
| | | this.startTime = !this.selectTime ? '' : dayjs(this.selectTime[0]).format('YYYY-MM-DD HH:mm') |
| | | this.endTime = !this.selectTime ? '' : dayjs(this.selectTime[1]).format('YYYY-MM-DD HH:mm') |
| | | this.getMacDetail() |
| | | if (this.type !== 'minute') { |
| | | this.getLineData() |
| | | if (this.type === 'minute') { |
| | | this.lineType = 'hour' |
| | | this.getLineData(this.startTime, this.endTime, 'hour') |
| | | } else { |
| | | this.lineType = this.type |
| | | this.getLineData(this.startTime, this.endTime, this.type) |
| | | } |
| | | }, |
| | | initPieChart (pieChartData) { |