diff --git a/ruoyi-ui/src/api/board/equipment.js b/ruoyi-ui/src/api/board/equipment.js index ab2de49..942c573 100644 --- a/ruoyi-ui/src/api/board/equipment.js +++ b/ruoyi-ui/src/api/board/equipment.js @@ -9,7 +9,7 @@ export function treeList(query=0) { }) } // 中下 -export function selectDeviceByDeviceModeByMonitorUnitId(query=0,data=0) { +export function selectDevicesByMonitorUnitId(query=0,data=0) { return request({ // baseURL:'/monitoring-api', url: '/business/monitorPlatform/selectDevicesByMonitorUnitId/'+query+'/'+data, @@ -18,7 +18,7 @@ export function selectDeviceByDeviceModeByMonitorUnitId(query=0,data=0) { }) } // 右 -export function selectDeviceModeFunctionByFunctionType(query) { +export function selectLatestDataByDeviceMode(query) { return request({ // baseURL:'/monitoring-api', url: '/business/monitorPlatform/selectLatestDataByDeviceMode', diff --git a/ruoyi-ui/src/components/BoardTopNav/index.vue b/ruoyi-ui/src/components/BoardTopNav/index.vue index 908c90b..8c9ad94 100644 --- a/ruoyi-ui/src/components/BoardTopNav/index.vue +++ b/ruoyi-ui/src/components/BoardTopNav/index.vue @@ -99,6 +99,7 @@ export default { } if (this.$route.query.name) { this.sceneId = data.find(e => e.sceneName === this.$route.query.name).sceneId + this.name = data.find(e => e.sceneName === this.$route.query.name).sceneName } this.$emit('sceneIdChange', this.sceneId); await this.$store.dispatch('app/setSceneId', this.sceneId) @@ -109,10 +110,10 @@ export default { toLink(e) { this.$router.replace({path: "/board/" + e}); }, - dropdownLink(e) { + async dropdownLink(e) { + await this.$store.dispatch('app/setSceneId', e.sceneId) this.$emit('sceneIdChange', e.sceneId); this.name = e.name - this.$store.dispatch('app/setSceneId', e.sceneId) this.$router.replace({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}}); }, toIndex() { diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue index e2e8731..740fc8f 100644 --- a/ruoyi-ui/src/views/board/equipment/index.vue +++ b/ruoyi-ui/src/views/board/equipment/index.vue @@ -83,13 +83,14 @@ diff --git a/ruoyi-ui/src/views/board/index/index.vue b/ruoyi-ui/src/views/board/index/index.vue index 71b4544..b0246f9 100644 --- a/ruoyi-ui/src/views/board/index/index.vue +++ b/ruoyi-ui/src/views/board/index/index.vue @@ -292,13 +292,6 @@ export default { this.setDeviceOperations() }, methods: { - sceneIdChange(){ - this.setChart1() - this.setChart2() - this.setAllNums() - this.setTable3() - this.setDeviceOperations() - }, async setChart1() { const {rows: data} = await monitorPercentage() let option1 = { diff --git a/ruoyi-ui/src/views/board/senso/index.vue b/ruoyi-ui/src/views/board/senso/index.vue index 65d9ca4..6a09628 100644 --- a/ruoyi-ui/src/views/board/senso/index.vue +++ b/ruoyi-ui/src/views/board/senso/index.vue @@ -147,7 +147,7 @@ export default { }, async setHistoryData() { const {data} = await getHistoryData({ - "sceneId": this.sceneId, + "sceneId":this.$store.getters.sceneId, "deviceId": 2, "offset": 0, "limit": 5, diff --git a/ruoyi-ui/src/views/board/smartScene/index.vue b/ruoyi-ui/src/views/board/smartScene/index.vue index 477a130..9f47d76 100644 --- a/ruoyi-ui/src/views/board/smartScene/index.vue +++ b/ruoyi-ui/src/views/board/smartScene/index.vue @@ -130,21 +130,21 @@ export default { methods: { sceneIdChange(e){ this.sceneId = e - this.getData() + this.getData(e) }, - async getData() { - await this.setAllNum() - await this.setLimitSubMonitorUnit() - await this.setAlarmCountGroupAlarmType() + async getData(e) { + await this.setAllNum(e) + await this.setLimitSubMonitorUnit(e) + await this.setAlarmCountGroupAlarmType(e) await this.setAlarmInfos() }, - async setAllNum() { - const {subSum, sum} = await sceneAllNums(this.$store.getters.sceneId) + async setAllNum(e) { + const {subSum, sum} = await sceneAllNums(e) this.num1 = subSum this.num2 = sum }, - async setLimitSubMonitorUnit() { - const data = await getLimitSubMonitorUnit(this.$store.getters.sceneId) + async setLimitSubMonitorUnit(e) { + const data = await getLimitSubMonitorUnit(e) this.LimitSubMonitorUnitList = data.rows this.tableData = data.rows.slice(0, 4) this.total = data.total @@ -152,8 +152,8 @@ export default { currentChange(e) { this.tableData = this.LimitSubMonitorUnitList.slice(4 * (e - 1), 4 * (e - 1) + 4) }, - async setAlarmCountGroupAlarmType() { - let {data: data} = await getAlarmCountGroupAlarmType(this.$store.getters.sceneId) + async setAlarmCountGroupAlarmType(e) { + let {data: data} = await getAlarmCountGroupAlarmType(e) data.sort((a, b) => { return b.alarmCount - a.alarmCount })