body_profile_menu.sql 4.1 KB

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