diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm index 5815a4daa..f0157e2f4 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm @@ -19,10 +19,10 @@ const { createMessage } = useMessage() const emit = defineEmits(['success', 'register']) const isUpdate = ref(true) -const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ +const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({ labelWidth: 120, baseColProps: { span: 24 }, - schemas: isUpdate? updateFormSchema : createFormSchema, + schemas: createFormSchema, showActionButtonGroup: false, actionColOptions: { span: 23 } }) @@ -32,6 +32,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data setModalProps({ confirmLoading: false }) isUpdate.value = !!data?.isUpdate if (unref(isUpdate)) { + resetSchema(updateFormSchema) const res = await get${simpleClassName}(data.record.id) setFieldsValue({ ...res }) }