From cd90ec25abef33c386f821948d03c011ec934b06 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, 2 Jul 2024 14:54:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/App.vue | 1 + ruoyi-ui/src/views/board/GPS/index.vue | 7 + ruoyi-ui/src/views/board/equipment/index.vue | 11 +- ruoyi-ui/src/views/board/index/index.vue | 124 +++++++++++++++++- .../src/views/business/alarmRule/index.vue | 24 ++-- 5 files changed, 148 insertions(+), 19 deletions(-) diff --git a/ruoyi-ui/src/App.vue b/ruoyi-ui/src/App.vue index 29de49f..2476d68 100644 --- a/ruoyi-ui/src/App.vue +++ b/ruoyi-ui/src/App.vue @@ -25,4 +25,5 @@ export default { #app .theme-picker { display: none; } + diff --git a/ruoyi-ui/src/views/board/GPS/index.vue b/ruoyi-ui/src/views/board/GPS/index.vue index df22619..b57f1ea 100644 --- a/ruoyi-ui/src/views/board/GPS/index.vue +++ b/ruoyi-ui/src/views/board/GPS/index.vue @@ -420,6 +420,13 @@ export default { ` }); marker.on('click', async () => { + if(polygons.length >0 || circles.length >0){ + map.remove(polygons) + map.remove(circles) + polygons = [] + circles = [] + return + } const {data} = await selectMonitorElectronic(e.deviceId) data.map(e => e.hwFenceAreaList).flat(1).forEach(e => { if (e.areaShapeFlag === '1') { diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue index 432f841..f8a9a18 100644 --- a/ruoyi-ui/src/views/board/equipment/index.vue +++ b/ruoyi-ui/src/views/board/equipment/index.vue @@ -129,6 +129,7 @@ 查询 -
+
@@ -233,6 +234,8 @@ export default { {required: true, message: '请选择对比属性', trigger: 'change'} ] }, + loading1:false, + loading2:false, show: false, monitorUnitId: '', data1: true, @@ -358,11 +361,13 @@ export default { this.getHistoryData() }, async getHistoryData() { + this.loading1 = true let query = JSON.parse(JSON.stringify(this.form)) query.startTime = this.parseTime(this.form.time?.[0]?.getTime()) query.endTime = this.parseTime(this.form.time?.[1]?.getTime()) delete query.time const data = await selectHistoryAndTrendAnalysis(query) + this.loading1 = false if (query.type === '1') { this.isHistoryTable = false @@ -450,7 +455,9 @@ export default { })) delete query.time delete query.sensor + this.loading2 = true const data = await selectHistoryAndTrendAnalysis(query) + this.loading2 = false let chartData = {} data.tableDataInfo.rows.forEach(e => { if (chartData[e.deviceId]) { @@ -465,7 +472,7 @@ export default { }) let series = Object.keys(chartData).map(e => { return { - name: this.propArr.find(item => item.id === parseFloat(e)).name, + name: (this.propArr.find(item => item.id === parseFloat(e)) || {}).name, type: 'line', stack: 'Total', data: chartData[e] diff --git a/ruoyi-ui/src/views/board/index/index.vue b/ruoyi-ui/src/views/board/index/index.vue index 0fa164b..91dbe0d 100644 --- a/ruoyi-ui/src/views/board/index/index.vue +++ b/ruoyi-ui/src/views/board/index/index.vue @@ -179,11 +179,28 @@ - - - - 查询 + + + + + + + + + +
` + }); + marker.on('click', async () => { + if (markerIds.includes(e.deviceId)) { + return + } else { + markerIds.push(e.deviceId) + } + const {data} = await selectMonitorElectronic(e.deviceId) + data.map(e => e.hwFenceAreaList).flat(1).forEach(e => { + if (e.areaShapeFlag === '1') { + this.setPolygon(e.areaRange.split('_').map(e => e.split(',').map(v => parseFloat(v)))) + } + if (e.areaShapeFlag === '2') { + let arr = e.areaRange.split(',') + this.setCircle([arr[0], arr[1]], arr[2]) + } + }) + }) + marker.on('dblclick', () => { + this.equipmentInfoDialog = true + this.equipmentInfo = e + this.monitorUnitId = e.monitorUnitId + // this.$router.push({path: '/board/equipment', query: {monitorUnitId: e.monitorUnitId}}) + }); + map.add(marker); + markers.push(marker) + }, + setMarker2(e) { + map.remove(markers) + map.remove(polygons) + map.remove(circles) + markers = [] + e.forEach(v=>{ + let arr = this.options.filter(r=>r.value.deviceId === v) || [] + if(arr.length >0){ + this.setMarker(arr[0].value) + } + }) + map.setFitView(markers) + }, getDeviceInfo() { this.$router.push({path: '/board/equipment', query: {monitorUnitId: this.monitorUnitId}}) }, @@ -957,11 +1025,32 @@ export default { markers = [] data.forEach(e => { if (e.latitude && e.longitude) { - this.setMarker(e) + this.setMarker1(e) } }) map.setFitView(markers) }, + async searchMap1(name) { + this.value = [] + map.remove(markers) + map.remove(polygons) + map.remove(circles) + markers = [] + this.loading = true; + const {data} = await selectDeviceByName({name:name}) + this.loading = false; + let option = [] + data.forEach(e => { + if (e.latitude && e.longitude) { + option.push({ + label:e.deviceName, + value:e + }) + } + }) + console.log(option) + this.options = option + }, exTable() { let query = {} query.startTime = this.parseTime(this.exTableTime?.[0]?.getTime()) @@ -1180,3 +1269,28 @@ export default { } + diff --git a/ruoyi-ui/src/views/business/alarmRule/index.vue b/ruoyi-ui/src/views/business/alarmRule/index.vue index d26410a..d5c00ff 100644 --- a/ruoyi-ui/src/views/business/alarmRule/index.vue +++ b/ruoyi-ui/src/views/business/alarmRule/index.vue @@ -185,14 +185,14 @@ - + - + + :disabled="sceneDisabled" style="width: 240px"> - + - + - + - + + @input="editedDeviceChange" style="width: 180px"> + :disabled="editedDisabled" style="width: 180px"> + :disabled="editedDisabled" style="width: 240px"> - + - +