From 9013f8572d8696fa37d8ed702559928b77692ec0 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 25 Jul 2023 16:47:00 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=A7=A3=E5=86=B3=E5=88=9D=E6=AD=A5?= =?UTF-8?q?=E8=8E=B7=E5=8F=96detail=E6=97=B6code=E8=A2=ABwatcher=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E6=9B=BF=E6=8D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/testingStep/components/DialogWithMenu.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/views/modules/pms/testingStep/components/DialogWithMenu.vue b/src/views/modules/pms/testingStep/components/DialogWithMenu.vue index c0f0e82..8406372 100644 --- a/src/views/modules/pms/testingStep/components/DialogWithMenu.vue +++ b/src/views/modules/pms/testingStep/components/DialogWithMenu.vue @@ -43,7 +43,7 @@
- + this.dataForm[targetProp], (val) => { + console.log("[DWM watch]"); if (val && targetProp in dataSource) { this.dataForm[followerProp] = dataSource[targetProp]?.find((item) => item.id === val)?.[followerProp]; } }, { - immediate: true, + immediate: false, } ); }, @@ -372,11 +373,11 @@ export default { console.log("[DWM doRequests] requestList", this.requestList); if (this.requestList.length) { const promiseList = []; - this.optionsLoading = true; try { this.requestList.forEach((opt) => { console.log("[DWM doRequests]", opt.fetchData); - promiseList.push(async function () { + promiseList.push(async () => { + this.optionsLoading = true; // const { data: res } = await opt.fetchData(this.dataForm.id ? this.dataForm.id : -1); const { data: res } = await opt.fetchData(); if (opt.cacheFetchedData) this.cached[opt.prop] = "list" in res.data ? res.data.list : res.data || []; @@ -412,12 +413,10 @@ export default { // res.code != 0 this.$set(opt, "options", []); } + this.optionsLoading = false; }); }); - const v = await Promise.all(promiseList.map(fn => fn.call(this))); - console.log("v", v); - - this.optionsLoading = false; + const v = await Promise.all(promiseList.map((fn) => fn.call(this))); return true; } catch (err) { this.$message.err("刷新选项失败");