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 @@