增加进路数据状态维护

This commit is contained in:
zyy 2020-01-19 11:22:48 +08:00
parent 0bee3cc61d
commit 2d5074d6d1
5 changed files with 89 additions and 51 deletions

View File

@ -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);
}
});
// 状态后处理

View File

@ -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.$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;
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;
this.$store.dispatch('map/getRouteDataListByCode', this.selected.code).then(list => {
const tempData = [];
this.$refs.routeHandControl.doShow(operate, this.selected, tempData);
// });
});
}
});
},

View File

@ -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);
},

View File

@ -44,6 +44,8 @@ export function loadNewMapDataByGroup(group) {
resolve();
});
});
const routeData = resp.data.logicDataNew.routeList; // 设置进路数据
store.dispatch('map/setRouteData', routeData);
}).catch(error => {
reject(error);
});

View File

@ -26,7 +26,6 @@ export default {
navList: [
{
name: '火灾报警',
type: 'FAS',
children: [
{
name: '站台报警',
@ -42,116 +41,123 @@ export default {
}
]
}, {
name: '机电', //
children: [
{
name: '机电',
type: 'FAS',
children: []
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: [
{