diff --git a/src/jmapNew/theme/ningbo_01/menus/menuDialog/areaSelection.vue b/src/jmapNew/theme/ningbo_01/menus/menuDialog/areaSelection.vue index 759f9126b..df3a01d4f 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuDialog/areaSelection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuDialog/areaSelection.vue @@ -5,7 +5,7 @@ :title="title" :visible.sync="show" width="650px" - :before-close="doClose" + :before-close="() => show=false" :show-close="true" :z-index="2000" :modal="false" @@ -43,14 +43,14 @@ - 全部申请 - 取消全部申请 - 全部释放 - 取消全部释放 - 全部强制分配 - 取消全部强制分配 - 应用 - 退出 + 全部申请 + 取消全部申请 + 全部释放 + 取消全部释放 + 全部强制分配 + 取消全部强制分配 + 应用 + 退出 @@ -87,7 +87,10 @@ export default { computed: { ...mapGetters('map', [ 'stationList' - ]) + ]), + commitDomId() { + return this.show ? OperationEvent.Station.areaSelection.confirm.domId : ''; + } }, watch: { '$store.state.map.mapStateLoadedCount': function () { @@ -107,6 +110,12 @@ export default { }); }, methods: { + getDomId(key) { + return this.show ? OperationEvent.Command.commandNingBo1[key].domId : ''; + }, + getOperation(key) { + return OperationEvent.Command.commandNingBo1[key] ? OperationEvent.Command.commandNingBo1[key].operation : ''; + }, doShow() { this.tableData = []; this.$store.state.training.simulationUserList.forEach(item => { @@ -138,7 +147,14 @@ export default { this.show = true; }, doClose() { - this.show = false; + const operate = { + operation: this.getOperation('doClose') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.show = false; + } + }); }, getControlStatus(code) { const newStation = this.$store.getters['map/getDeviceByCode'](code); @@ -167,49 +183,91 @@ export default { } }, applyAll() { - this.tableData.forEach(item => { - const centralizedStationCode = this.stationCentralizedMap[item.code]; - const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode); - const station = this.$store.getters['map/getDeviceByCode'](item.code); - if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') { - item.apply = false; - } else if (station.controller !== this.memberId) { - item.apply = true; + const operate = { + operation: this.getOperation('applyAll') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.tableData.forEach(item => { + const centralizedStationCode = this.stationCentralizedMap[item.code]; + const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode); + const station = this.$store.getters['map/getDeviceByCode'](item.code); + if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') { + item.apply = false; + } else if (station.controller !== this.memberId) { + item.apply = true; + } + }); } }); }, cancelApplyAll() { - this.tableData.forEach(item => { - item.apply = false; + const operate = { + operation: this.getOperation('cancelApplyAll') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.tableData.forEach(item => { + item.apply = false; + }); + } }); }, releaseAll() { - this.tableData.forEach(item => { - const centralizedStationCode = this.stationCentralizedMap[item.code]; - const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode); - const station = this.$store.getters['map/getDeviceByCode'](item.code); - if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') { - item.apply = false; - } else if (station.controller === this.memberId) { - item.release = true; + const operate = { + operation: this.getOperation('releaseAll') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.tableData.forEach(item => { + const centralizedStationCode = this.stationCentralizedMap[item.code]; + const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode); + const station = this.$store.getters['map/getDeviceByCode'](item.code); + if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') { + item.apply = false; + } else if (station.controller === this.memberId) { + item.release = true; + } + }); } }); }, cancelReleaseAll() { - this.tableData.forEach(item => { - item.release = false; + const operate = { + operation: this.getOperation('cancelReleaseAll') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.tableData.forEach(item => { + item.release = false; + }); + } }); }, distributionAll() { - this.tableData.forEach(item => { - if (item.controller !== this.memberId) { - item.distribution = true; + const operate = { + operation: this.getOperation('distributionAll') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.tableData.forEach(item => { + if (item.controller !== this.memberId) { + item.distribution = true; + } + }); } }); }, cancelDistributionAll() { - this.tableData.forEach(item => { - item.distribution = false; + const operate = { + operation: this.getOperation('cancelDistributionAll') + }; + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.tableData.forEach(item => { + item.distribution = false; + }); + } }); }, commit() { diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue index f36205ded..18280fb07 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue @@ -219,7 +219,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelSwitchLock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelSwitchLock.vue index 7510c459d..bfc3d699a 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelSwitchLock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelSwitchLock.vue @@ -4,22 +4,22 @@ - + - + - + - + @@ -31,7 +31,7 @@ - +
命令 @@ -69,27 +69,27 @@ export default { components: { NoticeInfo }, - props: { - initCacheMap: { - type: Object, - default() { - return {} - } - }, - initInfo: { - type: Object, - default() { - return {} - } - }, - updateDone: { - type: Number, - default: 0 - } - }, + props: { + initCacheMap: { + type: Object, + default() { + return {}; + } + }, + initInfo: { + type: Object, + default() { + return {}; + } + }, + updateDone: { + type: Number, + default: 0 + } + }, data() { return { - title: '', + title: '', status: false, standStatus: true, allChecked: false, @@ -100,31 +100,31 @@ export default { radio: '1', operate: null, command: true, - sure: false, - currentSelect: null, - noInit: true, - changeIgnore: false, + sure: false, + currentSelect: null, + noInit: true, + changeIgnore: false }; }, computed: { ...mapGetters('map', [ 'sectionList' ]), - cmdType() { - return '' - }, - initSelect() { - return this.initInfo.initSelect||{}; - }, - disabled() { - return !this.currentSelect || this.currentSelect.blockade || this.noInit; - }, + cmdType() { + return ''; + }, + initSelect() { + return this.initInfo.initSelect || {}; + }, + disabled() { + return !this.currentSelect || this.currentSelect.blockade || this.noInit; + }, show() { return this.dialogShow && !this.$store.state.menuOperation.break; }, - tempList() { - return this.sectionList.filter(el => ['01', '04'].includes(el.type) ) - }, + tempList() { + return this.sectionList.filter(el => ['01', '04'].includes(el.type) ); + }, domIdChoose() { return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''; }, @@ -144,105 +144,105 @@ export default { this.commit(); } }, - updateDone() { - if (this.currentSelect) { - this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one'; - } - } + updateDone() { + if (this.currentSelect) { + this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one'; + } + } }, methods: { - getCacheMap() { - return this.initCacheMap[this.cmdType.value]||{}; - }, + getCacheMap() { + return this.initCacheMap[this.cmdType.value] || {}; + }, doShow(operate, sure) { - this.operate = operate; - this.sure = sure; - if (!sure) this.command = true; - this.title = `${sure? '确认/取消过岔锁闭取消': '初始化过岔锁闭取消'}`; - this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); + this.operate = operate; + this.sure = sure; + if (!sure) this.command = true; + this.title = `${sure ? '确认/取消过岔锁闭取消' : '初始化过岔锁闭取消'}`; + this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure - this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null); + this.changeIgnore = sure; + this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$store.dispatch('training/emitTipFresh'); }); }, doClose() { this.loading = false; this.dialogShow = false; - this.sure && (this.currentSelect = null); - this.sure && this.$refs.table.setCurrentRow(); - this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, - Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) - ) + this.sure && (this.currentSelect = null); + this.sure && this.$refs.table.setCurrentRow(); + this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, + Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) + ); this.$store.dispatch('training/emitTipFresh'); }, commit(isClose = true) { - if (this.currentSelect && + if (this.currentSelect && this.currentSelect.code == this.initSelect.code) { - const cacheMap= this.getCacheMap(); - const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code]) - const operate = { - cmdType: this.sure&&isOK? this.cmdType: null, - operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, - over: this.sure, - param: {sectionCode: this.currentSelect.code} - }; + const cacheMap = this.getCacheMap(); + const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]); + const operate = { + cmdType: this.sure && isOK ? this.cmdType : null, + operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, + over: this.sure, + param: {sectionCode: this.currentSelect.code} + }; - this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (isOK) { - this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'}); - } else { - this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code); - } - this.$emit('updateDone') - this.$store.dispatch('map/flushMapRef'); - isClose && this.doClose(); - } - }).catch(() => { - isClose && this.isClose(); - this.$refs.noticeInfo.doShow(); - }); - } else { - this.$messageBox('两次选择不一致'); - } + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (isOK) { + this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure ? 'two' : 'one'}); + } else { + this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code); + } + this.$emit('updateDone'); + this.$store.dispatch('map/flushMapRef'); + isClose && this.doClose(); + } + }).catch(() => { + isClose && this.isClose(); + this.$refs.noticeInfo.doShow(); + }); + } else { + this.$messageBox('两次选择不一致'); + } }, - handleChangeLine(val) { - if (!val) { return; } - this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); - this.$emit('updateDone') + handleChangeLine(val) { + if (!val) { return; } + this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); + this.$emit('updateDone'); if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; - this.changeIgnore = false; - this.$emit('updateDone') + this.changeIgnore = false; + this.$emit('updateDone'); this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.sure || this.$emit('initSelect', this.currentSelect); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.sure || this.$emit('initSelect', this.currentSelect); } }).catch(() => { this.$refs.noticeInfo.doShow(); }); }, - getProcess(code) { - const cacheMap = this.getCacheMap(); - const cache = cacheMap[code]; - if (cache) { - if (this.sure) { - return cache.done == 'two' ? '确认过岔锁闭取消完成' : '等待确认/取消'; - } else { - return cache.done == 'one' ? '已初始化' : '' - } - } - return ''; + getProcess(code) { + const cacheMap = this.getCacheMap(); + const cache = cacheMap[code]; + if (cache) { + if (this.sure) { + return cache.done == 'two' ? '确认过岔锁闭取消完成' : '等待确认/取消'; + } else { + return cache.done == 'one' ? '已初始化' : ''; + } + } + return ''; }, getStationPIM(code) { return '16-NSW'; @@ -250,12 +250,12 @@ export default { getSectionMode(code) { return '后备'; }, - getSectionCanStatus(code) { - return '否' - }, - getSectionHasStatus(code) { - return '否' - }, + getSectionCanStatus(code) { + return '否'; + }, + getSectionHasStatus(code) { + return '否'; + }, cancel() { const operate = { operation: OperationEvent.Command.common.close.operation diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelTransferLock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelTransferLock.vue index 82582e6e7..ca81a9438 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelTransferLock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancelTransferLock.vue @@ -14,7 +14,7 @@ {{ getSectionMode(scope.row.code) }} - + @@ -26,7 +26,7 @@ - +
命令 @@ -64,27 +64,27 @@ export default { components: { NoticeInfo }, - props: { - initCacheMap: { - type: Object, - default() { - return {} - } - }, - initInfo: { - type: Object, - default() { - return {} - } - }, - updateDone: { - type: Number, - default: 0 - } - }, + props: { + initCacheMap: { + type: Object, + default() { + return {}; + } + }, + initInfo: { + type: Object, + default() { + return {}; + } + }, + updateDone: { + type: Number, + default: 0 + } + }, data() { return { - title: '', + title: '', status: false, standStatus: true, allChecked: false, @@ -95,31 +95,31 @@ export default { radio: '1', operate: null, command: true, - sure: false, - currentSelect: null, - noInit: true, - changeIgnore: false + sure: false, + currentSelect: null, + noInit: true, + changeIgnore: false }; }, computed: { ...mapGetters('map', [ 'sectionList' ]), - cmdType() { - return '' - }, - initSelect() { - return this.initInfo.initSelect||{}; - }, - disabled() { - return !this.currentSelect || this.currentSelect.blockade || this.noInit; - }, + cmdType() { + return ''; + }, + initSelect() { + return this.initInfo.initSelect || {}; + }, + disabled() { + return !this.currentSelect || this.currentSelect.blockade || this.noInit; + }, show() { return this.dialogShow && !this.$store.state.menuOperation.break; }, - tempList() { - return this.sectionList.filter(el => ['01', '04'].includes(el.type) ) - }, + tempList() { + return this.sectionList.filter(el => ['01', '04'].includes(el.type) ); + }, domIdChoose() { return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''; }, @@ -139,105 +139,105 @@ export default { this.commit(); } }, - updateDone() { - if (this.currentSelect) { - this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one'; - } - } + updateDone() { + if (this.currentSelect) { + this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one'; + } + } }, methods: { - getCacheMap() { - return this.initCacheMap[this.cmdType.value]||{}; - }, + getCacheMap() { + return this.initCacheMap[this.cmdType.value] || {}; + }, doShow(operate, sure) { - this.operate = operate; - this.sure = sure; - if (!sure) this.command = true; - this.title = `${sure? '确认/取消转换锁闭取消': '初始化转换锁闭取消'}`; - this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); + this.operate = operate; + this.sure = sure; + if (!sure) this.command = true; + this.title = `${sure ? '确认/取消转换锁闭取消' : '初始化转换锁闭取消'}`; + this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; - this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null); + this.changeIgnore = sure; + this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$store.dispatch('training/emitTipFresh'); }); }, doClose() { this.loading = false; this.dialogShow = false; - this.sure && (this.currentSelect = null); - this.sure && this.$refs.table.setCurrentRow(); - this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, - Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) - ) + this.sure && (this.currentSelect = null); + this.sure && this.$refs.table.setCurrentRow(); + this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, + Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) + ); this.$store.dispatch('training/emitTipFresh'); }, commit(isClose = true) { - if (this.currentSelect && + if (this.currentSelect && this.currentSelect.code == this.initSelect.code) { - const cacheMap= this.getCacheMap(); - const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code]) - const operate = { - cmdType: this.sure&&isOK? this.cmdType: null, - operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, - over: this.sure, - param: {sectionCode: this.currentSelect.code} - }; + const cacheMap = this.getCacheMap(); + const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]); + const operate = { + cmdType: this.sure && isOK ? this.cmdType : null, + operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, + over: this.sure, + param: {sectionCode: this.currentSelect.code} + }; - this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (isOK) { - this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'}); - } else { - this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code); - } - this.$emit('updateDone') - this.$store.dispatch('map/flushMapRef'); - isClose && this.doClose(); - } - }).catch(() => { - isClose && this.isClose(); - this.$refs.noticeInfo.doShow(); - }); - } else { - this.$messageBox('两次选择不一致'); - } + this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (isOK) { + this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure ? 'two' : 'one'}); + } else { + this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code); + } + this.$emit('updateDone'); + this.$store.dispatch('map/flushMapRef'); + isClose && this.doClose(); + } + }).catch(() => { + isClose && this.isClose(); + this.$refs.noticeInfo.doShow(); + }); + } else { + this.$messageBox('两次选择不一致'); + } }, - handleChangeLine(val) { - if (!val) { return; } - this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); - this.$emit('updateDone') + handleChangeLine(val) { + if (!val) { return; } + this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); + this.$emit('updateDone'); if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; - this.changeIgnore = false; - this.$emit('updateDone') + this.changeIgnore = false; + this.$emit('updateDone'); this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.sure || this.$emit('initSelect', this.currentSelect); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.sure || this.$emit('initSelect', this.currentSelect); } }).catch(() => { this.$refs.noticeInfo.doShow(); }); }, - getProcess(code) { - const cacheMap = this.getCacheMap(); - const cache = cacheMap[code]; - if (cache) { - if (this.sure) { - return cache.done == 'two' ? '确认转换锁闭取消完成' : '等待确认/取消'; - } else { - return cache.done == 'one' ? '已初始化' : '' - } - } - return ''; + getProcess(code) { + const cacheMap = this.getCacheMap(); + const cache = cacheMap[code]; + if (cache) { + if (this.sure) { + return cache.done == 'two' ? '确认转换锁闭取消完成' : '等待确认/取消'; + } else { + return cache.done == 'one' ? '已初始化' : ''; + } + } + return ''; }, getStationPIM(code) { return '16-NSW'; @@ -245,10 +245,10 @@ export default { getSectionMode(code) { return '后备'; }, - getSectionLock(code) { + getSectionLock(code) { const elem = this.$store.getters['map/getDeviceByCode'](code); return elem.blockade ? '关闭' : '打开'; - }, + }, cancel() { const operate = { operation: OperationEvent.Command.common.close.operation diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue index 4ee98fe5c..71867af7f 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue @@ -171,7 +171,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: `${val.code}`, + // code: `${val.code}`, operation: OperationEvent.Command.common.choose.operation, val: val.code, param: { diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue index 794ce6024..9da671342 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue @@ -278,7 +278,7 @@ export default { if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionOpen.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionOpen.vue index 59566fc4b..9d5505eb3 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionOpen.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionOpen.vue @@ -238,7 +238,7 @@ export default { if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue index 073828049..b229412e4 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue @@ -237,7 +237,7 @@ export default { if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue index 38a5009e5..74151bf75 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue @@ -222,7 +222,7 @@ export default { if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue index df8718c71..c4a0ed3fa 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue @@ -227,7 +227,7 @@ export default { if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalMode.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalMode.vue index 6d2e498ff..ac0da5849 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalMode.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalMode.vue @@ -18,7 +18,7 @@ - +
命令
确认 @@ -32,7 +32,7 @@ 确定(O) - 应用(A) + 应用(A) 关闭(C) @@ -52,40 +52,40 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; export default { - props: { - initCacheMap: { - type: Object, - default() { - return {} - } - }, - initInfo: { - type: Object, - default() { - return {} - } - }, - updateDone: { - type: Number, - default: 0 - } - }, components: { NoticeInfo }, + props: { + initCacheMap: { + type: Object, + default() { + return {}; + } + }, + initInfo: { + type: Object, + default() { + return {}; + } + }, + updateDone: { + type: Number, + default: 0 + } + }, data() { return { - title: '', + title: '', status: false, command: true, allChecked: false, dialogShow: false, loading: false, operate: {}, - sure: false, - currentSelect: null, - noInit: true, - changeIgnore: false + sure: false, + currentSelect: null, + noInit: true, + changeIgnore: false }; }, computed: { @@ -95,21 +95,21 @@ export default { show() { return this.dialogShow && !this.$store.state.menuOperation.break; }, - tempList() { - return this.signalList; - }, - initSelect() { - return this.initInfo.initSelect||{}; - }, - isCbtc() { - return true //this.operate.operation.includes(OperationEvent.Command.mBar.cbtcMode.operation); + tempList() { + return this.signalList; + }, + initSelect() { + return this.initInfo.initSelect || {}; + }, + isCbtc() { + return true; // this.operate.operation.includes(OperationEvent.Command.mBar.cbtcMode.operation); + }, + cmdType() { + return this.isCbtc ? CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING : CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING; + }, + disabled() { + return !this.currentSelect || this.noInit; }, - cmdType() { - return this.isCbtc ? CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING : CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING; - }, - disabled() { - return !this.currentSelect || this.noInit; - }, domIdChoose() { return this.dialogShow ? OperationEvent.Command.common.choose.domId : ''; }, @@ -129,97 +129,97 @@ export default { this.commit(); } }, - updateDone() { - if (this.currentSelect) { - this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one'; - } - } + updateDone() { + if (this.currentSelect) { + this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one'; + } + } }, methods: { - getCacheMap() { - return this.initCacheMap[this.cmdType.value]||{}; - }, + getCacheMap() { + return this.initCacheMap[this.cmdType.value] || {}; + }, doShow(operate, sure) { - this.operate = operate; - this.sure = sure; + this.operate = operate; + this.sure = sure; - if (sure) { - this.title = `${this.isCbtc ? '确认/取消CBTC模式' : '确认/取消后备模式'}`; - } else { - this.title = `${this.isCbtc ? '初始化CBTC模式' : '初始化后备模式'}`; - this.command = true; - } + if (sure) { + this.title = `${this.isCbtc ? '确认/取消CBTC模式' : '确认/取消后备模式'}`; + } else { + this.title = `${this.isCbtc ? '初始化CBTC模式' : '初始化后备模式'}`; + this.command = true; + } - this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); + this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; - this.$refs.table.setCurrentRow(sure? this.tempList.find(el => el.code == this.initSelect.code): null); + this.changeIgnore = sure; + this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$store.dispatch('training/emitTipFresh'); }); }, doClose() { this.loading = false; this.dialogShow = false; - this.sure && (this.currentSelect = null); - this.sure && this.$refs.table.setCurrentRow(); - this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, - Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) - ) + this.sure && (this.currentSelect = null); + this.sure && this.$refs.table.setCurrentRow(); + this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, + Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) + ); this.$store.dispatch('training/emitTipFresh'); }, - handleCurrentChange(val) { - if (!val) { return; } - this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); - this.$emit('updateDone') + handleCurrentChange(val) { + if (!val) { return; } + this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); + this.$emit('updateDone'); if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; - this.changeIgnore = false; + this.changeIgnore = false; this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.sure || this.$emit('initSelect', this.currentSelect); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.sure || this.$emit('initSelect', this.currentSelect); } }).catch(_ => { this.$refs.noticeInfo.doShow(); }); }, commit(isClose = false) { - if (this.currentSelect && + if (this.currentSelect && this.currentSelect.code == this.initSelect.code) { - const cacheMap= this.getCacheMap(); - const isOK = this.command&&(!this.sure || this.sure&&cacheMap[this.currentSelect.code]) - const step = { - cmdType: this.sure&&isOK? this.cmdType: null, - operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, - over: this.sure, - param: { signalCode: this.currentSelect.code } - }; + const cacheMap = this.getCacheMap(); + const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]); + const step = { + cmdType: this.sure && isOK ? this.cmdType : null, + operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, + over: this.sure, + param: { signalCode: this.currentSelect.code } + }; - this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (isOK) { - this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure? 'two': 'one'}); - } else { - this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code); - } - this.$store.dispatch('map/flushMapRef'); - isClose && this.doClose(); - } - }).catch(() => { - isClose && this.doClose(); - this.$refs.noticeInfo.doShow(); - }); - } else { - this.$messageBox('两次选择不一致'); - } + this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (isOK) { + this.$root.$emit('appendCache', this.cmdType.value, this.currentSelect.code, { done: this.sure ? 'two' : 'one'}); + } else { + this.$root.$emit('removeCache', this.cmdType.value, this.currentSelect.code); + } + this.$store.dispatch('map/flushMapRef'); + isClose && this.doClose(); + } + }).catch(() => { + isClose && this.doClose(); + this.$refs.noticeInfo.doShow(); + }); + } else { + this.$messageBox('两次选择不一致'); + } }, cancel() { const operate = { diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue index e02e24389..432cce3ce 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue @@ -122,7 +122,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue index 40dbeffcf..5f718901f 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationDevolution.vue @@ -176,7 +176,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationReclaim.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationReclaim.vue index c759be108..470e74ad5 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationReclaim.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationReclaim.vue @@ -193,7 +193,7 @@ export default { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue index 11be5decb..98797fb9d 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationRequest.vue @@ -204,7 +204,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationTransfer.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationTransfer.vue index c804b708a..8d7492428 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationTransfer.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/stationTransfer.vue @@ -214,7 +214,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchActive.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchActive.vue index 8b5c3943f..ee5a76d81 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchActive.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchActive.vue @@ -155,7 +155,7 @@ export default { handleCurrentChange(val) { if (!val) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchBlock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchBlock.vue index f48d6d202..07cdc4e4d 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchBlock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchBlock.vue @@ -240,7 +240,7 @@ export default { if (this.changeIgnore) { return; } const step = { - code: val.code, + // code: val.code, operation: OperationEvent.Command.common.choose.operation, val: val.code }; diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index e883cfb1b..338dfedf4 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -674,6 +674,54 @@ export const OperationEvent = { operation: '00b', domId: '' } + }, + // 宁波一 + commandNingBo1: { + // 区域选择 + areaSelection: { + operation: '00c', + domId: '_Tips-ningBo1-areaSelection' + }, + // 全部申请 + applyAll: { + operation: '00c1', + domId: '_Tips-ningBo1-areaSelection-applyAll' + }, + // 取消全部申请 + cancelApplyAll: { + operation: '00c2', + domId: '_Tips-ningBo1-areaSelection-cancelApplyAll' + }, + // 全部释放 + releaseAll: { + operation: '00c3', + domId: '_Tips-ningBo1-areaSelection-releaseAll' + }, + // 取消全部释放 + cancelReleaseAll: { + operation: '00c4', + domId: '_Tips-ningBo1-areaSelection-cancelReleaseAll' + }, + // 全部强制分配 + distributionAll: { + operation: '00c5', + domId: '_Tips-ningBo1-areaSelection-distributionAll' + }, + // 取消全部强制分配 + cancelDistributionAll: { + operation: '00c6', + domId: '_Tips-ningBo1-areaSelection-cancelDistributionAll' + }, + // 应用 + commit: { + operation: '00c7', + domId: '_Tips-ningBo1-areaSelection-commit' + }, + // 退出 + doClose: { + operation: '00c8', + domId: '_Tips-ningBo1-areaSelection-doClose' + } } }, // 站台概要表 @@ -2966,7 +3014,7 @@ export const OperationEvent = { // 区域选择 申请控制权 areaSelection: { menu: { - operation: '616', + c: '616', domId: '_Tips-Station-areaSelection-Menu' }, mbar: {