Files
zkxw/docs/sql/2026-08-28-oa-start-history-all-perm.sql
T
2026-08-28 10:51:28 +08:00

75 lines
2.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =============================================================================
-- OA 发起审批 · 全员历史记录按钮权限(menu_type = F)
-- perms: oa:start:history:all
-- =============================================================================
--
-- 用途:授予「发起审批」页历史弹窗查看本租户该流程全部实例的能力(含申请人筛选)。
-- 无此权限的用户仍可打开历史弹窗,但仅能看到本人发起的实例。
--
-- 执行方式(按环境替换连接参数):
-- mysql -h<host> -u<user> -p<password> <database> < docs/sql/2026-08-28-oa-start-history-all-perm.sql
--
-- 执行后授权:
-- 1. 登录 web-admin → 系统管理 → 角色管理
-- 2. 编辑目标角色 → 菜单权限树中展开「OA审批 → 发起审批」
-- 3. 勾选「全员历史记录」按钮并保存
-- 4. 相关用户重新登录或刷新权限缓存后生效
--
-- 执行前可选:确认「发起审批」菜单 id(应与下方 parent_id 一致)
-- SELECT id, parent_id, menu_name, perms, menu_type
-- FROM sys_menu
-- WHERE del_flag = 0 AND (perms = 'oa:start' OR menu_name LIKE '%发起审批%');
--
-- parent_id 来源:backend/app/api/menu.py、web-admin/src/router/modules/sqxp.ts
-- 发起审批 C 菜单 id = OA000000000000000000000000000103
-- =============================================================================
INSERT INTO `sys_menu` (
`id`,
`menu_name`,
`parent_id`,
`menu_type`,
`path`,
`component`,
`perms`,
`is_frame`,
`visible`,
`status`,
`tenant_no`,
`order_num`,
`remark`,
`create_by`,
`create_dept_id`,
`create_time`,
`update_by`,
`update_time`,
`del_flag`
)
SELECT
'OA000000000000000000000000000301',
'全员历史记录',
'OA000000000000000000000000000103',
'F',
'',
'',
'oa:start:history:all',
1,
'0',
'1',
'zkxw',
90,
'发起审批历史弹窗:有此权限可查看本租户该流程全部实例',
NULL,
'',
NOW(),
NULL,
NOW(),
0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1
FROM `sys_menu`
WHERE `perms` = 'oa:start:history:all'
AND `del_flag` = 0
);