添加大赛练习
This commit is contained in:
parent
b44e193bcf
commit
e5d83555af
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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() {
|
||||
},
|
||||
|
@ -20,6 +20,7 @@
|
||||
<el-button v-if="scheduleLoadShow" type="primary" size="small" @click="jumpScheduling">派班计划加载</el-button>
|
||||
<el-button v-if="schedulePreviewShow" type="primary" size="small" @click="schedulingView">派班计划预览</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="fieldPractice">实操练习</el-button>
|
||||
<el-button v-if="isContest" size="small" @click=" fieldTeach">实操教学</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="viewChangeMap">切换地图</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
@ -204,7 +205,10 @@ export default {
|
||||
this.$emit('changeMap', query);
|
||||
},
|
||||
fieldPractice() {
|
||||
this.$emit('fieldPractice');
|
||||
this.$emit('fieldPractice', 'practice');
|
||||
},
|
||||
fieldTeach() {
|
||||
this.$emit('fieldPractice', 'teach');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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();
|
||||
},
|
||||
|
@ -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);
|
||||
|
@ -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') {
|
||||
|
@ -312,7 +312,6 @@ export default {
|
||||
this.$router.back();
|
||||
},
|
||||
handelQuit() {
|
||||
console.log('------------', this.$route.path);
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user