Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
This commit is contained in:
commit
941dd2d24a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'
|
||||
}
|
||||
],
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -36,23 +36,30 @@ export default {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
trainingDetail() {
|
||||
console.log(this.$store.state.trainingNew.trainingDetail, '****');
|
||||
return this.$store.state.trainingNew.trainingDetail;
|
||||
},
|
||||
group () {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
trainingSwitch() {
|
||||
return this.$store.state.trainingNew.trainingSwitch;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
EventBus.$on('handleSliderShow', () => {
|
||||
if (!this.trainingList || !this.trainingList.length) {
|
||||
this.initLoadPage();
|
||||
}
|
||||
this.handleSliderShow(true);
|
||||
});
|
||||
this.initLoadPage();
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
getPublishTrainingListInOrg({mapId: this.mapId}).then(response => {
|
||||
const trainingType = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingType : '';
|
||||
console.log(trainingType, this.$store.state.training.domConfig);
|
||||
getPublishTrainingListInOrg({mapId: this.mapId, type: trainingType.toLowerCase()}).then(response => {
|
||||
this.trainingList = response.data;
|
||||
EventBus.$emit('setTrainingList', this.trainingList);
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
|
||||
});
|
||||
|
@ -44,6 +44,14 @@
|
||||
<el-button v-if="trainingSwitch" size="small" type="danger" @click="handlerEnd">结束</el-button>
|
||||
</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">上 一 题:</span>
|
||||
<span class="list-elem elem-span training-box" @click="loadTraining(previousTraining)">{{ previousTraining? previousTraining.name: '' }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">下 一 题:</span>
|
||||
<span class="list-elem elem-span training-box" @click="loadTraining(nextTraining)">{{ nextTraining? nextTraining.name:'' }}</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="drag-right" />
|
||||
@ -60,7 +68,7 @@
|
||||
|
||||
<script>
|
||||
import { ScriptMode } from '@/scripts/ConstDic';
|
||||
import { startTraining, endTraining } from '@/api/jmap/training';
|
||||
import { startTraining, endTraining, getPublishTrainingDetail, loadPublishTraining } from '@/api/jmap/training';
|
||||
import ScenePlayRole from './scenePlayRole';
|
||||
import TestResult from './testResult';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
@ -83,7 +91,10 @@ export default {
|
||||
TrainingMode: ScriptMode,
|
||||
activeName: 'first',
|
||||
training: {},
|
||||
trainingDesign: false
|
||||
trainingDesign: false,
|
||||
trainingList: [],
|
||||
nextTraining: null,
|
||||
previousTraining: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -103,10 +114,24 @@ export default {
|
||||
return this.$route.query.mapId;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.trainingNew.trainingDetail': function(val) {
|
||||
this.initAdjacentTraining();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
EventBus.$on('setTrainingList', (trainingList) => {
|
||||
this.trainingList = trainingList;
|
||||
this.initAdjacentTraining();
|
||||
});
|
||||
this.trainingDesign = this.$store.state.training.domConfig.trainingDesign;
|
||||
},
|
||||
methods: {
|
||||
initAdjacentTraining() {
|
||||
const index = this.trainingList.findIndex(training => this.trainingDetail && training.id === this.trainingDetail.id);
|
||||
this.previousTraining = this.trainingList[index - 1];
|
||||
this.nextTraining = this.trainingList[index + 1];
|
||||
},
|
||||
shrink() {
|
||||
if (this.isShrink) {
|
||||
this.isShrink = false;
|
||||
@ -154,13 +179,41 @@ export default {
|
||||
},
|
||||
trainingListShow() {
|
||||
EventBus.$emit('handleSliderShow');
|
||||
},
|
||||
async loadTraining(training) {
|
||||
if (this.trainingSwitch) {
|
||||
this.$message.error('请先结束当前实训后再加载新的实训!');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const detailResp = await getPublishTrainingDetail(training.id);
|
||||
this.training = detailResp.data;
|
||||
if (detailResp.data.mapLocationJson) {
|
||||
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
|
||||
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
|
||||
}
|
||||
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
|
||||
await loadPublishTraining(this.group, training.id, {mode: ''});
|
||||
this.$message.success('加载实训成功!');
|
||||
} catch (e) {
|
||||
this.$message.error('加载实训失败!');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.list-item{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.training-box{
|
||||
cursor: pointer;
|
||||
}
|
||||
.training-box:hover{
|
||||
color: dodgerblue;
|
||||
}
|
||||
.tip-body-box {
|
||||
height: 260px;
|
||||
position: absolute;
|
||||
@ -200,7 +253,7 @@ export default {
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
|
||||
.tip-title {
|
||||
width: 500px;
|
||||
|
Loading…
Reference in New Issue
Block a user