From 6fa82202359ef2171ff1855388f97931fa098dbe Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 7 Feb 2023 13:17:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?ctc=E6=8C=89=E9=92=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue | 1 + src/utils/baseUrl.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue b/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue index 76223b436..10be7580c 100644 --- a/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue +++ b/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue @@ -547,6 +547,7 @@ export default { }; this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { if (valid) { + this.deviceList.push(model); this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, hasSelected: 1}]); } }); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 17845245e..f84210e59 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -23,7 +23,7 @@ export function handlerUrl() { let OSS_URL; if (process.env.NODE_ENV === 'development') { // 开发分支 - // BASE_API = 'http://192.168.3.233/rtss-server'; + BASE_API = 'http://192.168.3.233/rtss-server'; // BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://114.116.51.125/jlcloud'; From de7ee599f53f60230ae3a8963f4b9deaebf46725 Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 7 Feb 2023 18:00:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?ibp,psl=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/cmdPlugin/CommandEnum.js | 7 +++ src/scripts/cmdPlugin/OperationHandler.js | 52 ++++++++++++++++ src/views/ibp/ibpsystem/index.vue | 69 +++++++++++++++++++--- src/views/newMap/display/terminals/psl.vue | 57 ++++++++++++++---- 4 files changed, 166 insertions(+), 19 deletions(-) diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index b38aa5c34..5237d02dc 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -497,5 +497,12 @@ export default { Conversation: { CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', label: '发送文本消息'}, CMD_Conversation_Chat_Audio_Base64: {value: 'Conversation_Chat_Audio_Base64', label: '发送语音消息'} + }, + PSL: { + CMD_PSL_PRESS_BUTTON: {value: 'PSL_PRESS_BUTTON', label: 'PSL按钮操作'} + }, + IBP: { + CMD_IBP_PRESS_BUTTON: {value: 'IBP_PRESS_BUTTON', label: 'IBP按钮按下'}, + CMD_IBP_RELEASE_BUTTON: {value: 'IBP_RELEASE_BUTTON', label: 'IBP按钮抬起'} } }; diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 5e426ebe6..7e74b4fcb 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -4365,6 +4365,58 @@ export const OperationEvent = { } } }, + Psl: { + standChange: { + change: { + operation: 'c001', + domId: '_Tips-Psl-standChange-Change' + } + }, + pslOperation: { + turn: { + operation: 'c002', + domId: '_Tips-Psl-pslOperation-Turn' + } + }, + hsjcOperation: { + turn: { + operation: 'c003', + domId: '_Tips-Psl-hsjcOperation-Turn' + } + }, + openDoor: { + button: { + operation: 'c004', + domId: '_Tips-Psl-openDoor-Button' + } + }, + closeDoor: { + button: { + operation: 'c005', + domId: '_Tips-Psl-closeDoor-Button' + } + }, + testLamp: { + button: { + operation: 'c006', + domId: '_Tips-Psl-testLamp-Button' + } + } + }, + Ibp: { + buttonPressed: { + button: { + operation: 'd001', + domId: '_Tips-Ibp-buttonPressed-Button' + } + }, + buttonRelease: { + button: { + operation: 'd002', + domId: '_Tips-Ibp-buttonRelease-Button' + } + } + }, RailCommand: { railFillInTicket: { menu: { diff --git a/src/views/ibp/ibpsystem/index.vue b/src/views/ibp/ibpsystem/index.vue index 71e32ab5a..b712a2281 100644 --- a/src/views/ibp/ibpsystem/index.vue +++ b/src/views/ibp/ibpsystem/index.vue @@ -20,7 +20,6 @@ import Vue from 'vue'; import IbpPan from '@/ibp/ibpPan'; import { parser } from '@/ibp/utils/parser'; import { mapGetters } from 'vuex'; -import { handleIbpPress, handleIbpRelease } from '@/api/simulation'; import { IbpOperation } from '@/scripts/ConstDic'; import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp'; import { getToken } from '@/utils/auth'; @@ -29,6 +28,8 @@ import { getSimulationInfoNew, getIbpInitialState } from '@/api/simulation'; import BuzzerAudio from '@/assets/buzzer.mp3'; import { getStationList } from '@/api/runplan'; import { EventBus } from '@/scripts/event-bus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; const pressedKeys = new Set(); export default { @@ -242,24 +243,74 @@ export default { onKeyboardAction(e) { if (this.preResetBtn) { if (e.type === 'keydown' && e.key === 'Control') { - pressedKeys.add(e.key); - this.preResetBtn.press(); - handleIbpPress(this.$route.query.group, this.stationCode, this.preResetBtn._code).catch(error => { this.$message.error(error.message); }); + // pressedKeys.add(e.key); + // this.preResetBtn.press(); + // handleIbpPress(this.$route.query.group, this.stationCode, this.preResetBtn._code).catch(error => { this.$message.error(error.message); }); + const operate = { + start: true, + send: true, + operation: OperationEvent.Ibp.buttonPressed.operation, + cmdType: CMD.IBP.CMD_IBP_PRESS_BUTTON, + param: { + stationCode: this.stationCode, + buttonCode: this.preResetBtn._code + } + }; + this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { + pressedKeys.add(e.key); + this.preResetBtn.press(); + }).catch(error => { this.$message.error(error.message); }); } else if (e.type === 'keyup' && e.key === 'Control') { - pressedKeys.delete(e.key); - this.preResetBtn.release(); - handleIbpRelease(this.$route.query.group, this.stationCode, this.preResetBtn._code).catch(error => { this.$message.error(error.message); }); + // pressedKeys.delete(e.key); + // this.preResetBtn.release(); + // handleIbpRelease(this.$route.query.group, this.stationCode, this.preResetBtn._code).catch(error => { this.$message.error(error.message); }); + const operate = { + start: true, + send: true, + operation: OperationEvent.Ibp.buttonRelease.operation, + cmdType: CMD.IBP.CMD_IBP_RELEASE_BUTTON, + param: { + stationCode: this.stationCode, + buttonCode: this.preResetBtn._code + } + }; + this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { + pressedKeys.delete(e.key); + this.preResetBtn.release(); + }).catch(error => { this.$message.error(error.message); }); } } }, onMouseDown(em) { if (['SquareButton', 'Key'].includes(em.deviceType)) { - handleIbpPress(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); }); + const operate = { + start: true, + send: true, + operation: OperationEvent.Ibp.buttonPressed.operation, + cmdType: CMD.IBP.CMD_IBP_PRESS_BUTTON, + param: { + stationCode: this.stationCode, + buttonCode: em.deviceCode + } + }; + 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); }); } }, onMouseUp(em) { if (['SquareButton'].includes(em.deviceType)) { - handleIbpRelease(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); }); + const operate = { + start: true, + send: true, + operation: OperationEvent.Ibp.buttonRelease.operation, + cmdType: CMD.IBP.CMD_IBP_RELEASE_BUTTON, + param: { + stationCode: this.stationCode, + buttonCode: em.deviceCode + } + }; + 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); }); } }, // 右键点击事件 diff --git a/src/views/newMap/display/terminals/psl.vue b/src/views/newMap/display/terminals/psl.vue index 2a19261ec..ad7611c2f 100644 --- a/src/views/newMap/display/terminals/psl.vue +++ b/src/views/newMap/display/terminals/psl.vue @@ -3,7 +3,7 @@
PSL
- +
-
+
禁止
允许
-
+
禁止
-
+
开门按钮
-
+
关门按钮
-
+
试灯按钮
import icons from '@/assets/psl_images/psl_icons'; -import { getPslStatus, pressPslButton } from '@/api/simulation'; +import { getPslStatus } from '@/api/simulation'; import {mapGetters} from 'vuex'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; export default { name: 'PSL', data() { @@ -112,6 +114,9 @@ export default { ]), group() { return this.$route.query.group; + }, + psl() { + return OperationEvent.Psl; } }, watch: { @@ -147,9 +152,23 @@ export default { this.indicators = resp.data; } }) - .catch(err => {}); + .catch(() => {}); + }, + standCodeChange(val) { + const operate = { + start: true, + over: true, + operation: OperationEvent.Psl.standChange.change.operation, + param: { + standCode: val + } + }; + this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { + if (valid) { + this.initData(this.group, this.standCode); + } + }); }, - doClose() { this.loading = false; this.dialogShow = false; @@ -159,7 +178,25 @@ export default { return status !== undefined ? icons[`${type}_${status}`] : icons[type]; }, btnClickHandler(btnType) { - pressPslButton(this.group, this.standCode, btnType); + const operationMap = { + YXJZ: this.psl.pslOperation.turn.operation, + HSJC: this.psl.hsjcOperation.turn.operation, + KM: this.psl.openDoor.button.operation, + GM: this.psl.closeDoor.button.operation, + SD: this.psl.testLamp.button.operation + }; + const operate = { + start: true, + send: true, + operation: operationMap[btnType], + cmdType: CMD.PSL.CMD_PSL_PRESS_BUTTON, + param: { + standCode: this.standCode, + button: btnType + } + }; + this.$store.dispatch('trainingNew/next', operate); + // pressPslButton(this.group, this.standCode, btnType); } } }; From d1611f900f86cd1207a1e4097822842d341dd7d0 Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 7 Feb 2023 18:00:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?ibp,psl=E5=A2=9E=E5=8A=A0=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 913f081fa..53780883c 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -228,22 +228,22 @@ export function handlerIbpEvent(group, button, stationCode, buttonCode) { }); } -/** 处理ibp盘事件(按下) */ - -export function handleIbpPress(group, stationCode, buttonCode) { - return request({ - url: `/simulation/${group}/ibp/press/${stationCode}/${buttonCode}`, - method: 'put' - }); -} -/** 处理ibp盘事件(松开) */ - -export function handleIbpRelease(group, stationCode, buttonCode) { - return request({ - url: `/simulation/${group}/ibp/release/${stationCode}/${buttonCode}`, - method: 'put' - }); -} +// /** 处理ibp盘事件(按下) */ +// +// export function handleIbpPress(group, stationCode, buttonCode) { +// return request({ +// url: `/simulation/${group}/ibp/press/${stationCode}/${buttonCode}`, +// method: 'put' +// }); +// } +// /** 处理ibp盘事件(松开) */ +// +// export function handleIbpRelease(group, stationCode, buttonCode) { +// return request({ +// url: `/simulation/${group}/ibp/release/${stationCode}/${buttonCode}`, +// method: 'put' +// }); +// } /** 预览脚本仿真(新版)*/ export function scriptDraftRecordNotifyNew(scriptId) {