From aa48a6f533dca261d2f8148eaeef5b884004e1d4 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Mon, 28 Apr 2025 15:10:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vben=20=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=BB=98=E8=AE=A4vbenForm=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../general/views/modules/form_sub_erp.vue.vm | 7 +++++++ .../general/views/modules/form_sub_normal.vue.vm | 13 ++++++++++--- .../codegen/vue3_vben5_antd/schema/views/data.ts.vm | 7 ------- .../vue3_vben5_antd/schema/views/form.vue.vm | 7 +++++++ .../schema/views/modules/form_sub_erp.vue.vm | 7 +++++++ .../schema/views/modules/form_sub_normal.vue.vm | 13 ++++++++++--- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm index 1b2c3f8200..db13527ac6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm @@ -24,6 +24,13 @@ }); const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: use${subSimpleClassName}FormSchema(), showDefaultActions: false diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm index bb0d809001..072fd8c3e7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm @@ -96,9 +96,16 @@ watch( ); #else const [Form, formApi] = useVbenForm({ -layout: 'horizontal', -schema: use${subSimpleClassName}FormSchema(), -showDefaultActions: false + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, + layout: 'horizontal', + schema: use${subSimpleClassName}FormSchema(), + showDefaultActions: false }); /** 暴露出表单校验方法和表单值获取方法 */ diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm index 78d53be1da..f4034cbe5c 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm @@ -39,7 +39,6 @@ export function useFormSchema(): VbenFormSchema[] { }); return handleTree(data); }, - class: 'w-full', labelField: '${treeNameColumn.javaField}', valueField: 'id', childrenField: 'children', @@ -89,7 +88,6 @@ export function useFormSchema(): VbenFormSchema[] { options: [], #end placeholder: '请选择${comment}', - class: 'w-full', }, #elseif($column.htmlType == "checkbox")## 多选框 component: 'Checkbox', @@ -127,7 +125,6 @@ export function useFormSchema(): VbenFormSchema[] { component: 'InputNumber', componentProps: { min: 0, - class: 'w-full', controlsPosition: 'right', placeholder: '请输入${comment}', }, @@ -325,7 +322,6 @@ export function use${subSimpleClassName}FormSchema(): VbenFormSchema[] { options: [], #end placeholder: '请选择${comment}', - class: 'w-full', }, #elseif($column.htmlType == "checkbox")## 多选框 component: 'Checkbox', @@ -363,7 +359,6 @@ export function use${subSimpleClassName}FormSchema(): VbenFormSchema[] { component: 'InputNumber', componentProps: { min: 0, - class: 'w-full', controlsPosition: 'right', placeholder: '请输入${comment}', }, @@ -600,7 +595,6 @@ export function use${subSimpleClassName}GridColumns( options: [], #end placeholder: '请选择${comment}', - class: 'w-full', }, #elseif($column.htmlType == "checkbox")## 多选框 component: 'Checkbox', @@ -638,7 +632,6 @@ export function use${subSimpleClassName}GridColumns( component: 'InputNumber', componentProps: { min: 0, - class: 'w-full', controlsPosition: 'right', placeholder: '请输入${comment}', }, diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm index 46e1ecc0a6..16809741c2 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm @@ -55,6 +55,13 @@ const getTitle = computed(() => { #end const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: useFormSchema(), showDefaultActions: false diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_erp.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_erp.vue.vm index 1b2c3f8200..db13527ac6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_erp.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_erp.vue.vm @@ -24,6 +24,13 @@ }); const [Form, formApi] = useVbenForm({ + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, layout: 'horizontal', schema: use${subSimpleClassName}FormSchema(), showDefaultActions: false diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_normal.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_normal.vue.vm index bb0d809001..072fd8c3e7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_normal.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/form_sub_normal.vue.vm @@ -96,9 +96,16 @@ watch( ); #else const [Form, formApi] = useVbenForm({ -layout: 'horizontal', -schema: use${subSimpleClassName}FormSchema(), -showDefaultActions: false + commonConfig: { + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, + }, + layout: 'horizontal', + schema: use${subSimpleClassName}FormSchema(), + showDefaultActions: false }); /** 暴露出表单校验方法和表单值获取方法 */