From 4d1f2e6fec696d122862ff3b7992eb926eb48657 Mon Sep 17 00:00:00 2001 From: LokerL Date: Thu, 5 Dec 2024 16:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dataStatistics/realtime/left-top.vue | 16 +++++++++------- .../dataStatistics/realtime/right-bottom.vue | 8 ++++---- .../views/dataStatistics/realtime/right-top.vue | 7 ++++++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ruoyi-ui/src/views/dataStatistics/realtime/left-top.vue b/ruoyi-ui/src/views/dataStatistics/realtime/left-top.vue index 416f68b..738c850 100644 --- a/ruoyi-ui/src/views/dataStatistics/realtime/left-top.vue +++ b/ruoyi-ui/src/views/dataStatistics/realtime/left-top.vue @@ -49,20 +49,17 @@ export default { watch: { queryParam: { handler: function (newVal, oldVal) { - this.refreshDebounce(); + this.refresh(); }, deep: true, }, selectedDept: { handler: function (newVal, oldVal) { - this.refreshDebounce(); + this.refresh(); }, deep: true, }, }, - mounted() { - this.refreshDebounce = debounce(this.refresh, 100); - }, methods: { refresh() { if (this.selectedDept && this.selectedDept.sn && this.queryParam) { @@ -81,12 +78,17 @@ export default { this.chartData.Xdata = axisData; this.chartData.Ydata = seriesData; } else { - this.chartData.Xdata = []; - this.chartData.Ydata = []; + this.resetChart(); } }); + } else { + this.resetChart(); } }, + resetChart() { + this.chartData.Xdata = []; + this.chartData.Ydata = []; + }, }, }; diff --git a/ruoyi-ui/src/views/dataStatistics/realtime/right-bottom.vue b/ruoyi-ui/src/views/dataStatistics/realtime/right-bottom.vue index 40891b3..dc3257d 100644 --- a/ruoyi-ui/src/views/dataStatistics/realtime/right-bottom.vue +++ b/ruoyi-ui/src/views/dataStatistics/realtime/right-bottom.vue @@ -4,7 +4,7 @@ :center="position" :zoom="16" :scroll-wheel-zoom=true style="width: auto; height: 40vh;" - :map-type="currentMapType" + :map-type="currentMapType" > diff --git a/ruoyi-ui/src/views/dataStatistics/realtime/right-top.vue b/ruoyi-ui/src/views/dataStatistics/realtime/right-top.vue index 860b8bb..8cd9057 100644 --- a/ruoyi-ui/src/views/dataStatistics/realtime/right-top.vue +++ b/ruoyi-ui/src/views/dataStatistics/realtime/right-top.vue @@ -87,7 +87,12 @@ export default { refresh() { if (this.queryParam.deptId) { getDeviceList(this.queryParam.deptId, this.pager).then((res) => { - if (res.code === 200 && res.rows.length > 0) { + if (res.code === 200) { + if (res.rows.length === 0) { + this.tableData = []; + this.deptSelect(null); + return; + } this.tableData = res.rows; this.radio = res.rows[0].id; this.pager.total = res.total;