From c710cb4e1b0a27f4410d49277c6ae107b9683b47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com>
Date: Thu, 21 Sep 2023 14:53:21 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=8F=82?=
=?UTF-8?q?=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ruoyi-ui/src/api/board/GPS.js | 6 +-
ruoyi-ui/src/api/board/equipment.js | 12 ++--
ruoyi-ui/src/api/board/equipmentMonitoring.js | 12 +---
ruoyi-ui/src/api/board/senso.js | 12 +---
ruoyi-ui/src/api/board/smartScene.js | 6 +-
ruoyi-ui/src/components/BoardTopNav/index.vue | 32 ++++++++---
ruoyi-ui/src/components/RuoYi/Git/index.vue | 8 +--
ruoyi-ui/src/views/board/GPS/index.vue | 56 ++++++++++---------
ruoyi-ui/src/views/board/equipment/index.vue | 35 +++++++-----
.../views/board/equipmentMonitoring/index.vue | 30 +++++++---
ruoyi-ui/src/views/board/senso/index.vue | 40 ++++++++-----
ruoyi-ui/src/views/board/smartScene/index.vue | 25 ++++++---
12 files changed, 159 insertions(+), 115 deletions(-)
diff --git a/ruoyi-ui/src/api/board/GPS.js b/ruoyi-ui/src/api/board/GPS.js
index f1a8e40..1c724ce 100644
--- a/ruoyi-ui/src/api/board/GPS.js
+++ b/ruoyi-ui/src/api/board/GPS.js
@@ -4,7 +4,7 @@ import request from '@/utils/request'
export function alarmStats(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/alarmStats/1',
+ url: '/business/monitorPlatform/alarmStats/'+query,
method: 'get',
})
}
@@ -12,7 +12,7 @@ export function alarmStats(query) {
export function subDevice(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/subDevice/1',
+ url: '/business/monitorPlatform/subDevice/'+query,
method: 'get',
})
}
@@ -28,7 +28,7 @@ export function getAlarmInfos(query) {
export function ElectronicNumVo(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/ElectronicNumVo/1',
+ url: '/business/monitorPlatform/ElectronicNumVo/'+query,
method: 'get',
})
}
diff --git a/ruoyi-ui/src/api/board/equipment.js b/ruoyi-ui/src/api/board/equipment.js
index 1be5c22..ab2de49 100644
--- a/ruoyi-ui/src/api/board/equipment.js
+++ b/ruoyi-ui/src/api/board/equipment.js
@@ -1,18 +1,18 @@
import request from '@/utils/request'
// 树
-export function treeList(query) {
+export function treeList(query=0) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/treeList/1',
+ url: '/business/monitorPlatform/treeList/'+query,
method: 'get',
})
}
// 中下
-export function selectDeviceByDeviceModeByMonitorUnitId(query) {
+export function selectDeviceByDeviceModeByMonitorUnitId(query=0,data=0) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/selectDevicesByMonitorUnitId/1/1',
+ url: '/business/monitorPlatform/selectDevicesByMonitorUnitId/'+query+'/'+data,
method: 'get',
data:query
})
@@ -27,10 +27,10 @@ export function selectDeviceModeFunctionByFunctionType(query) {
})
}
// 中上
-export function getMonitorById(query) {
+export function getMonitorById(query=0) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/getMonitorById/1',
+ url: '/business/monitorPlatform/getMonitorById/'+query,
method: 'get',
data:query
})
diff --git a/ruoyi-ui/src/api/board/equipmentMonitoring.js b/ruoyi-ui/src/api/board/equipmentMonitoring.js
index 4684815..e0f4d68 100644
--- a/ruoyi-ui/src/api/board/equipmentMonitoring.js
+++ b/ruoyi-ui/src/api/board/equipmentMonitoring.js
@@ -5,13 +5,7 @@ export function selectLatestDataByDeviceMode(query) {
return request({
url: '/business/monitorPlatform/selectLatestDataByDeviceMode',
method: 'post',
- data: {
- "sceneId": 1,
- "deviceModeId": 1,
- "startTime": 1222222222222,
- "offset": 0,
- "limit": 10
- }
+ data: query
})
}
@@ -21,8 +15,6 @@ export function getDeviceModesBySceneId(data) {
return request({
url: '/business/monitorPlatform/getDeviceModesBySceneId',
method: 'post',
- data: {
- "sceneId": 1,
- }
+ data:data
})
}
diff --git a/ruoyi-ui/src/api/board/senso.js b/ruoyi-ui/src/api/board/senso.js
index a0cf9d8..edb12c8 100644
--- a/ruoyi-ui/src/api/board/senso.js
+++ b/ruoyi-ui/src/api/board/senso.js
@@ -4,7 +4,7 @@ import request from '@/utils/request'
export function getDeviceInfo(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/getDeviceInfo/1',
+ url: '/business/monitorPlatform/getDeviceInfo/'+query,
method: 'get',
})
}
@@ -14,13 +14,7 @@ export function getHistoryData(query) {
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/getHistoryData',
method: 'post',
- data:{
- "sceneId": 1,
- "deviceId": 2,
- "offset": 0,
- "limit": 5,
- "startTime": 1266666666666
- }
+ data:query
})
}
@@ -28,7 +22,7 @@ export function getHistoryData(query) {
export function getLinkDevices(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/getLinkDevices/1',
+ url: '/business/monitorPlatform/getLinkDevices/'+query,
method: 'get',
})
}
diff --git a/ruoyi-ui/src/api/board/smartScene.js b/ruoyi-ui/src/api/board/smartScene.js
index 7cb2805..dd0a7d2 100644
--- a/ruoyi-ui/src/api/board/smartScene.js
+++ b/ruoyi-ui/src/api/board/smartScene.js
@@ -4,7 +4,7 @@ import request from '@/utils/request'
export function sceneAllNums(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/sceneAllNums/1',
+ url: '/business/monitorPlatform/sceneAllNums/'+query,
method: 'get',
})
}
@@ -13,7 +13,7 @@ export function sceneAllNums(query) {
export function getLimitSubMonitorUnit(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/limitSubMonitorUnit/1',
+ url: '/business/monitorPlatform/limitSubMonitorUnit/'+query,
method: 'get',
})
}
@@ -22,7 +22,7 @@ export function getLimitSubMonitorUnit(query) {
export function getAlarmCountGroupAlarmType(query) {
return request({
// baseURL:'/monitoring-api',
- url: '/business/monitorPlatform/getAlarmCountGroupAlarmType/1',
+ url: '/business/monitorPlatform/getAlarmCountGroupAlarmType/'+query,
method: 'get',
})
}
diff --git a/ruoyi-ui/src/components/BoardTopNav/index.vue b/ruoyi-ui/src/components/BoardTopNav/index.vue
index 69d4777..99067f3 100644
--- a/ruoyi-ui/src/components/BoardTopNav/index.vue
+++ b/ruoyi-ui/src/components/BoardTopNav/index.vue
@@ -2,7 +2,7 @@
智慧物联监控平台
-
+
监控主页
@@ -13,7 +13,8 @@
{{ name }}
- {{
+ {{
i.sceneName
}}
@@ -32,7 +33,7 @@
-
+
管 理
@@ -53,7 +54,8 @@ export default {
return {
selectSecnesList: [],
name: '智慧场景',
- isIndex : true
+ isIndex: true,
+ sceneId: 0,
}
},
props: {
@@ -63,16 +65,23 @@ export default {
},
},
- mounted() {
- if(this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')){
+ async mounted() {
+ await this.setSelectSecnes()
+ if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
this.isIndex = true
- }else{
+ } else {
this.isIndex = false
}
- this.setSelectSecnes()
+
if (this.$route.name === 'SmartScene') {
if (this.$route.query?.name) {
this.name = this.$route.query?.name
+ } else {
+ let routerData = this.selectSecnesList.find(e => e.sceneId === this.sceneId)
+ await this.$router.push({
+ path: "/board/" + (routerData.router || 'smartScene'),
+ query: {name: routerData.sceneName}
+ });
}
}
},
@@ -80,7 +89,13 @@ export default {
async setSelectSecnes() {
const {data} = await selectSecnes()
this.selectSecnesList = data
+ let defaultSceneId = data.find(e => e.defaultFlag === '1').sceneId
+ this.sceneId = defaultSceneId
+ this.$emit('sceneIdChange',defaultSceneId);
},
+ // sceneIdChange(){
+ //
+ // },
toLink(e) {
this.$router.push({path: "/board/" + e});
},
@@ -89,7 +104,6 @@ export default {
this.$router.push({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}});
},
toIndex() {
- console.log(123)
this.$router.push({path: "/index"});
}
}
diff --git a/ruoyi-ui/src/components/RuoYi/Git/index.vue b/ruoyi-ui/src/components/RuoYi/Git/index.vue
index 6e4bbea..bb30cc0 100644
--- a/ruoyi-ui/src/components/RuoYi/Git/index.vue
+++ b/ruoyi-ui/src/components/RuoYi/Git/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -14,10 +14,10 @@ export default {
},
methods: {
goto() {
- if(this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')){
+ if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
this.$router.push({path: "/board/index"});
- }else{
- this.$router.push({path:'/board/smartScene'})
+ } else {
+ this.$router.push({path: '/board/smartScene'})
}
}
}
diff --git a/ruoyi-ui/src/views/board/GPS/index.vue b/ruoyi-ui/src/views/board/GPS/index.vue
index 4e4a054..3f4be69 100644
--- a/ruoyi-ui/src/views/board/GPS/index.vue
+++ b/ruoyi-ui/src/views/board/GPS/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -133,17 +133,24 @@ export default {
boundaryGap: [0, 0.01],
},
},
- table1Data: []
+ table1Data: [],
+ sceneId: 0,
}
},
mounted() {
- this.createMap()
- this.getAlarmStats()
- this.getAubDevice()
- this.setAlarmInfos()
- this.setElectronicNumVo()
},
methods: {
+ sceneIdChange(e) {
+ this.sceneId = e
+ this.getData()
+ },
+ async getData() {
+ await this.createMap()
+ await this.getAlarmStats()
+ await this.getAubDevice()
+ await this.setAlarmInfos()
+ await this.setElectronicNumVo()
+ },
dispose() {
this.$confirm('该问题已处理?', '提示', {
confirmButtonText: '确定',
@@ -167,16 +174,16 @@ export default {
center: [113.4, 23.35],
});
},
- setMarker(position) {
- let marker =new AMap.Marker({
- position: position,
- icon: red,
+ setPolygon(position) {
+ let e = position.map(val => {
+ return [val.longitude, val.latitude]
})
- map.add(marker)
+ let thisPolygon = new AMap.Polygon({path: e});
+ map.add(thisPolygon)
map.setFitView()
},
- setCircle(center,radius) {
- let circle =new AMap.Circle({
+ setCircle(center, radius) {
+ let circle = new AMap.Circle({
center,
radius,
borderWeight: 3,
@@ -191,7 +198,7 @@ export default {
map.setFitView()
},
async getAlarmStats() {
- const {data} = await alarmStats()
+ const {data} = await alarmStats(this.sceneId)
let option1 = {
...this.chart1Option,
yAxis: {
@@ -239,10 +246,10 @@ export default {
this.$refs.chart1.setData(option1)
},
async getAubDevice() {
- let data = await subDevice()
+ let data = await subDevice(this.sceneId)
this.num1 = data.deviceNum
- this.num2 = data.onlineDeviceNum
- this.num3 = data.subSum
+ this.num2 = data.subSum
+ this.num3 = data.onlineDeviceNum
},
async setAlarmInfos() {
const {rows: data} = await getAlarmInfos()
@@ -251,21 +258,18 @@ export default {
value1: i,
value2: '高温预警',
value3: e.monitorUnitName,
- status:e.handleStatus
+ status: e.handleStatus
}
})
},
async setElectronicNumVo() {
- const {data} = await ElectronicNumVo()
- console.log(data)
+ const {data} = await ElectronicNumVo(this.sceneId)
data.forEach(e => {
if (e.areaPoints?.length > 0) {
- e.areaPoints.forEach(val => {
- this.setMarker([val.longitude,val.latitude])
- })
+ this.setPolygon(e.areaPoints)
}
- if(e.centerPoint){
- this.setCircle([e.centerPoint.longitude,e.centerPoint.latitude],e.radius)
+ if (e.centerPoint) {
+ this.setCircle([e.centerPoint.longitude, e.centerPoint.latitude], e.radius)
}
})
}
diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue
index 2d9101f..bbeeaac 100644
--- a/ruoyi-ui/src/views/board/equipment/index.vue
+++ b/ruoyi-ui/src/views/board/equipment/index.vue
@@ -1,7 +1,7 @@
-
+
福建省电力公司
@@ -104,18 +104,25 @@ export default {
treeData: [],
controlList: [],
acquisitionList: [],
- MonitorInfo: {}
+ MonitorInfo: {},
+ sceneId: 0,
}
},
- mounted() {
- this.getTree()
- this.getDevice()
- this.getRightDevice()
- this.setMonitorById()
+ async mounted() {
},
methods: {
+ sceneIdChange(e){
+ this.sceneId = e
+ this.getData()
+ },
+ async getData() {
+ await this.getTree()
+ await this.getDevice()
+ await this.getRightDevice()
+ await this.setMonitorById()
+ },
switchChange(e) {
- this.$confirm((this.controlList[e].deviceType === '1' ? '关闭' : '开启')+'该设备?', '提示', {
+ this.$confirm((this.controlList[e].deviceType === '1' ? '关闭' : '开启') + '该设备?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -133,8 +140,7 @@ export default {
});
},
async getTree() {
- const {data} = await treeList()
- console.log(data)
+ const {data} = await treeList(this.sceneId)
this.treeData = data
},
treeClick(e) {
@@ -145,21 +151,20 @@ export default {
}
},
async getDevice(e) {
- const {data} = await selectDeviceByDeviceModeByMonitorUnitId({monitorUnitId: e})
+ const {data} = await selectDeviceByDeviceModeByMonitorUnitId(this.sceneId, e)
this.controlList = data.control
this.acquisitionList = data.acquisition
},
async getRightDevice(e) {
const data = await selectDeviceModeFunctionByFunctionType({
- "sceneId": 1,
+ "sceneId": this.sceneId,
"deviceModeId": 1,
- "startTime": 1222222222222,
"offset": 0,
"limit": 1
})
},
async setMonitorById() {
- const {data} = await getMonitorById()
+ const {data} = await getMonitorById(this.sceneId)
this.MonitorInfo = data
}
}
@@ -408,7 +413,7 @@ export default {
.btnC {
position: absolute;
left: 50%;
- transform: translate(-50%,50%);
+ transform: translate(-50%, 50%);
}
}
}
diff --git a/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue b/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue
index 6ade6a7..e50181a 100644
--- a/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue
+++ b/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue
@@ -1,7 +1,7 @@