Przeglądaj źródła

代码模板,排序+导出按钮权限,前端

CzRger 9 miesięcy temu
rodzic
commit
49d5766494

+ 10 - 0
snowy-admin-web/src/views/gen/config.vue

@@ -48,6 +48,9 @@
 				<template v-if="column.dataIndex === 'whetherRetract'">
 					<a-checkbox v-model:checked="record.whetherRetract" :disabled="!record.whetherTable" />
 				</template>
+				<template v-if="column.dataIndex === 'whetherSort'">
+					<a-checkbox v-model:checked="record.whetherSort" :disabled="!record.whetherTable" />
+				</template>
 				<template v-if="column.dataIndex === 'whetherAddUpdate'">
 					<a-checkbox v-model:checked="record.whetherAddUpdate" :disabled="toFieldEstimate(record)" />
 				</template>
@@ -135,6 +138,12 @@
 			width: 80
 		},
 		{
+			title: '列排序',
+			align: 'center',
+			dataIndex: 'whetherSort',
+			width: 80
+		},
+		{
 			title: '增改',
 			align: 'center',
 			dataIndex: 'whetherAddUpdate',
@@ -377,6 +386,7 @@
 		if (record.effectType === 'editor') {
 			record.whetherTable = false
 			record.whetherRetract = false
+			record.whetherSort = false
 			record.queryWhether = 'N'
 			record.queryType = null
 		}

+ 3 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/basic/service/impl/GenBasicServiceImpl.java

@@ -243,6 +243,7 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
                 addParam.setWhetherAddUpdate(GenYesNoEnum.Y.getValue());
             }
             addParam.setWhetherRetract(GenYesNoEnum.N.getValue());
+            addParam.setWhetherSort(GenYesNoEnum.N.getValue());
             addParam.setWhetherRequired(GenYesNoEnum.N.getValue());
             addParam.setQueryWhether(GenYesNoEnum.N.getValue());
             addParam.setSortCode(i);
@@ -722,6 +723,8 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
                     configItem.set("whetherTable", genConfig.getWhetherTable().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
                     // 列省略
                     configItem.set("whetherRetract", genConfig.getWhetherRetract().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
+                    // 列排序
+                    configItem.set("whetherSort", genConfig.getWhetherSort().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
                     // 增改
                     configItem.set("whetherAddUpdate", genConfig.getWhetherAddUpdate().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
                     // 作用类型

+ 4 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/config/entity/GenConfig.java

@@ -73,6 +73,10 @@ public class GenConfig extends CommonEntity {
     @Schema(description = "列省略")
     private String whetherRetract;
 
+    /** 列排序 */
+    @Schema(description = "列排序")
+    private String whetherSort;
+
     /** 增改 */
     @Schema(description = "增改")
     private String whetherAddUpdate;

+ 4 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/config/param/GenConfigAddParam.java

@@ -72,6 +72,10 @@ public class GenConfigAddParam {
     @Schema(description = "列省略")
     private String whetherRetract;
 
+    /** 列排序 */
+    @Schema(description = "列排序")
+    private String whetherSort;
+
     /** 增改 */
     @Schema(description = "增改")
     private String whetherAddUpdate;

+ 5 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/config/param/GenConfigEditParam.java

@@ -81,6 +81,11 @@ public class GenConfigEditParam {
     @NotBlank(message = "whetherRetract不能为空")
     private String whetherRetract;
 
+    /** 列省略 */
+    @Schema(description = "列排序", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "whetherSort不能为空")
+    private String whetherSort;
+
     /** 增改 */
     @Schema(description = "增改", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotBlank(message = "whetherAddUpdate不能为空")

+ 5 - 2
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl

@@ -187,10 +187,13 @@
 	<% if(!configList[i].needTableId && configList[i].whetherTable) { %>
 		{
 			title: '${configList[i].fieldRemark}',
-			dataIndex: '${configList[i].fieldNameCamelCase}'<% if(configList[i].whetherRetract) { %>,<% } %>
+			dataIndex: '${configList[i].fieldNameCamelCase}',
 			<% if(configList[i].whetherRetract) { %>
-			ellipsis: true
+			ellipsis: true,
 			<% } %>
+			<% if(configList[i].whetherSort) { %>
+                sorter: true,
+            <% } %>
 		},
 	<% } %>
 	<% } %>

+ 6 - 3
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index_inside.vue.btl

@@ -188,10 +188,13 @@
 	<% if(!configList[i].needTableId && configList[i].whetherTable) { %>
 		{
 			title: '${configList[i].fieldRemark}',
-			dataIndex: '${configList[i].fieldNameCamelCase}'<% if(configList[i].whetherRetract) { %>,<% } %>
+			dataIndex: '${configList[i].fieldNameCamelCase}',
 			<% if(configList[i].whetherRetract) { %>
-			ellipsis: true
-			<% } %>
+                ellipsis: true,
+            <% } %>
+            <% if(configList[i].whetherSort) { %>
+                sorter: true,
+            <% } %>
 		},
 	<% } %>
 	<% } %>

+ 1 - 1
snowy-plugin/snowy-plugin-gen/src/main/resources/sqlend/Oracle.sql.btl

@@ -7,7 +7,7 @@ INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${menuId}', '${parentId}', '${functi
 
 INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${addButtonId}', '${menuId}', '新增${functionName}', NULL, '${classNameFirstLower}Add', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1', NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
 
-INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${batchDeleteButtonId}', '${menuId}', '批量删除${functionName}', NULL, '${classNameFirstLower}BatchDelete', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2', NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
+INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${batchExportButtonId}', '${menuId}', '批量导出${functionName}', NULL, '${classNameFirstLower}BatchExport', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2', NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
 
 INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${editButtonId}', '${menuId}', '编辑${functionName}', NULL, '${classNameFirstLower}Edit', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '3', NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
 

+ 1 - 1
snowy-plugin/snowy-plugin-sys/src/main/java/vip/xiaonuo/sys/modular/resource/service/impl/SysButtonServiceImpl.java

@@ -110,7 +110,7 @@ public class SysButtonServiceImpl extends ServiceImpl<SysButtonMapper, SysButton
         CollectionUtil.newArrayList(JSONUtil.createObj().set("title", "新增" + functionName).set("code", classNameFirstLower + "Add").set("sortCode", 1),
                 JSONUtil.createObj().set("title", "编辑" + functionName).set("code", classNameFirstLower + "Edit").set("sortCode", 2),
                 JSONUtil.createObj().set("title", "删除" + functionName).set("code", classNameFirstLower + "Delete").set("sortCode", 3),
-                JSONUtil.createObj().set("title", "批量删除").set("code", classNameFirstLower + "BatchDelete").set("sortCode", 4)).forEach(jsonObject -> {
+                JSONUtil.createObj().set("title", "批量导出" + functionName).set("code", classNameFirstLower + "BatchExport").set("sortCode", 4)).forEach(jsonObject -> {
                     SysButtonAddParam sysButtonAddParam = new SysButtonAddParam();
                     BeanUtil.copyProperties(jsonObject, sysButtonAddParam);
                     sysButtonAddParam.setParentId(sysMenu.getId());

+ 2 - 0
snowy-web-app/src/main/resources/_sql/snowy_mysql.sql

@@ -547,6 +547,7 @@ CREATE TABLE `GEN_BASIC`  (
   `CREATE_USER` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建用户',
   `UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '修改时间',
   `UPDATE_USER` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改用户',
+  `FORM_MODE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单模式',
   PRIMARY KEY (`ID`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '生成基础' ROW_FORMAT = DYNAMIC;
 
@@ -570,6 +571,7 @@ CREATE TABLE `GEN_CONFIG`  (
   `DICT_TYPE_CODE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字典',
   `WHETHER_TABLE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列表显示',
   `WHETHER_RETRACT` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列省略',
+  `WHETHER_SORT` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列排序',
   `WHETHER_ADD_UPDATE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否增改',
   `WHETHER_REQUIRED` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '必填',
   `QUERY_WHETHER` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '查询',