fix: WorkflowEditor 下拉过滤禁用用户 — getEligibleUsers 增加 is_active 条件
- 审核阶段: 只显示 is_active=true 且角色为 admin/dba/auditor 的用户 - 执行阶段: 只显示 is_active=true 且角色为 admin/dba 的用户 - 禁用用户不再出现在审批流程编辑器下拉列表中
This commit is contained in:
1 parent
1f9d373c08
commit
bfb64d4dce
1 file changed
+4
-3
@@ -281,9 +281,10 @@ function WorkflowEditorModal({ workflow, users, onClose, onSaved }: EditorProps)
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getEligibleUsers = (stepType: string) => {
|
const getEligibleUsers = (stepType: string) => {
|
||||||
if (stepType === 'audit') return users.filter(u => ['admin', 'superadmin', 'dba', 'auditor'].includes(u.role));
|
const active = users.filter(u => u.is_active);
|
||||||
if (stepType === 'execute') return users.filter(u => ['admin', 'superadmin', 'dba'].includes(u.role));
|
if (stepType === 'audit') return active.filter(u => ['admin', 'superadmin', 'dba', 'auditor'].includes(u.role));
|
||||||
return users;
|
if (stepType === 'execute') return active.filter(u => ['admin', 'superadmin', 'dba'].includes(u.role));
|
||||||
|
return active;
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleAllUsers = (idx: number) => {
|
const toggleAllUsers = (idx: number) => {
|
||||||
|
|||||||
Reference in new issue
Block a user