From cd0210f77cd1f8a5897c63f4a0570ae29f80ea00 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, 25 Jun 2024 14:14:52 +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/components/BoardTopNav/index.vue | 16 +--
ruoyi-ui/src/views/board/equipment/index.vue | 41 +++---
ruoyi-ui/src/views/board/index/index.vue | 130 +++++++++++++++---
3 files changed, 139 insertions(+), 48 deletions(-)
diff --git a/ruoyi-ui/src/components/BoardTopNav/index.vue b/ruoyi-ui/src/components/BoardTopNav/index.vue
index 986d5d8..fbddbf9 100644
--- a/ruoyi-ui/src/components/BoardTopNav/index.vue
+++ b/ruoyi-ui/src/components/BoardTopNav/index.vue
@@ -58,9 +58,9 @@
-
+
导入
-
+
@@ -94,11 +94,13 @@ import {
importAccount
} from '@/api/board/index'
+const vh = (document.documentElement.clientHeight || document.body.clientHeight) / 100
export default {
name: 'BoardTopNav',
data() {
return {
+ vh,
selectSecnesList: [],
name: '智慧场景',
isIndex: true,
@@ -125,7 +127,7 @@ export default {
this.tenantData = e.data
})
if (!this.$store.getters.sceneId) {
- this.$router.replace({path: "/board/index"})
+ await this.$router.replace({path: "/board/index"})
}
if (this.$route.name === 'smartScene' || this.$route.name === 'GPS' || this.$route.name === 'index' || this.$store.getters.sceneId) {
} else {
@@ -133,7 +135,7 @@ export default {
await this.$router.replace({path: "/board/index"});
} else {
await this.$router.replace({path: "/board/smartScene"});
- this.$router.push({path: '/board/smartScene'})
+ await this.$router.push({path: '/board/smartScene'})
}
}
await this.setSelectSecnes()
@@ -148,11 +150,7 @@ export default {
});
}
}
- if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
- this.isIndex = true
- } else {
- this.isIndex = false
- }
+ this.isIndex = !!(this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*'));
},
methods: {
diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue
index b25be25..a415fb5 100644
--- a/ruoyi-ui/src/views/board/equipment/index.vue
+++ b/ruoyi-ui/src/views/board/equipment/index.vue
@@ -655,16 +655,16 @@ export default {
background-repeat: no-repeat;
background-size: 100% 100%;
position: relative;
- width: 100%;
- height: 7vw;
+ width: 50%;
+ height: 3.5vw;
margin-top: 12px;
+ display: inline-block;
.icon {
background-image: url("~@/assets/board/equipment/icon.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
-
top: 21%;
left: 5.8%;
width: 14.5%;
@@ -676,7 +676,7 @@ export default {
top: 50%;
left: 30%;
transform: translateY(-50%);
- font-size: 1vw;
+ font-size: 0.6vw;
color: #1facf4;
}
@@ -704,10 +704,11 @@ export default {
.item {
position: relative;
- width: 100%;
+ width: 50%;
margin-bottom: 12px;
- height: 18vh;
- padding: 1vh 0;
+ height: 9vh;
+ padding: 0.5vh 0;
+ display: inline-block;
.iconBg {
background-image: url("~@/assets/board/equipment/iconBg.png");
@@ -716,8 +717,8 @@ export default {
position: absolute;
top: 16%;
left: 5%;
- width: 16vh;
- height: 16vh;
+ width: 8vh;
+ height: 8vh;
}
.icon {
@@ -725,10 +726,10 @@ export default {
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
- top: calc(16% + 1vh);
- left: calc(5% + 0.5vw);
- width: 14vh;
- height: 14vh;
+ top: calc(16% + 0.5vh);
+ left: calc(5% + 0.25vw);
+ width: 7vh;
+ height: 7vh;
}
.rightBg {
@@ -737,9 +738,9 @@ export default {
background-size: 100% 100%;
position: absolute;
top: 16%;
- left: calc(10% + 16vh);
- width: calc(90% - 16vh);;
- height: 16vh;
+ left: calc(10% + 8vh);
+ width: calc(90% - 8vh);
+ height: 8vh;
.title {
position: absolute;
@@ -747,13 +748,13 @@ export default {
left: 12%;
color: #1facf4;
transform: translate(-50%, -50%);
- font-size: 1vw;
+ font-size: 0.6vw;
}
.infoItem {
display: inline-block;
position: relative;
- width: 6vw;
+ width: 3vw;
height: 50%;
.spanBg {
@@ -773,7 +774,7 @@ export default {
bottom: 55%;
left: 12%;
color: #f4f4f4;
- font-size: 0.7vw;
+ font-size: 0.5vw;
}
.num {
@@ -781,7 +782,7 @@ export default {
top: 55%;
left: 12%;
color: #f4f4f4;
- font-size: 0.7vw;
+ font-size: 0.5vw;
}
}
diff --git a/ruoyi-ui/src/views/board/index/index.vue b/ruoyi-ui/src/views/board/index/index.vue
index d9be6af..c59fbed 100644
--- a/ruoyi-ui/src/views/board/index/index.vue
+++ b/ruoyi-ui/src/views/board/index/index.vue
@@ -134,9 +134,17 @@
- 导出告警信息
-
+
+
+
+ 导出告警信息
+
-
+
@@ -153,12 +161,35 @@
查询
+
+
+
+
+
+
+
+ 报警信息
+
+ {{ warInfo.alarmLevelName }}
+
+
+
+ 报警位置
+
+ {{ warInfo.location }}
+
+
+
备注
处理所有
+
+
+
+
+
+ 经度
+
+ {{ equipmentInfo.longitude }}
+
+
+
+ 纬度
+
+ {{ equipmentInfo.latitude }}
+
+
+
+ 名称
+
+ {{ equipmentInfo.deviceName }}
+
+
+
+
@@ -212,7 +271,13 @@ export default {
data() {
return {
containerPic,
- formInline:{},
+ isRail: true,
+ monitorUnitId: null,
+ equipmentInfoDialog: false,
+ exTableTime: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()],
+ equipmentInfo: {},
+ warInfo: {},
+ formInline: {},
textarea: '',
disposeNo: null,
isDispose: false,
@@ -437,6 +502,7 @@ export default {
const {rows: data} = await getAlarmInfos()
this.table1Data = data.map((e, i) => {
return {
+ ...e,
no: e.alarmInfoId,
type: e.alarmTypeName,
location: e.monitorUnitName,
@@ -516,6 +582,8 @@ export default {
this.$refs.chart3.setData(option3)
},
dispose(e) {
+ this.warInfo = e
+ console.log(e)
this.textarea = ''
this.isDispose = true
this.disposeNo = e.no
@@ -776,12 +844,15 @@ export default {
})
},
setMarker(e) {
+ if (!this.isRail) {
+ return
+ }
let marker = new AMap.Marker({
position: [e.longitude, e.latitude],
title: `信息\n经度:${e.longitude}\n纬度:${e.latitude}\n名称:${e.deviceName}\n`,
offset: new AMap.Pixel(-15, -30),
content: ``
});
marker.on('click', async () => {
@@ -802,11 +873,17 @@ export default {
})
})
marker.on('dblclick', () => {
- this.$router.push({path: '/board/equipment', query: {monitorUnitId: e.monitorUnitId}})
+ 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)
},
+ getDeviceInfo() {
+ this.$router.push({path: '/board/equipment', query: {monitorUnitId: this.monitorUnitId}})
+ },
setPolygon(e, val) {
// let e = position.map(val => {
// return [val.longitude, val.latitude]
@@ -845,21 +922,34 @@ export default {
center: this.centerGeo,
});
},
- async searchMap(){
+ async searchMap() {
const {data} = await selectDeviceByName(this.formInline)
map.remove(markers)
map.remove(polygons)
map.remove(circles)
- console.log(data)
- data.forEach(e=>{
- if(e.latitude && e.longitude){
+ markers = []
+ data.forEach(e => {
+ if (e.latitude && e.longitude) {
this.setMarker(e)
}
})
map.setFitView(markers)
},
- exTable(){
- exTableData({}, '告警信息')
+ exTable() {
+ let query = {}
+ query.startTime = this.parseTime(this.exTableTime?.[0]?.getTime())
+ query.endTime = this.parseTime(this.exTableTime?.[1]?.getTime())
+ exTableData(query, '告警信息')
+ },
+ async RailChange() {
+ if (this.isRail) {
+ const data = await getDeviceByAreaId(this.$store.getters.tenantId)
+ data.data.map(e => e.devicesList).flat(1).forEach(e => {
+ this.setMarker(e)
+ })
+ } else {
+ map.remove(markers)
+ }
}
}
}
@@ -985,8 +1075,8 @@ export default {
.table1 {
position: absolute;
width: 21%;
- height: 50%;
- top: 45.5%;
+ height: 45%;
+ top: 50.5%;
left: 76.3%;
}
@@ -1002,10 +1092,12 @@ export default {
width: 100%;
height: 80vh;
}
-.exTable{
+
+.exTable {
position: absolute;
- bottom: 0%;
- left: 87%;
- transform: translateX(-50%);
+ top: 46%;
+ left: 76.3%;
+ width: 21%;
+ /*transform: translateX(-50%);*/
}