feat(优化):年培训计划:已确认行的删除按钮、勾选框、批量删除均仅超级管理员可见/可用;提示文案随角色变化
deploy-hxtesting / build-and-deploy (push) Successful in 1m14s
deploy-hxtesting / build-and-deploy (push) Successful in 1m14s
课程管理:canDeleteCourse 超管不限状态/部门(已审核/已发布行可删,确认弹窗文案区分);批量删除按钮超管可见 月培训计划:已发布行的「删除」仅超管可见(普通维护角色仍只能删未发布计划),行内确认弹窗替代原 window.confirm,失败时透出后端文案 Training.vue:canManageTabs 加入 super_admin,纯超管(未兼其他角色)也能进入这三个页面执行删除
This commit is contained in:
1 parent
a448598df5
commit
2f1cda34da
19 files changed
+589
-278
No files matched your search
@@ -1250,22 +1250,28 @@ export const ROLE_DICT_RULE_KEY = 'role_dict'
|
||||
export const TRAINEE_LABEL = '学员'
|
||||
|
||||
/** 系统默认职称角色(与后端 DefaultRoleDict 一致;字典缺失/损坏时兜底)。
|
||||
* 角色体系 v2:学员(隐式)/课长/经理/人事/讲师;经理继承课长全部权限并叠加审批决策。 */
|
||||
* 角色体系 v2:学员(隐式)/课长/经理/人事/讲师;经理继承课长全部权限并叠加审批决策。
|
||||
* v2.1 增补超级管理员:不继承任何权限组,仅承载终态数据(已确认需求/已审核课程/
|
||||
* 已发布计划)的删除权,组织架构「设置角色」可分配。 */
|
||||
export const DEFAULT_ROLE_DICT: TrainingRoleDef[] = [
|
||||
{ key: 'hr', label: '人事', short: '人事', system: true },
|
||||
{ key: 'supervisor', label: '课长', short: '课长', system: true },
|
||||
{ key: 'lecturer', label: '讲师', short: '讲师', system: true },
|
||||
{ key: 'exec', label: '经理', short: '经理', system: true, inherits: ['supervisor'] },
|
||||
{ key: 'super_admin', label: '超级管理员', short: '超管', system: true },
|
||||
]
|
||||
|
||||
/** 存量角色别名:部门文员(clerk)已移除,按课长对待(与后端 LegacyRoleAlias 同构) */
|
||||
const LEGACY_ROLE_ALIAS: Record<string, string> = { clerk: 'supervisor' }
|
||||
|
||||
/** 角色体系 v2 升级判定:经理(exec)必须继承课长,否则视为旧字典(与后端 NeedsRoleDictUpgrade 同构) */
|
||||
/** 角色体系升级判定(与后端 NeedsRoleDictUpgrade 同构):
|
||||
* 经理(exec)未继承课长视为 v1 旧字典;v2 口径但缺 v2.1 增补的超级管理员
|
||||
* 同样需要读时升级补齐(存量租户免迁移)。 */
|
||||
export function needsRoleDictUpgrade(dict: TrainingRoleDef[]): boolean {
|
||||
const mgr = dict.find((r) => r.key === 'exec')
|
||||
if (!mgr) return true
|
||||
return !(mgr.inherits || []).includes('supervisor')
|
||||
if (!(mgr.inherits || []).includes('supervisor')) return true
|
||||
return !dict.some((r) => r.key === 'super_admin')
|
||||
}
|
||||
|
||||
/** v1 存量字典升级为 v2 视图(与后端 UpgradeRoleDictV2 同构,幂等):
|
||||
|
||||
Reference in new issue
Block a user