diff --git a/src/views/newMap/display/trainingDesign/designPane.vue b/src/views/newMap/display/trainingDesign/designPane.vue index b059b3e5b..5e25a7a94 100644 --- a/src/views/newMap/display/trainingDesign/designPane.vue +++ b/src/views/newMap/display/trainingDesign/designPane.vue @@ -159,20 +159,12 @@ export default { } }, watch: { - '$store.state.training.memberList': function (val) { + '$store.state.training.roles': function(val) { + this.getRoleList(); + }, + '$store.state.training.memberList': function(val) { if (val && val.length) { - const memberData = this.$store.state.training.memberData; - let activeTrainList = []; - if (this.$store.state.training.started) { - activeTrainList = this.$store.state.map.activeTrainList; - } - // 获取仿真成员列表 - const result = covertMemberData(activeTrainList, Object.values(memberData)); - let list = []; - result.deviceListData.forEach(item => { - list = list.concat(item); - }); - this.roleList = list; + this.getRoleList(); } }, editData() { @@ -198,6 +190,20 @@ export default { } }, methods: { + getRoleList() { + const memberData = this.$store.state.training.memberData; + let activeTrainList = []; + if (this.$store.state.training.started) { + activeTrainList = this.$store.state.map.activeTrainList; + } + // 获取仿真成员列表 + const result = covertMemberData(activeTrainList, Object.values(memberData)); + let list = []; + result.deviceListData.forEach(item => { + list = list.concat(item); + }); + this.roleList = list; + }, updateDetails(data) { this.editData = data; this.getStepList(data);