Bläddra i källkod

代码模板,查看按钮权限生成

CzRger 8 månader sedan
förälder
incheckning
42872d0e1a

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

@@ -672,6 +672,8 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
         bindingJsonObject.set("deleteButtonId", IdWorker.getIdStr());
         // 批量导出按钮ID
         bindingJsonObject.set("batchExportButtonId", IdWorker.getIdStr());
+        // 查看按钮ID
+        bindingJsonObject.set("viewButtonId", IdWorker.getIdStr());
         // 作者
         bindingJsonObject.set("authorName", genBasic.getAuthorName());
         // 生成时间

+ 2 - 0
snowy-plugin/snowy-plugin-gen/src/main/resources/sqlend/Mysql.sql.btl

@@ -13,6 +13,8 @@ INSERT INTO `SYS_RESOURCE` VALUES ('${editButtonId}', '${menuId}', '编辑${func
 
 INSERT INTO `SYS_RESOURCE` VALUES ('${deleteButtonId}', '${menuId}', '删除${functionName}', NULL, '${classNameFirstLower}Delete', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
 
+INSERT INTO `SYS_RESOURCE` VALUES ('${viewButtonId}', '${menuId}', '查看${functionName}', NULL, '${classNameFirstLower}View', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 5, NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
+
 
 <% if (mobileModuleId != null && mobileModuleId != '') { %>
 INSERT INTO `MOBILE_RESOURCE` VALUES ('${menuId}', '0', '${functionName}管理', NULL, 'MENU', '${mobileModuleId}', 'MENU', '/pages/${moduleName}/${busName}/index', 'apartment-outlined',  '#1890ff', 'YES', 'ENABLE', 99, NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);

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

@@ -13,6 +13,8 @@ INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${editButtonId}', '${menuId}', '编
 
 INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${deleteButtonId}', '${menuId}', '删除${functionName}', NULL, '${classNameFirstLower}Delete', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '4', NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
 
+INSERT INTO "SNOWY"."SYS_RESOURCE" VALUES ('${viewButtonId}', '${menuId}', '查看${functionName}', NULL, '${classNameFirstLower}View', 'BUTTON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '5', NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);
+
 
 <% if (mobileModuleId != null && mobileModuleId != '') { %>
 INSERT INTO "SNOWY"."MOBILE_RESOURCE" VALUES ('${menuId}', '0', '${functionName}管理', NULL, 'MENU', '${mobileModuleId}', 'MENU', '/pages/${moduleName}/${busName}/index', 'apartment-outlined',  '#1890ff', 'YES', 'ENABLE', 99, NULL, 'NOT_DELETE', NULL, NULL, NULL, NULL);

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

@@ -110,7 +110,8 @@ 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", "批量导出" + functionName).set("code", classNameFirstLower + "BatchExport").set("sortCode", 4)).forEach(jsonObject -> {
+                JSONUtil.createObj().set("title", "批量导出" + functionName).set("code", classNameFirstLower + "BatchExport").set("sortCode", 4),
+                JSONUtil.createObj().set("title", "查看" + functionName).set("code", classNameFirstLower + "View").set("sortCode", 5)).forEach(jsonObject -> {
                     SysButtonAddParam sysButtonAddParam = new SysButtonAddParam();
                     BeanUtil.copyProperties(jsonObject, sysButtonAddParam);
                     sysButtonAddParam.setParentId(sysMenu.getId());