SET NAMES utf8mb4;
-- 2.1 父菜单：供应商门户（根级）
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, remark)
VALUES (2100, '供应商门户', 0, 4, 'supplier-portal', NULL, NULL, NULL, 1, 0, 'M', '0', '0', '', 'user', 'admin', NOW(), '供应商门户');

-- 2.2 子菜单：我的报价请求
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, remark)
VALUES (2101, '我的报价请求', 2100, 1, 'my-rfq', 'bid/rfq/index', NULL, NULL, 1, 0, 'C', '0', '0', 'supplier:rfq:list', 'form', 'admin', NOW(), '供应商RFQ');

-- 2.3 按钮权限
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, remark)
VALUES (2102, '查询', 2101, 1, '#', NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'supplier:rfq:query', '#', 'admin', NOW(), '');

-- 角色-菜单关联
INSERT INTO sys_role_menu (role_id, menu_id)
SELECT 3, menu_id FROM sys_menu WHERE menu_id IN (2100, 2101, 2102);

SELECT menu_id, menu_name, perms FROM sys_menu WHERE menu_id IN (2100, 2101, 2102);
SELECT COUNT(*) AS role_menu_count FROM sys_role_menu WHERE role_id=3;
