显示调整

This commit is contained in:
fan 2021-09-13 09:13:27 +08:00
parent b130f4ce5b
commit 158e8a7d15
12 changed files with 20 additions and 57 deletions

View File

@ -309,10 +309,9 @@ class Jlmap {
const prdType2ShowMode = { '01': '03', '02': '02', '09': '09'};
const showMode = prdType2ShowMode[this.showConfig.prdType];
const stationCode = this.stationCode;
this.updateShowMode(list, showMode);
this.updateShowStation(list, stationCode);
this.updateShowStation(list);
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
}
@ -357,45 +356,14 @@ class Jlmap {
getShowConfig() {
return this.showConfig;
}
// showStationHandlePsd(oDevice, stationCode) {
// if (store.getters['map/checkDeviceShow'](stationCode, oDevice.standCode) || !stationCode) {
// this.$painter.updateSpecialShowStation(oDevice, true);
// } else {
// this.$painter.updateSpecialShowStation(oDevice, false);
// }
// }
// showStationHandleSection(oDevice, stationCode) {
// const trainWinDevice = this.mapDevice[oDevice.trainWindowCode];
// if (oDevice.stationCode === stationCode || !stationCode) {
// this.$painter.updateSpecialShowStation(trainWinDevice, true);
// } else {
// this.$painter.updateSpecialShowStation(trainWinDevice, false);
// }
// }
// showStationHandleStation (oDevice, stationCode) {
// if ((oDevice.centralized && oDevice.code === stationCode) || !stationCode) {
// this.$painter.updateSpecialShowStation(oDevice, true);
// oDevice.chargeStationCodeList.forEach(staCode => {
// const staDevice = this.mapDevice[staCode];
// this.$painter.updateSpecialShowStation(staDevice, true);
// });
// } else if (oDevice.centralized && oDevice.code !== stationCode) {
// this.$painter.updateSpecialShowStation(oDevice, false);
// oDevice.chargeStationCodeList.forEach(staCode => {
// const staDevice = this.mapDevice[staCode];
// this.$painter.updateSpecialShowStation(staDevice, false);
// });
// }
// }
updateShowStation(list = [], stationCode = '') {
this.stationCode = stationCode;
updateShowStation(list = [], stationCode = '') {
store.dispatch('map/setShowCentralizedStationCode', stationCode);
list.forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
this.$painter.updateShowStation(oDevice, stationCode);
this.$painter.update(oDevice);
});
this.$painter.$transformHandle.revisibleAll();
if (stationCode) {

View File

@ -43,7 +43,7 @@ export default class Arrow extends Group {
setState(model) {
// if (!this.isShowShape) return;
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.arrow && this.arrow.show();
}
}

View File

@ -113,7 +113,7 @@ export default class AutoTurnBack extends Group {
// 设置状态
setState(model) {
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
@ -171,11 +171,11 @@ export default class AutoTurnBack extends Group {
}
setShowMode() {
// const showMode = this.model.showMode;
// if (showMode == '04') {
// this.hideMode();
// return;
// }
const showMode = this.model.showMode;
if (showMode == '04') {
this.hideMode();
return;
}
// const showConditions = this.style.AutoTurnBack.visibleConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();

View File

@ -87,7 +87,7 @@ export default class AutomacticRoute extends Group {
setState(model) {
// if (!this.isShowShape) return;
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();

View File

@ -92,7 +92,7 @@ export default class AxleReset extends Group {
setState(model) {
this.recover();
// 只响应前端自定义类型的状态变化
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();

View File

@ -68,7 +68,7 @@ export default class DirectionRod extends Group {
setState(model) {
// if (!this.isShowShape) return;
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.rod && this.rod.hide();
this.tipText && this.tipText.hide();
} else {

View File

@ -48,10 +48,8 @@ export default class FloodGate extends Group {
setState(model) {
// if (!this.isShowShape) return;
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.floodGate && this.floodGate.hide();
} else {
}
}

View File

@ -100,7 +100,7 @@ export default class GuideLock extends Group {
setState(model) {
// 只响应前端自定义类型的状态变化
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();

View File

@ -62,12 +62,10 @@ export default class LcControl extends Group {
setState(model) {
// 只响应前端自定义类型的状态变化
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
} else if (model._free) {
this.setAshShow();
} else {
// if (!this.isShowShape) return;
}
}
recover() {

View File

@ -66,12 +66,10 @@ export default class LimitControl extends Group {
setState(model) {
// 只响应前端自定义类型的状态变化
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
} else if (model._free) {
this.setAshShow();
} else {
// if (!this.isShowShape) return;
}
}
recover() {

View File

@ -92,7 +92,7 @@ export default class Line2 extends Group {
setState(model) {
// if (!this.isShowShape) return;
this.recover();
if (model._displayNone) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.segment && this.segment.hide();
this.viceSegment && this.viceSegment.hide();
} else {

View File

@ -667,9 +667,10 @@ const map = {
return device;
},
checkDeviceShow: (state) => (stationCode, deviceCode) => {
checkDeviceShow: (state) => (deviceCode) => {
if (state.map && state.map.displayList && state.map.displayList.length) {
let flag = false;
const stationCode = state.showCentralizedStationCode;
state.map.displayList.forEach(item => {
if ( store.state.training.prdType === '01' && item.type === 'LOCAL' && item.stationCodeList.includes(stationCode) && item.elementList.includes(deviceCode)) {
flag = true;