From 4a7edc05608e40e6bc3c9f858fc0d3a68821dd44 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Sat, 12 Oct 2024 10:33:55 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edgeInsert/components/form-insert.vue | 66 ++++++++++++++++--- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/src/views/base/edgeInsert/components/form-insert.vue b/src/views/base/edgeInsert/components/form-insert.vue index 1b65ec2..97a0a83 100644 --- a/src/views/base/edgeInsert/components/form-insert.vue +++ b/src/views/base/edgeInsert/components/form-insert.vue @@ -164,7 +164,6 @@ export default { }, async mounted() { this.open = true - await this.getRanges(); if (this.editParams) { await Object.assign(this.projectParams, this.editParams); // 查询所属设备 @@ -180,6 +179,7 @@ export default { } else { this.subSort = 1; } + await this.getRanges(); this.open = false }, data() { @@ -286,21 +286,67 @@ export default { }; }); // 获取工程下拉选 - let projRes = await queryProjApi({ - isAll: 0, - }); - this.projRange = projRes.data.map((item) => { - return { - label: item.proName, - value: item.id, - }; - }); + if(this.subSort==1) + { + let projRes = await queryProjApi({ + isAll: 0, + }); + this.projRange = projRes.data.map((item) => { + return { + label: item.proName, + value: item.id, + }; + }); + } + if(this.subSort==2){ + // 获取工程下拉选 + let projRes = queryProjApi({ + isAll: 0 + }).then(projRes =>{ + this.projRange = projRes.data.map((item) => { + return { + label: item.proName, + value: item.id, + }; + }); + }) + } }, departChange(e) { this.departRange.forEach((item) => { if (e === item.value) { this.projectParams.departName = item.label; + if(this.subSort==2){ + // 获取工程下拉选 + let projRes = queryProjApi({ + isAll: 0, + departId: e, + }).then(projRes =>{ + this.projRange = projRes.data.map((item) => { + return { + label: item.proName, + value: item.id, + }; + }); + }) + } + + if(this.subSort==1){ + // 获取工程下拉选 + let projRes = queryProjApi({ + isAll: 0, + departId: e, + }).then(projRes =>{ + this.projRange = projRes.data.map((item) => { + return { + label: item.proName, + value: item.id, + }; + }); + }) + } } + }); }, projChange(e) {