diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index 0a30adf5c..abfa281ed 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -909,11 +909,6 @@ export const menuOperate = { agreeSwitchControlMode:{ operation: OperationEvent.MixinCommand.modeCovert.agreeModeCovertCommit.operation, cmdType: CMD.CTC.CTC_AGREE_OPERATION_MODEL - }, - // 不同意操作模式转换 - noAgreeSwitchControlMode:{ - operation: OperationEvent.MixinCommand.modeCovert.agreeModeCovertCommit.operation, - cmdType: CMD.CTC.CTC_NO_AGREE_OPERATION_MODEL } }, Rail: { diff --git a/src/jmapNew/theme/datie_02/menus/dialog/applyOrAgreeModeCovert.vue b/src/jmapNew/theme/datie_02/menus/dialog/applyOrAgreeModeCovert.vue index 7d43e9fe9..9caf08f28 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/applyOrAgreeModeCovert.vue +++ b/src/jmapNew/theme/datie_02/menus/dialog/applyOrAgreeModeCovert.vue @@ -24,31 +24,31 @@ @@ -108,6 +108,9 @@ export default { }, roleDeviceCode() { return this.$store.state.training.roleDeviceCode; + }, + operationModeApplyList() { + return this.$store.state.socket.operationModeApplyList; } }, watch: { @@ -141,6 +144,18 @@ export default { } }, methods:{ + getTextColor(row, type) { + let colorClass = ''; + if (row.source == type) { + colorClass = 'redText'; + } + if (this.isAgreeMode) { + if (row.target == type) { + colorClass = 'orangeText'; + } + } + return colorClass; + }, changeAllAgreeChecked() { this.tableData.forEach(item => { this.$set(item, 'isAgree', this.allAgreeChecked); @@ -169,7 +184,15 @@ export default { getListData() { this.tableData = []; if (this.isAgreeMode) { - console.log('============'); + this.operationModeApplyList.forEach(item => { + const info = this.$store.getters['map/getDeviceByCode'](item.code); + const obj = { + ...item, + name: info ? info.name : '', + isAgree: false + }; + this.tableData.push(obj); + }); } else { let list = this.stationList; if (this.work == 'ctcWork') { @@ -194,9 +217,38 @@ export default { } }, commit() { - console.log('--commit---'); if (this.isAgreeMode) { - console.log('==----------==='); + const list = []; + const noList = []; + this.tableData.forEach(item => { + if (item.isAgree) { + list.push(item.code); + } else { + noList.push(item.code); + } + }); + const operate = { + over: true, + operation: menuOperate.CTC.agreeSwitchControlMode.operation, + userOperationType: UserOperationType.LEFTCLICK, + cmdType: menuOperate.CTC.agreeSwitchControlMode.cmdType, + param: { + agreeStationCodes: list, + noAgreeStationCodes: noList + } + }; + this.loading = true; + this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { + if (valid) { + this.loading = false; + this.doClose(); + this.$store.commit('socket/clearOperationModeApplyList', JSON.parse(JSON.stringify(this.tableData))); + } + }).catch((err) => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(err.message); + }); } else { const list = []; this.tableData.forEach(item => { @@ -223,10 +275,10 @@ export default { this.loading = false; this.doClose(); } - }).catch(() => { + }).catch((err) => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(); + this.$refs.noticeInfo.doShow(err.message); }); } } @@ -262,4 +314,7 @@ export default { .redText { color: red; } +.orangeText { + color: orange; +} diff --git a/src/jmapNew/theme/datie_02/menus/dialog/statusSelect.vue b/src/jmapNew/theme/datie_02/menus/dialog/statusSelect.vue index 1963f5c24..8330e5e5a 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/statusSelect.vue +++ b/src/jmapNew/theme/datie_02/menus/dialog/statusSelect.vue @@ -155,7 +155,7 @@ export default { const localArr = ['Station']; list.forEach(item => { const obj = this.$store.getters['map/getDeviceByCode'](item.code); - if (obj && localArr.includes(obj.operationMode)) { + if (obj && obj.controlMode == 'Local' && localArr.includes(obj.operationMode)) { const param = { code: obj.code, name: obj.name, @@ -211,10 +211,10 @@ export default { this.loading = false; this.doClose(); } - }).catch(() => { + }).catch((err) => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(); + this.$refs.noticeInfo.doShow(err.message); }); } }, diff --git a/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue b/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue index 5fc26864d..aeb09a584 100644 --- a/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue +++ b/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue @@ -102,15 +102,15 @@
-
模式申请
-
同意模式申请
+
同意模式申请
@@ -216,6 +216,9 @@ export default { 'autoReentryList', 'autoReentryData' ]), + hasModeApplyList() { + return this.$store.state.socket.operationModeApplyList.length; + }, isDispatchWork () { return this.work == 'dispatchWork'; }, @@ -285,7 +288,11 @@ export default { this.$store.dispatch('menuOperation/setButtonOperation', null); this.clearOperate(); }, + '$store.state.menuOperation.leftClickCount': function (val) { + this.modeCovertShow = false; + }, '$store.state.menuOperation.menuCount': function (val) { + this.modeCovertShow = false; if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) { const operate = { userOperationType: 'rightClick', @@ -1070,4 +1077,21 @@ export default { color: #ccc !important; } } + .redFlick { + background: red; + } + @keyframes fade { + from { + opacity: 1.0; + } + 50% { + opacity: 0.2; + } + to { + opacity: 1.0; + } + } + .flicker { + animation: fade 600ms infinite; + } diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index a04a4f8f8..85d887894 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -494,8 +494,7 @@ export default { CTC_READ_DISPATCH_COMMAND:{value:'CTC_READ_DISPATCH_COMMAND', label: '调度台命令已读'}, CTC_SWITCH_ROUTE_SET_MODEL:{value:'Station_Switch_Route_Set_Model', label: '状态切换操作'}, CTC_SWITCH_CONTROL_OPERATION_MODEL:{value:'Station_Switch_Control_Operation_Mode', label: '操作模式转换'}, - CTC_AGREE_OPERATION_MODEL:{value:'Station_Agree_Operation_Mode', label: '同意操作模式转换'}, - CTC_NO_AGREE_OPERATION_MODEL:{value:'Station_No_Agree_Operation_Mode', label: '不同意操作模式转换'} + CTC_AGREE_OPERATION_MODEL:{value:'Station_Handle_Operation_Mode_Apply', label: '同意操作模式转换'} }, RAIL: { diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index b9c03c424..4b56cba08 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -395,12 +395,17 @@ const socket = { state.controlTransfer = transfer; }, operationModeApply: (state, list) => { - list.forEach(item => { - state.operationModeApplyList.push(item); - }); + state.operationModeApplyList = list; }, - clearOperationModeApplyList: (state) => { - state.operationModeApplyList = []; + clearOperationModeApplyList: (state, list) => { + list.forEach(item => { + const index = state.operationModeApplyList.findIndex(every => { + return every.code == item.code && every.target == item.target; + }); + if (index >= 0) { + state.operationModeApplyList.splice(index, 1); + } + }); } },