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-05 09:27:40 +08:00
commit 45f8430214
4 changed files with 151 additions and 39 deletions

View File

@ -5,7 +5,7 @@
<el-row> <el-row>
<div class="signal-box-title">开始</div> <div class="signal-box-title">开始</div>
<div style="border: 1px solid #ACABAA;padding: 8px;"> <div style="border: 1px solid #ACABAA;padding: 8px;">
<el-table ref="table" :data="signalList" height="184px" highlight-current-row @current-change="handleCurrentChangeStar"> <el-table :id="domIdStartSignal" ref="table" :data="signalList" height="184px" highlight-current-row @current-change="handleCurrentChangeStar">
<el-table-column prop="name" label="信号机" /> <el-table-column prop="name" label="信号机" />
</el-table> </el-table>
</div> </div>
@ -13,14 +13,14 @@
<el-row> <el-row>
<div class="signal-box-title">结束</div> <div class="signal-box-title">结束</div>
<div style="border: 1px solid #ACABAA;padding: 8px;"> <div style="border: 1px solid #ACABAA;padding: 8px;">
<el-table :data="signalList" height="184px" highlight-current-row @current-change="handleCurrentChangeEnd"> <el-table :id="domIdEndSignal" ref="endTable" :data="signalList" height="184px" highlight-current-row @current-change="handleCurrentChangeEnd">
<el-table-column prop="name" label="信号机" /> <el-table-column prop="name" label="信号机" />
</el-table> </el-table>
</div> </div>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="6" class="path-box"> <el-col :span="6" class="path-box">
<el-table ref="singleTable" :data="tempData" height="412px" highlight-current-row @current-change="handleRowChange"> <el-table :id="domIdPath" ref="singleTable" :data="tempData" height="412px" highlight-current-row @current-change="handleRowChange">
<el-table-column prop="name" label="路径" width="125" /> <el-table-column prop="name" label="路径" width="125" />
<el-table-column prop="direction" label="运行方向"> <el-table-column prop="direction" label="运行方向">
<template slot-scope="scope"> <template slot-scope="scope">
@ -38,6 +38,7 @@
<div class="border-box"> <div class="border-box">
<div class="border-box-title">CBTC</div> <div class="border-box-title">CBTC</div>
<el-table <el-table
:id="domIdCBTC1"
ref="singleTable1" ref="singleTable1"
:data="filterRouteList" :data="filterRouteList"
highlight-current-row highlight-current-row
@ -51,17 +52,18 @@
</el-table> </el-table>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :id="domIdUnlockType" :span="6">
<div class="radio-box-title">解锁类型</div> <div class="radio-box-title">解锁类型</div>
<div class="radio-box"> <div class="radio-box">
<el-radio v-model="unlockType" label="auto" style="display: block;margin-bottom: 10px;">自动</el-radio> <el-radio v-model="unlockType" label="auto" style="display: block;margin-bottom: 10px;" @input="changeUnlockType">自动</el-radio>
<el-radio v-model="unlockType" label="artificial" style="display: block;">人工</el-radio> <el-radio v-model="unlockType" label="artificial" style="display: block;" @input="changeUnlockType">人工</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="border-box"> <el-row class="border-box">
<div class="border-box-title">后备</div> <div class="border-box-title">后备</div>
<el-table <el-table
:id="domIdReserve1"
ref="singleTable2" ref="singleTable2"
:data="routeList" :data="routeList"
highlight-current-row highlight-current-row
@ -87,6 +89,7 @@
<div class="border-box"> <div class="border-box">
<div class="border-box-title">CBTC</div> <div class="border-box-title">CBTC</div>
<el-table <el-table
:id="domIdCBTC2"
ref="singleTable3" ref="singleTable3"
:data="routeList" :data="routeList"
highlight-current-row highlight-current-row
@ -103,6 +106,7 @@
<el-row class="border-box"> <el-row class="border-box">
<div class="border-box-title">后备</div> <div class="border-box-title">后备</div>
<el-table <el-table
:id="domIdReserve2"
ref="singleTable4" ref="singleTable4"
:data="routeList" :data="routeList"
highlight-current-row highlight-current-row
@ -164,7 +168,7 @@
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!route" @click="commit(true)">确定(O)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!route" @click="commit(true)">确定(O)</el-button>
</el-col> </el-col>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" :loading="loading" :disabled="!route" @click="commit(false)">应用(A)</el-button> <el-button :id="domIdApply" :loading="loading" :disabled="!route" @click="commit(false)">应用(A)</el-button>
</el-col> </el-col>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdClose" @click="cancel">关闭(C)</el-button> <el-button :id="domIdClose" @click="cancel">关闭(C)</el-button>
@ -225,11 +229,35 @@ export default {
domIdClose() { domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.common.confirm.domId : '';
},
domIdApply() {
return this.dialogShow ? OperationEvent.Command.common.apply.domId : '';
},
domIdStartSignal() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_startSignal.domId : '';
},
domIdEndSignal() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_endSignal.domId : '';
},
domIdPath() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_path.domId : '';
},
domIdCBTC1() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_CBTC1.domId : '';
},
domIdCBTC2() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_CBTC2.domId : '';
},
domIdReserve1() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_reserve1.domId : '';
},
domIdReserve2() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_reserve2.domId : '';
},
domIdUnlockType() {
return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_unlockType.domId : '';
}, },
title() { title() {
return '进路命令'; return '进路命令';
@ -243,6 +271,15 @@ export default {
} }
}, },
methods: { methods: {
changeUnlockType() {
const step = {
operation: OperationEvent.Command.commandNingBo3.Signal_command_unlockType.operation,
param: {
unlockType: this.unlockType
}
};
this.$store.dispatch('trainingNew/next', step);
},
doShow(operate) { doShow(operate) {
// //
this.dialogShow = true; this.dialogShow = true;
@ -260,7 +297,7 @@ export default {
setTimeout(()=> { setTimeout(()=> {
this.$refs.table.bodyWrapper.scrollTop = index * 20; this.$refs.table.bodyWrapper.scrollTop = index * 20;
}, 200); }, 200);
this.handleCurrentChangeStar(signal); // this.handleCurrentChangeStar(signal);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -268,14 +305,20 @@ export default {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$refs.table.setCurrentRow();
this.$refs.endTable.setCurrentRow();
this.$refs.singleTable.setCurrentRow();
this.$refs.singleTable1.setCurrentRow(); this.$refs.singleTable1.setCurrentRow();
this.$refs.singleTable2.setCurrentRow(); this.$refs.singleTable2.setCurrentRow();
this.$refs.singleTable3.setCurrentRow(); this.$refs.singleTable3.setCurrentRow();
this.$refs.singleTable4.setCurrentRow(); this.$refs.singleTable4.setCurrentRow();
this.activeName = 'first';
this.unlockType = 'auto';
this.$refs.table.bodyWrapper.scrollTop = 0; this.$refs.table.bodyWrapper.scrollTop = 0;
}, },
// //
handleCurrentChangeStar(val) { handleCurrentChangeStar(val) {
console.log('🚀 ~ file: routeCommand.vue:322 ~ handleCurrentChangeStar ~ val', val);
if (!val) { return; } if (!val) { return; }
this.tempData = []; this.tempData = [];
this.routeList.forEach(item => { this.routeList.forEach(item => {
@ -283,6 +326,13 @@ export default {
this.tempData.push(item); this.tempData.push(item);
} }
}); });
const step = {
operation: OperationEvent.Command.commandNingBo3.Signal_command_startSignal.operation,
param: {
startSignalCode: `${val.code}`
}
};
this.$store.dispatch('trainingNew/next', step);
}, },
handleCurrentChangeEnd(val) { handleCurrentChangeEnd(val) {
if (!val) { return; } if (!val) { return; }
@ -293,6 +343,13 @@ export default {
} }
}); });
this.tempData = arrList; this.tempData = arrList;
const step = {
operation: OperationEvent.Command.commandNingBo3.Signal_command_endSignal.operation,
param: {
endSignalCode: `${val.code}`
}
};
this.$store.dispatch('trainingNew/next', step);
}, },
restoreBeforeDevices() { restoreBeforeDevices() {
// //
@ -359,22 +416,26 @@ export default {
// //
const step = { const step = {
code: `${row.code}`, // code: `${row.code}`,
operation: OperationEvent.Signal.arrangementRoute.choose.operation, operation: OperationEvent.Command.commandNingBo3.Signal_command_path.operation,
param: {} param: {
pathCode: `${row.code}`
}
}; };
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.$store.dispatch('menuOperation/setSelected', {device: row});
} }
this.$store.dispatch('menuOperation/setSelected', {device: row});
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
}, },
commit(isClose = false) { commit(isClose = false) {
const step = { const step = {
start: true, //
over: true, over: true,
operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation,
param: { param: {
routeCode: this.route.code, routeCode: this.route.code,
signalCode: (this.selected || {}).startSignalCode signalCode: (this.selected || {}).startSignalCode
@ -383,17 +444,18 @@ export default {
if (this.activeName === 'first') { if (this.activeName === 'first') {
if (this.unlockType === 'auto') { if (this.unlockType === 'auto') {
step.operation = OperationEvent.Signal.atsAutoControl.confirm.operation; // step.operation = OperationEvent.Signal.atsAutoControl.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; step.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
} else if (this.unlockType === 'artificial') { } else if (this.unlockType === 'artificial') {
step.operation = OperationEvent.Signal.humanControl.confirm.operation; // step.operation = OperationEvent.Signal.humanControl.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; step.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
step.param.unlockType = this.unlockType;
} }
} else if (this.activeName === 'second') { } else if (this.activeName === 'second') {
step.operation = OperationEvent.Signal.cancelTrainRoute.confirm.operation; // step.operation = OperationEvent.Signal.cancelTrainRoute.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE; step.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE;
} else { } else {
step.operation = OperationEvent.Signal.cancelTrainRoute.confirm.operation; // step.operation = OperationEvent.Signal.cancelTrainRoute.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; step.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
} }
@ -415,15 +477,17 @@ export default {
this.route = val; this.route = val;
const step = { const step = {
code: `${val.code}`, // code: `${val.code}`,
operation: OperationEvent.Signal.atsAutoControl.choose.operation, operation: OperationEvent.Command.commandNingBo3.Signal_command_CBTC1.operation,
param: {} param: {
CBTC1Code: `${val.code}`
}
}; };
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.$store.dispatch('menuOperation/setSelected', {device: val});
} }
this.$store.dispatch('menuOperation/setSelected', {device: val});
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
@ -435,15 +499,17 @@ export default {
if (!val) { return; } if (!val) { return; }
const step = { const step = {
code: `${val.code}`, // code: `${val.code}`,
operation: OperationEvent.Signal.atsAutoControl.choose.operation, operation: OperationEvent.Command.commandNingBo3.Signal_command_reserve1.operation,
param: {} param: {
code: `${val.code}`
}
}; };
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.$store.dispatch('menuOperation/setSelected', {device: val});
} }
this.$store.dispatch('menuOperation/setSelected', {device: val});
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
@ -457,15 +523,17 @@ export default {
this.route = val; this.route = val;
const step = { const step = {
code: `${val.code}`, // code: `${val.code}`,
operation: OperationEvent.Signal.cancelTrainRoute.choose.operation, operation: OperationEvent.Command.commandNingBo3.Signal_command_CBTC2.operation,
param: {} param: {
CBTC2Code: `${val.code}`
}
}; };
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.$store.dispatch('menuOperation/setSelected', {device: val});
} }
this.$store.dispatch('menuOperation/setSelected', {device: val});
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });

View File

@ -168,7 +168,7 @@ 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 = sure;
let index = 0; let index = 0;
this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; })); this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; }));
setTimeout(()=> { setTimeout(()=> {
@ -181,8 +181,8 @@ 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.$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'))
); );
@ -229,7 +229,9 @@ export default {
const step = { const step = {
// code: val.code, // code: val.code,
operation: OperationEvent.Command.common.choose.operation, operation: OperationEvent.Command.common.choose.operation,
param: {
val: val.code val: val.code
}
}; };
this.changeIgnore = false; this.changeIgnore = false;

View File

@ -199,6 +199,12 @@ export default {
watch: { watch: {
'$store.state.menuOperation.menuCount': function (val) { '$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !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); this.doShow(this.$store.state.menuOperation.menuPosition);
} else { } else {
this.doClose(); this.doClose();

View File

@ -677,16 +677,52 @@ export const OperationEvent = {
domId: '_Tips-ningBo-line_remoteResetFunc-sure{TOP}' domId: '_Tips-ningBo-line_remoteResetFunc-sure{TOP}'
}, },
Switch_command_setMode: { Switch_command_setMode: {
operation: '00c04', operation: '00c041',
domId: '_Tips-ningBo-Switch_command_setMode{BOTTOM}' domId: '_Tips-ningBo-Switch_command_setMode{BOTTOM}'
}, },
Switch_command_setPosition: { Switch_command_setPosition: {
operation: '00c05', operation: '00c042',
domId: '_Tips-ningBo-Switch_command_setPosition{BOTTOM}' domId: '_Tips-ningBo-Switch_command_setPosition{BOTTOM}'
}, },
Switch_command_setReserved: { Switch_command_setReserved: {
operation: '00c06', operation: '00c043',
domId: '_Tips-ningBo-Switch_command_setReserved{BOTTOM}' domId: '_Tips-ningBo-Switch_command_setReserved{BOTTOM}'
},
Signal_command: {
operation: '00c05',
domId: '_Tips-ningBo-Signal_command{BOTTOM}'
},
Signal_command_startSignal: {
operation: '00c051',
domId: '_Tips-ningBo-Signal_command_startSignal{BOTTOM}'
},
Signal_command_endSignal: {
operation: '00c052',
domId: '_Tips-ningBo-Signal_command_endSignal{BOTTOM}'
},
Signal_command_path: {
operation: '00c053',
domId: '_Tips-ningBo-Signal_command_path{BOTTOM}'
},
Signal_command_CBTC1: {
operation: '00c054',
domId: '_Tips-ningBo-Signal_command_CBTC1{BOTTOM}'
},
Signal_command_CBTC2: {
operation: '00c055',
domId: '_Tips-ningBo-Signal_command_CBTC2{BOTTOM}'
},
Signal_command_reserve1: {
operation: '00c056',
domId: '_Tips-ningBo-Signal_command_reserve1{BOTTOM}'
},
Signal_command_reserve2: {
operation: '00c057',
domId: '_Tips-ningBo-Signal_command_reserve2{BOTTOM}'
},
Signal_command_unlockType: {
operation: '00c058',
domId: '_Tips-ningBo-Signal_command_unlockType{BOTTOM}'
} }
}, },
commandRight: { commandRight: {