From 8ddd4e5cfca72f732e46decd9cabd1f8e499ad5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Tue, 15 Oct 2024 18:07:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/board/GPS/index.vue | 7 ++- ruoyi-ui/src/views/board/equipment/index.vue | 20 +++---- ruoyi-ui/src/views/board/index/index.vue | 57 ++++++++++++-------- 3 files changed, 50 insertions(+), 34 deletions(-) diff --git a/ruoyi-ui/src/views/board/GPS/index.vue b/ruoyi-ui/src/views/board/GPS/index.vue index f8fb1cb..53222aa 100644 --- a/ruoyi-ui/src/views/board/GPS/index.vue +++ b/ruoyi-ui/src/views/board/GPS/index.vue @@ -396,13 +396,18 @@ export default { }, async mounted() { await this.getData() + setInterval(async ()=>{ + + await this.setAlarmInfos() + await this.getAubDevice() + await this.getTable2Data() + }) }, methods: { async getData() { if (this.$store.getters.sceneId === null) return await this.createMap() await this.getAlarmStats() - await this.getAubDevice() await this.setAlarmInfos() await this.setElectronicNumVo() await this.getTable2Data() diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue index 970499a..46aa37d 100644 --- a/ruoyi-ui/src/views/board/equipment/index.vue +++ b/ruoyi-ui/src/views/board/equipment/index.vue @@ -21,10 +21,10 @@ 名称: {{ MonitorInfo.monitorUnitName }}

- - - - + + + +

状态: {{ MonitorInfo.monitorUnitStatus === '1' ? '正常' : '异常' }} @@ -34,8 +34,8 @@ {{ MonitorInfo.monitorUnitTypeName }}

- {{ i.attributeName }}: - {{ i.attributeValue }} + {{ (i||{}).attributeName || '' }}: + {{ (i || {}).attributeValue }}

- + 0) { + // if (!e.children?.length > 0) { this.monitorUnitId = e.id await this.getDevice(e.id) await this.setMonitorById(e) @@ -351,7 +351,7 @@ export default { getDeviceInterval = setInterval(() => { this.getDevice(e.id) }, 30 * 1000) - } + // } }, async getDevice(e) { if (this.$store.getters.sceneId) { @@ -379,7 +379,7 @@ export default { time: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()], type: "2", } - this.getHistoryData() + // this.getHistoryData() }, async getHistoryData() { this.loading1 = true diff --git a/ruoyi-ui/src/views/board/index/index.vue b/ruoyi-ui/src/views/board/index/index.vue index ffb7a3f..3249faf 100644 --- a/ruoyi-ui/src/views/board/index/index.vue +++ b/ruoyi-ui/src/views/board/index/index.vue @@ -580,8 +580,10 @@ export default { this.setChart1() this.setChart2() this.setAllNums() - this.setTable3() this.setDeviceOperations() + setInterval(()=>{ + this.setTable3() + },5000) // let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) @@ -1190,29 +1192,38 @@ export default { clearInterval(time2) } time2 = null - time2 = setInterval(async () => { + if(name.length === 0){ + + const data = await getDeviceByAreaId(this.$store.getters.tenantId) + this.markerData = data.data.map(e => e.devicesList).flat(1) + data.data.map(e => e.devicesList).flat(1).forEach(e => { + this.setMarker(e) + }) + }else{ + time2 = setInterval(async () => { + const {data} = await selectDeviceByName({name: name}) + this.markerData = data + }, 5000) + // } const {data} = await selectDeviceByName({name: name}) - this.markerData = data - }, 5000) - // } - const {data} = await selectDeviceByName({name: name}) - this.value = [] - map.remove(markers) - map.remove(polygons) - map.remove(circles) - markers = [] - this.loading = true; - this.loading = false; - let option = [] - data.forEach(e => { - if (e.latitude && e.longitude && e.deviceName.includes(name)) { - option.push({ - label: e.deviceName, - value: e - }) - } - }) - this.options = option + this.value = [] + map.remove(markers) + map.remove(polygons) + map.remove(circles) + markers = [] + this.loading = true; + this.loading = false; + let option = [] + data.forEach(e => { + if (e.latitude && e.longitude && e.deviceName.includes(name)) { + option.push({ + label: e.deviceName, + value: e + }) + } + }) + this.options = option + } }, exTable() { let query = {}