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,
|
handler: this.fault,
|
||||||
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
|
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== section.stationCode;
|
return this.$store.state.training.roleDeviceCode !== section.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return device.controlMode !== 'Center';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
|
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
|
||||||
@ -75,8 +76,9 @@ export default {
|
|||||||
handler: this.split,
|
handler: this.split,
|
||||||
cmdType: CMD.Section.CMD_SECTION_CUT_OFF,
|
cmdType: CMD.Section.CMD_SECTION_CUT_OFF,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return section.cutOff === 1;
|
return section.cutOff === 1;
|
||||||
}
|
}
|
||||||
@ -88,8 +90,9 @@ export default {
|
|||||||
handler: this.active,
|
handler: this.active,
|
||||||
cmdType: CMD.Section.CMD_SECTION_ACTIVE,
|
cmdType: CMD.Section.CMD_SECTION_ACTIVE,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return section.cutOff !== 1;
|
return section.cutOff !== 1;
|
||||||
}
|
}
|
||||||
@ -101,8 +104,9 @@ export default {
|
|||||||
handler: this.axlePreReset,
|
handler: this.axlePreReset,
|
||||||
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET,
|
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== section.stationCode;
|
return this.$store.state.training.roleDeviceCode !== section.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -115,8 +119,9 @@ export default {
|
|||||||
cmdType: CMD.Section.CMD_SECTION_BLOCK,
|
cmdType: CMD.Section.CMD_SECTION_BLOCK,
|
||||||
// isDisabled: section => section.blockade === 1,
|
// isDisabled: section => section.blockade === 1,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return section.blockade === 1;
|
return section.blockade === 1;
|
||||||
}
|
}
|
||||||
@ -128,8 +133,9 @@ export default {
|
|||||||
handler: this.unlock,
|
handler: this.unlock,
|
||||||
cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
|
cmdType: CMD.Section.CMD_SECTION_UNBLOCK,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return section.blockade !== 1;
|
return section.blockade !== 1;
|
||||||
}
|
}
|
||||||
@ -141,8 +147,9 @@ export default {
|
|||||||
handler: this.setSpeed,
|
handler: this.setSpeed,
|
||||||
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
|
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return section.speedUpLimit !== -1;
|
return section.speedUpLimit !== -1;
|
||||||
}
|
}
|
||||||
@ -154,8 +161,9 @@ export default {
|
|||||||
handler: this.cancelSpeed,
|
handler: this.cancelSpeed,
|
||||||
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
|
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
|
||||||
isDisabled: (section, work) => {
|
isDisabled: (section, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](section.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return section.speedUpLimit === -1;
|
return section.speedUpLimit === -1;
|
||||||
}
|
}
|
||||||
|
@ -66,8 +66,9 @@ export default {
|
|||||||
handler: this.arrangementRoute,
|
handler: this.arrangementRoute,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
|
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
|
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -78,8 +79,9 @@ export default {
|
|||||||
handler: this.cancelTrainRoute,
|
handler: this.cancelTrainRoute,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
|
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
|
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -90,8 +92,9 @@ export default {
|
|||||||
handler: this.lock,
|
handler: this.lock,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
|
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return signal.blockade === 1;
|
return signal.blockade === 1;
|
||||||
}
|
}
|
||||||
@ -102,8 +105,9 @@ export default {
|
|||||||
handler: this.unlock,
|
handler: this.unlock,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
|
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return signal.blockade !== 1;
|
return signal.blockade !== 1;
|
||||||
}
|
}
|
||||||
@ -114,8 +118,9 @@ export default {
|
|||||||
handler: this.reopenSignal,
|
handler: this.reopenSignal,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL,
|
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
|
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -126,8 +131,9 @@ export default {
|
|||||||
handler: this.signalClose,
|
handler: this.signalClose,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL,
|
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
|
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -137,61 +143,121 @@ export default {
|
|||||||
label: '进路引导',
|
label: '进路引导',
|
||||||
handler: this.guide,
|
handler: this.guide,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_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'
|
isShow: (signal, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '引导进路办理',
|
label: '引导进路办理',
|
||||||
handler: this.guide,
|
handler: this.guide,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_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'
|
isShow: (signal, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
|
label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
|
||||||
handler: this.setAutoInterlock,
|
handler: this.setAutoInterlock,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
|
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'
|
isShow: (signal, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
|
label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
|
||||||
handler: this.cancelAutoInterlock,
|
handler: this.cancelAutoInterlock,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
|
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'
|
isShow: (signal, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
|
label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
|
||||||
handler: this.setAutoTrigger,
|
handler: this.setAutoTrigger,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER,
|
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'
|
isShow: (signal, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
|
label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
|
||||||
handler: this.cancelAutoTrigger,
|
handler: this.cancelAutoTrigger,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER,
|
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'
|
isShow: (signal, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '进路交人工控',
|
label: '进路交人工控',
|
||||||
handler: this.humanControl,
|
handler: this.humanControl,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
|
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'
|
isShow: (signal, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '进路交ATS自动控',
|
label: '进路交ATS自动控',
|
||||||
handler: this.atsAutoControl,
|
handler: this.atsAutoControl,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
|
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'
|
isShow: (signal, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '查询进路控制模式',
|
label: '查询进路控制模式',
|
||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
isDisabled: (signal, work) => {
|
isDisabled: (signal, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== signal.stationCode;
|
return this.$store.state.training.roleDeviceCode !== signal.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,9 @@ export default {
|
|||||||
handler: this.setAutoTrigger,
|
handler: this.setAutoTrigger,
|
||||||
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
|
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
|
||||||
isDisabled: (station, work) => {
|
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;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
||||||
@ -68,7 +70,9 @@ export default {
|
|||||||
handler: this.cancelAutoTrigger,
|
handler: this.cancelAutoTrigger,
|
||||||
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
|
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
|
||||||
isDisabled: (station, work) => {
|
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;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
|
||||||
@ -81,18 +85,33 @@ export default {
|
|||||||
label: '全站进路交人工控',
|
label: '全站进路交人工控',
|
||||||
handler: this.humanControlALL,
|
handler: this.humanControlALL,
|
||||||
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
|
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
|
||||||
|
isDisabled: (station, work) => {
|
||||||
|
if (station.controlMode !== 'Center') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
isShow: (station, work) => work === 'dispatchWork'
|
isShow: (station, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '全站进路ATS自排',
|
label: '全站进路ATS自排',
|
||||||
handler: this.atsAutoControlALL,
|
handler: this.atsAutoControlALL,
|
||||||
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
|
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
|
||||||
|
isDisabled: (station, work) => {
|
||||||
|
if (station.controlMode !== 'Center') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
isShow: (station, work) => work === 'dispatchWork'
|
isShow: (station, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStation.execKeyOperationTest'),
|
label: this.$t('menu.menuStation.execKeyOperationTest'),
|
||||||
handler: this.execKeyOperationTest,
|
handler: this.execKeyOperationTest,
|
||||||
cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
|
cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
|
||||||
|
isDisabled: (station, work) => {
|
||||||
|
if (station.controlMode !== 'Center') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
isShow: (station, work) => work === 'dispatchWork'
|
isShow: (station, work) => work === 'dispatchWork'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -65,28 +65,56 @@ export default {
|
|||||||
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
||||||
handler: this.setDetainTrain,
|
handler: this.setDetainTrain,
|
||||||
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
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'
|
isShow: (stand, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||||
handler: this.cancelDetainTrain,
|
handler: this.cancelDetainTrain,
|
||||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
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'
|
isShow: (stand, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
||||||
handler: this.setDetainTrain,
|
handler: this.setDetainTrain,
|
||||||
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
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'
|
isShow: (stand, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||||
handler: this.cancelDetainTrain,
|
handler: this.cancelDetainTrain,
|
||||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
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'
|
isShow: (stand, work) => work === 'localWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -94,8 +122,9 @@ export default {
|
|||||||
handler: this.cancelDetainTrainForce,
|
handler: this.cancelDetainTrainForce,
|
||||||
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN,
|
cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN,
|
||||||
isDisabled: (stand, work) => {
|
isDisabled: (stand, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
|
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -106,10 +135,11 @@ export default {
|
|||||||
handler: this.setJumpStop,
|
handler: this.setJumpStop,
|
||||||
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP,
|
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP,
|
||||||
isDisabled: (stand, work) => {
|
isDisabled: (stand, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return false;
|
return stand.allSkip !== 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -118,10 +148,11 @@ export default {
|
|||||||
handler: this.cancelJumpStop,
|
handler: this.cancelJumpStop,
|
||||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
|
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
|
||||||
isDisabled: (stand, work) => {
|
isDisabled: (stand, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} 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'),
|
label: this.$t('menu.menuStationStand.setStopTime'),
|
||||||
handler: this.setStopTime,
|
handler: this.setStopTime,
|
||||||
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
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'
|
isShow: (stand, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||||
handler: this.setRunLevel,
|
handler: this.setRunLevel,
|
||||||
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME,
|
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'
|
isShow: (stand, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||||
handler: this.earlyDeparture,
|
handler: this.earlyDeparture,
|
||||||
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART,
|
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'
|
isShow: (stand, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||||
handler: this.setBackStrategy,
|
handler: this.setBackStrategy,
|
||||||
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
|
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'
|
isShow: (station, work) => work === 'dispatchWork'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -155,8 +217,9 @@ export default {
|
|||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS,
|
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS,
|
||||||
isDisabled: (stand, work) => {
|
isDisabled: (stand, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode;
|
return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,9 @@ export default {
|
|||||||
handler: this.lock,
|
handler: this.lock,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
|
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -70,8 +71,9 @@ export default {
|
|||||||
handler: this.unlock,
|
handler: this.unlock,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
|
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -82,8 +84,9 @@ export default {
|
|||||||
handler: this.block,
|
handler: this.block,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
|
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -94,8 +97,9 @@ export default {
|
|||||||
handler: this.unblock,
|
handler: this.unblock,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK,
|
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
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 {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -106,8 +110,9 @@ export default {
|
|||||||
handler: this.switchTurnout,
|
handler: this.switchTurnout,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_TURN,
|
cmdType: CMD.Switch.CMD_SWITCH_TURN,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -118,8 +123,9 @@ export default {
|
|||||||
handler: this.fault,
|
handler: this.fault,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
|
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -130,8 +136,9 @@ export default {
|
|||||||
handler: this.axlePreReset,
|
handler: this.axlePreReset,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET,
|
cmdType: CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -142,8 +149,9 @@ export default {
|
|||||||
handler: this.split,
|
handler: this.split,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
|
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -154,8 +162,9 @@ export default {
|
|||||||
handler: this.active,
|
handler: this.active,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
|
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -166,8 +175,9 @@ export default {
|
|||||||
handler: this.setSpeed,
|
handler: this.setSpeed,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
|
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -178,8 +188,9 @@ export default {
|
|||||||
handler: this.cancelSpeed,
|
handler: this.cancelSpeed,
|
||||||
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED,
|
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED,
|
||||||
isDisabled: (switchDevice, work) => {
|
isDisabled: (switchDevice, work) => {
|
||||||
|
const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode);
|
||||||
if (work === 'localWork') {
|
if (work === 'localWork') {
|
||||||
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode;
|
return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -36,23 +36,30 @@ export default {
|
|||||||
return this.$route.query.mapId;
|
return this.$route.query.mapId;
|
||||||
},
|
},
|
||||||
trainingDetail() {
|
trainingDetail() {
|
||||||
console.log(this.$store.state.trainingNew.trainingDetail, '****');
|
|
||||||
return this.$store.state.trainingNew.trainingDetail;
|
return this.$store.state.trainingNew.trainingDetail;
|
||||||
},
|
},
|
||||||
group () {
|
group () {
|
||||||
return this.$route.query.group;
|
return this.$route.query.group;
|
||||||
|
},
|
||||||
|
trainingSwitch() {
|
||||||
|
return this.$store.state.trainingNew.trainingSwitch;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
EventBus.$on('handleSliderShow', () => {
|
EventBus.$on('handleSliderShow', () => {
|
||||||
|
if (!this.trainingList || !this.trainingList.length) {
|
||||||
|
this.initLoadPage();
|
||||||
|
}
|
||||||
this.handleSliderShow(true);
|
this.handleSliderShow(true);
|
||||||
});
|
});
|
||||||
this.initLoadPage();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initLoadPage() {
|
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;
|
this.trainingList = response.data;
|
||||||
|
EventBus.$emit('setTrainingList', this.trainingList);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
|
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>
|
<el-button v-if="trainingSwitch" size="small" type="danger" @click="handlerEnd">结束</el-button>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</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>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="drag-right" />
|
<div class="drag-right" />
|
||||||
@ -60,7 +68,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ScriptMode } from '@/scripts/ConstDic';
|
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 ScenePlayRole from './scenePlayRole';
|
||||||
import TestResult from './testResult';
|
import TestResult from './testResult';
|
||||||
import { EventBus } from '@/scripts/event-bus';
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
@ -83,7 +91,10 @@ export default {
|
|||||||
TrainingMode: ScriptMode,
|
TrainingMode: ScriptMode,
|
||||||
activeName: 'first',
|
activeName: 'first',
|
||||||
training: {},
|
training: {},
|
||||||
trainingDesign: false
|
trainingDesign: false,
|
||||||
|
trainingList: [],
|
||||||
|
nextTraining: null,
|
||||||
|
previousTraining: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -103,10 +114,24 @@ export default {
|
|||||||
return this.$route.query.mapId;
|
return this.$route.query.mapId;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.trainingNew.trainingDetail': function(val) {
|
||||||
|
this.initAdjacentTraining();
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
EventBus.$on('setTrainingList', (trainingList) => {
|
||||||
|
this.trainingList = trainingList;
|
||||||
|
this.initAdjacentTraining();
|
||||||
|
});
|
||||||
this.trainingDesign = this.$store.state.training.domConfig.trainingDesign;
|
this.trainingDesign = this.$store.state.training.domConfig.trainingDesign;
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
shrink() {
|
||||||
if (this.isShrink) {
|
if (this.isShrink) {
|
||||||
this.isShrink = false;
|
this.isShrink = false;
|
||||||
@ -154,13 +179,41 @@ export default {
|
|||||||
},
|
},
|
||||||
trainingListShow() {
|
trainingListShow() {
|
||||||
EventBus.$emit('handleSliderShow');
|
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>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@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 {
|
.tip-body-box {
|
||||||
height: 260px;
|
height: 260px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -200,7 +253,7 @@ export default {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
font-size: 18px;
|
font-size: 16px;
|
||||||
|
|
||||||
.tip-title {
|
.tip-title {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
|
Loading…
Reference in New Issue
Block a user