Commit ad7458de by 匡雅琴

bug修复

1 parent 264d14e4
......@@ -24,7 +24,10 @@ export default {
default: () => ['1', '2', '3', '4', '5', '6']
},
linetype: Number,
lineChartsYear: String
lineChartsYear: {
type: String,
default: ''
}
},
data() {
return {
......@@ -43,7 +46,7 @@ export default {
},
xAxis: {
type: 'category',
name: (this.linetype == 1 ? '周' : '天')+'\n('+this.lineChartsYear + '年'+')',
name: (this.linetype == 1 ? '周' : '天')+(this.lineChartsYear && '\n('+this.lineChartsYear + '年'+')'),
// nameLocation: 'center',
// nameGap: 20,
nameTextStyle: {
......
......@@ -303,7 +303,7 @@ export default {
this.linetype = res.data.statisticsType
let _int = res.data.statisticsType == 1 ? 'weekInt' : 'dayInt'
let _type = res.data.statisticsType == 1 ? 'weekNum' : 'dayNum'
this.lineChartsYear = _dataList[_dataList.length - 1].yearInt
this.lineChartsYear = _dataList[_dataList.length - 1].yearInt || ''
_dataList.forEach(item => {
this.xAxisDataList.push(item[_int])
this.useCarData.push(item[_type])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!