Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2023-01-06 13:55:26 +08:00
commit d3eed2d956
10 changed files with 113 additions and 59 deletions

View File

@ -116,10 +116,11 @@ export default {
this.operate = operate;
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
this.selectSignalCode = selected.code;
let index = 0;
this.$refs.table.setCurrentRow(this.signalList.find((el, i) => { index = i; return el.code == selected.code; }));
const signal = this.signalList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!signal;
this.selectSignalCode = selected.code;
this.$refs.table.setCurrentRow(signal);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
}, 200);

View File

@ -304,9 +304,9 @@ export default {
this.operate = operate;
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
let index = 0;
const signal = this.signalList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!signal;
this.$refs.table.setCurrentRow(signal);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;

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 = true;
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
const cRow = sure ? this.tempList.find(el => el.code == this.initSelect.code) : null;
this.changeIgnore = !!cRow;
this.$refs.table.setCurrentRow(cRow);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -178,9 +179,10 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
let index = 0;
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
const cRow = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!cRow;
this.$refs.table.setCurrentRow(cRow);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
}, 200);

View File

@ -151,8 +151,9 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
const cRow = sure ? this.tempList.find(el => el.code == this.initSelect.code) : null;
this.changeIgnore = !!cRow;
this.$refs.table.setCurrentRow(cRow);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -163,9 +164,10 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
let index = 0;
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
const cRow = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!cRow;
this.$refs.table.setCurrentRow(cRow);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
}, 200);

View File

@ -156,8 +156,9 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code);
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null);
const cRow = sure ? this.tempList.find(el => el.code == this.initSelect.code) : null;
this.changeIgnore = !!cRow;
this.$refs.table.setCurrentRow(cRow);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -168,9 +169,10 @@ export default {
this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code);
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
let index = 0;
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
const cRow = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!cRow;
this.$refs.table.setCurrentRow(cRow);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
}, 200);

View File

@ -157,9 +157,9 @@ export default {
this.operate = operate;
this.dialogShow = true;
this.$nextTick(function () {
this.changeIgnore = true;
let index = 0;
const signal = this.filterSignalList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!signal;
this.$refs.table.setCurrentRow(signal);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;

View File

@ -61,7 +61,8 @@ export default {
allChecked: false,
dialogShow: false,
loading: false,
isActive: false
isActive: false,
changeIgnore: false
};
},
computed: {
@ -121,6 +122,7 @@ export default {
this.$nextTick(function () {
let index = 0;
const switchEle = this.switchList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!switchEle;
this.$refs.table.setCurrentRow(switchEle);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
@ -131,6 +133,7 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.changeIgnore = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
@ -154,13 +157,17 @@ export default {
},
handleCurrentChange(val) {
if (!val) { return; }
this.$store.dispatch('menuOperation/setSelected', {device: val});
if (this.changeIgnore) {
this.changeIgnore = false;
return;
}
const step = {
// code: val.code,
operation: OperationEvent.Command.common.choose.operation,
val: val.code
};
this.$store.dispatch('menuOperation/setSelected', {device: val});
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });

View File

@ -163,8 +163,9 @@ export default {
this.currentSelect = sure ? this.$store.getters['map/getDeviceByCode'](this.initSelect.code) : null;
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 switchEle = sure ? this.tempList.find(el => el.code == this.initSelect.code) : null;
this.changeIgnore = !!switchEle;
this.$refs.table.setCurrentRow(switchEle);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -182,6 +183,7 @@ export default {
this.$nextTick(function () {
let index = 0;
const switchEle = this.tempList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!switchEle;
this.$refs.table.setCurrentRow(switchEle);
setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
@ -236,8 +238,12 @@ export default {
handleCurrentChange(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,
@ -245,11 +251,9 @@ export default {
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);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();

View File

@ -89,7 +89,8 @@ export default {
selectedSwitch: {},
mode: '',
position: '',
reserved: ''
reserved: '',
changeIgnore: false
};
},
@ -177,11 +178,12 @@ export default {
this.$nextTick(function () {
let index = 0;
const switchEle = this.switchList.find((el, i) => { index = i; return el.code == selected.code; });
this.changeIgnore = !!switchEle;
this.$refs.table.setCurrentRow(switchEle);
setTimeout(() => {
this.$refs.table.bodyWrapper.scrollTop = index * 20;
}, 200);
this.handleCurrentChange(switchEle);
// this.handleCurrentChange(switchEle);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -190,6 +192,7 @@ export default {
this.dialogShow = false;
this.mode = '';
this.position = '';
this.changeIgnore = false;
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
@ -232,19 +235,15 @@ export default {
},
handleCurrentChange(val) {
if (!val) { return; }
commitOperate(menuOperate.Switch.turnout, {code:val.code}).then(({valid, operate})=>{
// if (valid) {
this.position = '';
const switchModel = this.$store.getters['map/getDeviceByCode'](val.code);
this.selectedSwitchCode = val.code;
this.selectedSwitch = switchModel;
// this.mode = elem.auto ? 'artificial' : 'auto';
// if (!elem.auto) {
// if (elem.normalPosition) { this.position = 'reverse'; }
// if (elem.reversePosition) { this.position = 'normal'; }
// }
// }
});
this.position = '';
const switchModel = this.$store.getters['map/getDeviceByCode'](val.code);
this.selectedSwitchCode = val.code;
this.selectedSwitch = switchModel;
if (this.changeIgnore) {
this.changeIgnore = false;
return;
}
commitOperate(menuOperate.Switch.turnout, {code:val.code});
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -71,6 +71,7 @@ export default {
menuNormal: [
{
label: '命令',
operate: OperationEvent.Command.commandNingBo3.line_switch_cmd,
handler: this.handlerCommand
},
@ -79,10 +80,12 @@ export default {
children: [
{
label: '初始化',
operate: OperationEvent.Command.commandNingBo3.line_switch_block_init,
handler: this.handlerInitBlock
},
{
label: '确定/取消',
operate: OperationEvent.Command.commandNingBo3.line_switch_block_sure,
handler: this.handlerBlock
}
]
@ -92,10 +95,12 @@ export default {
children: [
{
label: '初始化',
operate: OperationEvent.Command.commandNingBo3.line_switch_unblock_init,
handler: this.handlerInitUnblock
},
{
label: '确定/取消',
operate: OperationEvent.Command.commandNingBo3.line_switch_unblock_sure,
handler: this.handlerUnblock
}
]
@ -105,17 +110,20 @@ export default {
children: [
{
label: '请求或授权/取消',
operate: OperationEvent.Command.commandNingBo3.line_switch_empower_init,
handler: this.handlerActive
},
{
label: '显示',
disabled: true,
operate: OperationEvent.Command.commandNingBo3.line_switch_empower_sure,
handler: this.undeveloped
}
]
},
{
label: '显示',
operate: OperationEvent.Command.commandNingBo3.line_switch_detail,
handler: this.handlerDetail
}
],
@ -145,12 +153,6 @@ export default {
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
const operate = {
code: `${this.selected.code}`,
userOperationType: 'rightClick',
operation: OperationEvent.Command.commandRight.right.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
@ -230,26 +232,61 @@ export default {
hookLock() {
this.$refs.switchHookLock.doShow(this.selected);
},
handlerCommand() {
this.$refs.switchCommand.rightClickShow('', this.selected);
handlerCommand(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchCommand.rightClickShow(item.operate, this.selected);
},
handlerInitBlock() {
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_block_init, false, this.selected);
handlerInitBlock(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchBlock.rightClickShow(item.operate, false, this.selected);
},
handlerBlock() {
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_block_sure, true, this.selected);
handlerBlock(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchBlock.rightClickShow(item.operate, true, this.selected);
},
handlerInitUnblock() {
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_unblock_init, false, this.selected);
handlerInitUnblock(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchBlock.rightClickShow(item.operate, false, this.selected);
},
handlerUnblock() {
this.$refs.switchBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_switch_unblock_sure, true, this.selected);
handlerUnblock(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchBlock.rightClickShow(item.operate, true, this.selected);
},
handlerActive() {
this.$refs.switchActive.rightClickShow('', this.selected);
handlerActive(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchActive.rightClickShow(item.operate, this.selected);
},
handlerDetail() {
this.$refs.switchDetail.rightClickShow('', this.selected);
handlerDetail(item) {
const operate = {
code: this.selected.code,
operation: item.operate.operation
};
this.$store.dispatch('trainingNew/next', operate);
this.$refs.switchDetail.rightClickShow(item.operate, this.selected);
}
}
};