From f53be7b70d4d26f116282e558a4ed26dc5061cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 26 Apr 2024 17:11:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E6=97=A0=E5=AD=97=E6=AE=B5=E6=97=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/board/equipment/index.vue | 8 +++++--- ruoyi-ui/src/views/board/senso/index.vue | 17 ++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue index f86666c..97ab472 100644 --- a/ruoyi-ui/src/views/board/equipment/index.vue +++ b/ruoyi-ui/src/views/board/equipment/index.vue @@ -198,11 +198,13 @@ export default { this.treeData = data } }, - treeClick(e) { + async treeClick(e) { if (!e.children?.length > 0) { this.monitorUnitId = e.id - this.getDevice(e.id) - this.setMonitorById(e) + + + await this.getDevice(e.id) + await this.setMonitorById(e) this.show = true if (typeof getDeviceInterval === 'number') { clearInterval(getDeviceInterval) diff --git a/ruoyi-ui/src/views/board/senso/index.vue b/ruoyi-ui/src/views/board/senso/index.vue index 80e80db..15eddd7 100644 --- a/ruoyi-ui/src/views/board/senso/index.vue +++ b/ruoyi-ui/src/views/board/senso/index.vue @@ -65,7 +65,7 @@ - @@ -106,7 +107,8 @@
已加载: {{ (mapOffset + 1) * 100 }} 总计: {{ mapTotal }} + @click="continueMap">已加载: + {{ ((mapOffset + 1) * 100 > mapTotal) ? mapTotal : ((mapOffset + 1) * 100) }} 总计: {{ mapTotal }} 继续加载 @@ -351,10 +353,9 @@ export default { startTime: this.date?.[0], endTime: this.date?.[1], }) - console.log(data) let deviceDataColumns = data.deviceDataColumns let dataList = data.historyData?.dataList || [] - if (deviceDataColumns.filter(e => e.columnKey === 'longitude' || e.columnKey === '"latitude"').length >0) { + if (deviceDataColumns.filter(e => e.columnKey === 'longitude' || e.columnKey === '"latitude"').length > 0 && dataList.length > 0) { this.isMap = true this.mapTotal = data.historyData.count let mapData = dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('"latitude"'))).map(e => { @@ -377,8 +378,10 @@ export default { } else { this.tableData = data.historyData?.dataList this.total = data.historyData?.count - // this.currentPage = 1 - this.deviceDataColumns = data.deviceDataColumns + if (dataList.length > 0) { + // this.currentPage = 1 + this.deviceDataColumns = data.deviceDataColumns + } this.$nextTick(() => { this.show = true })