From f3ea863e761d676fefb80c2bc5ee3f09424fe239 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Wed, 11 Sep 2024 10:13:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E8=A1=A8=E5=A2=9E=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E9=AA=8C=E8=AF=81=E6=8F=90=E7=A4=BA=E3=80=81=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/modules/gen/crud/vueForm.xml | 23 +++++++++-------- .../modules/gen/crud/vueFormRoute.xml | 25 +++++++++++-------- .../templates/modules/gen/crud/vueList.xml | 2 +- .../templates/modules/gen/crud/vueSelect.xml | 2 +- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml index 043f6b1b..e16abc67 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml @@ -133,7 +133,7 @@ for(c in table.columnList){ allowClear: true, style: 'width: calc(50% - 60px)', }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, <% } for (c in table.columnList){ @@ -309,7 +309,7 @@ for (c in table.columnList){ <% } if (isNewLine){ %> - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, <% } %> @@ -329,7 +329,7 @@ for (c in table.columnList){ bizType: '${className}_image', uploadType: 'image', }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, <% } @@ -345,7 +345,7 @@ for (c in table.columnList){ bizType: '${className}_file', uploadType: 'all', }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, <% } @@ -354,7 +354,7 @@ for (c in table.columnList){ label: t('${child.comments}'), field: '${@StringUtils.uncap(child.className)}List', component: 'Input', - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, slot: '${@StringUtils.uncap(child.className)}List', }, <% @@ -368,14 +368,14 @@ for (c in table.columnList){ componentProps: { maxlength: 500, }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, show: () => record.value.bpm.status != '2', }, { label: t('下一步流程信息'), field: 'nextTaskInfo', component: 'FormGroup', - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, { label: t('要求完成时间'), @@ -442,7 +442,7 @@ for (c in table.columnList){ labelWidth: 120, schemas: inputFormSchemas, <% var formColNum = table.optionMap['formColNum']; %> - baseColProps: { lg: ${formColNum=="1"?24:formColNum=="3"?8:12}, md: 24 }, + baseColProps: { md: 24, lg: ${formColNum=="1"?24:formColNum=="3"?8:12} }, }); <% for (child in table.childList){ %> @@ -616,7 +616,10 @@ for (c in table.columnList){ }); } if (!${@StringUtils.uncap(child.className)}ListValid) { - throw { errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }] }; + throw { + errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }], + message: t('${child.comments}填写有误,请根据提示修正'), + }; } return ${@StringUtils.uncap(child.className)}List; } @@ -697,7 +700,7 @@ for (c in table.columnList){ emit('success', data); } catch (error: any) { if (error && error.errorFields) { - showMessage(t('common.validateError')); + showMessage(error.message || t('common.validateError')); } console.log('error', error); } finally { diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml index 59bd5f23..6268379d 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueFormRoute.xml @@ -147,7 +147,7 @@ for(c in table.columnList){ allowClear: true, style: 'width: calc(50% - 60px)', }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, <% } for (c in table.columnList){ @@ -323,7 +323,7 @@ for (c in table.columnList){ <% } if (isNewLine){ %> - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, <% } %> @@ -343,7 +343,7 @@ for (c in table.columnList){ bizType: '${className}_image', uploadType: 'image', }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, <% } @@ -359,7 +359,7 @@ for (c in table.columnList){ bizType: '${className}_file', uploadType: 'all', }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, <% } @@ -372,7 +372,7 @@ for (c in table.columnList){ { field: '${@StringUtils.uncap(child.className)}List', component: 'Input', - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, slot: '${@StringUtils.uncap(child.className)}List', }, ]; @@ -389,14 +389,14 @@ for (c in table.columnList){ componentProps: { maxlength: 500, }, - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, show: () => record.value.bpm.status != '2', }, { label: t('下一步流程信息'), field: 'nextTaskInfo', component: 'FormGroup', - colProps: { lg: 24, md: 24 }, + colProps: { md: 24, lg: 24 }, }, { label: t('要求完成时间'), @@ -463,14 +463,14 @@ for (c in table.columnList){ labelWidth: 120, schemas: inputFormSchemas, <% var formColNum = table.optionMap['formColNum']; %> - baseColProps: { lg: ${formColNum=="1"?24:formColNum=="3"?8:12}, md: 24 }, + baseColProps: { md: 24, lg: ${formColNum=="1"?24:formColNum=="3"?8:12} }, }); <% for (child in table.childList){ %> const [register${child.className}Form, ${@StringUtils.uncap(child.className)}Form] = useForm({ labelWidth: 120, schemas: input${child.className}FormSchemas, - baseColProps: { lg: 24, md: 24 }, + baseColProps: { md: 24, lg: 24 }, }); const [register${child.className}Table, ${@StringUtils.uncap(child.className)}Table] = useTable({ @@ -643,7 +643,10 @@ for (c in table.columnList){ }); } if (!${@StringUtils.uncap(child.className)}ListValid) { - throw { errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }] }; + throw { + errorFields: [{ name: ['${@StringUtils.uncap(child.className)}List'] }], + message: t('${child.comments}填写有误,请根据提示修正'), + }; } return ${@StringUtils.uncap(child.className)}List; } @@ -751,7 +754,7 @@ for (c in table.columnList){ handleClose(); } catch (error: any) { if (error && error.errorFields) { - showMessage(t('common.validateError')); + showMessage(error.message || t('common.validateError')); } console.log('error', error); } finally { diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml index 232a0676..6fe12509 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml @@ -181,7 +181,7 @@ for(c in table.columnList){ <% } %> const searchForm: FormProps = { - baseColProps: { lg: 6, md: 8 }, + baseColProps: { md: 8, lg: 6 }, labelWidth: 90, schemas: [ <% for(c in table.columnList){ %> diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml index d71c5d5a..e6c02a96 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueSelect.xml @@ -45,7 +45,7 @@ const modalProps = { }; const searchForm: FormProps = { - baseColProps: { lg: 6, md: 8 }, + baseColProps: { md: 8, lg: 6 }, labelWidth: 90, schemas: [ <% for(c in table.columnList){ %>