@baishuyun/ui-business 6.1.1 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/DeptsMemberSelector/{CorpDeptTree-Bd9vQiyE.js → CorpDeptTree-B4EEUTqQ.js} +1 -1
  2. package/dist/DeptsMemberSelector/{CorpFlatList-AoU46OJa.js → CorpFlatList-Cn8-KRFi.js} +2 -2
  3. package/dist/DeptsMemberSelector/CorpLabelTree-iQ_7Ux_J.js +212 -0
  4. package/dist/DeptsMemberSelector/{Department-Buo6RYwS.js → Department-DXD3xoiS.js} +4 -4
  5. package/dist/DeptsMemberSelector/DeptsMemberSelector-DXpd9aCn.js +1935 -0
  6. package/dist/DeptsMemberSelector/{DeptsUser-0XtIImLw.js → DeptsUser-DO-SQexg.js} +146 -126
  7. package/dist/DeptsMemberSelector/{EnterpriseLabelList-Dik3GxJY.js → EnterpriseLabelList-BtB8AjXO.js} +2 -2
  8. package/dist/DeptsMemberSelector/{Member-B0yVNXTb.js → Member-BrNFIHZy.js} +22 -22
  9. package/dist/DeptsMemberSelector/OrganizationPanel-hray3UWA.js +671 -0
  10. package/dist/DeptsMemberSelector/{RelationShipList-CpNKR298.js → RelationShipList-DcgaMOyr.js} +1 -1
  11. package/dist/DeptsMemberSelector/{TagIcon-CgEG5XAx.js → TagIcon-CYklI9Ar.js} +40 -40
  12. package/dist/DeptsMemberSelector/{filterLabelCorpFlatNodes-COzZgZE5.js → filterLabelCorpFlatNodes-BrRZqDkm.js} +1 -1
  13. package/dist/DeptsMemberSelector/index.js +15 -15
  14. package/dist/DeptsMemberSelector/services/contact/{selector.service-dmS_qeZo.js → selector.service-CQopqiTw.js} +3 -1
  15. package/dist/DeptsMemberSelector/subcomponents/Entity/Department/index.js +6 -6
  16. package/dist/DeptsMemberSelector/subcomponents/Entity/DeptsUser/index.js +12 -12
  17. package/dist/DeptsMemberSelector/subcomponents/Entity/Member/index.js +5 -5
  18. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpDeptPanel/CorpDeptTree/index.js +2 -2
  19. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/CorpFlatList/index.js +3 -3
  20. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/CorpLabelTree/index.js +5 -5
  21. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersEnterpriseLabelPanel/EnterpriseLabelList/index.js +3 -3
  22. package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +2 -2
  23. package/dist/DeptsMemberSelector/{useDeptsMemberSelector-CiImbq5E.js → useDeptsMemberSelector-B6XZHqd5.js} +2 -3
  24. package/dist/DeptsMemberSelector/useFilteredMemberList-BE7jRCME.js +807 -0
  25. package/dist/DeptsMemberSelector/{useTreeExpandedKeys-BlOuNYZ2.js → useTreeExpandedKeys-oLUTUYkP.js} +13 -13
  26. package/dist/components/DeptsMemberSelector/context/DeptsMemberContext.d.ts +3 -5
  27. package/dist/components/DeptsMemberSelector/hooks/useDeptsMemberSelector.d.ts +1 -2
  28. package/dist/components/DeptsMemberSelector/hooks/useFilteredMemberList.d.ts +2 -2
  29. package/dist/components/DeptsMemberSelector/subcomponents/Entity/DeptsUser/DeptUsersSearch/DeptUsersSearch.d.ts +5 -0
  30. package/dist/components/DeptsMemberSelector/subcomponents/Entity/DeptsUser/DeptUsersSearch/useDeptUsersSearchData.d.ts +19 -0
  31. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/alignDockCorpSelectedKeys.d.ts +27 -0
  32. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/buildCorpLabelTreeData.d.ts +2 -0
  33. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/useCorpLabelTreePanelData.d.ts +1 -1
  34. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersRolePanel/useDeptUsersRolePanelData.d.ts +1 -15
  35. package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/useMemberPagedList.d.ts +40 -0
  36. package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/useMemberPanelData.d.ts +88 -3
  37. package/dist/components/DeptsMemberSelector/types/selector.d.ts +5 -6
  38. package/dist/components/DeptsMemberSelector/utils/deptUsersCorpDeptSearchGroup.d.ts +3 -16
  39. package/dist/components/DeptsMemberSelector/utils/deptUsersCorpSearchGroup.d.ts +9 -18
  40. package/dist/components/DeptsMemberSelector/utils/deptUsersDockCacheKeys.d.ts +13 -1
  41. package/dist/components/DeptsMemberSelector/utils/deptUsersEnterpriseLabelSearchGroup.d.ts +3 -15
  42. package/dist/components/DeptsMemberSelector/utils/deptUsersOrgDepartmentsData.d.ts +30 -0
  43. package/dist/components/DeptsMemberSelector/utils/deptUsersOrganizationSearchGroup.d.ts +25 -0
  44. package/dist/components/DeptsMemberSelector/utils/deptUsersRelationSearchGroup.d.ts +4 -16
  45. package/dist/components/DeptsMemberSelector/utils/deptUsersRoleModel.d.ts +43 -0
  46. package/dist/components/DeptsMemberSelector/utils/deptUsersRoleSearchGroup.d.ts +24 -0
  47. package/dist/components/DeptsMemberSelector/utils/deptUsersSearchDimensions.d.ts +30 -0
  48. package/dist/components/DeptsMemberSelector/utils/entityItemType.d.ts +5 -2
  49. package/dist/components/DeptsMemberSelector/utils/flattenDockUserList.d.ts +7 -0
  50. package/dist/components/DeptsMemberSelector/utils/flowCreator.d.ts +12 -3
  51. package/dist/components/DeptsMemberSelector/utils/resolveDeptUsersExternalMembers.d.ts +7 -0
  52. package/dist/components/DeptsMemberSelector/utils/resolveDeptUsersOrganizationEntryVisibility.d.ts +1 -1
  53. package/dist/components/DeptsMemberSelector/utils/resolveDockCorpId.d.ts +15 -0
  54. package/dist/components/DeptsMemberSelector/utils/useDeptUsersOrgDepartmentsPrefetch.d.ts +16 -0
  55. package/dist/index.css +1 -1
  56. package/dist/index.js +15 -15
  57. package/dist/lang/en-US.json.d.ts +2 -1
  58. package/dist/lang/zh-CN.json.d.ts +2 -1
  59. package/dist/lang/zh-TW.json.d.ts +2 -1
  60. package/dist/vendors/useLocale.js +12 -3
  61. package/package.json +3 -3
  62. package/dist/DeptsMemberSelector/CorpLabelTree-CNPD4B-g.js +0 -105
  63. package/dist/DeptsMemberSelector/DeptsMemberSelector-DxrheJ9Y.js +0 -1757
  64. package/dist/DeptsMemberSelector/OrganizationPanel-Bcgs46Oo.js +0 -604
  65. package/dist/DeptsMemberSelector/memberStatus-C9tTnu8V.js +0 -717
  66. package/dist/components/DeptsMemberSelector/utils/deptUsersSearchVisibility.d.ts +0 -36
@@ -1,45 +1,45 @@
1
1
  import { n as e } from "../vendors/lodash-es.js";
2
2
  import { useEffect as t, useRef as n, useState as r } from "react";
3
- //#region src/components/DeptsMemberSelector/utils/treeExpandedKeys.ts
4
- var i = (e, t) => {
3
+ //#region src/components/DeptsMemberSelector/utils/deptUsersDockCacheKeys.ts
4
+ var i = "deptUsersCorps", a = "deptUsersCorpLabelTree", o = "deptUsersCorpDeptTree", s = "deptUsersRelations", c = "deptUsersRoleLeaves", l = "deptUsersOrgInternal", u = "deptUsersOrgExternal", d = (e, t, n = !0) => `${e}:${t?.appId ?? ""}:${t?.entryId ?? ""}:${!!n}`, f = (e, t) => {
5
5
  if (t === "none" || e.length === 0) return [];
6
6
  if (t === "single-root-only") {
7
7
  let t = e[0]._id;
8
8
  return e.length === 1 && t != null ? [t] : [];
9
9
  }
10
10
  return e.map((e) => e._id).filter((e) => e != null);
11
- }, a = (e, t, n = []) => {
11
+ }, p = (e, t, n = []) => {
12
12
  for (let r of e) {
13
13
  if (r._id === void 0 || r._id === null) continue;
14
14
  let e = [...n, r._id];
15
15
  if (r._id === t) return e;
16
16
  if (r.children?.length) {
17
- let n = a(r.children, t, e);
17
+ let n = p(r.children, t, e);
18
18
  if (n) return n;
19
19
  }
20
20
  }
21
21
  return null;
22
- }, o = (t, n = []) => {
22
+ }, m = (t, n = []) => {
23
23
  let r = [];
24
24
  return n.forEach((e) => {
25
- let n = a(t, e);
25
+ let n = p(t, e);
26
26
  n && r.push(...n.slice(0, -1));
27
27
  }), e(r);
28
- }, s = (t, n) => {
29
- let r = i(t, n.baselineMode), a = n.selectionExpandKeys ?? [];
30
- return e([...r, ...a]);
31
- }, c = (e, t) => {
28
+ }, h = (t, n) => {
29
+ let r = f(t, n.baselineMode), i = n.selectionExpandKeys ?? [];
30
+ return e([...r, ...i]);
31
+ }, g = (e, t) => {
32
32
  if (e.length !== t.length) return !1;
33
33
  let n = new Set(t.map(String));
34
34
  return e.every((e) => n.has(String(e)));
35
- }, l = (e) => {
35
+ }, _ = (e) => {
36
36
  let [i, a] = r(null), o = n(e);
37
37
  return t(() => {
38
- c(e, o.current) || (o.current = e, a(null));
38
+ g(e, o.current) || (o.current = e, a(null));
39
39
  }, [e]), {
40
40
  expandedKeys: i ?? e,
41
41
  onExpand: a
42
42
  };
43
43
  };
44
44
  //#endregion
45
- export { s as i, a as n, o as r, l as t };
45
+ export { i as a, u as c, c as d, d as f, h as i, l, p as n, o, m as r, a as s, _ as t, s as u };
@@ -1,4 +1,3 @@
1
- import { SetStateAction } from 'react';
2
1
  import { Action } from '../types/context';
3
2
  import { CurrentContext, DepartmentSelectableRange, DepartmentPanelRequestGuard, DeptUsersPanelConfig, FlowCreator, MemberPanelRequestGuard, MemberPanelVisibility, RequestContext, SelectorLimits, SelectorType } from '../types/selector';
4
3
  declare const DeptsMemberContext: import('react').Context<{
@@ -8,7 +7,6 @@ declare const DeptsMemberContext: import('react').Context<{
8
7
  * @description 无论单选还是多选,value 都统一按数组存储,避免面板层再分叉处理状态结构
9
8
  */
10
9
  value?: any[];
11
- setValue: (v: SetStateAction<any[]>, ...args: any[]) => void;
12
10
  dispatch: (action: Action) => void;
13
11
  containerHeight: number;
14
12
  currentUsers?: Record<string, unknown>[];
@@ -40,9 +38,9 @@ declare const DeptsMemberContext: import('react').Context<{
40
38
  */
41
39
  isSingleSelect?: boolean;
42
40
  /**
43
- * true 时在所有成员列表出口过滤当前登录用户,并隐藏「当前用户」Tab。
44
- * 不影响部门实体与流程发起人。由主组件从 props.noUserMe 派生注入。
41
+ * 成员黑名单 id Set。仅 type === 'deptusers' 时由主组件从 props.excludedMemberIds 派生;
42
+ * 其它 type 或未传时为空 Set。命中 `_id` / `id` / `dock_userid` 的成员不展示。
45
43
  */
46
- noUserMe?: boolean;
44
+ excludedMemberIdSet?: ReadonlySet<string>;
47
45
  }>;
48
46
  export default DeptsMemberContext;
@@ -3,7 +3,6 @@ export declare const useDeptsMemberSelector: () => {
3
3
  departmentPanelRequestGuard: import('../types/selector').DepartmentPanelRequestGuard;
4
4
  type: import('..').SelectorType;
5
5
  value?: any[];
6
- setValue: (v: import('react').SetStateAction<any[]>, ...args: any[]) => void;
7
6
  dispatch: (action: import('../types/context').Action) => void;
8
7
  containerHeight: number;
9
8
  currentUsers?: Record<string, unknown>[];
@@ -21,5 +20,5 @@ export declare const useDeptsMemberSelector: () => {
21
20
  hasDock?: boolean;
22
21
  hasDeptDock?: boolean;
23
22
  isSingleSelect?: boolean;
24
- noUserMe?: boolean;
23
+ excludedMemberIdSet?: ReadonlySet<string>;
25
24
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * 成员列表出口统一过滤当前登录用户:transfer noUserMe 为 true 时剔除身份重合成员。
3
- * 从 Context 读取 type / currentUsers / noUserMe 并 memo 化结果。仅用于渲染期调用点;
2
+ * 成员列表出口统一过滤:transfer 剔除当前登录用户;excludedMemberIdSet 非空时剔除黑名单成员。
3
+ * 从 Context 读取 type / currentUsers / excludedMemberIdSet 并 memo 化结果。仅用于渲染期调用点;
4
4
  * useRequest 异步回调内请直接使用 filterMemberListCandidates。
5
5
  */
6
6
  export declare const useFilteredMemberList: <T extends Record<string, unknown>>(list: T[]) => T[];
@@ -0,0 +1,5 @@
1
+ /** deptusers 全局搜索唯一宿主:按维度注册表并集展示结果。 */
2
+ declare const DeptUsersSearch: React.FC<{
3
+ wd?: string;
4
+ }>;
5
+ export default DeptUsersSearch;
@@ -0,0 +1,19 @@
1
+ import { TreeNodeDefine } from '@baishuyun/ui-base/components/Tree';
2
+ /** deptusers 全局搜索唯一宿主数据层:按维度注册表并集挂载 remote/local 搜索。 */
3
+ declare const useDeptUsersSearchData: ({ wd }: {
4
+ wd?: string;
5
+ }) => {
6
+ containerHeight: number;
7
+ treeData: {
8
+ title: string;
9
+ value: string;
10
+ children: any[];
11
+ }[];
12
+ defaultExpandedKeys: string[];
13
+ selectedKeys: any[];
14
+ isLoading: boolean;
15
+ checkType: "radio" | "checkbox";
16
+ handleSelect: (_id: any, node?: TreeNodeDefine) => void;
17
+ handleDeSelect: (targetValue: any) => void;
18
+ };
19
+ export { useDeptUsersSearchData };
@@ -0,0 +1,27 @@
1
+ import { CorpLabelTreeNode } from './buildCorpLabelTreeData';
2
+ export declare const resolveDockCorpBareId: (corpId: string | number | null | undefined) => string;
3
+ /** 裸 id → label_corp 树中的 dockcorp 节点(用于勾选对齐与预览补名)。 */
4
+ export declare const indexDockCorpTreeNodesByBare: (treeData?: CorpLabelTreeNode[]) => Map<string, CorpLabelTreeNode>;
5
+ /**
6
+ * 按裸 id 把已选 dockcorp _id 对齐到 label_corp 树节点真实 _id。
7
+ * 解决 corp_id_list 与树节点 _host/_guest 形态不一致导致的不勾选。
8
+ */
9
+ export declare const alignDockCorpSelectedKeys: (selectedIds: Array<string | number>, treeData?: CorpLabelTreeNode[]) => Array<string | number>;
10
+ type SelectorLikeItem = {
11
+ _id?: string | number;
12
+ id?: string | number;
13
+ type?: string;
14
+ name?: string;
15
+ nickname?: string;
16
+ dock_corpname?: string;
17
+ [key: string]: unknown;
18
+ };
19
+ /**
20
+ * 用 label_corp 树回填已选 dockcorp:补 name、对齐 _id;不在树中的项视为已删除/不可用并剔除。
21
+ * 对齐旧版 memberSelect:预览名来自树/corpMap,失效企业不展示(或标 deleted)。
22
+ */
23
+ export declare const reconcileDockCorpSelectionWithTree: <T extends SelectorLikeItem>(items?: T[], treeData?: CorpLabelTreeNode[]) => {
24
+ nextItems: T[];
25
+ changed: boolean;
26
+ };
27
+ export {};
@@ -1,6 +1,8 @@
1
1
  type CorpLabelSourceItem = {
2
2
  _id?: string | number;
3
3
  name?: string;
4
+ /** label_corp 接口 dockcorp 节点可能带企业展示名 */
5
+ dock_corpname?: string;
4
6
  type?: string;
5
7
  departmentId?: string | number;
6
8
  parentId?: string | number;
@@ -2,7 +2,7 @@ import { CorpLabelTreeNode } from './buildCorpLabelTreeData';
2
2
  export declare const useCorpLabelTreePanelData: () => {
3
3
  treeData: CorpLabelTreeNode[];
4
4
  loading: boolean;
5
- selectedCorpIds: any[];
5
+ selectedCorpIds: (string | number)[];
6
6
  selectionExpandKeys: (string | number)[];
7
7
  containerHeight: number;
8
8
  isSingleSelect: boolean | undefined;
@@ -1,3 +1,4 @@
1
+ import { InternalRolePickNode, RoleSourceItem } from '../../../utils/deptUsersRoleModel';
1
2
  import { TreeNodeDefine } from '@baishuyun/ui-base/components/Tree';
2
3
  type RoleEntryKey = 'internal' | 'external';
3
4
  type MenuItem = {
@@ -15,21 +16,6 @@ type DeptUsersRoleSelectionItem = {
15
16
  type DeptUsersRoleOptionItem = DeptUsersRoleSelectionItem & {
16
17
  label: string;
17
18
  };
18
- type RoleSourceItem = {
19
- _id: string;
20
- role_id: string | number;
21
- name: string;
22
- type?: string | number;
23
- parent?: string | number;
24
- children?: RoleSourceItem[];
25
- };
26
- /**
27
- * roleChildEnable:true 用的可勾选树节点:分组 checkable:false(点击仅展开),叶子 checkable:true。
28
- */
29
- type InternalRolePickNode = RoleSourceItem & {
30
- checkable: boolean;
31
- children?: InternalRolePickNode[];
32
- };
33
19
  declare const useDeptUsersRolePanelData: () => {
34
20
  containerHeight: number;
35
21
  menuItems: MenuItem[];
@@ -0,0 +1,40 @@
1
+ import { MemberPanelRequestGuard, SelectorType } from '../../../types/selector';
2
+ export type MemberPagedListParams = {
3
+ /** 与父组件 key 对齐;同实例内变化时走 ahooks reload(测试 harness) */
4
+ memberQueryKey: string;
5
+ type: SelectorType;
6
+ activeKey: string;
7
+ selectKey: string | symbol;
8
+ uniqueAllKey: symbol;
9
+ externalActiveTab: string;
10
+ currentCorpId?: string;
11
+ requestContext: any;
12
+ limits: any;
13
+ memberSearchLimit: any;
14
+ isMemberLimitMode: boolean;
15
+ shouldUsePagedMembers: boolean;
16
+ isInternalDisabled: boolean;
17
+ isDockDisabled: boolean;
18
+ memberPanelRequestGuard: MemberPanelRequestGuard;
19
+ excludedMemberIdSet?: ReadonlySet<string>;
20
+ currentUsers?: any;
21
+ onUsersFirstPage?: (usersLen: number) => void;
22
+ onMemberLimitResult?: (result: {
23
+ users?: any[];
24
+ dock_user_list?: any[];
25
+ mappedRoles?: any[];
26
+ mappedDockRoles?: any[];
27
+ }) => void;
28
+ };
29
+ /**
30
+ * 成员第三栏分页列表。须由父组件用 key={memberQueryKey} 挂载,
31
+ * 以便 Tab/筛选切换时卸载重建,避免 ahooks useInfiniteScroll 跨 query 复用 finalData。
32
+ */
33
+ declare const useMemberPagedList: (params: MemberPagedListParams) => {
34
+ userList: any[];
35
+ scrollRef: import('react').RefObject<HTMLDivElement>;
36
+ memberLoading: boolean;
37
+ memberLoadingMore: boolean;
38
+ memberData: any;
39
+ };
40
+ export { useMemberPagedList };
@@ -3,7 +3,11 @@ type MenuItem = {
3
3
  label: string;
4
4
  visible: boolean;
5
5
  };
6
- declare const useMemberPanelData: () => {
6
+ /**
7
+ * 成员面板壳层:侧栏、部门树、activeKey。
8
+ * 第三栏分页列表由 useMemberPagedList 承担,UI 侧须用 key={memberQueryKey} 挂载以重置 ahooks 状态。
9
+ */
10
+ declare const useMemberPanelShell: () => {
7
11
  containerHeight: number;
8
12
  menuItems: MenuItem[];
9
13
  activeKey: string;
@@ -18,12 +22,93 @@ declare const useMemberPanelData: () => {
18
22
  external: any[];
19
23
  };
20
24
  currentTreeData: any[];
25
+ loading: boolean;
26
+ showUnavailableOverlay: boolean;
27
+ showTree: boolean;
28
+ memberQueryKey: string;
29
+ pagedListParams: {
30
+ memberQueryKey: string;
31
+ type: import('../../../types/selector').SelectorType;
32
+ activeKey: string;
33
+ selectKey: string | symbol;
34
+ uniqueAllKey: symbol;
35
+ externalActiveTab: string;
36
+ currentCorpId: string | undefined;
37
+ requestContext: import('../../../types/selector').RequestContext;
38
+ limits: import('../../../types/selector').SelectorLimits;
39
+ memberSearchLimit: import('../../../types/selector').MemberSearchLimit | undefined;
40
+ isMemberLimitMode: boolean;
41
+ shouldUsePagedMembers: boolean;
42
+ isInternalDisabled: boolean;
43
+ isDockDisabled: boolean;
44
+ memberPanelRequestGuard: import('../../../types/selector').MemberPanelRequestGuard;
45
+ excludedMemberIdSet: ReadonlySet<string> | undefined;
46
+ currentUsers: Record<string, unknown>[] | undefined;
47
+ onUsersFirstPage: (usersLen: number) => void;
48
+ onMemberLimitResult: (result: {
49
+ users?: any[];
50
+ dock_user_list?: any[];
51
+ mappedRoles?: any[];
52
+ mappedDockRoles?: any[];
53
+ }) => void;
54
+ };
55
+ shouldUsePagedMembers: boolean;
56
+ isMemberLimitMode: boolean;
57
+ };
58
+ /**
59
+ * 测试 / 兼容入口:壳层 + 分页列表同实例组合。
60
+ * 生产 UI 请用 useMemberPanelShell + key={memberQueryKey} 的列表子组件,避免跨 Tab 复用 ahooks finalData。
61
+ */
62
+ declare const useMemberPanelData: () => {
21
63
  userList: any[];
22
64
  scrollRef: import('react').RefObject<HTMLDivElement>;
23
- loading: boolean;
24
65
  memberLoading: boolean;
25
66
  memberLoadingMore: boolean;
67
+ containerHeight: number;
68
+ menuItems: MenuItem[];
69
+ activeKey: string;
70
+ setActiveKey: (nextKey: string) => void;
71
+ selectKey: string | symbol;
72
+ setSelectKey: import('react').Dispatch<import('react').SetStateAction<string | symbol>>;
73
+ uniqueAllKey: symbol;
74
+ externalActiveTab: string;
75
+ handleExternalActiveTabChange: (tab: string) => void;
76
+ treeData: {
77
+ internal: any[];
78
+ external: any[];
79
+ };
80
+ currentTreeData: any[];
81
+ loading: boolean;
26
82
  showUnavailableOverlay: boolean;
27
83
  showTree: boolean;
84
+ memberQueryKey: string;
85
+ pagedListParams: {
86
+ memberQueryKey: string;
87
+ type: import('../../../types/selector').SelectorType;
88
+ activeKey: string;
89
+ selectKey: string | symbol;
90
+ uniqueAllKey: symbol;
91
+ externalActiveTab: string;
92
+ currentCorpId: string | undefined;
93
+ requestContext: import('../../../types/selector').RequestContext;
94
+ limits: import('../../../types/selector').SelectorLimits;
95
+ memberSearchLimit: import('../../../types/selector').MemberSearchLimit | undefined;
96
+ isMemberLimitMode: boolean;
97
+ shouldUsePagedMembers: boolean;
98
+ isInternalDisabled: boolean;
99
+ isDockDisabled: boolean;
100
+ memberPanelRequestGuard: import('../../../types/selector').MemberPanelRequestGuard;
101
+ excludedMemberIdSet: ReadonlySet<string> | undefined;
102
+ currentUsers: Record<string, unknown>[] | undefined;
103
+ onUsersFirstPage: (usersLen: number) => void;
104
+ onMemberLimitResult: (result: {
105
+ users?: any[];
106
+ dock_user_list?: any[];
107
+ mappedRoles?: any[];
108
+ mappedDockRoles?: any[];
109
+ }) => void;
110
+ };
111
+ shouldUsePagedMembers: boolean;
112
+ isMemberLimitMode: boolean;
28
113
  };
29
- export { useMemberPanelData };
114
+ export { useMemberPanelData, useMemberPanelShell };
@@ -212,13 +212,12 @@ type EntitySelectorProps = {
212
212
  */
213
213
  flowCreator?: FlowCreator;
214
214
  /**
215
- * @description true 时,在所有成员列表面板中隐藏「当前用户」:
216
- * - 隐藏成员 Tab 中的「当前用户」子 Tab(覆盖 limit.creator 打开的情况)
217
- * - 从成员、角色、职位、外部联系人、对接人、搜索结果等成员列表中过滤掉当前登录用户
218
- * 仅作用于成员列表,不影响部门实体(「我所在部门」Tab)与流程发起人。
219
- * @default false
215
+ * @description 成员黑名单 id 列表。仅 type === 'deptusers' 生效。
216
+ * 列表项的 `_id` / `id` / `dock_userid` 任一命中则不展示。
217
+ * 只过滤成员浏览/搜索列表,不隐藏 Tab,不影响已选回显与部门/职位/角色/企业等非成员实体。
218
+ * @default []
220
219
  */
221
- noUserMe?: boolean;
220
+ excludedMemberIds?: string[];
222
221
  };
223
222
  /**
224
223
  * @description transfer 模式流程发起人,由调用方传入的固定结构。
@@ -1,19 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ENTITY_ITEM_TYPE } from './entityItemType';
3
3
  import { RequestContext } from '../types/selector';
4
- type CorpDeptSearchVariant = 'department' | 'member';
5
- type DepartmentCorpDeptSearchGroup = {
6
- title: string;
7
- _id: string;
8
- children: Array<{
9
- _id: string | number;
10
- name: string;
11
- type: typeof ENTITY_ITEM_TYPE.USER;
12
- owner_corpid: string;
13
- title: ReactNode;
14
- }>;
15
- };
16
- type MemberCorpDeptSearchGroup = {
4
+ type CorpDeptSearchGroup = {
17
5
  title: string;
18
6
  value: string;
19
7
  children: Array<{
@@ -30,15 +18,14 @@ type MemberCorpDeptSearchGroup = {
30
18
  * 忽略 users,将 dock_user_list 各分组 userList 合并为对接人结果。
31
19
  * owner_corpid 取值:API 返回优先,否则回退分组 dockCorpid。
32
20
  */
33
- declare function useDeptUsersCorpDeptSearchGroup<V extends CorpDeptSearchVariant>({ enabled, variant, requestContext, hasDock, wd, groupTitle, }: {
21
+ declare function useDeptUsersCorpDeptSearchGroup({ enabled, requestContext, hasDock, wd, groupTitle, }: {
34
22
  enabled: boolean;
35
- variant: V;
36
23
  requestContext: RequestContext;
37
24
  hasDock?: boolean;
38
25
  wd?: string;
39
26
  groupTitle: string;
40
27
  }): {
41
- searchGroup: V extends 'department' ? DepartmentCorpDeptSearchGroup | null : MemberCorpDeptSearchGroup | null;
28
+ searchGroup: CorpDeptSearchGroup | null;
42
29
  loading: boolean;
43
30
  };
44
31
  export { useDeptUsersCorpDeptSearchGroup };
@@ -1,32 +1,23 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ENTITY_ITEM_TYPE } from './entityItemType';
3
- type CorpSearchVariant = 'department' | 'member';
4
- type CorpSearchTreeChild = {
5
- _id: string;
6
- name: string;
7
- type: typeof ENTITY_ITEM_TYPE.DOCKCORP;
8
- disabled?: boolean;
9
- title: ReactNode;
10
- };
11
- type DepartmentCorpSearchGroup = {
12
- title: string;
13
- _id: string;
14
- children: CorpSearchTreeChild[];
15
- };
16
- type MemberCorpSearchGroup = {
3
+ type CorpSearchGroup = {
17
4
  title: string;
18
5
  value: string;
19
- children: Array<CorpSearchTreeChild & {
6
+ children: Array<{
7
+ _id: string;
20
8
  value: string;
9
+ name: string;
10
+ type: typeof ENTITY_ITEM_TYPE.DOCKCORP;
11
+ disabled?: boolean;
12
+ title: ReactNode;
21
13
  }>;
22
14
  };
23
- declare function useDeptUsersCorpSearchGroup<V extends CorpSearchVariant>({ enabled, variant, wd, groupTitle, }: {
15
+ declare function useDeptUsersCorpSearchGroup({ enabled, wd, groupTitle, }: {
24
16
  enabled: boolean;
25
- variant: V;
26
17
  wd?: string;
27
18
  groupTitle: string;
28
19
  }): {
29
- searchGroup: V extends 'department' ? DepartmentCorpSearchGroup | null : MemberCorpSearchGroup | null;
20
+ searchGroup: CorpSearchGroup | null;
30
21
  loading: boolean;
31
22
  };
32
23
  export { useDeptUsersCorpSearchGroup };
@@ -1,4 +1,16 @@
1
1
  declare const DEPT_USERS_CORPS_CACHE_KEY = "deptUsersCorps";
2
2
  declare const DEPT_USERS_CORP_LABEL_TREE_CACHE_KEY = "deptUsersCorpLabelTree";
3
3
  declare const DEPT_USERS_CORP_DEPT_TREE_CACHE_KEY = "deptUsersCorpDeptTree";
4
- export { DEPT_USERS_CORPS_CACHE_KEY, DEPT_USERS_CORP_LABEL_TREE_CACHE_KEY, DEPT_USERS_CORP_DEPT_TREE_CACHE_KEY, };
4
+ /** 关系列表本地搜索与面板共用,避免反复全量拉取 */
5
+ declare const DEPT_USERS_RELATIONS_CACHE_KEY = "deptUsersRelations";
6
+ /** 角色叶子列表本地搜索缓存 */
7
+ declare const DEPT_USERS_ROLE_LEAVES_CACHE_KEY = "deptUsersRoleLeaves";
8
+ /** 组织架构内部组织:面板预拉与本地搜索共用 */
9
+ declare const DEPT_USERS_ORG_INTERNAL_CACHE_KEY = "deptUsersOrgInternal";
10
+ /** 组织架构外部组织:面板预拉与本地搜索共用 */
11
+ declare const DEPT_USERS_ORG_EXTERNAL_CACHE_KEY = "deptUsersOrgExternal";
12
+ declare const buildDeptUsersOrgCacheKey: (baseKey: string, requestContext?: {
13
+ appId?: string;
14
+ entryId?: string;
15
+ }, dockEnabled?: boolean) => string;
16
+ export { DEPT_USERS_CORPS_CACHE_KEY, DEPT_USERS_CORP_LABEL_TREE_CACHE_KEY, DEPT_USERS_CORP_DEPT_TREE_CACHE_KEY, DEPT_USERS_RELATIONS_CACHE_KEY, DEPT_USERS_ROLE_LEAVES_CACHE_KEY, DEPT_USERS_ORG_INTERNAL_CACHE_KEY, DEPT_USERS_ORG_EXTERNAL_CACHE_KEY, buildDeptUsersOrgCacheKey, };
@@ -1,17 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ENTITY_ITEM_TYPE } from './entityItemType';
3
- type EnterpriseLabelSearchVariant = 'department' | 'member';
4
- type DepartmentEnterpriseLabelSearchGroup = {
5
- title: string;
6
- _id: string;
7
- children: Array<{
8
- _id: string;
9
- name: string;
10
- type: typeof ENTITY_ITEM_TYPE.LABEL;
11
- title: ReactNode;
12
- }>;
13
- };
14
- type MemberEnterpriseLabelSearchGroup = {
3
+ type EnterpriseLabelSearchGroup = {
15
4
  title: string;
16
5
  value: string;
17
6
  children: Array<{
@@ -22,13 +11,12 @@ type MemberEnterpriseLabelSearchGroup = {
22
11
  title: ReactNode;
23
12
  }>;
24
13
  };
25
- declare function useDeptUsersEnterpriseLabelSearchGroup<V extends EnterpriseLabelSearchVariant>({ enabled, variant, wd, groupTitle, }: {
14
+ declare function useDeptUsersEnterpriseLabelSearchGroup({ enabled, wd, groupTitle, }: {
26
15
  enabled: boolean;
27
- variant: V;
28
16
  wd?: string;
29
17
  groupTitle: string;
30
18
  }): {
31
- searchGroup: V extends 'department' ? DepartmentEnterpriseLabelSearchGroup | null : MemberEnterpriseLabelSearchGroup | null;
19
+ searchGroup: EnterpriseLabelSearchGroup | null;
32
20
  loading: boolean;
33
21
  };
34
22
  export { useDeptUsersEnterpriseLabelSearchGroup };
@@ -0,0 +1,30 @@
1
+ type DeptUsersOrgDockReadiness = {
2
+ isDockDisabled: boolean;
3
+ isInternalDisabled: boolean;
4
+ readyInternal: boolean;
5
+ readyExternal: boolean;
6
+ dockEnabled: boolean;
7
+ };
8
+ type DeptUsersOrgCounts = {
9
+ departmentsCount: number;
10
+ labelCorpCount: number;
11
+ };
12
+ type DeptUsersOrgPayload = {
13
+ departments_count?: number;
14
+ label_corp_count?: number;
15
+ departments?: unknown[];
16
+ label_corp_list?: unknown[];
17
+ };
18
+ /**
19
+ * 配置层预拉/请求门控:hasDeptDock 优先于 hasDock:false。
20
+ * readyGate 为 false 时两侧都不请求(如搜索未启用)。
21
+ */
22
+ declare const resolveDeptUsersOrgDockReadiness: ({ hasDock, hasDeptDock, readyGate, }: {
23
+ hasDock?: boolean;
24
+ hasDeptDock?: boolean;
25
+ readyGate?: boolean;
26
+ }) => DeptUsersOrgDockReadiness;
27
+ /** 双路响应 count 交叉兜底:内部优先 departments_count,外部优先 label_corp_count。 */
28
+ declare const mergeDeptUsersOrgCounts: (internal?: DeptUsersOrgPayload | null, external?: DeptUsersOrgPayload | null) => DeptUsersOrgCounts;
29
+ export { resolveDeptUsersOrgDockReadiness, mergeDeptUsersOrgCounts };
30
+ export type { DeptUsersOrgDockReadiness, DeptUsersOrgCounts, DeptUsersOrgPayload };
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from 'react';
2
+ type OrganizationSearchChild = {
3
+ _id: string | number;
4
+ value: string | number;
5
+ name: string;
6
+ type?: string;
7
+ title: ReactNode;
8
+ [key: string]: unknown;
9
+ };
10
+ type OrganizationSearchGroup = {
11
+ title: string;
12
+ value: string;
13
+ children: OrganizationSearchChild[];
14
+ };
15
+ /** deptusers 组织架构本地搜索;与面板共用 department/list 预拉缓存。 */
16
+ declare const useDeptUsersOrganizationSearchGroup: ({ enabled, wd, groupTitle, externalLabel, }: {
17
+ enabled: boolean;
18
+ wd?: string;
19
+ groupTitle: string;
20
+ externalLabel: string;
21
+ }) => {
22
+ searchGroup: OrganizationSearchGroup | null;
23
+ loading: boolean;
24
+ };
25
+ export { useDeptUsersOrganizationSearchGroup };
@@ -1,18 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ENTITY_ITEM_TYPE } from './entityItemType';
3
3
  import { RequestContext } from '../types/selector';
4
- type RelationSearchVariant = 'department' | 'member';
5
- type DepartmentRelationSearchGroup = {
6
- title: string;
7
- _id: string;
8
- children: Array<{
9
- _id: string;
10
- name: string;
11
- type: typeof ENTITY_ITEM_TYPE.RELATION;
12
- title: ReactNode;
13
- }>;
14
- };
15
- type MemberRelationSearchGroup = {
4
+ type RelationSearchGroup = {
16
5
  title: string;
17
6
  value: string;
18
7
  children: Array<{
@@ -23,15 +12,14 @@ type MemberRelationSearchGroup = {
23
12
  title: ReactNode;
24
13
  }>;
25
14
  };
26
- declare function useDeptUsersRelationSearchGroup<V extends RelationSearchVariant>({ enabled, variant, requestContext, wd, groupTitle, }: {
15
+ declare function useDeptUsersRelationSearchGroup({ enabled, requestContext, wd, groupTitle, }: {
27
16
  enabled: boolean;
28
- variant: V;
29
17
  requestContext: RequestContext;
30
18
  wd?: string;
31
19
  groupTitle: string;
32
20
  }): {
33
- searchGroup: V extends 'department' ? DepartmentRelationSearchGroup | null : MemberRelationSearchGroup | null;
21
+ searchGroup: RelationSearchGroup | null;
34
22
  loading: boolean;
35
23
  };
36
24
  export { useDeptUsersRelationSearchGroup };
37
- export type { RelationSearchVariant, DepartmentRelationSearchGroup, MemberRelationSearchGroup };
25
+ export type { RelationSearchGroup };
@@ -0,0 +1,43 @@
1
+ type RoleSourceItem = {
2
+ _id: string;
3
+ role_id: string | number;
4
+ name: string;
5
+ type?: string | number;
6
+ parent?: string | number;
7
+ children?: RoleSourceItem[];
8
+ };
9
+ /** roleChildEnable:true 用的可勾选树节点:分组 checkable:false,叶子 checkable:true。 */
10
+ type InternalRolePickNode = RoleSourceItem & {
11
+ checkable: boolean;
12
+ children?: InternalRolePickNode[];
13
+ };
14
+ type RoleLeafSelection = {
15
+ _id: string;
16
+ name: string;
17
+ type: 'role';
18
+ role_id?: string | number;
19
+ };
20
+ type RoleGroupScopeSelection = {
21
+ _id: string;
22
+ name: string;
23
+ type: 'rolegroup';
24
+ };
25
+ declare const ROLE_GROUP_SCOPE_SUFFIX = "-roleGroup";
26
+ declare const ROLE_GROUP_SUB_SCOPE_SUFFIX = "-roleGroupSub";
27
+ declare const toStoredId: (role: Pick<RoleSourceItem, "_id">) => string;
28
+ declare const isRoleGroupNode: (role?: RoleSourceItem | null) => boolean;
29
+ declare const normalizeRole: (role: RoleSourceItem) => RoleSourceItem;
30
+ declare const toRoleGroupScopeId: (storedId: string) => string;
31
+ declare const toRoleGroupSubScopeId: (storedId: string) => string;
32
+ declare const toRoleLeafSelection: (role: RoleSourceItem) => RoleLeafSelection;
33
+ declare const toRoleGroupCurrentScopeSelection: (role: RoleSourceItem) => RoleGroupScopeSelection;
34
+ declare const toRoleGroupSubScopeSelection: (role: RoleSourceItem) => RoleGroupScopeSelection;
35
+ /** 展平内部角色树:叶子 + 分组(不含「及子分组」范围 option)。 */
36
+ declare const collectSearchableRoles: (nodes: RoleSourceItem[]) => RoleSourceItem[];
37
+ declare const findRoleByStoredId: (roles: RoleSourceItem[], id?: string) => RoleSourceItem | undefined;
38
+ declare const markInternalRolePickTree: (nodes: RoleSourceItem[]) => InternalRolePickNode[];
39
+ declare const toRoleSearchSelection: (item: RoleSourceItem) => (RoleLeafSelection | RoleGroupScopeSelection) & {
40
+ value: string;
41
+ };
42
+ export { ROLE_GROUP_SCOPE_SUFFIX, ROLE_GROUP_SUB_SCOPE_SUFFIX, collectSearchableRoles, findRoleByStoredId, isRoleGroupNode, markInternalRolePickTree, normalizeRole, toRoleGroupCurrentScopeSelection, toRoleGroupScopeId, toRoleGroupSubScopeId, toRoleGroupSubScopeSelection, toRoleLeafSelection, toRoleSearchSelection, toStoredId, };
43
+ export type { InternalRolePickNode, RoleGroupScopeSelection, RoleLeafSelection, RoleSourceItem };