This commit is contained in:
joylink_cuiweidong 2022-06-08 09:55:48 +08:00
commit 37644ef8fa
4 changed files with 95 additions and 49 deletions

View File

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

View File

@ -18,7 +18,13 @@
<center><b></b><b></b></center>
</span>
</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">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
@ -160,8 +166,6 @@
deviceTimeNode: 0, // 15
routeDataMap: null, // btnCodeList key
routeButtonCodeList: [], // btnCodeList code list
guideLockRightFlag: false,
guideLockLeftFlag: false,
menu: [
{
label: '命令下达',
@ -249,8 +253,6 @@
this.commandTypeList = [];
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.clearOperate();
this.guideLockRightFlag = false;
this.guideLockLeftFlag = false;
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
@ -316,12 +318,6 @@
trainingOperation(operate) {
this.$store.dispatch('training/nextNew', operate).then(({ 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 });
}
}).catch((error) => {
@ -357,10 +353,8 @@
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
if (this.guideLockRightFlag) {
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: false};
}
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: false};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
@ -375,10 +369,8 @@
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
if (this.guideLockRightFlag) {
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: true};
}
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: true};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
@ -392,7 +384,11 @@
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 }) => {
if (valid) {
this.operation = operation;
@ -445,7 +441,20 @@
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) {
const operate = { operation: this.Signal.arrangementRoute.button.operation };
if (!this.routeDataMap) { this.handleRouteDataMap(); }
@ -492,7 +501,6 @@
key = key + (index ? '-' : '') + (index? item.code : this.menuSignal.code);
});
const route = this.routeDataMap[key];
console.log(route, '***********');
if (route) {
operate.code = deviceList[deviceList.length - 1].code;
operate.param = {routeCode: route.code};
@ -620,17 +628,16 @@
this.sendCommand(operate);
},
handleGuideLock(model) {
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode);
if (signal && (this.guideLockRightFlag && signal.right) || (this.guideLockLeftFlag && !signal.right)) {
const operate = {
over: true,
code: model.code,
operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton,
nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK,
param: {signalCode: model.signalCode}
};
this.$refs.password.doShow(operate);
}
const operate = {
code: model.code,
operation: this.Signal.guide.button.operation,
param: {signalCode: model.signalCode}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
}).catch((e) => {
this.$refs.noticeInfo.doShow();
this.clearOperate();
});
},
handelFaultSection(model) {
if (model._type === 'Section') {
@ -662,7 +669,7 @@
];
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);
} else if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
@ -675,6 +682,8 @@
this.handelSignalBlockOrUnblock(model);
} else if (buttonOperation === this.Section.fault.button.operation) {
this.handelFaultSection(model);
} else if (buttonOperation === this.Signal.reopenSignal.button.operation) {
this.handelReopenSignal(model)
} else if (buttonOperation === this.Signal.arrangementRoute.button.operation) {
this.deviceList.push(model);
this.arrangementRouteOperation(this.deviceList);
@ -734,6 +743,22 @@
this.$refs.noticeInfo.doShow();
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() {

View File

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

View File

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