|
@@ -31,11 +31,22 @@ export default {
|
|
|
},
|
|
|
chartData() {
|
|
|
const data = this.data[this.active] || {}
|
|
|
+ const values = Object.values(this.items)
|
|
|
+ const months = {}
|
|
|
+ for (const item of values) {
|
|
|
+ for (const row of (item.indexMonthData || [])) {
|
|
|
+ const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
|
|
|
+ if (!months[key]) {
|
|
|
+ months[key] = {
|
|
|
+ '月份': key,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ months[key][item.title] = row.percent
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
- columns: ['月份', data.title],
|
|
|
- rows: (data.indexMonthData || []).map(item => ({
|
|
|
- '月份': this.$helpers.dayjs(item.month).month() + 1 + '月', [data.title]: item.percent,
|
|
|
- }))
|
|
|
+ columns: ['月份', ...values.map(item => item.title)],
|
|
|
+ rows: Object.values(months)
|
|
|
}
|
|
|
}
|
|
|
},
|