From 0ed61d79a0360ecc27773bd49419c7e9de3d46ea Mon Sep 17 00:00:00 2001 From: duan Date: Tue, 2 Aug 2022 17:18:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(src/views/reagent/mainoverview/):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/reagent/mainoverview/index.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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',