This commit is contained in:
fan 2023-05-30 17:07:59 +08:00
commit b863211cca

View File

@ -283,34 +283,38 @@ export default {
}, },
onMouseDown(em) { onMouseDown(em) {
if (['SquareButton', 'Key'].includes(em.deviceType)) { if (['SquareButton', 'Key'].includes(em.deviceType)) {
const operate = { setTimeout(() => {
start: true, const operate = {
send: true, start: true,
operation: OperationEvent.Ibp.buttonPressed.operation, send: true,
cmdType: CMD.IBP.CMD_IBP_PRESS_BUTTON, operation: OperationEvent.Ibp.buttonPressed.operation,
param: { cmdType: CMD.IBP.CMD_IBP_PRESS_BUTTON,
stationCode: this.stationCode, param: {
buttonCode: em.deviceCode stationCode: this.stationCode,
} buttonCode: em.deviceCode
}; }
this.$store.dispatch('trainingNew/next', operate).catch(error => { this.$message.error(error.message); }); };
this.$store.dispatch('trainingNew/next', operate).catch(error => { this.$message.error(error.message); });
// handleIbpPress(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); }); // handleIbpPress(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); });
}, 500);
} }
}, },
onMouseUp(em) { onMouseUp(em) {
if (['SquareButton'].includes(em.deviceType)) { if (['SquareButton'].includes(em.deviceType)) {
const operate = { setTimeout(() => {
start: true, const operate = {
send: true, start: true,
operation: OperationEvent.Ibp.buttonRelease.operation, send: true,
cmdType: CMD.IBP.CMD_IBP_RELEASE_BUTTON, operation: OperationEvent.Ibp.buttonRelease.operation,
param: { cmdType: CMD.IBP.CMD_IBP_RELEASE_BUTTON,
stationCode: this.stationCode, param: {
buttonCode: em.deviceCode stationCode: this.stationCode,
} buttonCode: em.deviceCode
}; }
this.$store.dispatch('trainingNew/next', operate).catch(error => { this.$message.error(error.message); }); };
this.$store.dispatch('trainingNew/next', operate).catch(error => { this.$message.error(error.message); });
// handleIbpRelease(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); }); // handleIbpRelease(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); });
}, 500);
} }
}, },
// //