@baishuyun/ui-business 2.0.3 → 2.0.4

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