-- 司法行政机构管理菜单及按钮权限（达梦8 / JZ_TEST）
-- 请在 sys_menu 中确认父菜单 ID，默认挂载在「系统管理(1)」下，可按需调整 parent_id

-- 主菜单（menu_id 请按环境调整，避免冲突）
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES (2100, '司法行政机构', 1, 10, 'org', 'busi/org/index', '', '', 1, 0, 'C', '0', '0', 'busi:org:list', 'tree', 'admin', SYSDATE, '', NULL, '司法行政机构管理菜单');

-- 按钮权限
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES (2101, '机构查询', 2100, 1, '#', '', '', '', 1, 0, 'F', '0', '0', 'busi:org:query', '#', 'admin', SYSDATE, '', NULL, '');

INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES (2102, '机构新增', 2100, 2, '#', '', '', '', 1, 0, 'F', '0', '0', 'busi:org:add', '#', 'admin', SYSDATE, '', NULL, '');

INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES (2103, '机构修改', 2100, 3, '#', '', '', '', 1, 0, 'F', '0', '0', 'busi:org:edit', '#', 'admin', SYSDATE, '', NULL, '');

INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES (2104, '机构删除', 2100, 4, '#', '', '', '', 1, 0, 'F', '0', '0', 'busi:org:remove', '#', 'admin', SYSDATE, '', NULL, '');

-- 为超级管理员角色授权（role_id=1）
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2100);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2101);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2102);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2103);
INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2104);
