@baishuyun/ui-business 2.0.0 → 2.0.1
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/DeptsMember/{DeptsMember-C54jKU8C.js → DeptsMember-C4fZKTp3.js} +249 -255
- package/dist/DeptsMember/TabGroup-C4h1Oi7h.js +137 -0
- package/dist/DeptsMember/index.js +2 -2
- package/dist/DeptsMember/subcomponents/Entity/Department/index.js +1 -9
- package/dist/DeptsMember/subcomponents/Entity/Member/index.js +34 -33
- package/dist/DeptsMember/utils/index.js +37 -35
- package/dist/components/DeptsMember/DeptsMember.type.d.ts +9 -3
- package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +1 -1
- package/dist/components/DeptsMember/index.d.ts +1 -1
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/AllMemeberCheck/AllMemeberCheck.d.ts +1 -0
- package/dist/components/DeptsMember/utils/constants.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/lang/en-US.json.d.ts +56 -55
- package/dist/lang/zh-CN.json.d.ts +56 -55
- package/dist/vendors/lodash-es.js +89 -84
- package/package.json +5 -1
- package/dist/DeptsMember/TabGroup-B_2npRbC.js +0 -121
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as G, a as L, E as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { CloseOutlined as
|
|
6
|
-
import { useState as T, useRef as M, useEffect as U, useMemo as
|
|
7
|
-
import { Icon as I, Tree as
|
|
2
|
+
import { c as k } from "../vendors/clsx.js";
|
|
3
|
+
import { u as G, a as L, E as d, M as pe, T as ue, P as he, G as X, b as fe, c as ne, D as be } from "./TabGroup-C4h1Oi7h.js";
|
|
4
|
+
import { Button as W, Avatar as B, Spin as ae } from "antd";
|
|
5
|
+
import { CloseOutlined as xe } from "@ant-design/icons";
|
|
6
|
+
import { useState as T, useRef as M, useEffect as U, useMemo as le, useCallback as ye } from "react";
|
|
7
|
+
import { Icon as I, Tree as se } from "bsy-react-ui";
|
|
8
8
|
import { createPortal as ve } from "react-dom";
|
|
9
9
|
import { AnimatePresence as Y, motion as J } from "motion/react";
|
|
10
|
-
import { useToggle as ge, useControllableValue as
|
|
11
|
-
import { getColorByName as
|
|
12
|
-
import { S as
|
|
10
|
+
import { useToggle as ge, useControllableValue as re, useRequest as F } from "ahooks";
|
|
11
|
+
import { getColorByName as z, findNodeInTree as Q } from "./utils/index.js";
|
|
12
|
+
import { S as q } from "../vendors/simplebar-react.js";
|
|
13
13
|
import { n as _e, d as Ne } from "../vendors/lodash-es.js";
|
|
14
14
|
import { useMemberTabItems as we } from "./subcomponents/Entity/Member/index.js";
|
|
15
15
|
import { useDepartmentTabItems as Ee } from "./subcomponents/Entity/Department/index.js";
|
|
@@ -18,82 +18,82 @@ import { g as Re } from "../vendors/services/data/member_limit.service.js";
|
|
|
18
18
|
import { g as Te } from "../vendors/services/data/member.service.js";
|
|
19
19
|
import { produce as De } from "immer";
|
|
20
20
|
const Ie = () => {
|
|
21
|
-
const { value:
|
|
21
|
+
const { value: n = [], setValue: i, type: t } = G(), { t: s } = L(), u = {
|
|
22
22
|
dockcorp: s("member.contact"),
|
|
23
23
|
dockcorpdept: s("department.contact")
|
|
24
|
-
}, [a,
|
|
24
|
+
}, [a, m] = T(0), [o, { toggle: h }] = ge(!1), [x, c] = T(!1), [b, _] = T(null), y = M(null), g = M(null), S = (E) => i?.(n.filter((A) => A._id !== E)), v = M(null), R = M(null), r = [d.DEPARMENT, d.USER].includes(t) ? pe : ue;
|
|
25
25
|
U(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
26
|
+
o && c(!0);
|
|
27
|
+
}, [o]);
|
|
28
28
|
const l = () => {
|
|
29
|
-
|
|
30
|
-
}, [
|
|
29
|
+
o || c(!1);
|
|
30
|
+
}, [N, H] = T(!1);
|
|
31
31
|
U(() => {
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
32
|
+
if (!v.current || !R.current) return;
|
|
33
|
+
const E = () => {
|
|
34
34
|
requestAnimationFrame(() => {
|
|
35
|
-
if (H(!1), !
|
|
36
|
-
const A =
|
|
37
|
-
if (
|
|
38
|
-
|
|
35
|
+
if (H(!1), !v.current || !R.current) return;
|
|
36
|
+
const A = v.current, V = Math.max(A.clientWidth, 924) - 20, f = R.current.querySelectorAll(".measure-list li");
|
|
37
|
+
if (f.length === 0) {
|
|
38
|
+
m(n.length);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
if (
|
|
42
|
-
console.warn("DOM not fully updated, retrying..."), requestAnimationFrame(() =>
|
|
41
|
+
if (f.length !== n.length) {
|
|
42
|
+
console.warn("DOM not fully updated, retrying..."), requestAnimationFrame(() => E());
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
let C = 0, P = 0, D = 0;
|
|
46
|
-
for (let
|
|
47
|
-
const O =
|
|
48
|
-
if (D + O <=
|
|
49
|
-
D += O, C =
|
|
46
|
+
for (let w = 0; w < f.length; ) {
|
|
47
|
+
const O = f[w].clientWidth + X;
|
|
48
|
+
if (D + O <= V)
|
|
49
|
+
D += O, C = w + 1, w++;
|
|
50
50
|
else {
|
|
51
|
-
P =
|
|
51
|
+
P = w;
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
D = 0;
|
|
56
|
-
const ce =
|
|
57
|
-
for (let
|
|
58
|
-
const O =
|
|
59
|
-
if (D + O +
|
|
60
|
-
D += O, C =
|
|
56
|
+
const ce = y.current?.offsetWidth || fe;
|
|
57
|
+
for (let w = P; w < f.length; w++) {
|
|
58
|
+
const O = f[w].clientWidth + X, me = w < n.length - 1 ? ce : 0;
|
|
59
|
+
if (D + O + me < V)
|
|
60
|
+
D += O, C = w + 1;
|
|
61
61
|
else {
|
|
62
62
|
H(!0);
|
|
63
63
|
break;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
a !== C &&
|
|
66
|
+
a !== C && m(C);
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
const j =
|
|
72
|
-
const A = [
|
|
69
|
+
E();
|
|
70
|
+
}, [n]);
|
|
71
|
+
const j = n.length - a, ie = N && !o, oe = o && g.current?.clientHeight || r, K = (E = !1) => {
|
|
72
|
+
const A = [d.DEPARMENT_GROUP, d.DEPARMENT].includes(t), V = E || o ? n.length : a;
|
|
73
73
|
return /* @__PURE__ */ e(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
77
|
-
"measure-list":
|
|
76
|
+
className: k({
|
|
77
|
+
"measure-list": E
|
|
78
78
|
}),
|
|
79
|
-
children: /* @__PURE__ */ p("ul", { className: "entity-list", ref:
|
|
80
|
-
|
|
81
|
-
const P =
|
|
79
|
+
children: /* @__PURE__ */ p("ul", { className: "entity-list", ref: E ? g : void 0, children: [
|
|
80
|
+
n.slice(0, V)?.map((f, C) => {
|
|
81
|
+
const P = f.name || f.nickname, D = f.type ? f.type : Object.prototype.hasOwnProperty.call(f, "departmentId") ? null : "group";
|
|
82
82
|
return /* @__PURE__ */ p(
|
|
83
83
|
"li",
|
|
84
84
|
{
|
|
85
|
-
className:
|
|
86
|
-
"entity-item--user": [
|
|
87
|
-
"entity-item--department": [
|
|
88
|
-
|
|
85
|
+
className: k("entity-item", {
|
|
86
|
+
"entity-item--user": [d.USER, d.USER_GROUP].includes(t),
|
|
87
|
+
"entity-item--department": [d.DEPARMENT, d.DEPARMENT_GROUP].includes(
|
|
88
|
+
t
|
|
89
89
|
)
|
|
90
90
|
}),
|
|
91
91
|
children: [
|
|
92
|
-
/* @__PURE__ */ e("div", { className: "entity-item__content", children: A ? /* @__PURE__ */ e(ne, { type: D }) :
|
|
93
|
-
|
|
92
|
+
/* @__PURE__ */ e("div", { className: "entity-item__content", children: A ? /* @__PURE__ */ e(ne, { type: D }) : f.avatarurl ? /* @__PURE__ */ e(B, { src: f.avatarurl, size: 20 }) : /* @__PURE__ */ e(
|
|
93
|
+
B,
|
|
94
94
|
{
|
|
95
95
|
style: {
|
|
96
|
-
backgroundColor:
|
|
96
|
+
backgroundColor: z(P),
|
|
97
97
|
fontSize: "12px",
|
|
98
98
|
lineHeight: "13px",
|
|
99
99
|
width: "20px",
|
|
@@ -102,11 +102,11 @@ const Ie = () => {
|
|
|
102
102
|
children: P?.charAt(0) || "?"
|
|
103
103
|
}
|
|
104
104
|
) }),
|
|
105
|
-
/* @__PURE__ */ p("div", { className: "entity-item__text", "data-type":
|
|
105
|
+
/* @__PURE__ */ p("div", { className: "entity-item__text", "data-type": f.type, children: [
|
|
106
106
|
/* @__PURE__ */ e("span", { className: "entity-item__name", children: P }),
|
|
107
|
-
|
|
107
|
+
f.type === "dockcorpdept" || f.type === "dockcorp" ? /* @__PURE__ */ p("span", { className: "entity-item__badge", children: [
|
|
108
108
|
"(",
|
|
109
|
-
|
|
109
|
+
u[f.type],
|
|
110
110
|
")"
|
|
111
111
|
] }) : null
|
|
112
112
|
] }),
|
|
@@ -115,8 +115,8 @@ const Ie = () => {
|
|
|
115
115
|
{
|
|
116
116
|
role: "button",
|
|
117
117
|
className: "entity-item__close",
|
|
118
|
-
onClick:
|
|
119
|
-
children: /* @__PURE__ */ e(
|
|
118
|
+
onClick: E ? _e : () => S(f._id),
|
|
119
|
+
children: /* @__PURE__ */ e(xe, {})
|
|
120
120
|
}
|
|
121
121
|
)
|
|
122
122
|
]
|
|
@@ -124,14 +124,14 @@ const Ie = () => {
|
|
|
124
124
|
C
|
|
125
125
|
);
|
|
126
126
|
}),
|
|
127
|
-
ie && !
|
|
127
|
+
ie && !E && /* @__PURE__ */ e("li", { ref: y, className: "entity-list__more", children: /* @__PURE__ */ p(
|
|
128
128
|
"div",
|
|
129
129
|
{
|
|
130
130
|
role: "button",
|
|
131
131
|
className: "entity-list__more-button",
|
|
132
132
|
onClick: () => {
|
|
133
|
-
const
|
|
134
|
-
|
|
133
|
+
const f = document.querySelector('[data-teleport="DeptsMember"]');
|
|
134
|
+
_(f), h();
|
|
135
135
|
},
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ e("span", { children: s("common.viewAll", { count: j }) }),
|
|
@@ -148,31 +148,31 @@ const Ie = () => {
|
|
|
148
148
|
{
|
|
149
149
|
className: "depts-member-selection-preview",
|
|
150
150
|
style: {
|
|
151
|
-
height:
|
|
151
|
+
height: x ? `${he}px` : "auto"
|
|
152
152
|
},
|
|
153
153
|
children: /* @__PURE__ */ p(
|
|
154
154
|
"div",
|
|
155
155
|
{
|
|
156
|
-
className:
|
|
157
|
-
expand:
|
|
158
|
-
"enable-animation":
|
|
156
|
+
className: k("depts-member-selection-preview-container", {
|
|
157
|
+
expand: o,
|
|
158
|
+
"enable-animation": x
|
|
159
159
|
}),
|
|
160
160
|
children: [
|
|
161
161
|
/* @__PURE__ */ p(
|
|
162
162
|
"div",
|
|
163
163
|
{
|
|
164
|
-
className:
|
|
165
|
-
expand:
|
|
164
|
+
className: k("preview-container__body", {
|
|
165
|
+
expand: o
|
|
166
166
|
}),
|
|
167
167
|
ref: R,
|
|
168
168
|
children: [
|
|
169
169
|
K(!0),
|
|
170
|
-
/* @__PURE__ */ e(
|
|
170
|
+
/* @__PURE__ */ e(q, { style: { maxHeight: "400px" }, children: /* @__PURE__ */ e("div", { ref: v, className: "preview-container__scroll-gutter", children: /* @__PURE__ */ e(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
173
|
className: "preview-container__scroll",
|
|
174
174
|
style: {
|
|
175
|
-
height:
|
|
175
|
+
height: oe + "px"
|
|
176
176
|
},
|
|
177
177
|
children: K()
|
|
178
178
|
}
|
|
@@ -181,7 +181,7 @@ const Ie = () => {
|
|
|
181
181
|
}
|
|
182
182
|
),
|
|
183
183
|
b && ve(
|
|
184
|
-
/* @__PURE__ */ e(Y, { children:
|
|
184
|
+
/* @__PURE__ */ e(Y, { children: o && /* @__PURE__ */ e(
|
|
185
185
|
J.div,
|
|
186
186
|
{
|
|
187
187
|
className: "depts-member-preview-container__mask",
|
|
@@ -194,7 +194,7 @@ const Ie = () => {
|
|
|
194
194
|
) }),
|
|
195
195
|
b
|
|
196
196
|
),
|
|
197
|
-
/* @__PURE__ */ e(Y, { mode: "wait", children:
|
|
197
|
+
/* @__PURE__ */ e(Y, { mode: "wait", children: o && /* @__PURE__ */ e(
|
|
198
198
|
J.div,
|
|
199
199
|
{
|
|
200
200
|
className: "preview-container__button",
|
|
@@ -202,7 +202,7 @@ const Ie = () => {
|
|
|
202
202
|
exit: { opacity: 0 },
|
|
203
203
|
transition: { duration: 0.3 },
|
|
204
204
|
onAnimationComplete: l,
|
|
205
|
-
children: /* @__PURE__ */ p(
|
|
205
|
+
children: /* @__PURE__ */ p(W, { type: "link", onClick: () => h(), children: [
|
|
206
206
|
s("common.collapseAll"),
|
|
207
207
|
/* @__PURE__ */ e(I, { name: "arrow-up" })
|
|
208
208
|
] })
|
|
@@ -213,53 +213,53 @@ const Ie = () => {
|
|
|
213
213
|
)
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
|
-
}, Ce = (
|
|
217
|
-
const [
|
|
218
|
-
defaultValue:
|
|
219
|
-
}), [s,
|
|
216
|
+
}, Ce = (n) => {
|
|
217
|
+
const [i, t] = re(n, {
|
|
218
|
+
defaultValue: n.tabs.length ? n.tabs[0].value : void 0
|
|
219
|
+
}), [s, u] = T(""), a = M(/* @__PURE__ */ new Map()), [m, o] = T({
|
|
220
220
|
width: 0,
|
|
221
221
|
transform: "translateX(0)"
|
|
222
|
-
}),
|
|
222
|
+
}), h = M(Ne((c) => n.onSearch?.(c), 250)).current;
|
|
223
223
|
U(() => () => {
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
const
|
|
224
|
+
h.cancel();
|
|
225
|
+
}, [h]);
|
|
226
|
+
const x = (c) => {
|
|
227
227
|
const b = a.current.get(c);
|
|
228
228
|
if (b) {
|
|
229
|
-
const { width:
|
|
230
|
-
|
|
231
|
-
width:
|
|
232
|
-
transform: `translateX(${
|
|
229
|
+
const { width: _, left: y } = b.getBoundingClientRect(), g = b.parentElement?.getBoundingClientRect().left || 0;
|
|
230
|
+
o({
|
|
231
|
+
width: _,
|
|
232
|
+
transform: `translateX(${y - g}px)`
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
return U(() => {
|
|
237
|
-
|
|
238
|
-
}, [
|
|
239
|
-
const c =
|
|
240
|
-
c &&
|
|
241
|
-
}, [
|
|
237
|
+
i && x(i);
|
|
238
|
+
}, [i]), U(() => {
|
|
239
|
+
const c = n.tabs.length ? n.tabs[0].value : void 0;
|
|
240
|
+
c && x(c);
|
|
241
|
+
}, [n.tabs]), /* @__PURE__ */ p("div", { className: "tab-bar flex justify-between px-[10px] border-b border-[#e0e0e0] relative", children: [
|
|
242
242
|
/* @__PURE__ */ e("div", { className: "tab-bar__list", children: /* @__PURE__ */ p("ul", { className: "tab-bar__list-container flex gap-10 relative py-[5px]", children: [
|
|
243
243
|
/* @__PURE__ */ e(
|
|
244
244
|
"div",
|
|
245
245
|
{
|
|
246
246
|
className: "absolute bottom-[-1px] h-[2px] bg-[#0265ff] transition-all duration-300 ease-in-out",
|
|
247
247
|
style: {
|
|
248
|
-
width: `${
|
|
249
|
-
transform:
|
|
248
|
+
width: `${m.width}px`,
|
|
249
|
+
transform: m.transform
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
),
|
|
253
|
-
|
|
253
|
+
n.tabs.map((c) => /* @__PURE__ */ e(
|
|
254
254
|
"li",
|
|
255
255
|
{
|
|
256
256
|
ref: (b) => {
|
|
257
257
|
b && a.current.set(c.value, b);
|
|
258
258
|
},
|
|
259
|
-
onClick: () =>
|
|
260
|
-
className:
|
|
261
|
-
"text-[#0265ff]":
|
|
262
|
-
"hover:text-[#0265ff]":
|
|
259
|
+
onClick: () => t(c.value),
|
|
260
|
+
className: k("tab-bar__list-item cursor-pointer relative py-1", {
|
|
261
|
+
"text-[#0265ff]": i === c.value,
|
|
262
|
+
"hover:text-[#0265ff]": i !== c.value
|
|
263
263
|
}),
|
|
264
264
|
children: c.label
|
|
265
265
|
},
|
|
@@ -273,10 +273,10 @@ const Ie = () => {
|
|
|
273
273
|
type: "text",
|
|
274
274
|
value: s,
|
|
275
275
|
onChange: (c) => {
|
|
276
|
-
|
|
276
|
+
u(c.target.value), h(c.target.value);
|
|
277
277
|
},
|
|
278
|
-
placeholder:
|
|
279
|
-
className:
|
|
278
|
+
placeholder: n.searchPlaceholder,
|
|
279
|
+
className: k(
|
|
280
280
|
"w-[280px] h-[30px] pl-8 pr-3 rounded-[100px] bg-white border border-[#E0E0E0] outline-none text-sm placeholder:text-[#999] transition-all duration-300 ease-in-out",
|
|
281
281
|
"hover:border-[#0265ff]"
|
|
282
282
|
)
|
|
@@ -291,173 +291,173 @@ const Ie = () => {
|
|
|
291
291
|
)
|
|
292
292
|
] }) })
|
|
293
293
|
] });
|
|
294
|
-
}, Pe = (
|
|
295
|
-
const { containerHeight:
|
|
294
|
+
}, Pe = (n) => {
|
|
295
|
+
const { containerHeight: i } = G();
|
|
296
296
|
return /* @__PURE__ */ e(
|
|
297
297
|
"div",
|
|
298
298
|
{
|
|
299
|
-
className:
|
|
299
|
+
className: k("tab-panel"),
|
|
300
300
|
style: {
|
|
301
|
-
height:
|
|
301
|
+
height: i + "px"
|
|
302
302
|
},
|
|
303
|
-
children:
|
|
303
|
+
children: n.children
|
|
304
304
|
}
|
|
305
305
|
);
|
|
306
306
|
}, Me = {
|
|
307
307
|
"selection-tabs": "_selection-tabs_88491_1"
|
|
308
|
-
}, Z = ({ avatarurl:
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
}, Z = ({ avatarurl: n, randomColor: i, name: t, extra: s }) => /* @__PURE__ */ p("div", { className: "flex flex-1 gap-[6px] items-center overflow-hidden ml-[-16px]", children: [
|
|
309
|
+
n ? /* @__PURE__ */ e(B, { src: n, size: 20, style: { flexShrink: 0 } }) : /* @__PURE__ */ e(
|
|
310
|
+
B,
|
|
311
311
|
{
|
|
312
312
|
style: {
|
|
313
|
-
backgroundColor:
|
|
313
|
+
backgroundColor: i,
|
|
314
314
|
fontSize: "12px",
|
|
315
315
|
lineHeight: "13px",
|
|
316
316
|
width: "20px",
|
|
317
317
|
height: "20px",
|
|
318
318
|
flexShrink: 0
|
|
319
319
|
},
|
|
320
|
-
children:
|
|
320
|
+
children: t.charAt(0)
|
|
321
321
|
}
|
|
322
322
|
),
|
|
323
|
-
/* @__PURE__ */ e("span", { className: "text-sm select-none text-ellipsis whitespace-nowrap overflow-hidden", children:
|
|
323
|
+
/* @__PURE__ */ e("span", { className: "text-sm select-none text-ellipsis whitespace-nowrap overflow-hidden", children: t }),
|
|
324
324
|
s
|
|
325
|
-
] }), ee = (
|
|
326
|
-
const { type:
|
|
325
|
+
] }), ee = (n) => {
|
|
326
|
+
const { type: i, dispatch: t, value: s, containerHeight: u } = G(), { t: a } = L(), { data: m, loading: o } = F(
|
|
327
327
|
() => ke({
|
|
328
328
|
groupLimit: [],
|
|
329
329
|
memberLimit: [],
|
|
330
330
|
limit: 100,
|
|
331
331
|
skip: 0,
|
|
332
|
-
key:
|
|
332
|
+
key: n.wd
|
|
333
333
|
}),
|
|
334
334
|
{
|
|
335
|
-
refreshDeps: [
|
|
335
|
+
refreshDeps: [n.wd]
|
|
336
336
|
}
|
|
337
|
-
), { data:
|
|
337
|
+
), { data: h, loading: x } = F(
|
|
338
338
|
() => Re({
|
|
339
|
-
key:
|
|
339
|
+
key: n.wd,
|
|
340
340
|
limit: 100,
|
|
341
341
|
skip: 0,
|
|
342
342
|
hasLimit: !1
|
|
343
343
|
}),
|
|
344
344
|
{
|
|
345
|
-
refreshDeps: [
|
|
345
|
+
refreshDeps: [n.wd]
|
|
346
346
|
}
|
|
347
|
-
), c =
|
|
347
|
+
), c = m?.list || [], b = h?.dock_user_list || [], _ = h?.users || [], y = [
|
|
348
348
|
{
|
|
349
349
|
title: a("externalContact.title"),
|
|
350
350
|
value: "waibulianxiren",
|
|
351
|
-
children: c.map((
|
|
352
|
-
const l =
|
|
351
|
+
children: c.map((r) => {
|
|
352
|
+
const l = r.nickname || r.name, N = z(l);
|
|
353
353
|
return {
|
|
354
|
-
...
|
|
354
|
+
...r,
|
|
355
355
|
title: /* @__PURE__ */ e(
|
|
356
356
|
Z,
|
|
357
357
|
{
|
|
358
|
-
avatarurl:
|
|
359
|
-
randomColor:
|
|
358
|
+
avatarurl: r.avatarurl,
|
|
359
|
+
randomColor: N,
|
|
360
360
|
name: l,
|
|
361
361
|
extra: /* @__PURE__ */ p("span", { className: "text-xs text-[#4d609f] shrink-0 truncate", children: [
|
|
362
362
|
"(",
|
|
363
363
|
a("externalContact.title"),
|
|
364
364
|
":",
|
|
365
|
-
|
|
365
|
+
r.groupname,
|
|
366
366
|
")"
|
|
367
367
|
] })
|
|
368
368
|
}
|
|
369
369
|
),
|
|
370
|
-
value:
|
|
370
|
+
value: r._id
|
|
371
371
|
};
|
|
372
372
|
})
|
|
373
373
|
},
|
|
374
374
|
{
|
|
375
375
|
title: a("member.title"),
|
|
376
376
|
value: "chengyuan",
|
|
377
|
-
children: [...
|
|
378
|
-
const l =
|
|
377
|
+
children: [..._, ...b].map((r) => {
|
|
378
|
+
const l = r.nickname || r.name, N = z(l);
|
|
379
379
|
return {
|
|
380
|
-
...
|
|
380
|
+
...r,
|
|
381
381
|
title: /* @__PURE__ */ e(
|
|
382
382
|
Z,
|
|
383
383
|
{
|
|
384
|
-
avatarurl:
|
|
385
|
-
randomColor:
|
|
384
|
+
avatarurl: r.avatarurl,
|
|
385
|
+
randomColor: N,
|
|
386
386
|
name: l,
|
|
387
|
-
extra: /* @__PURE__ */ e("span", { className: "text-xs text-[#4d609f] shrink-0 truncate", children:
|
|
387
|
+
extra: /* @__PURE__ */ e("span", { className: "text-xs text-[#4d609f] shrink-0 truncate", children: r.user_type === "dock_user" ? `(${a("department.external")}:${r.dock_corpname})` : r.deptnames })
|
|
388
388
|
}
|
|
389
389
|
),
|
|
390
|
-
value:
|
|
390
|
+
value: r._id
|
|
391
391
|
};
|
|
392
392
|
})
|
|
393
393
|
}
|
|
394
|
-
].filter((
|
|
395
|
-
if (
|
|
396
|
-
const l = Q(
|
|
397
|
-
l &&
|
|
394
|
+
].filter((r) => r.children.length), g = y.map((r) => r.value), S = x || o, v = (r) => {
|
|
395
|
+
if (d.USER === i) {
|
|
396
|
+
const l = Q(r, y);
|
|
397
|
+
l && t({
|
|
398
398
|
type: "insertOnly",
|
|
399
399
|
payload: {
|
|
400
400
|
...l
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
if (
|
|
405
|
-
const l = Q(
|
|
406
|
-
|
|
404
|
+
if (d.USER_GROUP === i) {
|
|
405
|
+
const l = Q(r, y);
|
|
406
|
+
t({
|
|
407
407
|
type: "addOne",
|
|
408
408
|
payload: {
|
|
409
409
|
...l
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
-
}, R = (
|
|
414
|
-
|
|
413
|
+
}, R = (r) => {
|
|
414
|
+
d.USER !== i && t({
|
|
415
415
|
type: "deleteOne",
|
|
416
|
-
payload:
|
|
416
|
+
payload: r
|
|
417
417
|
});
|
|
418
418
|
};
|
|
419
419
|
return /* @__PURE__ */ p("div", { className: "h-full relative overflow-hidden", children: [
|
|
420
|
-
/* @__PURE__ */ e(ae, { spinning: S, children: /* @__PURE__ */ e(
|
|
421
|
-
|
|
420
|
+
/* @__PURE__ */ e(ae, { spinning: S, children: /* @__PURE__ */ e(q, { style: { height: u - 8, padding: "4px" }, children: y.length && !S ? /* @__PURE__ */ e("div", { className: "p-1", children: /* @__PURE__ */ e(
|
|
421
|
+
se,
|
|
422
422
|
{
|
|
423
|
-
data:
|
|
424
|
-
checkType:
|
|
425
|
-
defaultSelectedKeys: s?.map((
|
|
426
|
-
defaultExpandedKeys:
|
|
427
|
-
switcherIcon: (
|
|
423
|
+
data: y,
|
|
424
|
+
checkType: i === d.USER ? "radio" : "checkbox",
|
|
425
|
+
defaultSelectedKeys: s?.map((r) => r._id),
|
|
426
|
+
defaultExpandedKeys: g,
|
|
427
|
+
switcherIcon: (r) => /* @__PURE__ */ e(
|
|
428
428
|
I,
|
|
429
429
|
{
|
|
430
430
|
name: "xiangxiazhankai-11",
|
|
431
|
-
className:
|
|
431
|
+
className: k(
|
|
432
432
|
"transition-transform duration-300 text-base ease-in-out text-[#666]",
|
|
433
433
|
{
|
|
434
|
-
"rotate-90":
|
|
434
|
+
"rotate-90": r
|
|
435
435
|
}
|
|
436
436
|
)
|
|
437
437
|
}
|
|
438
438
|
),
|
|
439
|
-
onSelect:
|
|
439
|
+
onSelect: v,
|
|
440
440
|
onDeSelect: R
|
|
441
441
|
}
|
|
442
442
|
) }) : null }) }),
|
|
443
|
-
!
|
|
443
|
+
!y.length && !S && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: a("member.noAvailable") }) })
|
|
444
444
|
] });
|
|
445
|
-
}, te = (
|
|
446
|
-
const { type:
|
|
445
|
+
}, te = (n) => {
|
|
446
|
+
const { type: i, value: t, dispatch: s, containerHeight: u } = G(), { t: a } = L(), { data: m, loading: o } = F(
|
|
447
447
|
() => Te({
|
|
448
448
|
departmentLimit: [],
|
|
449
|
-
key:
|
|
449
|
+
key: n.wd
|
|
450
450
|
}),
|
|
451
451
|
{
|
|
452
|
-
refreshDeps: [
|
|
452
|
+
refreshDeps: [n.wd]
|
|
453
453
|
}
|
|
454
|
-
), { data:
|
|
454
|
+
), { data: h, loading: x } = F(
|
|
455
455
|
() => Se()
|
|
456
|
-
), c =
|
|
456
|
+
), c = h?.list || [], b = m?.departments || [], _ = (m?.label_corp_list || []).filter((l) => l.type !== "dockcorpdept"), y = [...b, ..._].filter((l) => l.type !== "label"), g = [
|
|
457
457
|
{
|
|
458
458
|
title: a("externalContact.group"),
|
|
459
459
|
_id: "waibulianxiren",
|
|
460
|
-
children: c.filter((l) => l.status === 1 && l.name?.includes(
|
|
460
|
+
children: c.filter((l) => l.status === 1 && l.name?.includes(n.wd)).map((l) => ({
|
|
461
461
|
...l,
|
|
462
462
|
title: /* @__PURE__ */ p($, { children: [
|
|
463
463
|
/* @__PURE__ */ e(ne, { type: "group" }),
|
|
@@ -468,7 +468,7 @@ const Ie = () => {
|
|
|
468
468
|
{
|
|
469
469
|
title: a("department.title"),
|
|
470
470
|
_id: "bumen",
|
|
471
|
-
children:
|
|
471
|
+
children: y.map((l) => ({
|
|
472
472
|
...l,
|
|
473
473
|
title: /* @__PURE__ */ p($, { children: [
|
|
474
474
|
/* @__PURE__ */ e(I, { name: "dept-one", className: "text-[#0265ff] text-lg" }),
|
|
@@ -481,25 +481,25 @@ const Ie = () => {
|
|
|
481
481
|
] })
|
|
482
482
|
}))
|
|
483
483
|
}
|
|
484
|
-
].filter((l) => l.children.length), S =
|
|
485
|
-
if (!
|
|
484
|
+
].filter((l) => l.children.length), S = g.map((l) => l._id), v = (l, N) => {
|
|
485
|
+
if (!N)
|
|
486
486
|
return;
|
|
487
|
-
if (
|
|
487
|
+
if (i === d.DEPARMENT) {
|
|
488
488
|
s({
|
|
489
489
|
type: "insertOnly",
|
|
490
490
|
payload: {
|
|
491
|
-
...
|
|
492
|
-
type:
|
|
491
|
+
...N,
|
|
492
|
+
type: N.departmentId ? "dockdept" : "group"
|
|
493
493
|
}
|
|
494
494
|
});
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
|
-
const H = c.some((j) => j._id ===
|
|
497
|
+
const H = c.some((j) => j._id === N._id);
|
|
498
498
|
s({
|
|
499
499
|
type: "addOne",
|
|
500
500
|
payload: {
|
|
501
|
-
...
|
|
502
|
-
_id:
|
|
501
|
+
...N,
|
|
502
|
+
_id: N._id,
|
|
503
503
|
type: H ? "group" : "dockdept"
|
|
504
504
|
}
|
|
505
505
|
});
|
|
@@ -508,14 +508,14 @@ const Ie = () => {
|
|
|
508
508
|
type: "deleteOne",
|
|
509
509
|
payload: l
|
|
510
510
|
});
|
|
511
|
-
},
|
|
511
|
+
}, r = o || x;
|
|
512
512
|
return /* @__PURE__ */ p("div", { className: "relative overflow-hidden", children: [
|
|
513
|
-
/* @__PURE__ */ e(ae, { spinning:
|
|
514
|
-
|
|
513
|
+
/* @__PURE__ */ e(ae, { spinning: r, children: /* @__PURE__ */ e(q, { style: { height: u - 8 }, children: g.length && !r ? /* @__PURE__ */ e("div", { className: "p-1", children: /* @__PURE__ */ e(
|
|
514
|
+
se,
|
|
515
515
|
{
|
|
516
|
-
data:
|
|
517
|
-
checkType:
|
|
518
|
-
selectedKeys:
|
|
516
|
+
data: g,
|
|
517
|
+
checkType: i === d.DEPARMENT ? "radio" : "checkbox",
|
|
518
|
+
selectedKeys: t?.map((l) => l._id),
|
|
519
519
|
fieldNames: {
|
|
520
520
|
title: "title",
|
|
521
521
|
children: "children",
|
|
@@ -526,7 +526,7 @@ const Ie = () => {
|
|
|
526
526
|
I,
|
|
527
527
|
{
|
|
528
528
|
name: "xiangxiazhankai-11",
|
|
529
|
-
className:
|
|
529
|
+
className: k(
|
|
530
530
|
"transition-transform text-base duration-300 ease-in-out text-[#666]",
|
|
531
531
|
{
|
|
532
532
|
"rotate-90": l
|
|
@@ -534,148 +534,142 @@ const Ie = () => {
|
|
|
534
534
|
)
|
|
535
535
|
}
|
|
536
536
|
),
|
|
537
|
-
onSelect:
|
|
537
|
+
onSelect: v,
|
|
538
538
|
onDeSelect: R
|
|
539
539
|
}
|
|
540
540
|
) }) : null }) }),
|
|
541
|
-
!
|
|
541
|
+
!g.length && !r && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: a("department.noAvailable") }) })
|
|
542
542
|
] });
|
|
543
543
|
}, Ae = () => {
|
|
544
|
-
const { type:
|
|
545
|
-
[
|
|
546
|
-
raw: /* @__PURE__ */ e(ee, { wd:
|
|
547
|
-
placeholder:
|
|
544
|
+
const { type: n } = G(), { t: i } = L(), [t, s] = T(), u = we(), a = Ee(), m = {
|
|
545
|
+
[d.USER]: {
|
|
546
|
+
raw: /* @__PURE__ */ e(ee, { wd: t }),
|
|
547
|
+
placeholder: i("tabs.searchMember")
|
|
548
548
|
},
|
|
549
|
-
[
|
|
550
|
-
raw: /* @__PURE__ */ e(ee, { wd:
|
|
551
|
-
placeholder:
|
|
549
|
+
[d.USER_GROUP]: {
|
|
550
|
+
raw: /* @__PURE__ */ e(ee, { wd: t }),
|
|
551
|
+
placeholder: i("tabs.searchMember")
|
|
552
552
|
},
|
|
553
|
-
[
|
|
554
|
-
raw: /* @__PURE__ */ e(te, { wd:
|
|
555
|
-
placeholder:
|
|
553
|
+
[d.DEPARMENT]: {
|
|
554
|
+
raw: /* @__PURE__ */ e(te, { wd: t }),
|
|
555
|
+
placeholder: i("tabs.searchDepartment")
|
|
556
556
|
},
|
|
557
|
-
[
|
|
558
|
-
raw: /* @__PURE__ */ e(te, { wd:
|
|
559
|
-
placeholder:
|
|
557
|
+
[d.DEPARMENT_GROUP]: {
|
|
558
|
+
raw: /* @__PURE__ */ e(te, { wd: t }),
|
|
559
|
+
placeholder: i("tabs.searchDepartment")
|
|
560
560
|
}
|
|
561
|
-
},
|
|
562
|
-
[
|
|
563
|
-
[
|
|
564
|
-
[
|
|
565
|
-
[
|
|
566
|
-
}), [
|
|
567
|
-
c(
|
|
568
|
-
},
|
|
569
|
-
if (!
|
|
561
|
+
}, h = le(() => ({
|
|
562
|
+
[d.USER]: u,
|
|
563
|
+
[d.USER_GROUP]: u,
|
|
564
|
+
[d.DEPARMENT]: a,
|
|
565
|
+
[d.DEPARMENT_GROUP]: a
|
|
566
|
+
}), [u, a])[n], [x, c] = T(h[0].value), b = (v) => {
|
|
567
|
+
c(v), s(void 0);
|
|
568
|
+
}, _ = h.find((v) => v.value === x)?.view, y = (v) => {
|
|
569
|
+
if (!v.trim().length) {
|
|
570
570
|
s(void 0);
|
|
571
571
|
return;
|
|
572
572
|
}
|
|
573
|
-
s(
|
|
574
|
-
},
|
|
575
|
-
return /* @__PURE__ */ p("div", { className:
|
|
573
|
+
s(v);
|
|
574
|
+
}, g = t ? m[n]?.raw : _, S = m[n]?.placeholder;
|
|
575
|
+
return /* @__PURE__ */ p("div", { className: k(Me["selection-tabs"]), children: [
|
|
576
576
|
/* @__PURE__ */ e(
|
|
577
577
|
Ce,
|
|
578
578
|
{
|
|
579
|
-
value:
|
|
579
|
+
value: x,
|
|
580
580
|
onChange: b,
|
|
581
|
-
onSearch:
|
|
582
|
-
tabs:
|
|
581
|
+
onSearch: y,
|
|
582
|
+
tabs: h,
|
|
583
583
|
searchPlaceholder: S
|
|
584
584
|
}
|
|
585
585
|
),
|
|
586
|
-
/* @__PURE__ */ e(Pe, { children:
|
|
586
|
+
/* @__PURE__ */ e(Pe, { children: g })
|
|
587
587
|
] });
|
|
588
|
-
}, Oe = (
|
|
589
|
-
switch (
|
|
588
|
+
}, Oe = (n, i) => De(n, (t) => {
|
|
589
|
+
switch (i.type) {
|
|
590
590
|
case "addOne": {
|
|
591
|
-
const s =
|
|
592
|
-
~
|
|
591
|
+
const s = i.payload;
|
|
592
|
+
~t.findIndex((a) => a._id === s._id) || t.push(s);
|
|
593
593
|
break;
|
|
594
594
|
}
|
|
595
595
|
case "addMany": {
|
|
596
|
-
|
|
597
|
-
~
|
|
596
|
+
i.payload.forEach((s) => {
|
|
597
|
+
~t.findIndex((a) => a._id === s._id) || t.push(s);
|
|
598
598
|
});
|
|
599
599
|
break;
|
|
600
600
|
}
|
|
601
601
|
case "removeMany": {
|
|
602
|
-
const s =
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
~
|
|
602
|
+
const s = i.payload;
|
|
603
|
+
t.filter((a) => s.includes(a._id)).forEach((a) => {
|
|
604
|
+
const m = t.findIndex((o) => o._id === a._id);
|
|
605
|
+
~m && t.splice(m, 1);
|
|
606
606
|
});
|
|
607
607
|
break;
|
|
608
608
|
}
|
|
609
609
|
case "removeAll": {
|
|
610
|
-
|
|
610
|
+
t.splice(0, t.length);
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
613
|
case "insertOnly": {
|
|
614
|
-
const s =
|
|
615
|
-
|
|
614
|
+
const s = i.payload;
|
|
615
|
+
t.length && (t.length = 0), t.push(s);
|
|
616
616
|
break;
|
|
617
617
|
}
|
|
618
618
|
case "deleteOne": {
|
|
619
|
-
const s =
|
|
620
|
-
~
|
|
619
|
+
const s = i.payload, u = t.findIndex((a) => a._id === s);
|
|
620
|
+
~u && t.splice(u, 1);
|
|
621
621
|
break;
|
|
622
622
|
}
|
|
623
623
|
// 插入新元素 & 删除旧元素
|
|
624
624
|
case "deleteAndInsert": {
|
|
625
|
-
const { newItems: s, oldIds:
|
|
626
|
-
|
|
627
|
-
const
|
|
628
|
-
~
|
|
625
|
+
const { newItems: s, oldIds: u } = i.payload;
|
|
626
|
+
u.forEach((a) => {
|
|
627
|
+
const m = t.findIndex((o) => o._id === a);
|
|
628
|
+
~m && t.splice(m, 1);
|
|
629
629
|
}), s.forEach((a) => {
|
|
630
|
-
~
|
|
630
|
+
~t.findIndex((o) => o._id === a._id) || t.push(a);
|
|
631
631
|
});
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
}), Ue = {
|
|
635
635
|
"depts-member-selector": "_depts-member-selector_d4xq4_1"
|
|
636
|
-
}, nt = (
|
|
637
|
-
const { onCancel:
|
|
638
|
-
defaultValue: []
|
|
639
|
-
}),
|
|
640
|
-
(
|
|
641
|
-
const
|
|
642
|
-
|
|
636
|
+
}, nt = (n) => {
|
|
637
|
+
const { onCancel: i, onConfirm: t, onChange: s, defaultValue: u, type: a = "user" } = n, { t: m } = L(), [o, h] = re(n, {
|
|
638
|
+
defaultValue: u || []
|
|
639
|
+
}), x = ye(
|
|
640
|
+
(b) => {
|
|
641
|
+
const _ = Oe(o, b);
|
|
642
|
+
h(_), s?.(_);
|
|
643
643
|
},
|
|
644
|
-
[
|
|
645
|
-
)
|
|
644
|
+
[h, o, s]
|
|
645
|
+
), c = le(() => ({
|
|
646
|
+
type: a,
|
|
647
|
+
value: o,
|
|
648
|
+
setValue: h,
|
|
649
|
+
dispatch: x,
|
|
650
|
+
containerHeight: [d.USER_GROUP, d.DEPARMENT_GROUP].includes(a) ? 355 : 395
|
|
651
|
+
}), [a, o, h, x]);
|
|
646
652
|
return /* @__PURE__ */ p("div", { className: "depts-member-selector", children: [
|
|
647
|
-
/* @__PURE__ */ e("div", { className: "px-5 pt-5", children: /* @__PURE__ */ e("div", { className: Ue["depts-member-selector"], "data-teleport": "DeptsMember", children: /* @__PURE__ */ p(
|
|
648
|
-
|
|
649
|
-
{
|
|
650
|
-
|
|
651
|
-
type: t.type,
|
|
652
|
-
value: m,
|
|
653
|
-
setValue: a,
|
|
654
|
-
dispatch: u,
|
|
655
|
-
containerHeight: [o.USER_GROUP, o.DEPARMENT_GROUP].includes(t.type) ? 355 : 395
|
|
656
|
-
},
|
|
657
|
-
children: [
|
|
658
|
-
/* @__PURE__ */ e(Ie, {}),
|
|
659
|
-
/* @__PURE__ */ e(Ae, {})
|
|
660
|
-
]
|
|
661
|
-
}
|
|
662
|
-
) }) }),
|
|
653
|
+
/* @__PURE__ */ e("div", { className: "px-5 pt-5", children: /* @__PURE__ */ e("div", { className: Ue["depts-member-selector"], "data-teleport": "DeptsMember", children: /* @__PURE__ */ p(be.Provider, { value: c, children: [
|
|
654
|
+
/* @__PURE__ */ e(Ie, {}),
|
|
655
|
+
/* @__PURE__ */ e(Ae, {})
|
|
656
|
+
] }) }) }),
|
|
663
657
|
/* @__PURE__ */ p("div", { className: "flex py-[14px] px-5", children: [
|
|
664
|
-
[
|
|
665
|
-
|
|
658
|
+
[d.DEPARMENT_GROUP, d.USER_GROUP].includes(a) && /* @__PURE__ */ e("div", { className: "flex-auto", children: /* @__PURE__ */ e(
|
|
659
|
+
W,
|
|
666
660
|
{
|
|
667
661
|
type: "text",
|
|
668
662
|
className: "hover:bg-transparent hover:text-[#0265ff] pl-0",
|
|
669
663
|
icon: /* @__PURE__ */ e(I, { name: "clearTree", className: "text-lg", style: { verticalAlign: "sub" } }),
|
|
670
664
|
onClick: () => {
|
|
671
|
-
|
|
665
|
+
h([]);
|
|
672
666
|
},
|
|
673
|
-
children:
|
|
667
|
+
children: m("common.clearAll")
|
|
674
668
|
}
|
|
675
669
|
) }),
|
|
676
670
|
/* @__PURE__ */ p("div", { className: "flex-1 flex justify-end", children: [
|
|
677
|
-
/* @__PURE__ */ e(
|
|
678
|
-
/* @__PURE__ */ e(
|
|
671
|
+
/* @__PURE__ */ e(W, { onClick: i, className: "btn-cancel", children: m("common.cancel") }),
|
|
672
|
+
/* @__PURE__ */ e(W, { type: "primary", className: "ml-3", onClick: () => t?.(o), children: m("common.confirm") })
|
|
679
673
|
] })
|
|
680
674
|
] })
|
|
681
675
|
] });
|