代码调整

This commit is contained in:
dong 2022-12-07 09:57:42 +08:00
parent 75e70ef63f
commit d4642b76e8
5 changed files with 212 additions and 45 deletions

View File

@ -62,10 +62,11 @@ export default {
handler: this.fault,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode;
return this.$store.state.training.roleDeviceCode !== section.stationCode || device.controlMode !== 'Local';
} else {
return false;
return device.controlMode !== 'Center';
}
},
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
@ -75,8 +76,9 @@ export default {
handler: this.split,
cmdType: CMD.Section.CMD_SECTION_CUT_OFF,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.cutOff === 1;
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.cutOff === 1 || device.controlMode !== 'Local';
} else {
return section.cutOff === 1;
}
@ -88,8 +90,9 @@ export default {
handler: this.active,
cmdType: CMD.Section.CMD_SECTION_ACTIVE,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.cutOff !== 1;
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.cutOff !== 1 || device.controlMode !== 'Local';
} else {
return section.cutOff !== 1;
}
@ -101,8 +104,9 @@ export default {
handler: this.axlePreReset,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode;
return this.$store.state.training.roleDeviceCode !== section.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -115,8 +119,9 @@ export default {
cmdType: CMD.Section.CMD_SECTION_BLOCK,
// isDisabled: section => section.blockade === 1,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade === 1;
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade === 1 || device.controlMode !== 'Local';
} else {
return section.blockade === 1;
}
@ -128,8 +133,9 @@ export default {
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade !== 1;
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade !== 1 || device.controlMode !== 'Local';
} else {
return section.blockade !== 1;
}
@ -141,8 +147,9 @@ export default {
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit !== -1;
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit !== -1 || device.controlMode !== 'Local';
} else {
return section.speedUpLimit !== -1;
}
@ -154,8 +161,9 @@ export default {
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
isDisabled: (section, work) => {
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit === -1;
return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit === -1 || device.controlMode !== 'Local';
} else {
return section.speedUpLimit === -1;
}

View File

@ -66,8 +66,9 @@ export default {
handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -78,8 +79,9 @@ export default {
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -90,8 +92,9 @@ export default {
handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade === 1;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade === 1 || device.controlMode !== 'Local';
} else {
return signal.blockade === 1;
}
@ -102,8 +105,9 @@ export default {
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade !== 1;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade !== 1 || device.controlMode !== 'Local';
} else {
return signal.blockade !== 1;
}
@ -114,8 +118,9 @@ export default {
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -126,8 +131,9 @@ export default {
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -137,61 +143,121 @@ export default {
label: '进路引导',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'localWork'
},
{
label: '引导进路办理',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode === 1,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode === 1 || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'localWork'
},
{
label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode === 0,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode === 0 || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'localWork'
},
{
label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER,
isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl === 1,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl === 1 || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'localWork'
},
{
label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER,
isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl !== 1,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl !== 1 || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'localWork'
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'dispatchWork'
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (signal, work) => work === 'dispatchWork'
},
{
label: '查询进路控制模式',
handler: this.detail,
isDisabled: (signal, work) => {
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
} else {
return false;
}

View File

@ -54,7 +54,9 @@ export default {
handler: this.setAutoTrigger,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
isDisabled: (station, work) => {
if (this.$store.state.training.roleDeviceCode === station.code) {
if (station.controlMode !== 'Local') {
return true;
} else if (this.$store.state.training.roleDeviceCode === station.code) {
return false;
} else {
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
@ -68,7 +70,9 @@ export default {
handler: this.cancelAutoTrigger,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
isDisabled: (station, work) => {
if (this.$store.state.training.roleDeviceCode === station.code) {
if (station.controlMode !== 'Local') {
return true;
} else if (this.$store.state.training.roleDeviceCode === station.code) {
return false;
} else {
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
@ -81,18 +85,33 @@ export default {
label: '全站进路交人工控',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
isDisabled: (station, work) => {
if (station.controlMode !== 'Center') {
return true;
}
},
isShow: (station, work) => work === 'dispatchWork'
},
{
label: '全站进路ATS自排',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
isDisabled: (station, work) => {
if (station.controlMode !== 'Center') {
return true;
}
},
isShow: (station, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStation.execKeyOperationTest'),
handler: this.execKeyOperationTest,
cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
isDisabled: (station, work) => {
if (station.controlMode !== 'Center') {
return true;
}
},
isShow: (station, work) => work === 'dispatchWork'
}
],

View File

@ -65,28 +65,56 @@ export default {
label: this.$t('menu.menuStationStand.setDetainTrain'),
handler: this.setDetainTrain,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
isDisabled: stand => stand.centerHoldTrain === 1,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return stand.centerHoldTrain === 1 || device.controlMode !== 'Local';
} else {
return stand.centerHoldTrain === 1 || device.controlMode !== 'Center';
}
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
handler: this.cancelDetainTrain,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
isDisabled: stand => stand.centerHoldTrain !== 1,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return stand.centerHoldTrain !== 1 || device.controlMode !== 'Local';
} else {
return stand.centerHoldTrain !== 1 || device.controlMode !== 'Center';
}
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStationStand.setDetainTrain'),
handler: this.setDetainTrain,
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
isDisabled: (stand, work) => this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain === 1,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain === 1 || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (stand, work) => work === 'localWork'
},
{
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
handler: this.cancelDetainTrain,
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
isDisabled: (stand, work) => this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 1,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 1 || device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (stand, work) => work === 'localWork'
},
{
@ -94,8 +122,9 @@ export default {
handler: this.cancelDetainTrainForce,
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -106,10 +135,11 @@ export default {
handler: this.setJumpStop,
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.allSkip === 1;
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.allSkip !== 0 || device.controlMode !== 'Local';
} else {
return false;
return stand.allSkip !== 0;
}
}
},
@ -118,10 +148,11 @@ export default {
handler: this.cancelJumpStop,
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || (stand.allSkip !== 1 && stand.assignSkip !== 1);
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || (stand.allSkip !== 1 && stand.assignSkip !== 1) || device.controlMode !== 'Local';
} else {
return false;
return (stand.allSkip !== 1 && stand.assignSkip !== 1) || device.controlMode !== 'Center';
}
}
},
@ -129,25 +160,56 @@ export default {
label: this.$t('menu.menuStationStand.setStopTime'),
handler: this.setStopTime,
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStationStand.setRunLevel'),
handler: this.setRunLevel,
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
handler: this.earlyDeparture,
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART,
isDisabled: stand => stand.trainParking !== 1,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return stand.trainParking !== 1 || device.controlMode !== 'Local';
} else {
return stand.trainParking !== 1;
}
},
isShow: (stand, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStationStand.setBackStrategy'),
handler: this.setBackStrategy,
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return device.controlMode !== 'Local';
} else {
return false;
}
},
isShow: (station, work) => work === 'dispatchWork'
},
{
@ -155,8 +217,9 @@ export default {
handler: this.detail,
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS,
isDisabled: (stand, work) => {
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local';
} else {
return false;
}

View File

@ -58,8 +58,9 @@ export default {
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock === 1;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock === 1 || device.controlMode !== 'Local';
} else {
return false;
}
@ -70,8 +71,9 @@ export default {
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock !== 1;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock !== 1 || device.controlMode !== 'Local';
} else {
return false;
}
@ -82,8 +84,9 @@ export default {
handler: this.block,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade === 1;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade === 1 || device.controlMode !== 'Local';
} else {
return false;
}
@ -94,8 +97,9 @@ export default {
handler: this.unblock,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade !== 1;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade !== 1 || device.controlMode !== 'Local';
} else {
return false;
}
@ -106,8 +110,9 @@ export default {
handler: this.switchTurnout,
cmdType: CMD.Switch.CMD_SWITCH_TURN,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -118,8 +123,9 @@ export default {
handler: this.fault,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -130,8 +136,9 @@ export default {
handler: this.axlePreReset,
cmdType: CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -142,8 +149,9 @@ export default {
handler: this.split,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -154,8 +162,9 @@ export default {
handler: this.active,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -166,8 +175,9 @@ export default {
handler: this.setSpeed,
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}
@ -178,8 +188,9 @@ export default {
handler: this.cancelSpeed,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED,
isDisabled: (switchDevice, work) => {
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
if (work === 'localWork') {
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
} else {
return false;
}