first commit

This commit is contained in:
Your Name
2026-09-08 11:40:15 +08:00
commit a5353f7eb5
9568 changed files with 1646214 additions and 0 deletions
@@ -0,0 +1,115 @@
-- 一诊 / 我的患者
-- 页面:/first_visit/my_patients
-- 组件:first_visit/my_patients/index
-- 查询权限:firstvisit.myPatient/lists
START TRANSACTION;
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`)
SELECT
0,
'M',
'一诊',
'el-icon-FirstAidKit',
802,
'',
'first_visit',
'',
'',
'',
0,
1,
0,
UNIX_TIMESTAMP(),
UNIX_TIMESTAMP()
FROM DUAL
WHERE NOT EXISTS (
SELECT 1
FROM `zyt_system_menu`
WHERE `pid` = 0
AND `type` = 'M'
AND (
TRIM(`name`) = '一诊'
OR LOWER(TRIM(`paths`)) IN ('first_visit', 'firstvisit', 'first-visit')
)
);
SET @first_visit_menu_id = (
SELECT `id`
FROM `zyt_system_menu`
WHERE `pid` = 0
AND `type` = 'M'
AND (
TRIM(`name`) = '一诊'
OR LOWER(TRIM(`paths`)) IN ('first_visit', 'firstvisit', 'first-visit')
)
ORDER BY CASE WHEN TRIM(`name`) = '一诊' AND TRIM(`paths`) = 'first_visit' THEN 0 ELSE 1 END, `id`
LIMIT 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`)
SELECT
@first_visit_menu_id,
'C',
'我的患者',
'el-icon-User',
100,
'firstvisit.myPatient/lists',
'my_patients',
'first_visit/my_patients/index',
'',
'',
0,
1,
0,
UNIX_TIMESTAMP(),
UNIX_TIMESTAMP()
FROM DUAL
WHERE @first_visit_menu_id IS NOT NULL
AND NOT EXISTS (
SELECT 1
FROM `zyt_system_menu`
WHERE `perms` = 'firstvisit.myPatient/lists'
OR (
`pid` = @first_visit_menu_id
AND (
TRIM(`name`) = '我的患者'
OR TRIM(`paths`) = 'my_patients'
OR TRIM(`component`) = 'first_visit/my_patients/index'
)
)
);
SET @my_patient_menu_id = (
SELECT `id`
FROM `zyt_system_menu`
WHERE `pid` = @first_visit_menu_id
AND (
`perms` = 'firstvisit.myPatient/lists'
OR TRIM(`name`) = '我的患者'
OR TRIM(`paths`) = 'my_patients'
OR TRIM(`component`) = 'first_visit/my_patients/index'
)
ORDER BY CASE WHEN `perms` = 'firstvisit.myPatient/lists' THEN 0 ELSE 1 END, `id`
LIMIT 1
);
-- 医生、医助、经理、诊室组长、管理员可见入口;root 无需角色菜单授权。
-- 页面内诊单/预约/订单按钮继续使用各自原有按钮权限。
INSERT IGNORE INTO `zyt_system_role_menu` (`role_id`, `menu_id`)
SELECT `id`, @first_visit_menu_id
FROM `zyt_system_role`
WHERE @first_visit_menu_id IS NOT NULL
AND `delete_time` IS NULL
AND `name` IN ('医生', '医助', '经理', '诊室组长', '管理员');
INSERT IGNORE INTO `zyt_system_role_menu` (`role_id`, `menu_id`)
SELECT `id`, @my_patient_menu_id
FROM `zyt_system_role`
WHERE @my_patient_menu_id IS NOT NULL
AND `delete_time` IS NULL
AND `name` IN ('医生', '医助', '经理', '诊室组长', '管理员');
COMMIT;