大铁线路调整23

This commit is contained in:
fan 2022-04-27 17:35:36 +08:00
parent e65abe322a
commit 1c04fd0bd6
18 changed files with 869 additions and 52 deletions

View File

@ -947,7 +947,7 @@ class SkinCode extends defaultStyle {
fontFamily:'宋体'
}
};
this[deviceType.PickOrDepartArrow] = {
this[deviceType.DepartArrow] = {
triangleLength: 15,
lineWidth: 8,
length: 35,
@ -955,7 +955,18 @@ class SkinCode extends defaultStyle {
fill: '#000',
stroke: '#fff',
fontSize: 11,
defaultText: '接发车',
defaultText: '发车',
defaultColor: '#ccc'
};
this[deviceType.PickArrow] = {
triangleLength: 15,
lineWidth: 8,
length: 35,
distance: 15,
fill: '#000',
stroke: '#fff',
fontSize: 11,
defaultText: '接车',
defaultColor: '#ccc'
};
this[deviceType.Occlusion] = {

View File

@ -285,9 +285,14 @@ deviceRender[deviceType.IndicatorLight] = {
_type: deviceType.IndicatorLight,
zlevel: 1
};
/** 接发车指示灯 */
deviceRender[deviceType.PickOrDepartArrow] = {
_type: deviceType.PickOrDepartArrow,
/** 接车指示灯 */
deviceRender[deviceType.PickArrow] = {
_type: deviceType.PickArrow,
zlevel: 1
};
/** 发车指示灯 */
deviceRender[deviceType.DepartArrow] = {
_type: deviceType.DepartArrow,
zlevel: 1
};
/** 区间占用 区间监控 */

View File

@ -51,7 +51,8 @@ const deviceType = {
DirectionRod: 'DirectionRod',
Responder: 'Responder',
SignalButton: 'SignalButton',
PickOrDepartArrow: 'PickOrDepartArrow',
PickArrow: 'PickArrow',
DepartArrow: 'DepartArrow',
Occlusion: 'Occlusion',
Accident: 'Accident',
Recovery: 'Recovery',

View File

@ -350,7 +350,8 @@ export function updateMapData(state, model) {
case deviceType.Axle: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.IndicatorLight: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.PickOrDepartArrow: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.PickArrow: updateForList(model, state, 'indicatorLightList');break;
case deviceType.DepartArrow: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.Occlusion: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.Accident: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.Recovery: updateForList(model, state, 'indicatorLightList'); break;

View File

@ -16,22 +16,22 @@ export default class EPickOrDepartArrow extends Group {
this.arrow = new Polygon({
zlevel: this.zlevel,
z: this.z,
origin: [model.x + style.PickOrDepartArrow.length / 2, model.y],
origin: [model.x + style[this._subType].length / 2, model.y],
rotation: model.right ? Math.PI : 0,
shape: {
points: [
[model.x, model.y],
[model.x + style.PickOrDepartArrow.triangleLength, model.y - style.PickOrDepartArrow.triangleLength / 2],
[model.x + style.PickOrDepartArrow.triangleLength, model.y - style.PickOrDepartArrow.lineWidth / 2],
[model.x + style.PickOrDepartArrow.length, model.y - style.PickOrDepartArrow.lineWidth / 2],
[model.x + style.PickOrDepartArrow.length, model.y + style.PickOrDepartArrow.lineWidth / 2],
[model.x + style.PickOrDepartArrow.triangleLength, model.y + style.PickOrDepartArrow.lineWidth / 2],
[model.x + style.PickOrDepartArrow.triangleLength, model.y + style.PickOrDepartArrow.triangleLength / 2]
[model.x + style[this._subType].triangleLength, model.y - style[this._subType].triangleLength / 2],
[model.x + style[this._subType].triangleLength, model.y - style[this._subType].lineWidth / 2],
[model.x + style[this._subType].length, model.y - style[this._subType].lineWidth / 2],
[model.x + style[this._subType].length, model.y + style[this._subType].lineWidth / 2],
[model.x + style[this._subType].triangleLength, model.y + style[this._subType].lineWidth / 2],
[model.x + style[this._subType].triangleLength, model.y + style[this._subType].triangleLength / 2]
]
},
style: {
fill: style.PickOrDepartArrow.fill,
stroke: style.PickOrDepartArrow.stroke,
fill: style[this._subType].fill,
stroke: style[this._subType].stroke,
lineWidth: 1
}
});
@ -39,13 +39,13 @@ export default class EPickOrDepartArrow extends Group {
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + style.PickOrDepartArrow.length / 2,
y: model.y + style.PickOrDepartArrow.distance,
x: model.x + style[this._subType].length / 2,
y: model.y + style[this._subType].distance,
fontWeight: style.textStyle.fontWeight,
fontSize: style.PickOrDepartArrow.fontSize,
fontSize: style[this._subType].fontSize,
fontFamily: style.fontFamily,
text: model.text,
textFill: style.PickOrDepartArrow.defaultColor,
textFill: style[this._subType].defaultColor,
textAlign: style.textStyle.textAlign,
textVerticalAlign: style.textStyle.textVerticalAlign
}
@ -58,9 +58,9 @@ export default class EPickOrDepartArrow extends Group {
if (color) {
const style = this.model.style;
this.arrow.animateStyle(true)
.when(0, { fill: style.PickOrDepartArrow.fill })
.when(0, { fill: style[this._subType].fill })
.when(1000, { stroke: color })
.when(2000, { fill: style.PickOrDepartArrow.fill })
.when(2000, { fill: style[this._subType].fill })
.start();
}
}
@ -68,7 +68,7 @@ export default class EPickOrDepartArrow extends Group {
recover() {
const style = this.model.style;
this.arrow.stopAnimation(false);
this.arrow.setStyle('fill', style.PickOrDepartArrow.fill);
this.arrow.setStyle('fill', style[this._subType].fill);
}
setControlColor(color) {

View File

@ -179,7 +179,7 @@ export default class SaidLamp extends Group {
_subType: 'IndicatorLight'
});
this.add(this.control);
} else if (this._type === 'PickOrDepartArrow') {
} else if (this._type === 'PickArrow'|| this._type === 'DepartArrow') {
this.control = new EPickOrDepartArrow({
zlevel: this.zlevel,
z: this.z,
@ -188,7 +188,7 @@ export default class SaidLamp extends Group {
text: model.name,
right: model.right,
style: this.style,
_subType: 'PickOrDepartArrow'
_subType: this._type
});
this.add(this.control);
}
@ -201,7 +201,7 @@ export default class SaidLamp extends Group {
this.control && this.control.hide();
} else {
// 区段占用,辅助状态,接发车箭头
const datieType = [deviceType.SectionOccupied, deviceType.AssistStatus, deviceType.PickOrDepartArrow];
const datieType = [deviceType.SectionOccupied, deviceType.AssistStatus, deviceType.PickArrow ,deviceType.DepartArrow];
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);
@ -213,7 +213,7 @@ export default class SaidLamp extends Group {
this.control && this.control.setControlFlashing('#FFFFFF');
} else {
let defalutColor;
if (model._type == deviceType.PickOrDepartArrow) {
if (model._type == deviceType.PickArrow || model._type == deviceType.DepartArrow) {
defalutColor = this.deviceStyle.fill;
} else {
defalutColor = this.deviceStyle.lamp.controlColor;

View File

@ -71,6 +71,70 @@ export default class SignalButton extends Group {
});
this.add(this.rightLine);
this.rightLine.hide();
this.leftBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y - 1,
x2: model.position.x - 1,
y2: model.position.y + 16
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.add(this.leftBoard);
this.leftBoard.hide();
this.topBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y - 1,
x2: model.position.x + 16,
y2: model.position.y - 1
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.add(this.topBoard);
this.topBoard.hide();
this.rightBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x + 16,
y1: model.position.y - 1,
x2: model.position.x + 16,
y2: model.position.y + 16
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
this.add(this.rightBoard);
this.rightBoard.hide();
this.bottomBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y + 16,
x2: model.position.x + 16,
y2: model.position.y + 16,
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
this.add(this.bottomBoard);
this.bottomBoard.hide();
const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION'];
if (hasTextList.includes(model.type)) {
this.buttonText = new Text({
@ -132,7 +196,7 @@ export default class SignalButton extends Group {
color = '#008000';
}
return color;
}// 12
}//
recover() {
this.stopAnimation();
this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() });
@ -140,6 +204,9 @@ export default class SignalButton extends Group {
this.leftLine && this.leftLine.hide();
this.rectButton && this.rectButton.show();
this.buttonText && this.buttonText.show();
// this.leftBoard && this.leftBoard.show();
// this.rightBoard && this.rightBoard.show();
// this.top
}
blockShow() {
this.rightLine && this.rightLine.show();

View File

@ -77,7 +77,8 @@ mapShape[deviceType.ReturnModeGroup] = SaidLamp;
mapShape[deviceType.Axle] = SaidLamp;
mapShape[deviceType.SwitchFault] = SaidLamp;
mapShape[deviceType.IndicatorLight] = SaidLamp;
mapShape[deviceType.PickOrDepartArrow] = SaidLamp;
mapShape[deviceType.PickArrow] = SaidLamp;
mapShape[deviceType.DepartArrow] = SaidLamp;
mapShape[deviceType.Occlusion] = SaidLamp;
mapShape[deviceType.Accident] = SaidLamp;
mapShape[deviceType.Recovery] = SaidLamp;

View File

@ -431,7 +431,6 @@ export default {
}
this.deviceTimeNode = this.$store.state.socket.simulationTimeSync;
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].signalCode || deviceList[0].code);// deviceList[0] SignalButton || Signal
console.log(deviceList, signal, '***************');
if (deviceList.length === 1 && !signal.routeLock) { //
operate.code = deviceList[0].code;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {

View File

@ -0,0 +1,708 @@
<template>
<div v-if="isShowBtn" id="menuButtons_box" class="menu menuButton" style="height: 35px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button :id="Signal.arrangementRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.arrangementRoute.button.operation, ['Signal'])">
<span style="color: black">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="MixinCommand.totalCancel.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.totalCancel.button.operation, ['Signal','SignalButton'])">
<span style="color: black;">
<center><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Signal.reopenSignal.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.reopenSignal.button.operation, ['Signal'])">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Station.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor: guideLockLeftFlag? guideColorDown: guideColorUp}" @click="guideLockLeftButtonDown()">
<span style="color: #800000">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, ['Signal','SignalButton'])">
<span style="color: #800000">
<center><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Switch.locate.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.locate.button.operation, ['Switch'])">
<span style="color: black">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Switch.reverse.button.domId" class="button_box" :style="{width: width+'px',backgroundColor:buttonUpColor}" @click="buttonDown(Switch.reverse.button.operation, ['Switch'])">
<span style="color: black">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Switch.lock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.lock.button.operation, ['Switch'])">
<span style="color: black">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, ['Switch'])">
<span style="color: black">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="MixinCommand.block.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.lock.button.operation, ['Switch', 'Signal'])">
<span style="color: black">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="MixinCommand.functionButton.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.functionButton.button.operation, ['StationStand', 'Station'])">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown()">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :disabled="true" :id="" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown()">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="Command.cancel.clearMbm.domId" class="button_box" :style="{width:width+'px',backgroundColor:buttonUpColor}" @click="buttonDown(Command.cancel.clearMbm.operation)">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown()">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="" class="button_box" :style="{width: width+'px', backgroundColor: buttonUpColor}" @click="buttonDown()">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="" class="button_box" :style="{width: width+'px', backgroundColor: buttonUpColor}" @click="buttonDown()">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<password-box ref="password" @checkOver="passWordCommit" @checkCancel="clearOperate" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import Handler from '@/scripts/cmdPlugin/Handler';
import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { MouseEvent } from '@/scripts/ConstDic';
import CenterConfig from '../../../../views/newMap/newMapdraft/mapoperate/displayConfig/centerConfig';
// import { OperateMode } from '@/scripts/ConstDic';564
export default {
name: 'MapButtonMenu',
components: {
CenterConfig,
PasswordBox,
NoticeInfo
},
props: {
selected: {
type: Object,
default: () => {
return null;
}
}
},
data() {
return {
point: {
x: 0,
y: 0
},
operation: '0',
buttonName: '',
guideColorDown: '#FEEE1A',
guideColorUp: '#DCDCDC',
buttonDownColor: '#FEEE1A',
buttonUpColor: '#DCDCDC',
width: 78,
tempData: null,
offset: {},
commandTypeList: [],
cmdTypeList: [],
deviceList: [],
timeNode: 0, // 15
deviceTimeNode: 0, // 15
routeDataMap: null, // btnCodeList key
routeButtonCodeList: [], // btnCodeList code list
guideLockRightFlag: false,
guideLockLeftFlag: false
};
},
computed: {
...mapGetters('training', [
'operatemode'
]),
...mapGetters('map', [
'routeList',
'routeData',
'signalList',
'autoReentryList',
'autoReentryData'
]),
Switch() {
return OperationEvent.Switch;
},
Section() {
return OperationEvent.Section;
},
Station() {
return OperationEvent.Station;
},
Signal() {
return OperationEvent.Signal;
},
CTCCommand() {
return OperationEvent.CTCCommand;
},
MixinCommand() {
return OperationEvent.MixinCommand;
},
Command() {
return OperationEvent.Command;
},
isShowBtn() {
return this.$store.state.training.prdType == '01' || this.$store.state.training.prdType == '10';
},
CMD() {
return CMD;
},
cmdType() {
switch (this.operation) {
case this.Switch.lock.button.operation: //
return CMD.Switch.CMD_SWITCH_SINGLE_LOCK;
case this.Switch.unlock.button.operation: //
return CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
case this.Switch.locate.button.operation: //
return CMD.Switch.CMD_SWITCH_NORMAL_POSITION;
case this.Switch.reverse.button.operation: //
return CMD.Switch.CMD_SWITCH_REVERSE_POSITION;
case this.Switch.block.button.operation: //
return CMD.Switch.CMD_SWITCH_BLOCK;
case this.Switch.unblock.button.operation:
return CMD.Switch.CMD_SWITCH_UNBLOCK;
case this.Section.fault.button.operation: //
return CMD.Section.CMD_SECTION_FAULT_UNLOCK;
case this.Signal.humanTrainRoute.button.operation: // ()
return CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
case this.Signal.arrangementRoute.button.operation: //
return CMD.Signal.CMD_SIGNAL_SET_ROUTE;
case this.Signal.guide.button.operation: //
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
}
return '';
}
},
watch: {
'$store.state.menuOperation.buttonOperation': function (val, old) {
this.updateButtonShow(val, old);
},
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
},
'$store.state.map.clearButtonCount': function(val) {
this.commandTypeList = [];
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.clearOperate();
this.guideLockRightFlag = false;
this.guideLockLeftFlag = false;
},
'$store.state.socket.simulationTimeSync': function (val) {
if (this.timeNode && val - this.timeNode >= 15) {
this.clearOperate();
}
if (this.deviceTimeNode && val - this.deviceTimeNode >= 15) {
if (this.deviceList && this.deviceList.length && this.deviceList[0]._type === 'SignalButton') {
this.$store.dispatch('training/updateMapState', [{code: this.deviceList[0].code, _type: 'SignalButton', hasSelected: 0}]);
} else if (this.deviceList && this.deviceList.length && this.deviceList[0]._type === 'Signal' && this.deviceList[0].type === 'SHUNTING') {
this.$store.dispatch('training/updateMapState', [{code: this.deviceList[0].code, _type: 'Signal', hasSelected: 0}]);
}
this.deviceList = [];
}
}
},
beforeDestroy() {
this.routeDataMap = null;
this.routeButtonCodeList = [];
},
methods: {
//
passWordCommit(data) {
let operate = {};
if (data.nextCmdType) {
operate = {
over: true,
operation: data.operation,
cmdType: data.nextCmdType,
param: data.param
};
} else {
operate = {
operationPre: data.operation,
operation: data.operateNext
};
}
this.trainingOperation(operate);
},
//
trainingOperation(operate) {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
/* 引导总锁输入面后 处理按钮选中状态 */
if (operate.operationPre === this.Switch.guideLock.leftButton.operation || operate.operation === this.Switch.guideLock.leftButton.operation) {
this.guideLockLeftFlag = !this.guideLockLeftFlag;
} else if (operate.operationPre === this.Switch.guideLock.rightButton.operation || operate.operation === this.Switch.guideLock.rightButton.operation) {
this.guideLockRightFlag = !this.guideLockRightFlag;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
updateButtonShow(val, old) {
if (old) {
//
const domId = OperationHandler.getDomIdByOperation(old);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = false;
dom.style.backgroundColor = this.buttonUpColor;
}
}
if (val) {
//
const domId = OperationHandler.getDomIdByOperation(val);
const dom = document.getElementById(domId);
if (dom) {
dom.disabled = true;
dom.style.backgroundColor = this.buttonDownColor;
}
}
},
// S
guideLockLeftButtonDown() {
const operate = {
operation: this.Switch.guideLock.leftButton.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
if (this.guideLockRightFlag) {
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: false};
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
});
},
// X
guideLockRightButtonDown() {
const operate = {
operation: this.Switch.guideLock.rightButton.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
if (this.guideLockRightFlag) {
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: true};
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
});
},
buttonDown(operation, commandTypeList) {
this.clearOperate();
if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
operation: operation
};
//
const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.operation = operation;
this.commandTypeList = commandTypeList;
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
//
if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
this.timeNode = this.$store.state.socket.simulationTimeSync;
this.$store.dispatch('training/emitTipFresh');
}
});
} else {
//
const operate = {
start: true,
operation: operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.commandTypeList = [];
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
});
}
},
//
handleRouteDataMap() {
this.routeDataMap = {};
this.routeButtonCodeList = [];
this.routeList.forEach(item => {
const name = item.btnCodeList.join('-');
this.routeDataMap[name] = item;
this.routeButtonCodeList.push(name);
});
},
// code
checkHaveRoute(deviceList) {
let name = '';
deviceList.forEach((device, index) =>{
name = name + (index ? '-' : '') + device.code;
});
return this.routeButtonCodeList.some(item => item.includes(name));
},
// OR
arrangementRouteOperation(deviceList) {
const operate = {
operation: this.Signal.arrangementRoute.button.operation
};
if (!this.routeDataMap) { this.handleRouteDataMap(); }
if (!this.checkHaveRoute(deviceList)) { // deviceList
this.$message.error('无效的进路按钮');
this.clearOperate();
return;
}
this.deviceTimeNode = this.$store.state.socket.simulationTimeSync;
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].signalCode || deviceList[0].code);// deviceList[0] SignalButton || Signal
console.log(deviceList, signal, '***************');
if (deviceList.length === 1 && !signal.routeLock) { //
operate.code = deviceList[0].code;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
//
if (deviceList[0]._type === 'SignalButton' || (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING')) {
this.$store.dispatch('training/updateMapState', [{code: deviceList[0].code, _type: deviceList[0]._type, hasSelected: 1}]);
}
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
} else if (deviceList.length === 1 && signal.routeLock) { //
operate.operation = this.Signal.reopenSignal.button.operation;
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
operate.code = signal.code;
operate.param = {signalCode: signal.code};
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {
this.clearOperate();
}).catch(() => this.$refs.noticeInfo.doShow() );
} else if (deviceList.length > 1) {
let key = '';
deviceList.forEach((item, index) => {
key = key + (index ? '-' : '') + item.code;
});
const route = this.routeDataMap[key];
if (route) {
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
operate.code = deviceList[deviceList.length - 1].code;
operate.param = {routeCode: route.code};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.deviceTimeNode = 0;
}).catch(() => {
this.deviceTimeNode = 0;
this.$refs.noticeInfo.doShow();
}).finally(() => { this.clearOperate(); });
}
}
},
//
handelTotalCancel(model) {
const operate = {
over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
param: {
signalCode: model._type === 'Signal' ? model.code : model.signalCode
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.clearOperate();
}).catch((error) => {
this.clearOperate();
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
handleGuideSignal(model) {
const operate = {
over: true,
code: model.code,
operation: this.Signal.guide.button.operation,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
param: {signalCode: model.signalCode}
};
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode);
// 15s
if (signal.guideTime) {
this.sendCommand(operate);
} else {
operate.nextCmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
this.$refs.password.doShow(operate);
}
},
//
handleTotalHumanSolution(model) {
const operate = {
over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
val: model.code,
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
};
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code);
if (model._type === 'SignalButton' && model.type === 'PICK' && signal.routeLock) {
operate.param = {signalCode: model.signalCode};
this.sendCommand(operate);
} else if (model._type === 'Signal' && model.type === 'SHUNTING' && signal.routeLock) {
operate.param = {signalCode: model.code};
this.sendCommand(operate);
}
},
handelSwitchOperate(model) {
const operate = {
over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
param: { switchCode: model.code}
};
this.sendCommand(operate);
},
//
sendCommand(operate) {
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
}).finally(() =>{ this.clearOperate(); });
},
// ()
checkHasTrainButton(model) {
if (model.signalButtonList && model.signalButtonList.length > 0) {
let flag = false;
model.signalButtonList.forEach(item => {
const signalButton = this.$store.getters['map/getDeviceByCode'](item);
flag = flag || signalButton.type === 'PICK';
});
return flag;
} else {
return false;
}
},
handelSignalBlockOrUnblock(model) {
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
const operate = {
over: true,
code: model.code,
operation: buttonOperation,
cmdType: '',
param: {}
};
if (model._type === 'Signal' && !this.checkHasTrainButton(model)) {
if (buttonOperation === this.Signal.lock.button.operation) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK;
operate.param = {signalCode: model.code};
} else if (buttonOperation === this.Signal.unlock.button.operation) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
operate.param = {signalCode: model.code};
}
} else if (model._type === 'SignalButton' && model.type === 'PICK') {
if (buttonOperation === this.Signal.lock.button.operation) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK;
operate.param = {signalCode: model.signalCode};
} else if (buttonOperation === this.Signal.unlock.button.operation) {
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
operate.param = {signalCode: model.signalCode};
}
}
this.sendCommand(operate);
},
handleGuideLock(model) {
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode);
if (signal && (this.guideLockRightFlag && signal.right) || (this.guideLockLeftFlag && !signal.right)) {
const operate = {
over: true,
code: model.code,
operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton,
nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK,
param: {signalCode: model.signalCode}
};
this.$refs.password.doShow(operate);
}
},
handelFaultSection(model) {
if (model._type === 'Section') {
const operate = {
over: true,
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
param: {sectionCode: model.code}
};
this.sendCommand(operate);
}
},
// CHANGE_DIRECTION
selectedChange() {
//
const model = this.selected; //
if ((this.$store.state.training.prdType != '01' && this.$store.state.training.prdType != '10') || this.selected._event !== MouseEvent.Left || (!model._type && !model._code)) {
return;
}
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
const switchOperation = [
this.Switch.lock.button.operation,
this.Switch.unlock.button.operation,
this.Switch.locate.button.operation,
this.Switch.reverse.button.operation,
this.Switch.block.button.operation,
this.Switch.unblock.button.operation
];
if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') {
this.handleGuideLock(model);
} else if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
this.handelTotalCancel(model);
} else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) {
this.handleTotalHumanSolution(model);
} else if (switchOperation.includes(buttonOperation)) {
this.handelSwitchOperate(model);
} else if (buttonOperation === this.Signal.lock.button.operation || buttonOperation === this.Signal.unlock.button.operation) {
this.handelSignalBlockOrUnblock(model);
} else if (buttonOperation === this.Section.fault.button.operation) {
this.handelFaultSection(model);
} else {
this.clearOperate();
}
} else if (!buttonOperation) {
if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE' ) {
this.handleGuideSignal(model);
} else if (model._type === 'SignalButton' && model.type === 'CHANGE_DIRECTION') {
//
this.changeDirection(model);
} else if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) || (model._type === 'Signal' && !model.blockade)) {
this.deviceList.push(model);
this.arrangementRouteOperation(this.deviceList);
} else {
this.clearOperate();
}
} else { this.clearOperate(); }
if (this.timeNode) { this.timeNode = 0; }
},
checkSignalBlock(code) { //
if (code) {
const signal = this.$store.getters['map/getDeviceByCode'](code);
return signal && signal.blockade;
} else { return false; }
},
clearOperate() { //
this.deviceList && this.deviceList.length && this.$store.dispatch('training/updateMapState', [{code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0}]);
this.deviceList = [];
Handler.clear(); //
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
changeDirection(model) {
const operate = {
over: true,
code: model.code,
operation: this.CTCCommand.assistPressDownTurnDirection.menu.operation,
cmdType: CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION,
param: {
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
// this.clearOperate();
}).catch((error) => {
// this.clearOperate();
console.error(error);
this.$refs.noticeInfo.doShow();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg: #fff;
$hoverBg: #FEEE1A;
.button_box{
display: block;
float: left;
font-size: 13px;
height: 35px;
}
.menu {
background-color: $bg;
position: fixed;
border: 1px solid gray;
z-index: 10;
display: block;
.dsp-block {
display: block;
text-align: center;
border-radius: unset;
width: 100%;
}
.dsp-block:hover {
background-color: $hoverBg;
}
}
</style>

View File

@ -90,7 +90,7 @@ class Theme {
'13':'all',
'14':'ecStation',
'15':'all',
'16':'all'
'16':'ecStation'
};
}

View File

@ -317,7 +317,7 @@
if (flag){
return '#29CA42';
} else {
return trigger ? '#FFBF2F' : '#CCCCCC'
return trigger ? '#FFBF2F' : '#CCCCCC';
}
},
doShowRecDep(row, type) {
@ -327,7 +327,6 @@
this.$refs.routeSelection.doShow(row, type, this.selectCode);
},
popMenuShow(item,type, e){
console.log(e,item, '====');
if (type === 'rec') {
this.menu[0].disabled = item.receivingRouteAutoTrigger;
this.menu[1].disabled = !item.receivingRouteAutoTrigger;

View File

@ -312,6 +312,7 @@ export default {
const lineCode = this.$store.state.map.map.skinVO.code;
if (Vue.prototype.$theme) {
this.localStationShow = Vue.prototype.$theme._localShowMode[lineCode] === 'ecStation';
console.log(this.localStationShow, '============');
}
this.$store.dispatch('map/setTrainWindowShow', this.previewOrMapDraw);
},
@ -498,7 +499,7 @@ export default {
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
console.log(list, stationCode, '=============');
this.$jlmap.updateShowStation(list, stationCode);
!setCenter && stationCode && this.setCenter(stationCode);
},

View File

@ -185,7 +185,7 @@
setSelected(selected) {
if (selected) {
const deviceTypeList = ['SectionOccupied'.toUpperCase(), 'AssistStatus'.toUpperCase(), 'TotalAssist'.toUpperCase(), 'DepartAssist'.toUpperCase(),
'PickAssist'.toUpperCase(), 'PickOrDepartArrow'.toUpperCase(),
'PickAssist'.toUpperCase(), 'DepartArrow'.toUpperCase(),'PickArrow'.toUpperCase(),
'SignalButton'.toUpperCase()];
if (deviceTypeList.includes(selected._type.toUpperCase()) && this.field.toUpperCase() === 'code'.toUpperCase()) {
this.addModel.code = selected.code;

View File

@ -57,7 +57,7 @@
@mouseenter="mouseenter(nor)"
@mouseleave="mouseleave(nor)"
>
<div class="name">{{ nor.name }}</div>
<div class="name">{{ nor.name || nor.code }}</div>
<div class="close" @click="delList(nor, item.list)"><i class="el-icon-close" /></div>
</div>
</div>
@ -119,6 +119,11 @@ export default {
type: 'Signal',
name: '信号机列表',
list: []
},
{
type: 'SignalButton',
name: '信号按钮列表',
list: []
}
]
};
@ -156,6 +161,8 @@ export default {
this.modelList[1].list.push(item);
} else if (item._type == 'Signal') {
this.modelList[2].list.push(item);
} else if (item._type == 'SignalButton') {
this.modelList[3].list.push(item);
}
if (item.stationCode == this.seclectDeviceList[0].stationCode) {
count++;
@ -317,6 +324,11 @@ export default {
type: 'Signal',
name: '信号机列表',
list: []
},
{
type: 'SignalButton',
name: '信号按钮列表',
list: []
}
];
},

View File

@ -99,7 +99,8 @@ export default {
'Recovery',
'Accident',
'Occlusion',
'PickOrDepartArrow'
'PickArrow',
'DepartArrow'
],
noNameTypeList: ['FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle'],
typeList: [
@ -130,9 +131,10 @@ export default {
{ name: '复原', value: 'Recovery' },
{ name: '事故', value: 'Accident' },
{ name: '闭塞', value: 'Occlusion' },
{ name: '接发车箭头', value: 'PickOrDepartArrow' }
{ name: '接车箭头', value: 'PickArrow' },
{ name: '发车箭头', value: 'DepartArrow' }
],
hasDirectionList: ['SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist', 'Recovery', 'Accident', 'Occlusion', 'PickOrDepartArrow'],
hasDirectionList: ['SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist', 'Recovery', 'Accident', 'Occlusion', 'PickArrow', 'DepartArrow'],
directionList: [{label: 'X',value: 'X'},{label: 'XF',value: 'XF'},{label: 'XD',value: 'XD'}, {label:'S',value:'S'},{label:'SF',value:'SF'},{label:'SD',value: 'SD'}],
editModel:getModel('ControlLamp'),
addModel:getModel('ControlLamp'),
@ -165,7 +167,7 @@ export default {
] },
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup'},
{ prop: 'right', label: '朝右:', type: 'checkbox', isHidden: this.editModel.type !== 'PickOrDepartArrow' },
{ prop: 'right', label: '朝右:', type: 'checkbox', isHidden: this.editModel.type !== 'DepartArrow' && this.editModel.type !== 'PickArrow' },
{ prop: 'labelEnum', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.editModel.type) },
{ prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.editModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType },
{ prop:'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList}
@ -292,7 +294,8 @@ export default {
this.RecoveryList = [];
this.AccidentList = [];
this.OcclusionList = [];
this.PickOrDepartArrowList = [];
this.DepartArrowList = [];
this.PickArrowList = [];
indicatorLightList.forEach(item => {
switch (item._type) {
case 'AtsControl':
@ -376,8 +379,11 @@ export default {
case 'Occlusion':
this.OcclusionList.push(item);
break;
case 'PickOrDepartArrow':
this.PickOrDepartArrowList.push(item);
case 'PickArrow':
this.PickArrowList.push(item);
break;
case 'DepartArrow':
this.DepartArrowList.push(item);
break;
}
});
@ -465,8 +471,11 @@ export default {
case 'Occlusion':
this.selectLists = this.OcclusionList;
break;
case 'PickOrDepartArrow':
this.selectLists = this.PickOrDepartArrowList;
case 'PickArrow':
this.selectLists = this.PickArrowList;
break;
case 'DepartArrow':
this.selectLists = this.DepartArrowList;
break;
default :
this.selectLists = this.intersiteControlList;
@ -577,8 +586,11 @@ export default {
case 'Occlusion':
idPrefix = 'occlusion';
break;
case 'PickOrDepartArrow':
idPrefix = 'podArrow'
case 'PickArrow':
idPrefix = 'pickArrow';
break;
case 'DepartArrow':
idPrefix = 'departArrow';
break;
}
return idPrefix;

View File

@ -211,7 +211,7 @@ export default {
const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain',
'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament',
'ReturnModeGroup', 'ControlSwitch', 'Axle', 'IndicatorLight', 'SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist',
'Recovery', 'Accident', 'Occlusion', 'PickOrDepartArrow'];
'Recovery', 'Accident', 'Occlusion', 'PickArrow' ,'DepartArrow'];
const type = device._type;
if (this.selectDevice) {
this.enabledTab = this.selectDevice;