卡斯柯线路调整

This commit is contained in:
fan 2022-08-16 17:31:21 +08:00
parent 6b4b63fc40
commit 954f388c3a
12 changed files with 283 additions and 162 deletions

View File

@ -264,7 +264,9 @@ class SkinCode extends defaultStyle {
showName: true,
selectColor: '#0000ff',
flashingColor: '#ffff00',
countOffset: { x: 0, y: -15 }
countOffset: { x: 0, y: -15 },
typeList: ['PICK_ASSIST', 'DEPART_ASSIST', 'ASSIST', 'GUIDELOCK', 'SECTION_FAULT_UNLOCK', 'LOCATE', 'REVERSE', 'CANCEL', 'HUMAN_RELEASE_ROUTE', 'MONOLOCK',
'UNLOCK', 'BLOCK', 'UNBLOCK', 'CHANGE_DIRECTION', 'ACCIDENT', 'RECOVERY', 'OCCLUSION', 'FAULT_NOTICE', 'GUIDE']
};
this[deviceType.SwitchFault] = {
text: {
@ -1186,6 +1188,10 @@ class SkinCode extends defaultStyle {
lineWidth: 3
}
};
this[deviceType.Counter] = {
fontSize: 11,
defaultColor: '#fff'
};
}
}

View File

@ -343,4 +343,8 @@ deviceRender[deviceType.NoStatusLamp] = {
_type: deviceType.NoStatusLamp,
zlevel: 1
};
deviceRender[deviceType.Counter] = {
_type: deviceType.Counter,
zlevel: 1
};
export default deviceRender;

View File

@ -62,6 +62,7 @@ const deviceType = {
AssistStatus: 'AssistStatus',
SectionOccupied: 'SectionOccupied',
ThroatRoute: 'ThroatRoute',
NoStatusLamp: 'NoStatusLamp'
NoStatusLamp: 'NoStatusLamp',
Counter: 'Counter'
};
export default deviceType;

View File

@ -361,6 +361,7 @@ export function updateMapData(state, model) {
case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.ThroatRoute: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.NoStatusLamp: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.Counter: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
case deviceType.Power: updateForList(model, state, 'powerLineList'); break;

View File

@ -0,0 +1,57 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
export default class ECounter extends Group {
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this._subType = model._subType;
this.z = model.z;
this.onmouseover = model.mouseover;
this.onmouseout = model.mouseout;
this.create(model);
}
create(model) {
const style = model.style;
this.counter = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x,
y: model.y,
fontWeight: style.textStyle.fontWeight,
fontSize: style.Counter.fontSize,
fontFamily: style.fontFamily,
text: '000',
textFill: style.Counter.defaultColor,
textAlign: style.textStyle.textAlign,
textVerticalAlign: style.textStyle.textVerticalAlign
}
});
this.name = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x,
y: model.y + 20,
fontWeight: style.textStyle.fontWeight,
fontSize: style.Counter.fontSize,
fontFamily: style.fontFamily,
text: model.text,
textFill: style.Counter.defaultColor,
textAlign: style.textStyle.textAlign,
textVerticalAlign: style.textStyle.textVerticalAlign
}
});
this.add(this.counter);
this.add(this.name);
}
recover() {
}
show() {}
setCount(count) {
this.counter && this.counter.setStyle({ text: count || '000' });
}
}

View File

@ -11,6 +11,7 @@ import EUnmanned from './EUnmanned';
import EAxle from './EAxle';
import EIndicatorLight from './EIndicatorLight';
import EPickOrDepartArrow from './EPickOrDepartArrow';
import ECounter from './ECounter';
import store from '@/store/index';
export default class SaidLamp extends Group {
@ -199,6 +200,17 @@ export default class SaidLamp extends Group {
_subType: this._type
});
this.add(this.control);
} else if (this._type === 'Counter' && this.style.Counter) {
this.control = new ECounter({
zlevel: this.zlevel,
z: this.z,
x: this.computedPosition.x,
y: this.computedPosition.y,
text: model.name,
style: this.style,
_subType: this._type
});
this.add(this.control);
}
}
@ -284,6 +296,8 @@ export default class SaidLamp extends Group {
}
}
}
} else if (model._type === deviceType.Counter) {
this.control && this.control.setCount(model.count);
}
}
}

View File

@ -42,6 +42,7 @@ export default class SignalButton extends Group {
this.model = model;
this.style = style;
this.pressed = false;
this.typeList = this.style.SignalButton.typeList || typeList;
// Line
this.create();
this.setState(model);
@ -51,7 +52,7 @@ export default class SignalButton extends Group {
const model = this.model;
const computedPosition = this.computedPosition;
const fillColor = this.getTypeColor();
if (this.style.SignalButton && this.style.SignalButton.shape === 'roundWithDock' && typeList.includes(model.type)) {
if (this.style.SignalButton && this.style.SignalButton.shape === 'roundWithDock' && this.typeList.includes(model.type)) {
const circle1 = new Circle({
zlevel: this.zlevel,
z: this.z + 2,
@ -277,7 +278,7 @@ export default class SignalButton extends Group {
this.rectButton && this.rectButton.stopAnimation(true);
}
getTypeColor() {
if (this.style.SignalButton && this.style.SignalButton.fillColor && typeList.includes(this.model.type)) {
if (this.style.SignalButton && this.style.SignalButton.fillColor && this.typeList.includes(this.model.type)) {
return this.style.SignalButton.fillColor;
}
let color = '';

View File

@ -89,6 +89,7 @@ mapShape[deviceType.AssistStatus] = SaidLamp;
mapShape[deviceType.SectionOccupied] = SaidLamp;
mapShape[deviceType.ThroatRoute] = SaidLamp;
mapShape[deviceType.NoStatusLamp] = SaidLamp;
mapShape[deviceType.Counter] = SaidLamp;
mapShape[deviceType.SplitStation] = SplitStation;
mapShape[deviceType.Arrow] = Arrow;
mapShape[deviceType.Power] = Power;

View File

@ -36,7 +36,7 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="Station.guideLock.button.domId" :disabled="true" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['SignalButton'])">
<button :id="Station.guideLock.button.domId" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['SignalButton'])">
<span :style="{color: operation === Station.guideLock.button.operation?'#ccc':'black'}">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
@ -72,22 +72,28 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="MixinCommand.block.button.domId" class="button_box" @click="buttonDown(MixinCommand.lock.button.operation, ['Switch', 'Signal'])">
<button :id="MixinCommand.block.button.domId" class="button_box" @click="buttonDown(MixinCommand.block.button.operation, ['Switch', 'Signal', 'Section'])">
<span :style="{color: operation === MixinCommand.block.button.operation ? '#ccc':'black'}">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="333" :disabled="true" class="button_box" @click="buttonDown()">
<span style="color: black;">
<button :id="Section.fault.button.domId" class="button_box" @click="buttonDown(Section.fault.button.operation, ['Section'])">
<span :style="{color: operation === Section.fault.button.operation ? '#ccc':'black'}">
<center><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :id="444" :disabled="true" class="button_box" @click="buttonDown()">
<button :id="MixinCommand.functionButton.button.domId" class="button_box" @click="buttonDown(MixinCommand.functionButton.button.operation, ['SignalButton'])">
<span style="color: black;">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
<center>
<b :style="{color: operation === MixinCommand.functionButton.button.operation ? '#ccc':'#000080'}"></b>
<b :style="{color: operation === MixinCommand.functionButton.button.operation ? '#ccc':'#8A1715'}"></b>
</center>
<center>
<b :style="{color: operation === MixinCommand.functionButton.button.operation ? '#ccc':'#FF00FF'}"></b>
<b :style="{color: operation === MixinCommand.functionButton.button.operation ? '#ccc':'#038103'}"></b>
</center>
</span>
</button>
<button :id="555" :disabled="true" class="button_box" @click="buttonDown()">
@ -179,8 +185,6 @@ export default {
deviceTimeNode: 0, // 15
routeDataMap: null, // btnCodeList key
routeButtonCodeList: [], // btnCodeList code list
guideLockRightFlag: false,
guideLockLeftFlag: false,
displayFlags: {
chineseCharacter: true,
buttonName: true,
@ -267,8 +271,6 @@ export default {
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) {
@ -359,27 +361,14 @@ export default {
},
//
trainingOperation(operate) {
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
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 });
if (operate.over) { this.clearOperate(); }
}
})
.catch(error => {
}).catch(error => {
console.error(error);
this.clearOperate();
this.$refs.noticeInfo.doShow();
});
},
@ -413,17 +402,15 @@ export default {
code: this.$store.state.map.showCentralizedStationCode,
param: { stationCode: this.$store.state.map.showCentralizedStationCode }
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.clearOperate();
} else {
this.$refs.noticeInfo.doShow();
}
})
.catch(error => {
}).catch(error => {
console.error(error);
this.clearOperate();
this.$refs.noticeInfo.doShow();
});
},
@ -446,13 +433,18 @@ export default {
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Section.defectiveShunting.button.operation,
this.Signal.guide.button.operation
this.Signal.guide.button.operation,
this.Station.guideLock.button.operation,
this.Switch.unlock.button.operation,
this.Switch.lock.button.operation,
this.MixinCommand.block.button.operation
];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.operation = operation;
this.commandTypeList = commandTypeList;
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
console.log(operation, this.$store.state.menuOperation.buttonOperation, '--------');
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
//
if (operationList.includes(operation)) {
@ -473,7 +465,6 @@ export default {
if (valid) {
this.commandTypeList = [];
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.guideLockRightFlag = false;
}
});
}
@ -506,7 +497,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.clearOperate();
}).catch(() => this.$refs.noticeInfo.doShow());
}).catch(() => { this.$refs.noticeInfo.doShow(); this.clearOperate(); });
},
// OR
arrangementRouteOperation(deviceList) {
@ -528,9 +519,7 @@ export default {
if (deviceList.length === 1 && !signal.lockedRouteCode) {
//
operate.code = deviceList[0].code;
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid, response }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
//
if (deviceList[0]._type === 'SignalButton' || (deviceList[0]._type === 'Signal' && deviceList[0].type === 'SHUNTING')) {
@ -547,9 +536,9 @@ export default {
this.$store.dispatch('training/updateMapState', updateList);
}
}
})
.catch(() => {
}).catch(() => {
this.$refs.noticeInfo.doShow();
this.clearOperate();
});
} else if (deviceList.length > 1) {
let key = '';
@ -606,7 +595,7 @@ export default {
code: model.code,
operation: this.Signal.guide.button.operation,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
param: { signalCode: model.signalCode }
param: { signalCode: model.signalCode, _COUNT: model.code }
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.$store.dispatch('training/updateMapState', [{ code: model.code, _type: model._type, toSelected: 1 }]);
@ -629,10 +618,10 @@ export default {
// const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code);
console.log(model._type, model.type, '8888888');
if (model._type === 'SignalButton' && model.type === 'PICK') {
operate.param = { signalCode: model.signalCode };
operate.param = { signalCode: model.signalCode, _COUNT: 'HumanSolution' };
this.sendCommand(operate);
} else if (model._type === 'Signal' && model.type === 'SHUNTING') {
operate.param = { signalCode: model.code };
operate.param = { signalCode: model.code, _COUNT: 'HumanSolution' };
this.sendCommand(operate);
}
},
@ -716,11 +705,18 @@ export default {
const operate = {
operation: this.Station.guideLock.button.operation
};
const device = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
let nextCmdType = '';
if (model.labelEnum === 'X') {
nextCmdType = device.xGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
} else if (model.labelEnum === 'S') {
nextCmdType = device.sGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
operate.nextCmdType = this.xGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
operate.param = { throat: model.labelEnum, stationCode: this.$store.state.map.showCentralizedStationCode };
operate.nextCmdType = nextCmdType;
operate.param = { throat: model.labelEnum, stationCode: this.$store.state.map.showCentralizedStationCode, _COUNT: model.code };
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
@ -734,7 +730,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
param: { sectionCode: model.code }
param: { sectionCode: model.code, _COUNT: 'FaultSection' }
};
this.sendCommand(operate);
}
@ -747,11 +743,7 @@ export default {
this.pressedSignalButton.instance.pressDown(false);
this.pressedSignalButton = null;
}
if (
(this.$store.state.training.prdType != '01' && this.$store.state.training.prdType != '10') ||
this.selected._event !== MouseEvent.Left ||
(!model._type && !model._code)
) {
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;
@ -763,18 +755,18 @@ export default {
this.Switch.block.button.operation,
this.Switch.unblock.button.operation
];
const signalButtonOperation = [
'LOCATE', //
'REVERSE', //
'MONOLOCK', //
'UNLOCK', //
'BLOCK', //
'UNBLOCK', // ,
'SECTION_FAULT_UNLOCK', //
'CANCEL', //
'HUMAN_RELEASE_ROUTE' //
];
console.log(buttonOperation, this.Signal.humanTrainRoute.button.operation, '9999');
// const signalButtonOperation = [
// 'LOCATE', //
// 'REVERSE', //
// 'MONOLOCK', //
// 'UNLOCK', //
// 'BLOCK', //
// 'UNBLOCK', // ,
// 'SECTION_FAULT_UNLOCK', //
// 'CANCEL', //
// 'HUMAN_RELEASE_ROUTE' //
// ];
console.log(buttonOperation, this.Station.guideLock.button.operation, '9999', model.type);
if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
this.handelTotalCancel(model);
@ -797,49 +789,54 @@ export default {
this.reopenSignalOperation(model);
} else if (buttonOperation === this.Signal.guide.button.operation) {
this.handleGuideSignal(model);
} else if (buttonOperation === this.MixinCommand.functionButton.button.operation) {
this.assistOperateOrChange(model);
} else if (buttonOperation === this.MixinCommand.block.button.operation) {
this.handleDeviceBlockOrUnblock(model);
} else {
this.clearOperate();
}
} else if (!buttonOperation) {
const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT'];
// const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT'];
// if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE') {
// this.handleGuideSignal(model);
// } else
if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
//
this.assistOperateOrChange(model);
} else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) {
this.pressedSignalButton = model;
const { lamp } = model.instance.style.SwitchFault;
//
if (model.type === 'LOCATE') {
this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor);
} else if (model.type === 'REVERSE') {
this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'], lamp.reverseColor);
} else if (model.type === 'MONOLOCK') {
this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'], lamp.lockColor);
} else if (model.type === 'UNLOCK') {
this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor);
} else if (model.type === 'BLOCK') {
this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'], lamp.blockColor);
} else if (model.type === 'UNBLOCK') {
this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor);
} else if (model.type === 'SECTION_FAULT_UNLOCK') {
//
this.buttonDown(this.Section.fault.button.operation, ['Section'], lamp.faultColor);
} else if (model.type === 'CANCEL') {
//
this.buttonDown(this.MixinCommand.totalCancel.button.operation, ['Signal', 'SignalButton']);
} else if (model.type === 'HUMAN_RELEASE_ROUTE') {
//
this.buttonDown(this.Signal.humanTrainRoute.button.operation, ['Signal', 'SignalButton']);
}
} else if ((model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) || (model._type === 'Signal' && !model.blockade)) {
this.deviceList.push(model);
this.arrangementRouteOperation(this.deviceList);
} else {
// if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
// //
// this.assistOperateOrChange(model);
// } else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) {
// this.pressedSignalButton = model;
// const { lamp } = model.instance.style.SwitchFault;
// //
// if (model.type === 'LOCATE') {
// this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor);
// } else if (model.type === 'REVERSE') {
// this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'], lamp.reverseColor);
// } else if (model.type === 'MONOLOCK') {
// this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'], lamp.lockColor);
// } else if (model.type === 'UNLOCK') {
// this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor);
// } else if (model.type === 'BLOCK') {
// this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'], lamp.blockColor);
// } else if (model.type === 'UNBLOCK') {
// this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor);
// } else if (model.type === 'SECTION_FAULT_UNLOCK') {
// //
// this.buttonDown(this.Section.fault.button.operation, ['Section'], lamp.faultColor);
// } else if (model.type === 'CANCEL') {
// //
// this.buttonDown(this.MixinCommand.totalCancel.button.operation, ['Signal', 'SignalButton']);
// } else if (model.type === 'HUMAN_RELEASE_ROUTE') {
// //
// this.buttonDown(this.Signal.humanTrainRoute.button.operation, ['Signal', 'SignalButton']);
// }
// } 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();
// }
this.clearOperate();
}
} else {
this.clearOperate();
}
@ -856,7 +853,26 @@ export default {
return false;
}
},
handleDeviceBlockOrUnblock(model) {
const operate = {
over: true,
code: model.code,
operation: this.MixinCommand.block.button.operation
};
if (model && model._type === 'Section') {
operate.cmdType = model.blockade ? CMD.Section.CMD_SECTION_UNBLOCK : CMD.Section.CMD_SECTION_BLOCK;
operate.param = { sectionCode: model.code };
} else if (model && model._type === 'Signal') {
operate.cmdType = model.blockade ? CMD.Signal.CMD_SIGNAL_UNBLOCK : CMD.Signal.CMD_SIGNAL_BLOCK;
operate.param = { signalCode: model.code };
} else if (model && model._type === 'Switch') {
operate.cmdType = model.blockade ? CMD.Switch.CMD_SWITCH_UNBLOCK : CMD.Switch.CMD_SWITCH_BLOCK;
operate.param = { switchCode: model.code };
}
this.sendCommand(operate);
},
clearOperate() { //
console.log('************');
this.clearSignalButton();
this.deviceList = [];
Handler.clear(); //
@ -889,6 +905,7 @@ export default {
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode,
_COUNT: model.code,
pressDown: model.pressDown ? 0 : 1 // 10
}
},
@ -899,6 +916,7 @@ export default {
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode,
_COUNT: model.code,
pressDown: model.pressDown ? 0 : 1 // 10
}
},
@ -959,17 +977,15 @@ export default {
param: noPasswordModelTypeMap[model.type].param,
cmdType: noPasswordModelTypeMap[model.type].nextCmdType
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.clearOperate();
} else {
this.$refs.noticeInfo.doShow();
}
})
.catch(error => {
}).catch(error => {
console.error(error);
this.clearOperate();
this.$refs.noticeInfo.doShow();
});
} else {
@ -978,17 +994,15 @@ export default {
code: model.code,
param: modelTypeMap[model.type].param
};
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
operate.nextCmdType = modelTypeMap[model.type].nextCmdType;
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
})
.catch(error => {
}).catch(error => {
console.error(error);
this.clearOperate();
this.$refs.noticeInfo.doShow();
});
}

View File

@ -102,7 +102,8 @@ export default {
'PickArrow',
'DepartArrow',
'ThroatRoute',
'NoStatusLamp'
'NoStatusLamp',
'Counter'
],
noNameTypeList: ['FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle'],
typeList: [
@ -136,7 +137,8 @@ export default {
{ name: '接车箭头', value: 'PickArrow' },
{ name: '发车箭头', value: 'DepartArrow' },
{ name: '咽喉进路表示', value: 'ThroatRoute' },
{ name: '无状态替代灯', value: 'NoStatusLamp' }
{ name: '无状态替代灯', value: 'NoStatusLamp' },
{ name: '计数器', value: 'Counter' }
],
hasDirectionList: [
'SectionOccupied',
@ -228,6 +230,15 @@ export default {
options: this.directionList,
isHidden: !this.hasDirectionList.includes(this.editModel.type)
},
{
prop: 'counterType',
label: '计数器类型:',
type: 'select',
optionLabel: 'label',
optionValue: 'value',
options: [{label: '总人解', value: 'HumanSolution'}, {label: '区故解', value: 'FaultSection'}],
isHidden: this.editModel.type !== 'Counter'
},
{
prop: 'switchCode',
label: '所属道岔:',
@ -405,6 +416,7 @@ export default {
this.PickArrowList = [];
this.ThroatRouteList = [];
this.NoStatusLampList = [];
this.CounterList = [];
indicatorLightList.forEach(item => {
switch (item._type) {
case 'AtsControl':
@ -500,6 +512,9 @@ export default {
case 'NoStatusLamp':
this.NoStatusLampList.push(item);
break;
case 'Counter':
this.CounterList.push(item);
break;
}
});
},
@ -598,6 +613,9 @@ export default {
case 'NoStatusLamp':
this.selectLists = this.NoStatusLampList;
break;
case 'Counter':
this.selectLists = this.CounterList;
break;
default:
this.selectLists = this.intersiteControlList;
break;
@ -719,6 +737,9 @@ export default {
case 'NoStatusLamp':
idPrefix = 'noStatusLamp';
break;
case 'Counter':
idPrefix = 'counter';
break;
}
return idPrefix;
},

View File

@ -212,7 +212,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', 'PickArrow', 'DepartArrow', 'ThroatRoute', 'NoStatusLamp'];
'Recovery', 'Accident', 'Occlusion', 'PickArrow', 'DepartArrow', 'ThroatRoute', 'NoStatusLamp', 'Counter'];
const type = device._type;
if (this.selectDevice) {
this.enabledTab = this.selectDevice;

View File

@ -204,6 +204,7 @@ class Model {
this.switchCode = '';
this.labelEnum = '';
this.right = false;
this.counterType = '';
}
}