-- 中医诊单菜单和权限配置 -- 注意:需要根据实际的菜单表结构调整字段名称 -- 1. 添加一级菜单:中医管理 INSERT INTO `zyt_system_menu` (`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (0, 'M', '中医管理', 'el-icon-Memo', 100, '', '/tcm', '', '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 获取刚插入的一级菜单ID SET @pid = LAST_INSERT_ID(); -- 2. 添加二级菜单:中医诊单 INSERT INTO `zyt_system_menu` (`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (@pid, 'C', '中医诊单', '', 1, 'tcm.diagnosis/lists', '/tcm/diagnosis', '/tcm/diagnosis/index', '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 获取二级菜单ID SET @menu_id = LAST_INSERT_ID(); -- 3. 添加按钮权限:查看 INSERT INTO `zyt_system_menu` (`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (@menu_id, 'A', '查看', '', 1, 'tcm.diagnosis/detail', '', '', '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 4. 添加按钮权限:新增 INSERT INTO `zyt_system_menu` (`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (@menu_id, 'A', '新增', '', 2, 'tcm.diagnosis/add', '', '', '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 5. 添加按钮权限:编辑 INSERT INTO `zyt_system_menu` (`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (@menu_id, 'A', '编辑', '', 3, 'tcm.diagnosis/edit', '', '', '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 6. 添加按钮权限:删除 INSERT INTO `zyt_system_menu` (`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`) VALUES (@menu_id, 'A', '删除', '', 4, 'tcm.diagnosis/delete', '', '', '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); -- 说明: -- type: M-目录 C-菜单 A-按钮 -- perms: 权限标识,对应后端控制器方法 -- paths: 前端路由路径 -- component: 前端组件路径 -- is_show: 是否显示在菜单中 -- is_disable: 是否禁用