From e82d8b5f50e7a13555f97798ecd8c9c7d9fe03d3 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Fri, 16 Sep 2022 15:57:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=BA=E5=BE=B7=E5=B1=85=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E4=B8=8D=E6=AD=A3=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/shequ/cpts/people-more.vue | 25 ++++++++++------- .../visual/basicinfo/cpts/people-more.vue | 27 ++++++++++++------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/views/modules/shequ/cpts/people-more.vue b/src/views/modules/shequ/cpts/people-more.vue index fc85b2c0d..b230cb661 100644 --- a/src/views/modules/shequ/cpts/people-more.vue +++ b/src/views/modules/shequ/cpts/people-more.vue @@ -594,16 +594,23 @@ export default { } }); }); - console.log("1111111111111111111111111", this.groupList); - this.groupList.forEach((subList, index) => { - subList.itemList.forEach(async (item, subIndex) => { - if (item.optionSourceType == "remote" && item.optionSourceValue) { - this.groupList[index].itemList[subIndex].options = - await this.getOptions(item.optionSourceValue); - } - }); - }); + await Promise.all( + this.groupList.map((subList, index) => { + return Promise.all( + subList.itemList.map(async (item, subIndex) => { + if ( + item.optionSourceType == "remote" && + item.optionSourceValue + ) { + this.groupList[index].itemList[subIndex].options = + await this.getOptions(item.optionSourceValue); + } + }) + ); + }) + ); + console.log("44444444", this.groupList); let arr = [ { groupId: "hs123", diff --git a/src/views/modules/visual/basicinfo/cpts/people-more.vue b/src/views/modules/visual/basicinfo/cpts/people-more.vue index 5d72f52e6..3084ebbe4 100644 --- a/src/views/modules/visual/basicinfo/cpts/people-more.vue +++ b/src/views/modules/visual/basicinfo/cpts/people-more.vue @@ -536,16 +536,23 @@ export default { } }); }); - console.log("1111111111111111111111111", this.groupList); - - this.groupList.forEach((subList, index) => { - subList.itemList.forEach(async (item, subIndex) => { - if (item.optionSourceType == "remote" && item.optionSourceValue) { - this.groupList[index].itemList[subIndex].options = - await this.getOptions(item.optionSourceValue); - } - }); - }); + + await Promise.all( + this.groupList.map((subList, index) => { + return Promise.all( + subList.itemList.map(async (item, subIndex) => { + if ( + item.optionSourceType == "remote" && + item.optionSourceValue + ) { + this.groupList[index].itemList[subIndex].options = + await this.getOptions(item.optionSourceValue); + } + }) + ); + }) + ); + console.log("44444444", this.groupList); let arr = [ {