调整宁波三轨道实训提示问题

This commit is contained in:
dong 2023-01-06 16:10:10 +08:00
parent aaafb5beec
commit 205dda94fb
3 changed files with 106 additions and 38 deletions

View File

@ -196,9 +196,12 @@ export default {
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.changeIgnore = sure; this.changeIgnore = true;
this.$refs.singleTable1.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$refs.singleTable1.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
this.isSetSpeed && this.$refs.singleTable2.setCurrentRow(sure ? this.limitList[this.initParams.value / 5 - 1] : 0); this.isSetSpeed && this.$refs.singleTable2.setCurrentRow(sure ? this.limitList[this.initParams.value / 5 - 1] : 0);
setTimeout(()=> {
this.changeIgnore = false;
}, 200);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -214,13 +217,15 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code); this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.changeIgnore = sure; this.changeIgnore = true;
let index = 0; let index = 0;
const section = this.tempList.find((el, i) => { index = i; return el.code == selected.code; }); const section = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
this.$refs.singleTable1.setCurrentRow(section); this.$refs.singleTable1.setCurrentRow(section);
this.speedLimitValue = this.initParams.value || 0; // this.speedLimitValue = this.initParams.value || 0;
this.speedLimitValue = this.getLimitSpeed(section.code);
setTimeout(()=> { setTimeout(()=> {
this.$refs.singleTable1.bodyWrapper.scrollTop = index * 20; this.$refs.singleTable1.bodyWrapper.scrollTop = index * 20;
this.changeIgnore = false;
}, 200); }, 200);
this.$emit('updateDone'); this.$emit('updateDone');
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -230,9 +235,9 @@ export default {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.speedLimitValue = 0; this.speedLimitValue = 0;
this.sure && (this.currentSelect = null); this.currentSelect = null;
this.sure && this.$refs.singleTable1.setCurrentRow(); this.$refs.singleTable1.setCurrentRow();
this.sure && this.isSetSpeed && this.$refs.singleTable2.setCurrentRow(); this.isSetSpeed && this.$refs.singleTable2.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
); );
@ -274,20 +279,21 @@ export default {
selectLine1(val) { selectLine1(val) {
if (!val) { return; } if (!val) { return; }
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.isSetSpeed ? this.speedLimitValue : this.getLimitSpeed(val.code)});
this.$emit('updateDone'); this.$emit('updateDone');
if (this.changeIgnore) { return; } if (this.changeIgnore) { return; }
const step = { const step = {
// code: val.code, // code: val.code,
operation: OperationEvent.Command.common.choose.operation, operation: OperationEvent.Command.common.choose.operation,
val: val.code param: {
val: val.code
}
}; };
this.changeIgnore = false;
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.speedLimitValue});
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
@ -296,19 +302,20 @@ export default {
selectLine2(val) { selectLine2(val) {
if (!val) { return; } if (!val) { return; }
this.speedLimitValue = val.value; this.speedLimitValue = val.value;
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.isSetSpeed ? this.speedLimitValue : 0});
this.$emit('updateDone'); this.$emit('updateDone');
if (this.changeIgnore) { return; } if (this.changeIgnore) { return; }
const step = { const step = {
operation: OperationEvent.Command.common.select.operation, operation: OperationEvent.Command.common.select.operation,
val: val.value param: {
val: val.value
}
}; };
this.changeIgnore = false;
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect, {value: this.isSetSpeed ? this.speedLimitValue : 0});
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();

View File

@ -161,8 +161,9 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.changeIgnore = sure; const section = 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.changeIgnore = !!section;
this.$refs.table.setCurrentRow(section);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -180,6 +181,7 @@ export default {
this.$nextTick(function () { this.$nextTick(function () {
let index = 0; let index = 0;
const section = this.tempList.find((el, i) => { index = i; return el.code == selected.code; }); const section = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!section;
this.$refs.table.setCurrentRow(section); this.$refs.table.setCurrentRow(section);
setTimeout(()=> { setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20; this.$refs.table.bodyWrapper.scrollTop = index * 20;
@ -191,8 +193,9 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.sure && (this.currentSelect = null); this.currentSelect = null;
this.sure && this.$refs.table.setCurrentRow(); this.changeIgnore = false;
this.$refs.table.setCurrentRow();
this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value,
Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done'))
); );
@ -234,21 +237,25 @@ export default {
handleChangeLine(val) { handleChangeLine(val) {
if (!val) { return; } if (!val) { return; }
this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code);
this.sure || this.$emit('initSelect', this.currentSelect);
this.$emit('updateDone'); this.$emit('updateDone');
if (this.changeIgnore) { return; } if (this.changeIgnore) {
this.changeIgnore = false;
return;
}
const step = { const step = {
// code: val.code, // code: val.code,
operation: OperationEvent.Command.common.choose.operation, operation: OperationEvent.Command.common.choose.operation,
val: val.code param: {
val: val.code
}
}; };
this.changeIgnore = false;
this.$emit('updateDone'); this.$emit('updateDone');
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.sure || this.$emit('initSelect', this.currentSelect);
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();

View File

@ -80,10 +80,12 @@ export default {
children: [ children: [
{ {
label: '初始化', label: '初始化',
operate: OperationEvent.Command.commandNingBo3.line_section_open_init,
handler: this.handlerInitOpen handler: this.handlerInitOpen
}, },
{ {
label: '确定/取消', label: '确定/取消',
operate: OperationEvent.Command.commandNingBo3.line_section_open_sure,
handler: this.handlerOpen handler: this.handlerOpen
} }
] ]
@ -93,10 +95,12 @@ export default {
children: [ children: [
{ {
label: '初始化', label: '初始化',
operate: OperationEvent.Command.commandNingBo3.line_section_close_init,
handler: this.handlerInitClose handler: this.handlerInitClose
}, },
{ {
label: '确定/取消', label: '确定/取消',
operate: OperationEvent.Command.commandNingBo3.line_section_close_sure,
handler: this.handlerClose handler: this.handlerClose
} }
] ]
@ -109,10 +113,12 @@ export default {
children: [ children: [
{ {
label: '初始化', label: '初始化',
operate: OperationEvent.Command.commandNingBo3.line_section_setSpeed_init,
handler: this.handlerInitSetLimit handler: this.handlerInitSetLimit
}, },
{ {
label: '确定/取消', label: '确定/取消',
operate: OperationEvent.Command.commandNingBo3.line_section_setSpeed_sure,
handler: this.handlerSetLimit handler: this.handlerSetLimit
} }
] ]
@ -122,10 +128,12 @@ export default {
children: [ children: [
{ {
label: '初始化', label: '初始化',
operate: OperationEvent.Command.commandNingBo3.line_section_clearSpeed_init,
handler: this.handlerInitCancelLimit handler: this.handlerInitCancelLimit
}, },
{ {
label: '确定/取消', label: '确定/取消',
operate: OperationEvent.Command.commandNingBo3.line_section_clearSpeed_sure,
handler: this.handlerCancelLimit handler: this.handlerCancelLimit
} }
] ]
@ -134,6 +142,7 @@ export default {
}, },
{ {
label: '显示', label: '显示',
operate: OperationEvent.Command.commandNingBo3.line_section_detail,
handler: this.handlerDetail handler: this.handlerDetail
} }
], ],
@ -313,32 +322,77 @@ export default {
} }
}); });
}, },
handlerInitOpen() { handlerInitOpen(item) {
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_open_init, false, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionOpen.rightClickShow(item.operate, false, this.selected);
}, },
handlerOpen() { handlerOpen(item) {
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_open_sure, true, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionOpen.rightClickShow(item.operate, true, this.selected);
}, },
handlerInitClose() { handlerInitClose(item) {
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_close_init, false, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionOpen.rightClickShow(item.operate, false, this.selected);
}, },
handlerClose() { handlerClose(item) {
this.$refs.sectionOpen.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_close_sure, true, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionOpen.rightClickShow(item.operate, true, this.selected);
}, },
handlerInitSetLimit() { handlerInitSetLimit(item) {
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_setSpeed_init, false, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionLimitSpeed.rightClickShow(item.operate, false, this.selected);
}, },
handlerSetLimit() { handlerSetLimit(item) {
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_setSpeed_sure, true, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionLimitSpeed.rightClickShow(item.operate, true, this.selected);
}, },
handlerInitCancelLimit() { handlerInitCancelLimit(item) {
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_clearSpeed_init, false, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionLimitSpeed.rightClickShow(item.operate, false, this.selected);
}, },
handlerCancelLimit() { handlerCancelLimit(item) {
this.$refs.sectionLimitSpeed.rightClickShow(OperationEvent.Command.commandNingBo3.line_section_clearSpeed_sure, true, this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionLimitSpeed.rightClickShow(item.operate, true, this.selected);
}, },
handlerDetail() { handlerDetail(item) {
this.$refs.sectionShow.rightClickShow('', this.selected); const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.sectionShow.rightClickShow(item.operate, this.selected);
} }
} }
}; };