From 0c17edaa33b64989eead29d00c534198fd2a64b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Thu, 16 Nov 2023 10:36:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=9B=BD=E5=86=85=E6=A0=87=E5=87=86-?= =?UTF-8?q?=E5=88=86=E6=A0=87=E5=A7=94=E4=B8=8B=E6=8B=89=E6=A1=86=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customField/AddForm.vue | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index ac571380..6f112330 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -90,7 +90,8 @@ :placeholder="$t('pleaseSelect')+item.dbFieldTxt" :type="'select'" :triggerChange="false" - :dictCode="item.dictField" /> + :options="optionsData[item.dbFieldName]" + :dictCode="item.fieldHref ? null : item.dictField" /> + :options="optionsData[item.dbFieldName]" + :dictCode="item.fieldHref ? null : item.dictField"/> acc.concat(cur), []) formList.forEach(item => { - if (item.fieldShowType === FieldType.TREE.value || item.fieldShowType === FieldType.TREE_SINGLE.value) { - // 展示类型是树选择,且有接口的 - if (item.fieldHref) { - getAction(item.fieldHref).then(res => { - if (res.success) { - this.$set(this.optionsData, item.dbFieldName, res.result) - } - }) - } else if (item.dictId) { - getFormDictTreeList({ dictId: item.dictId }).then(res => { - if (res.success) { - this.$set(this.optionsData, item.dbFieldName, res.result) - } - }) - } + // 如果接口这个字段有值 + if (item.fieldHref) { + getAction(item.fieldHref).then(res => { + if (res.success) { + this.$set(this.optionsData, item.dbFieldName, res.result) + } + }) + } else if ((item.fieldShowType === FieldType.TREE.value || item.fieldShowType === FieldType.TREE_SINGLE.value) && item.dictId) { + getFormDictTreeList({ dictId: item.dictId }).then(res => { + if (res.success) { + this.$set(this.optionsData, item.dbFieldName, res.result) + } + }) } }) }, @@ -674,7 +674,7 @@ export default { filterTreeOption (input, option) { const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label return text.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, + } } }