diff --git a/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue b/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue index f94e17295..fe239a56d 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuDialog/stationControl.vue @@ -118,6 +118,7 @@ export default { }, doClose() { this.dialogShow = false; + this.station = {}; this.$store.dispatch('training/emitTipFresh'); }, cancel() { diff --git a/src/jmapNew/theme/beijing_01/menus/menuStation.vue b/src/jmapNew/theme/beijing_01/menus/menuStation.vue index 1f71a617c..7c121a37d 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuStation.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuStation.vue @@ -151,7 +151,6 @@ export default { initMenu() { this.menu = []; this.menuNormal.forEach(menuItem => { - console.log(this.selected, this.work, '------'); menuItem.show = menuItem.isShow && menuItem.isShow(this.selected, this.work); menuItem.disabled = !judgeStationControl(this.selected.code, this.selected.stationCode, this.work) || (menuItem.isDisabled && menuItem.isDisabled(this.selected, this.work)); this.menu.push(menuItem); diff --git a/src/jmapNew/theme/chengdu_01/menus/menuStation.vue b/src/jmapNew/theme/chengdu_01/menus/menuStation.vue index acc418989..1b63d6e2c 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuStation.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuStation.vue @@ -15,7 +15,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; export default { name: 'StationMenu', @@ -45,6 +45,73 @@ export default { return { menu: [], menuNormal: [ + { + label: '本地控制许可', + children: [ + { + label: '请求', + handler: this.setStationControl, + cmdType: this.work === 'localWork' ? CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL : CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL, + isDisabled: (station, work) => { + if (work === 'localWork') { + return station.controlMode !== 'Center'; + } else { + return station.controlMode === 'Center'; + } + } + }, + { + label: '取消', + handler: this.setCenterControl, + cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL, + isDisabled: (station, work) => { + if (work === 'localWork') { + return station.controlMode === 'Center'; + } else { + return station.controlMode !== 'Center'; + } + }, + isShow: (station, work) => { + return work === 'localWork'; + } + }, + { + label: '紧急本地控制', + handler: this.setEmergencyControl, + cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL, + isDisabled: (station, work) => { + return station.controlMode === 'Emergency'; + }, + isShow: (station, work) => { + return work === 'localWork'; + } + } + ] + }, + { + label: '进路模式', + children: [ + { + label: '自动', + handler: this.atsAutoControlALL, + cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, + isDisabled: (station, work) => { + return false; + } + }, + { + label: '人工', + handler: this.humanControlALL, + cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, + isDisabled: (station, work) => { + return false; + } + } + ], + isShow: (station, work) => { + return work === 'dispatchWork'; + } + } ], menuForce: [ { @@ -94,12 +161,21 @@ export default { }; }, initMenu() { + const selected = this.selected; + const work = this.work; + function setDisabledShow(item) { + if (item.children) { + item.children.forEach(ii => { + setDisabledShow(ii); + }); + } + item.disabled = item.isDisabled ? item.isDisabled(selected, work) : false; + item.show = item.isShow ? item.isShow(selected, work) : true; + } if (this.selected.centralized) { this.menu = []; this.menuNormal.forEach(menuItem => { - const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work); - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false; - menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work, this.lineCode) : true; + setDisabledShow(menuItem); this.menu.push(menuItem); }); // 故障模式菜单列表 @@ -149,6 +225,159 @@ export default { } }); }, + // 所有进路自排关 + humanControlALL() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Station.humanControlALL.menu.operation, + param: { + stationCode: this.selected.code + } + }; + this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { + code: OperationEvent.Command.commandXian.confirm.operation, + name: '所有进路自排关', + cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, + param: step.param + } + }); + } else { + this.$refs.noticeInfo.doShow(); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(); + }); + }, + // 所有进路自排开 + atsAutoControlALL() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Station.atsAutoControlALL.menu.operation, + param: { + stationCode: this.selected.code + } + }; + this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { + code: OperationEvent.Command.commandXian.confirm.operation, + name: '所有进路自排开', + cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, + param: step.param + } + }); + } else { + this.$refs.noticeInfo.doShow(); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(); + }); + }, + setPriorityStrategy() { + this.getStrategyByStation('侧线优先'); + }, + setLineStrategy() { + this.getStrategyByStation('直线折返'); + }, + setLateralStrategy() { + this.getStrategyByStation('侧线折返'); + }, + getStrategyByStation(type) { + const tbStrategy = this.tbStrategyList.find(strategy=>{ + return strategy.stationCode == this.selected.code; + }); + if (tbStrategy) { + const strategy = tbStrategy.optionList.find(each=>{ + return each.label == type; + }); + if (strategy) { + commitOperate(menuOperate.StationControl.setBackStrategy, {stationCode: this.selected.code, id:strategy.id}, 0).then(({valid, operate})=>{ + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { + code: OperationEvent.Command.commandXian.confirm.operation, + name: type, + cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY, + param: {stationCodes:[this.selected.code]} + } + }); + }).catch((error) => { + console.error(error); + this.$refs.noticeInfo.doShow(); + }); + } + } + }, + setStationControl() { + // 请求站控 + commitOperate(menuOperate.StationControl.requestStationControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { + code: OperationEvent.Command.commandXian.confirm.operation, + name: '请求站控', + cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL, + param: {stationCodes:[this.selected.code]} + } + }); + } + }); + }, + setCenterControl() { + // 请求中控 + commitOperate(menuOperate.StationControl.requestCentralControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { + code: OperationEvent.Command.commandXian.confirm.operation, + name: '请求中控', + cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL, + param: {stationCodes:[this.selected.code]} + } + }); + } + }); + }, + setEmergencyControl() { + // 紧急站控 + commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{ + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { + code: OperationEvent.Command.commandXian.confirm.operation, + name: '紧急站控', + cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL, + param: {stationCodes:[this.selected.code]} + } + }); + } + }); + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + }, triggerFaultManagement() { this.$store.dispatch('training/setTriggerFaultCount', this.selected); } diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue b/src/jmapNew/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue index 6e62de12d..4e9e098ab 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuDialog/stationControlConvert.vue @@ -296,8 +296,11 @@ export default { if (selection && selection.length) { const operate = { operation: '', - val: stationCodeList.join('::'), - selection: selection + // val: stationCodeList.join('::'), + selection: selection, + param: { + stationCodes: stationCodeList + } }; if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) { @@ -324,7 +327,7 @@ export default { const operate = { messages: [this.$t('menu.menuDialog.confirmStationControlTip')], operation: OperationEvent.StationControl.requestStationControl.menu.operation, - val: stationCodeList.join('::'), + // val: stationCodeList.join('::'), selection: this.selection, param: { stationCodes: stationCodeList @@ -352,7 +355,7 @@ export default { const operate = { messages: [this.$t('menu.menuDialog.confirmInTheControlTip')], operation: OperationEvent.StationControl.forcedStationControl.menu.operation, - val: stationCodeList.join('::'), + // val: stationCodeList.join('::'), selection: this.selection, param: { stationCodes: stationCodeList @@ -380,7 +383,7 @@ export default { const operate = { messages: [this.$t('menu.menuDialog.confirmInTheControlTip')], operation: OperationEvent.StationControl.requestCentralControl.menu.operation, - val: stationCodeList.join('::'), + // val: stationCodeList.join('::'), selection: this.selection, param: { stationCodes: stationCodeList diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 006a70bed..0e5bf409e 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -871,15 +871,15 @@ export default { }, initMenus() { this.basicParamList = this.work === 'localWork' ? [ - { name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' }, - { name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' }, - { name: '强行站控', cmdType: CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL, operate: OperationEvent.StationControl.forcedStationControl.menu, show:false, securityCommand: true }, + { name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menuButton, show: false, disabledName: 'controlMode', mode: 'Center' }, + { name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menuButton, show: false, disabledName: 'controlMode', mode: 'None' }, + { name: '强行站控', cmdType: CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL, operate: OperationEvent.StationControl.forcedStationControl.menuButton, show:false, securityCommand: true }, { name: '重启令解', cmdType: CMD.Station.CMD_STATION_RESTART, operate:OperationEvent.Station.stationRestart.menuButton, show: false, securityCommand: true}, - { name: '追踪全开', cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, operate: OperationEvent.Station.setAutoTrigger.menu, show: false }, - { name: '追踪全关', cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, operate: OperationEvent.Station.cancelAutoTrigger.menu, show: false }, - { name: '关区信号', cmdType: CMD.Station.CMD_STATION_CIAREA_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.ciAreaCloseAllSignal.menu, show: false }, - { name: '自排全开', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, operate: OperationEvent.Station.atsAutoControlALL.menu, show: false }, - { name: '自排全关', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, operate: OperationEvent.Station.humanControlALL.menu, show: false } + { name: '追踪全开', cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, operate: OperationEvent.Station.setAutoTrigger.menuButton, show: false }, + { name: '追踪全关', cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, operate: OperationEvent.Station.cancelAutoTrigger.menuButton, show: false }, + { name: '关区信号', cmdType: CMD.Station.CMD_STATION_CIAREA_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.ciAreaCloseAllSignal.menuButton, show: false }, + { name: '自排全开', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, operate: OperationEvent.Station.atsAutoControlALL.menuButton, show: false }, + { name: '自排全关', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, operate: OperationEvent.Station.humanControlALL.menuButton, show: false } ] : [ // { name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' }, // { name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' }, diff --git a/src/jmapNew/theme/xian_02/menus/menuSignal.vue b/src/jmapNew/theme/xian_02/menus/menuSignal.vue index 0007d80dc..9d6156897 100644 --- a/src/jmapNew/theme/xian_02/menus/menuSignal.vue +++ b/src/jmapNew/theme/xian_02/menus/menuSignal.vue @@ -224,8 +224,9 @@ export default { }, '$store.state.menuOperation.leftClickCount': function (val) { // const control = MenuContextHandler.getStationControl(this.selected); - const centralStation = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); - if (this.selected._type === 'Signal' && this.selected.controlMode == centralStation.controlMode) { + // const centralStation = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); + const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work); + if (this.selected._type === 'Signal' && status) { this.arrangementRoute(); } } diff --git a/src/scripts/cmdPlugin/newHandler.js b/src/scripts/cmdPlugin/newHandler.js index 1875dc245..b296d6c9a 100644 --- a/src/scripts/cmdPlugin/newHandler.js +++ b/src/scripts/cmdPlugin/newHandler.js @@ -127,7 +127,7 @@ class Handler { const stepInfo = store.state.trainingNew.stepInfo; const operateOrder = store.state.trainingNew.operateOrder; const operation = stepInfo.operations[operateOrder]; - if (operation.domId === OperationEvent.Conversation.Chat.menu.operation) { + if (operation && operation.domId === OperationEvent.Conversation.Chat.menu.operation) { this.handleVoiceStepList(); } } diff --git a/src/views/newMap/display/simulationMenu/simulationMenu.vue b/src/views/newMap/display/simulationMenu/simulationMenu.vue index 02fe8977c..8c887c691 100644 --- a/src/views/newMap/display/simulationMenu/simulationMenu.vue +++ b/src/views/newMap/display/simulationMenu/simulationMenu.vue @@ -59,7 +59,7 @@ export default { { label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isDisabled: () => { return false; }, isShow: () => { return true; } }, { label: '设备管理', name: 'deviceManage', click: this.deviceManage, isDisabled: () => { return false; }, isShow: () => { return (this.$store.state.training.domConfig.hasDeviceManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER) || (this.$route.query.client === 'interlockWork' && this.$route.query.projectDevice === 'ILW'); } }, { label: '联系方式', name: 'contectUs', click: this.contectUs, isDisabled: () => { return false; }, isShow: () => { return true; } }, - { label: '生成二维码', name: 'generateQrCode', click: this.generateQrCode, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.isJoint && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } }, + { label: '生成二维码', name: 'generateQrCode', click: this.generateQrCode, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.joint && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } }, { label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasLpf && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } }, { label: '成员管理', name: 'memberManage', click: this.memberManage, isDisabled: () => { return false; }, isShow: () => { return this.$route.query.type == 'IM' || (!this.$route.query.type && !this.$store.state.training.domConfig.hasMemberManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER); } }, { label: '考试', name: 'exam', click: this.goExam, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasExam && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } }, diff --git a/src/views/newMap/display/trainingDesign/designPane.vue b/src/views/newMap/display/trainingDesign/designPane.vue index df16efa22..ea104688c 100644 --- a/src/views/newMap/display/trainingDesign/designPane.vue +++ b/src/views/newMap/display/trainingDesign/designPane.vue @@ -1,5 +1,5 @@ diff --git a/src/views/newMap/display/trainingList/trainingPositionTip.vue b/src/views/newMap/display/trainingList/trainingPositionTip.vue index 4c43d14e5..d0087946b 100644 --- a/src/views/newMap/display/trainingList/trainingPositionTip.vue +++ b/src/views/newMap/display/trainingList/trainingPositionTip.vue @@ -91,7 +91,6 @@ export default { } const distance = 5; this.tip = stepInfo ? stepInfo.description : ''; - console.log(stepInfo, this.tip, '***'); if (stepInfo.tipPosition && stepInfo.tipPosition.deviceCode) { const position = this.getShapeTipPoint(stepInfo.tipPosition); if (position) { @@ -108,7 +107,6 @@ export default { this.position.y -= distance; this.popTipShow(); } - console.log(this.popShow, this.position, this.tip, '-----'); } else { this.popTipHide(); } @@ -181,10 +179,10 @@ export default { } else if (this.tipAlignIsTop(tipPosition, domId)) { align = 'top'; } - console.log(align, '*******', domId); + const width = align === 'right' ? 0 : btnDom.clientWidth / 2; resolve({ align: align, - x: offset.x + btnDom.clientWidth / 2, + x: offset.x + width, y: offset.y }); } else { diff --git a/src/views/organization/examManage/index.vue b/src/views/organization/examManage/index.vue index 0876e625d..f9448c2c2 100644 --- a/src/views/organization/examManage/index.vue +++ b/src/views/organization/examManage/index.vue @@ -1,21 +1,21 @@ diff --git a/src/views/organization/trainingManage/index.vue b/src/views/organization/trainingManage/index.vue index 81bef6279..277b77759 100644 --- a/src/views/organization/trainingManage/index.vue +++ b/src/views/organization/trainingManage/index.vue @@ -4,7 +4,7 @@