调整佛山线路行调下道岔操作

This commit is contained in:
zyy 2020-04-21 17:53:46 +08:00
parent f229bc9231
commit 75c1cffa11
2 changed files with 80 additions and 19 deletions

View File

@ -190,7 +190,7 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
};
this.sendCommand(operate);
@ -200,7 +200,7 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
};
this.sendCommand(operate);

View File

@ -45,11 +45,36 @@ export default {
Local: [
],
Center: [
// {
// label: '',
// handler: this.setSpeed,
// cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
// },
{
label: '道岔总定',
handler: this.locate,
cmdType:CMD.Switch.CMD_SWITCH_NORMAL_POSITION
},
{
label: '道岔总反',
handler: this.reverse,
cmdType:CMD.Switch.CMD_SWITCH_REVERSE_POSITION
},
{
label: '道岔单锁',
handler: this.lock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
{
label: '道岔单解',
handler: this.unlock,
cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
{
label: '道岔封闭',
handler: this.block,
cmdType:CMD.Switch.CMD_SWITCH_BLOCK
},
{
label: '道岔解封',
handler: this.unblock,
cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK
}
]
},
menuForce: [
@ -213,48 +238,84 @@ export default {
},
//
locate(selectType) {
commitOperate(menuOperate.Switch.locate, {switchCode:selectType.code}, 3).then(({valid, operate})=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
let code = selectType.code;
let type = 3;
if (!code) {
code = this.selected.code;
type = 0;
}
commitOperate(menuOperate.Switch.locate, {switchCode: code}, type).then(({valid, operate})=>{
!selectType.code && this.$refs.switchControl.doShow(operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
reverse(selectType) {
commitOperate(menuOperate.Switch.reverse, {switchCode:selectType.code}, 3).then(({valid, operate})=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
let code = selectType.code;
let type = 3;
if (!code) {
code = this.selected.code;
type = 0;
}
commitOperate(menuOperate.Switch.reverse, {switchCode: code}, type).then(({valid, operate})=>{
!selectType.code && this.$refs.switchControl.doShow(operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
lock(selectType) {
commitOperate(menuOperate.Switch.lock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
let code = selectType.code;
let type = 3;
if (!code) {
code = this.selected.code;
type = 0;
}
commitOperate(menuOperate.Switch.lock, {switchCode: code}, type).then(({valid, operate})=>{
!selectType.code && this.$refs.switchControl.doShow(operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
unlock(selectType) {
commitOperate(menuOperate.Switch.unlock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{
// this.$refs.switchUnLock.doShow(data.operate, this.selected);
let code = selectType.code;
let type = 3;
if (!code) {
code = this.selected.code;
type = 0;
}
commitOperate(menuOperate.Switch.unlock, {switchCode: code}, type).then(({valid, operate})=>{
!selectType.code && this.$refs.switchUnLock.doShow(operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
block(selectType) {
commitOperate(menuOperate.Switch.block, {switchCode:selectType.code}, 3).then(({valid, operate})=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
let code = selectType.code;
let type = 3;
if (!code) {
code = this.selected.code;
type = 0;
}
commitOperate(menuOperate.Switch.block, {switchCode: code}, type).then(({valid, operate})=>{
!selectType.code && this.$refs.switchControl.doShow(operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
unblock(selectType) {
commitOperate(menuOperate.Switch.unblock, {switchCode:selectType.code}, 3).then(({valid, operate})=>{
// this.$refs.switchUnLock.doShow(data.operate, this.selected);
let code = selectType.code;
let type = 3;
if (!code) {
code = this.selected.code;
type = 0;
}
commitOperate(menuOperate.Switch.unblock, {switchCode: code}, type).then(({valid, operate})=>{
!selectType.code && this.$refs.switchUnLock.doShow(operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});