chore: config

This commit is contained in:
dap 2024-09-25 14:03:40 +08:00
parent 600bfc7aaf
commit fd3f1f738a

View File

@ -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);