# Conflicts:
#	src/jmapNew/shape/graph/Switch/index.js
This commit is contained in:
joylink_cuiweidong 2021-09-13 11:20:48 +08:00
commit 077a4454c6
60 changed files with 3748 additions and 3265 deletions

View File

@ -182,49 +182,49 @@ class Iscs {
const code = elem.code;
if (elem.deviceType === 'IBP') {
if (this.iscsDevice['IscsCircle_20']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#008DCE';
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_20']);
}
if (this.iscsDevice['IscsCircle_17']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#008DCE';
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_17']);
}
if (this.iscsDevice['IscsCircle_18']) {
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#008DCE';
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_18']);
}
if (this.iscsDevice['IscsCircle_19']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '008DCE';
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_19']);
}
} else if (elem.deviceType === 'PSL') {
if (this.iscsDevice['IscsCircle_12']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#008DCE';
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_12']);
}
if (this.iscsDevice['IscsCircle_9']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#008DCE';
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_9']);
}
if (this.iscsDevice['IscsCircle_35']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#008DCE';
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_35']);
}
if (this.iscsDevice['IscsCircle_37']) {
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#008DCE';
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_37']);
}
} else if (elem.deviceType === 'SAFETY_CIRCLE') {
if (this.iscsDevice['IscsCircle_26']) {
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#008DCE';
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_26']);
}
if (this.iscsDevice['IscsCircle_25']) {
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#008DCE';
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_25']);
}
if (this.iscsDevice['IscsCircle_27']) {
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#008DCE';
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_27']);
}
} else {

View File

@ -309,10 +309,9 @@ class Jlmap {
const prdType2ShowMode = { '01': '03', '02': '02'};
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,57 +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);
// if (oDevice._type === deviceType.Station) {
// this.showStationHandleStation(oDevice, stationCode);
// } else if (oDevice._type === deviceType.Section) {
// this.$painter.updateShowStation(oDevice, stationCode);
// this.showStationHandleSection(oDevice, stationCode);
// } else if (oDevice._type === deviceType.TrainWindow) {
// // 不处理车次窗 勿删
// } else if (oDevice._type === deviceType.Psd) {
// this.showStationHandlePsd(oDevice, stationCode);
// } else {
// this.$painter.updateShowStation(oDevice, stationCode);
// }
this.$painter.updateShowStation(oDevice, stationCode);
this.$painter.update(oDevice);
});
this.$painter.$transformHandle.revisibleAll();
if (stationCode) {
@ -428,18 +384,6 @@ class Jlmap {
});
this.$painter.$transformHandle.revisibleAll();
}
// updatePrdType(list = [], showMode = '03', val = '') {
// this.showConfig.prdType = val;
// this.showConfig.showMode = showMode;
// list.forEach(item => {
// const code = item.code;
// const type = item._type;
// const oDevice = this.mapDevice[code] || deviceFactory(type, item, this.showConfig);
// this.hookHandle(oDevice, this.showConfig);
// this.$painter.update(oDevice);
// this.$painter.updateShowMode(oDevice);
// });
// }
update(list = [], fetch = true) {
this.setUpdateMapDevice(list, fetch); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息

View File

@ -196,9 +196,9 @@ class Painter {
/**
* 更新现地显示单独集中站
* */
updateShowStation(device, stationCode) {
if (device && device.instance) {
device.instance.setShowStation(stationCode);
updateShowStation(device) {
if (device && device.instance && device.model) {
device.instance.setState(device.model);
}
}
// updateSpecialShowStation(device, flag) {

View File

@ -11,7 +11,7 @@ export default class Arrow extends Group {
this.z = 0;
this.model = model;
// this.style = style;
this.isShowShape = true;
// this.isShowShape = true;
this.create();
this.setState(model);
this.setShowMode();
@ -41,27 +41,24 @@ export default class Arrow extends Group {
}
setState(model) {
if (!this.isShowShape) return;
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.arrow && this.arrow.show();
}
}
recover() {
this.arrow && this.arrow.hide();
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.arrow.show();
} else {
this.arrow.hide();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.hide();
this.isShowShape = false;
}
// const showMode = this.model.showMode;
// const showConditions = this.model.showConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.arrow.show();
// } else {
// this.arrow.hide();
// }
}
getAnchorPoint() {
const rect = this.arrow.getBoundingRect();

View File

@ -18,7 +18,7 @@ export default class AutoTurnBack extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.isShowShape = true;
// this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
@ -101,6 +101,10 @@ export default class AutoTurnBack extends Group {
}
recover() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.arcBorder && this.arcBorder.show();
this.control && this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.controlColor });
}
handleSignal() {
@ -109,14 +113,21 @@ export default class AutoTurnBack extends Group {
// 设置状态
setState(model) {
this.recover();
model.setUp && this.handleSignal();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
this.arcBorder && this.arcBorder.hide();
} else {
model.setUp && this.handleSignal();
}
}
createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
@ -165,34 +176,12 @@ export default class AutoTurnBack extends Group {
this.hideMode();
return;
}
const showConditions = this.style.AutoTurnBack.visibleConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode();
} else {
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {
this.isShowShape = false;
this.hideMode();
}
}
showMode() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.arcBorder && this.arcBorder.show();
this.setState(this.model);
}
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
this.arcBorder && this.arcBorder.hide();
// const showConditions = this.style.AutoTurnBack.visibleConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();
// } else {
// this.hideMode();
// }
}
setControlColor(color) {

View File

@ -85,12 +85,20 @@ export default class AutomacticRoute extends Group {
// 设置状态
setState(model) {
if (!this.isShowShape) return;
if (this.model.fleetMode) {
this.control && this.control.setStyle('fill', this.style.AutomaticRoute.lamp.lightColor);
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
} else {
this.control && this.control.setStyle('fill', this.style.AutomaticRoute.lamp.controlColor);
if (this.model.fleetMode) {
this.control && this.control.setStyle('fill', this.style.AutomaticRoute.lamp.lightColor);
} else {
this.control && this.control.setStyle('fill', this.style.AutomaticRoute.lamp.controlColor);
}
}
}
createMouseEvent() {
@ -129,33 +137,18 @@ export default class AutomacticRoute extends Group {
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = (this.style.AutomaticRoute || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode();
} else {
this.hideMode();
}
// const showMode = this.model.showMode;
// const showConditions = (this.style.AutomaticRoute || {}).displayCondition;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();
// } else {
// this.hideMode();
// }
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {
this.isShowShape = false;
this.hideMode();
}
}
showMode() {
recover() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.setState(this.model);
}
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
}
getAnchorPoint() {
return this.model.position;

View File

@ -90,14 +90,23 @@ export default class AxleReset extends Group {
// 设置状态
setState(model) {
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
} else if (model._free) {
this.setAshShow();
} else {
if (!this.isShowShape) return;
}
}
recover() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
}
createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
@ -133,33 +142,13 @@ export default class AxleReset extends Group {
}
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = (this.style.AxleReset || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode();
} else {
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {
this.isShowShape = false;
this.hideMode();
}
}
showMode() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.setState(this.model);
}
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
// const showMode = this.model.showMode;
// const showConditions = (this.style.AxleReset || {}).displayCondition;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();
// } else {
// this.hideMode();
// }
}
getAnchorPoint() {
return this.model.position;

View File

@ -12,7 +12,7 @@ export default class DirectionRod extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.isShowShape = true;
// this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
@ -59,61 +59,46 @@ export default class DirectionRod extends Group {
});
this.add(this.rod);
this.add(this.tipText);
// setTimeout(()=> {
// console.log('*************');
// this.rod.attr('rotation', Math.PI);
// console.log(this.rod, '----');
// }, 10000);
}
recover() {
this.rod && this.rod.show();
this.tipText && this.tipText.show();
}
// 设置状态
setState(model) {
// if (!this.isShowShape) return;
// this.recover();
if (model.reversed && this.model.right) {
this.rod.attr('rotation', 0);
} else if (!model.reversed && this.model.right) {
this.rod.attr('rotation', Math.PI);
} else if (model.reversed && !this.model.right) {
this.rod.attr('rotation', Math.PI);
} else if (!model.reversed && !this.model.right) {
this.rod.attr('rotation', 0);
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.rod && this.rod.hide();
this.tipText && this.tipText.hide();
} else {
if (model.reversed && this.model.right) {
this.rod.attr('rotation', 0);
} else if (!model.reversed && this.model.right) {
this.rod.attr('rotation', Math.PI);
} else if (model.reversed && !this.model.right) {
this.rod.attr('rotation', Math.PI);
} else if (!model.reversed && !this.model.right) {
this.rod.attr('rotation', 0);
}
}
}
createMouseEvent() {
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = (this.style.DirectionRod || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode();
} else {
this.hideMode();
}
// const showMode = this.model.showMode;
// const showConditions = (this.style.DirectionRod || {}).displayCondition;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();
// } else {
// this.hideMode();
// }
}
drawSelected() {
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {
this.isShowShape = false;
this.hideMode();
}
}
showMode() {
this.rod && this.rod.show();
this.tipText && this.tipText.show();
this.setState(this.model);
}
hideMode() {
this.rod && this.rod.hide();
this.tipText && this.tipText.hide();
}
getAnchorPoint() {
const rect = this.rod.getBoundingRect();

View File

@ -41,41 +41,29 @@ export default class FloodGate extends Group {
this.add(this.floodGate);
}
recover() {
this.floodGate && this.floodGate.show();
this.floodGate.setStyle({ stroke: this.style.FloodGate.spareStrokeColor, fill: this.style.FloodGate.spareFillColor });
}
// 设置状态
setState(model) {
if (!this.isShowShape) return;
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.floodGate && this.floodGate.hide();
}
}
createMouseEvent() {
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = (this.style.FloodGate || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode();
} else {
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {
this.isShowShape = false;
this.hideMode();
}
}
showMode() {
this.floodGate && this.floodGate.show();
this.setState(this.model);
}
hideMode() {
this.floodGate && this.floodGate.hide();
// const showMode = this.model.showMode;
// const showConditions = (this.style.FloodGate || {}).displayCondition;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();
// } else {
// this.hideMode();
// }
}
getAnchorPoint() {
return this.model.position;

View File

@ -17,7 +17,7 @@ export default class GuideLock extends Group {
this.zlevel = model.zlevel;
this.model = model;
this.style = style;
this.isShowShape = true;
// this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
@ -83,6 +83,9 @@ export default class GuideLock extends Group {
this.add(this.text);
}
recover() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.control && this.control.setStyle({ fill: this.style.GuideLock.lamp.controlColor });
}
handleSignal() {
@ -96,13 +99,19 @@ export default class GuideLock extends Group {
// 设置状态
setState(model) {
// 只响应前端自定义类型的状态变化
if (model._free) {
this.setAshShow();
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
} else {
if (!this.isShowShape) return;
this.recover();
model.totalGuideLock && this.handleSignal();
if (model._free) {
this.setAshShow();
} else {
model.totalGuideLock && this.handleSignal();
}
}
}
createMouseEvent() {
@ -139,34 +148,14 @@ export default class GuideLock extends Group {
}
}
setShowMode() {
const showMode = this.model.showMode;
const showConditions = (this.style.GuideLock || {}).displayCondition;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.showMode();
} else {
this.hideMode();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.isShowShape = true;
this.showMode();
} else {
this.isShowShape = false;
this.hideMode();
}
}
showMode() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
this.setState(this.model);
}
hideMode() {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
// const showMode = this.model.showMode;
// const showConditions = (this.style.GuideLock || {}).displayCondition;
//
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.showMode();
// } else {
// this.hideMode();
// }
}
getAnchorPoint() {
return this.model.position;

View File

@ -61,12 +61,16 @@ export default class LcControl extends Group {
// 设置状态
setState(model) {
// 只响应前端自定义类型的状态变化
if (model._free) {
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
} else if (model._free) {
this.setAshShow();
} else {
if (!this.isShowShape) return;
}
}
recover() {
this.control && this.control.show();
}
createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) {
@ -88,16 +92,6 @@ export default class LcControl extends Group {
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.control.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.control.hide();
this.isShowShape = false;
}
}
getAnchorPoint() {
return this.model.position;
}

View File

@ -65,13 +65,16 @@ export default class LimitControl extends Group {
// 设置状态
setState(model) {
// 只响应前端自定义类型的状态变化
if (model._free) {
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
} else if (model._free) {
this.setAshShow();
} else {
if (!this.isShowShape) return;
}
}
recover() {
this.control && this.control.show();
}
createMouseEvent() {
if (this.style.LimitControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
@ -93,16 +96,6 @@ export default class LimitControl extends Group {
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.control.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.control.hide();
this.isShowShape = false;
}
}
getAnchorPoint() {
return this.model.position;
}

View File

@ -90,32 +90,33 @@ export default class Line2 extends Group {
}
setState(model) {
if (!this.isShowShape) return;
this.setLineType(model.type);
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.segment && this.segment.hide();
this.viceSegment && this.viceSegment.hide();
} else {
this.setLineType(model.type);
}
}
recover() {
this.segment && this.segment.show();
this.viceSegment && this.viceSegment.show();
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.segment && this.segment.show();
this.viceSegment && this.viceSegment.show();
} else {
this.segment && this.segment.hide();
this.viceSegment && this.viceSegment.hide();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.segment && this.segment.show();
this.viceSegment && this.viceSegment.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.segment && this.segment.hide();
this.viceSegment && this.viceSegment.hide();
this.isShowShape = false;
}
// const showMode = this.model.showMode;
// const showConditions = this.model.showConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.segment && this.segment.show();
// this.viceSegment && this.viceSegment.show();
// } else {
// this.segment && this.segment.hide();
// this.viceSegment && this.viceSegment.hide();
// }
// if (store.state.training.prdType === '09') {
// this.text && this.text.hide();
// }
}
getAnchorPoint() {
if (this.segment) {

View File

@ -40,32 +40,29 @@ export default class OutFrame extends Group {
// 设置状态
setState(model) {
if (!this.isShowShape) return;
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.box && this.box.hide();
}
}
recover() {
this.box && this.box.hide();
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (showMode == '04') {
this.box && this.box.hide();
return;
}
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.box && this.box.show();
this.setState(this.model);
} else {
this.box && this.box.hide();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.box && this.box.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.box && this.box.hide();
this.isShowShape = false;
}
// const showMode = this.model.showMode;
// const showConditions = this.model.showConditions;
// if (showMode == '04') {
// this.box && this.box.hide();
// return;
// }
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.box && this.box.show();
// this.setState(this.model);
// } else {
// this.box && this.box.hide();
// }
}
screenShow() {
this.box && this.box.hide();

View File

@ -1,6 +1,7 @@
import Group from 'zrender/src/container/Group';
import ETextName from '../element/ETextName'; // 名称文字 (共有)
import BoundingRect from 'zrender/src/core/BoundingRect';
import store from '@/store/index';
export default class OverAp extends Group {
constructor(model, {style}) {
@ -42,23 +43,28 @@ export default class OverAp extends Group {
this.add(this.text);
}
}
setState(model) {
recover() {
this.text && this.text.hide();
if (model.remainTime && this.style.OverAp.show) { // 目前哈尔滨线路显示
// console.log(model, model.remainTime, model.sectionName, '=====');
this.text && this.text.show();
let offset = 40;
if (!model.offsetRight) {
offset = -40;
}
this.text && this.text.attr({
style: {
text: model.remainTime,
x: model.points.x + offset,
y: model.points.y - this.style.Section.line.width * 2
}
setState(model) {
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.text && this.text.hide();
} else {
if (model.remainTime && this.style.OverAp.show) { // 目前哈尔滨线路显示
this.text && this.text.show();
let offset = 40;
if (!model.offsetRight) {
offset = -40;
}
});
this.text && this.text.attr({
style: {
text: model.remainTime,
x: model.points.x + offset,
y: model.points.y - this.style.Section.line.width * 2
}
});
}
}
}
getBoundingRect() {

View File

@ -111,43 +111,38 @@ export default class Line2 extends Group {
}
setState(model) {
if (!this.isShowShape) return;
// if (!this.isShowShape) return;
this.recover();
this.setLineType(model.type);
model.on && this.setCharged();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.line && this.line.hide();
this.leftTerminal && this.leftTerminal.hide();
this.rightTerminal && this.rightTerminal.hide();
} else {
this.setLineType(model.type);
model.on && this.setCharged();
}
}
recover() {
this.line.setStyle('stroke', this.style.Power.noElectricStrokeColor);
this.line && this.line.show();
this.line && this.line.setStyle('stroke', this.style.Power.noElectricStrokeColor);
this.leftTerminal && this.leftTerminal.show();
this.rightTerminal && this.rightTerminal.show();
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.eachChild((child) => {
child.show();
});
} else {
this.eachChild((child) => {
child.hide();
});
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild((child) => {
child.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild((child) => {
child.hide();
});
this.isShowShape = false;
}
// const showMode = this.model.showMode;
// const showConditions = this.model.showConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.eachChild((child) => {
// child.show();
// });
// } else {
// this.eachChild((child) => {
// child.hide();
// });
// }
}
screenShow() {
this.eachChild((child) => {

View File

@ -52,9 +52,12 @@ export default class Line2 extends Group {
setState(model) {
this.recover();
if (!this.isShowShape) return;
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
const currentTypeList = this.style.Psd.elemnetType;
currentTypeList.forEach(element => {
this[element].hide();
});
} else if (model._free) {
this.setAshShow();
} else {
const currentTypeList = this.style.Psd.elemnetType;
@ -77,32 +80,14 @@ export default class Line2 extends Group {
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
setShowMode(flag) {
setShowMode() {
const showMode = this.model.showMode;
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if (showMode == '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
this.setState(this.model);
}
}
getAnchorPoint() {

View File

@ -44,7 +44,14 @@ export default class Resource extends Group {
}
setState(model) {
if (!this.isShowShape) return;
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.image && this.image.hide();
}
}
recover() {
this.image && this.image.show();
}
// 整体图片
@ -70,16 +77,6 @@ export default class Resource extends Group {
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.image && this.image.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.image && this.image.hide();
this.isShowShape = false;
}
}
getAnchorPoint() {
return this.model.position;
}

View File

@ -141,19 +141,27 @@ export default class Responder extends Group {
}
setState(model) {
if (!this.isShowShape) return;
const responderStyle = this.style.Responder || defaultStyle;
const style = responderStyle.block.mapStyle[model.type] || {fill: '#000'};
this.block && this.block.setStyle(style);
if (this.delta1) {
model.type == 'IB' ? this.delta1.show() : this.delta1.hide();
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.block && this.block.hide();
this.text && this.text.hide();
} else {
const responderStyle = this.style.Responder || defaultStyle;
const style = responderStyle.block.mapStyle[model.type] || {fill: '#000'};
this.block && this.block.setStyle(style);
if (this.delta1) {
model.type == 'IB' ? this.delta1.show() : this.delta1.hide();
}
if (this.delta2) {
model.type == 'IB' ? this.delta2.show() : this.delta2.hide();
}
}
if (this.delta2) {
model.type == 'IB' ? this.delta2.show() : this.delta2.hide();
}
}
recover() {
this.block && this.block.show();
this.text && this.text.show();
}
// 整体图片
transformRotation(item, origin, rotation) {
item.origin = origin;
@ -188,16 +196,6 @@ export default class Responder extends Group {
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.block && this.block.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.block && this.block.hide();
this.isShowShape = false;
}
}
getAnchorPoint() {
return this.anchorPoint;
}

View File

@ -183,15 +183,22 @@ export default class SaidLamp extends Group {
// 设置状态
setState(model) {
if (!this.isShowShape) return;
if (model._type === deviceType.PowerSupply && model.name.includes('2')) {
this.control && this.control.setControlColor(this.deviceStyle.lamp.offColor);
this.control && this.control.setControlStroke(this.deviceStyle.lamp.strokeColor, 1);
} else if ((model._type === deviceType.AtsControl || model._type === deviceType.LocalControl || model._type === deviceType.ChainControl) && model.name.includes('B')) {
this.control && this.control.setControlColor(this.deviceStyle.lamp.offColor);
// if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
} else {
if (model._type === deviceType.PowerSupply && model.name.includes('2')) {
this.control && this.control.setControlColor(this.deviceStyle.lamp.offColor);
this.control && this.control.setControlStroke(this.deviceStyle.lamp.strokeColor, 1);
} else if ((model._type === deviceType.AtsControl || model._type === deviceType.LocalControl || model._type === deviceType.ChainControl) && model.name.includes('B')) {
this.control && this.control.setControlColor(this.deviceStyle.lamp.offColor);
}
}
}
recover() {
this.control && this.control.show();
}
createMouseEvent() {
if (this.deviceStyle.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
@ -212,25 +219,15 @@ export default class SaidLamp extends Group {
return null;
}
setShowMode() {
const showMode = this.model.showMode;
if (this.deviceStyle) {
const showConditions = (this.deviceStyle || {}).displayCondition;
if (showConditions === '01' || showMode === showConditions) {
this.control && this.control.show();
} else {
this.control && this.control.hide();
}
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.control && this.control.show();
this.isShowShape = true;
this.setState(this.model);
} else {
this.control && this.control.hide();
this.isShowShape = false;
}
// const showMode = this.model.showMode;
// if (this.deviceStyle) {
// const showConditions = (this.deviceStyle || {}).displayCondition;
// if (showConditions === '01' || showMode === showConditions) {
// this.control && this.control.show();
// } else {
// this.control && this.control.hide();
// }
// }
}
setControlColor(color, flag = false) {
this.control && this.control.getControl && this.control.getControl().stopAnimation(false);

View File

@ -581,7 +581,7 @@ export default class ELines extends Group {
}
recover() {
this.section && this.section.show();
}
setState() {

View File

@ -6,6 +6,7 @@ class ETextName extends Group {
constructor(model) {
super();
this.model = model;
this.isShow = false;
this.create();
}
@ -16,7 +17,6 @@ class ETextName extends Group {
let styleY = '';
let styleName = '';
let isCreate = false;
let isShow = false;
// 计算区段坐标位置
const x = Math.min(model.points[0].x, model.points[model.points.length - 1].x) + Math.abs(model.points[model.points.length - 1].x - model.points[0].x) / 2;
@ -37,7 +37,7 @@ class ETextName extends Group {
}
styleName = model.name;
if (model.nameShow) {
isShow = true;
this.isShow = true;
}
}
// 逻辑区段
@ -49,7 +49,7 @@ class ETextName extends Group {
styleName = model.name;
isCreate = true;
if (model.nameShow) {
isShow = true;
this.isShow = true;
}
}
// 站台轨名称
@ -63,7 +63,7 @@ class ETextName extends Group {
styleName = model.standTrackName;
}
if (model.standTrackNameShow) {
isShow = true;
this.isShow = true;
}
}
// 折返轨名称
@ -77,7 +77,7 @@ class ETextName extends Group {
styleName = model.reentryTrackName;
}
if (model.reentryTrackNameShow) {
isShow = true;
this.isShow = true;
}
}
// 转换轨名称
@ -91,7 +91,7 @@ class ETextName extends Group {
styleName = model.transferTrackName;
}
if (model.transferTrackNameShow) {
isShow = true;
this.isShow = true;
}
}
// 目的码名称
@ -109,7 +109,7 @@ class ETextName extends Group {
styleName = model.destinationCode;
}
if (model.destinationNameShow) {
isShow = true;
this.isShow = true;
}
}
@ -133,7 +133,7 @@ class ETextName extends Group {
}
});
this.add(this.text);
isShow ? this.text.show() : this.text.hide();
this.isShow ? this.text.show() : this.text.hide();
}
}
@ -155,6 +155,9 @@ class ETextName extends Group {
recover() {
// 暂时不做状态初始化
if (this.text) {
this.isShow ? this.text.show() : this.text.hide();
}
const styleModel = this.model.style.Section[this.model.type];
this.text && this.text.setStyle({textFill: this.model.approach && this.model.type === 'name' ? styleModel.approachColor : styleModel.fontColor });
}

View File

@ -63,7 +63,7 @@ export default class Section extends Group {
this.mapDevice = mapDevice;
this.selected = false; // 绘图选中状态
this.selectedType = ''; // 绘图批量选中状态
this.isShowShape = true;
// this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
@ -142,6 +142,11 @@ export default class Section extends Group {
// this.line.setRunLineDefault();
}
this.name && this.name.recover();
this.logicText && this.logicText.recover();
this.transferTrackText && this.transferTrackText.recover();
this.standTrackText && this.standTrackText.recover();
this.destinationText && this.destinationText.recover();
this.reentryTrackText && this.reentryTrackText.recover();
this.derailer && this.derailer.hide();
this.speedLimit && this.speedLimit.hide();
this.speedLimitName && this.speedLimitName.hide();
@ -151,6 +156,7 @@ export default class Section extends Group {
stroke: this.style.Section.line.spareColor,
fill: this.style.Section.line.spareColor
});
this.line && this.line.recover();
this.line && this.line.recoverRoute();
this.lineBorder && this.lineBorder.setStyle({ lineWidth: 0 });
}
@ -428,10 +434,13 @@ export default class Section extends Group {
}
/** 设置状态*/
setState(model, flag = false) {
if (!this.isShowShape || model.showMode === '05') return;
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => {
item.hide();
});
} else if (model._free) {
// 先初始化为灰色
this.setAshShow();
model.preGreen && this.line.setStyle({stroke: '#00FF00'});
@ -577,12 +586,6 @@ export default class Section extends Group {
this.line && this.line.setStyle({ stroke: 'rgba(255,255,255,0.8)' });
}
setShowMode(flag = false) {
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if (this.model.showMode === '05') {
this.line.setStyle({stroke: this.style.Section.line.troColor, lineWidth: this.style.Section.line.troWidth});
this.separator && this.separator.hide();
@ -595,39 +598,8 @@ export default class Section extends Group {
if (this.model.type === '05') {
this.line.hide();
}
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
if (this.name) {
this.model.nameShow ? this.name.show() : this.name.hide();
}
if (this.logicText) {
this.model.nameShow ? this.logicText.show() : this.logicText.hide();
}
if (this.transferTrackText) {
this.model.transferTrackNameShow ? this.transferTrackText.show() : this.transferTrackText.hide();
}
if (this.standTrackText) {
this.model.standTrackNameShow ? this.standTrackText.show() : this.standTrackText.hide();
}
if (this.destinationText) {
this.model.destinationNameShow ? this.destinationText.show() : this.destinationText.hide();
}
if (this.reentryTrackText) {
this.model.reentryTrackNameShow ? this.reentryTrackText.show() : this.reentryTrackText.hide();
}
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
this.setState(this.model);
}
}

View File

@ -195,7 +195,6 @@ class Signal extends Group {
this.count = parseInt(model.lampPositionType);
this.lamps = new Array(this.count);
this.zlevel = model.zlevel;
this.isShowShape = true;
this.z = 7;
if (!model.positionPoint) {
model.positionPoint = {
@ -365,7 +364,7 @@ class Signal extends Group {
});
const timeNameY = model.position.y + model.positionPoint.y - posit * 15;
this.remainTImeName = new ESigName({
this.remainTimeName = new ESigName({
zlevel: this.zlevel,
z: this.z,
silent: false,
@ -460,7 +459,7 @@ class Signal extends Group {
this.style.Signal.text.show && model.nameShow ? this.sigName.show() : this.sigName.hide();
this.add(this.sigRoute);
this.add(this.sigDelay);
this.add(this.remainTImeName);
this.add(this.remainTimeName);
if (this.model.virtual) {
// 虚拟信号机显示
@ -871,8 +870,8 @@ class Signal extends Group {
}
// 信号显示延迟解锁
showRemainTime(number) {
this.remainTImeName.show();
this.remainTImeName && this.remainTImeName.setStyle({ text: number });
this.remainTimeName.show();
this.remainTimeName && this.remainTimeName.setStyle({ text: number });
this.model.signalButtonList && this.model.signalButtonList.length && this.model.signalButtonList.forEach(item => {
const button = store.getters['map/getDeviceByCode'](item);
if (button.type === 'PICK') {
@ -891,18 +890,20 @@ class Signal extends Group {
}
// 恢复状态
recover() {
this.sigName && this.sigName.show();
this.sigName && this.sigName.setAnimationEnd();
this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); });
this.sigName.setStyle({ textBorderWidth: 0 });
this.sigName.setColor(this.style.Signal.text.defaultColor);
this.remainTImeName && this.remainTImeName.hide();
this.remainTimeName && this.remainTimeName.hide();
this.sigDelay && this.sigDelay.hide();
if (this.style.Signal.auto.autoTriggerType != 'text') {
this.setAutoClose();
this.sigAuto && this.sigAuto.animationRecover();
}
this.sigAuto && this.sigAuto.show();
this.sigRoute && this.sigRoute.hide();
this.sigBack && this.sigBack.hide();
this.sigPost && this.sigPost.show();
this.sigPost && this.sigPost.setColor(this.style.Signal.post.standardColor); // 设置底座默认颜色
if (this.style.Signal.lamp.guidName === 'singleRY') {
@ -932,8 +933,12 @@ class Signal extends Group {
this.ciConfirm && this.ciConfirm.hide();
this.sigBack && this.sigBack.hide();
this.tText && this.tText.hide();
this.transmission && this.transmission.show();
this.lowButton && this.lowButton.hide();
this.sigBack && this.sigBack.stopAnimation(false);
this.lamps && this.lamps[0] && this.lamps[0].setAnimationEnd();
this.virtualSignal && this.virtualSignal.show();
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor);
if (this.model.signalButtonList && this.model.signalButtonList.length) {
this.model.signalButtonList.forEach(item => {
@ -944,18 +949,22 @@ class Signal extends Group {
}
setState(model) {
if (!this.isShowShape || this.model.type === 'TRANSMISSION' || model.showMode === '05') {
return;
}
const path = window.location.href;
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => {
item.hide();
});
} else if (model._free) {
this.setAshShow();
} else {
/** 信号机进路按钮显示 */
/** 终端信号机按钮 */
if ( this.model.type === 'TRANSMISSION' ) {
return;
}
if (model.isRouteActive) {
this.setLowButtonActive();
} else {
@ -1090,6 +1099,9 @@ class Signal extends Group {
if (this.style.Signal.text.conflictColor && model.checkConflict) {
this.sigName.setColor(this.style.Signal.text.conflictColor);
}
if (store.state.training.prdType === '01') {
this.lowButton && this.lowButton.show();
}
}
}
@ -1191,40 +1203,31 @@ class Signal extends Group {
});
}
}
setShowMode(flag = false) {
setShowMode() {
const showMode = this.model.showMode;
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
if (showMode == '03') {
this.lowButton && this.lowButton.show();
this.model.prdType = '01';
} else if (showMode == '02') {
this.lowButton && this.lowButton.hide();
this.model.prdType = '02';
} else if (showMode == '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.style.Signal.text.show && this.model.nameShow ? this.sigName.show() : this.sigName.hide();
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
// if (!flag) {
// this.eachChild(item => {
// item.show();
// });
// this.isShowShape = true;
// this.setState(this.model);
// }
// if (showMode == '03') {
// this.lowButton && this.lowButton.show();
// this.model.prdType = '01';
// } else if (showMode == '02') {
// this.lowButton && this.lowButton.hide();
// this.model.prdType = '02';
// } else if (showMode == '05') {
// this.eachChild(item => {
// item.hide();
// });
// }
if (showMode === '05') {
this.eachChild(item => { item.show(); });
} else {
this.setState(this.model);
}
}
setLowButtonShow() {

View File

@ -13,7 +13,6 @@ export default class SignalButton extends Group {
this.z = 0;
this.model = model;
this.style = style.Line;
this.isShowShape = true;
this.create();
this.setState(model);
this.setShowMode();
@ -116,6 +115,8 @@ export default class SignalButton extends Group {
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
this.rightLine && this.rightLine.hide();
this.leftLine && this.leftLine.hide();
this.rectButton && this.rectButton.show();
this.buttonText && this.buttonText.show();
}
blockShow() {
this.rightLine && this.rightLine.show();
@ -123,28 +124,21 @@ export default class SignalButton extends Group {
}
setState(model) {
this.recover();
if (!this.isShowShape) return;
if (model.hasSelected) {
this.startAnimate();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.buttonText && this.buttonText.hide();
this.rectButton && this.rectButton.hide();
this.leftLine && this.leftLine.hide();
this.rightLine && this.rightLine.hide();
} else {
if (model.hasSelected) {
this.startAnimate();
}
}
}
// 设置显示模式
setShowMode() {
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
}
getAnchorPoint() {
}
}

View File

@ -124,29 +124,32 @@ export default class SplitStation extends Group {
if (showMode == '04') {
this.eachChild(item => item.hide() );
return;
}
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.eachChild(item => item.show() );
} else {
this.eachChild(item => item.hide() );
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
this.setState(this.model);
}
// const showConditions = this.model.showConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.eachChild(item => item.show() );
// } else {
// this.eachChild(item => item.hide() );
// }
}
setState(model) {
if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.verticalLine && this.verticalLine.hide();
this.arrowLeft && this.arrowLeft.hide();
this.arrowRight && this.arrowRight.hide();
this.leftText && this.leftText.hide();
this.rightText && this.rightText.hide();
}
}
recover() {
this.verticalLine && this.verticalLine.show();
this.arrowLeft && this.arrowLeft.show();
this.arrowRight && this.arrowRight.show();
this.leftText && this.leftText.show();
this.rightText && this.rightText.show();
}
screenShow() {
this.eachChild((child) => {

View File

@ -28,7 +28,6 @@ export default class Station extends Group {
this.model = model;
this.style = style;
this.noneBeforeMode = '';
this.isShowShape = true;
this.create();
this.createTurnBack(); // 创建按图折返
this.createControlMode();
@ -570,6 +569,9 @@ export default class Station extends Group {
}
recover() {
this.eachChild(item => {
item.show();
});
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.text.fontColor);
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
@ -579,15 +581,13 @@ export default class Station extends Group {
this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.text.fontColor);
this.controlPreReset && this.controlPreReset.setColor(this.style.Station.StationControl.lamp.grayColor);
this.troButton && this.troButton.hide();
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
if (this.style.Station.stationText.isSpecialType) {
// if()
this.stationText.setColor(this.style.Station.stationText.noneModeColor);
this.stationText.setBackground(this.style.Station.stationText.defaultBackColor);
this.stationText && this.stationText.stopAnimate();
// sationEle.controller
} else {
this.stationText && this.stationText.stopAnimate();
}
@ -595,50 +595,55 @@ export default class Station extends Group {
// 设置状态
setState(model) {
if (!this.isShowShape) return;
this.recover();
model.controlMode && this['handle' + model.controlMode]();
// if (this.style.Station.syncCentralizeStation && model.controller && model.centralized) {
// debugger;
// model.chargeStationCodeList.forEach(item => {
// const device = store.getters['map/getDeviceByCode'](item);
// // device.controller = model.controller;
// device && device.instance && device.instance.recover();
// device && device.instance && device.instance.handleComplexControl(model.controller);
// });
// //
// }
// console.log(model.controller, model.centralized, '5555555555555');
model.preResetValidDuration && this.handlePreResetLamp();
model.controller && this.handleComplexControl(model.controller);
model.emergencyController != undefined && this.handleEmergencyChange(model.emergencyController);
// model.controlApplicant
model.controlApplicant && this.handleControlApplicant(model);
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) {
model.chargeStationCodeList.forEach(item => {
const device = store.getters['map/getDeviceByCode'](item);
device && device.instance && device.instance.recover();
if (model.emergencyController != undefined) {
device.emergencyController = model.emergencyController;
device && device.instance && device.instance.handleEmergencyChange(model.emergencyController);
}
if (model.controller) {
device.controller = model.controller;
device && device.instance && device.instance.handleComplexControl(model.controller);
} else {
device.controlMode = model.controlMode;
device && device.instance && device.instance['handle' + model.controlMode]();
}
});
}
if (model.tbStrategyId) {
store.state.map.map.tbStrategyList.forEach(item => {
if (item.stationCode == model.code) {
const modelData = Vue.prototype.$jlmap.mapDevice[item.code];
modelData && modelData.instance && modelData.instance.setState(modelData, model.tbStrategyId);
}
});
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => { item.hide(); });
} else {
model.controlMode && this['handle' + model.controlMode]();
// if (this.style.Station.syncCentralizeStation && model.controller && model.centralized) {
// debugger;
// model.chargeStationCodeList.forEach(item => {
// const device = store.getters['map/getDeviceByCode'](item);
// // device.controller = model.controller;
// device && device.instance && device.instance.recover();
// device && device.instance && device.instance.handleComplexControl(model.controller);
// });
// //
// }
// console.log(model.controller, model.centralized, '5555555555555');
model.preResetValidDuration && this.handlePreResetLamp();
model.controller && this.handleComplexControl(model.controller);
model.emergencyController != undefined && this.handleEmergencyChange(model.emergencyController);
// model.controlApplicant
model.controlApplicant && this.handleControlApplicant(model);
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) {
model.chargeStationCodeList.forEach(item => {
const device = store.getters['map/getDeviceByCode'](item);
device && device.instance && device.instance.recover();
if (model.emergencyController != undefined) {
device.emergencyController = model.emergencyController;
device && device.instance && device.instance.handleEmergencyChange(model.emergencyController);
}
if (model.controller) {
device.controller = model.controller;
device && device.instance && device.instance.handleComplexControl(model.controller);
} else {
device.controlMode = model.controlMode;
device && device.instance && device.instance['handle' + model.controlMode]();
}
});
}
if (model.tbStrategyId) {
store.state.map.map.tbStrategyList.forEach(item => {
if (item.stationCode == model.code) {
const modelData = Vue.prototype.$jlmap.mapDevice[item.code];
modelData && modelData.instance && modelData.instance.setState(modelData, model.tbStrategyId);
}
});
}
if (this.mileageText) {
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
}
}
handlePreResetLamp() {
@ -783,25 +788,6 @@ export default class Station extends Group {
this.troButton && this.troButton.hide();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
if (this.model.visible) {
this.eachChild(item => {
item.show();
});
if (this.mileageText) {
this.model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
}
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
}
setVisible(visible) {
if (visible) {

View File

@ -15,7 +15,6 @@ export default class StationCounter extends Group {
this.style = style;
this.zlevel = model.zlevel;
this.z = 30;
this.isShowShape = true;
this.create();
this.setState(model);
}
@ -83,27 +82,23 @@ export default class StationCounter extends Group {
}
setState(model) {
if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.counter && this.counter.hide();
this.table && this.table.hide();
this.counterName && this.counterName.hide();
}
}
recover() {
this.counter && this.counter.show();
this.table && this.table.show();
this.counterName && this.counterName.show();
}
getShapeTipPoint() {
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
}
getAnchorPoint() {
return this.model.position;
}

View File

@ -15,7 +15,6 @@ export default class StationDelayUnlock extends Group {
this.style = style;
this.zlevel = model.zlevel;
this.z = 1;
this.isShowShape = true;
this.create();
this.setState(model);
}
@ -92,35 +91,33 @@ export default class StationDelayUnlock extends Group {
/** 延时解锁计数*/
delayUnlock() {
if (!this.isShowShape) return;
this.table.setStyle('stroke', this.style.sidelineColor);
this.time.setStyle('text', '' + this.model.remainTime);
}
setState(model) {
switch (model.status) {
case '01': this.delayClose(); break; // 关闭
case '02': this.delayUnlock(); break; // 延迟解锁
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.text && this.text.hide();
this.table && this.table.hide();
this.time && this.time.hide();
} else {
switch (model.status) {
case '01': this.delayClose(); break; // 关闭
case '02': this.delayUnlock(); break; // 延迟解锁
}
}
}
getShapeTipPoint() {
return null;
}
setShowMode() {}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
recover() {
this.text && this.text.show();
this.table && this.table.show();
this.time && this.time.show();
}
getAnchorPoint() {
return this.model.position;

View File

@ -59,7 +59,8 @@ class EPatternFilter extends Group {
}
recover() {
this.patternFilter1 && this.patternFilter1.show();
this.patternFilter2 && this.patternFilter2.show();
}
setState(model) {

View File

@ -51,6 +51,7 @@ class EStationPlatform extends Group {
}
recover() {
const style = this.model.style;
this.showMode();
this.setColor(style.StationStand.stationPlatform.defaultColor);
}

View File

@ -47,6 +47,7 @@ class ETrainSetButton extends Group {
this.trainSetButton && this.trainSetButton.setStyle({textFill: color});
}
recover() {
this.trainSetButton && this.trainSetButton.show();
const style = this.model.style;
this.setColor(style.StationStand.trainSetButton.textColor);
}

View File

@ -73,6 +73,9 @@ class EDetainCircle extends Group {
recover() {
const style = this.model.style;
this.detainCircle && this.detainCircle.hide();
this.line1 && this.line1.hide();
this.line2 && this.line2.hide();
this.setColor(style.StationStand.detainCircle.defaultColor);
}

View File

@ -50,7 +50,6 @@ class StationStand extends Group {
this.zlevel = model.zlevel;
this.z = 1;
this.mapDevice = mapDevice;
this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setVisible(model.visible);
@ -148,17 +147,25 @@ class StationStand extends Group {
currentTypeList.forEach(element => {
this[element].recover();
});
this.stopJumpLamp && this.stopJumpLamp.hide();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();
this.upDetainLamp && this.upDetainLamp.hide();
this.downDetainLamp && this.downDetainLamp.hide();
}
setScreenDoorOpenStatus(model) {
this.gapStand && this.gapStand.setState(model);
}
setState(model) {
if (!this.isShowShape) return;
// // 新版地图使用新版状态变更方式
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
const currentTypeList = this.style.StationStand.elemnetType;
currentTypeList.forEach(element => {
this[element].hide();
});
} else if (model._free) {
this.setAshShow();
} else {
// 更新状态
@ -166,6 +173,12 @@ class StationStand extends Group {
currentTypeList.forEach(element => {
this[element].setState(model);
});
if (store.state.training.prdType === '01') {
this.stopJumpLamp && this.stopJumpLamp.show();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show();
}
}
}
@ -230,37 +243,28 @@ class StationStand extends Group {
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.StationStand.common.functionButtonShow;
this.setVisible(this.model.visible);
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.stopJumpLamp && this.stopJumpLamp.show();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show();
} else if (showMode === '05') {
this.eachChild(item => {
item.hide();
});
// const showConditions = this.style.StationStand.common.functionButtonShow;
// this.setVisible(this.model.visible);
if (showMode === '05') {
this.eachChild(item => { item.hide(); });
} else {
this.stopJumpLamp && this.stopJumpLamp.hide();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();
this.upDetainLamp && this.upDetainLamp.hide();
this.downDetainLamp && this.downDetainLamp.hide();
}
}
setShowStation(stationCode) {
if ((!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) && this.model.visible) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.stopJumpLamp && this.stopJumpLamp.show();
// this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
// this.upDetainLamp && this.upDetainLamp.show();
// this.downDetainLamp && this.downDetainLamp.show();
// } else if (showMode === '05') {
// this.eachChild(item => {
// item.hide();
// });
// } else {
// this.stopJumpLamp && this.stopJumpLamp.hide();
// this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();
// this.upDetainLamp && this.upDetainLamp.hide();
// this.downDetainLamp && this.downDetainLamp.hide();
// }
}
getAnchorPoint() {
return this.model.position;

View File

@ -75,6 +75,9 @@ class EGapStand extends Group {
recover() {
const style = this.model.style;
this.stand1 && this.stand1.show();
this.stand2 && this.stand2.show();
this.standText && this.standText.show();
if (!style.Psd.horizontal2Door.special) {
this.stand1 && this.stand1.setStyle({ fill:style.StationStand.gapStand.spareColor });
this.stand2 && this.stand2.setStyle({ fill:style.StationStand.gapStand.spareColor });

View File

@ -38,6 +38,7 @@ class EHollowStand extends Group {
recover() {
const style = this.model.style;
this.setColor(style.StationStand.hollowStand.spareColor);
this.stand && this.stand.show();
}
setState(model) {

View File

@ -60,6 +60,7 @@ class ESolidStand extends Group {
}
recover() {
// const style = this.model.style;
this.stand && this.stand.show();
}
setState(model) {

View File

@ -16,7 +16,6 @@ export default class StationTurnBack extends Group {
this.model = model;
this.style = style;
this.lineCode = lineCode;
this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
@ -129,6 +128,10 @@ export default class StationTurnBack extends Group {
if (!path.includes('/map/draw')) {
this.strategyText && this.strategyText.hide();
}
this.control && this.control.show();
this.controlRect && this.controlRect.show();
this.text && this.text.show();
this.strategyText && this.strategyText.show();
if (this.style.ReturnModeGroup) {
this.control && this.control.highlightType1(this.style.ReturnModeGroup.highlightColor);
@ -165,11 +168,15 @@ export default class StationTurnBack extends Group {
// 设置状态
setState(model, tbStrategyId = null) {
if (!this.isShowShape) return;
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.controlRect && this.controlRect.hide();
this.text && this.text.hide();
this.strategyText && this.strategyText.hide();
} else if (model._free) {
this.setAshShow();
} else {
if (tbStrategyId) {
@ -198,18 +205,6 @@ export default class StationTurnBack extends Group {
this.eachChild(item => item.hide() );
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
}
getAnchorPoint() {
return this.model.position;
}

View File

@ -23,7 +23,6 @@ export default class Switch extends Group {
this.style = style;
this.zlevel = model.zlevel;
this.z = 6;
this.isShowShape = true;
this.switchPosition = '';
this.mapDevice = mapDevice;
this.triangle = new JTriangle(model.intersection, model.skew);
@ -331,10 +330,10 @@ export default class Switch extends Group {
this.lockCircle && this.lockCircle.hide(); // 圆形包围框
this.lockArc && this.lockArc.hide(); // 圆形单锁框
this.name.getNameText().stopAnimation(false);
this.shapeModelC.hide(); // 形状 C
this.shapeModelA.hide(); // 形状 A
this.shapeModelB.hide(); // 形状 B
this.shapeBlockCover.hide(); // 封锁覆盖
this.shapeModelC && this.shapeModelC.hide(); // 形状 C
this.shapeModelA && this.shapeModelA.hide(); // 形状 A
this.shapeModelB && this.shapeModelB.hide(); // 形状 B
this.shapeBlockCover && this.shapeBlockCover.hide(); // 封锁覆盖
this.setHasTextBorder(0);
this.shapeModelC.attr({
z: this.z + 3
@ -343,6 +342,8 @@ export default class Switch extends Group {
this.lossShow && this.lossShow.hide(); // 道岔失去矩形
this.lossShow && this.lossShow.stopAnimation(false);
this.artificialArc && this.artificialArc.hide();
this.name && this.name.show();
this.limitName && this.limitName.show();
}
/** 定位*/
@ -678,10 +679,11 @@ export default class Switch extends Group {
}
}
setState(model) {
if (!this.isShowShape || model.showMode === '05') return;
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => { item.hide(); });
} else if (model._free) {
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
@ -805,33 +807,17 @@ export default class Switch extends Group {
}
}
setShowMode(flag = false) {
if (!flag) {
this.eachChild(item => {
item.show();
});
this.setState(this.model);
}
// if (!flag) {
// this.eachChild(item => {
// item.show();
// });
// this.isShowShape = true;
// this.setState(this.model);
// }
if ( this.model.showMode === '05') {
this.eachChild(item => {
item.hide();
});
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
if (this.name) {
this.style.Switch.text.show && this.model.nameShow ? this.name.show() : this.name.hide();
}
this.isShowShape = true;
this.setState(this.model);
this.eachChild(item => { item.hide(); });
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
this.setState(this.model);
}
}
getAnchorPoint() {

View File

@ -14,7 +14,6 @@ export default class Text2 extends Group {
this.style = style;
this.z = 6;
this.lineCode = lineCode;
this.isShowShape = true;
this.create();
this.setState(model);
this.setShowMode();
@ -46,7 +45,13 @@ export default class Text2 extends Group {
}
setState(model) {
if (!this.isShowShape) return;
this.recover();
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.text && this.text.hide();
}
}
recover() {
this.text && this.text.show();
}
getBoundingRect() {
if (this.text) {
@ -62,26 +67,15 @@ export default class Text2 extends Group {
this.text && this.text.hide();
return;
}
const showConditions = this.model.showConditions;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.text && this.text.show();
} else {
this.text && this.text.hide();
}
}
setShowStation(stationCode) {
if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this._code)) {
this.eachChild(item => {
item.show();
});
this.isShowShape = true;
this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();
});
this.isShowShape = false;
}
// const showConditions = this.model.showConditions;
// if (!showConditions || showConditions === '01' || showMode === showConditions) {
// this.text && this.text.show();
// } else {
// this.text && this.text.hide();
// }
// if (store.state.training.prdType === '09') {
// this.text && this.text.hide();
// }
}
screenShow() {
if (this.lineCode == '06') { // 宁波线路隐藏

View File

@ -18,7 +18,6 @@ export default class Train extends Group {
this.size = 0;
this.z = 40;
this.section = null;
this.isShowShape = true;
this.fontSize = model.nameFontSize || style.Train.common.trainTextFontSize;
this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
this.nameFormat = model.nameFormat || style.Train.trainBody.trainNameFormat;
@ -344,9 +343,10 @@ export default class Train extends Group {
}
// 设置状态
setState(model, object) {
if (!this.isShowShape) return;
const flag = model.trainWindowModel ? model.trainWindowModel.reversal : false;
if (model) {
const flag = model && model.trainWindowModel ? model.trainWindowModel.reversal : false;
if (!this.model.sectionModel || !store.getters['map/checkDeviceShow'](this.model.sectionModel.code)) {
this.eachChild(item => { item.hide(); });
} else if (model) {
this.recover();
// if (this.style.Train.common.trainHeadColorChangeMode) {
// this.setDriveMode(model.driveMode + model.runLevel);
@ -461,18 +461,6 @@ export default class Train extends Group {
});
}
}
setShowStation(stationCode) {
if ((this.model.sectionModel && store.getters['map/checkDeviceShow'](stationCode, this.model.sectionModel.code)) || !stationCode) {
this.eachChild(item => {
item.show();
});
this.setState(this.model, this);
} else {
this.eachChild(item => {
item.hide();
});
}
}
// screenShow() {
// // this.text && this.text.hide();
// this.setState(this.model);

View File

@ -14,8 +14,6 @@ class TrainWindow extends Group {
this.style = style;
this.z = 9;
this.prdType = store.state.training.prdType;
this.isShowShape = model.isShowShape;
this.stationCode = '';
this.create();
this.createMouseEvent();
this.setState(model);
@ -72,8 +70,14 @@ class TrainWindow extends Group {
}
setState(model) {
if (!this.isShowShape) return;
this.setVisible(model.trainWindowShow);
// if (!this.isShowShape) return;
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.trainRect && this.trainRect.hide();
} else if (model._tro) {
this.trainRect && this.trainRect.hide();
} else {
this.setVisible(model.trainWindowShow);
}
}
setVisible(show) {
@ -93,22 +97,6 @@ class TrainWindow extends Group {
});
}
}
setShowStation(stationCode) {
this.stationCode = stationCode;
// console.log(this.model);
// if (!stationCode || store.getters['map/checkDeviceShow'](stationCode, this.model.sectionModel)) {
// this.eachChild(item => {
// item.show();
// });
// this.isShowShape = true;
// this.setState(this.model);
// } else {
// this.eachChild(item => {
// item.hide();
// });
// this.isShowShape = false;
// }
}
getAnchorPoint() {
return this.model.point || this.model.position;
}

View File

@ -239,7 +239,6 @@ export default {
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); //
});
}
this.$store.dispatch('map/updateMapDevices', deviceList);
}
}

View File

@ -159,7 +159,8 @@ export default {
{ enlabel: 'Comprehensive exercise cloud platform', label: '综合演练云平台', value: '03'},
{ enlabel: 'Driver simulation driving system', label: '司机模拟驾驶系统', value: '04'},
{ enlabel: 'Dispatch workstation', label: '派班工作站', value: '05'},
{ enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'}
{ enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'},
{ enlabel: 'Interlocking station at depot', label: '车辆段联锁工作站', value: '09' }
],
trainingDeviceType: {
Switch: {enlabel: 'Switch training', label:'道岔实训'},

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,14 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.2.175:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.167:9000'; // 旭强 无线
BASE_API = 'http://192.168.8.177:9000'; // 旭强
// BASE_API = 'http://192.168.2.183:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -1,38 +1,32 @@
<template>
<div class="jl3dpassflow">
<div id="jl3d" :class="lineCode=='07'?'jl3ddraw':'jl3ddraw1'" />
<div v-if="lineCode=='07'" id="jlReal3d" class="jlReal3d">
<div id="jl3d" :class="lineCode == '07' ? 'jl3ddraw' : 'jl3ddraw1'" />
<div v-if="lineCode == '07'" id="jlReal3d" class="jlReal3d">
<div class="realCctv1">
<video id="myvideo0" class="video-js">
<source src="http://160.20.60.15/hls/cctv1.m3u8" type="application/x-mpegURL">
<source src="http://160.20.60.15/hls/cctv1.m3u8" type="application/x-mpegURL" />
</video>
</div>
<div class="realCctv2">
<video id="myvideo1" class="video-js">
<source src="http://160.20.60.15/hls/cctv2.m3u8" type="application/x-mpegURL">
<source src="http://160.20.60.15/hls/cctv2.m3u8" type="application/x-mpegURL" />
</video>
</div>
<div class="realCctv3">
<video id="myvideo2" class="video-js">
<source src="http://160.20.60.15/hls/cctv3.m3u8" type="application/x-mpegURL">
<source src="http://160.20.60.15/hls/cctv3.m3u8" type="application/x-mpegURL" />
</video>
</div>
<div class="realCctv4">
<video id="myvideo3" class="video-js">
<source src="http://160.20.60.15/hls/cctv4.m3u8" type="application/x-mpegURL">
<source src="http://160.20.60.15/hls/cctv4.m3u8" type="application/x-mpegURL" />
</video>
</div>
</div>
<div class="station" :style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}">
<div style="margin-top:5%;font-size: 30px;">当前车站:</div>
<div class="station" :style="{ 'background-image': 'url(' + localStatic + '/texture/scene.png)' }">
<div style="margin-top: 5%; font-size: 30px">当前车站:</div>
<el-select v-model="value" class="listmenu" placeholder="当前车站" @change="currentsel">
<el-option
v-for="item in stationlist"
:key="item.name"
:label="item.name"
:value="item.name"
:disabled="item.disabled"
/>
<el-option v-for="item in stationlist" :key="item.name" :label="item.name" :value="item.name" :disabled="item.disabled" />
</el-select>
</div>
@ -50,231 +44,236 @@
</el-button-group>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import Video from 'video.js';
import 'video.js/dist/video-js.css';
import { Jl3dpassflow } from '@/jlmap3d/jl3dpassflow/jl3dpassflownew.js';
import { ProjectIcon, loginInfo } from '@/scripts/ProjectConfig';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import Vue from 'vue'
import Video from 'video.js'
import 'video.js/dist/video-js.css'
import { Jl3dpassflow } from '@/jlmap3d/jl3dpassflow/jl3dpassflownew.js'
import { ProjectIcon, loginInfo } from '@/scripts/ProjectConfig'
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'
export default {
name: 'Passflow',
components: {
// VideoPlayer
},
data() {
return {
localStatic:JL3D_LOCAL_STATIC,
jl3d: null,
rendermode:'监控视角',
renderswitch:false,
stationlist:[],
value:'',
isCctv:true,
videoList:[],
// playerOptionList:[
// http://hls.cntv.lxdns.com/asp/hls/main/0303000a/3/default/978a64ddd3a1caa85ae70a23414e6540/main.m3u8
// // http://160.20.60.15/hls/cctv1.m3u8
// {sources: [{ type:'application/x-mpegURL', src: 'http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8'}]},
// {sources: [{ type:'application/x-mpegURL', src: 'http://192.168.3.6/hls/vlc.m3u8'}]},
// {sources: [{ type:'application/x-mpegURL', src: 'http://192.168.3.6/hls/vlc.m3u8'}]},
// {sources: [{ type:'application/x-mpegURL', src: 'http://192.168.3.6/hls/vlc.m3u8'}]}
// ],
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts']
};
},
computed: {
code() {
return this.$route.query.code;
},
lineCode() {
return this.$route.query.lineCode;
}
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.videoList.forEach((videoPlay, index)=>{
console.log("??");
document.querySelector('.myvideo' + index + '-dimensions').style.width = window.innerWidth / 4 + 'px';
document.querySelector('.myvideo' + index + '-dimensions').style.height = window.innerHeight / 2 + 'px';
// videoPlay.width_ = window.innerWidth / 4;
// videoPlay.height_ = window.innerHeight / 2;
});
}
},
created() {
if (this.loadingProjectList.includes(this.$route.query.project)) {
this.$store.dispatch('app/transitionAnimations');
}
document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
},
mounted() {
if (this.lineCode == '07') {
for (var i = 0; i < 4; i++) {
const videoPlay = new Video('myvideo' + i, {
controls: false,
autoplay: 'muted',
loop:true,
preload: 'auto',
width: window.innerWidth / 4 + 'px',
height: window.innerHeight / 2 + 'px',
hls: {
withCredentials: true
}
}, function () { console.log('videojs播放器初始化成功'); });
this.videoList.push(videoPlay);
}
}
this.init();
window.updatestationlist = this.updatestationlist;
if (this.$route.query.type == 'CCTV') {
this.isCctv = false;
}
},
beforeDestroy() {
},
methods: {
init: function () {
// let mapdata = this.$store.state.socket.device;
let dom = document.getElementById('jl3d');
this.jl3d = new Jl3dpassflow(dom, this.$route.query.mapid, this.$route.query.group, 'normal');
},
switchrender() {
if (this.renderswitch == true) {
this.rendermode = '退出监控';
this.renderswitch = false;
this.jl3d.switchviews('freeview');
} else {
this.rendermode = '监控视角';
this.renderswitch = true;
this.jl3d.switchviews('4views');
}
},
switch4view() {
this.jl3d.switchviews('4views');
},
switch2view() {
this.jl3d.switchviews('2views');
},
switchauto() {
this.jl3d.switchviews('freeview');
},
updatestationlist(list) {
// console.log(list);
this.value = list[0].name;
this.stationlist = list;
},
currentsel(selVal) {
this.jl3d.changestation(selVal);
// let oldgroupnum = this.groupnum;
// this.value = selVal;
},
back() {
window.close();
}
name: 'Passflow',
components: {
// VideoPlayer
},
data() {
return {
localStatic: JL3D_LOCAL_STATIC,
jl3d: null,
rendermode: '监控视角',
renderswitch: false,
stationlist: [],
value: '',
isCctv: true,
videoList: [],
// playerOptionList:[
// http://hls.cntv.lxdns.com/asp/hls/main/0303000a/3/default/978a64ddd3a1caa85ae70a23414e6540/main.m3u8
// // http://160.20.60.15/hls/cctv1.m3u8
// {sources: [{ type:'application/x-mpegURL', src: 'http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8'}]},
// {sources: [{ type:'application/x-mpegURL', src: 'http://192.168.3.6/hls/vlc.m3u8'}]},
// {sources: [{ type:'application/x-mpegURL', src: 'http://192.168.3.6/hls/vlc.m3u8'}]},
// {sources: [{ type:'application/x-mpegURL', src: 'http://192.168.3.6/hls/vlc.m3u8'}]}
// ],
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts'],
}
};
},
computed: {
code() {
return this.$route.query.code
},
lineCode() {
return this.$route.query.lineCode
},
},
watch: {
'$store.state.app.windowSizeCount': function () {
this.videoList.forEach((videoPlay, index) => {
console.log('??')
document.querySelector('.myvideo' + index + '-dimensions').style.width = window.innerWidth / 4 + 'px'
document.querySelector('.myvideo' + index + '-dimensions').style.height = window.innerHeight / 2 + 'px'
// videoPlay.width_ = window.innerWidth / 4;
// videoPlay.height_ = window.innerHeight / 2;
})
},
},
created() {
if (this.loadingProjectList.includes(this.$route.query.project)) {
this.$store.dispatch('app/transitionAnimations')
}
document.querySelector("link[rel*='icon']").href =
loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project]
},
mounted() {
if (this.lineCode == '07') {
for (var i = 0; i < 4; i++) {
const videoPlay = new Video(
'myvideo' + i,
{
controls: false,
autoplay: 'muted',
loop: true,
preload: 'auto',
width: window.innerWidth / 4 + 'px',
height: window.innerHeight / 2 + 'px',
hls: {
withCredentials: true,
},
},
function () {
console.log('videojs播放器初始化成功')
}
)
this.videoList.push(videoPlay)
}
}
this.init()
window.updatestationlist = this.updatestationlist
if (this.$route.query.type == 'CCTV') {
this.isCctv = false
}
},
beforeDestroy() {},
methods: {
init: function () {
// let mapdata = this.$store.state.socket.device;
let dom = document.getElementById('jl3d')
this.jl3d = new Jl3dpassflow(dom, this.$route.query.mapid, this.$route.query.group, 'normal')
},
switchrender() {
if (this.renderswitch == true) {
this.rendermode = '退出监控'
this.renderswitch = false
this.jl3d.switchviews('freeview')
} else {
this.rendermode = '监控视角'
this.renderswitch = true
this.jl3d.switchviews('4views')
}
},
switch4view() {
this.jl3d.switchviews('4views')
},
switch2view() {
this.jl3d.switchviews('2views')
},
switchauto() {
this.jl3d.switchviews('freeview')
},
updatestationlist(list) {
// console.log(list);
this.value = list[0].name
this.stationlist = list
},
currentsel(selVal) {
this.jl3d.changestation(selVal)
// let oldgroupnum = this.groupnum;
// this.value = selVal;
},
back() {
window.close()
},
},
}
</script>
<style scoped>
/* #jl3d {
/* #jl3d {
width: 937px;
height: 937px;
} */
.jl3dpassflow{
width: 100%;
height: 100%;
}
.jl3ddraw1{
position: absolute;
float: right;
top:0%;
/* left: 0; */
width: 100%;
height: 100%;
z-index: 0;
}
.jl3ddraw {
z-index: 3001;
position: absolute;
float: right;
top:0%;
/* left: 0; */
width: 50%;
height: 100%;
z-index: 0;
}
.jlReal3d{
position: absolute;
top:0%;
left: 50%;
width: 50%;
height: 100%;
z-index: 0;
font-size:0;
}
.realCctv1{
position: absolute;
width:50%;
height:50%;
left:0;
top:0;
}
.realCctv2{
position: absolute;
width:50%;
height:50%;
left:50%;
top:0;
}
.realCctv3{
position: absolute;
width:50%;
height:50%;
left:0;
top:50%;
}
.realCctv4{
position: absolute;
width:50%;
height:50%;
left:50%;
top:50%;
}
.station{
width:250px;
height:100px;
top:0;
left:0;
text-align: center;
/* right:500px; */
/* bottom:0; */
position: absolute;
background-size: 100% 100%;
border-radius:10px;
}
.listmenu{
/* top:50%; */
}
.menutop{
top:0;
right:0;
position:absolute;
}
.menudown{
bottom:0;
right:0;
position:absolute;
}
#canvastexture {
position: absolute;
float: left;
left: 0;
z-index: -12;
}
.video-js video{
outline: none !important;
}
.jl3dpassflow {
width: 100%;
height: 100%;
}
.jl3ddraw1 {
position: absolute;
float: right;
top: 0%;
/* left: 0; */
width: 100%;
height: 100%;
z-index: 0;
}
.jl3ddraw {
z-index: 3001;
position: absolute;
float: right;
top: 0%;
/* left: 0; */
width: 50%;
height: 100%;
z-index: 0;
}
.jlReal3d {
position: absolute;
top: 0%;
left: 50%;
width: 50%;
height: 100%;
z-index: 0;
font-size: 0;
}
.realCctv1 {
position: absolute;
width: 50%;
height: 50%;
left: 0;
top: 0;
}
.realCctv2 {
position: absolute;
width: 50%;
height: 50%;
left: 50%;
top: 0;
}
.realCctv3 {
position: absolute;
width: 50%;
height: 50%;
left: 0;
top: 50%;
}
.realCctv4 {
position: absolute;
width: 50%;
height: 50%;
left: 50%;
top: 50%;
}
.station {
width: 250px;
height: 100px;
top: 0;
left: 0;
text-align: center;
/* right:500px; */
/* bottom:0; */
position: absolute;
background-size: 100% 100%;
border-radius: 10px;
}
.listmenu {
/* top:50%; */
}
.menutop {
top: 0;
right: 0;
position: absolute;
}
.menudown {
bottom: 0;
right: 0;
position: absolute;
}
#canvastexture {
position: absolute;
float: left;
left: 0;
z-index: -12;
}
.video-js video {
outline: none !important;
}
</style>

View File

@ -208,12 +208,12 @@ export default {
},
// showMode
switchModeInner(swch) {
let showMode = '03';
if (swch == '01') {
showMode = '03';
} else if (swch == '02') {
showMode = '02';
}
// let showMode = '03';
// if (swch == '01') {
// showMode = '03';
// } else if (swch == '02') {
// showMode = '02';
// }
const list = [];
const mapDevice = this.$store.state.map.mapDevice;
@ -227,7 +227,7 @@ export default {
this.$jlmap.updateShowStation(list, ''); //
}
this.$jlmap.updateShowMode(list, showMode); //
// this.$jlmap.updateShowMode(list, showMode); //
},
//
loadMapData() {

View File

@ -513,7 +513,6 @@ export default {
this.$jlmap.updateShowStation(list, stationCode);
!setCenter && this.setCenter(stationCode);
// }
},
setOffset(data, num, sum, obj) {
this.$jlmap.switchScreen(data, num, sum, obj);

View File

@ -563,7 +563,6 @@ export default {
}
this.$jlmap.updateShowStation(list, showStation);
this.$jlmap.setCenter(showStation);
// }
},
setCentralizedstationList(map) {
this.centralizedstationList = [];

View File

@ -0,0 +1,70 @@
<template>
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="dialogVisible"
width="35%"
center
:close-on-click-modal="false"
:destroy-on-close="true"
>
<div>
<div class="eachButton uploadDemo">
<i class="el-icon-plus avatar-uploader-icon el-icon-other" />
<input ref="files" type="file" class="file_box" accept=".json, application/json" @change="importElem" />
</div>
</div>
<div class="footer" slot="footer">
<el-button @click="cancel">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" @click="confirm">{{ $t('map.confirm') }}</el-button>
</div>
</el-dialog>
</template>
<script>
let data = null
export default {
name: 'elementImport',
computed: {
title() {
return '元素导入'
},
},
data() {
return {
dialogVisible: false,
selected: false,
}
},
methods: {
open() {
this.dialogVisible = true
},
close() {
this.dialogVisible = false
},
importElem(e) {
const file = e.target.files[0]
const reader = new FileReader()
reader.readAsText(file, 'utf-8')
reader.onload = e => {
data = JSON.parse(e.target.result)
}
},
confirm() {
if (data) {
this.$emit('elementImport', data)
this.close()
} else {
console.error('no data')
}
},
cancel() {
this.close()
},
},
}
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

View File

@ -21,12 +21,7 @@
<el-tab-pane label="批量设置所属车站" name="second">
<div class="select-box">
<el-select v-model="belongStationCode" filterable size="mini">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name + item.code"
:value="item.code"
/>
<el-option v-for="item in stationList" :key="item.code" :label="item.name + item.code" :value="item.code" />
</el-select>
</div>
<div class="button-box">
@ -34,11 +29,23 @@
<el-button type="" size="mini" @click="clearList">清空</el-button>
</div>
</el-tab-pane>
<el-tab-pane label="批量导出" name="third">
<div class="button-box">
<el-button type="primary" size="mini" @click="handleBatchExport">批量导出</el-button>
<el-button type="" size="mini" @click="clearList">清空</el-button>
</div>
</el-tab-pane>
</el-tabs>
<div v-for="item in modelList" :key="item.type" class="content-box-list" style="margin-top: 10px;">
<div v-for="item in modelList" :key="item.type" class="content-box-list" style="margin-top: 10px">
<div class="title-box">{{ item.name }}</div>
<div class="list-box">
<div v-for="nor in item.list" :key="nor.code" class="list-content" @mouseenter="mouseenter(nor)" @mouseleave="mouseleave(nor)">
<div
v-for="nor in item.list"
:key="nor.code"
class="list-content"
@mouseenter="mouseenter(nor)"
@mouseleave="mouseleave(nor)"
>
<div class="name">{{ nor.name }}</div>
<div class="close" @click="delList(nor, item.list)"><i class="el-icon-close" /></div>
</div>
@ -49,248 +56,282 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex'
import { deepAssign } from '@/utils/index'
export default {
name: 'CheckboxDraft',
components: {
name: 'CheckboxDraft',
components: {},
props: {
selected: {
type: Object,
default: function () {
return null
},
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
}
},
data() {
return {
stationCode: '',
belongStationCode: '',
activeName: 'first',
modelList: [
{
type: 'Section',
name: '区段列表',
list: []
},
{
type: 'Switch',
name: '道岔列表',
list: []
},
{
type: 'Signal',
name: '信号机列表',
list: []
}
]
};
},
computed: {
...mapGetters('map', [
'seclectDeviceList',
'stationList'
]),
centralizedStationList() {
let list = [];
list = this.stationList.filter(station=>{
return station.centralized;
});
return list;
}
},
mounted() {
},
methods: {
// deviceChange(code) {
// this.$emit('setCenter', code);
// this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
// },
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.activeName = 'first';
this.clearModelList();
let count = 0;
this.seclectDeviceList.forEach(item => {
if (item._type == 'Section') {
if (item.type != '02') {
this.modelList[0].list.push(item);
}
} else if (item._type == 'Switch') {
this.modelList[1].list.push(item);
} else if (item._type == 'Signal') {
this.modelList[2].list.push(item);
}
if (item.stationCode == this.seclectDeviceList[0].stationCode) {
count++;
}
});
if (count && count == this.seclectDeviceList.length) {
this.stationCode = this.seclectDeviceList[0].stationCode;
} else {
this.stationCode = '';
}
this.belongStationCode = this.stationList[0].code;
}
},
data() {
return {
stationCode: '',
belongStationCode: '',
activeName: 'first',
modelList: [
{
type: 'Section',
name: '区段列表',
list: [],
logicSectionList: [],
},
clearModelList() {
this.modelList.forEach(item => {
item.list = [];
});
{
type: 'Switch',
name: '道岔列表',
list: [],
},
//
delList(model, list) {
list.forEach((nor, index) => {
if (nor.code == model.code) {
list.splice(index, 1);
}
});
this.seclectDeviceList.forEach((item, index) => {
if (item.code == model.code) {
this.seclectDeviceList.splice(index, 1);
}
});
{
type: 'Signal',
name: '信号机列表',
list: [],
},
//
handleSectionStationCode() {
if (this.stationCode && this.seclectDeviceList && this.seclectDeviceList.length > 0) {
const models = [];
this.modelList.forEach(model => { //
model.list.forEach(item => {
const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code));
Model.stationCode = this.stationCode;
if (Model._type == 'Section' && Model.logicSectionCodeList && Model.logicSectionCodeList.length) {
Model.logicSectionCodeList.forEach(children => {
const ModelChild = deepAssign({}, this.$store.getters['map/getDeviceByCode'](children));
ModelChild.stationCode = this.stationCode;
models.push(ModelChild);
});
}
models.push(Model);
});
});
this.$emit('updateMapModel', models);
this.$message.success('设置设备集中站成功');
this.stationCode = '';
}
},
handleBelongStationCode() {
if (this.belongStationCode && this.seclectDeviceList && this.seclectDeviceList.length > 0) {
const models = [];
this.modelList.forEach(model => { //
model.list.forEach(item => {
const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code));
if (Model._type == 'Section') {
Model.belongStation = this.belongStationCode;
} else {
Model.belongStationCode = this.belongStationCode;
}
if (Model._type == 'Section' && Model.logicSectionCodeList && Model.logicSectionCodeList.length) {
Model.logicSectionCodeList.forEach(children => {
const ModelChild = deepAssign({}, this.$store.getters['map/getDeviceByCode'](children));
ModelChild.belongStation = this.belongStationCode;
models.push(ModelChild);
});
}
models.push(Model);
});
});
this.$emit('updateMapModel', models);
this.$message.success('设置所属车站成功');
this.stationCode = '';
}
},
clearList() { //
this.stationCode = '';
this.belongStationCode = '';
this.$store.commit('map/setSeclectDeviceList', []);
this.modelList = [
{
type: 'Section',
name: '区段列表',
list: []
},
{
type: 'Switch',
name: '道岔列表',
list: []
},
{
type: 'Signal',
name: '信号机列表',
list: []
}
];
},
mouseenter(model) {
if (model._type == 'Section') {
model.instance.mouseover();
}
},
mouseleave(model) {
if (model._type == 'Section') {
model.instance.mouseout();
}
}
],
}
};
},
computed: {
...mapGetters('map', ['seclectDeviceList', 'stationList']),
centralizedStationList() {
let list = []
list = this.stationList.filter(station => {
return station.centralized
})
return list
},
},
mounted() {},
methods: {
// deviceChange(code) {
// this.$emit('setCenter', code);
// this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
// },
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.activeName = 'first'
this.clearModelList()
let count = 0
this.seclectDeviceList.forEach(item => {
if (item._type == 'Section') {
if (item.type != '02') {
this.modelList[0].list.push(item)
} else {
this.modelList[0].logicSectionList.push(item)
}
} else if (item._type == 'Switch') {
this.modelList[1].list.push(item)
} else if (item._type == 'Signal') {
this.modelList[2].list.push(item)
}
if (item.stationCode == this.seclectDeviceList[0].stationCode) {
count++
}
})
if (count && count == this.seclectDeviceList.length) {
this.stationCode = this.seclectDeviceList[0].stationCode
} else {
this.stationCode = ''
}
this.belongStationCode = this.stationList[0] && this.stationList[0].code
}
},
clearModelList() {
this.modelList.forEach(item => {
item.list = []
if (item.logicSectionList) item.logicSectionList = []
})
},
//
delList(model, list) {
list.forEach((nor, index) => {
if (nor.code == model.code) {
list.splice(index, 1)
}
})
this.seclectDeviceList.forEach((item, index) => {
if (item.code == model.code) {
this.seclectDeviceList.splice(index, 1)
}
})
},
//
handleSectionStationCode() {
if (this.stationCode && this.seclectDeviceList && this.seclectDeviceList.length > 0) {
const models = []
this.modelList.forEach(model => {
//
model.list.forEach(item => {
const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code))
Model.stationCode = this.stationCode
if (Model._type == 'Section' && Model.logicSectionCodeList && Model.logicSectionCodeList.length) {
Model.logicSectionCodeList.forEach(children => {
const ModelChild = deepAssign({}, this.$store.getters['map/getDeviceByCode'](children))
ModelChild.stationCode = this.stationCode
models.push(ModelChild)
})
}
models.push(Model)
})
})
this.$emit('updateMapModel', models)
this.$message.success('设置设备集中站成功')
this.stationCode = ''
}
},
handleBelongStationCode() {
if (this.belongStationCode && this.seclectDeviceList && this.seclectDeviceList.length > 0) {
const models = []
this.modelList.forEach(model => {
//
model.list.forEach(item => {
const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code))
if (Model._type == 'Section') {
Model.belongStation = this.belongStationCode
} else {
Model.belongStationCode = this.belongStationCode
}
if (Model._type == 'Section' && Model.logicSectionCodeList && Model.logicSectionCodeList.length) {
Model.logicSectionCodeList.forEach(children => {
const ModelChild = deepAssign({}, this.$store.getters['map/getDeviceByCode'](children))
ModelChild.belongStation = this.belongStationCode
models.push(ModelChild)
})
}
models.push(Model)
})
})
this.$emit('updateMapModel', models)
this.$message.success('设置所属车站成功')
this.stationCode = ''
}
},
handleBatchExport() {
const exportData = this.generateExportData()
const content = new Blob([JSON.stringify(exportData)])
const url = URL.createObjectURL(content)
const el = document.createElement('a')
el.href = url
el.download = `export.json`
el.click()
URL.revokeObjectURL(url)
},
generateExportData() {
// TODO
let res = {}
this.modelList.forEach(item => {
res[`${item.type.toLowerCase()}List`] = item.list.map(_ => _.code)
if (item.type === 'Section')
item.logicSectionList.forEach(_ => {
res[`${item.type.toLowerCase()}List`].push(_.code)
})
})
res.switchList = res.switchList.map(c => this.$store.state.map.map.switchList.find(_ => _.code === c))
res.switchList.forEach(swch => {
if (!res.sectionList.includes(swch.sectionACode)) res.sectionList.push(swch.sectionACode)
if (!res.sectionList.includes(swch.sectionBCode)) res.sectionList.push(swch.sectionBCode)
if (!res.sectionList.includes(swch.sectionCCode)) res.sectionList.push(swch.sectionCCode)
})
for (let key in res) {
if (key !== 'switchList') res[key] = this.$store.state.map.map[key].filter(model => res[key].includes(model.code))
}
return res
},
clearList() {
//
this.stationCode = ''
this.belongStationCode = ''
this.$store.commit('map/setSeclectDeviceList', [])
this.modelList = [
{
type: 'Section',
name: '区段列表',
list: [],
logicSectionList: [],
},
{
type: 'Switch',
name: '道岔列表',
list: [],
},
{
type: 'Signal',
name: '信号机列表',
list: [],
},
]
},
mouseenter(model) {
if (model._type == 'Section') {
model.instance.mouseover()
}
},
mouseleave(model) {
if (model._type == 'Section') {
model.instance.mouseout()
}
},
},
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.content-box{
padding-bottom: 20px;
font-size: 13px;
padding-top: 2px;
overflow:auto;
height:100%;
&-list{
padding: 10px;
margin: 10px;
margin-top: 0;
box-shadow: 1px 1px 4px #ccc;
}
}
@import 'src/styles/mixin.scss';
.content-box {
padding-bottom: 20px;
font-size: 13px;
padding-top: 2px;
overflow: auto;
height: 100%;
&-list {
padding: 10px;
margin: 10px;
margin-top: 0;
box-shadow: 1px 1px 4px #ccc;
}
}
.select-box{
margin-bottom: 10px;
padding-left: 10px;
}
.button-box{
padding-left: 10px;
}
.select-box {
margin-bottom: 10px;
padding-left: 10px;
}
.button-box {
padding-left: 10px;
}
.list-box{
overflow: hidden;
.list-content{
float: left;
background: #e2e2e2;
margin: 5px;
border-radius: 5px;
height: 30px;
line-height: 30px;
padding-left: 10px;
padding-right: 3px;
cursor: pointer;
.list-box {
overflow: hidden;
.list-content {
float: left;
background: #e2e2e2;
margin: 5px;
border-radius: 5px;
height: 30px;
line-height: 30px;
padding-left: 10px;
padding-right: 3px;
cursor: pointer;
&:hover{
background: #ccc;
}
.name{
float: left;
margin-right: 20px;
}
.close{
float: left;
width: 23px;
cursor: pointer;
}
}
&:hover {
background: #ccc;
}
.title-box{
padding-left: 10px;
border-left: 4px solid red;
margin-bottom: 10px;
.name {
float: left;
margin-right: 20px;
}
.close {
float: left;
width: 23px;
cursor: pointer;
}
}
}
.title-box {
padding-left: 10px;
border-left: 4px solid red;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,220 @@
<template>
<div v-loading="loading" class="view-control-content">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
<div slot="header">
<span>请选择行调显示设备</span>
</div>
<div style="padding: 10px;font-size: 14px;">
<div class="content-box-list" style="margin-top: 10px;">
<div class="title-box">设备列表</div>
<div class="list-box" style="height:400px;overflow:auto">
<div v-for="nor in addModel.elementList" :key="nor.code" class="list-content">
<div class="name">{{ getDeviceName(nor) }}</div>
<div class="close" @click="delList(nor, addModel.elementList)"><i class="el-icon-close" /></div>
</div>
</div>
</div>
</div>
</el-card>
<div style="display: table; margin-left: 150px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" @click="generateData">自动生成</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button>
</div>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { saveMap } from '@/api/jmap/mapdraft';
export default {
components: {
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
}
},
data() {
return {
otherData: [],
addModel: {
type: 'CENTER',
elementList: []
},
loading: false,
dataLoading:false
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList',
'signalList',
'switchList',
'stationStandList',
'automaticRouteButtonList',
'axleCounterResetButtonList',
'cycleButtonList',
'directionRodList',
'indicatorLightList',
'lineList',
'outerFrameList',
'psdList',
'responderList',
'tbStrategyList',
'tempSpeedLimitList',
'textList',
'totalGuideLockButtonVOList',
'seclectDeviceList'
])
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
},
mounted() {
this.initData();
},
methods: {
initData() {
this.$store.state.map.map.displayList.forEach(item => {
if (item.type === 'CENTER') {
this.addModel = item;
} else {
this.otherData.push(item);
}
});
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.seclectDeviceList.forEach(item => {
if (this.addModel.elementList.indexOf(item.code) < 0) {
this.addModel.elementList.push(item.code);
}
});
} else if (selected) {
if (this.addModel.elementList.indexOf(selected.code) < 0) {
this.addModel.elementList.push(selected.code);
}
}
},
getDeviceName(code) {
const device = this.$store.getters['map/getDeviceByCode'](code);
return device.name || device.code;
},
//
delList(model, list) {
list.forEach((nor, index) => {
if (nor == model) {
list.splice(index, 1);
}
});
this.seclectDeviceList.forEach((item, index) => {
if (item.code == model) {
this.seclectDeviceList.splice(index, 1);
}
});
},
save() {
const map = this.$store.state.map.map;
const param = {
displayList: [...this.otherData, this.addModel],
mapId: this.$route.params.mapId
};
this.dataLoading = true;
saveMap(Object.assign(map, param)).then(response => {
this.$message.success('保存行调配置成功');
this.dataLoading = false;
}).catch(() => {
this.dataLoading = false;
this.$messageBox('保存行调配置失败');
});
},
back() {
this.$emit('goDraw');
},
clear() {
this.addModel = {elementList: []};
},
generateData() {
this.loading = true;
this.tableData = [];
const station = this.stationList.find(item => item.depot);
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {
if (item.stationCode !== station.code) {
this.addModel.elementList.push(item.code);
}
});
[...this.directionRodList].forEach(item => {
if (item.deviceStationCode !== station.code) {
this.addModel.elementList.push(item.code);
}
});
this.psdList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
if (stand.stationCode !== station.code) {
this.addModel.elementList.push(item.code);
}
});
const map = this.$store.state.map.map;
const param = {
displayList: [...this.otherData, this.addModel],
mapId: this.$route.params.mapId
};
saveMap(Object.assign(map, param)).then(response => {
this.loading = false;
this.$message.success('保存行调配置成功');
}).catch(() => {
this.loading = false;
this.$messageBox('保存行调配置失败');
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.title-box{
padding-left: 10px;
border-left: 4px solid red;
margin-bottom: 10px;
}
.list-box{
overflow: hidden;
.list-content{
float: left;
background: #e2e2e2;
margin: 5px;
border-radius: 5px;
height: 30px;
line-height: 30px;
padding-left: 10px;
padding-right: 3px;
cursor: pointer;
&:hover{
background: #ccc;
}
.name{
float: left;
margin-right: 20px;
}
.close{
float: left;
width: 23px;
cursor: pointer;
}
}
}
</style>

View File

@ -0,0 +1,221 @@
<template>
<div v-loading="loading" class="view-control-content">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
<div slot="header">
<span>请选择车辆段显示设备</span>
</div>
<div style="padding: 10px;font-size: 14px;">
<div class="content-box-list" style="margin-top: 10px;">
<div class="title-box">设备列表</div>
<div class="list-box" style="height:400px;overflow:auto">
<div v-for="nor in addModel.elementList" :key="nor.code" class="list-content">
<div class="name">{{ getDeviceName(nor) }}</div>
<div class="close" @click="delList(nor, addModel.elementList)"><i class="el-icon-close" /></div>
</div>
</div>
</div>
</div>
</el-card>
<div style="display: table; margin-left: 150px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" @click="generateData">自动生成</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button>
</div>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { saveMap } from '@/api/jmap/mapdraft';
export default {
components: {
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
}
},
data() {
return {
otherData: [],
addModel: {
type: 'DEPOT_IL',
elementList: []
},
loading: false,
dataLoading:false
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList',
'signalList',
'switchList',
'stationStandList',
'automaticRouteButtonList',
'axleCounterResetButtonList',
'cycleButtonList',
'directionRodList',
'indicatorLightList',
'lineList',
'outerFrameList',
'psdList',
'responderList',
'tbStrategyList',
'tempSpeedLimitList',
'textList',
'totalGuideLockButtonVOList',
'seclectDeviceList'
])
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
}
},
mounted() {
this.initData();
},
methods: {
initData() {
this.$store.state.map.map.displayList.forEach(item => {
if (item.type === 'DEPOT_IL') {
this.addModel = item;
} else {
this.otherData.push(item);
}
});
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.seclectDeviceList.forEach(item => {
if (this.addModel.elementList.indexOf(item.code) < 0) {
this.addModel.elementList.push(item.code);
}
});
} else if (selected) {
if (this.addModel.elementList.indexOf(selected.code) < 0) {
this.addModel.elementList.push(selected.code);
}
}
},
getDeviceName(code) {
const device = this.$store.getters['map/getDeviceByCode'](code);
return device.name || device.code;
},
//
delList(model, list) {
list.forEach((nor, index) => {
if (nor == model) {
list.splice(index, 1);
}
});
this.seclectDeviceList.forEach((item, index) => {
if (item.code == model) {
this.seclectDeviceList.splice(index, 1);
}
});
},
save() {
const map = this.$store.state.map.map;
const param = {
displayList: [...this.otherData, this.addModel],
mapId: this.$route.params.mapId
};
this.dataLoading = true;
saveMap(Object.assign(map, param)).then(response => {
this.$message.success('保存车辆段配置成功');
this.dataLoading = false;
}).catch(() => {
this.dataLoading = false;
this.$messageBox('保存车辆段配置失败');
});
},
back() {
this.$emit('goDraw');
},
clear() {
this.addModel = { type: 'DEPOT_IL', elementList: [] };
},
generateData() {
this.loading = true;
this.clear();
const station = this.stationList.find(item => item.depot);
console.log(station, station.code);
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {
if (item.stationCode === station.code) {
this.addModel.elementList.push(item.code);
}
});
[...this.directionRodList].forEach(item => {
if (item.deviceStationCode === station.code) {
this.addModel.elementList.push(item.code);
}
});
this.psdList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
if (stand.stationCode === station.code) {
this.addModel.elementList.push(item.code);
}
});
const map = this.$store.state.map.map;
const param = {
displayList: [...this.otherData, this.addModel],
mapId: this.$route.params.mapId
};
saveMap(Object.assign(map, param)).then(response => {
this.loading = false;
this.$message.success('保存车辆段配置成功');
}).catch(() => {
this.loading = false;
this.$messageBox('保存车辆段配置失败');
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.title-box{
padding-left: 10px;
border-left: 4px solid red;
margin-bottom: 10px;
}
.list-box{
overflow: hidden;
.list-content{
float: left;
background: #e2e2e2;
margin: 5px;
border-radius: 5px;
height: 30px;
line-height: 30px;
padding-left: 10px;
padding-right: 3px;
cursor: pointer;
&:hover{
background: #ccc;
}
.name{
float: left;
margin-right: 20px;
}
.close{
float: left;
width: 23px;
cursor: pointer;
}
}
}
</style>

View File

@ -65,7 +65,8 @@
</div>
</el-card>
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" @click="generateData">按集中站生成并保存</el-button>
<el-button type="primary" size="small" @click="generateData">按集中站生成</el-button>
<el-button type="primary" size="small" @click="generateAllData">全显生成</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button>
</div>
@ -91,7 +92,9 @@ export default {
data() {
return {
tableData: [],
otherData: [],
addModel: {
type: 'LOCAL',
stationCodeList: [],
switchStationCodeList:[],
elementList: []
@ -125,7 +128,6 @@ export default {
'tempSpeedLimitList',
'textList',
'totalGuideLockButtonVOList',
'localStationConfig',
'seclectDeviceList'
]),
cardTitle() {
@ -158,7 +160,14 @@ export default {
// }
// },
initData() {
this.tableData = this.$store.state.map.map.displayList || [];
// this.tableData = (this.$store.state.map.map.displayList || []).filter(item => item.type === 'LOCAL');
this.$store.state.map.map.displayList.forEach( item => {
if (item.type === 'LOCAL') {
this.tableData.push(item);
} else {
this.otherData.push(item);
}
});
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
@ -222,7 +231,7 @@ export default {
save() {
const map = this.$store.state.map.map;
const param = {
displayList: this.tableData,
displayList: [...this.tableData, ...this.otherData],
mapId: this.$route.params.mapId
};
this.dataLoading = true;
@ -251,20 +260,63 @@ export default {
this.clearData();
},
clear() {
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
},
clearData() {
this.addModel = { stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.addModel = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
this.index = '';
this.cardMode = 'generate';
},
generateAllData() {
this.loading = true;
this.tableData = [];
const tempData = { type: 'LOCAL', stationCodeList: [], elementList: [], switchStationCodeList:[] };
const stationCodeList = [];
this.stationList.forEach(item => {
if (!item.depot) {
tempData.stationCodeList.push(item.code);
} else { stationCodeList.push(item.code); }
});
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {
if (!stationCodeList.includes(item.stationCode)) {
tempData.elementList.push(item.code);
}
});
[...this.directionRodList].forEach(item => {
if (!stationCodeList.includes(item.deviceStationCode)) {
tempData.elementList.push(item.code);
}
});
this.psdList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
if (!stationCodeList.includes(stand.stationCode)) {
tempData.elementList.push(item.code);
}
});
this.tableData.push(tempData);
const map = this.$store.state.map.map;
const param = {
displayList: [...this.tableData, ...this.otherData],
mapId: this.$route.params.mapId
};
saveMap(Object.assign(map, param)).then(response => {
this.loading = false;
this.$message.success('保存现地配置成功');
this.cancelOverlab();
}).catch(() => {
this.loading = false;
this.$messageBox('保存现地配置失败');
});
},
generateData() {
this.loading = true;
this.tableData = [];
// switchStationCodeList:[...item.switchStationCodeList, item.code]
this.stationList.forEach(item => {
if (item.centralized) {
this.tableData.push({stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
this.tableData.push({type: 'LOCAL', stationCodeList: [...item.chargeStationCodeList, item.code], elementList: [...item.chargeStationCodeList, item.code], switchStationCodeList:[...item.chargeStationCodeList, item.code]});
}
});
@ -285,7 +337,7 @@ export default {
});
const map = this.$store.state.map.map;
const param = {
displayList: this.tableData,
displayList: [...this.tableData, ...this.otherData],
mapId: this.$route.params.mapId
};
saveMap(Object.assign(map, param)).then(response => {

View File

@ -13,8 +13,10 @@
<el-dropdown class="operate-button" trigger="click">
<span class="el-dropdown-link">配置</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item><span @click="showCenterConfig">行调配置</span></el-dropdown-item>
<el-dropdown-item><span @click="showLocalConfig">现地配置</span></el-dropdown-item>
<el-dropdown-item><span @click="showScreenConfig">大屏配置</span></el-dropdown-item>
<el-dropdown-item><span @click="showDepotConfig">车辆段配置</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown class="operate-button" trigger="click">
@ -38,16 +40,10 @@
/>
</el-tab-pane>
</el-tabs>
<template v-if="configShow === 'local'">
<local-config ref="localConfig" :selected="selected" @goDraw="goDraw" />
</template>
<template v-show="configShow === 'screen'">
<split-screen
ref="splitScreen"
:selected="selected"
@goDraw="goDraw"
/>
</template>
<local-config v-if="configShow === 'local'" ref="localConfig" :selected="selected" @goDraw="goDraw" />
<split-screen v-else-if="configShow === 'screen'" ref="splitScreen" :selected="selected" @goDraw="goDraw" />
<center-config v-else-if="configShow === 'center'" ref="centerConfig" :selected="selected" @goDraw="goDraw" />
<depot-config v-else-if="configShow === 'depot'" ref="depotConfig" :selected="selected" @goDraw="goDraw" />
</div>
</transition>
</template>
@ -75,11 +71,13 @@ import ResponderDraft from './responder/index';
import ControlLamp from './controlLamp';
import SplitStation from './splitStation';
import Arrow from './arrow';
import SplitScreen from './splitScreen';
import SplitScreen from './displayConfig/splitScreen';
import FloodGate from './floodGate';
import DirectionRod from './directionRod';
import SignalButton from './signalButton';
import LocalConfig from './localConfig';
import LocalConfig from './displayConfig/localConfig';
import CenterConfig from './displayConfig/centerConfig';
import DepotConfig from './displayConfig/depotConfig';
export default {
name: 'MapOperate',
@ -111,7 +109,9 @@ export default {
FloodGate,
DirectionRod,
SignalButton,
LocalConfig
LocalConfig,
CenterConfig,
DepotConfig
},
props: {
selected: {
@ -188,12 +188,18 @@ export default {
dataRelation() {
this.$emit('selectView', 'path');
},
showCenterConfig() {
this.configShow = 'center';
},
showLocalConfig() {
this.configShow = 'local';
},
showScreenConfig() {
this.configShow = 'screen';
},
showDepotConfig() {
this.configShow = 'depot';
},
goDraw() {
this.configShow = 'none';
},
@ -237,13 +243,13 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draftMapName{
width:280px;
overflow:hidden;
height:17px;
text-overflow:ellipsis;
white-space:nowrap;
}
.draftMapName{
width:280px;
overflow:hidden;
height:17px;
text-overflow:ellipsis;
white-space:nowrap;
}
.el-dropdown-link {
cursor: pointer;
color: #409EFF;
@ -251,68 +257,68 @@ export default {
.el-icon-arrow-down {
font-size: 12px;
}
.map-control {
width: 100%;
height: 100%;
}
.operate-button{
padding: 3px 0;
margin-right: 5px;
}
// .physical-view {
// line-height: 25px;
// height: 118px;
// padding-left: 12px;
// .el-checkbox {
// width: 70px;
// margin: 0;
// margin-right: 30px;
// }
// }
.map-operate{
height: 47px;
padding: 15px;
display:flex;
}
.mapEdit{
height: calc(100% - 47px);
.tab_pane_box{
height: 100%;
}
}
/deep/ .button_box{
width: 100%;
background: #ffffff;
border-top: 1px #f3f1f1 solid;
box-shadow: 4px 7px 10px #565656;
border-radius: 0;
border-bottom: 1px transparent solid;
position:absolute;
bottom:0;
z-index:3;
.map-control {
width: 100%;
height: 100%;
}
/deep/ .view-control-content{
height:100%;
padding-bottom:46px;
overflow-y:auto;
}
.operate-button{
padding: 3px 0;
margin-right: 5px;
}
/deep/ .map-draft-group {
float: right;
margin: 6px 5px;
}
// .physical-view {
// line-height: 25px;
// height: 118px;
// padding-left: 12px;
/deep/ .view-control {
height:100%;
}
// .el-checkbox {
// width: 70px;
// margin: 0;
// margin-right: 30px;
// }
// }
/deep/ {
.map-operate{
height: 47px;
padding: 15px;
display:flex;
}
.mapEdit{
height: calc(100% - 47px);
.tab_pane_box{
height: 100%;
}
}
/deep/ .button_box{
width: 100%;
background: #ffffff;
border-top: 1px #f3f1f1 solid;
box-shadow: 4px 7px 10px #565656;
border-radius: 0;
border-bottom: 1px transparent solid;
position:absolute;
bottom:0;
z-index:3;
}
/deep/ .view-control-content{
height:100%;
padding-bottom:46px;
overflow-y:auto;
}
/deep/ .map-draft-group {
float: right;
margin: 6px 5px;
}
/deep/ .view-control {
height:100%;
}
/deep/ {
.mapEdit .el-tabs__nav-wrap.is-scrollable {
padding: 0 20px;
}
@ -355,8 +361,8 @@ export default {
}
}
//
/deep/ {
//
/deep/ {
.card .el-transfer-panel__filter{
margin: 5px 15px;
}

View File

@ -86,6 +86,7 @@ class Model {
this.callOn = true;
this.turnBack = false;
this.ctc = true; // 是否灭灯显示
this.ctcSetOverlap = true; // CTC级别是否办理延续保护
this.noOverlap = false; // 是否无延续保护
this.routeEnd = false; // 是否进路终端
this.noRoute = false; // 是否不生成进路

View File

@ -150,6 +150,7 @@ export default {
{ prop: 'callOn', label: '是否引导信号:', type: 'checkbox'},
{ prop: 'turnBack', label: '是否自动折返始端:', type: 'checkbox', isHidden: this.editModel.virtual},
{ prop: 'ctc', label: '是否灭灯显示(CTC级)', type: 'checkbox'},
{ prop: 'ctcSetOverlap', label: 'CTC级别是否办理延续保护', type: 'checkbox' },
{ prop: 'noOverlap', label: '是否无延续保护', type: 'checkbox'},
{ prop: 'routeEnd', label: '是否进路终端', type: 'checkbox'},
{ prop: 'ignoreRouteEnd', label: '不生成进路的信号机终端', type: 'multiSelectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, hover: this.hover, buttonType: 'signalIgnoreRouteEnd', buttonShowType: this.signalIgnoreRouteEnd },