@baishuyun/ui-business 6.0.6 → 6.1.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.
- package/dist/BubbleChart/{AutoGridEChart-xO0UCKcb.js → AutoGridEChart-CJVgpqeo.js} +34 -28
- package/dist/BubbleChart/{BubbleChart-BFdGfB9S.js → BubbleChart-CavI9Qnb.js} +1 -1
- package/dist/BubbleChart/index.js +2 -2
- package/dist/DeptsMemberSelector/Department-lQJcetBA.js +267 -0
- package/dist/DeptsMemberSelector/DeptsMemberSelector-DmwD1Ls_.js +1336 -0
- package/dist/DeptsMemberSelector/DeptsUser-wWfkuBDp.js +974 -0
- package/dist/DeptsMemberSelector/Member-K4kgwY7b.js +603 -0
- package/dist/DeptsMemberSelector/MemberPanel-Cm1Hv-GV.js +698 -0
- package/dist/DeptsMemberSelector/OrganizationPanel-2QDNfFtJ.js +401 -0
- package/dist/DeptsMemberSelector/RelationShipList-DkF9XivU.js +75 -0
- package/dist/DeptsMemberSelector/index.js +12 -14
- package/dist/DeptsMemberSelector/services/contact/selector.service-BUQcY5DZ.js +380 -0
- package/dist/DeptsMemberSelector/subcomponents/Entity/Department/index.js +4 -5
- package/dist/DeptsMemberSelector/subcomponents/Entity/DeptsUser/index.js +6 -8
- package/dist/DeptsMemberSelector/subcomponents/Entity/Member/index.js +4 -5
- package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +2 -2
- package/dist/DeptsMemberSelector/useDeptsMemberSelector-CHK0U3R4.js +155 -0
- package/dist/DeptsMemberSelector/useOutsiderGroupPanelState-d2EiLVaV.js +648 -0
- package/dist/DeptsMemberSelector/utils/index.js +2 -87
- package/dist/DeptsMemberSelector/utils-BVfGpRu5.js +103 -0
- package/dist/Scatterplot/{Scatterplot-B7bP08oE.js → Scatterplot-D4GhWpFa.js} +1 -1
- package/dist/Scatterplot/index.js +2 -2
- package/dist/components/DeptsMemberSelector/context/DeptsMemberContext.d.ts +17 -1
- package/dist/components/DeptsMemberSelector/hooks/useDeptsMemberSelector.d.ts +5 -0
- package/dist/components/DeptsMemberSelector/hooks/useOutsiderGroupPanelState.d.ts +19 -0
- package/dist/components/DeptsMemberSelector/hooks/useSlidingTabIndicator.d.ts +29 -0
- package/dist/components/DeptsMemberSelector/index.d.ts +2 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Entity/Member/MemberSearch/useMemberSearchData.d.ts +2 -2
- package/dist/components/DeptsMemberSelector/subcomponents/Entity/Member/MemerList/MemberListCheckboxRow.d.ts +17 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersExtraContactPanel/useDeptUsersExtraContactPanelData.d.ts +11 -5
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersPositionPanel/useDeptUsersPositionPanelData.d.ts +5 -1
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersRolePanel/useDeptUsersRolePanelData.d.ts +2 -1
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/ExtraConcactPanel/useExtraContactPanelData.d.ts +8 -10
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/ExtraContactGroupPanel/ExtraContactGroupPanel.d.ts +2 -2
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/FlowCreatorPanel/FlowCreatorPanel.d.ts +2 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/ExternalMember/ExternalMember.d.ts +2 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/asideFallback.d.ts +26 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/resolveMemberPanelShowSidebar.d.ts +13 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/useMemberPanelData.d.ts +6 -1
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +4 -12
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/types.d.ts +1 -13
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/useMemberRelationShipPanelData.d.ts +7 -36
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/OrganizationPanel/ExternalOrganization/ExternalOrganization.d.ts +2 -1
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/OrganizationPanel/InternalOrganization/InternalOrganization.d.ts +2 -1
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/OrganizationPanel/utils/treeExpandedKeys.d.ts +23 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/OrganizationPanel/utils/useOrganizationTreeExpandedKeys.d.ts +9 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/PositionPanel/usePositionPanelData.d.ts +5 -0
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/RolePanel/useRolePanelData.d.ts +1 -1
- package/dist/components/DeptsMemberSelector/subcomponents/SelectedItemIcon/SelectedItemIcon.d.ts +8 -0
- package/dist/components/DeptsMemberSelector/subcomponents/SelectionTabs/SelectionTabList/SelectionTabList.d.ts +4 -0
- package/dist/components/DeptsMemberSelector/subcomponents/SelectionTabs/useSelectorType.d.ts +1 -0
- package/dist/components/DeptsMemberSelector/subcomponents/SlidingTabIndicatorBar/SlidingTabIndicatorBar.d.ts +10 -0
- package/dist/components/DeptsMemberSelector/subcomponents/TagIcon/TagIcon.d.ts +9 -3
- package/dist/components/DeptsMemberSelector/types/selector.d.ts +90 -3
- package/dist/components/DeptsMemberSelector/utils/constants.d.ts +27 -0
- package/dist/components/DeptsMemberSelector/utils/currentUserDepts.d.ts +21 -0
- package/dist/components/DeptsMemberSelector/utils/departmentSearchVisibility.d.ts +9 -0
- package/dist/components/DeptsMemberSelector/utils/deptUsersRelationSearchGroup.d.ts +37 -0
- package/dist/components/DeptsMemberSelector/utils/deptUsersSearchVisibility.d.ts +30 -0
- package/dist/components/DeptsMemberSelector/utils/entityItemType.d.ts +32 -0
- package/dist/components/DeptsMemberSelector/utils/flowCreator.d.ts +8 -0
- package/dist/components/DeptsMemberSelector/utils/index.d.ts +10 -2
- package/dist/components/DeptsMemberSelector/utils/jobTitleDepartmentLimit.d.ts +3 -0
- package/dist/components/DeptsMemberSelector/utils/memberBadgeText.d.ts +20 -0
- package/dist/components/DeptsMemberSelector/utils/memberStatus.d.ts +4 -0
- package/dist/components/DeptsMemberSelector/utils/memberUsersDepartmentLimit.d.ts +7 -0
- package/dist/components/DeptsMemberSelector/utils/normalizeIdList.d.ts +2 -0
- package/dist/components/DeptsMemberSelector/utils/outsiderGroupBuckets.d.ts +18 -0
- package/dist/components/DeptsMemberSelector/utils/requestContext.d.ts +4 -2
- package/dist/components/DeptsMemberSelector/utils/resolveExternalMemberUserType.d.ts +6 -0
- package/dist/components/DeptsMemberSelector/utils/resolveOutsiderFlatMemberMode.d.ts +4 -0
- package/dist/components/DeptsMemberSelector/utils/resolveOutsiderGroupTabs.d.ts +21 -0
- package/dist/components/DeptsMemberSelector/utils/resolveSelectedItemVisual.d.ts +10 -0
- package/dist/components/DeptsMemberSelector/utils/widgetRequestLimits.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +51 -36
- package/dist/lang/en-US.json.d.ts +5 -3
- package/dist/lang/zh-CN.json.d.ts +5 -3
- package/dist/lang/zh-TW.json.d.ts +5 -3
- package/dist/services/contact/selector.service.d.ts +34 -12
- package/dist/vendors/lodash-es.js +689 -175
- package/dist/vendors/simplebar-react.js +2 -2
- package/package.json +3 -3
- package/dist/DeptsMemberSelector/Department-6R-BZNZ4.js +0 -252
- package/dist/DeptsMemberSelector/DeptsMemberSelector-CC32KXc8.js +0 -1064
- package/dist/DeptsMemberSelector/DeptsUser-9Lf7ytTr.js +0 -981
- package/dist/DeptsMemberSelector/Member-BY8mtQb0.js +0 -517
- package/dist/DeptsMemberSelector/MemberPanel-Dw1b2J3V.js +0 -510
- package/dist/DeptsMemberSelector/OrganizationPanel-Di4dqUlZ.js +0 -366
- package/dist/DeptsMemberSelector/RelationShipDepts-__eb4oDP.js +0 -55
- package/dist/DeptsMemberSelector/RelationShipList-CS5uhLos.js +0 -52
- package/dist/DeptsMemberSelector/TabGroup-Dht9ylk4.js +0 -114
- package/dist/DeptsMemberSelector/services/contact/selector.service-BFwBe9fo.js +0 -346
- package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +0 -4
- package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +0 -6
- package/dist/DeptsMemberSelector/useDeptsMemberSelector-B2Un1d5r.js +0 -123
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +0 -7
- package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipMember/RelationShipMember.d.ts +0 -9
- package/dist/vendors/useLocale.js +0 -209
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { t as e } from "../vendors/simplebar-react.js";
|
|
2
|
+
import { t } from "../vendors/clsx.js";
|
|
3
|
+
import { a as n, n as r } from "../vendors/lodash-es.js";
|
|
4
|
+
import { a as i, t as a } from "./useDeptsMemberSelector-CHK0U3R4.js";
|
|
5
|
+
import { f as o, t as s } from "./services/contact/selector.service-BUQcY5DZ.js";
|
|
6
|
+
import { c, f as l, i as u, l as d, n as f, p, r as m, u as h } from "./useOutsiderGroupPanelState-d2EiLVaV.js";
|
|
7
|
+
import { i as g, n as _, r as v } from "./utils-BVfGpRu5.js";
|
|
8
|
+
import { useCallback as y, useEffect as b, useMemo as x, useState as S } from "react";
|
|
9
|
+
import { Spin as C } from "antd";
|
|
10
|
+
import { Icon as w, Tree as T } from "@baishuyun/ui-base";
|
|
11
|
+
import { useRequest as E } from "ahooks";
|
|
12
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
13
|
+
//#region src/components/DeptsMemberSelector/subcomponents/Panels/OrganizationPanel/utils/departmentExpandState.ts
|
|
14
|
+
var k = {
|
|
15
|
+
INTERNAL: "internal",
|
|
16
|
+
EXTERNAL_DOCK_CORP: "external:dockcorp",
|
|
17
|
+
EXTERNAL_DOCK_DEPARTMENT: "external:dockcorpdept"
|
|
18
|
+
}, A = {
|
|
19
|
+
DOCK_PERSON_GROUP: "dockcorp",
|
|
20
|
+
DOCK_DEPARTMENT: "dockcorpdept"
|
|
21
|
+
}, j = {
|
|
22
|
+
[k.EXTERNAL_DOCK_CORP]: A.DOCK_PERSON_GROUP,
|
|
23
|
+
[k.EXTERNAL_DOCK_DEPARTMENT]: A.DOCK_DEPARTMENT
|
|
24
|
+
}, M = {
|
|
25
|
+
dockcorp: k.EXTERNAL_DOCK_CORP,
|
|
26
|
+
dockdept: k.EXTERNAL_DOCK_DEPARTMENT,
|
|
27
|
+
dockcorpdept: k.EXTERNAL_DOCK_DEPARTMENT
|
|
28
|
+
}, N = (e) => e ? j[e] : void 0, P = (e, t, n = []) => {
|
|
29
|
+
for (let r of e) {
|
|
30
|
+
let e = [...n, r._id];
|
|
31
|
+
if (r._id === t) return e;
|
|
32
|
+
if (r.children?.length) {
|
|
33
|
+
let n = P(r.children, t, e);
|
|
34
|
+
if (n) return n;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}, F = (e) => [M[e.type] ?? k.INTERNAL], I = (e) => r(e.flatMap((e) => e?._id ? F(e) : [])), L = (e) => {
|
|
39
|
+
let t = I(e);
|
|
40
|
+
return t.length === 1 ? t[0] : void 0;
|
|
41
|
+
}, R = ({ selectedDepartments: e, treesByView: t }) => {
|
|
42
|
+
let n = {}, i = /* @__PURE__ */ new Set(), a = I(e);
|
|
43
|
+
Object.keys(t).forEach((e) => {
|
|
44
|
+
n[e] = [];
|
|
45
|
+
}), e.forEach((e) => {
|
|
46
|
+
if (!e?._id) return;
|
|
47
|
+
let a = F(e);
|
|
48
|
+
for (let o of a) {
|
|
49
|
+
let a = t[o];
|
|
50
|
+
if (!a?.length) continue;
|
|
51
|
+
let s = P(a, e._id);
|
|
52
|
+
if (s) {
|
|
53
|
+
i.add(o), n[o] = r([...n[o], ...s.slice(0, -1)]);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
let o = [...i];
|
|
59
|
+
return {
|
|
60
|
+
preferredViewKey: a.length > 1 ? void 0 : o.length === 1 ? o[0] : void 0,
|
|
61
|
+
matchedViewKeys: o,
|
|
62
|
+
expandedKeysByView: n
|
|
63
|
+
};
|
|
64
|
+
}, z = ({ internalTreeData: e, externalDockCorpTreeData: t, externalDockDeptTreeData: n, selectedDepartments: r }) => x(() => {
|
|
65
|
+
let i = L(r), a = R({
|
|
66
|
+
selectedDepartments: r,
|
|
67
|
+
treesByView: {
|
|
68
|
+
[k.INTERNAL]: e,
|
|
69
|
+
[k.EXTERNAL_DOCK_CORP]: t,
|
|
70
|
+
[k.EXTERNAL_DOCK_DEPARTMENT]: n
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
...a,
|
|
75
|
+
preferredViewKeyFromSelection: i,
|
|
76
|
+
preferredExternalTab: N(a.preferredViewKey || i)
|
|
77
|
+
};
|
|
78
|
+
}, [
|
|
79
|
+
t,
|
|
80
|
+
n,
|
|
81
|
+
e,
|
|
82
|
+
r
|
|
83
|
+
]), B = (e, t) => {
|
|
84
|
+
let n = [];
|
|
85
|
+
for (let r of e) {
|
|
86
|
+
if (r.type === t) {
|
|
87
|
+
n.push({
|
|
88
|
+
...r,
|
|
89
|
+
children: t === "dockcorpdept" ? r.children : r.children?.length ? B(r.children, t) : void 0
|
|
90
|
+
});
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
let e = r.children?.length ? B(r.children, t) : [];
|
|
94
|
+
e.length > 0 && n.push({
|
|
95
|
+
...r,
|
|
96
|
+
children: e
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return n;
|
|
100
|
+
}, V = {
|
|
101
|
+
INTERNAL: 0,
|
|
102
|
+
EXTERNAL: 1
|
|
103
|
+
}, H = {
|
|
104
|
+
preferredViewKey: void 0,
|
|
105
|
+
preferredExternalTab: void 0,
|
|
106
|
+
matchedViewKeys: [],
|
|
107
|
+
expandedKeysByView: {
|
|
108
|
+
[k.INTERNAL]: [],
|
|
109
|
+
[k.EXTERNAL_DOCK_CORP]: [],
|
|
110
|
+
[k.EXTERNAL_DOCK_DEPARTMENT]: []
|
|
111
|
+
}
|
|
112
|
+
}, U = () => {
|
|
113
|
+
let { type: e, value: t = [], dispatch: r, requestContext: f, limits: C, departmentSelectableRange: w, departmentPanelRequestGuard: T, hasDock: O, hasDeptDock: k, isSingleSelect: j } = a(), { t: M } = l(), N = [p.DEPARMENT, p.DEPARMENT_GROUP].includes(e), P = e === p.DEPT_USERS && O === !1, F = e === p.DEPT_USERS && k === !0, [I, L] = S(F ? V.EXTERNAL : V.INTERNAL), R = I === V.EXTERNAL, { data: U, loading: W } = E(() => i(T, () => e === p.DEPT_USERS ? s({
|
|
114
|
+
requestContext: f,
|
|
115
|
+
hasDeptDock: R && !P || F || void 0,
|
|
116
|
+
hasDock: !P
|
|
117
|
+
}) : o({
|
|
118
|
+
requestContext: f,
|
|
119
|
+
limits: C,
|
|
120
|
+
departmentSelectableRange: w,
|
|
121
|
+
hasDeptDock: R || void 0
|
|
122
|
+
})), { refreshDeps: [
|
|
123
|
+
R,
|
|
124
|
+
e,
|
|
125
|
+
f,
|
|
126
|
+
C,
|
|
127
|
+
w,
|
|
128
|
+
T
|
|
129
|
+
] }), G = x(() => {
|
|
130
|
+
let e = m(U?.departments || []);
|
|
131
|
+
return n(e) ? [] : _(e);
|
|
132
|
+
}, [U]), K = (U?.departments_count || 0) > 0, q = (U?.label_corp_count || 0) > 0, J = x(() => [{
|
|
133
|
+
key: V.INTERNAL,
|
|
134
|
+
label: M("department.internal"),
|
|
135
|
+
visible: !F && K
|
|
136
|
+
}, {
|
|
137
|
+
key: V.EXTERNAL,
|
|
138
|
+
label: M("department.external"),
|
|
139
|
+
visible: !P && q
|
|
140
|
+
}], [
|
|
141
|
+
M,
|
|
142
|
+
P,
|
|
143
|
+
F,
|
|
144
|
+
K,
|
|
145
|
+
q
|
|
146
|
+
]);
|
|
147
|
+
b(() => {
|
|
148
|
+
!W && !F && !K && I === V.INTERNAL && L(V.EXTERNAL);
|
|
149
|
+
}, [
|
|
150
|
+
K,
|
|
151
|
+
I,
|
|
152
|
+
F,
|
|
153
|
+
W
|
|
154
|
+
]);
|
|
155
|
+
let Y = x(() => {
|
|
156
|
+
let e = m(U?.label_corp_list || []);
|
|
157
|
+
if (n(e)) return [];
|
|
158
|
+
let t = e.filter((t) => u(t) ? t.type === "dockcorp" || t.type === "dockdept" ? !0 : t.parentId === 0 ? !1 : e.some((e) => e.parentId === t.departmentId) : !1).map((e) => ({
|
|
159
|
+
...e,
|
|
160
|
+
checkable: e.type !== "dockcorpdept" && e.type !== "label",
|
|
161
|
+
icon: /* @__PURE__ */ D(c, {
|
|
162
|
+
type: e.type,
|
|
163
|
+
size: 16
|
|
164
|
+
})
|
|
165
|
+
}));
|
|
166
|
+
return t.length > 0 ? v(t, {
|
|
167
|
+
parentId: "parentId",
|
|
168
|
+
children: "children",
|
|
169
|
+
value: "departmentId",
|
|
170
|
+
title: "name"
|
|
171
|
+
}) : [];
|
|
172
|
+
}, [U]), X = x(() => B(Y, A.DOCK_PERSON_GROUP), [Y]), Z = x(() => B(Y, A.DOCK_DEPARTMENT), [Y]), Q = x(() => ({
|
|
173
|
+
internal: G,
|
|
174
|
+
external: Y
|
|
175
|
+
}), [Y, G]), $ = z({
|
|
176
|
+
internalTreeData: G,
|
|
177
|
+
externalDockCorpTreeData: X,
|
|
178
|
+
externalDockDeptTreeData: Z,
|
|
179
|
+
selectedDepartments: N ? t : []
|
|
180
|
+
}), ee = y((t, n) => {
|
|
181
|
+
if (p.DEPARMENT === e || j) {
|
|
182
|
+
let e = R ? U?.label_corp_list : U?.departments;
|
|
183
|
+
if (!e) return;
|
|
184
|
+
let n = e.find((e) => e._id === t && u(e));
|
|
185
|
+
n && r({
|
|
186
|
+
type: "insertOnly",
|
|
187
|
+
payload: h({
|
|
188
|
+
...n,
|
|
189
|
+
type: n.type || d.DEPARTMENTS
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
r({
|
|
195
|
+
type: "addOne",
|
|
196
|
+
payload: h({
|
|
197
|
+
...n,
|
|
198
|
+
type: n.type || d.DEPARTMENTS
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
}, [
|
|
202
|
+
U,
|
|
203
|
+
r,
|
|
204
|
+
R,
|
|
205
|
+
e,
|
|
206
|
+
j
|
|
207
|
+
]), te = y((e) => {
|
|
208
|
+
let t = g(e, I === V.INTERNAL ? Q.internal : Q.external, {
|
|
209
|
+
children: "children",
|
|
210
|
+
value: "_id"
|
|
211
|
+
});
|
|
212
|
+
t && r({
|
|
213
|
+
type: "deleteOne",
|
|
214
|
+
payload: t._id
|
|
215
|
+
});
|
|
216
|
+
}, [
|
|
217
|
+
I,
|
|
218
|
+
r,
|
|
219
|
+
Q
|
|
220
|
+
]);
|
|
221
|
+
return {
|
|
222
|
+
activeKey: I,
|
|
223
|
+
setActiveKey: L,
|
|
224
|
+
menuItems: J,
|
|
225
|
+
treeData: Q,
|
|
226
|
+
currentTreeData: R ? Q.external : Q.internal,
|
|
227
|
+
loading: W,
|
|
228
|
+
showMenu: q,
|
|
229
|
+
handleSelect: ee,
|
|
230
|
+
handleDeselect: te,
|
|
231
|
+
isBorderless: !q,
|
|
232
|
+
menuType: V,
|
|
233
|
+
expandState: N ? $ : H,
|
|
234
|
+
preferredExternalTab: N ? $.preferredExternalTab : void 0
|
|
235
|
+
};
|
|
236
|
+
}, W = (e, t) => t === "none" || e.length === 0 ? [] : t === "single-root-only" ? e.length === 1 ? [e[0]._id] : [] : e.map((e) => e._id), G = (e, t) => {
|
|
237
|
+
let n = W(e, t.baselineMode), i = t.selectionExpandKeys ?? [];
|
|
238
|
+
return r([...n, ...i]);
|
|
239
|
+
}, K = (e) => {
|
|
240
|
+
let [t, n] = S(null);
|
|
241
|
+
return b(() => {
|
|
242
|
+
n(null);
|
|
243
|
+
}, [e]), {
|
|
244
|
+
expandedKeys: t ?? e,
|
|
245
|
+
onExpand: n
|
|
246
|
+
};
|
|
247
|
+
}, q = (n) => {
|
|
248
|
+
let { type: r, containerHeight: i, value: o, isSingleSelect: s } = a(), { t: c } = l(), u = o?.map((e) => e._id) || [], { expandedKeys: d, onExpand: f } = K(x(() => G(n.data, {
|
|
249
|
+
baselineMode: "all-roots",
|
|
250
|
+
selectionExpandKeys: n.selectionExpandKeys
|
|
251
|
+
}), [n.data, n.selectionExpandKeys]));
|
|
252
|
+
return /* @__PURE__ */ O(e, {
|
|
253
|
+
style: {
|
|
254
|
+
height: i - 8,
|
|
255
|
+
padding: "4px"
|
|
256
|
+
},
|
|
257
|
+
className: "internal-container",
|
|
258
|
+
classNames: { contentEl: "internal-container-content-el" },
|
|
259
|
+
children: [n.data.length > 0 && /* @__PURE__ */ D(T, {
|
|
260
|
+
parentCheckable: !0,
|
|
261
|
+
checkType: r === p.DEPARMENT || s ? "radio" : "checkbox",
|
|
262
|
+
data: n.data,
|
|
263
|
+
fieldNames: {
|
|
264
|
+
title: "name",
|
|
265
|
+
value: "_id",
|
|
266
|
+
children: "children"
|
|
267
|
+
},
|
|
268
|
+
selectedKeys: u,
|
|
269
|
+
onSelect: n.onSelect,
|
|
270
|
+
onDeSelect: n.onDeselect,
|
|
271
|
+
expandedKeys: d,
|
|
272
|
+
onExpand: f,
|
|
273
|
+
icon: () => /* @__PURE__ */ D(w, {
|
|
274
|
+
name: "dept-one",
|
|
275
|
+
className: "internal-container__icon"
|
|
276
|
+
}),
|
|
277
|
+
switcherIcon: (e) => /* @__PURE__ */ D(w, {
|
|
278
|
+
name: "xiangxiazhankai-11",
|
|
279
|
+
className: t("internal-container__arrow-icon", { "rotate-90": e })
|
|
280
|
+
})
|
|
281
|
+
}), n.data.length === 0 && !n.loading && /* @__PURE__ */ D("div", {
|
|
282
|
+
className: "internal-container__empty",
|
|
283
|
+
children: /* @__PURE__ */ D("span", { children: c("department.noAvailable") })
|
|
284
|
+
})]
|
|
285
|
+
});
|
|
286
|
+
}, J = {
|
|
287
|
+
"external-organization": "_external-organization_kf3pt_1",
|
|
288
|
+
"external-organization__content": "_external-organization__content_kf3pt_5",
|
|
289
|
+
"external-organization__scroll-content": "_external-organization__scroll-content_kf3pt_8",
|
|
290
|
+
"external-organization__tree-icon": "_external-organization__tree-icon_kf3pt_12",
|
|
291
|
+
"external-organization__switcher-icon": "_external-organization__switcher-icon_kf3pt_15",
|
|
292
|
+
"external-organization__switcher-icon--expanded": "_external-organization__switcher-icon--expanded_kf3pt_20",
|
|
293
|
+
"external-organization__empty": "_external-organization__empty_kf3pt_23"
|
|
294
|
+
}, Y = (n) => {
|
|
295
|
+
let { type: r, containerHeight: i, value: o, isSingleSelect: s } = a(), { t: c } = l(), [u, d] = S(n.preferredTab || A.DOCK_PERSON_GROUP), m = o?.map((e) => e._id) || [], h = [{
|
|
296
|
+
label: c("department.externalContactGroup"),
|
|
297
|
+
value: A.DOCK_PERSON_GROUP
|
|
298
|
+
}, {
|
|
299
|
+
label: c("department.externalContactDepartment"),
|
|
300
|
+
value: A.DOCK_DEPARTMENT
|
|
301
|
+
}];
|
|
302
|
+
b(() => {
|
|
303
|
+
n.preferredTab && d(n.preferredTab);
|
|
304
|
+
}, [n.preferredTab]);
|
|
305
|
+
let g = x(() => B(n.data, u), [u, n.data]), _ = n.selectionExpandKeysByTab?.[u], { expandedKeys: v, onExpand: y } = K(x(() => G(g, {
|
|
306
|
+
baselineMode: "all-roots",
|
|
307
|
+
selectionExpandKeys: _
|
|
308
|
+
}), [g, _]));
|
|
309
|
+
return /* @__PURE__ */ O("div", {
|
|
310
|
+
className: J["external-organization"],
|
|
311
|
+
children: [/* @__PURE__ */ D(f, {
|
|
312
|
+
tabs: h,
|
|
313
|
+
value: u,
|
|
314
|
+
onChange: d
|
|
315
|
+
}), /* @__PURE__ */ D("div", {
|
|
316
|
+
className: J["external-organization__content"],
|
|
317
|
+
children: /* @__PURE__ */ O(e, {
|
|
318
|
+
style: {
|
|
319
|
+
height: i - 42,
|
|
320
|
+
padding: "4px"
|
|
321
|
+
},
|
|
322
|
+
classNames: { contentEl: J["external-organization__scroll-content"] },
|
|
323
|
+
children: [g.length > 0 && /* @__PURE__ */ D(T, {
|
|
324
|
+
parentCheckable: !0,
|
|
325
|
+
checkType: r === p.DEPARMENT || s ? "radio" : "checkbox",
|
|
326
|
+
data: g,
|
|
327
|
+
fieldNames: {
|
|
328
|
+
title: "name",
|
|
329
|
+
value: "_id",
|
|
330
|
+
children: "children"
|
|
331
|
+
},
|
|
332
|
+
selectedKeys: m,
|
|
333
|
+
onSelect: n.onSelect,
|
|
334
|
+
onDeSelect: n.onDeselect,
|
|
335
|
+
expandedKeys: v,
|
|
336
|
+
onExpand: y,
|
|
337
|
+
icon: () => /* @__PURE__ */ D(w, {
|
|
338
|
+
name: "dept-one",
|
|
339
|
+
className: J["external-organization__tree-icon"],
|
|
340
|
+
size: 16
|
|
341
|
+
}),
|
|
342
|
+
switcherIcon: (e) => /* @__PURE__ */ D(w, {
|
|
343
|
+
name: "xiangxiazhankai-11",
|
|
344
|
+
className: t(J["external-organization__switcher-icon"], { [J["external-organization__switcher-icon--expanded"]]: e })
|
|
345
|
+
})
|
|
346
|
+
}), g.length === 0 && !n.loading && /* @__PURE__ */ D("div", {
|
|
347
|
+
className: J["external-organization__empty"],
|
|
348
|
+
children: /* @__PURE__ */ D("span", { children: c("department.noAvailable") })
|
|
349
|
+
})]
|
|
350
|
+
})
|
|
351
|
+
})]
|
|
352
|
+
});
|
|
353
|
+
}, X = {
|
|
354
|
+
"organization-panel": "_organization-panel_1dfed_1",
|
|
355
|
+
"organization-panel__menu": "_organization-panel__menu_1dfed_6",
|
|
356
|
+
"organization-panel__menu-list": "_organization-panel__menu-list_1dfed_10",
|
|
357
|
+
"organization-panel__menu-item": "_organization-panel__menu-item_1dfed_14",
|
|
358
|
+
"organization-panel__menu-item--active": "_organization-panel__menu-item--active_1dfed_25",
|
|
359
|
+
"organization-panel__content": "_organization-panel__content_1dfed_32",
|
|
360
|
+
"organization-panel__content--borderless": "_organization-panel__content--borderless_1dfed_37"
|
|
361
|
+
}, Z = () => {
|
|
362
|
+
let e = U();
|
|
363
|
+
return /* @__PURE__ */ O("div", {
|
|
364
|
+
className: X["organization-panel"],
|
|
365
|
+
children: [e.showMenu && /* @__PURE__ */ D("aside", {
|
|
366
|
+
className: X["organization-panel__menu"],
|
|
367
|
+
children: /* @__PURE__ */ D("ul", {
|
|
368
|
+
className: X["organization-panel__menu-list"],
|
|
369
|
+
children: e.menuItems.filter((e) => e.visible).map((n) => /* @__PURE__ */ D("li", {
|
|
370
|
+
onClick: () => e.setActiveKey(n.key),
|
|
371
|
+
className: t(X["organization-panel__menu-item"], { [X["organization-panel__menu-item--active"]]: e.activeKey === n.key }),
|
|
372
|
+
children: n.label
|
|
373
|
+
}, n.key))
|
|
374
|
+
})
|
|
375
|
+
}), /* @__PURE__ */ D("section", {
|
|
376
|
+
className: t(X["organization-panel__content"], { [X["organization-panel__content--borderless"]]: e.isBorderless }),
|
|
377
|
+
children: /* @__PURE__ */ O(C, {
|
|
378
|
+
spinning: e.loading,
|
|
379
|
+
children: [e.menuType.INTERNAL === e.activeKey && /* @__PURE__ */ D(q, {
|
|
380
|
+
onSelect: e.handleSelect,
|
|
381
|
+
onDeselect: e.handleDeselect,
|
|
382
|
+
loading: e.loading,
|
|
383
|
+
data: e.currentTreeData,
|
|
384
|
+
selectionExpandKeys: e.expandState.expandedKeysByView.internal
|
|
385
|
+
}), e.menuType.EXTERNAL === e.activeKey && /* @__PURE__ */ D(Y, {
|
|
386
|
+
data: e.currentTreeData,
|
|
387
|
+
onSelect: e.handleSelect,
|
|
388
|
+
onDeselect: e.handleDeselect,
|
|
389
|
+
loading: e.loading,
|
|
390
|
+
preferredTab: e.preferredExternalTab,
|
|
391
|
+
selectionExpandKeysByTab: {
|
|
392
|
+
dockcorp: e.expandState.expandedKeysByView["external:dockcorp"],
|
|
393
|
+
dockcorpdept: e.expandState.expandedKeysByView["external:dockcorpdept"]
|
|
394
|
+
}
|
|
395
|
+
})]
|
|
396
|
+
})
|
|
397
|
+
})]
|
|
398
|
+
});
|
|
399
|
+
};
|
|
400
|
+
//#endregion
|
|
401
|
+
export { Z as t };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { t as e } from "../vendors/simplebar-react.js";
|
|
2
|
+
import { t } from "../vendors/clsx.js";
|
|
3
|
+
import { t as n } from "./useDeptsMemberSelector-CHK0U3R4.js";
|
|
4
|
+
import { Radio as r, Spin as i } from "antd";
|
|
5
|
+
import { Checkbox as a } from "@baishuyun/ui-base";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/RelationShipList.module.scss
|
|
8
|
+
var s = {
|
|
9
|
+
"relation-ship-list__option": "_relation-ship-list__option_bqzl7_1",
|
|
10
|
+
"relation-ship-list__option--checkbox": "_relation-ship-list__option--checkbox_bqzl7_9",
|
|
11
|
+
"relation-ship-list__option--radio": "_relation-ship-list__option--radio_bqzl7_12",
|
|
12
|
+
"relation-ship-list__radio-group": "_relation-ship-list__radio-group_bqzl7_15",
|
|
13
|
+
"relation-ship-list__radio": "_relation-ship-list__radio_bqzl7_15",
|
|
14
|
+
"relation-ship-list__name": "_relation-ship-list__name_bqzl7_41",
|
|
15
|
+
"relation-ship-list__checkbox-row": "_relation-ship-list__checkbox-row_bqzl7_48",
|
|
16
|
+
"relation-ship-list__checkbox": "_relation-ship-list__checkbox_bqzl7_48",
|
|
17
|
+
"relation-ship-list__group": "_relation-ship-list__group_bqzl7_59"
|
|
18
|
+
}, c = ({ relationList: c = [], selectedIds: l = [], selectedId: u, loading: d = !1, isSingleSelect: f = !1, onChange: p, onToggle: m }) => {
|
|
19
|
+
let { containerHeight: h } = n();
|
|
20
|
+
return /* @__PURE__ */ o(i, {
|
|
21
|
+
spinning: d,
|
|
22
|
+
children: /* @__PURE__ */ o(e, {
|
|
23
|
+
style: { height: h - 8 },
|
|
24
|
+
children: /* @__PURE__ */ o("div", {
|
|
25
|
+
className: s["relation-ship-list"],
|
|
26
|
+
children: /* @__PURE__ */ o("ul", {
|
|
27
|
+
className: s["relation-ship-list__list"],
|
|
28
|
+
children: f ? /* @__PURE__ */ o(r.Group, {
|
|
29
|
+
value: u,
|
|
30
|
+
className: s["relation-ship-list__radio-group"],
|
|
31
|
+
prefixCls: "ant-radio",
|
|
32
|
+
children: c.map((e) => /* @__PURE__ */ o("li", {
|
|
33
|
+
className: t(s["relation-ship-list__option"], s["relation-ship-list__option--radio"]),
|
|
34
|
+
onClick: () => m?.(e),
|
|
35
|
+
children: /* @__PURE__ */ o(r, {
|
|
36
|
+
value: e._id,
|
|
37
|
+
className: s["relation-ship-list__radio"],
|
|
38
|
+
children: /* @__PURE__ */ o("div", {
|
|
39
|
+
className: s["relation-ship-list__checkbox-row"],
|
|
40
|
+
title: e.name,
|
|
41
|
+
children: /* @__PURE__ */ o("span", {
|
|
42
|
+
className: s["relation-ship-list__name"],
|
|
43
|
+
children: e.name
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
}, e._id))
|
|
48
|
+
}) : /* @__PURE__ */ o(a.Group, {
|
|
49
|
+
value: l,
|
|
50
|
+
onChange: p,
|
|
51
|
+
className: s["relation-ship-list__group"],
|
|
52
|
+
children: c.map((e) => /* @__PURE__ */ o("li", {
|
|
53
|
+
className: t(s["relation-ship-list__option"], s["relation-ship-list__option--checkbox"]),
|
|
54
|
+
children: /* @__PURE__ */ o(a, {
|
|
55
|
+
labelPosition: "left",
|
|
56
|
+
value: e._id,
|
|
57
|
+
className: s["relation-ship-list__checkbox"],
|
|
58
|
+
children: /* @__PURE__ */ o("div", {
|
|
59
|
+
className: s["relation-ship-list__checkbox-row"],
|
|
60
|
+
title: e.name,
|
|
61
|
+
children: /* @__PURE__ */ o("span", {
|
|
62
|
+
className: s["relation-ship-list__name"],
|
|
63
|
+
children: e.name
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
}, e._id))
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { c as t };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import "../vendors/simplebar-react.js";
|
|
2
|
-
import "./useDeptsMemberSelector-
|
|
3
|
-
import {
|
|
4
|
-
import { t } from "./DeptsMemberSelector-
|
|
5
|
-
import "../vendors/useLocale.js";
|
|
2
|
+
import "./useDeptsMemberSelector-CHK0U3R4.js";
|
|
3
|
+
import { l as e, m as t, p as n } from "./useOutsiderGroupPanelState-d2EiLVaV.js";
|
|
4
|
+
import { t as r } from "./DeptsMemberSelector-DmwD1Ls_.js";
|
|
6
5
|
import "../ConfigProvider/configContext-kYu9qTM2.js";
|
|
7
|
-
import {
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./RelationShipList-
|
|
12
|
-
import "./
|
|
13
|
-
import "./
|
|
14
|
-
import "./Department-6R-BZNZ4.js";
|
|
6
|
+
import { o as i } from "./utils-BVfGpRu5.js";
|
|
7
|
+
import "./OrganizationPanel-2QDNfFtJ.js";
|
|
8
|
+
import "./MemberPanel-Cm1Hv-GV.js";
|
|
9
|
+
import "./DeptsUser-wWfkuBDp.js";
|
|
10
|
+
import "./RelationShipList-DkF9XivU.js";
|
|
11
|
+
import "./Member-K4kgwY7b.js";
|
|
12
|
+
import "./Department-lQJcetBA.js";
|
|
15
13
|
//#region src/components/DeptsMemberSelector/index.ts
|
|
16
|
-
var
|
|
14
|
+
var a = r;
|
|
17
15
|
//#endregion
|
|
18
|
-
export { e as Entity,
|
|
16
|
+
export { e as ENTITY_ITEM_TYPE, n as Entity, t as IconType, a as default, i as getColorByName };
|