道岔单解操作代码调整

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

View File

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