ctc调整

This commit is contained in:
fan 2022-06-08 09:36:14 +08:00
parent a0eaa636f9
commit e5f484f3bb
4 changed files with 95 additions and 49 deletions

View File

@ -115,7 +115,6 @@ export default {
if (operate.operateNext) { if (operate.operateNext) {
this.operation = operate.operateNext; this.operation = operate.operateNext;
} }
console.log(this.operate, '--------------0000operate');
this.dialogShow = true; this.dialogShow = true;
this.checkHasInput = false; this.checkHasInput = false;
this.$nextTick(function () { this.$nextTick(function () {
@ -158,7 +157,6 @@ export default {
this.encryptionPassword = this.passwordCheck; this.encryptionPassword = this.passwordCheck;
} }
}, },
cancel() { cancel() {
const operate = { const operate = {
send: false, send: false,

View File

@ -18,7 +18,13 @@
<center><b></b><b></b></center> <center><b></b><b></b></center>
</span> </span>
</button> </button>
<button :id="Station.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor: guideLockLeftFlag? guideColorDown: guideColorUp}" @click="guideLockLeftButtonDown()"> <button :id="Signal.guide.button.domId" class="button_box" :style="{width: width+'px', backgroundColor: buttonUpColor}" @click="buttonDown(Signal.guide.button.operation, ['SignalButton'])">
<span style="color: #800000">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<button :disabled="true" :id="Station.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor: buttonUpColor}" @click="buttonDown(Station.guideLock.button.operation, ['Button'])">
<span style="color: #800000"> <span style="color: #800000">
<center><b></b><b></b></center> <center><b></b><b></b></center>
<center><b></b><b></b></center> <center><b></b><b></b></center>
@ -160,8 +166,6 @@
deviceTimeNode: 0, // 15 deviceTimeNode: 0, // 15
routeDataMap: null, // btnCodeList key routeDataMap: null, // btnCodeList key
routeButtonCodeList: [], // btnCodeList code list routeButtonCodeList: [], // btnCodeList code list
guideLockRightFlag: false,
guideLockLeftFlag: false,
menu: [ menu: [
{ {
label: '命令下达', label: '命令下达',
@ -249,8 +253,6 @@
this.commandTypeList = []; this.commandTypeList = [];
this.$store.dispatch('menuOperation/setButtonOperation', null); this.$store.dispatch('menuOperation/setButtonOperation', null);
this.clearOperate(); this.clearOperate();
this.guideLockRightFlag = false;
this.guideLockLeftFlag = false;
}, },
'$store.state.menuOperation.menuCount': function (val) { '$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
@ -316,12 +318,6 @@
trainingOperation(operate) { trainingOperation(operate) {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
/* 引导总锁输入面后 处理按钮选中状态 */
if (operate.operationPre === this.Switch.guideLock.leftButton.operation || operate.operation === this.Switch.guideLock.leftButton.operation) {
this.guideLockLeftFlag = !this.guideLockLeftFlag;
} else if (operate.operationPre === this.Switch.guideLock.rightButton.operation || operate.operation === this.Switch.guideLock.rightButton.operation) {
this.guideLockRightFlag = !this.guideLockRightFlag;
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}).catch((error) => { }).catch((error) => {
@ -357,10 +353,8 @@
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
// //
if (this.guideLockRightFlag) { operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK; operate.param = {right: false};
operate.param = {right: false};
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation; operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate); this.$refs.password.doShow(operate);
@ -375,10 +369,8 @@
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
// //
if (this.guideLockRightFlag) { operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK; operate.param = {right: true};
operate.param = {right: true};
}
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation; operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate); this.$refs.password.doShow(operate);
@ -392,7 +384,11 @@
operation: operation operation: operation
}; };
// //
const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation]; const operationList = [
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Signal.guide.button.operation
];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.operation = operation; this.operation = operation;
@ -445,7 +441,20 @@
return this.routeButtonCodeList.some(item => item.includes(name)); return this.routeButtonCodeList.some(item => item.includes(name));
} }
}, },
// OR //
handelReopenSignal(device) {
const operate = {
operation: this.Signal.reopenSignal.button.operation,
// over: true,
// cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL,
code: device.code,
param: { signalCode: device.code }
};
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {
// this.clearOperate();
}).catch(() => this.$refs.noticeInfo.doShow() );
},
//
arrangementRouteOperation(deviceList) { arrangementRouteOperation(deviceList) {
const operate = { operation: this.Signal.arrangementRoute.button.operation }; const operate = { operation: this.Signal.arrangementRoute.button.operation };
if (!this.routeDataMap) { this.handleRouteDataMap(); } if (!this.routeDataMap) { this.handleRouteDataMap(); }
@ -492,7 +501,6 @@
key = key + (index ? '-' : '') + (index? item.code : this.menuSignal.code); key = key + (index ? '-' : '') + (index? item.code : this.menuSignal.code);
}); });
const route = this.routeDataMap[key]; const route = this.routeDataMap[key];
console.log(route, '***********');
if (route) { if (route) {
operate.code = deviceList[deviceList.length - 1].code; operate.code = deviceList[deviceList.length - 1].code;
operate.param = {routeCode: route.code}; operate.param = {routeCode: route.code};
@ -620,17 +628,16 @@
this.sendCommand(operate); this.sendCommand(operate);
}, },
handleGuideLock(model) { handleGuideLock(model) {
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode); const operate = {
if (signal && (this.guideLockRightFlag && signal.right) || (this.guideLockLeftFlag && !signal.right)) { code: model.code,
const operate = { operation: this.Signal.guide.button.operation,
over: true, param: {signalCode: model.signalCode}
code: model.code, };
operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton, this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK, }).catch((e) => {
param: {signalCode: model.signalCode} this.$refs.noticeInfo.doShow();
}; this.clearOperate();
this.$refs.password.doShow(operate); });
}
}, },
handelFaultSection(model) { handelFaultSection(model) {
if (model._type === 'Section') { if (model._type === 'Section') {
@ -662,7 +669,7 @@
]; ];
console.log(buttonOperation, this.Signal.arrangementRoute.button.operation, 'buttonOperation', this.commandTypeList.includes(model._type)); console.log(buttonOperation, this.Signal.arrangementRoute.button.operation, 'buttonOperation', this.commandTypeList.includes(model._type));
if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') { if (model._type === 'SignalButton' && model.type === 'GUIDE') {
this.handleGuideLock(model); this.handleGuideLock(model);
} else if (buttonOperation && this.commandTypeList.includes(model._type)) { } else if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) { if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
@ -675,6 +682,8 @@
this.handelSignalBlockOrUnblock(model); this.handelSignalBlockOrUnblock(model);
} else if (buttonOperation === this.Section.fault.button.operation) { } else if (buttonOperation === this.Section.fault.button.operation) {
this.handelFaultSection(model); this.handelFaultSection(model);
} else if (buttonOperation === this.Signal.reopenSignal.button.operation) {
this.handelReopenSignal(model)
} else if (buttonOperation === this.Signal.arrangementRoute.button.operation) { } else if (buttonOperation === this.Signal.arrangementRoute.button.operation) {
this.deviceList.push(model); this.deviceList.push(model);
this.arrangementRouteOperation(this.deviceList); this.arrangementRouteOperation(this.deviceList);
@ -734,6 +743,22 @@
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
this.clearOperate(); this.clearOperate();
}); });
} else if (this.operation === OperationEvent.Signal.reopenSignal.button.operation) {
const operate = {over: true, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.clearOperate();
}).catch(() => {
this.$refs.noticeInfo.doShow();
this.clearOperate();
})
} else if (this.operation === OperationEvent.Signal.guide.button.operation) {
const operate = {over: true, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.clearOperate();
}).catch(() => {
this.$refs.noticeInfo.doShow();
this.clearOperate();
})
} }
}, },
commandClear() { commandClear() {

View File

@ -5,7 +5,7 @@
:class="popClass" :class="popClass"
title="取消进路" title="取消进路"
:visible.sync="dialogShow" :visible.sync="dialogShow"
width="300px" width="350px"
:before-close="doClose" :before-close="doClose"
:z-index="2000" :z-index="2000"
:modal="false" :modal="false"
@ -13,7 +13,7 @@
> >
<div> <div>
<i class="el-icon-warning"/> <i class="el-icon-warning"/>
<span>{{ `下发“取消进路”【信号机:${signalName}】命令吗?` }}</span> <span>{{ showMessage }}</span>
</div> </div>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
@ -24,25 +24,29 @@
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" :pop-class="popClass" /> <notice-info ref="noticeInfo" :pop-class="popClass" />
<password-box ref="passwordBox" @checkOver="passWordCommit" @checkCancel="cancel" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../../../components/utils/menuOperate'; import {menuOperate, commitOperate} from '../../../components/utils/menuOperate';
import NoticeInfo from '../../../components/menus/childDialog/noticeInfo'; import NoticeInfo from '../../../components/menus/childDialog/noticeInfo';
import PasswordBox from '../dialog/childDialog/passwordInputBox.vue';
export default { export default {
name: 'routeCancel', name: 'routeCancel',
components: { components: {
NoticeInfo NoticeInfo,
PasswordBox
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
signalName: '', signalName: '',
popClass: '' popClass: 'chengdou-03__systerm',
loading: false,
showMessage: ''
} }
}, },
computed: { computed: {
@ -50,11 +54,8 @@
return this.dialogShow ? OperationEvent.Command.close.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
return OperationEvent.Signal.unlock.confirm.domId;
}
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : ''; return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
}, }
}, },
methods: { methods: {
doClose() { doClose() {
@ -71,13 +72,28 @@
this.signalName = selected.name; this.signalName = selected.name;
} }
this.operation = operate.operation; this.operation = operate.operation;
if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
this.showMessage = `下发“取消进路”【信号机:${this.signalName}】命令吗?`;
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
this.showMessage = `下发“信号重开”命令吗?`;
} else if (this.operation === OperationEvent.Signal.guide.menu.operation) {
this.showMessage = `下发“引导进路”命令吗?`;
} else {
this.showMessage = '';
}
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
commit() { commit() {
this.sendCommand(menuOperate.Signal.cancelTrainRoute); if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
this.sendCommand(menuOperate.Signal.cancelTrainRoute);
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
this.sendCommand(menuOperate.Signal.reopenSignal);
} else if (this.operation === OperationEvent.Signal.guide.menu.operation) {
this.$refs.passwordBox.doShow({ operation: OperationEvent.Signal.guide.menu.operation });
}
}, },
cancel() { cancel() {
const operate = { const operate = {
@ -106,6 +122,11 @@
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
}, },
passWordCommit(operate) {
if (operate.operation === OperationEvent.Signal.guide.menu.operation) {
this.sendCommand(menuOperate.Signal.guide);
}
}
} }
}; };
</script> </script>

View File

@ -9,6 +9,7 @@
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" /> <notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
<password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" /> <password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
<draw-select ref="drawSelect" /> <draw-select ref="drawSelect" />
<route-cancel ref="routeCancel" />
<set-fault ref="setFault" pop-class="chengdou-03__systerm" /> <set-fault ref="setFault" pop-class="chengdou-03__systerm" />
</div> </div>
</template> </template>
@ -283,7 +284,8 @@ export default {
guide() { guide() {
commitOperate(menuOperate.Signal.guide, {signalCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Signal.guide, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.passwordBox.doShow({...operate, ...{selected: this.selected}, ...{routesList: this.getRouteList(this.selected)}}); // this.$refs.passwordBox.doShow({...operate, ...{selected: this.selected}, ...{routesList: this.getRouteList(this.selected)}});
this.$refs.routeCancel.doShow(operate, this.selected)
} }
}); });
}, },
@ -291,7 +293,7 @@ export default {
cancelTrainRoute() { cancelTrainRoute() {
commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.routeControl.doShow(operate, this.selected); this.$refs.routeCancel.doShow(operate, this.selected);
} }
}); });
}, },
@ -308,7 +310,7 @@ export default {
reopenSignal() { reopenSignal() {
commitOperate(menuOperate.Signal.reopenSignal, {signalCode: this.selected.code}, 0).then(({valid, operate}) => { commitOperate(menuOperate.Signal.reopenSignal, {signalCode: this.selected.code}, 0).then(({valid, operate}) => {
if (valid) { if (valid) {
this.$refs.routeControl.doShow(operate, this.selected); this.$refs.routeCancel.doShow(operate, this.selected);
} }
}); });
}, },