道岔单解操作代码调整

This commit is contained in:
joylink_cuiweidong 2020-06-09 14:29:36 +08:00
parent f3d37dd240
commit 3c3a355fb6
2 changed files with 35 additions and 28 deletions

View File

@ -49,7 +49,7 @@
</div> </div>
<div class="body_cont"> <div class="body_cont">
<div class="status_text">状态</div> <div class="status_text">状态</div>
<div class="textarea_content" /> <div class="textarea_content">{{ message }}</div>
</div> </div>
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button> <el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
@ -73,7 +73,7 @@ export default {
dialogShow: false, dialogShow: false,
selected: null, selected: null,
operation: null, operation: null,
message:'',
messageText1: '', messageText1: '',
messageText2: '', messageText2: '',
timeCountConfirm: -1, timeCountConfirm: -1,
@ -124,6 +124,7 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.message = '';
this.selected = selected; this.selected = selected;
if (!this.dialogShow) { if (!this.dialogShow) {
this.messageText1 = selected.name; this.messageText1 = selected.name;
@ -139,6 +140,7 @@ export default {
this.dialogShow = false; this.dialogShow = false;
this.messageText1 = ''; this.messageText1 = '';
this.messageText2 = ''; this.messageText2 = '';
this.message = '';
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.disabledConfirm1 = false; this.disabledConfirm1 = false;
this.disabledConfirm2 = true; this.disabledConfirm2 = true;
@ -147,6 +149,7 @@ export default {
}, },
SelectChange() { SelectChange() {
this.message = '';
const operate = { const operate = {
operation: '', operation: '',
val: this.messageText2 val: this.messageText2
@ -192,32 +195,33 @@ export default {
}); });
}, },
confirm2() { confirm2() {
if (this.selected.code != this.messageText2) { if (this.selected.code == this.messageText2) {
this.$refs.noticeInfo.doShow({}, '请选择正确的道岔'); const operate = {
return false; over: true,
} operation: '',
const operate = { cmdType: ''
over: true, };
operation: '', if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
cmdType: '' operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
}; operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
if (this.operation == OperationEvent.Switch.unlock.menu.operation) { } else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unlock.confirm2.operation; operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK; operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText2 = '*****';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
} }
}).catch((error) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$refs.noticeInfo.doShow(operate, error.message); if (valid) {
}); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.messageText2 = '*****';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
this.message = '操作成功';
}
}).catch((error) => {
this.$refs.noticeInfo.doShow(operate, error.message);
});
} else {
this.message = '请选择正确的道岔';
}
}, },
commit() { commit() {
const operate = { const operate = {
@ -319,6 +323,7 @@ export default {
width: 100%; width: 100%;
border: 2px solid #E9E9E9; border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset; box-shadow: 2px 2px #959595 inset;
padding:5px;
} }
} }
} }

View File

@ -242,12 +242,13 @@ export default {
this.messageText2 = '*****'; this.messageText2 = '*****';
this.disabledConfirm2 = true; this.disabledConfirm2 = true;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.message = '操作成功';
} }
}).catch(() => { }).catch(() => {
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}); });
} else { } else {
this.message = '选择道岔错误'; this.message = '选择正确的道岔';
} }
}, },
commit() { commit() {
@ -350,6 +351,7 @@ export default {
width: 100%; width: 100%;
border: 2px solid #E9E9E9; border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset; box-shadow: 2px 2px #959595 inset;
padding:5px;
} }
} }
} }