调整哈尔滨道岔显示问题

This commit is contained in:
joylink_zyy 2020-02-29 00:04:24 +08:00
parent ff640adf39
commit 446593fded
4 changed files with 47 additions and 25 deletions

View File

@ -98,6 +98,10 @@ class Status {
this.statusObj = { this.statusObj = {
}; };
} }
handleTrainWindow(device) {
this.statusObj = {
};
}
getStatus() { getStatus() {
return this.statusObj; return this.statusObj;
} }

View File

@ -240,8 +240,17 @@ class Jlmap {
} }
}); });
} }
setUpdateMapDevice(list) {
store.dispatch('map/updateMapDevice', list);
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
this.hookHandle(oDevice, elem)
});
}
update(list) { update(list) {
this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
(list || []).forEach(elem => { (list || []).forEach(elem => {
const code = elem.code; const code = elem.code;
const type = elem._type; const type = elem._type;
@ -258,9 +267,9 @@ class Jlmap {
if (elem.dispose) { if (elem.dispose) {
this.$painter.delete(oDevice); this.$painter.delete(oDevice);
} else { } else {
if (this.hookHandle(oDevice, elem)) { // if (this.hookHandle(oDevice, elem)) {
this.$painter.update(oDevice); this.$painter.update(oDevice);
} // }
} }
} }

View File

@ -774,6 +774,15 @@ export default class Section extends Group {
/** 设置状态*/ /** 设置状态*/
setState(model) { setState(model) {
this.recover(); this.recover();
// 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的
if (this.style.Switch.sectionAction.flag && model.relSwitchCode) {
const switchModel = store.getters['map/getDeviceByCode'](model.relSwitchCode);
if (switchModel.normalPosition && switchModel.sectionCCode == model.code) {
this.section.setStyle({ stroke: this.style.Switch.sectionAction.spareColor })
} else if (switchModel.reversePosition && switchModel.sectionBCode == model.code) {
this.section.setStyle({ stroke: this.style.Switch.sectionAction.spareColor })
}
}
/** 道岔保护区段锁闭 */ /** 道岔保护区段锁闭 */
model.overlapLock && this.protectiveLock(); model.overlapLock && this.protectiveLock();
/** 空闲锁闭或者叫进路锁闭 */ /** 空闲锁闭或者叫进路锁闭 */
@ -796,14 +805,6 @@ export default class Section extends Group {
sectionSwitch.instance && sectionSwitch.instance.setState(sectionSwitch); sectionSwitch.instance && sectionSwitch.instance.setState(sectionSwitch);
} }
} }
if (this.style.Switch.sectionAction.flag && model.relSwitchCode) {
const switchCode = store.getters['map/getDeviceByCode'](model.relSwitchCode);
if (switchCode.normalPosition && switchCode.sectionCCode == model.code) {
this.section.setStyle({stroke: this.style.Switch.sectionAction.spareColor })
} else if (switchCode.reversePosition && switchCode.sectionBCode == model.code){
this.section.setStyle({stroke: this.style.Switch.sectionAction.spareColor })
}
}
} }
/** 计算提示位置*/ /** 计算提示位置*/

View File

@ -498,6 +498,11 @@ const map = {
state.mapDevice = {}; state.mapDevice = {};
} }
}, },
updateMapDevice: (state, list) => {
list.forEach(elem => {
state.mapDevice[elem.code] = deepAssign(state.mapDevice[elem.code] || {}, elem);
})
},
setMapConfig: (state, config) => { setMapConfig: (state, config) => {
state.mapConfig = config; state.mapConfig = config;
}, },
@ -624,6 +629,9 @@ const map = {
setMapData: ({ commit }, map) => { // 设置地图数据 setMapData: ({ commit }, map) => { // 设置地图数据
commit('setMapData', map); commit('setMapData', map);
}, },
updateMapDevice: ({ commit }, list) => {
commit('updateMapDevice', list);
},
setMapConfig: ({ commit }, config) => { // 设置地图所属线路 setMapConfig: ({ commit }, config) => { // 设置地图所属线路
commit('setMapConfig', config); commit('setMapConfig', config);
}, },