Commit aa48a6f533dca261d2f8148eaeef5b884004e1d4

Authored by xingyu4j
1 parent 1080972e

fix: vben 代码生成默认vbenForm 样式

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 @@ @@ -24,6 +24,13 @@
24 }); 24 });
25 25
26 const [Form, formApi] = useVbenForm({ 26 const [Form, formApi] = useVbenForm({
  27 + commonConfig: {
  28 + componentProps: {
  29 + class: 'w-full',
  30 + },
  31 + formItemClass: 'col-span-2',
  32 + labelWidth: 80,
  33 + },
27 layout: 'horizontal', 34 layout: 'horizontal',
28 schema: use${subSimpleClassName}FormSchema(), 35 schema: use${subSimpleClassName}FormSchema(),
29 showDefaultActions: false 36 showDefaultActions: false
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( @@ -96,9 +96,16 @@ watch(
96 ); 96 );
97 #else 97 #else
98 const [Form, formApi] = useVbenForm({ 98 const [Form, formApi] = useVbenForm({
99 -layout: 'horizontal',  
100 -schema: use${subSimpleClassName}FormSchema(),  
101 -showDefaultActions: false 99 + commonConfig: {
  100 + componentProps: {
  101 + class: 'w-full',
  102 + },
  103 + formItemClass: 'col-span-2',
  104 + labelWidth: 80,
  105 + },
  106 + layout: 'horizontal',
  107 + schema: use${subSimpleClassName}FormSchema(),
  108 + showDefaultActions: false
102 }); 109 });
103 110
104 /** 暴露出表单校验方法和表单值获取方法 */ 111 /** 暴露出表单校验方法和表单值获取方法 */
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[] { @@ -39,7 +39,6 @@ export function useFormSchema(): VbenFormSchema[] {
39 }); 39 });
40 return handleTree(data); 40 return handleTree(data);
41 }, 41 },
42 - class: 'w-full',  
43 labelField: '${treeNameColumn.javaField}', 42 labelField: '${treeNameColumn.javaField}',
44 valueField: 'id', 43 valueField: 'id',
45 childrenField: 'children', 44 childrenField: 'children',
@@ -89,7 +88,6 @@ export function useFormSchema(): VbenFormSchema[] { @@ -89,7 +88,6 @@ export function useFormSchema(): VbenFormSchema[] {
89 options: [], 88 options: [],
90 #end 89 #end
91 placeholder: '请选择${comment}', 90 placeholder: '请选择${comment}',
92 - class: 'w-full',  
93 }, 91 },
94 #elseif($column.htmlType == "checkbox")## 多选框 92 #elseif($column.htmlType == "checkbox")## 多选框
95 component: 'Checkbox', 93 component: 'Checkbox',
@@ -127,7 +125,6 @@ export function useFormSchema(): VbenFormSchema[] { @@ -127,7 +125,6 @@ export function useFormSchema(): VbenFormSchema[] {
127 component: 'InputNumber', 125 component: 'InputNumber',
128 componentProps: { 126 componentProps: {
129 min: 0, 127 min: 0,
130 - class: 'w-full',  
131 controlsPosition: 'right', 128 controlsPosition: 'right',
132 placeholder: '请输入${comment}', 129 placeholder: '请输入${comment}',
133 }, 130 },
@@ -325,7 +322,6 @@ export function use${subSimpleClassName}FormSchema(): VbenFormSchema[] { @@ -325,7 +322,6 @@ export function use${subSimpleClassName}FormSchema(): VbenFormSchema[] {
325 options: [], 322 options: [],
326 #end 323 #end
327 placeholder: '请选择${comment}', 324 placeholder: '请选择${comment}',
328 - class: 'w-full',  
329 }, 325 },
330 #elseif($column.htmlType == "checkbox")## 多选框 326 #elseif($column.htmlType == "checkbox")## 多选框
331 component: 'Checkbox', 327 component: 'Checkbox',
@@ -363,7 +359,6 @@ export function use${subSimpleClassName}FormSchema(): VbenFormSchema[] { @@ -363,7 +359,6 @@ export function use${subSimpleClassName}FormSchema(): VbenFormSchema[] {
363 component: 'InputNumber', 359 component: 'InputNumber',
364 componentProps: { 360 componentProps: {
365 min: 0, 361 min: 0,
366 - class: 'w-full',  
367 controlsPosition: 'right', 362 controlsPosition: 'right',
368 placeholder: '请输入${comment}', 363 placeholder: '请输入${comment}',
369 }, 364 },
@@ -600,7 +595,6 @@ export function use${subSimpleClassName}GridColumns( @@ -600,7 +595,6 @@ export function use${subSimpleClassName}GridColumns(
600 options: [], 595 options: [],
601 #end 596 #end
602 placeholder: '请选择${comment}', 597 placeholder: '请选择${comment}',
603 - class: 'w-full',  
604 }, 598 },
605 #elseif($column.htmlType == "checkbox")## 多选框 599 #elseif($column.htmlType == "checkbox")## 多选框
606 component: 'Checkbox', 600 component: 'Checkbox',
@@ -638,7 +632,6 @@ export function use${subSimpleClassName}GridColumns( @@ -638,7 +632,6 @@ export function use${subSimpleClassName}GridColumns(
638 component: 'InputNumber', 632 component: 'InputNumber',
639 componentProps: { 633 componentProps: {
640 min: 0, 634 min: 0,
641 - class: 'w-full',  
642 controlsPosition: 'right', 635 controlsPosition: 'right',
643 placeholder: '请输入${comment}', 636 placeholder: '请输入${comment}',
644 }, 637 },
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(() => { @@ -55,6 +55,13 @@ const getTitle = computed(() => {
55 #end 55 #end
56 56
57 const [Form, formApi] = useVbenForm({ 57 const [Form, formApi] = useVbenForm({
  58 + commonConfig: {
  59 + componentProps: {
  60 + class: 'w-full',
  61 + },
  62 + formItemClass: 'col-span-2',
  63 + labelWidth: 80,
  64 + },
58 layout: 'horizontal', 65 layout: 'horizontal',
59 schema: useFormSchema(), 66 schema: useFormSchema(),
60 showDefaultActions: false 67 showDefaultActions: false
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 @@ @@ -24,6 +24,13 @@
24 }); 24 });
25 25
26 const [Form, formApi] = useVbenForm({ 26 const [Form, formApi] = useVbenForm({
  27 + commonConfig: {
  28 + componentProps: {
  29 + class: 'w-full',
  30 + },
  31 + formItemClass: 'col-span-2',
  32 + labelWidth: 80,
  33 + },
27 layout: 'horizontal', 34 layout: 'horizontal',
28 schema: use${subSimpleClassName}FormSchema(), 35 schema: use${subSimpleClassName}FormSchema(),
29 showDefaultActions: false 36 showDefaultActions: false
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( @@ -96,9 +96,16 @@ watch(
96 ); 96 );
97 #else 97 #else
98 const [Form, formApi] = useVbenForm({ 98 const [Form, formApi] = useVbenForm({
99 -layout: 'horizontal',  
100 -schema: use${subSimpleClassName}FormSchema(),  
101 -showDefaultActions: false 99 + commonConfig: {
  100 + componentProps: {
  101 + class: 'w-full',
  102 + },
  103 + formItemClass: 'col-span-2',
  104 + labelWidth: 80,
  105 + },
  106 + layout: 'horizontal',
  107 + schema: use${subSimpleClassName}FormSchema(),
  108 + showDefaultActions: false
102 }); 109 });
103 110
104 /** 暴露出表单校验方法和表单值获取方法 */ 111 /** 暴露出表单校验方法和表单值获取方法 */