代码调整

This commit is contained in:
dong 2022-12-01 16:26:18 +08:00
parent c2e0182d53
commit 7a84b23cdc

View File

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