From e5d83555af5a23c24a03ac894dceebeb079bc575 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 16 Sep 2020 10:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=A7=E8=B5=9B=E7=BB=83?= =?UTF-8?q?=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/training.js | 13 +- src/views/newMap/displayNew/demonChat.vue | 189 ------------------ src/views/newMap/displayNew/demonMenu.vue | 6 +- .../displayNew/dispatherContest/index.vue | 10 +- .../displayNew/dispatherContest/sceneList.vue | 5 +- src/views/newMap/displayNew/menuDemon.vue | 2 +- .../scriptDisplay/component/scriptTip.vue | 2 +- src/views/publish/examRule/index.vue | 1 - 8 files changed, 29 insertions(+), 199 deletions(-) diff --git a/src/store/modules/training.js b/src/store/modules/training.js index 228bebb69..60bd1b7ca 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -41,7 +41,8 @@ const training = { memberData: {}, // 综合仿真成员列表 simulationUserList: [], // 综合仿真用户列表 orignalUserRoleId:'', // 设置旧的角色的id - scriptQuitCount: 0 // 主动退出剧本 + scriptQuitCount: 0, // 主动退出剧本 + scriptOperationType: '' // 剧本操作类型 }, getters: { @@ -107,6 +108,9 @@ const training = { }, scriptQuitCount: (state) => { return state.scriptQuitCount; + }, + scriptOperationType: (state) => { + return state.scriptOperationType; } }, @@ -297,6 +301,9 @@ const training = { }, setScriptQuit: (state) => { state.scriptQuitCount++; + }, + setScriptOperationType: (state, scriptOperationType) => { + state.scriptOperationType = scriptOperationType; } }, @@ -726,6 +733,10 @@ const training = { /** 剧本仿真 设置旧的角色的id */ setOrignalUserRoleId:({ commit }, data) => { commit('setOrignalUserRoleId', data); + }, + /** 操作剧本类型(教学、练习、考试)*/ + setScriptOperationType: ({ commit }, data) => { + commit('setScriptOperationType', data); } } }; diff --git a/src/views/newMap/displayNew/demonChat.vue b/src/views/newMap/displayNew/demonChat.vue index 83a363285..36a868368 100644 --- a/src/views/newMap/displayNew/demonChat.vue +++ b/src/views/newMap/displayNew/demonChat.vue @@ -57,200 +57,11 @@ export default { } }, watch:{ - // '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始获取仿真成员 - // getSimulationMemberList(this.group).then(resp => { - // this.driverList = []; - // this.treeData = []; - // const result = covertMemberData(this.activeTrainList, resp.data); - // this.driverList = result.driverList; - // this.treeData = [{ - // label: '行调', - // id: 'dispatcher', - // type: 'role', - // children: result.deviceListData[0] - // }, { - // label: '车站值班员', - // id: 'stationSupervisor', - // type: 'role', - // children: result.deviceListData[2] - // }, { - // label: '司机', - // id: 'driver', - // type: 'role', - // children: result.deviceListData[3] - // }, { - // label: '通号', - // id: 'maintainer', - // type: 'role', - // children: result.deviceListData[1] - // }, { - // label: '车辆段', - // id: 'depotDispatcher', - // type: 'role', - // children: result.deviceListData[4] - // }]; - // this.memberData = result.lastMemberList; - // }).catch(() => { - // this.$messageBox('获取仿真成员列表失败!'); - // }); - // }, - // 创建会话 - // '$store.state.socket.createConversition':function(val) { - // if (this.memberData.length > 0) { - // const conversitionMember = this.memberData.find(member=>{ return member.userId == this.$store.state.user.id; }); - // if (conversitionMember && val.memberIds.includes(conversitionMember.id)) { - // // 当前用户创建的会话 - // if (val.creatorId !== conversitionMember.id) { - // this.$message.success(this.coverName(val) + '与你开启会话'); - // } - // this.isHasCoversition = true; - // this.isStartRecord = true; - // this.isQuitShow = true; - // this.conversitionId = val.id; - // const memberList = []; - // val.memberIds.forEach(id=>{ - // if (val.creatorId == id) { - // const member = this.memberData.find(member=>{ return member.id == id; }); - // member.connect = true; - // memberList.push(member); - // } else { - // const member = this.memberData.find(member=>{ return member.id == id; }); - // // member.connect = false; - // member.connect = true; - // member && memberList.push(member); - // } - // }); - // this.currentMemberList = memberList; - // } else { - // // 如果是观众看所有人的会话 - // if (this.userRole == 'AUDIENCE') { - // this.isHasCoversition = true; - // this.currentMemberList = this.memberData; - // } - // } - // } - // }, - // 用户接受会话 - // '$store.state.socket.acceptConversionInvite':function(val) { - // this.conversitionId = val.id; - // if (this.conversitionId) { - // let result = false; - // // 更改成员列表里面的成员状态 - // const memberList = this.currentMemberList.map(member => { - // if (member.id == val.memberId) { - // member.connect = true; - // result = true; - // } - // return member; - // }); - // // 如果该用户不在成员列表里面,就动态加进去(当前会话) - // if (!result && this.conversitionId) { - // const member = this.memberData.find(member=>{ return member.id == val.memberId; }); - // if (member) { - // member.connect = true; - // memberList.push(member); - // // 如果是当前的用户 - // if (member.userId == this.$store.state.user.id) { - // memberList.push(this.inviteUser); - // this.isStartRecord = true; - // this.isQuitShow = true; - // this.inviteUser = {}; - // this.isHasCoversition = true; - // } - // } - // } - // this.currentMemberList = memberList; - // } - // }, - // 会话聊天消息 - // '$store.state.socket.conversationInfo':function (val, old) { // 仿真聊天 - // const simulationText = this.$store.state.socket.conversationInfo; - // if (val.messageType == 'MESSAGE' && (this.conversitionId == val.id || this.userRole == 'AUDIENCE')) { - // const content = this.addContent(simulationText.message); - // this.chatContentList.push(content); - // if (!content.self) { - // this.$refs.chatbox.addAudioList(content); - // } - // } - // }, - // 按计划行车的列车列表更新(更新司机列表) - // '$store.state.map.activeTrainListChange': function (val) { - // const activeTrainList = this.$store.state.map.activeTrainList; - // activeTrainList.sort((a, b) => { - // return parseInt(a) - parseInt(b); - // }); - // if (this.driverList.length > 0) { - // const driverList = []; - // if (activeTrainList && activeTrainList.length) { - // activeTrainList.forEach(groupNumber => { - // const drivers = this.driverList.find(driver=>{ - // return driver.deviceCode == groupNumber; - // }); - // if (drivers) { - // driverList.push(drivers); - // } - // }); - // } - // this.treeData[2].children = driverList; - // this.memberData = [...this.treeData[0].children, ...this.treeData[1].children, ...this.treeData[2].children, ...this.treeData[3].children, ...this.treeData[4].children]; - // } else { - // this.activeTrainList = activeTrainList; - // } - // }, // 剧本执行完成消息 '$store.state.socket.scriptFinish':function(val, old) { this.$message('剧本演出完毕'); this.$refs.scriptTip.resetScriptTip(); - }, - // 退出会话消息 - // '$store.state.socket.overConversition': function (val) { - // if (val.id === this.conversitionId) { - // this.conversitionId = ''; - // this.currentMemberList = []; - // this.chatContentList = []; - // this.isHasCoversition = false; - // this.isStartRecord = false; - // } - // }, - // '$store.state.socket.exitConversition': function (val) { - // const member = this.memberData.find(member=>{ return member.memberId == val.member; }); - // if (val.id === this.conversitionId && member.userId == this.$store.state.user.id) { - // this.conversitionId = ''; - // this.currentMemberList = []; - // this.chatContentList = []; - // this.isHasCoversition = false; - // this.isStartRecord = false; - // } else if (val.id === this.conversitionId) { - // const mList = []; - // this.currentMemberList.forEach(member => { - // if (member.memberId != val.memberId) { - // mList.push(member); - // } - // }); - // this.currentMemberList = mList; - // } - // }, - // 邀请会话的消息 - '$store.state.socket.inviteSimulationConversition':function(val) { - // const conversitionMember = this.memberData.find(member=>{ return member.id == val.creatorId; }); - // if (conversitionMember) { - // this.inviteUserName = conversitionMember.label; - // this.conversitionId = val.id; - // conversitionMember.connect = true; - // conversitionMember.online = true; - // this.inviteUser = conversitionMember; - // - // this.currentMemberList.push(conversitionMember); - // const member = this.memberData.find(member=>{ return member.id == val.memberId; }); - // member.connect = true; - // this.currentMemberList.push(member); - // this.isStartRecord = true; - // this.isHasCoversition = true; - // // this.$refs.chatbox.inviteMember(); - // this.$message.success(this.inviteUserName + '与你开启会话'); - // } } - }, mounted() { }, diff --git a/src/views/newMap/displayNew/demonMenu.vue b/src/views/newMap/displayNew/demonMenu.vue index 357a1e89a..b59495dcd 100644 --- a/src/views/newMap/displayNew/demonMenu.vue +++ b/src/views/newMap/displayNew/demonMenu.vue @@ -20,6 +20,7 @@ 派班计划加载 派班计划预览 实操练习 + 实操教学 切换地图 @@ -204,7 +205,10 @@ export default { this.$emit('changeMap', query); }, fieldPractice() { - this.$emit('fieldPractice'); + this.$emit('fieldPractice', 'practice'); + }, + fieldTeach() { + this.$emit('fieldPractice', 'teach'); } } }; diff --git a/src/views/newMap/displayNew/dispatherContest/index.vue b/src/views/newMap/displayNew/dispatherContest/index.vue index e8857a103..4f94152fb 100644 --- a/src/views/newMap/displayNew/dispatherContest/index.vue +++ b/src/views/newMap/displayNew/dispatherContest/index.vue @@ -376,7 +376,8 @@ export default { } this.userRole = userRole; this.$store.dispatch('scriptRecord/updateBgSet', true); - this.$refs.chatbox.setMembers(id); + console.log(id, '-------------'); + // this.$refs.chatbox.setMembers(id); const res = await loadScriptNew(row.id, id, this.group); if (res && res.code == 200) { if (mapLocation) { @@ -387,6 +388,7 @@ export default { // this.initLoadPage(); } } catch (error) { + console.log(error); this.$messageBox(error.message); } // if (this.isScript) { @@ -410,7 +412,7 @@ export default { } } this.userRole = userRole; - this.$refs.chatbox.setMembers(this.$store.state.training.orignalUserRoleId); + // this.$refs.chatbox.setMembers(this.$store.state.training.orignalUserRoleId); this.$refs.chatbox.clearAllData(); this.$store.dispatch('training/setPrdType', this.$route.query.prdType); this.$store.dispatch('training/setRoles', userRole); @@ -441,8 +443,8 @@ export default { } }, - fieldPractice() { - this.$refs.sceneList.doShow(); + fieldPractice(param) { + this.$refs.sceneList.doShow(param); } } }; diff --git a/src/views/newMap/displayNew/dispatherContest/sceneList.vue b/src/views/newMap/displayNew/dispatherContest/sceneList.vue index 3aa9c97d4..27e91d08d 100644 --- a/src/views/newMap/displayNew/dispatherContest/sceneList.vue +++ b/src/views/newMap/displayNew/dispatherContest/sceneList.vue @@ -48,6 +48,7 @@ export default { memberList: [], memberId:'', selectMapLineCode:'', + operationType: '', mainSceneData: [ {type: '车辆故障', scene: '列车救援'}, {type: '信号系统故障', scene: '道岔故障', id: '9'}, @@ -83,7 +84,8 @@ export default { } }, methods:{ - doShow(row) { + doShow(param) { + this.operationType = param; this.dialogVisible = true; }, doClose() { @@ -133,6 +135,7 @@ export default { this.confirm(); }, confirm() { + this.$store.dispatch('training/setScriptOperationType', this.operationType); this.$emit('selectQuest', {row:this.row, id:this.memberId, mapLocation:this.mapLocation}); this.doClose(); }, diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index fec9ee256..58078885f 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -332,7 +332,7 @@ export default { this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.$store.dispatch('training/setPrdType', ''); } - this.$refs.menuSchema.loadRunData(); + // this.$refs.menuSchema.loadRunData(); this.userRole = userRole; this.$store.dispatch('scriptRecord/updateBgSet', true); // this.$refs.chatbox.setMembers(id); diff --git a/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue b/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue index 14f2b2c19..9c280a554 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue +++ b/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue @@ -26,7 +26,7 @@ export default { watch:{ // 剧本提示 '$store.state.socket.simulationScriptTip':function(val, old) { - if (val) { + if (val && this.$store.state.training.scriptOperationType === 'teach') { if (val.type == 'Conversation') { this.scriptTipMessage = '请说:' + val.content; } else if (val.type == 'Operation') { diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index decab328a..020261441 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -312,7 +312,6 @@ export default { this.$router.back(); }, handelQuit() { - console.log('------------', this.$route.path); window.close(); } }