sys_post_home_page_menu.sql 2.1 KB

12345678910111213141516171819202122232425262728293031
  1. -- 菜单 SQL
  2. -- 岗位首页配置菜单及权限
  3. -- 查找系统管理菜单ID(通常为1)
  4. -- 假设系统管理菜单ID为1,如果不同请相应调整
  5. SET @systemMenuId = 1;
  6. -- 二级菜单:岗位首页配置
  7. 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)
  8. VALUES ('岗位首页配置', @systemMenuId, 10, 'postHomePage', 'system/postHomePage/index', 1, 0, 'C', '0', '0', 'system:postHomePage:list', 'guide', 'admin', sysdate(), '', null, '岗位首页配置菜单');
  9. -- 获取刚插入的菜单ID,用于后续按钮权限
  10. SET @postHomePageMenuId = LAST_INSERT_ID();
  11. -- 按钮权限
  12. 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)
  13. VALUES
  14. ('岗位首页配置查询', @postHomePageMenuId, 1, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:query', '#', 'admin', sysdate(), '', null, ''),
  15. ('岗位首页配置新增', @postHomePageMenuId, 2, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:add', '#', 'admin', sysdate(), '', null, ''),
  16. ('岗位首页配置修改', @postHomePageMenuId, 3, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:edit', '#', 'admin', sysdate(), '', null, ''),
  17. ('岗位首页配置删除', @postHomePageMenuId, 4, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:remove', '#', 'admin', sysdate(), '', null, ''),
  18. ('岗位首页配置导出', @postHomePageMenuId, 5, '#', '', 1, 0, 'F', '0', '0', 'system:postHomePage:export', '#', 'admin', sysdate(), '', null, '');
  19. -- 说明:
  20. -- 1. parent_id 为系统管理菜单ID,请根据实际情况调整
  21. -- 2. 执行此脚本后,需要在角色管理中为相应角色分配菜单权限
  22. -- 3. is_frame: 是否为外链(0是 1否)
  23. -- 4. is_cache: 是否缓存(0缓存 1不缓存)
  24. -- 5. menu_type: 菜单类型(M目录 C菜单 F按钮)
  25. -- 6. visible: 菜单状态(0显示 1隐藏)
  26. -- 7. status: 菜单状态(0正常 1停用)