diff --git a/pages/work/index.vue b/pages/work/index.vue index 5672a17..1591544 100644 --- a/pages/work/index.vue +++ b/pages/work/index.vue @@ -80,7 +80,7 @@ enableScroll: true, xAxis: { scrollShow: true, - itemCount: 7, + itemCount: 5, disableGrid: true }, // update: true, @@ -221,6 +221,13 @@ } }) }, + handleDate(date) { + if (!date) return date + const time = new Date(date) + const month = time.getMonth() + 1, + day = time.getDate() + return `${month<10?'0'+month : month}/${day<10 ? '0'+day : day}` + }, getWeekChartData() { this.$refs.weekChartDateRangeSelect.showBtnLoading(true) getSevenChargeData({ @@ -234,9 +241,9 @@ chargedCap = [], disChargedCap = [] data.forEach(item => { - categories.push(item.ammeterDate || undefined) - chargedCap.push(item.chargedCap || undefined) - disChargedCap.push(item.disChargedCap || undefined) + categories.push(this.handleDate(item.ammeterDate) || undefined) + chargedCap.push(item.chargedCap) + disChargedCap.push(item.disChargedCap) }) this.weekChartData = JSON.parse(JSON.stringify({ categories,