添加大赛练习

This commit is contained in:
fan 2020-09-16 10:49:16 +08:00
parent b44e193bcf
commit e5d83555af
8 changed files with 29 additions and 199 deletions

View File

@ -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);
}
}
};

View File

@ -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() {
},

View File

@ -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');
}
}
};

View File

@ -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);
}
}
};

View File

@ -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();
},

View File

@ -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);

View File

@ -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') {

View File

@ -312,7 +312,6 @@ export default {
this.$router.back();
},
handelQuit() {
console.log('------------', this.$route.path);
window.close();
}
}