From 7a84b23cdc14c5ad0d496e55f18648f76607538f Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 1 Dec 2022 16:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../display/trainingDesign/designPane.vue | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) 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);