代码调整

This commit is contained in:
dong 2022-12-16 17:25:44 +08:00
parent 75d2ea8aed
commit 2c66d6aadf
16 changed files with 332 additions and 332 deletions

View File

@ -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
};

View File

@ -4,22 +4,22 @@
<el-col :span="sure? 18: 24">
<el-table :id="domIdChoose" ref="table" :data="tempList" highlight-current-row height="300px" @current-change="handleChangeLine">
<el-table-column prop="name" width="90" label="闭塞区段" />
<el-table-column width="90" label="PMI">
<el-table-column width="90" label="PMI">
<template slot-scope="scope">
<span>{{ getStationPIM(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column width="90" label="信号模式">
<el-table-column width="90" label="信号模式">
<template slot-scope="scope">
<span>{{ getSectionMode(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="120" label="过岔锁闭可取消">
<el-table-column width="120" label="过岔锁闭可取消">
<template slot-scope="scope">
<span>{{ getSectionCanStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="120" label="过岔锁闭已取消">
<el-table-column width="120" label="过岔锁闭已取消">
<template slot-scope="scope">
<span>{{ getSectionHasStatus(scope.row.code) }}</span>
</template>
@ -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">
@ -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

View File

@ -14,7 +14,7 @@
<span>{{ getSectionMode(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column width="90" label="转换锁闭">
<el-table-column width="90" label="转换锁闭">
<template slot-scope="scope">
<span>{{ getSectionLock(scope.row.code) }}</span>
</template>
@ -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">
@ -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

View File

@ -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: {

View File

@ -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
};

View File

@ -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
};

View File

@ -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
};

View File

@ -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
};

View File

@ -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>
@ -32,7 +32,7 @@
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(true)">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!!disabled" :loading="loading" @click="commit(false)">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -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 = {

View File

@ -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
};

View File

@ -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
};

View File

@ -193,7 +193,7 @@ export default {
return;
}
const step = {
code: val.code,
// code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};

View File

@ -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
};

View File

@ -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
};

View File

@ -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
};

View File

@ -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
};