From e60a33a2b1bcfbe7b654bf7f17afac51f34cc370 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 15 Jun 2023 18:28:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20json=20attr=20form?= =?UTF-8?q?=20=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormFields/JSONManyToManySelect/AttrFormDialog.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/FormFields/JSONManyToManySelect/AttrFormDialog.vue b/src/components/FormFields/JSONManyToManySelect/AttrFormDialog.vue index 20b3ed629..d3dd022f4 100644 --- a/src/components/FormFields/JSONManyToManySelect/AttrFormDialog.vue +++ b/src/components/FormFields/JSONManyToManySelect/AttrFormDialog.vue @@ -65,8 +65,7 @@ export default { // 变化会影响 match 的选项 const attr = this.attrs.find(attr => attr.name === val) if (!attr) return - const matchSupports = vm.updateMatchOptions(attr) - const matchOption = matchSupports.find(item => item.value === vm.form.match) || matchSupports[0] + const matchOption = vm.updateMatchOptions(attr) setTimeout(() => { updateForm({ match: matchOption.value }) }, 10) @@ -143,8 +142,9 @@ export default { }) this.formConfig.fields[2].el.attr = attr const supports = attrMatchOptions.filter(option => !option.hidden) - this.formConfig.fields[2].el.match = supports[0].value - return supports + const matchOption = supports.find(item => item.value === this.form.match) || supports[0] + this.formConfig.fields[2].el.match = matchOption.value + return matchOption } } }