diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 8aef78eba..230da72d6 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -10,6 +10,7 @@ import deviceType from './constant/deviceType'; import { selectLineCode } from './config/deviceStyle'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deepAssign } from '@/utils/index'; +import store from '@/store'; const renderer = 'canvas'; const devicePixelRatio = 1; @@ -251,6 +252,9 @@ class Jlmap { this.$painter.update(oDevice); } } + if (elem.deviceType == 'ROUTE') { // 处理进路数据状态 + store.dispatch('map/updateRouteState', elem); + } }); // 状态后处理 diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index d64917fcb..da580ef1c 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -262,11 +262,10 @@ export default { this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); if (valid) { - // querySignalStatus(this.group, {signalCode: this.selected.code}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.routeSelection.doShow(step.operation, this.selected, tempData); - // }); + this.$store.dispatch('map/getRouteDataListByCode', this.selected.code).then(list => { + const tempData = list; + this.$refs.routeSelection.doShow(step.operation, this.selected, tempData); + }); } }).catch(() => { this.$refs.noticeInfo.doShow(step); @@ -373,11 +372,10 @@ export default { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.routeHandControl.doShow(operate, this.selected, tempData); - // }); + this.$store.dispatch('map/getRouteDataListByCode', this.selected.code).then(list => { + const tempData = []; + this.$refs.routeHandControl.doShow(operate, this.selected, tempData); + }); } }); }, @@ -394,11 +392,10 @@ export default { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { - // const tempData = resp.data; - const tempData = []; - this.$refs.routeHandControl.doShow(operate, this.selected, tempData); - // }); + this.$store.dispatch('map/getRouteDataListByCode', this.selected.code).then(list => { + const tempData = []; + this.$refs.routeHandControl.doShow(operate, this.selected, tempData); + }); } }); }, diff --git a/src/store/modules/map.js b/src/store/modules/map.js index b486b39bb..a318fca01 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -179,6 +179,7 @@ const map = { namespaced: true, state: { + routeData: {}, // 进路数据 stepData: [], // 缓存数据 recoverStepData: [], // 缓存恢复数据 seclectDeviceList: [], // 包围框选中元素列表 @@ -556,6 +557,14 @@ const map = { }, setMousemove: (state) => { state.mousemove++; + }, + setRouteData: (state, routeDataList) => { + routeDataList.forEach(data => { + state.routeData[data.code] = data; + }); + }, + updateRouteState: (state, status) => { + state.routeData[status.code] = deepAssign(state.routeData[status.code], status); } }, @@ -573,10 +582,30 @@ const map = { commit('setDataZoom', dataZoom); }, - setMapData: ({ commit }, map) => { + setMapData: ({ commit }, map) => { // 设置地图数据 commit('setMapData', map); }, + setRouteData: ({ commit }, routeData) => { // 设置进路数据 + commit('setRouteData', routeData); + }, + + updateRouteState: ({ commit }, status) => { // 设置进路数据状态 + commit('updateRouteState', status); + }, + getRouteDataListByCode: ({ state, commit }, code) => { // 获取进路数据 + return new Promise((resolve) => { + const list = []; + const routeList = Object.values(state.routeData); + routeList.forEach(route => { + if (route.startSignalCode == code) { + list.push(route); + } + }); + resolve(list); + }); + }, + setTrainDetails: ({ commit }, message) => { commit('setTrainDetails', message); }, diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index 1d24b6859..667352b7e 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -44,6 +44,8 @@ export function loadNewMapDataByGroup(group) { resolve(); }); }); + const routeData = resp.data.logicDataNew.routeList; // 设置进路数据 + store.dispatch('map/setRouteData', routeData); }).catch(error => { reject(error); }); diff --git a/src/views/system/iscsSystem/nav.vue b/src/views/system/iscsSystem/nav.vue index a14831da1..b79b40771 100644 --- a/src/views/system/iscsSystem/nav.vue +++ b/src/views/system/iscsSystem/nav.vue @@ -26,7 +26,6 @@ export default { navList: [ { name: '火灾报警', - type: 'FAS', children: [ { name: '站台报警', @@ -42,116 +41,123 @@ export default { } ] }, { - name: '机电', - type: 'FAS', - children: [] + name: '机电', // 未知子菜单 + children: [ + { + name: '机电', + type: 'BAS' + } + ] }, { name: '广播', - type: 'FAS', children: [ { name: '主画面', - type: 'standFAS' + type: 'PA' }, { name: '广播监听', - type: 'standFAS' + type: 'PA' }, { name: '计时一览', - type: 'standFAS' + type: 'PA' } ] }, { name: '乘客信息', - type: 'FAS', children: [ { name: '主画面', - type: 'standFAS' + type: 'PIS' }, { name: 'LCD屏控制', - type: 'standFAS' + type: 'PIS' }, { name: '计时一览', - type: 'standFAS' + type: 'PIS' }, { name: '车站网络', - type: 'standFAS' + type: 'PIS' }, { name: '紧急发布一览', - type: 'standFAS' + type: 'PIS' } ] }, { name: '闭路电视', - type: 'FAS', children: [ { name: '车站控制', - type: 'standFAS' + type: 'CCTV' }, { name: '车站时序', - type: 'standFAS' + type: 'CCTV' }, { name: '车站时序编辑', - type: 'standFAS' + type: 'CCTV' }, { name: '车站设备状态', - type: 'standFAS' + type: 'CCTV' }, { name: '中心设备状态', - type: 'standFAS' + type: 'CCTV' } ] }, { name: '屏蔽门', - type: 'FAS', children: [ { name: '屏蔽门', - type: 'standFAS' + type: 'PSD' } ] }, { name: '售检票', - type: 'FAS', children: [ { name: '售检票', - type: 'standFAS' + type: 'AFC' } ] }, { name: '门禁', - type: 'FAS', children: [ { name: '站厅层', - type: 'standFAS' + type: 'ACS' }, { name: '站台层', - type: 'standFAS' + type: 'ACS' } ] - }, { - name: '防淹门', - type: 'FAS', - children: [] - }, { - name: '网络状态', - type: 'FAS', - children: [] } + // { + // name: '防淹门', // 未知 子菜单 + // children: [ + // { + // name: '防淹门', + // type: 'standFAS' + // } + // ] + // }, { + // name: '网络状态', // 未知 子菜单 + // children: [ + // { + // name: '网络状态', + // type: 'standFAS' + // } + // ] + // } ], stationList: [ {