This commit is contained in:
yuan 2021-09-07 14:35:20 +08:00
parent bafc4d65e7
commit 939cf77b2e

View File

@ -245,100 +245,39 @@ export default {
this.$refs.noticeInfo.doShow() this.$refs.noticeInfo.doShow()
}) })
}, },
methods: { resetMbmButton() {
updateButtonShow(val, old) { this.$store.dispatch('menuOperation/setButtonOperation', null)
if (old) { Handler.clear() //
// },
// this.promptInfo = ''; buttonDown(operation) {
const domId = OperationHandler.getDomIdByOperation(old) //
const dom = document.getElementById(domId) this.deviceList = []
if (dom) { // if (operation != this.Command.cancel.clearMbm.operation) {
dom.disabled = false const operate = {
dom.style.backgroundColor = this.buttonUpColor operation: operation,
} }
}
if (val) {
//
const domId = OperationHandler.getDomIdByOperation(val)
const dom = document.getElementById(domId)
if (dom) {
// this.promptInfo = dom.innerText;
dom.disabled = true
dom.style.backgroundColor = this.buttonDownColor
}
}
},
passWordCommit(data) {
let operate = {}
if (data.overNext) {
operate = {
over: true,
code: data.code,
operation: data.operation,
cmdType: this.cmdType,
param: data.param,
}
} else if (data.nextCmdType) {
operate = {
over: true,
operation: data.operation,
cmdType: data.nextCmdType,
}
} else {
operate = {
operation: data.operateNext,
}
}
this.trainingOperation(operate)
},
//
trainingOperation(operate) {
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
}
})
.catch((error) => {
console.error(error)
this.$refs.noticeInfo.doShow()
})
},
resetMbmButton() {
this.$store.dispatch('menuOperation/setButtonOperation', null)
Handler.clear() //
},
buttonDown(operation) {
//
this.deviceList = []
// if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
operation: operation,
}
// () // ()
const operationList = [ const operationList = [
this.Section.fault.button.operation, this.Section.fault.button.operation,
this.Signal.humanTrainRoute.button.operation, this.Signal.humanTrainRoute.button.operation,
this.Station.guideLock.button.operation, this.Station.guideLock.button.operation,
this.Station.powerUnLock.button.operation, this.Station.powerUnLock.button.operation,
] ]
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.operation = operation this.operation = operation
this.$store.dispatch('menuOperation/setButtonOperation', operation) // this.$store.dispatch('menuOperation/setButtonOperation', operation) //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }) this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
// //
if (operationList.includes(operation)) { if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation operate['operateNext'] = this.Command.close.password.operation
this.$refs.password.doShow(operate) this.$refs.password.doShow(operate)
}
this.$store.dispatch('training/emitTipFresh')
} }
}) this.$store.dispatch('training/emitTipFresh')
}, }
})
}, },
}, },
} }