oaEnums.ts
1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* OA 枚举镜像(与后端 src/services/oa/enums.py 一一对应,取值必须一致)。
* 改动任一枚举时两侧同步。
*/
export const Status = { ACTIVE: "active", DISABLED: "disabled" } as const;
export const StatusLabel: Record<string, string> = {
active: "启用",
disabled: "停用",
};
export const GrantStatus = { ACTIVE: "active", REVOKED: "revoked" } as const;
export const DeptCategory = { HQ: "hq", OUTSOURCE: "outsource", STORE: "store" } as const;
export const DeptCategoryLabel: Record<string, string> = { hq: "总部", outsource: "外包", store: "驻店" };
export const SourceType = {
DIR: "M",
MENU: "C",
PAGE: "P",
BUTTON: "F",
API: "A",
} as const;
export const SourceTypeLabel: Record<string, string> = {
M: "目录",
C: "菜单",
P: "页面",
F: "按钮",
A: "接口",
};
export const DataScope = {
ALL: 1,
CUSTOM: 2,
DEPT: 3,
DEPT_AND_SUB: 4,
SELF: 5,
} as const;
export const DataScopeLabel: Record<number, string> = {
1: "全部",
2: "自定义",
3: "本部门",
4: "本部门及以下",
5: "仅本人",
};
export const KbType = { BASE: "base", DEPT: "dept" } as const;
export const KbTypeLabel: Record<string, string> = {
base: "基础库",
dept: "部门库",
};
// 知识库权限三层模型:owner(绑定部门归属,由 kb.dept_id 承载,只作有效级别)
// / editor(可授权,读写)/ reader(可授权,只读)。
export const KbAccess = { OWNER: "owner", EDITOR: "editor", READER: "reader" } as const;
export const KbAccessLabel: Record<string, string> = {
owner: "所有者",
editor: "写权限",
reader: "访问权限",
};
export const BuiltinRole = {
SUPER_ADMIN: "super_admin",
CENTER_LEAD: "center_lead",
DEPT_LEAD: "dept_lead",
STAFF: "staff",
GUEST: "guest",
} as const;