diff --git a/src/views/kpi/report/home/index.vue b/src/views/kpi/report/home/index.vue index 8a95789..a50425c 100644 --- a/src/views/kpi/report/home/index.vue +++ b/src/views/kpi/report/home/index.vue @@ -227,6 +227,7 @@ export default { }, beforeMount () { }, async mounted () { + this.defaultId = Number(this.$route.query.id) await this.handleChartDataReq() await this.handleStartsReq() }, @@ -285,11 +286,17 @@ export default { }, // handleChange (val) { + this.$router.replace({ + name: 'reportHome', + query: { + id: val[1] + } + }) this.startId = val this.handleChartDataReq(val[1]) }, // 获取报表内容 - async handleChartDataReq (startId) { + async handleChartDataReq (startId = this.defaultId) { let params = { startId: startId } @@ -301,7 +308,8 @@ export default { if (val.type === 0) { // 头部数据 this.statisticals = val.statisticals - this.defaultId = val.defaultId + if (!this.defaultId) this.defaultId = val.defaultId + console.log('this.defaultId : ', this.defaultId) } else if (val.type === 1) { // 等级分布数据 this.tableData = val.statisticals