-- 身体档案菜单SQL(简化版) -- 使用说明: -- 1. 执行前请确保fa_auth_rule表存在 -- 2. 执行后需要在后台权限管理中为相应角色分配权限 -- 3. 菜单图标可根据需要调整 -- 获取父级菜单ID(如果不存在则创建) SET @parent_id = (SELECT id FROM fa_auth_rule WHERE name = 'body_profile' LIMIT 1); -- 如果父级菜单不存在,先创建 INSERT IGNORE INTO fa_auth_rule (type, pid, name, title, icon, condition, remark, ismenu, createtime, updatetime, weigh, status) VALUES (1, 0, 'body_profile', '我的档案', 'fa fa-user', '', '身体档案管理', 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 100, 'normal'); -- 重新获取父级菜单ID SET @parent_id = (SELECT id FROM fa_auth_rule WHERE name = 'body_profile' LIMIT 1); -- 档案列表(主页面) INSERT IGNORE INTO fa_auth_rule (type, pid, name, title, icon, condition, remark, ismenu, createtime, updatetime, weigh, status) VALUES (1, @parent_id, 'body_profile/index', '档案列表', 'fa fa-list', '', '查看档案列表', 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 90, 'normal'); -- 查看详情 INSERT IGNORE INTO fa_auth_rule (type, pid, name, title, icon, condition, remark, ismenu, createtime, updatetime, weigh, status) VALUES (1, @parent_id, 'body_profile/detail', '查看详情', 'fa fa-eye', '', '查看档案详情', 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 80, 'normal'); -- 获取体型数据(AJAX接口) INSERT IGNORE INTO fa_auth_rule (type, pid, name, title, icon, condition, remark, ismenu, createtime, updatetime, weigh, status) VALUES (1, @parent_id, 'body_profile/getBodyTypes', '获取体型数据', '', '', '获取体型选择数据', 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 70, 'normal'); -- 获取测量数据(AJAX接口) INSERT IGNORE INTO fa_auth_rule (type, pid, name, title, icon, condition, remark, ismenu, createtime, updatetime, weigh, status) VALUES (1, @parent_id, 'body_profile/getMeasurements', '获取测量数据', '', '', '获取身体测量数据', 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 60, 'normal'); -- 注意事项: -- 1. 执行前请备份数据库 -- 2. 请将上述SQL中的pid值85替换为实际查询到的主菜单ID -- 3. 可以通过以下查询获取主菜单ID: -- SELECT id FROM `fa_auth_rule` WHERE `name` = 'body_profile'; -- 4. 执行完成后,需要清除缓存或重新登录后台查看菜单 -- 完整执行示例(动态获取主菜单ID): /* SET @parent_id = (SELECT id FROM `fa_auth_rule` WHERE `name` = 'body_profile'); INSERT INTO `fa_auth_rule` (`type`, `pid`, `name`, `title`, `icon`, `url`, `condition`, `remark`, `ismenu`, `menutype`, `extend`, `py`, `pinyin`, `createtime`, `updatetime`, `weigh`, `status`) VALUES ('file', @parent_id, 'body_profile/index', '档案列表', 'fa fa-list', '', '', '查看身体档案列表', 1, NULL, '', 'dalb', 'danganliebiao', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 119, 'normal'), ('file', @parent_id, 'body_profile/index', '查看', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 118, 'normal'), ('file', @parent_id, 'body_profile/add', '添加', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 117, 'normal'), ('file', @parent_id, 'body_profile/edit', '编辑', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 116, 'normal'), ('file', @parent_id, 'body_profile/del', '删除', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 115, 'normal'), ('file', @parent_id, 'body_profile/multi', '批量操作', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 114, 'normal'), ('file', @parent_id, 'body_profile/detail', '详情', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 113, 'normal'), ('file', @parent_id, 'body_profile/measurements', '测量数据', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 112, 'normal'), ('file', @parent_id, 'body_profile/bodyTypes', '体型选择', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 111, 'normal'); */