代码调整
This commit is contained in:
parent
75d2ea8aed
commit
2c66d6aadf
@ -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
|
||||
};
|
||||
|
@ -31,7 +31,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="5" :offset="1" v-if="sure">
|
||||
<el-col v-if="sure" :span="5" :offset="1">
|
||||
<fieldset style="position: absolute;top: 40%;">
|
||||
<legend class="card_title">命令</legend>
|
||||
<el-radio-group v-model="command">
|
||||
@ -73,13 +73,13 @@ export default {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
@ -103,7 +103,7 @@ export default {
|
||||
sure: false,
|
||||
currentSelect: null,
|
||||
noInit: true,
|
||||
changeIgnore: false,
|
||||
changeIgnore: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -111,10 +111,10 @@ export default {
|
||||
'sectionList'
|
||||
]),
|
||||
cmdType() {
|
||||
return ''
|
||||
return '';
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect||{};
|
||||
return this.initInfo.initSelect || {};
|
||||
},
|
||||
disabled() {
|
||||
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
|
||||
@ -123,7 +123,7 @@ export default {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
tempList() {
|
||||
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
|
||||
return this.sectionList.filter(el => ['01', '04'].includes(el.type) );
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
@ -146,24 +146,24 @@ export default {
|
||||
},
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value]||{};
|
||||
return this.initCacheMap[this.cmdType.value] || {};
|
||||
},
|
||||
doShow(operate, sure) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (!sure) this.command = true;
|
||||
this.title = `${sure? '确认/取消过岔锁闭取消': '初始化过岔锁闭取消'}`;
|
||||
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');
|
||||
});
|
||||
},
|
||||
@ -174,16 +174,16 @@ export default {
|
||||
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 &&
|
||||
this.currentSelect.code == this.initSelect.code) {
|
||||
const cacheMap= this.getCacheMap();
|
||||
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[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,
|
||||
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}
|
||||
@ -193,11 +193,11 @@ export default {
|
||||
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'});
|
||||
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.$emit('updateDone');
|
||||
this.$store.dispatch('map/flushMapRef');
|
||||
isClose && this.doClose();
|
||||
}
|
||||
@ -212,17 +212,17 @@ export default {
|
||||
handleChangeLine(val) {
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone')
|
||||
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.$emit('updateDone');
|
||||
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
@ -239,7 +239,7 @@ export default {
|
||||
if (this.sure) {
|
||||
return cache.done == 'two' ? '确认过岔锁闭取消完成' : '等待确认/取消';
|
||||
} else {
|
||||
return cache.done == 'one' ? '已初始化' : ''
|
||||
return cache.done == 'one' ? '已初始化' : '';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
@ -251,10 +251,10 @@ export default {
|
||||
return '后备';
|
||||
},
|
||||
getSectionCanStatus(code) {
|
||||
return '否'
|
||||
return '否';
|
||||
},
|
||||
getSectionHasStatus(code) {
|
||||
return '否'
|
||||
return '否';
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
@ -26,7 +26,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="5" :offset="1" v-if="sure">
|
||||
<el-col v-if="sure" :span="5" :offset="1">
|
||||
<fieldset style="position: absolute;top: 40%;">
|
||||
<legend class="card_title">命令</legend>
|
||||
<el-radio-group v-model="command">
|
||||
@ -68,13 +68,13 @@ export default {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
@ -106,10 +106,10 @@ export default {
|
||||
'sectionList'
|
||||
]),
|
||||
cmdType() {
|
||||
return ''
|
||||
return '';
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect||{};
|
||||
return this.initInfo.initSelect || {};
|
||||
},
|
||||
disabled() {
|
||||
return !this.currentSelect || this.currentSelect.blockade || this.noInit;
|
||||
@ -118,7 +118,7 @@ export default {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
tempList() {
|
||||
return this.sectionList.filter(el => ['01', '04'].includes(el.type) )
|
||||
return this.sectionList.filter(el => ['01', '04'].includes(el.type) );
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Command.common.choose.domId : '';
|
||||
@ -141,24 +141,24 @@ export default {
|
||||
},
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value]||{};
|
||||
return this.initCacheMap[this.cmdType.value] || {};
|
||||
},
|
||||
doShow(operate, sure) {
|
||||
this.operate = operate;
|
||||
this.sure = sure;
|
||||
if (!sure) this.command = true;
|
||||
this.title = `${sure? '确认/取消转换锁闭取消': '初始化转换锁闭取消'}`;
|
||||
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.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
@ -169,16 +169,16 @@ export default {
|
||||
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 &&
|
||||
this.currentSelect.code == this.initSelect.code) {
|
||||
const cacheMap= this.getCacheMap();
|
||||
const isOK = this.command&&(!this.sure || this.sure&&cacheMap[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,
|
||||
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}
|
||||
@ -188,11 +188,11 @@ export default {
|
||||
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'});
|
||||
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.$emit('updateDone');
|
||||
this.$store.dispatch('map/flushMapRef');
|
||||
isClose && this.doClose();
|
||||
}
|
||||
@ -207,17 +207,17 @@ export default {
|
||||
handleChangeLine(val) {
|
||||
if (!val) { return; }
|
||||
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
|
||||
this.$emit('updateDone')
|
||||
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.$emit('updateDone');
|
||||
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
@ -234,7 +234,7 @@ export default {
|
||||
if (this.sure) {
|
||||
return cache.done == 'two' ? '确认转换锁闭取消完成' : '等待确认/取消';
|
||||
} else {
|
||||
return cache.done == 'one' ? '已初始化' : ''
|
||||
return cache.done == 'one' ? '已初始化' : '';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
|
@ -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: {
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -18,7 +18,7 @@
|
||||
<el-table-column v-if="!isCbtc" prop="status" label="后备模式进程" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="5" :offset="1" v-if="sure">
|
||||
<el-col v-if="sure" :span="5" :offset="1">
|
||||
<div class="set-status-title">命令</div>
|
||||
<div class="set-status-box">
|
||||
<el-radio v-model="command" :label="true">确认</el-radio>
|
||||
@ -52,17 +52,20 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
initCacheMap: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
initInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
updateDone: {
|
||||
@ -70,9 +73,6 @@ export default {
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
@ -99,10 +99,10 @@ export default {
|
||||
return this.signalList;
|
||||
},
|
||||
initSelect() {
|
||||
return this.initInfo.initSelect||{};
|
||||
return this.initInfo.initSelect || {};
|
||||
},
|
||||
isCbtc() {
|
||||
return true //this.operate.operation.includes(OperationEvent.Command.mBar.cbtcMode.operation);
|
||||
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;
|
||||
@ -131,13 +131,13 @@ export default {
|
||||
},
|
||||
updateDone() {
|
||||
if (this.currentSelect) {
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code]||{}).done != 'one';
|
||||
this.noInit = this.sure && (this.getCacheMap()[this.currentSelect.code] || {}).done != 'one';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCacheMap() {
|
||||
return this.initCacheMap[this.cmdType.value]||{};
|
||||
return this.initCacheMap[this.cmdType.value] || {};
|
||||
},
|
||||
doShow(operate, sure) {
|
||||
this.operate = operate;
|
||||
@ -154,7 +154,7 @@ export default {
|
||||
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.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
@ -165,17 +165,17 @@ export default {
|
||||
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')
|
||||
this.$emit('updateDone');
|
||||
if (this.changeIgnore) { return; }
|
||||
|
||||
const step = {
|
||||
code: val.code,
|
||||
// code: val.code,
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code
|
||||
};
|
||||
@ -193,10 +193,10 @@ export default {
|
||||
commit(isClose = false) {
|
||||
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 cacheMap = this.getCacheMap();
|
||||
const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]);
|
||||
const step = {
|
||||
cmdType: this.sure&&isOK? this.cmdType: null,
|
||||
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 }
|
||||
@ -206,7 +206,7 @@ export default {
|
||||
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'});
|
||||
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);
|
||||
}
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -193,7 +193,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
const step = {
|
||||
code: val.code,
|
||||
// code: val.code,
|
||||
operation: OperationEvent.Command.common.choose.operation,
|
||||
val: val.code
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user