From a57f79cf90e8fc70f646c1dd91fac79b0df6ce73 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 25 Jul 2022 16:53:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vue2=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codegen/java/controller/vo/exportReqVO.vm | 10 ++----- .../codegen/java/controller/vo/pageReqVO.vm | 10 ++----- .../resources/codegen/vue/views/index.vue.vm | 14 +++------- .../src/router/modules/remaining.ts | 2 +- .../codegen/{ => components}/EditTable.vue | 7 ++--- .../infra/codegen/components/GenInfoForm.vue | 5 ++++ .../infra/codegen/components/ImportTable.vue | 28 +++++++++---------- .../views/infra/codegen/components/index.ts | 7 +++++ .../src/views/infra/codegen/index.vue | 3 +- .../src/views/infra/codegen/index.vue | 2 +- 10 files changed, 42 insertions(+), 46 deletions(-) rename yudao-ui-admin-vue3/src/views/infra/codegen/{ => components}/EditTable.vue (92%) create mode 100644 yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm index 10ab97afc6..afd583c28d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm @@ -15,9 +15,6 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end ## 字段模板 #macro(columnTpl $prefix $prefixStr) -#if (${column.javaType} == "Date")## 时间类型 - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) -#end @ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end; #end @@ -27,12 +24,11 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; public class ${sceneEnum.prefixClass}${table.className}ExportReqVO { #foreach ($column in $columns) -#set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写 #if (${column.listOperation})##查询操作 #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候 - #columnTpl('begin', '开始') - - #columnTpl('end', '结束') + @ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private ${column.javaType}[] ${column.javaField}; #else##情况二,非 Between 的时间 #columnTpl('', '') #end diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm index 5f5952c59e..df2be7036b 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm @@ -15,9 +15,6 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end ## 字段模板 #macro(columnTpl $prefix $prefixStr) -#if (${column.javaType} == "Date")## 时间类型 - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) -#end @ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end; #end @@ -29,12 +26,11 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PageParam { #foreach ($column in $columns) -#set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写 #if (${column.listOperation})##查询操作 #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候 - #columnTpl('begin', '开始') - - #columnTpl('end', '结束') + @ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private ${column.javaType}[] ${column.javaField}; #else##情况二,非 Between 的时间 #columnTpl('', '') #end diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm index d49fa93c5c..95f7d66a26 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm @@ -219,22 +219,16 @@ export default { title: "", // 是否显示弹出层 open: false, - #foreach ($column in $columns)## 时间范围 - #if ($column.listOperation) - #if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") - #set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) - dateRange${AttrName}: [], - #end - #end - #end // 查询参数 queryParams: { pageNo: 1, pageSize: 10, #foreach ($column in $columns) - #if ($column.listOperation && $column.listOperationCondition != 'BETWEEN') + #if ($column.listOperation) + #if ($column.listOperationCondition != 'BETWEEN') $column.javaField: null, - #else if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN") + #end + #if ($column.htmlType == "datetime" || $column.listOperationCondition == "BETWEEN") $column.javaField: [], #end #end diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 92f3a367ef..7c3c524e6d 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -72,7 +72,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'edit', - component: () => import('@/views/infra/codegen/EditTable.vue'), + component: () => import('@/views/infra/codegen/components/EditTable.vue'), name: 'EditTable', meta: { noCache: true, diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue b/yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue similarity index 92% rename from yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue rename to yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue index 07dfa52210..47e2c89e63 100644 --- a/yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue +++ b/yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue @@ -1,9 +1,9 @@