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

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

View File

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

View File

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