命令
确认
@@ -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
};