-- 公司日历菜单配置脚本

SET @AdminRoleId = '94e3a9bb0fce4547886972998fddba1c'; -- 系统管理员角色ID

-- 1. 清理旧数据 (防止重复执行报错)
DELETE FROM BASE_MODULE WHERE F_Id IN ('company-calendar', 'company-calendar-type');
DELETE FROM BASE_AUTHORIZE WHERE F_ItemId IN ('company-calendar', 'company-calendar-type');

-- 2. 创建菜单: 公司日历 (父级: 扩展功能 725873504657868037)
-- 请根据实际的父级菜单ID修改 F_ParentId
INSERT INTO BASE_MODULE (F_Id, F_ParentId, F_Type, F_FullName, F_EnCode, F_UrlAddress, F_Icon, F_SortCode, F_EnabledMark, F_Category, F_DeleteMark, F_LinkTarget, F_PropertyJson, F_IsButtonAuthorize, F_IsColumnAuthorize, F_IsDataAuthorize, F_IsFormAuthorize, F_CreatorTime)
VALUES 
('company-calendar', '725873504657868037', 2, '公司日历', 'companyCalendar', 'extend/companyCalendar', 'icon-ym icon-ym-calendar', 12, 1, 'Web', NULL, '_self', '{"moduleId":"","iconBackgroundColor":"","isTree":0}', 1, 1, 1, 1, NOW());

-- 3. 授权给 系统管理员 角色
INSERT INTO BASE_AUTHORIZE (F_Id, F_ItemType, F_ItemId, F_ObjectType, F_ObjectId, F_SortCode, F_CreatorTime, F_CreatorUserId)
VALUES 
(REPLACE(UUID(), '-', ''), 'module', 'company-calendar', 'Role', @AdminRoleId, 1, NOW(), 'admin');
