From fd3f1f738aa93d220895a29de7338b97e55294ae Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Wed, 25 Sep 2024 14:03:40 +0800 Subject: [PATCH] chore: config --- .../src/views/system/config/config-modal.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/apps/web-antd/src/views/system/config/config-modal.vue b/apps/web-antd/src/views/system/config/config-modal.vue index b3486002..1087fe55 100644 --- a/apps/web-antd/src/views/system/config/config-modal.vue +++ b/apps/web-antd/src/views/system/config/config-modal.vue @@ -16,12 +16,11 @@ const title = computed(() => { return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add'); }); -const schema = modalSchema(); const [BasicForm, formApi] = useVbenForm({ commonConfig: { labelWidth: 80, }, - schema, + schema: modalSchema(), showDefaultActions: false, }); @@ -40,14 +39,7 @@ const [BasicModal, modalApi] = useVbenModal({ if (isUpdate.value && id) { const record = await configInfo(id); - // 只取需要的字段 - schema - .map((item) => item.fieldName) - .forEach((key) => { - if (key in record) { - formApi.setFieldValue(key, record[key as keyof typeof record]); - } - }); + await formApi.setValues(record); } modalApi.modalLoading(false);