diff --git a/src/views/reagent/mainoverview/index.vue b/src/views/reagent/mainoverview/index.vue index 683ac05..2051e32 100644 --- a/src/views/reagent/mainoverview/index.vue +++ b/src/views/reagent/mainoverview/index.vue @@ -369,15 +369,10 @@ export default { linechartData: [] } }, - created() { + async created() { this.loading = true - client_list().then( - res => { - this.clientOptions = res.data.data_list - this.client_id = this.clientOptions[0].client_id - } - ) this.getMonitoringData() + await this.initClientData() home_info().then(res => { this.initDataFunc(res.data) this.initAllCharts() @@ -391,6 +386,17 @@ export default { }) }, methods: { + initClientData() { + return new Promise((resolve, reject) => { + client_list().then( + res => { + this.clientOptions = res.data.data_list + this.client_id = this.clientOptions[0].client_id + resolve() + } + ) + }) + }, valueChange(t, value) { this.getMonitoringData() this.lineCharts(t) @@ -497,10 +503,6 @@ export default { return item }) const option = { - // legend: { - // orient: 'vertical', - // left: 'left' - // }, series: [ { name: 'Nightingale Chart',