diff --git a/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue b/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue index 3d1b0deca..85ffc175f 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuDialog/detainTrainContorl.vue @@ -11,9 +11,9 @@ :modal="false" :close-on-click-modal="false" > - + - {{ controlProps[item] }} + {{ controlProps[item] }} @@ -31,155 +31,161 @@ import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, check import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo'; export default { - name: 'StationStand', - components: { - NoticeInfo - }, - data() { - return { - operate: null, - dialogShow: false, - disabledClose: false, - disabledCommit: false, - control: '01', - controlProps: { - '01': '全线扣车', - '02': '取消全线扣车' - } + name: 'StationStand', + components: { + NoticeInfo + }, + data() { + return { + operate: null, + dialogShow: false, + disabledClose: false, + disabledCommit: false, + control: '01', + controlProps: { + '01': '全线扣车', + '02': '取消全线扣车' + }, + controlPropDisabled:{ + '01':false, + '02':false + } + }; + }, + computed: { + ...mapGetters('map', [ + 'stationList' + ]), + ...mapGetters('training', [ + 'mode', + 'started' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + title() { + if (this.dialogShow) { + if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { + return '全线扣车'; + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { + return '取消全线扣车'; + } + } + }, + domIdCommit() { + if (this.dialogShow) { + if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { + return OperationEvent.StationStand.setDetainTrainAll.menu.domId; + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { + return OperationEvent.StationStand.cancelDetainTrainAll.menu.domId; + } + } + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate) { + if (!this.dialogShow) { + this.operate = operate || {}; + this.operation = operate.operation; + } + if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { + // 设置全线扣车 + this.control = '01'; + this.controlPropDisabled['01'] = false; + this.controlPropDisabled['02'] = true; + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { + // 取消全线扣车 + this.control = '02'; + this.controlPropDisabled['01'] = true; + this.controlPropDisabled['02'] = false; + } - }; - }, - computed: { - ...mapGetters('map', [ - 'stationList' - ]), - ...mapGetters('training', [ - 'mode', - 'started' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - title() { - if (this.dialogShow) { - if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { - return '全线扣车'; - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { - return '取消全线扣车'; - } - } - }, - domIdCommit() { - if (this.dialogShow) { - if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { - return OperationEvent.StationStand.setDetainTrainAll.menu.domId; - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { - return OperationEvent.StationStand.cancelDetainTrainAll.menu.domId; - } - } - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate) { - if (!this.dialogShow) { - this.operate = operate || {}; - this.operation = operate.operation; - } + this.dialogShow = true; + this.$store.dispatch('training/emitTipFresh'); + }, + doClose() { + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + }, + cancel() { + const operate = { + type: 'bar', + operation: OperationEvent.Command.cancel.menu.operation + }; - if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { - // 设置全线扣车 - this.control = '01'; - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { - // 取消全线扣车 - this.control = '02'; - } + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }); + }, - this.dialogShow = true; - this.$store.dispatch('training/emitTipFresh'); - }, - doClose() { - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - }, - cancel() { - const operate = { - type: 'bar', - operation: OperationEvent.Command.cancel.menu.operation - }; + // 路由指令 + handleCommit() { + if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { + // 设置全线扣车 + this.setDetainTrainAll(); + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { + // 取消全线扣车 + this.cancelDetainTrainAll(); + } + }, - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }); - }, + // 设置全线扣车 + setDetainTrainAll() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.setDetainTrainAll.menu.operation, + val: this.control, + messages: ['确认设置全线扣车!'] + }; - // 路由指令 - handleCommit() { - if (this.operation == OperationEvent.StationStand.setDetainTrainAll.mbar.operation) { - // 设置全线扣车 - this.setDetainTrainAll(); - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.mbar.operation) { - // 取消全线扣车 - this.cancelDetainTrainAll(); - } - }, + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.disabledSure = false; + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); - // 设置全线扣车 - setDetainTrainAll() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setDetainTrainAll.menu.operation, - val: this.control, - messages: ['确认设置全线扣车!'] - }; + }); + }, - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.disabledSure = false; - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); + // 取消全线扣车 + cancelDetainTrainAll() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, + val: this.control, + messages: ['确认取消全线扣车!'] + }; - }); - }, - - // 取消全线扣车 - cancelDetainTrainAll() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, - val: this.control, - messages: ['确认取消全线扣车!'] - }; - - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.disabledSure = false; - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - } - } + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.disabledSure = false; + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + } + } };