-- 菜单 SQL -- 岗位首页配置菜单及权限 -- 查找系统管理菜单ID(通常为1) -- 假设系统管理菜单ID为1,如果不同请相应调整 SET @systemMenuId = 1; -- 二级菜单:岗位首页配置 INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ('岗位首页配置', @systemMenuId, 10, 'postHomePage', 'system/postHomePage/index', 1, 0, 'C', '0', '0', 'system:postHomePage:list', 'guide', 'admin', sysdate(), '', null, '岗位首页配置菜单'); -- 获取刚插入的菜单ID,用于后续按钮权限 SET @postHomePageMenuId = LAST_INSERT_ID(); -- 按钮权限 INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES ('岗位首页配置查询', @postHomePageMenuId, 1, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:query', '#', 'admin', sysdate(), '', null, ''), ('岗位首页配置新增', @postHomePageMenuId, 2, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:add', '#', 'admin', sysdate(), '', null, ''), ('岗位首页配置修改', @postHomePageMenuId, 3, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:edit', '#', 'admin', sysdate(), '', null, ''), ('岗位首页配置删除', @postHomePageMenuId, 4, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:remove', '#', 'admin', sysdate(), '', null, ''), ('岗位首页配置导出', @postHomePageMenuId, 5, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:export', '#', 'admin', sysdate(), '', null, ''); -- 说明: -- 1. parent_id 为系统管理菜单ID,请根据实际情况调整 -- 2. 执行此脚本后,需要在角色管理中为相应角色分配菜单权限 -- 3. is_frame: 是否为外链(0是 1否) -- 4. is_cache: 是否缓存(0缓存 1不缓存) -- 5. menu_type: 菜单类型(M目录 C菜单 F按钮) -- 6. visible: 菜单状态(0显示 1隐藏) -- 7. status: 菜单状态(0正常 1停用)