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;