车辆段道岔操作

This commit is contained in:
yuan 2021-09-07 17:02:27 +08:00
parent 1efcb7491f
commit e350ae04dc

View File

@ -219,46 +219,26 @@ export default {
}
},
operationHandler(buttonOperation, selected) {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
commitOperate(menuOperate.Switch.locate, { switchCode: selected.code }, 3)
.then(({ valid }) => {
if (valid) {
} else {
this.$refs.noticeInfo.doShow()
}
})
.catch((error) => {
console.error(error)
this.$refs.noticeInfo.doShow()
})
break
}
case OperationEvent.Switch.reverse.button.operation: {
//
break
}
case OperationEvent.Switch.lock.button.operation: {
//
break
}
case OperationEvent.Switch.unlock.button.operation: {
//
break
}
case OperationEvent.Switch.block.button.operation: {
//
break
}
case OperationEvent.Switch.unblock.button.operation: {
//
break
}
default:
break
}
const map = new Map([
[OperationEvent.Switch.locate.button.operation, menuOperate.Switch.locate],
[OperationEvent.Switch.reverse.button.operation, menuOperate.Switch.reverse],
[OperationEvent.Switch.lock.button.operation, menuOperate.Switch.lock],
[OperationEvent.Switch.unlock.button.operation, menuOperate.Switch.unlock],
[OperationEvent.Switch.block.button.operation, menuOperate.Switch.block],
[OperationEvent.Switch.unblock.button.operation, menuOperate.Switch.unblock],
])
commitOperate(map.get(buttonOperation), { switchCode: selected.code }, 3)
.then(({ valid }) => {
if (valid) {
console.log('123')
} else {
this.$refs.noticeInfo.doShow()
}
})
.catch((error) => {
console.error(error)
this.$refs.noticeInfo.doShow()
})
},
doShow(point) {
this.initMenu()