@baishuyun/ui-business 4.0.0 → 4.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/ConfigProvider/ConfigProvider-CAq3dN6-.js +15 -0
- package/dist/ConfigProvider/configContext-_BAslzM-.js +9 -0
- package/dist/ConfigProvider/index.d.ts +2 -0
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DeptsMember/DeptsMember-BNuoQ8y4.js +865 -0
- package/dist/DeptsMember/ExtraConcactPanel-BoSCI3s5.js +738 -0
- package/dist/DeptsMember/OrganizationPanel-ByWU1PWX.js +275 -0
- package/dist/DeptsMember/TabGroup-DZC7i-Yr.js +104 -0
- package/dist/DeptsMember/index-BRIA1uOQ.js +88 -0
- package/dist/DeptsMember/index.js +6 -4
- package/dist/DeptsMember/subcomponents/Entity/Department/index.js +115 -76
- package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +256 -27
- package/dist/DeptsMember/subcomponents/Entity/Member/index.js +15 -12
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +4 -0
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +15 -0
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +4 -0
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +67 -0
- package/dist/DeptsMember/useDeptsMemberSelector-D3rvDuVf.js +13 -0
- package/dist/Scatterplot/Scatterplot-CD1c18zN.js +215 -0
- package/dist/Scatterplot/index.d.ts +6 -0
- package/dist/Scatterplot/index.js +4 -0
- package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +13 -1
- package/dist/components/ConfigProvider/index.d.ts +1 -0
- package/dist/components/DeptsMember/DeptsMember.type.d.ts +15 -0
- package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +4 -0
- package/dist/components/DeptsMember/index.d.ts +1 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/MemberRelationShip.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +5 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +15 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipMember/RelationShipMember.d.ts +6 -0
- package/dist/components/DeptsMember/subcomponents/Panels/OtherPanel/OtherPanel.d.ts +5 -0
- package/dist/components/Scatterplot/Scatterplot.d.ts +3 -0
- package/dist/components/Scatterplot/Scatterplot.type.d.ts +59 -0
- package/dist/components/Scatterplot/index.d.ts +3 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +14 -7
- package/dist/lang/en-US.json.d.ts +7 -2
- package/dist/lang/zh-CN.json.d.ts +7 -2
- package/dist/services/apiService.d.ts +1 -0
- package/dist/services/ncorp/department.service.d.ts +11 -0
- package/dist/services/ncorp/relation.service.d.ts +4 -0
- package/dist/utils/getRelationNodeName.d.ts +9 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/recordSelectedNode.d.ts +8 -0
- package/dist/vendors/echarts.js +43864 -0
- package/dist/vendors/services/apiService.js +18 -10
- package/dist/vendors/services/corp/outsider.service.js +4 -4
- package/dist/vendors/services/data/department.service.js +3 -3
- package/dist/vendors/services/data/member.service.js +6 -6
- package/dist/vendors/services/data/member_limit.service.js +3 -3
- package/dist/vendors/services/data/outsider.service.js +4 -4
- package/dist/vendors/services/ncorp/department.service.js +6 -0
- package/dist/vendors/services/ncorp/relation.service.js +5 -0
- package/dist/vendors/useLocale.js +42 -0
- package/package.json +4 -3
- package/dist/ConfigProvider/ConfigProvider-CE-neQMa.js +0 -9
- package/dist/ConfigProvider/configContext-lDqg07Z3.js +0 -7
- package/dist/DeptsMember/DeptsMember-CzJqr_LX.js +0 -721
- package/dist/DeptsMember/ExtraConcactPanel-BI9emYpp.js +0 -674
- package/dist/DeptsMember/OrganizationPanel-DcwvZ6X4.js +0 -254
- package/dist/DeptsMember/TabGroup-wNM86-Zq.js +0 -141
|
@@ -0,0 +1,865 @@
|
|
|
1
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { c as C } from "../vendors/clsx.js";
|
|
3
|
+
import { u as U, D as be } from "./useDeptsMemberSelector-D3rvDuVf.js";
|
|
4
|
+
import { Avatar as W, Button as F, Spin as ce } from "antd";
|
|
5
|
+
import { forwardRef as ye, useRef as O, useImperativeHandle as fe, useState as D, useEffect as j, useMemo as le, useCallback as ge } from "react";
|
|
6
|
+
import { Icon as P, Tree as oe } from "@baishuyun/ui-base";
|
|
7
|
+
import { createPortal as ve } from "react-dom";
|
|
8
|
+
import { AnimatePresence as Z, motion as ee } from "motion/react";
|
|
9
|
+
import { useToggle as we, useControllableValue as _e, useRequest as z } from "ahooks";
|
|
10
|
+
import { a as de, E as v, M as xe, T as ke, P as Ne, G as te, b as Se } from "./TabGroup-DZC7i-Yr.js";
|
|
11
|
+
import { S as X } from "../vendors/simplebar-react.js";
|
|
12
|
+
import { u as H } from "../vendors/useLocale.js";
|
|
13
|
+
import { getColorByName as J, findNodeInTree as se } from "./utils/index.js";
|
|
14
|
+
import { n as Ee, d as Ie } from "../vendors/lodash-es.js";
|
|
15
|
+
import { useDeptUserTabItems as Te } from "./subcomponents/Entity/DeptsUser/index.js";
|
|
16
|
+
import { useMemberTabItems as Ce } from "./subcomponents/Entity/Member/index.js";
|
|
17
|
+
import { useDepartmentTabItems as Re } from "./subcomponents/Entity/Department/index.js";
|
|
18
|
+
import { g as De, a as Pe } from "../vendors/services/data/outsider.service.js";
|
|
19
|
+
import { g as Me } from "../vendors/services/data/member_limit.service.js";
|
|
20
|
+
import { g as Ae } from "../vendors/services/data/member.service.js";
|
|
21
|
+
import { produce as Oe } from "immer";
|
|
22
|
+
const E = {
|
|
23
|
+
"selection-area": "_selection-area_7ti3u_1",
|
|
24
|
+
"selection-area__container": "_selection-area__container_7ti3u_4",
|
|
25
|
+
"selection-area__container--expanded": "_selection-area__container--expanded_7ti3u_11",
|
|
26
|
+
"selection-area__container--animating": "_selection-area__container--animating_7ti3u_14",
|
|
27
|
+
"selection-area__body": "_selection-area__body_7ti3u_19",
|
|
28
|
+
"selection-area__body--expanded": "_selection-area__body--expanded_7ti3u_26",
|
|
29
|
+
"selection-area__scroll-gutter": "_selection-area__scroll-gutter_7ti3u_34",
|
|
30
|
+
"selection-area__scroll": "_selection-area__scroll_7ti3u_34",
|
|
31
|
+
"selection-area__button": "_selection-area__button_7ti3u_41",
|
|
32
|
+
"selection-area__mask": "_selection-area__mask_7ti3u_61"
|
|
33
|
+
}, Ue = "bsy_dept_member", He = "preset_bsy_dept_member";
|
|
34
|
+
function Le(s, r) {
|
|
35
|
+
try {
|
|
36
|
+
const a = s.includes("-relationSub-") ? "relationSub" : s.includes("-relationUser-") ? "relationUser" : s.includes("-relation-") ? "relation" : null;
|
|
37
|
+
if (!a)
|
|
38
|
+
return r;
|
|
39
|
+
const _ = s.split("-")[0];
|
|
40
|
+
let t;
|
|
41
|
+
const l = sessionStorage.getItem(He);
|
|
42
|
+
if (l && (t = JSON.parse(l).find((p) => String(p._id) === _)), !t) {
|
|
43
|
+
const d = sessionStorage.getItem(Ue);
|
|
44
|
+
d && (t = JSON.parse(d).find((y) => String(y._id) === _));
|
|
45
|
+
}
|
|
46
|
+
if (!t)
|
|
47
|
+
return r;
|
|
48
|
+
switch (a) {
|
|
49
|
+
case "relationSub":
|
|
50
|
+
return `${t.name}及子部门 - ${r}`;
|
|
51
|
+
case "relation":
|
|
52
|
+
return `${t.name} - ${r}`;
|
|
53
|
+
case "relationUser":
|
|
54
|
+
return `${t.nickname} - ${r}`;
|
|
55
|
+
default:
|
|
56
|
+
return r;
|
|
57
|
+
}
|
|
58
|
+
} catch (a) {
|
|
59
|
+
return console.error("获取关联节点名称时发生错误:", a), r;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const w = {
|
|
63
|
+
"preview-selected-items": "_preview-selected-items_184kl_1",
|
|
64
|
+
"preview-selected-items--measure": "_preview-selected-items--measure_184kl_4",
|
|
65
|
+
"preview-selected-items__list": "_preview-selected-items__list_184kl_16",
|
|
66
|
+
"preview-selected-items__item": "_preview-selected-items__item_184kl_23",
|
|
67
|
+
"preview-selected-items__item--user": "_preview-selected-items__item--user_184kl_34",
|
|
68
|
+
"preview-selected-items__item--department": "_preview-selected-items__item--department_184kl_37",
|
|
69
|
+
"preview-selected-items__item--relation": "_preview-selected-items__item--relation_184kl_40",
|
|
70
|
+
"preview-selected-items__item--public": "_preview-selected-items__item--public_184kl_43",
|
|
71
|
+
"preview-selected-items__content": "_preview-selected-items__content_184kl_46",
|
|
72
|
+
"preview-selected-items__text": "_preview-selected-items__text_184kl_52",
|
|
73
|
+
"preview-selected-items__name": "_preview-selected-items__name_184kl_57",
|
|
74
|
+
"preview-selected-items__badge": "_preview-selected-items__badge_184kl_64",
|
|
75
|
+
"preview-selected-items__close": "_preview-selected-items__close_184kl_69",
|
|
76
|
+
"preview-selected-items__more": "_preview-selected-items__more_184kl_83",
|
|
77
|
+
"preview-selected-items__more-button": "_preview-selected-items__more-button_184kl_89"
|
|
78
|
+
}, ae = ye(
|
|
79
|
+
(s, r) => {
|
|
80
|
+
const {
|
|
81
|
+
isMeasure: a = !1,
|
|
82
|
+
showEllipsisButton: i = !1,
|
|
83
|
+
onToggle: _,
|
|
84
|
+
hiddenCount: t = 0,
|
|
85
|
+
previewCount: l = 0
|
|
86
|
+
} = s, { t: d } = H(), { value: p = [], setValue: y, type: o } = U(), b = O(null), u = O(null), g = {
|
|
87
|
+
dockcorp: d("department.externalContactGroup"),
|
|
88
|
+
dockcorpdept: d("department.contact")
|
|
89
|
+
}, x = (m) => y?.(p.filter((S) => S._id !== m));
|
|
90
|
+
return fe(r, () => ({
|
|
91
|
+
measureRef: b.current,
|
|
92
|
+
ellipsisButtonRef: u.current
|
|
93
|
+
})), /* @__PURE__ */ e(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
className: C(w["preview-selected-items"], {
|
|
97
|
+
[w["preview-selected-items--measure"]]: a
|
|
98
|
+
}),
|
|
99
|
+
children: /* @__PURE__ */ h(
|
|
100
|
+
"ul",
|
|
101
|
+
{
|
|
102
|
+
className: w["preview-selected-items__list"],
|
|
103
|
+
ref: a ? b : void 0,
|
|
104
|
+
"data-role": a ? "measure-list" : "preview-list",
|
|
105
|
+
children: [
|
|
106
|
+
p.slice(0, l)?.map((m, S) => {
|
|
107
|
+
const R = m.name || m.nickname, c = m.type ? m.type : Object.prototype.hasOwnProperty.call(m, "departmentId") ? null : "group", n = ["relation", "relationSub", "relationUser"].some(
|
|
108
|
+
(B) => m._id.includes(B)
|
|
109
|
+
), f = n ? Le(m._id, R) : R, L = n ? "relation" : c, M = !!m.nickname;
|
|
110
|
+
return /* @__PURE__ */ h(
|
|
111
|
+
"li",
|
|
112
|
+
{
|
|
113
|
+
className: C(w["preview-selected-items__item"], {
|
|
114
|
+
[w["preview-selected-items__item--user"]]: [
|
|
115
|
+
v.USER,
|
|
116
|
+
v.USER_GROUP
|
|
117
|
+
].includes(o),
|
|
118
|
+
[w["preview-selected-items__item--department"]]: [
|
|
119
|
+
v.DEPARMENT,
|
|
120
|
+
v.DEPARMENT_GROUP
|
|
121
|
+
].includes(o),
|
|
122
|
+
[w["preview-selected-items__item--relation"]]: n,
|
|
123
|
+
[w["preview-selected-items__item--public"]]: m.type === "public"
|
|
124
|
+
}),
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ e("div", { className: w["preview-selected-items__content"], children: M ? m.avatarurl ? /* @__PURE__ */ e(W, { src: m.avatarurl, size: 20 }) : /* @__PURE__ */ e(
|
|
127
|
+
W,
|
|
128
|
+
{
|
|
129
|
+
style: {
|
|
130
|
+
backgroundColor: J(f),
|
|
131
|
+
fontSize: "12px",
|
|
132
|
+
lineHeight: "13px",
|
|
133
|
+
width: "20px",
|
|
134
|
+
height: "20px"
|
|
135
|
+
},
|
|
136
|
+
children: f?.charAt(0) || "?"
|
|
137
|
+
}
|
|
138
|
+
) : /* @__PURE__ */ e(de, { type: L }) }),
|
|
139
|
+
/* @__PURE__ */ h("div", { className: w["preview-selected-items__text"], "data-type": m.type, children: [
|
|
140
|
+
/* @__PURE__ */ e("span", { className: w["preview-selected-items__name"], title: f, children: f }),
|
|
141
|
+
m.type === "dockcorpdept" || m.type === "dockcorp" ? /* @__PURE__ */ h("span", { className: w["preview-selected-items__badge"], children: [
|
|
142
|
+
"(",
|
|
143
|
+
g[m.type],
|
|
144
|
+
")"
|
|
145
|
+
] }) : null
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ e(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
role: "button",
|
|
151
|
+
className: w["preview-selected-items__close"],
|
|
152
|
+
onClick: a ? Ee : () => x(m._id),
|
|
153
|
+
children: /* @__PURE__ */ e(P, { name: "close", color: "#666" })
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
S
|
|
159
|
+
);
|
|
160
|
+
}),
|
|
161
|
+
i && !a && /* @__PURE__ */ e(
|
|
162
|
+
"li",
|
|
163
|
+
{
|
|
164
|
+
ref: u,
|
|
165
|
+
className: w["preview-selected-items__more"],
|
|
166
|
+
"data-button": "ellipsis-button",
|
|
167
|
+
children: /* @__PURE__ */ h(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
role: "button",
|
|
171
|
+
className: w["preview-selected-items__more-button"],
|
|
172
|
+
onClick: () => {
|
|
173
|
+
_?.();
|
|
174
|
+
},
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ e("span", { children: d("common.viewAll", { count: t }) }),
|
|
177
|
+
/* @__PURE__ */ e(P, { name: "arrow-down" })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
), Ge = () => {
|
|
190
|
+
const { value: s = [], type: r } = U(), { t: a } = H(), [i, _] = D(0), [t, { toggle: l }] = we(!1), [d, p] = D(!1), [y, o] = D(null), b = O(null), u = O(null), g = [v.DEPARMENT, v.USER].includes(r) ? xe : ke;
|
|
191
|
+
j(() => {
|
|
192
|
+
t && p(!0);
|
|
193
|
+
}, [t]);
|
|
194
|
+
const x = () => {
|
|
195
|
+
t || p(!1);
|
|
196
|
+
}, [m, S] = D(!1);
|
|
197
|
+
j(() => {
|
|
198
|
+
if (!b.current || !u.current) return;
|
|
199
|
+
const f = () => {
|
|
200
|
+
requestAnimationFrame(() => {
|
|
201
|
+
if (S(!1), !b.current || !u.current) return;
|
|
202
|
+
const M = b.current.clientWidth, B = u.current.querySelector('[data-role="measure-list"]'), A = B ? B.querySelectorAll("li") : [], pe = u.current.querySelector(
|
|
203
|
+
'[data-button="ellipsis-button"]'
|
|
204
|
+
);
|
|
205
|
+
if (A.length === 0) {
|
|
206
|
+
_(s.length);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (A.length !== s.length) {
|
|
210
|
+
console.warn("DOM not fully updated, retrying..."), requestAnimationFrame(() => f());
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
let V = 0, Y = 0, G = 0, $ = 0;
|
|
214
|
+
for (; $ < A.length; ) {
|
|
215
|
+
const K = A[$].clientWidth + te;
|
|
216
|
+
if (G + K <= M)
|
|
217
|
+
G += K, V = $ + 1, $++;
|
|
218
|
+
else
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
Y = $, G = 0;
|
|
222
|
+
const ue = pe?.offsetWidth || Se;
|
|
223
|
+
for (let q = Y; q < A.length; q++) {
|
|
224
|
+
const Q = A[q].clientWidth + te, he = ue;
|
|
225
|
+
if (G + Q + he < M)
|
|
226
|
+
G += Q, V = q + 1;
|
|
227
|
+
else {
|
|
228
|
+
S(!0);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
i !== V && _(V);
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
f();
|
|
236
|
+
}, [s]);
|
|
237
|
+
const R = s.length - i, c = m && !t, n = le(() => t && u?.current?.querySelector('[data-role="measure-list"]')?.clientHeight || g, [g, t]);
|
|
238
|
+
return /* @__PURE__ */ e(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
className: E["selection-area"],
|
|
242
|
+
style: {
|
|
243
|
+
height: d ? `${Ne}px` : "auto"
|
|
244
|
+
},
|
|
245
|
+
children: /* @__PURE__ */ h(
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
className: C(E["selection-area__container"], {
|
|
249
|
+
[E["selection-area__container--expanded"]]: t,
|
|
250
|
+
[E["selection-area__container--animating"]]: d
|
|
251
|
+
}),
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ h(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
className: C(E["selection-area__body"], {
|
|
257
|
+
[E["selection-area__body--expanded"]]: t
|
|
258
|
+
}),
|
|
259
|
+
ref: u,
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ e(ae, { isMeasure: !0, previewCount: s.length }),
|
|
262
|
+
/* @__PURE__ */ e(X, { style: { maxHeight: "400px" }, children: /* @__PURE__ */ e("div", { className: E["selection-area__scroll-gutter"], children: /* @__PURE__ */ e(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
className: E["selection-area__scroll"],
|
|
266
|
+
ref: b,
|
|
267
|
+
style: {
|
|
268
|
+
height: n + "px"
|
|
269
|
+
},
|
|
270
|
+
children: /* @__PURE__ */ e(
|
|
271
|
+
ae,
|
|
272
|
+
{
|
|
273
|
+
previewCount: t ? s.length : i,
|
|
274
|
+
showEllipsisButton: c,
|
|
275
|
+
hiddenCount: R,
|
|
276
|
+
onToggle: () => {
|
|
277
|
+
const f = document.querySelector('[data-teleport="DeptsMember"]');
|
|
278
|
+
o(f), l();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
) }) })
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
y && ve(
|
|
288
|
+
/* @__PURE__ */ e(Z, { children: t && /* @__PURE__ */ e(
|
|
289
|
+
ee.div,
|
|
290
|
+
{
|
|
291
|
+
className: E["selection-area__mask"],
|
|
292
|
+
initial: { opacity: 0, backdropFilter: "blur(0px)" },
|
|
293
|
+
animate: { opacity: 1, backdropFilter: "blur(.5px)" },
|
|
294
|
+
exit: { opacity: 0, backdropFilter: "blur(0px)" },
|
|
295
|
+
transition: { duration: 0.3, ease: "easeIn" },
|
|
296
|
+
onAnimationComplete: x
|
|
297
|
+
}
|
|
298
|
+
) }),
|
|
299
|
+
y
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ e(Z, { mode: "wait", children: t && /* @__PURE__ */ e(
|
|
302
|
+
ee.div,
|
|
303
|
+
{
|
|
304
|
+
className: E["selection-area__button"],
|
|
305
|
+
initial: { opacity: 1 },
|
|
306
|
+
exit: { opacity: 0 },
|
|
307
|
+
transition: { duration: 0.3 },
|
|
308
|
+
onAnimationComplete: x,
|
|
309
|
+
children: /* @__PURE__ */ h(F, { type: "link", onClick: () => l(), children: [
|
|
310
|
+
a("common.collapseAll"),
|
|
311
|
+
/* @__PURE__ */ e(P, { name: "arrow-up" })
|
|
312
|
+
] })
|
|
313
|
+
}
|
|
314
|
+
) })
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
}, I = {
|
|
321
|
+
"selection-tab-list": "_selection-tab-list_ujxba_1",
|
|
322
|
+
"selection-tab-list__tabs-wrapper": "_selection-tab-list__tabs-wrapper_ujxba_8",
|
|
323
|
+
"selection-tab-list__tabs": "_selection-tab-list__tabs_ujxba_8",
|
|
324
|
+
"selection-tab-list__indicator": "_selection-tab-list__indicator_ujxba_18",
|
|
325
|
+
"selection-tab-list__item": "_selection-tab-list__item_ujxba_25",
|
|
326
|
+
"selection-tab-list__item--active": "_selection-tab-list__item--active_ujxba_35",
|
|
327
|
+
"selection-tab-list__search": "_selection-tab-list__search_ujxba_38",
|
|
328
|
+
"selection-tab-list__search-field": "_selection-tab-list__search-field_ujxba_43",
|
|
329
|
+
"selection-tab-list__input": "_selection-tab-list__input_ujxba_47",
|
|
330
|
+
"selection-tab-list__search-icon": "_selection-tab-list__search-icon_ujxba_64"
|
|
331
|
+
}, $e = (s) => {
|
|
332
|
+
const [r, a] = _e(s, {
|
|
333
|
+
defaultValue: s.tabs.length ? s.tabs[0].key : void 0
|
|
334
|
+
}), [i, _] = D(""), t = O(/* @__PURE__ */ new Map()), [l, d] = D({
|
|
335
|
+
width: 0,
|
|
336
|
+
transform: "translateX(0)"
|
|
337
|
+
}), p = O(Ie((o) => s.onSearch?.(o), 250)).current;
|
|
338
|
+
j(() => () => {
|
|
339
|
+
p.cancel();
|
|
340
|
+
}, [p]);
|
|
341
|
+
const y = (o) => {
|
|
342
|
+
const b = t.current.get(o);
|
|
343
|
+
if (b) {
|
|
344
|
+
const { width: u, left: g } = b.getBoundingClientRect(), x = b.parentElement?.getBoundingClientRect().left || 0;
|
|
345
|
+
d({
|
|
346
|
+
width: u,
|
|
347
|
+
transform: `translateX(${g - x}px)`
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
return j(() => {
|
|
352
|
+
r && y(r);
|
|
353
|
+
}, [r]), j(() => {
|
|
354
|
+
const o = s.tabs.length ? s.tabs[0].key : void 0;
|
|
355
|
+
o && y(o);
|
|
356
|
+
}, [s.tabs]), /* @__PURE__ */ h("div", { className: I["selection-tab-list"], children: [
|
|
357
|
+
/* @__PURE__ */ h("div", { className: I["selection-tab-list__tabs-wrapper"], children: [
|
|
358
|
+
/* @__PURE__ */ e(
|
|
359
|
+
"div",
|
|
360
|
+
{
|
|
361
|
+
className: I["selection-tab-list__indicator"],
|
|
362
|
+
style: {
|
|
363
|
+
width: `${l.width}px`,
|
|
364
|
+
transform: l.transform
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
),
|
|
368
|
+
/* @__PURE__ */ e("ul", { className: I["selection-tab-list__tabs"], children: s.tabs.map((o) => /* @__PURE__ */ e(
|
|
369
|
+
"li",
|
|
370
|
+
{
|
|
371
|
+
ref: (b) => {
|
|
372
|
+
b && t.current.set(o.key, b);
|
|
373
|
+
},
|
|
374
|
+
onClick: () => a(o.key),
|
|
375
|
+
className: C(I["selection-tab-list__item"], {
|
|
376
|
+
[I["selection-tab-list__item--active"]]: r === o.key
|
|
377
|
+
}),
|
|
378
|
+
children: o.label
|
|
379
|
+
},
|
|
380
|
+
o.key
|
|
381
|
+
)) })
|
|
382
|
+
] }),
|
|
383
|
+
/* @__PURE__ */ e("div", { className: I["selection-tab-list__search"], children: /* @__PURE__ */ h("div", { className: I["selection-tab-list__search-field"], children: [
|
|
384
|
+
/* @__PURE__ */ e(
|
|
385
|
+
"input",
|
|
386
|
+
{
|
|
387
|
+
type: "text",
|
|
388
|
+
value: i,
|
|
389
|
+
onChange: (o) => {
|
|
390
|
+
_(o.target.value), p(o.target.value);
|
|
391
|
+
},
|
|
392
|
+
placeholder: s.searchPlaceholder,
|
|
393
|
+
className: I["selection-tab-list__input"]
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
/* @__PURE__ */ e(P, { name: "search", className: I["selection-tab-list__search-icon"] })
|
|
397
|
+
] }) })
|
|
398
|
+
] });
|
|
399
|
+
}, qe = {
|
|
400
|
+
"selection-tab-panel": "_selection-tab-panel_f6iav_1"
|
|
401
|
+
}, je = (s) => {
|
|
402
|
+
const { containerHeight: r } = U();
|
|
403
|
+
return /* @__PURE__ */ e(
|
|
404
|
+
"div",
|
|
405
|
+
{
|
|
406
|
+
className: C(qe["selection-tab-panel"]),
|
|
407
|
+
style: {
|
|
408
|
+
height: r + "px"
|
|
409
|
+
},
|
|
410
|
+
children: s.children
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
}, Be = {
|
|
414
|
+
"selection-tabs": "_selection-tabs_88491_1"
|
|
415
|
+
}, N = {
|
|
416
|
+
"member-search": "_member-search_162pf_1",
|
|
417
|
+
"member-search__tree-wrapper": "_member-search__tree-wrapper_162pf_6",
|
|
418
|
+
"member-search__tree-content": "_member-search__tree-content_162pf_9",
|
|
419
|
+
"member-search__tree-title": "_member-search__tree-title_162pf_12",
|
|
420
|
+
"member-search__tree-name": "_member-search__tree-name_162pf_20",
|
|
421
|
+
"member-search__tree-extra": "_member-search__tree-extra_162pf_27",
|
|
422
|
+
"member-search__switch-icon": "_member-search__switch-icon_162pf_36",
|
|
423
|
+
"member-search__switch-icon--expanded": "_member-search__switch-icon--expanded_162pf_41",
|
|
424
|
+
"member-search__empty": "_member-search__empty_162pf_44",
|
|
425
|
+
"member-search__empty-text": "_member-search__empty-text_162pf_51"
|
|
426
|
+
}, re = ({ avatarurl: s, randomColor: r, name: a, extra: i }) => /* @__PURE__ */ h("div", { className: N["member-search__tree-title"], children: [
|
|
427
|
+
s ? /* @__PURE__ */ e(W, { src: s, size: 20, style: { flexShrink: 0 } }) : /* @__PURE__ */ e(
|
|
428
|
+
W,
|
|
429
|
+
{
|
|
430
|
+
style: {
|
|
431
|
+
backgroundColor: r,
|
|
432
|
+
fontSize: "12px",
|
|
433
|
+
lineHeight: "13px",
|
|
434
|
+
width: "20px",
|
|
435
|
+
height: "20px",
|
|
436
|
+
flexShrink: 0
|
|
437
|
+
},
|
|
438
|
+
children: a.charAt(0)
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
/* @__PURE__ */ e("span", { className: N["member-search__tree-name"], children: a }),
|
|
442
|
+
i
|
|
443
|
+
] }), Ve = (s) => {
|
|
444
|
+
const { type: r, dispatch: a, value: i, containerHeight: _ } = U(), { t } = H(), { data: l, loading: d } = z(
|
|
445
|
+
() => De({
|
|
446
|
+
groupLimit: [],
|
|
447
|
+
memberLimit: [],
|
|
448
|
+
limit: 100,
|
|
449
|
+
skip: 0,
|
|
450
|
+
key: s.wd
|
|
451
|
+
}),
|
|
452
|
+
{
|
|
453
|
+
refreshDeps: [s.wd]
|
|
454
|
+
}
|
|
455
|
+
), { data: p, loading: y } = z(
|
|
456
|
+
() => Me({
|
|
457
|
+
key: s.wd,
|
|
458
|
+
limit: 100,
|
|
459
|
+
skip: 0,
|
|
460
|
+
hasLimit: !1
|
|
461
|
+
}),
|
|
462
|
+
{
|
|
463
|
+
refreshDeps: [s.wd]
|
|
464
|
+
}
|
|
465
|
+
), o = l?.list || [], b = p?.dock_user_list || [], u = p?.users || [], g = [
|
|
466
|
+
{
|
|
467
|
+
title: t("externalContact.title"),
|
|
468
|
+
value: "waibulianxiren",
|
|
469
|
+
children: o.map((c) => {
|
|
470
|
+
const n = c.nickname || c.name, f = J(n);
|
|
471
|
+
return {
|
|
472
|
+
...c,
|
|
473
|
+
title: /* @__PURE__ */ e(
|
|
474
|
+
re,
|
|
475
|
+
{
|
|
476
|
+
avatarurl: c.avatarurl,
|
|
477
|
+
randomColor: f,
|
|
478
|
+
name: n,
|
|
479
|
+
extra: /* @__PURE__ */ h("span", { className: N["member-search__tree-extra"], children: [
|
|
480
|
+
"(",
|
|
481
|
+
t("externalContact.title"),
|
|
482
|
+
":",
|
|
483
|
+
c.groupname,
|
|
484
|
+
")"
|
|
485
|
+
] })
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
value: c._id
|
|
489
|
+
};
|
|
490
|
+
})
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
title: t("member.title"),
|
|
494
|
+
value: "chengyuan",
|
|
495
|
+
children: [...u, ...b].map((c) => {
|
|
496
|
+
const n = c.nickname || c.name, f = J(n);
|
|
497
|
+
return {
|
|
498
|
+
...c,
|
|
499
|
+
title: /* @__PURE__ */ e(
|
|
500
|
+
re,
|
|
501
|
+
{
|
|
502
|
+
avatarurl: c.avatarurl,
|
|
503
|
+
randomColor: f,
|
|
504
|
+
name: n,
|
|
505
|
+
extra: /* @__PURE__ */ e("span", { className: N["member-search__tree-extra"], children: c.user_type === "dock_user" ? `(${t("department.external")}:${c.dock_corpname})` : c.deptnames })
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
value: c._id
|
|
509
|
+
};
|
|
510
|
+
})
|
|
511
|
+
}
|
|
512
|
+
].filter((c) => c.children.length), x = g.map((c) => c.value), m = y || d, S = (c) => {
|
|
513
|
+
if (v.USER === r) {
|
|
514
|
+
const n = se(c, g);
|
|
515
|
+
n && a({
|
|
516
|
+
type: "insertOnly",
|
|
517
|
+
payload: {
|
|
518
|
+
...n
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
if (v.USER_GROUP === r) {
|
|
523
|
+
const n = se(c, g);
|
|
524
|
+
a({
|
|
525
|
+
type: "addOne",
|
|
526
|
+
payload: {
|
|
527
|
+
...n
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
}, R = (c) => {
|
|
532
|
+
v.USER !== r && a({
|
|
533
|
+
type: "deleteOne",
|
|
534
|
+
payload: c
|
|
535
|
+
});
|
|
536
|
+
};
|
|
537
|
+
return /* @__PURE__ */ h("div", { className: N["member-search"], children: [
|
|
538
|
+
/* @__PURE__ */ e(ce, { spinning: m, children: /* @__PURE__ */ e(
|
|
539
|
+
X,
|
|
540
|
+
{
|
|
541
|
+
style: { height: _ - 8 },
|
|
542
|
+
className: N["member-search__tree-wrapper"],
|
|
543
|
+
children: g.length && !m ? /* @__PURE__ */ e("div", { className: N["member-search__tree-content"], children: /* @__PURE__ */ e(
|
|
544
|
+
oe,
|
|
545
|
+
{
|
|
546
|
+
data: g,
|
|
547
|
+
checkType: r === v.USER ? "radio" : "checkbox",
|
|
548
|
+
defaultSelectedKeys: i?.map((c) => c._id),
|
|
549
|
+
defaultExpandedKeys: x,
|
|
550
|
+
switcherIcon: (c) => /* @__PURE__ */ e(
|
|
551
|
+
P,
|
|
552
|
+
{
|
|
553
|
+
name: "xiangxiazhankai-11",
|
|
554
|
+
className: C(N["member-search__switch-icon"], {
|
|
555
|
+
[N["member-search__switch-icon--expanded"]]: c
|
|
556
|
+
})
|
|
557
|
+
}
|
|
558
|
+
),
|
|
559
|
+
onSelect: S,
|
|
560
|
+
onDeSelect: R
|
|
561
|
+
}
|
|
562
|
+
) }) : null
|
|
563
|
+
}
|
|
564
|
+
) }),
|
|
565
|
+
!g.length && !m && /* @__PURE__ */ e("div", { className: N["member-search__empty"], children: /* @__PURE__ */ e("span", { className: N["member-search__empty-text"], children: t("member.noAvailable") }) })
|
|
566
|
+
] });
|
|
567
|
+
}, k = {
|
|
568
|
+
"department-search": "_department-search_i1rya_1",
|
|
569
|
+
"department-search__scroll": "_department-search__scroll_i1rya_5",
|
|
570
|
+
"department-search__tree-content": "_department-search__tree-content_i1rya_8",
|
|
571
|
+
"department-search__title": "_department-search__title_i1rya_11",
|
|
572
|
+
"department-search__name": "_department-search__name_i1rya_16",
|
|
573
|
+
"department-search__extra": "_department-search__extra_i1rya_23",
|
|
574
|
+
"department-search__icon": "_department-search__icon_i1rya_31",
|
|
575
|
+
"department-search__switch-icon": "_department-search__switch-icon_i1rya_34",
|
|
576
|
+
"department-search__switch-icon--expanded": "_department-search__switch-icon--expanded_i1rya_39",
|
|
577
|
+
"department-search__empty": "_department-search__empty_i1rya_42",
|
|
578
|
+
"department-search__empty-text": "_department-search__empty-text_i1rya_49"
|
|
579
|
+
}, me = (s) => {
|
|
580
|
+
const { type: r, value: a, dispatch: i, containerHeight: _ } = U(), { t } = H(), { data: l, loading: d } = z(
|
|
581
|
+
() => Ae({
|
|
582
|
+
departmentLimit: [],
|
|
583
|
+
key: s.wd
|
|
584
|
+
}),
|
|
585
|
+
{
|
|
586
|
+
refreshDeps: [s.wd]
|
|
587
|
+
}
|
|
588
|
+
), { data: p, loading: y } = z(
|
|
589
|
+
() => Pe()
|
|
590
|
+
), o = p?.list || [], b = l?.departments || [], u = (l?.label_corp_list || []).filter((n) => n.type !== "dockcorpdept"), g = [...b, ...u].filter((n) => n.type !== "label"), x = [
|
|
591
|
+
{
|
|
592
|
+
title: t("externalContact.group"),
|
|
593
|
+
_id: "waibulianxiren",
|
|
594
|
+
children: o.filter((n) => n.status === 1 && n.name?.includes(s.wd)).map((n) => ({
|
|
595
|
+
...n,
|
|
596
|
+
title: /* @__PURE__ */ h("span", { className: k["department-search__title"], children: [
|
|
597
|
+
/* @__PURE__ */ e(de, { type: "group", size: 16 }),
|
|
598
|
+
/* @__PURE__ */ e("span", { className: k["department-search__name"], children: n.name })
|
|
599
|
+
] })
|
|
600
|
+
}))
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
title: t("department.title"),
|
|
604
|
+
_id: "bumen",
|
|
605
|
+
children: g.map((n) => ({
|
|
606
|
+
...n,
|
|
607
|
+
title: /* @__PURE__ */ h("span", { className: k["department-search__title"], children: [
|
|
608
|
+
/* @__PURE__ */ e(P, { name: "dept-one", className: k["department-search__icon"], size: 16 }),
|
|
609
|
+
/* @__PURE__ */ e("span", { className: k["department-search__name"], children: n.name }),
|
|
610
|
+
["dockdept", "dockcorp", "dockcorpdept"].includes(n.type) && /* @__PURE__ */ h("span", { className: k["department-search__extra"], children: [
|
|
611
|
+
"(",
|
|
612
|
+
t("department.external"),
|
|
613
|
+
")"
|
|
614
|
+
] })
|
|
615
|
+
] })
|
|
616
|
+
}))
|
|
617
|
+
}
|
|
618
|
+
].filter((n) => n.children.length), m = x.map((n) => n._id), S = (n, f) => {
|
|
619
|
+
if (!f)
|
|
620
|
+
return;
|
|
621
|
+
if (r === v.DEPARMENT) {
|
|
622
|
+
i({
|
|
623
|
+
type: "insertOnly",
|
|
624
|
+
payload: {
|
|
625
|
+
...f,
|
|
626
|
+
type: f.departmentId ? "dockdept" : "group"
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
const L = o.some((M) => M._id === f._id);
|
|
632
|
+
i({
|
|
633
|
+
type: "addOne",
|
|
634
|
+
payload: {
|
|
635
|
+
...f,
|
|
636
|
+
_id: f._id,
|
|
637
|
+
type: L ? "group" : "dockdept"
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
}, R = (n) => {
|
|
641
|
+
i({
|
|
642
|
+
type: "deleteOne",
|
|
643
|
+
payload: n
|
|
644
|
+
});
|
|
645
|
+
}, c = d || y;
|
|
646
|
+
return /* @__PURE__ */ h("div", { className: k["department-search"], children: [
|
|
647
|
+
/* @__PURE__ */ e(ce, { spinning: c, children: /* @__PURE__ */ e(
|
|
648
|
+
X,
|
|
649
|
+
{
|
|
650
|
+
style: { height: _ - 8 },
|
|
651
|
+
className: k["department-search__scroll"],
|
|
652
|
+
children: x.length && !c ? /* @__PURE__ */ e("div", { className: k["department-search__tree-content"], children: /* @__PURE__ */ e(
|
|
653
|
+
oe,
|
|
654
|
+
{
|
|
655
|
+
data: x,
|
|
656
|
+
checkType: r === v.DEPARMENT ? "radio" : "checkbox",
|
|
657
|
+
selectedKeys: a?.map((n) => n._id),
|
|
658
|
+
fieldNames: {
|
|
659
|
+
title: "title",
|
|
660
|
+
children: "children",
|
|
661
|
+
value: "_id"
|
|
662
|
+
},
|
|
663
|
+
defaultExpandedKeys: m,
|
|
664
|
+
switcherIcon: (n) => /* @__PURE__ */ e(
|
|
665
|
+
P,
|
|
666
|
+
{
|
|
667
|
+
name: "xiangxiazhankai-11",
|
|
668
|
+
className: C(k["department-search__switch-icon"], {
|
|
669
|
+
[k["department-search__switch-icon--expanded"]]: n
|
|
670
|
+
})
|
|
671
|
+
}
|
|
672
|
+
),
|
|
673
|
+
onSelect: S,
|
|
674
|
+
onDeSelect: R
|
|
675
|
+
}
|
|
676
|
+
) }) : null
|
|
677
|
+
}
|
|
678
|
+
) }),
|
|
679
|
+
!x.length && !c && /* @__PURE__ */ e("div", { className: k["department-search__empty"], children: /* @__PURE__ */ e("span", { className: k["department-search__empty-text"], children: t("department.noAvailable") }) })
|
|
680
|
+
] });
|
|
681
|
+
}, ne = ({ wd: s, t: r, memberTabItems: a }) => ({
|
|
682
|
+
raw: /* @__PURE__ */ e(Ve, { wd: s }),
|
|
683
|
+
placeholder: r("tabs.searchMember"),
|
|
684
|
+
tabItems: a
|
|
685
|
+
}), ie = ({
|
|
686
|
+
wd: s,
|
|
687
|
+
t: r,
|
|
688
|
+
departmentTabItems: a
|
|
689
|
+
}) => ({
|
|
690
|
+
raw: /* @__PURE__ */ e(me, { wd: s }),
|
|
691
|
+
placeholder: r("tabs.searchDepartment"),
|
|
692
|
+
tabItems: a
|
|
693
|
+
}), We = ({
|
|
694
|
+
wd: s,
|
|
695
|
+
t: r,
|
|
696
|
+
deptUserTabItems: a
|
|
697
|
+
}) => ({
|
|
698
|
+
raw: /* @__PURE__ */ e(me, { wd: s }),
|
|
699
|
+
placeholder: r("common.searchPlaceholder"),
|
|
700
|
+
tabItems: a
|
|
701
|
+
}), ze = {
|
|
702
|
+
user: ne,
|
|
703
|
+
usergroup: ne,
|
|
704
|
+
dept: ie,
|
|
705
|
+
deptgroup: ie,
|
|
706
|
+
deptusers: We
|
|
707
|
+
}, Ke = (s, r) => {
|
|
708
|
+
const a = Ce(), i = Re(), _ = Te(), { t } = H(), l = ze[s];
|
|
709
|
+
if (!l)
|
|
710
|
+
throw new Error(`No search strategy found for type: ${s}`);
|
|
711
|
+
return {
|
|
712
|
+
config: l({
|
|
713
|
+
wd: r,
|
|
714
|
+
t,
|
|
715
|
+
memberTabItems: a,
|
|
716
|
+
departmentTabItems: i,
|
|
717
|
+
deptUserTabItems: _
|
|
718
|
+
})
|
|
719
|
+
};
|
|
720
|
+
}, Fe = () => {
|
|
721
|
+
const { type: s } = U(), [r, a] = D(), { config: i } = Ke(s, r), { tabItems: _ } = i, [t, l] = D(_[0].key), d = (u) => {
|
|
722
|
+
l(u), a(void 0);
|
|
723
|
+
}, p = _.find((u) => u.key === t)?.view, y = (u) => {
|
|
724
|
+
if (!u.trim().length) {
|
|
725
|
+
a(void 0);
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
a(u);
|
|
729
|
+
}, o = r ? i.raw : p, b = i.placeholder;
|
|
730
|
+
return /* @__PURE__ */ h("div", { className: C(Be["selection-tabs"]), children: [
|
|
731
|
+
/* @__PURE__ */ e(
|
|
732
|
+
$e,
|
|
733
|
+
{
|
|
734
|
+
value: t,
|
|
735
|
+
onChange: d,
|
|
736
|
+
onSearch: y,
|
|
737
|
+
tabs: _,
|
|
738
|
+
searchPlaceholder: b
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
/* @__PURE__ */ e(je, { children: o })
|
|
742
|
+
] });
|
|
743
|
+
}, Je = (s, r) => Oe(s, (a) => {
|
|
744
|
+
switch (r.type) {
|
|
745
|
+
case "addOne": {
|
|
746
|
+
const i = r.payload;
|
|
747
|
+
~a.findIndex((t) => t._id === i._id) || a.push(i);
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
case "addMany": {
|
|
751
|
+
r.payload.forEach((i) => {
|
|
752
|
+
~a.findIndex((t) => t._id === i._id) || a.push(i);
|
|
753
|
+
});
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
case "removeMany": {
|
|
757
|
+
const i = r.payload;
|
|
758
|
+
a.filter((t) => i.includes(t._id)).forEach((t) => {
|
|
759
|
+
const l = a.findIndex((d) => d._id === t._id);
|
|
760
|
+
~l && a.splice(l, 1);
|
|
761
|
+
});
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
case "removeAll": {
|
|
765
|
+
a.splice(0, a.length);
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
case "insertOnly": {
|
|
769
|
+
const i = r.payload;
|
|
770
|
+
a.length && (a.length = 0), a.push(i);
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
case "deleteOne": {
|
|
774
|
+
const i = r.payload, _ = a.findIndex((t) => t._id === i);
|
|
775
|
+
~_ && a.splice(_, 1);
|
|
776
|
+
break;
|
|
777
|
+
}
|
|
778
|
+
// 插入新元素 & 删除旧元素
|
|
779
|
+
case "deleteAndInsert": {
|
|
780
|
+
const { newItems: i, oldIds: _ } = r.payload;
|
|
781
|
+
_.forEach((t) => {
|
|
782
|
+
const l = a.findIndex((d) => d._id === t);
|
|
783
|
+
~l && a.splice(l, 1);
|
|
784
|
+
}), i.forEach((t) => {
|
|
785
|
+
~a.findIndex((d) => d._id === t._id) || a.push(t);
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}), T = {
|
|
790
|
+
"depts-member": "_depts-member_1yeqk_1",
|
|
791
|
+
"depts-member__body": "_depts-member__body_1yeqk_6",
|
|
792
|
+
"depts-member__content": "_depts-member__content_1yeqk_9",
|
|
793
|
+
"depts-member__footer": "_depts-member__footer_1yeqk_15",
|
|
794
|
+
"depts-member__clear-area": "_depts-member__clear-area_1yeqk_20",
|
|
795
|
+
"depts-member__clear-button": "_depts-member__clear-button_1yeqk_24",
|
|
796
|
+
"depts-member__actions": "_depts-member__actions_1yeqk_35",
|
|
797
|
+
"depts-member__cancel-button": "_depts-member__cancel-button_1yeqk_42",
|
|
798
|
+
"depts-member__confirm-button": "_depts-member__confirm-button_1yeqk_45"
|
|
799
|
+
}, yt = (s) => {
|
|
800
|
+
const { onCancel: r, onConfirm: a, onChange: i, defaultValue: _, type: t = "user", currentUser: l } = s, { t: d } = H(), [p, y] = _e(s, {
|
|
801
|
+
defaultValue: _ || []
|
|
802
|
+
}), o = ge(
|
|
803
|
+
(u) => {
|
|
804
|
+
const g = Je(p, u);
|
|
805
|
+
y(g), i?.(g);
|
|
806
|
+
},
|
|
807
|
+
[y, p, i]
|
|
808
|
+
), b = le(() => ({
|
|
809
|
+
type: t,
|
|
810
|
+
value: p,
|
|
811
|
+
setValue: y,
|
|
812
|
+
dispatch: o,
|
|
813
|
+
currentUser: l,
|
|
814
|
+
auth: {
|
|
815
|
+
publicPermissionEnable: s.auth?.publicPermissionEnable || !1,
|
|
816
|
+
managerPermissionEnable: s.auth?.managerPermissionEnable || !1
|
|
817
|
+
},
|
|
818
|
+
containerHeight: [v.USER_GROUP, v.DEPARMENT_GROUP].includes(t) ? 355 : 395
|
|
819
|
+
}), [
|
|
820
|
+
t,
|
|
821
|
+
p,
|
|
822
|
+
y,
|
|
823
|
+
o,
|
|
824
|
+
l,
|
|
825
|
+
s.auth?.publicPermissionEnable,
|
|
826
|
+
s.auth?.managerPermissionEnable
|
|
827
|
+
]);
|
|
828
|
+
return /* @__PURE__ */ h("div", { className: T["depts-member"], children: [
|
|
829
|
+
/* @__PURE__ */ e("div", { className: T["depts-member__body"], children: /* @__PURE__ */ e("div", { className: T["depts-member__content"], "data-teleport": "DeptsMember", children: /* @__PURE__ */ h(be.Provider, { value: b, children: [
|
|
830
|
+
/* @__PURE__ */ e(Ge, {}),
|
|
831
|
+
/* @__PURE__ */ e(Fe, {})
|
|
832
|
+
] }) }) }),
|
|
833
|
+
/* @__PURE__ */ h("div", { className: T["depts-member__footer"], children: [
|
|
834
|
+
[v.DEPARMENT_GROUP, v.USER_GROUP].includes(t) && /* @__PURE__ */ e("div", { className: T["depts-member__clear-area"], children: /* @__PURE__ */ h(
|
|
835
|
+
"div",
|
|
836
|
+
{
|
|
837
|
+
className: T["depts-member__clear-button"],
|
|
838
|
+
onClick: () => {
|
|
839
|
+
y([]);
|
|
840
|
+
},
|
|
841
|
+
children: [
|
|
842
|
+
/* @__PURE__ */ e(P, { name: "clearTree", size: 20, style: { verticalAlign: "sub" } }),
|
|
843
|
+
/* @__PURE__ */ e("span", { children: d("common.clearAll") })
|
|
844
|
+
]
|
|
845
|
+
}
|
|
846
|
+
) }),
|
|
847
|
+
/* @__PURE__ */ h("div", { className: T["depts-member__actions"], children: [
|
|
848
|
+
/* @__PURE__ */ e(F, { onClick: r, className: T["depts-member__cancel-button"], children: d("common.cancel") }),
|
|
849
|
+
/* @__PURE__ */ e(
|
|
850
|
+
F,
|
|
851
|
+
{
|
|
852
|
+
type: "primary",
|
|
853
|
+
className: T["depts-member__confirm-button"],
|
|
854
|
+
onClick: () => a?.(p),
|
|
855
|
+
children: d("common.confirm")
|
|
856
|
+
}
|
|
857
|
+
)
|
|
858
|
+
] })
|
|
859
|
+
] })
|
|
860
|
+
] });
|
|
861
|
+
};
|
|
862
|
+
export {
|
|
863
|
+
yt as D,
|
|
864
|
+
Le as g
|
|
865
|
+
};
|