fix 代码生成-父级菜单,状态字段优化
This commit is contained in:
@@ -27,12 +27,17 @@ DELETE FROM `sys_auth_rule` WHERE `name` = '{{.apiVersion}}/{{.modulePath}}/{{$.
|
||||
-- 当前日期
|
||||
select @now := now();
|
||||
|
||||
{{if eq .table.MenuPid 0}}
|
||||
-- 目录 SQL
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`is_cached`,`is_hide`,`path`,`link_url`,`component`,`is_iframe`,`module_type`,`model_id`,`created_at`,`updated_at` )
|
||||
VALUES({{.table.MenuPid}},'{{.apiVersion}}/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','{{.table.TableComment}}管理','iconfont icon-fuwenbenkuang','','{{.table.TableComment}}管理',0,0,1,0,'/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','','layout/routerView/parent',0,'sys_admin',0,@now,@now);
|
||||
VALUES(0,'{{.apiVersion}}/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','{{.table.TableComment}}管理','iconfont icon-fuwenbenkuang','','{{.table.TableComment}}管理',0,0,1,0,'/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','','layout/routerView/parent',0,'sys_admin',0,@now,@now);
|
||||
|
||||
-- 菜单父目录ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
{{else}}
|
||||
-- 菜单父目录ID
|
||||
SELECT @parentId := {{$.table.MenuPid}};
|
||||
{{end}}
|
||||
|
||||
-- 菜单 SQL
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`is_cached`,`is_hide`,`path`,`link_url`,`component`,`is_iframe`,`module_type`,`model_id`,`created_at`,`updated_at`)
|
||||
|
@@ -29,14 +29,18 @@ DELETE FROM sys_auth_rule WHERE name = '{{.apiVersion}}/{{.modulePath}}/{{$.tabl
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
|
||||
{{if eq .table.MenuPid 0}}
|
||||
-- 目录 SQL
|
||||
INSERT INTO sys_auth_rule (pid,name,title,icon,condition,remark,menu_type,weigh,is_cached,is_hide,path,link_url,component,is_iframe,module_type,model_id,created_at,updated_at )
|
||||
VALUES({{.table.MenuPid}},'{{.apiVersion}}/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','{{.table.TableComment}}管理','iconfont icon-fuwenbenkuang','','{{.table.TableComment}}管理',0,0,1,0,'/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','','layout/routerView/parent',0,'sys_admin',0,v_time,v_time) RETURNING id INTO parentId;
|
||||
|
||||
VALUES(0,'{{.apiVersion}}/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','{{.table.TableComment}}管理','iconfont icon-fuwenbenkuang','','{{.table.TableComment}}管理',0,0,1,0,'/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}','','layout/routerView/parent',0,'sys_admin',0,v_time,v_time) RETURNING id INTO parentId;
|
||||
-- 菜单 SQL
|
||||
INSERT INTO sys_auth_rule (pid,name,title,icon,condition,remark,menu_type,weigh,is_cached,is_hide,path,link_url,component,is_iframe,module_type,model_id,created_at,updated_at)
|
||||
VALUES(parentId,'{{.apiVersion}}/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}/list','{{.table.TableComment}}列表','ele-Fold','','{{.table.TableComment}}列表',1,0,1,0,'/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}/list','','{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}/list/index',0,'sys_admin',0,v_time,v_time) RETURNING id INTO parentId;
|
||||
{{else}}
|
||||
-- 菜单 SQL
|
||||
INSERT INTO sys_auth_rule (pid,name,title,icon,condition,remark,menu_type,weigh,is_cached,is_hide,path,link_url,component,is_iframe,module_type,model_id,created_at,updated_at)
|
||||
VALUES({{$.table.MenuPid}},'{{.apiVersion}}/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}/list','{{.table.TableComment}}列表','ele-Fold','','{{.table.TableComment}}列表',1,0,1,0,'/{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}/list','','{{.modulePath}}/{{.table.BusinessName | CaseCamelLower}}/list/index',0,'sys_admin',0,v_time,v_time) RETURNING id INTO parentId;
|
||||
{{end}}
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO sys_auth_rule (pid,name,title,icon,condition,remark,menu_type,weigh,is_cached,is_hide,path,link_url,component,is_iframe,module_type,model_id,created_at,updated_at)
|
||||
|
Reference in New Issue
Block a user