From 1fe574efac11337231bcba3a9314614fe6b0b501 Mon Sep 17 00:00:00 2001 From: blank <2649084208@qq.com> Date: Tue, 6 Dec 2022 15:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.vue | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index c64fc66..41f8b4b 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -111,10 +111,10 @@ export default { level: {}, status: [], dist: { - stnms: ['鄞州公园', '横溪镇-上'], + stnms: [], values: [ { isLive: '在线', value: [1, 2]}, - { isLive: '离线', value: [1, 1]} + { isLive: '离线', value: []} ] }, @@ -163,7 +163,6 @@ export default { .then(e => e.json()) .then(e => { this.station = e - console.log(this.station) e.forEach(station => { if(this.showLevel.some(item => item.id == station.id)) return this.showLevel.push({ @@ -180,7 +179,6 @@ export default { .then(e => e.json()) .then(e => { this.level = e.data - this.dist.stnms = e.data.stnms this.setLine() }) .catch(e => { console.error(e) }) @@ -196,19 +194,20 @@ export default { .then(e => { this.status = e.data this.setPie() - this.setDist() }) .catch(e => { console.error(e) }) - + // 水位计分布 fetch(this.api + 'count') .then(e => e.json()) .then(e => { - console.log(e) + this.dist.stnms = e.data.stnms + this.dist.values[0].value = e.data.zx + this.dist.values[1].value = e.data.lx + this.setDist() }) - .catch(e => { console.log(e) }) + .catch(e => { console.error(e) }) return this.getList }, - // 实时时间 setTime() { var t = null;