Commit b2095f38 by 胡悦

修复bug

1 parent 9914ce6e
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 19:38:58
* @LastEditTime: 2022-07-01 15:43:48
-->
<template>
<div>
......@@ -80,13 +80,13 @@ export default {
}
})
this.$set(this, 'hasData', !flag.every(i => !i))
this.draw()
this.draw(val.reportType)
})
.catch(() => {
this.hasData = false
})
},
draw() {
draw(reportType) {
this.option = {
tooltip: {
trigger: 'axis',
......@@ -214,7 +214,13 @@ export default {
}
]
}
this.option.xAxis.data = this.dataList[0].map(item => item.statDate)
const xData = []
this.option.xAxis.data = xData
this.dataList[0].map(e => {
const month = new Date(e.statDate).getMonth()
xData.push(reportType == 0 ? `${month == 0 ? '1月' : `${Number(month) + 1}月`}` : e.statDate)
})
this.list.forEach((i, index) => {
this.option.series[index].data = this.dataList[index].map(item => item.num)
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!