diff --git a/src/api/jmap/training.js b/src/api/jmap/training.js index a721b0a3d..e8e806ba9 100644 --- a/src/api/jmap/training.js +++ b/src/api/jmap/training.js @@ -234,10 +234,11 @@ export function startTraining(group, params) { }); } /** 结束实训 */ -export function endTraining(group) { +export function endTraining(group, data) { return request({ url: `/api/training2Simulation/${group}/finish`, - method: 'put' + method: 'put', + data }); } /** 实训完成步骤 */ diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index b433ed257..7d63a7b0b 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -437,17 +437,12 @@ class Jlmap { this.$painter.$transformHandle.revisibleAll(); } updatePicture(list = []) { - console.log('---------------'); - // debugger; list.forEach(item => { const device = this.mapDevice[item]; if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) { const pictureDevice = store.getters['map/getPictureDeviceByCode'](item); device._pictureHide = pictureDevice ? pictureDevice.pictureHide : false; this.$painter.updatePicture(device); - if (device.code === 'X97979') { - console.log(pictureDevice, 'pictureDevice', this.mapDevice[device.code]); - } try { if (device._type === deviceType.Section && device.type === '03') { this.mapDevice[device.switch.code]._pictureHide = pictureDevice ? pictureDevice.pictureHide : false; diff --git a/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js b/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js index 33cff02aa..e6d2ba7e6 100644 --- a/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js +++ b/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js @@ -84,7 +84,7 @@ class EHorizontal2Door extends Group { this.stand2.setStyle('fill', style.Psd.horizontal2Door.defaultColor); } } - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.stand1.setStyle('fill', '#7F7F7F'); this.stand2.setStyle('fill', '#7F7F7F'); } diff --git a/src/jmapNew/shape/graph/Psd/ERectDoor.js b/src/jmapNew/shape/graph/Psd/ERectDoor.js index 227cd39f9..716ab0781 100644 --- a/src/jmapNew/shape/graph/Psd/ERectDoor.js +++ b/src/jmapNew/shape/graph/Psd/ERectDoor.js @@ -51,7 +51,7 @@ class ERect2Door extends Group { this.psd.setStyle('fill', style.Psd.rectDoor.defaultColor); } } - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.psd.setStyle('fill', '#7F7F7F'); } } diff --git a/src/jmapNew/shape/graph/Section/index.js b/src/jmapNew/shape/graph/Section/index.js index c05475ad6..b31edc13a 100644 --- a/src/jmapNew/shape/graph/Section/index.js +++ b/src/jmapNew/shape/graph/Section/index.js @@ -578,7 +578,7 @@ export default class Section extends Group { // 区段延时解锁 model.remain > 0 && this.delayUnlock(); // 设置灰显 - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.setAshShow(); } // 设置脱轨器 diff --git a/src/jmapNew/shape/graph/Signal/index.js b/src/jmapNew/shape/graph/Signal/index.js index 5f5d4544d..b74acd722 100644 --- a/src/jmapNew/shape/graph/Signal/index.js +++ b/src/jmapNew/shape/graph/Signal/index.js @@ -1210,7 +1210,7 @@ class Signal extends Group { } this.model.virtual && this.sigBack && this.sigBack.show(); // 设置灰显 - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.setAshShow(); } @@ -1218,7 +1218,7 @@ class Signal extends Group { if (this.style.Signal.text.conflictColor && model.checkConflict) { this.sigName.setColor(this.style.Signal.text.conflictColor); } - if (store.state.training.prdType === '01') { + if (store.state.map.picture === 'localWork') { this.lowButton && this.lowButton.show(); } } diff --git a/src/jmapNew/shape/graph/Station/EStationText.js b/src/jmapNew/shape/graph/Station/EStationText.js index 672c8922d..7d4c96574 100644 --- a/src/jmapNew/shape/graph/Station/EStationText.js +++ b/src/jmapNew/shape/graph/Station/EStationText.js @@ -42,8 +42,8 @@ class EStationText extends Group { z: this.model.z, silent: !model.visible || false, style: { - x: model.subheadPosition.x, - y: model.subheadPosition.y, + x: model.computedSubheadTextPosition.x, + y: model.computedSubheadTextPosition.y, fontWeight: model.fontWeight, fontSize: model.subheadFont || 18, fontFamily: style.fontFamily, diff --git a/src/jmapNew/shape/graph/Station/index.js b/src/jmapNew/shape/graph/Station/index.js index 96fe16def..4061db974 100644 --- a/src/jmapNew/shape/graph/Station/index.js +++ b/src/jmapNew/shape/graph/Station/index.js @@ -34,10 +34,12 @@ export default class Station extends Group { this.computedPosition = pictureDevice.position; this.computedTurnBackPoint = { x: model.turnBackPoint ? model.turnBackPoint.x + offsetX : 0, y: model.turnBackPoint ? model.turnBackPoint.y + offsetY : 0 }; this.computedControlModePoint = { x: model.controlModePoint.x + offsetX, y: model.controlModePoint.y + offsetY }; + this.computedSubheadTextPosition = { x: model.subheadPosition ? model.subheadPosition.x + offsetX : 0, y: model.subheadPosition ? model.subheadPosition.y + offsetY : 0 }; } else { this.computedPosition = model.position; this.computedTurnBackPoint = model.turnBackPoint; this.computedControlModePoint = model.controlModePoint; + this.computedSubheadTextPosition = model.subheadPosition; } this.z = 40; this.model = model; @@ -59,6 +61,7 @@ export default class Station extends Group { 'stationText': EStationText // 车站名称 (普通站台样式) }; model.computedPosition = this.computedPosition; + model.computedSubheadTextPosition = this.computedSubheadTextPosition; // 遍历当前线路下的绘图元素 组合模式 traverseLineElements(style.Station, elementTypeList, model, style, this); diff --git a/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js b/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js index cd9cddf84..967b742be 100644 --- a/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js +++ b/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js @@ -55,7 +55,7 @@ class ETrainSetButton extends Group { } setState(model) { - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.setColor('#7F7F7F'); } } diff --git a/src/jmapNew/shape/graph/StationStand/index.js b/src/jmapNew/shape/graph/StationStand/index.js index 12c635464..8c535b354 100644 --- a/src/jmapNew/shape/graph/StationStand/index.js +++ b/src/jmapNew/shape/graph/StationStand/index.js @@ -159,7 +159,7 @@ class StationStand extends Group { this.downDetainLamp && this.downDetainLamp.hide(); } setScreenDoorOpenStatus(model) { - if (!this.model.noStatus && !(this.model.atsNoStatus && store.state.training.prdType == '02')) { + if (!this.model.noStatus && !(this.model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.gapStand && this.gapStand.setState(model); } } @@ -183,7 +183,7 @@ class StationStand extends Group { currentTypeList.forEach(element => { this[element].setState(model); }); - if (store.state.training.prdType === '01') { + if (store.state.map.picture === 'localWork') { this.stopJumpLamp && this.stopJumpLamp.show(); this.cancelStopJumpLamp && this.cancelStopJumpLamp.show(); this.upDetainLamp && this.upDetainLamp.show(); diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js index 8201de20d..86ef8f30f 100644 --- a/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js +++ b/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js @@ -110,7 +110,7 @@ class EGapStand extends Group { this.setClose(); } } - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === '02')) { this.setColor('#7F7F7F'); } } diff --git a/src/jmapNew/shape/graph/Switch/index.js b/src/jmapNew/shape/graph/Switch/index.js index 3657c219a..044ea66f4 100644 --- a/src/jmapNew/shape/graph/Switch/index.js +++ b/src/jmapNew/shape/graph/Switch/index.js @@ -877,7 +877,7 @@ export default class Switch extends Group { const sectionC = this.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.handleSwitchSection(sectionC); } - if (model.noStatus || (model.atsNoStatus && store.state.training.prdType == '02')) { + if (model.noStatus || (model.atsNoStatus && store.state.map.picture === 'dispatchWork')) { this.setAshShow(); } !model.auto && this.artificialArc && this.artificialArc.show(); diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js index 8559cb3c4..6050ac372 100644 --- a/src/jmapNew/shape/graph/Train/index.js +++ b/src/jmapNew/shape/graph/Train/index.js @@ -40,7 +40,7 @@ export default class Train extends Group { _computed() { const model = this.model; const style = this.style; - if (model.trainWindowModel) { + if (model.trainWindowModel && model.trainWindowModel.instance) { const amendData = store.getters['map/amendPoints'](model.trainWindowModel.code); if (amendData) { model.trainWindowModel.instance.computedPoint = amendData.position; diff --git a/src/jmapNew/shape/graph/TrainWindow/EMouse.js b/src/jmapNew/shape/graph/TrainWindow/EMouse.js index 0d790f839..297607a32 100644 --- a/src/jmapNew/shape/graph/TrainWindow/EMouse.js +++ b/src/jmapNew/shape/graph/TrainWindow/EMouse.js @@ -4,34 +4,25 @@ export default class EMouse { } mouseover(e) { - if (this.device.prdType) { - this.device.setVisible(true); - const instance = this.device.getInstanceByCode(this.device.model.sectionCode); - if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) { - instance.mouseEvent.mouseEnter(e); - } + this.device.setVisible(true); + const instance = this.device.getInstanceByCode(this.device.model.sectionCode); + if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) { + instance.mouseEvent.mouseEnter(e); } } mouseout(e) { - if (this.device.prdType) { - this.device.setVisible(false); - const instance = this.device.getInstanceByCode(this.device.model.sectionCode); - if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { - instance.mouseEvent.mouseLeave(e); - } + this.device.setVisible(false); + const instance = this.device.getInstanceByCode(this.device.model.sectionCode); + if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { + instance.mouseEvent.mouseLeave(e); } } mouseEnter() { - // if (this.device.prdType) { - // this.device.setVisible(true); - // } } mouseLeave() { - if (this.device.prdType ) { - this.device.setVisible(false); - } + this.device.setVisible(false); } } diff --git a/src/jmapNew/shape/graph/TrainWindow/index.js b/src/jmapNew/shape/graph/TrainWindow/index.js index 3329eddc4..637fc59de 100644 --- a/src/jmapNew/shape/graph/TrainWindow/index.js +++ b/src/jmapNew/shape/graph/TrainWindow/index.js @@ -23,13 +23,12 @@ class TrainWindow extends Group { this.model = model; this.style = style; this.z = 9; - this.prdType = store.state.training.prdType; this.create(); this.createMouseEvent(); this.setState(model); } create() { - if (this.prdType !== '01') { + if (store.state.map.picture !== 'localWork') { this.createTrainWindow(); } } diff --git a/src/jmapNew/theme/components/menus/dialog/cmdManage.vue b/src/jmapNew/theme/components/menus/dialog/cmdManage.vue index 65b19d733..ad052d164 100644 --- a/src/jmapNew/theme/components/menus/dialog/cmdManage.vue +++ b/src/jmapNew/theme/components/menus/dialog/cmdManage.vue @@ -91,8 +91,8 @@
- 拒签 - 签收 + 拒签 + 签收 关闭
@@ -101,6 +101,7 @@ import { sendCommandNew } from '@/api/jmap/training'; import shouxinxiang from '@/assets/dispatcherStation/shouxinxiang.png'; import { mapState } from 'vuex'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; export default { name:'CmdManage', data() { @@ -223,6 +224,9 @@ export default { // this.searchCmd(); }, methods:{ + getDomObj(key) { + return OperationEvent.DispatchCmd.menuButton[key]; + }, tableRowClassName({row, rowIndex}) { const status = this.getStateInfo(row.rcvCompanies).state; if (status === 'Signed') { @@ -307,15 +311,25 @@ export default { command = 'CTC_SIGN_REJECT_DIS_COMMAND'; delete data.proxySign; } - sendCommandNew(this.group, command, data).then((res) => { - console.log(res, '---res'); - if (res.code == 200) { - // this.searchCmd(); - } else { - this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${res.message}`); + const key = status ? 'signCmdTrue' : 'signCmdFalse'; + const operate = { + operation: this.getDomObj(key).operation, + param: data, + userOperationType: 'leftClick' + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + sendCommandNew(this.group, command, data).then((res) => { + console.log(res, '---res'); + if (res.code == 200) { + // this.searchCmd(); + } else { + this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${res.message}`); + } + }).catch(error => { + this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${error.message}`); + }); } - }).catch(error => { - this.$messageBox(`${status ? '签收' : '拒签'}调度命令失败:${error.message}`); }); }, filterTableData() { diff --git a/src/jmapNew/theme/components/menus/dialog/signedCmd.vue b/src/jmapNew/theme/components/menus/dialog/signedCmd.vue index 371aaa5f1..38845bab8 100644 --- a/src/jmapNew/theme/components/menus/dialog/signedCmd.vue +++ b/src/jmapNew/theme/components/menus/dialog/signedCmd.vue @@ -81,8 +81,8 @@
- 拒签 - 签收 + 拒签 + 签收 关闭
@@ -91,6 +91,7 @@ import { sendCommandNew } from '@/api/jmap/training'; import { mapState } from 'vuex'; import { parseTime } from '@/utils/index'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; export default { name:'CmdManage', data() { @@ -181,6 +182,9 @@ export default { beforeDestroy() {}, mounted() {}, methods:{ + getDomObj(key) { + return OperationEvent.DispatchCmd.menuButton[key]; + }, getDeviceName(receiverId) { let name = ''; if (receiverId) { @@ -239,12 +243,22 @@ export default { command = 'CTC_SIGN_REJECT_DIS_COMMAND'; delete data.proxySign; } - sendCommandNew(this.group, command, data).then((res) => { - console.log(res, '---res'); - // this.$emit('changeSignedStatus', signInfo); - this.doClose(); - }).catch(error => { - this.$messageBox('查询调度命令失败:' + error.message); + const key = status ? 'signCmdTrue' : 'signCmdFalse'; + const operate = { + operation: this.getDomObj(key).operation, + param: data, + userOperationType: 'leftClick' + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + sendCommandNew(this.group, command, data).then((res) => { + console.log(res, '---res'); + // this.$emit('changeSignedStatus', signInfo); + this.doClose(); + }).catch(error => { + this.$messageBox('查询调度命令失败:' + error.message); + }); + } }); }, searchCmd() { diff --git a/src/permission.js b/src/permission.js index 47e9b90d7..9eece9784 100644 --- a/src/permission.js +++ b/src/permission.js @@ -63,7 +63,6 @@ function handleRoute(to, next, loginPath) { // 除没有动态改变权限的需求可直接next() 删下方权限判断 if (to.path === '/404' && to.redirectedFrom === '/') { const project = getSessionStorage('project'); - console.log(localStore.get('trainingPlatformRoute' + store.getters.id + project, '-------------')); next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform'); } else { next(); diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 04262930b..4b924bbd2 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -4216,6 +4216,68 @@ export const OperationEvent = { domId: '_Tips-TrainingDesign-menuButton-faultMode' } } + }, + // 调度台 + DispatcherManage: { + menu: { + schedulingPlan: { + operation: '1601', + domId: '_Tips-DispatcherManage-menu-schedulingPlan' + }, + dispatchingCommand: { + operation: '1602', + domId: '_Tips-DispatcherManage-menu-dispatchingCommand' + }, + dispatchWork: { + operation: '1603', + domId: '_Tips-DispatcherManage-menu-dispatchWork' + }, + dataUpdate: { + operation: '1604', + domId: '_Tips-DispatcherManage-menu-dataUpdate' + }, + timeLock: { + operation: '1605', + domId: '_Tips-DispatcherManage-menu-timeLock' + } + } + }, + // 调度命令 + DispatchCmd: { + menuButton: { + refreshSearch: { + operation: '1701', + domId: '_Tips-DispatchCmd-menuButton-refreshSearch' + }, + createCmd: { + operation: '1702', + domId: '_Tips-DispatchCmd-menuButton-createCmd' + }, + search: { + operation: '1703', + domId: '_Tips-DispatchCmd-menuButton-search' + }, + allographCmd: { + operation: '1704', + domId: '_Tips-DispatchCmd-menuButton-allographCmd{BOTTOM}' + }, + sendCmd: { + operation: '1705', + domId: '_Tips-DispatchCmd-menuButton-sendCmd{BOTTOM}' + }, + saveCacheData: { + operation: '1706', + domId: '_Tips-DispatchCmd-menuButton-saveCacheData{BOTTOM}' + }, + signCmdTrue: { + operation: '1707', + domId: '_Tips-DispatchCmd-menuButton-signCmdTrue{BOTTOM}' + }, + signCmdFalse: { + operation: '1708', + domId: '_Tips-DispatchCmd-menuButton-signCmdFalse{BOTTOM}' + } + } } }; diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 1526cf37d..3cb4d7620 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -1,6 +1,5 @@ import store from '@/store/index'; import { copyAssign } from '@/utils/index'; -import { Notification } from 'element-ui'; function handleSockInfo(state, msg, type) { switch (type) { @@ -27,311 +26,6 @@ function handleSimulationStateMsg(state, type) { break; } } -// function handle(state, data) { -// // console.log(data, 'socket订阅'); -// const msg = data.body; -// const path = window.location.href; -// const search = window.location.search; -// if (((path.includes('/display/demon') && search.includes('project=bjd')) || path.includes('/planSchedule/window')) && !state.isFirst) { state.isFirst = true; } -// switch (data.type) { -// case 'Order_Pay_Result': // 订单支付结果消息 -// state.payOrder = msg; -// break; -// case 'Simulation_DeviceStatus': // 仿真-设备状态消息 -// state.equipmentStatus = msg; -// break; -// case 'Simulation_User': // 仿真-进出仿真消息 -// handleSimulationUserinfo(state, msg); // 用户进出仿真消息 -// break; -// case 'Simulation_Script_Action_Tip': // 剧本提示消息 -// handleSimulationScriptTipInfo(state, msg); // 剧本提示消息 -// break; -// case 'Simulation_Script_Action_Finish': -// state.simulationScriptTipFinish++; // 剧本某一部操作完成提示 -// break; -// case 'Simulation_Script_Action_Error': -// state.simulationScriptTipError++; // 剧本某一部操作执行错误 -// break; -// case 'Simulation_Over': // 用户退出仿真推送消息 -// state.simulationOver++; // 用户退出仿真推送消息 -// break; -// case 'Simulation_Script_Action':// 剧本编制添加指令的推送消息 -// state.scriptAction = msg; -// break; -// case 'Simulation_AutoFault_Trigger': // 自动故障触发操作推送消息 -// state.autoFaultTrigger++; -// break; -// case 'Simulation_RunFact': // 仿真-列车实际到 发车站消息 -// if (!Array.isArray(msg)) { -// state.trainStationList = [msg]; -// } else { -// state.trainStationList = msg; -// } -// break; -// case 'Simulation_Error': // 仿真-异常消息 -// state.simulationError += 1; -// break; -// case 'Simulation_RunAsPlan_Start': // 仿真-仿真开始按计划行车消息 -// state.simulationStart = msg; -// break; -// case 'Simulation_Reset': // 仿真-仿真重置消息 退出计划行车 -// state.simulationReset += 1; -// break; -// case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令) -// handleSimulationInfo(state, msg); -// break; -// case 'Simulation_Conversation_Operation': // 仿真-用户交互消息(聊天/命令)-新 -// handleSimulationInfo(state, {id: msg.id, message: msg, messageType: 'MESSAGE'}); -// break; -// case 'Simulation_ApplyHandle': // 请求处理消息(旧版可能在用,新版地图不用这个) -// handlePushMsgQueue(state, msg); -// break; -// case 'Simulation_Invite': // 综合演练-仿真邀请消息 -// state.simulationInvite = msg; -// break; -// case 'Be_Logged_Out': // 重复登录被登出 -// state.beLogoutCount++; -// state.loggedOutMsg = msg; -// break; -// case 'Simulation_Run_Plan_Reload': // 运行图变更 -// state.runPlanReloadCount++; -// break; -// case 'Simulation_Control_Pause': // 暂停中 -// store.dispatch('scriptRecord/updateSimulationPause', msg); -// break; -// case 'BROADCAST': // 升级通知消息 -// Notification.warning({ -// title: msg.title, -// center: true, -// message: msg.message, -// position: 'bottom-right', -// showClose: msg.showClose, -// duration: 0 -// }); -// break; -// case 'Simulation_Member': -// state.memberChangeCount++; -// break; -// case 'Simulation_Time_Sync': -// state.simulationTimeSync = msg; -// break; -// case 'Simulation_IbpStatus': -// state.simulationIbpStatus = msg; -// break; -// case 'Simulation_Competition_Practice_Finish': -// state.competitionPracticeFinish++; -// break; -// case 'Simulation_Alarm': -// state.simulationAlarmInfo = msg; -// break; -// case 'STATION_PFI_NUM': -// state.stationPfiNum = msg; -// break; -// case 'STAND_PFI': -// state.standPfiNum = msg; -// break; -// case 'TRAIN_PFI_NUM': -// state.trainPfiNum = msg; -// break; -// case 'TRAIN_PFI_BL': -// state.trainPfiBL = msg; -// break; -// case 'LPF_STRATEGY_RECOMMEND': -// state.LPFstrategy = msg; -// break; -// case 'Simulation_Scenes_Reload': -// if (msg) { -// store.dispatch('training/start'); -// } else { -// store.dispatch('training/over'); -// } -// state.trainingReloadCount++; -// break; -// case 'Simulation_PslStatus': -// state.simulationPslStatus = msg; -// break; -// // 运行图加线/抽线/变化推送消息 -// case 'Simulation_Trip_Plan_Change': -// state.simulationPlanChange = msg; -// break; -// // 占线板信息 -// case 'Simulation_RailCtcStatus': -// state.railCtcStatusMsg = msg; -// break; -// // 大铁项目 ctc 运行图初始化信息 -// // case 'SIMULATION_CTC_RUN_PLAN_INIT': -// // msg.forEach(element => { -// // const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber; -// // const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber; -// // if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; } -// // if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; } -// // const code = element.stationCode + '' + element.code; -// // state.railCtcRunplanInitMsg[code] = element; -// // }); -// // break; -// // 大铁项目 ctc 运行图改变信息 -// case 'SIMULATION_CTC_RUN_PLAN_CHANGE': -// state.voiceBroadcastMsgs = []; -// msg.forEach(element => { -// const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber; -// const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber; -// if (tripNumberDe) { -// element.departRunPlan.up = ''; -// element.departRunPlan.down = ''; -// parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; -// } -// if (tripNumberAr) { -// element.arriveRunPlan.up = ''; -// element.arriveRunPlan.down = ''; -// parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; -// } -// const code = element.stationCode + '' + element.code; -// if (store.state.training.roleDeviceCode === element.stationCode && element.arriveRunPlan && element.arriveRunPlan.adjacentMessage === '1') { -// state.voiceBroadcastMsgs.push(element.stationCode + '' + element.code); -// } -// state.railCtcRunplanInitMsg[code] = copyAssign(state.railCtcRunplanInitMsg[code] || {}, element); -// }); -// if (state.voiceBroadcastMsgs.length) { -// state.voiceBroadcastChange++; -// } -// state.railCtcRunplanChange++; -// break; -// // 大铁项目 ctc 调度发布行车计划 给车站下发消息 -// case 'SIMULATION_RAILWAY_RUN_PLAN_SEND': -// msg.forEach(each=>{ -// state.railwaySimulationRunplanSendMap[each.stationCode] = each; -// }); -// state.railwaySimulationRunplanSendChange++; -// break; -// // 大铁项目 ctc 车务管理端 初始化消息 -// case 'SIMULATION_CTC_MANAGER_RUN_PLAN_EDIT_INIT': -// state.railCtcStationManageRpMsg = {}; -// msg.forEach(element => { -// const code = element.stationCode + '' + element.tripNumber; -// state.railCtcStationManageRpMsg[code] = element; -// }); -// // state.railCtcStationManageRpChange++; -// break; -// // 大铁项目 ctc 车务管理端 修改/增加消息 -// case 'SIMULATION_CTC_MANAGER_RUN_PLAN_EDIT_CHANGE': -// msg.forEach(element => { -// const code = element.stationCode + '' + element.tripNumber; -// state.railCtcStationManageRpMsg[code] = copyAssign(state.railCtcStationManageRpMsg[code] || {}, element); -// }); -// state.railCtcStationManageRpChange++; -// break; -// // 大铁项目 ctc 车务管理端 移除消息 -// case 'SIMULATION_CTC_MANAGER_RUN_PLAN_EDIT_REMOVE': -// msg.forEach(element => { -// const code = element.stationCode + '' + element.tripNumber; -// delete state.railCtcStationManageRpMsg[code]; -// }); -// state.railCtcStationManageRpChange++; -// break; -// // 调度命令信息 -// case 'SIMULATION_RAIL_CTC_DIS_COMMAND_ADD': -// state.dispatchCommandMsg = msg; -// break; -// // 调度命令状态 -// case 'SIMULATION_RAIL_CTC_DIS_COMMAND_SYNC': -// state.dispatchCommandState = msg; -// console.log('调度命令状态', msg); -// break; -// // 车站发送计划信息 -// case 'SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND': -// state.changedCtcRunplanMap = msg; -// break; -// case 'SIMULATION_RAIL_TICKET': -// state.ticketInfo = msg; -// break; -// // // 实训提示消息 -// // case 'Simulation_Training_Step_Tip': -// // state.trainingStepTip = msg; -// // break; -// case 'Simulation_Training_Finish': -// state.trainingOverCount++; -// break; -// case 'YJDDZH_TRAIN_POSITION': -// state.whTrainInfo = msg; -// break; -// case 'Simulation_Training_Step_Finish': -// state.trainingStepFinishCount++; -// break; -// case 'SIMULATION_WORK_PARAM': -// state.simulationWorkParam = msg; -// break; -// // -// // // 大铁项目 调度台 运行图信息 初始化消息 -// // case 'SIMULATION_RAILWAY_RUN_PLAN_INIT': -// // state.railwaySimulationRpMsg = {}; -// // msg.forEach(element => { -// // const code = element.stationCode + '' + element.runPlanCode; -// // state.railwaySimulationRpMsg[code] = element; -// // }); -// // break; -// // // 大铁项目 调度台 运行图信息 修改/增加消息 -// // case 'SIMULATION_RAILWAY_RUN_PLAN_CHANGE': -// // msg.forEach(element => { -// // const code = element.stationCode + '' + element.runPlanCode; -// // state.railwaySimulationRpMsg[code] = copyAssign(state.railwaySimulationRpMsg[code] || {}, element); -// // }); -// // state.railwaySimulationRpChange++; -// // break; -// // // 大铁项目 调度台 运行图信息 移除消息 -// // case 'SIMULATION_RAILWAY_RUN_PLAN_REMOVE': -// // msg.forEach(element => { -// // const code = element.stationCode + '' + element.runPlanCode; -// // delete state.railwaySimulationRpMsg[code]; -// // }); -// // state.railwaySimulationRpChange++; -// // break; -// } -// } -// 仿真内部聊天 -function handleSimulationInfo(state, data) { - switch (data.messageType) { - case 'INVITE': - state.inviteSimulationConversation = data; - break; - case 'CONNECT': - state.acceptConversionInvite = data; - break; - case 'OVER': - state.overConversation = data; - break; - case 'MESSAGE': - state.conversationInfo = data; - break; - case 'CREATE': - state.createConversation = data; - break; - case 'EXIT': - state.exitConversation = data; - break; - } -} - -// 剧本提示 -function handleSimulationScriptTipInfo(state, data) { - state.simulationScriptTip = data; -} - -function handleSimulationUserinfo(state, data) { - state.simulationRoleList = (data instanceof Array) ? data : [data]; -} - -// (旧版可能在用,新版地图不用这个) -function handlePushMsgQueue(state, msg) { - if (msg instanceof Array) { - state.msgQueue.concat(msg); - } else { - state.msgQueue.push(msg); - } - - if (!state.msgHead) { - state.msgHead = state.msgQueue[0]; - } -} const socket = { namespaced: true, @@ -407,7 +101,6 @@ const socket = { railwaySimulationRunplanSendChange:0, // 大铁项目 调度台 发布 行车计划变化 voiceBroadcastMsgs: [], // 语音播报信息 voiceBroadcastChange: 0, // 语音播报信息变化 - trainingStepTip: '', // 新实训推送消息 trainingOverCount: 0, // 新实训结束计数器 trainingReloadCount: 0, whTrainInfo: null, @@ -535,9 +228,6 @@ const socket = { state.railCtcRunplanInitMsg[code] = element; }); }, - clearTrainingStepTip: (state) => { - state.trainingStepTip = ''; - }, clearTrainingOverCount: (state) => { state.trainingOverCount = 0; }, @@ -691,9 +381,6 @@ const socket = { setTicketInfo: (state, data) => { state.ticketInfo = data; }, - setTrainingStepTip: (state, data) => { - state.trainingStepTip = data; - }, trainingOverCountIncrease: (state) => { state.trainingOverCount++; }, @@ -801,9 +488,6 @@ const socket = { initRailCtcRunplanInitMsg:({ commit }, list) => { commit('initRailCtcRunplanInitMsg', list); }, - clearTrainingStepTip: ({ commit }) => { - commit('clearTrainingStepTip'); - }, clearTrainingOverCount: ({ commit }) => { commit('clearTrainingOverCount'); }, @@ -924,9 +608,6 @@ const socket = { setTicketInfo: ({ commit }, data) => { commit('setTicketInfo', data); }, - setTrainingStepTip: ({ commit }, data) => { - commit('setTrainingStepTip', data); - }, trainingOverCountIncrease: ({ commit }) => { commit('trainingOverCountIncrease'); }, diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 855fc1eff..5deba5235 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -14,9 +14,8 @@ const training = { sceneOperate: null, stepOrder: 0, operateOrder: 0, - // stepOverCount: 0, - trainingScore: '', - operateErrMsg: '' + operateErrMsg: '', + trainingStepTip: '' }, getters: { teachMode: (state) => { @@ -34,9 +33,6 @@ const training = { stepOrder: (state) => { return state.stepOrder; }, - trainingScore: (state) => { - return state.trainingScore; - }, sceneOperate: (state) => { return state.sceneOperate; } @@ -80,14 +76,17 @@ const training = { clearStepOverCount: (state) => { state.clearStepOverCount = 0; }, - setTrainingScore: (state, score) => { - state.trainingScore = score; - }, setSceneOperate: (state, sceneOperate) => { state.sceneOperate = sceneOperate; }, setOperateErrMsg: (state, msg) => { state.operateErrMsg = msg; + }, + clearTrainingStepTip: (state) => { + state.trainingStepTip = ''; + }, + setTrainingStepTip: (state, data) => { + state.trainingStepTip = data; } }, actions: { @@ -126,9 +125,6 @@ const training = { clearStepOverCount: ({commit}) => { commit('clearStepOverCount'); }, - setTrainingScore: ({commit}, score) => { - commit('setTrainingScore', score); - }, setSceneOperate: ({commit}, sceneOperate) => { commit('setSceneOperate', sceneOperate); }, @@ -170,6 +166,12 @@ const training = { reject(e); }); }); + }, + clearTrainingStepTip: ({ commit }) => { + commit('clearTrainingStepTip'); + }, + setTrainingStepTip: ({ commit }, data) => { + commit('setTrainingStepTip', data); } } }; diff --git a/src/utils/date.js b/src/utils/date.js index c1d33503b..afb150905 100644 --- a/src/utils/date.js +++ b/src/utils/date.js @@ -106,7 +106,7 @@ export function objectIsEqual(obj1, obj2) { } // 仅过滤值为null的项 const arr1 = Object.keys(obj1).filter(key => { return obj1[key] != null; }); - const arr2 = Object.keys(obj2).filter(key => { return obj1[key] != null; }); + const arr2 = Object.keys(obj2).filter(key => { return obj2[key] != null; }); if (arr1.length !== arr2.length) { return false; } diff --git a/src/utils/sock.js b/src/utils/sock.js index 3e851edef..d661945cf 100644 --- a/src/utils/sock.js +++ b/src/utils/sock.js @@ -125,11 +125,11 @@ StompClient.prototype = { const subscription = this.subscribeMap.get(topic); if (subscription && subscription.count > 0) { subscription.count--; - if (subscription && subscription.sub && subscription.count < 0) { + if (subscription && subscription.sub && subscription.count <= 0) { subscription.sub.unsubscribe(); this.subscribeMap.delete(topic); console.log('取消订阅:' + topic); - } else if (subscription && subscription.count < 0) { + } else if (subscription && subscription.count <= 0) { this.subscribeMap.delete(topic); } } diff --git a/src/utils/stomp.js b/src/utils/stomp.js index 13e9f1c12..664821d4a 100644 --- a/src/utils/stomp.js +++ b/src/utils/stomp.js @@ -50,6 +50,15 @@ export function getTopic(type, group, param) { // topic = `/user/queue/simulation/${group}/ctc/manage`; topic = `/user/queue/simulation/${group}/ctcManage`; break; + case 'ATS_STATUS': + topic = `/user/queue/simulation/${group}/device/status`; + break; + case 'COMMON': + topic = `/user/queue/simulation/${group}`; + break; + case 'LPF': + topic = `/user/queue/simulation/passenger/${group}`; + break; } return topic; diff --git a/src/utils/subscribeCallback.js b/src/utils/subscribeCallback.js index 78f161061..fde6482b1 100644 --- a/src/utils/subscribeCallback.js +++ b/src/utils/subscribeCallback.js @@ -174,10 +174,6 @@ function handle(data) { case 'SIMULATION_RAIL_TICKET': store.dispatch('socket/setTicketInfo', msg); break; - // // 实训提示消息 - // case 'Simulation_Training_Step_Tip': - // store.dispatch('socket/setTrainingStepTip', msg); - // break; case 'Simulation_Training_Finish': store.dispatch('socket/trainingOverCountIncrease'); break; diff --git a/src/views/designPlatform/trainingMenu.vue b/src/views/designPlatform/trainingMenu.vue index 07c6f9114..7676efd01 100644 --- a/src/views/designPlatform/trainingMenu.vue +++ b/src/views/designPlatform/trainingMenu.vue @@ -146,7 +146,7 @@ export default { handlerEnd() { endTraining(this.group).then((resp) => { this.$store.dispatch('trainingNew/trainingEnd'); - this.$store.dispatch('socket/clearTrainingStepTip'); + this.$store.dispatch('trainingNew/clearTrainingStepTip'); this.$store.dispatch('trainingNew/clearStepOrder'); this.$store.dispatch('trainingNew/clearOperateOrder'); this.$store.dispatch('trainingNew/setTrainingScore', resp.data); diff --git a/src/views/designPlatform/trainingPositionTip.vue b/src/views/designPlatform/trainingPositionTip.vue index 0edb941ca..1dfec1bc6 100644 --- a/src/views/designPlatform/trainingPositionTip.vue +++ b/src/views/designPlatform/trainingPositionTip.vue @@ -38,7 +38,7 @@ export default { } }, watch: { - '$store.state.socket.trainingStepTip': function(val) { + '$store.state.trainingNew.trainingStepTip': function(val) { if (val && this.trainingDetail.type === 'SINGLE') { const member = this.$store.state.training.memberData[val.memberId]; this.$nextTick(function() { @@ -74,7 +74,7 @@ export default { if (steps && steps.length) { const step = steps[stepOrder - 1]; const distance = 5; - this.tip = this.$store.state.socket.trainingStepTip.content; + this.tip = this.$store.state.trainingNew.trainingStepTip.content; if (step && step.tipPosition && step.tipPosition.deviceCode) { const position = this.getShapeTipPoint(step.tipPosition); if (position) { diff --git a/src/views/designPlatform/trainingPreview.vue b/src/views/designPlatform/trainingPreview.vue index 3e34bcc6c..3e518d6bc 100644 --- a/src/views/designPlatform/trainingPreview.vue +++ b/src/views/designPlatform/trainingPreview.vue @@ -144,7 +144,7 @@ export default { handlerEnd() { endTraining(this.group).then((resp) => { this.$store.dispatch('trainingNew/trainingEnd'); - this.$store.dispatch('socket/clearTrainingStepTip'); + this.$store.dispatch('trainingNew/clearTrainingStepTip'); this.$store.dispatch('trainingNew/clearStepOrder'); this.$store.dispatch('trainingNew/setTrainingScore', resp.data); }).catch(() => { diff --git a/src/views/designPlatform/trainingTip.vue b/src/views/designPlatform/trainingTip.vue index 94c54fc22..427cad2e3 100644 --- a/src/views/designPlatform/trainingTip.vue +++ b/src/views/designPlatform/trainingTip.vue @@ -21,7 +21,7 @@ export default { } }, watch: { - '$store.state.socket.trainingStepTip': function(val) { + '$store.state.trainingNew.trainingStepTip': function(val) { if (val && this.trainingDetail.type === 'SCENE') { const member = this.$store.state.training.memberData[val.memberId]; this.$nextTick(function() { diff --git a/src/views/newMap/display/flowData.vue b/src/views/newMap/display/flowData.vue index 96c02d0ec..2c3d0c459 100644 --- a/src/views/newMap/display/flowData.vue +++ b/src/views/newMap/display/flowData.vue @@ -138,16 +138,19 @@ export default { this.flowDataShow = true; this.isDisabled = true; const simulationWorkParam = this.$store.state.socket.simulationWorkParam; - if (simulationWorkParam && simulationWorkParam.itemMap && simulationWorkParam.itemMap.LPF) { - const currentFlowData = this.flowDataList.find(each=>{ return each.id == simulationWorkParam.itemMap.LPF; }); - if (currentFlowData) { - this.currentFlowDataId = currentFlowData.id; - this.currentFlowDataName = currentFlowData.name; - } - } else { + if (this.currentFlowDataName) { const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; }); if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; } + } else { + if (simulationWorkParam && simulationWorkParam.itemMap && simulationWorkParam.itemMap.LPF) { + const currentFlowData = this.flowDataList.find(each=>{ return each.id == simulationWorkParam.itemMap.LPF; }); + if (currentFlowData) { + this.currentFlowDataId = currentFlowData.id; + this.currentFlowDataName = currentFlowData.name; + } + } } + } }, clearSubscribe() { diff --git a/src/views/newMap/display/index.vue b/src/views/newMap/display/index.vue index 134fd8fdd..b74ac864a 100644 --- a/src/views/newMap/display/index.vue +++ b/src/views/newMap/display/index.vue @@ -10,10 +10,8 @@ - - diff --git a/src/views/newMap/display/simulationControl.vue b/src/views/newMap/display/simulationControl.vue index c03d6b26b..e97b5ae7c 100644 --- a/src/views/newMap/display/simulationControl.vue +++ b/src/views/newMap/display/simulationControl.vue @@ -1,5 +1,5 @@ @@ -30,13 +25,9 @@ export default { pauseLoading:false, group:'', speed: 1, - nowMode: '普通模式', + nowMode: '正常操作', isShowSpeedMenuList: false, - isShowModeMenuList: false, - modeList: [ - {label: '故障模式', value: OperateMode.FAULT}, - {label: '普通模式', value: OperateMode.NORMAL} - ] + isShowModeMenuList: false }; }, computed: { @@ -68,25 +59,27 @@ export default { }, project() { return getSessionStorage('project'); - }, - isShowDirective() { // 哈尔滨项目 行调设备显示 - return this.$route.query.type === 'CW' && this.project === 'heb'; } }, mounted() { this.group = this.$route.query.group; - if (this.isShowDirective) { - this.menuList.unshift({label: '指令模式', value: OperateMode.DIRECTIVE}); - } window.addEventListener('click', this.close, false); }, beforeDestroy() { window.removeEventListener('click', this.close); }, methods:{ - changeOperateMode(mode) { - this.nowMode = mode.label; - this.$store.dispatch('training/changeOperateMode', { mode: mode.value }); + changeOperateMode() { + // this.nowMode = mode.label; + let val = ''; + if (this.nowMode === '正常操作') { + this.nowMode = '特殊操作'; + val = OperateMode.FAULT; + } else { + this.nowMode = '正常操作'; + val = OperateMode.NORMAL; + } + this.$store.dispatch('training/changeOperateMode', { mode: val }); }, showMenuModeList() { event.stopPropagation(); diff --git a/src/views/newMap/display/simulationMenu.vue b/src/views/newMap/display/simulationMenu.vue index c21a1e82c..e1add9bbe 100644 --- a/src/views/newMap/display/simulationMenu.vue +++ b/src/views/newMap/display/simulationMenu.vue @@ -41,7 +41,6 @@ - @@ -52,13 +51,13 @@ - - + - + + + diff --git a/src/views/newMap/display/trainingList/index.vue b/src/views/newMap/display/trainingList/index.vue deleted file mode 100644 index 250e38ba4..000000000 --- a/src/views/newMap/display/trainingList/index.vue +++ /dev/null @@ -1,235 +0,0 @@ - - - - diff --git a/src/views/newMap/display/trainingList/trainingMenu.vue b/src/views/newMap/display/trainingList/trainingMenu.vue index 339da83e3..2f13bc277 100644 --- a/src/views/newMap/display/trainingList/trainingMenu.vue +++ b/src/views/newMap/display/trainingList/trainingMenu.vue @@ -3,19 +3,21 @@
-
- - +
+ 实训列表 + 实训菜单 + +

- {{ trainingDetail.name }} + {{ trainingDetail ?trainingDetail.name:'' }}

-
+

@@ -54,6 +56,16 @@

+
+ + + + + + + + +
@@ -65,7 +77,7 @@ import { ScriptMode } from '@/scripts/ConstDic'; import { clearSimulation } from '@/api/simulation'; import { startTraining, endTraining } from '@/api/jmap/training'; import ScenePlayRole from './scenePlayRole'; - +import { getPublishSingleList, getPublishTrainingDetail, loadPublishTraining, getPublishScenesList } from '@/api/jmap/training'; export default { name: 'TipTrainingDetail', components: { @@ -82,16 +94,94 @@ export default { isShrink: true, showSumbit: false, demoMode: ScriptMode.TEACH, - TrainingMode: ScriptMode + TrainingMode: ScriptMode, + activeName: 'first', + showMenu: false, + scoreList: [], + pagerConfig: { + pageSize: 'pageSize', + pageIndex: 'pageNum' + }, + training: {}, + queryForm: { + labelWidth: '100px', + reset: true, + show:false + }, + queryList: { + query: this.queryFunction, + selectCheckShow: false, + paginationHiden: true, + indexShow: true, + height: 200, + columns: [ + { + title: this.$t('trainingManage.name'), + prop: 'name' + }, + { + title: this.$t('trainingManage.description'), + prop: 'description' + }, + { + title: this.$t('trainingManage.labelJson'), + prop: 'labelJson' + }, + { + type: 'button', + title: this.$t('trainingManage.operate'), + buttons: [ + { + name: '加载', + handleClick: this.loadScript, + type: 'primary', + showControl:(row) => { return row.id; } + } + ] + } + ] + }, + queryListScene: { + query: this.queryFunctionScene, + selectCheckShow: false, + paginationHiden: true, + indexShow: true, + height: 200, + columns: [ + { + title: this.$t('trainingManage.name'), + prop: 'name' + }, + { + title: this.$t('trainingManage.description'), + prop: 'description' + }, + { + title: this.$t('trainingManage.labelJson'), + prop: 'labelJson' + }, + { + type: 'button', + title: this.$t('trainingManage.operate'), + buttons: [ + { + name: '加载', + handleClick: this.loadScript, + type: 'primary', + showControl:(row) => { return row.id; } + } + ] + } + ] + }, + playerId: '', + trainingScore: 0 }; }, computed: { trainingSwitch() { return this.$store.state.trainingNew.trainingSwitch; }, - trainingScore() { - return this.$store.state.trainingNew.trainingScore; - }, trainingDetail() { return this.$store.state.trainingNew.trainingDetail; }, @@ -100,19 +190,29 @@ export default { }, teachMode() { return this.$store.state.trainingNew.teachMode; + }, + mapId() { + return this.$route.query.mapId; } }, watch: { '$store.state.trainingNew.stepOrder': function(val) { const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson); + const scoringRule = JSON.parse(this.$store.state.trainingNew.trainingDetail.scoringRuleJson); + const rule = scoringRule.find(rule => rule.memberId == this.playerId); + if (rule.details && stepList[val - 1]) { + const scoreRule = rule.details.find(item => item.elementId == stepList[val - 1].id ); + this.scoreList.push(scoreRule); + this.trainingScore += scoreRule.score; + console.log(this.scoreList, this.trainingScore, rule, scoreRule, stepList[val - 1].id, scoreRule.score, scoreRule.elementId); + } if (val >= 1 && val < stepList.length) { const msg = {content:stepList[val].description, memberId:stepList[val].memberId}; - this.$store.dispatch('socket/setTrainingStepTip', msg); + this.$store.dispatch('trainingNew/setTrainingStepTip', msg); } else { - this.$store.dispatch('socket/setTrainingStepTip', null); + this.$store.dispatch('trainingNew/setTrainingStepTip', null); val && this.$store.dispatch('socket/trainingOverCountIncrease'); } - // operateOrder; } }, mounted() { @@ -122,6 +222,9 @@ export default { loadInitData() { this.showSumbit = false; }, + changeShow(val) { + this.showMenu = val; + }, shrink() { if (this.isShrink) { this.isShrink = false; @@ -150,21 +253,21 @@ export default { this.$store.dispatch('trainingNew/changeTeachMode', this.demoMode); startTraining(this.group, {mode: this.demoMode}).then(() => { this.$store.dispatch('trainingNew/trainingStart'); - this.$store.dispatch('trainingNew/setTrainingScore', ''); const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson); const msg = {content:stepList[0].description, memberId:stepList[0].memberId}; - this.$store.dispatch('socket/setTrainingStepTip', msg); + this.$store.dispatch('trainingNew/setTrainingStepTip', msg); }).catch(() => { this.$message.error('开始实训失败!'); }); }, handlerEnd() { - endTraining(this.group).then((resp) => { + endTraining(this.group, { scoreList: this.scoreList }).then((resp) => { this.$store.dispatch('trainingNew/trainingEnd'); - this.$store.dispatch('socket/clearTrainingStepTip'); + this.$store.dispatch('trainingNew/clearTrainingStepTip'); this.$store.dispatch('trainingNew/clearStepOrder'); this.$store.dispatch('trainingNew/clearOperateOrder'); - this.$store.dispatch('trainingNew/setTrainingScore', resp.data); + this.scoreList = []; + this.trainingScore = 0; }).catch(() => { this.$message.error('结束实训失败!'); }); @@ -173,6 +276,41 @@ export default { if (this.group) { clearSimulation(this.group); } + }, + queryFunction() { + return getPublishSingleList(this.mapId); + }, + queryFunctionScene() { + return getPublishScenesList(this.mapId); + }, + async loadScript(index, data) { + if (this.trainingSwitch) { + this.$message.error('请先结束当前实训后再加载新的实训!'); + return; + } + try { + const detailResp = await getPublishTrainingDetail(data.id); + this.training = detailResp.data; + if (detailResp.data.mapLocationJson) { + const mapLocation = JSON.parse(detailResp.data.mapLocationJson); + this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); + } + this.playerId = ''; + if (detailResp.data.playerIdJson) { + this.playerId = JSON.parse(detailResp.data.playerIdJson)[0]; + // if (playerId) { + // const member = this.$store.state.training.memberData[playerId]; + // this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]); + // this.$store.dispatch('training/setRoles', member.type); + // } + } + this.showMenu = true; + this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data); + await loadPublishTraining(this.group, data.id, {mode: this.teachMode}); + this.$message.success('加载实训成功!'); + } catch (e) { + this.$message.error('加载实训失败!'); + } } } }; @@ -190,7 +328,7 @@ export default { .reminder-drag{ position: absolute; - bottom: 0px; + bottom: 0; left: 15px; z-index: 10; } diff --git a/src/views/newMap/display/trainingList/trainingPositionTip.vue b/src/views/newMap/display/trainingList/trainingPositionTip.vue index a69cbcb7b..5b9377505 100644 --- a/src/views/newMap/display/trainingList/trainingPositionTip.vue +++ b/src/views/newMap/display/trainingList/trainingPositionTip.vue @@ -38,7 +38,7 @@ export default { } }, watch: { - '$store.state.socket.trainingStepTip': function(val) { + '$store.state.trainingNew.trainingStepTip': function(val) { if (val && this.trainingDetail.type === 'SINGLE') { const member = this.$store.state.training.memberData[val.memberId]; this.$nextTick(function() { @@ -67,14 +67,13 @@ export default { this.position = { x: 0, y: 0 }; }, '$store.state.training.tipEvent': function (val) { - setTimeout(() => { this.tipInit(); }, 300); - this.$nextTick(function() { - this.tipInit(); - }); + if (this.tip) { + setTimeout(() => { this.tipInit(); }, 10); + } } }, methods: { - tipInit() { + async tipInit() { if (this.teachMode === ScriptMode.TEACH) { this.tipShow = true; const offset = this.$store.state.config.canvasOffset; @@ -84,7 +83,7 @@ export default { if (steps && steps.length) { const step = steps[stepOrder]; const distance = 5; - this.tip = this.$store.state.socket.trainingStepTip ? this.$store.state.socket.trainingStepTip.content : ''; + this.tip = this.$store.state.trainingNew.trainingStepTip ? this.$store.state.trainingNew.trainingStepTip.content : ''; if (step && step.tipPosition && step.tipPosition.deviceCode) { const position = this.getShapeTipPoint(step.tipPosition); if (position) { @@ -95,7 +94,7 @@ export default { this.popTipShow(); } } else if (step && step.tipPosition && step.tipPosition.domId) { - const position = this.getOtherTipPoint(step.tipPosition); + const position = await this.getOtherTipPoint(step.tipPosition); if (position) { this.position = position; this.position.y -= distance; @@ -157,25 +156,48 @@ export default { // 获取地图菜单按钮和对话框按钮提示显示位置 getOtherTipPoint(tipPosition) { const domId = OperationHandler.getDomIdByOperation(tipPosition.domId); - const btnDom = document.getElementById(domId); - if (btnDom) { - const offset = getDomOffset(btnDom); - if (offset.x == 0 && offset.y == 0) { - return null; - } + if (!domId) { return null; } + return new Promise(async(resolve, reject) => { + try { + let btnDom = document.getElementById(domId); + if (!btnDom) { + btnDom = await this.getAwaitDom(domId); + } + if (btnDom) { + const offset = getDomOffset(btnDom); + if (offset.x == 0 && offset.y == 0) { + resolve(null); + } - let align = 'bottom'; - if (this.tipAlignIsTop(tipPosition, domId)) { - align = 'top'; - } + let align = 'bottom'; + if (this.tipAlignIsTop(tipPosition, domId)) { + align = 'top'; + } - return { - align: align, - x: offset.x + btnDom.clientWidth / 2, - y: offset.y - }; - } - return null; + resolve({ + align: align, + x: offset.x + btnDom.clientWidth / 2, + y: offset.y + }); + } else { + resolve(null); + } + } catch (err) { + resolve(null); + } + }); + }, + getAwaitDom(domId) { + return new Promise((resolve) => { + setTimeout(() => { + const btnDom = document.getElementById(domId); + if (btnDom) { + resolve(btnDom); + } else { + resolve(null); + } + }, 300); + }); }, tipAlignIsTop(step, domId) { // 如果是tip框则箭头朝上 diff --git a/src/views/newMap/display/trainingList/trainingTip.vue b/src/views/newMap/display/trainingList/trainingTip.vue index 43e3e00c4..014ec9e16 100644 --- a/src/views/newMap/display/trainingList/trainingTip.vue +++ b/src/views/newMap/display/trainingList/trainingTip.vue @@ -21,7 +21,7 @@ export default { } }, watch: { - '$store.state.socket.trainingStepTip': function(val) { + '$store.state.trainingNew.trainingStepTip': function(val) { if (val && this.trainingDetail.type === 'SCENE') { const member = this.$store.state.training.memberData[val.memberId]; this.$nextTick(function() { @@ -48,7 +48,7 @@ export default { this.trainingTipMessage = '实训完成,请点击结束按钮。'; } }, - '$store.state.trainingNew.operateErrMsg': function (val) { + '$store.state.training.operateErrMsg': function (val) { this.tipInfo({ color: val.color, message: val.errMsg }); } }, diff --git a/src/views/newMap/display/voiceChatBox/chatContent.vue b/src/views/newMap/display/voiceChatBox/chatContent.vue new file mode 100644 index 000000000..4364ec822 --- /dev/null +++ b/src/views/newMap/display/voiceChatBox/chatContent.vue @@ -0,0 +1,363 @@ + + + diff --git a/src/views/newMap/display/voiceChatBox/chatSetting.vue b/src/views/newMap/display/voiceChatBox/chatSetting.vue new file mode 100644 index 000000000..7ec309380 --- /dev/null +++ b/src/views/newMap/display/voiceChatBox/chatSetting.vue @@ -0,0 +1,127 @@ + + + + diff --git a/src/views/newMap/display/voiceChatBox/index.vue b/src/views/newMap/display/voiceChatBox/index.vue new file mode 100644 index 000000000..6ad1f1dc6 --- /dev/null +++ b/src/views/newMap/display/voiceChatBox/index.vue @@ -0,0 +1,1214 @@ + + + + diff --git a/src/views/newMap/mapDraftPicture/createPicture.vue b/src/views/newMap/mapDraftPicture/createPicture.vue index a92330a32..7a56bd984 100644 --- a/src/views/newMap/mapDraftPicture/createPicture.vue +++ b/src/views/newMap/mapDraftPicture/createPicture.vue @@ -7,7 +7,7 @@ > - + @@ -36,7 +36,8 @@ - 创建 + 创建 + 修改 @@ -57,7 +58,8 @@ export default { name: [{ required: true, message: '请输入画面名称', trigger: 'blur' }], type: [{ required: true, message: '请选择画面类型', trigger: 'change' }], lineCode: [{ required: true, message: '请选择线路', trigger: 'change' }] - } + }, + edit: false }; }, computed: { @@ -97,12 +99,41 @@ export default { } }); }, + updateData() { + this.$refs.ruleForm.validate((valid) => { + const map = this.$store.state.map.map; + if (map && map.pictureList && map.pictureList.length) { + const pictureModel = map.pictureList.find(elem => elem.name === this.ruleForm.name); + pictureModel.type = this.ruleForm.type; + pictureModel.stationCodes = this.ruleForm.stationCodes; + pictureModel.lineCode = this.ruleForm.lineCode; + if (map && parseInt(this.$route.params.mapId)) { + saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(() => { + this.$message.success('修改画面成功!'); + this.doClose(); + }).catch(() => { + this.$message.error('修改画面失败!'); + }); + } + } else { + this.$message.error('数据不存在!'); + } + }); + }, doClose() { this.$refs.ruleForm.resetFields(); this.centerDialogVisible = false; }, - doShow() { + doShow(data) { + this.edit = false; this.centerDialogVisible = true; + if (data) { + this.ruleForm.name = data.name; + this.ruleForm.type = data.type; + this.ruleForm.stationCodes = data.stationCodes; + this.ruleForm.lineCode = data.lineCode; + this.edit = true; + } } } }; diff --git a/src/views/newMap/mapDraftPicture/index.vue b/src/views/newMap/mapDraftPicture/index.vue index ef206d695..c4cf99e44 100644 --- a/src/views/newMap/mapDraftPicture/index.vue +++ b/src/views/newMap/mapDraftPicture/index.vue @@ -27,6 +27,7 @@ @createPicture="createPicture" @changePicture="changePicture" @deletePicture="deletePicture" + @editPicture="editPicture" @setCenter="setCenter" />
@@ -375,6 +376,12 @@ export default { changePicture() { this.$refs.changePicture.doShow(); }, + editPicture() { + if (this.pictureName) { + const pictureModel = this.$store.state.map.map.pictureList.find(elem => elem.name == this.pictureName); + this.$refs.createPicture.doShow(pictureModel); + } + }, // 撤销 revocation() { this.$store.dispatch('map/setRevocation'); diff --git a/src/views/newMap/mapDraftPicture/mapoperate/device.vue b/src/views/newMap/mapDraftPicture/mapoperate/device.vue index b7679d79c..2cfb0e970 100644 --- a/src/views/newMap/mapDraftPicture/mapoperate/device.vue +++ b/src/views/newMap/mapDraftPicture/mapoperate/device.vue @@ -68,7 +68,7 @@ export default { deviceList () { return [...this.sectionList, ...this.signalList, ...this.psdList, ...this.stationStandList, ...this.stationList, ...this.trainWindowList, ...this.arrowList, ...this.automaticRouteButtonList, ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.directionRodList, ...this.espList, - ...this.indicatorLightList, ...this.lcList, ...this.lineList, ...this.outerFrameList, ...this.psdList, ...this.resourceList, ...this.responderList, + ...this.indicatorLightList, ...this.lcList, ...this.lineList, ...this.outerFrameList, ...this.resourceList, ...this.responderList, ...this.signalButtonList, ...this.splitStationList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList, ...this.zcList]; }, diff --git a/src/views/newMap/mapsystemNew/plugin/trainingtip.vue b/src/views/newMap/mapsystemNew/plugin/trainingtip.vue index bbb1ce740..be7860b91 100644 --- a/src/views/newMap/mapsystemNew/plugin/trainingtip.vue +++ b/src/views/newMap/mapsystemNew/plugin/trainingtip.vue @@ -33,9 +33,6 @@ export default { watch: { '$store.state.training.tipEvent': function (val) { setTimeout(() => { this.tipInit(); }, 300); - this.$nextTick(function() { - this.tipInit(); - }); } }, methods: { diff --git a/src/views/publish/publishMap/editSubsystem.vue b/src/views/publish/publishMap/editSubsystem.vue index 2d6f6b031..83615ea91 100644 --- a/src/views/publish/publishMap/editSubsystem.vue +++ b/src/views/publish/publishMap/editSubsystem.vue @@ -155,7 +155,8 @@ export default { { key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'}, { key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' }, { key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' }, - { key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' } + { key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' }, + { key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' } ], endTableData: [ { key: 'DEFAULT_MEMBER', label: '默认仿真成员', value: '', type: 'select', optionList: [] }, @@ -359,7 +360,8 @@ export default { { key: 'client', label: '初始客户端', value: '', type: 'select', optionList: this.clientList}, { key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'}, { key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' }, - { key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' } + { key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' }, + { key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' } ]; this.endTableData = [ { key: 'DEFAULT_MEMBER', label: '默认仿真成员', value: '', type: 'select', optionList: [] }, diff --git a/src/views/publish/publishMap/subsystem.vue b/src/views/publish/publishMap/subsystem.vue index b78a54dff..fd552f5b0 100644 --- a/src/views/publish/publishMap/subsystem.vue +++ b/src/views/publish/publishMap/subsystem.vue @@ -35,25 +35,25 @@ const simTypeMap = { RAILWAY: '大铁CTC', EMERGENCY: '应急调度' }; -const clientMap = { - C_ATS: '中心ATS工作站', - C_ATS_BS: '中心ATS大屏', - C_PA: '中心PA系统', - C_CCTV: '中心视频监控系统', - L_ATS: '现地ATS工作站', - LCW: '本地控制工作站', - L_CCTV: '现地视频监控系统', - L_PA: '现地PA系统', - GPC: '调度台终端', - IPC: '联锁工作站', - STPC: '车务终端', - DMP: '车务管理终端', - ISCS: 'ISCS', - IBP: 'IBP', - PSL: 'PSL', - RUN_PLAN_DESIGN: '运行图编制', - DRIVE: '列车驾驶' -}; +// const clientMap = { +// C_ATS: '中心ATS工作站', +// C_ATS_BS: '中心ATS大屏', +// C_PA: '中心PA系统', +// C_CCTV: '中心视频监控系统', +// L_ATS: '现地ATS工作站', +// LCW: '本地控制工作站', +// L_CCTV: '现地视频监控系统', +// L_PA: '现地PA系统', +// GPC: '调度台终端', +// IPC: '联锁工作站', +// STPC: '车务终端', +// DMP: '车务管理终端', +// ISCS: 'ISCS', +// IBP: 'IBP', +// PSL: 'PSL', +// RUN_PLAN_DESIGN: '运行图编制', +// DRIVE: '列车驾驶' +// }; export default { name: 'PublishMap', components: { @@ -120,35 +120,35 @@ export default { title: '默认扮演成员', prop: 'DEFAULT_MEMBER', type: 'tag', - columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('DEFAULT_MEMBER') ? '是' : '否'; }, + columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('DEFAULT_MEMBER') ? '是' : '否'; }, tagType: () => { return 'success'; } }, { title: '大客流', prop: 'LPF', type: 'tag', - columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('LPF') ? '是' : '否'; }, + columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('LPF') ? '是' : '否'; }, tagType: () => { return 'success'; } }, { title: '真实设备', prop: 'REAL_DEVICE', type: 'tag', - columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('REAL_DEVICE') ? '是' : '否'; }, + columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('REAL_DEVICE') ? '是' : '否'; }, tagType: () => { return 'success'; } }, { title: '加载实训', prop: 'TRAINING', type: 'tag', - columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('TRAINING') ? '是' : '否'; }, + columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('TRAINING') ? '是' : '否'; }, tagType: () => { return 'success'; } }, { title: '加载试卷', prop: 'EXAM', type: 'tag', - columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('EXAM') ? '是' : '否'; }, + columnValue: (row) => { return row.paramVO.itemMap && row.paramVO.itemMap.hasOwnProperty('EXAM') ? '是' : '否'; }, tagType: () => { return 'success'; } }, { @@ -219,6 +219,13 @@ export default { this.$refs.ruleForm.validate((valid) => { if (valid) { generateMapFunctionNew(this.$route.query.mapId, this.form).then(resp => { + if (resp.data && resp.data.length) { + let message = ''; + resp.data.forEach(item => { + message = message + item + ';'; + }); + this.$messageBox(message); + } this.reloadTable(); this.doCloseGenerate(); }).catch(error => { diff --git a/src/views/trainingManage/designIndex.vue b/src/views/trainingManage/designIndex.vue index 598299af0..e73ba9c09 100644 --- a/src/views/trainingManage/designIndex.vue +++ b/src/views/trainingManage/designIndex.vue @@ -388,6 +388,10 @@ export default { }); }, updateMapLocation() { + if (!Vue.prototype.$jlmap) { + this.$message.warning('请切换到站场图定位!'); + return; + } const data = Vue.prototype.$jlmap.$options; const params = {scale: data.scaleRate, x: data.offsetX, y: data.offsetY}; updateTrainingMaplocation({id: this.editData.id, mapLocationJson: JSON.stringify(params)}).then(res => { diff --git a/src/views/trainingManage/list.vue b/src/views/trainingManage/list.vue index 1f3adc54e..19b2c5245 100644 --- a/src/views/trainingManage/list.vue +++ b/src/views/trainingManage/list.vue @@ -199,7 +199,7 @@ export default { this.$store.dispatch('trainingNew/setTrainingDetail', null); if (resp.data && resp.data.mapLocationJson) { const mapLocation = JSON.parse(resp.data.mapLocationJson); - this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); + this.$jlmap && this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); } this.$emit('updateDetails', resp.data); this.doClose(); @@ -278,7 +278,7 @@ export default { this.training = detailResp.data; if (detailResp.data.mapLocationJson) { const mapLocation = JSON.parse(detailResp.data.mapLocationJson); - this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); + this.$jlmap && this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); } if (detailResp.data.playerIdJson) { const playerId = JSON.parse(detailResp.data.playerIdJson)[0];