This commit is contained in:
sunzhenyu 2020-07-10 16:42:21 +08:00
commit 8831528b9a
3 changed files with 25 additions and 3 deletions

View File

@ -228,6 +228,22 @@ const training = {
setSimulationUserList: (state, simulationUserList) => {
state.simulationUserList = simulationUserList;
},
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId, isDriver}) => {
if (oldMemberId) {
// 重置旧数据
if (state.memberData[oldMemberId].trust) {
state.memberData[newMemberId].trust = false;
}
delete state.memberData[oldMemberId].userId;
state.memberData[oldMemberId].disabled = false;
}
// 更新新数据
state.memberData[newMemberId].userId = userId;
state.memberData[newMemberId].disabled = true;
if (isDriver) {
state.memberData[newMemberId].trust = true;
}
},
updateMemberAndUser: (state, {simulationUserList, userId}) => {
simulationUserList.forEach(item => {
let memberIndex = -1;
@ -667,6 +683,10 @@ const training = {
/** 更新综合演练仿真成员和用户列表 */
updateMemberAndUser: ({ commit }, data) => {
commit('updateMemberAndUser', data);
},
/** 更新剧本所有成员列表 */
updateMemberListInScript:({ commit }, data) => {
commit('updateMemberListInScript', data);
}
}
};

View File

@ -169,7 +169,7 @@ export default {
lastData.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.role + deviceName + name;
each.name = each.type + deviceName + name;
});
return lastData;
},
@ -217,7 +217,6 @@ export default {
this.mapLocation = res.data.mapLocation;
}
this.memberList = newMemberList || [];
debugger;
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
}
this.roleShow = true;

View File

@ -58,6 +58,7 @@ export default {
return {
isShow:true,
language:'',
oldMemberId:'',
memberId:'',
isPause:false,
executeDisabled: false,
@ -175,6 +176,8 @@ export default {
prdType = '';
}
}
this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.$store.state.user.id, isDriver:memberInfo.type == '司机'});
this.oldMemberId = role;
this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{
if (each.label == memberInfo.type) {
@ -299,7 +302,7 @@ export default {
dumpScriptDataNew(group).then(resp => {
this.$parent.resetBeginTime();
this.$refs['getAction'].loadInitData();
this.initData();
this.changeRunPlanStatus();
this.memberId = '';
this.$store.dispatch('map/setRunPlanStatus', false);
this.$store.dispatch('training/setPrdType', '01');