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("刷新选项失败");