@baishuyun/ui-business 2.0.4 → 3.0.2

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,24 +1,24 @@
1
- import { jsx as e, jsxs as C, Fragment as V } from "react/jsx-runtime";
2
- import { useState as N, useRef as P, useMemo as B } from "react";
1
+ import { jsx as e, jsxs as C, Fragment as P } from "react/jsx-runtime";
2
+ import { useState as N, useRef as B, useMemo as Z } from "react";
3
3
  import { c as _ } from "../../../../vendors/clsx.js";
4
4
  import { useRequest as L } from "ahooks";
5
- import { g as Z, a as $, b as Q, c as W } from "../../../../vendors/services/data/member.service.js";
6
- import { produce as O } from "immer";
7
- import { getColorByName as j, buildDeptTree as q, findNodeInTree as X, buildTree as Y } from "../../../utils/index.js";
8
- import { Radio as H, Avatar as A, Spin as E } from "antd";
9
- import { u as I, a as M, E as T, d as ee, b as te } from "../../../TabGroup-LsBzSRvu.js";
10
- import { Checkbox as R, Icon as S, Tree as U } from "bsy-react-ui";
5
+ import { g as O, a as $, b as Q, c as W } from "../../../../vendors/services/data/member.service.js";
6
+ import { produce as J } from "immer";
7
+ import { getColorByName as U, buildDeptTree as H, findNodeInTree as X, buildTree as Y } from "../../../utils/index.js";
8
+ import { Radio as T, Avatar as A, Spin as E } from "antd";
9
+ import { u as I, a as M, E as G, d as ee, b as te } from "../../../TabGroup-CznMwTOD.js";
10
+ import { Checkbox as K, Icon as S, Tree as z } from "bsy-react-ui";
11
11
  import { S as w } from "../../../../vendors/simplebar-react.js";
12
12
  import { g as le, a as ne } from "../../../../vendors/services/data/department.service.js";
13
- import { g as re, a as ie } from "../../../../vendors/services/corp/outsider.service.js";
14
- import { g as se } from "../../../../vendors/services/team/team.services.js";
13
+ import { g as re, a as se } from "../../../../vendors/services/corp/outsider.service.js";
14
+ import { g as ie } from "../../../../vendors/services/team/team.services.js";
15
15
  const D = (t) => {
16
- const { list: l, showCheckAll: b = !0 } = t, { t: d } = I(), { value: f, type: s, dispatch: o } = M(), m = s === T.USER, h = s === T.USER_GROUP, v = f?.[0]?._id, c = (r) => {
17
- const i = l?.find((u) => u._id === r.target.value);
18
- i && o({
16
+ const { list: l, showCheckAll: b = !0 } = t, { t: d } = I(), { value: f, type: i, dispatch: o } = M(), m = i === G.USER, h = i === G.USER_GROUP, y = f?.[0]?._id, c = (r) => {
17
+ const s = l?.find((u) => u._id === r.target.value);
18
+ s && o({
19
19
  type: "insertOnly",
20
20
  payload: {
21
- ...i
21
+ ...s
22
22
  }
23
23
  });
24
24
  }, p = (r) => {
@@ -26,17 +26,17 @@ const D = (t) => {
26
26
  type: "deleteOne",
27
27
  payload: r
28
28
  });
29
- }, g = f?.map((r) => r._id) || [], n = l.filter((r) => g.includes(r._id)).length, y = (r) => {
30
- const i = [], u = [];
29
+ }, g = f?.map((r) => r._id) || [], n = l.filter((r) => g.includes(r._id)).length, v = (r) => {
30
+ const s = [], u = [];
31
31
  for (let k = 0; k < l.length; k++) {
32
32
  const x = l[k];
33
- r.includes(x._id) ? i.push(x) : u.push(x);
33
+ r.includes(x._id) ? s.push(x) : u.push(x);
34
34
  }
35
35
  o({
36
36
  type: "deleteAndInsert",
37
37
  payload: {
38
38
  oldIds: u.map((k) => k._id),
39
- newItems: i
39
+ newItems: s
40
40
  }
41
41
  });
42
42
  }, a = () => {
@@ -52,14 +52,14 @@ const D = (t) => {
52
52
  };
53
53
  return /* @__PURE__ */ e("div", { className: "memeber-list", children: /* @__PURE__ */ C("ul", { className: "font-0", children: [
54
54
  m && /* @__PURE__ */ e(
55
- H.Group,
55
+ T.Group,
56
56
  {
57
- value: v,
57
+ value: y,
58
58
  onChange: c,
59
59
  className: "w-full",
60
60
  prefixCls: "ant-radio",
61
61
  children: l.map((r) => {
62
- const i = r.nickname || r.name, u = j(i);
62
+ const s = r.nickname || r.name, u = U(s);
63
63
  return /* @__PURE__ */ e(
64
64
  "li",
65
65
  {
@@ -67,7 +67,7 @@ const D = (t) => {
67
67
  "hover:bg-[#f3f3f3]": !0
68
68
  }),
69
69
  children: /* @__PURE__ */ e(
70
- H,
70
+ T,
71
71
  {
72
72
  value: r._id,
73
73
  className: "px-[10px] py-[6px]",
@@ -86,10 +86,10 @@ const D = (t) => {
86
86
  height: "20px",
87
87
  flexShrink: 0
88
88
  },
89
- children: i.charAt(0)
89
+ children: s.charAt(0)
90
90
  }
91
91
  ),
92
- /* @__PURE__ */ e("span", { className: "text-sm select-none text-ellipsis whitespace-nowrap overflow-hidden shrink-0", children: i }),
92
+ /* @__PURE__ */ e("span", { className: "text-sm select-none text-ellipsis whitespace-nowrap overflow-hidden shrink-0", children: s }),
93
93
  t.badge && t.badge(r)
94
94
  ] })
95
95
  }
@@ -100,7 +100,7 @@ const D = (t) => {
100
100
  })
101
101
  }
102
102
  ),
103
- h && /* @__PURE__ */ C(V, { children: [
103
+ h && /* @__PURE__ */ C(P, { children: [
104
104
  b && /* @__PURE__ */ e(
105
105
  "li",
106
106
  {
@@ -108,7 +108,7 @@ const D = (t) => {
108
108
  "hover:bg-[#f3f3f3]": !0
109
109
  }),
110
110
  children: /* @__PURE__ */ e(
111
- R,
111
+ K,
112
112
  {
113
113
  labelPosition: "left",
114
114
  checked: n === l.length,
@@ -119,15 +119,15 @@ const D = (t) => {
119
119
  )
120
120
  }
121
121
  ),
122
- /* @__PURE__ */ e(R.Group, { value: g, onChange: y, children: l.map((r) => {
123
- const i = r.nickname || r.name, u = j(i);
122
+ /* @__PURE__ */ e(K.Group, { value: g, onChange: v, children: l.map((r) => {
123
+ const s = r.nickname || r.name, u = U(s);
124
124
  return /* @__PURE__ */ e(
125
125
  "li",
126
126
  {
127
127
  className: _("rounded-[4px] cursor-pointer font-0 px-[10px]", {
128
128
  "hover:bg-[#f3f3f3]": !0
129
129
  }),
130
- children: /* @__PURE__ */ e(R, { labelPosition: "left", value: r._id, children: /* @__PURE__ */ C("div", { className: "flex flex-1 gap-[6px] items-center py-[6px] overflow-hidden", children: [
130
+ children: /* @__PURE__ */ e(K, { labelPosition: "left", value: r._id, children: /* @__PURE__ */ C("div", { className: "flex flex-1 gap-[6px] items-center py-[7px] overflow-hidden", children: [
131
131
  r.avatarurl ? /* @__PURE__ */ e(A, { src: r.avatarurl, size: 20, style: { flexShrink: 0 } }) : /* @__PURE__ */ e(
132
132
  A,
133
133
  {
@@ -139,10 +139,10 @@ const D = (t) => {
139
139
  height: "20px",
140
140
  flexShrink: 0
141
141
  },
142
- children: i.charAt(0)
142
+ children: s.charAt(0)
143
143
  }
144
144
  ),
145
- /* @__PURE__ */ e("span", { className: "text-sm select-none text-ellipsis whitespace-nowrap overflow-hidden", children: i }),
145
+ /* @__PURE__ */ e("span", { className: "text-sm select-none text-ellipsis whitespace-nowrap overflow-hidden", children: s }),
146
146
  t.badge && t.badge(r)
147
147
  ] }) })
148
148
  },
@@ -151,25 +151,24 @@ const D = (t) => {
151
151
  }) })
152
152
  ] })
153
153
  ] }) });
154
- }, K = {
154
+ }, j = {
155
155
  "bsy-external-member__icon": "_bsy-external-member__icon_10zdq_20",
156
156
  "bsy-external-member__switcher-icon": "_bsy-external-member__switcher-icon_10zdq_24",
157
157
  "bsy-external-member__switcher-icon--expanded": "_bsy-external-member__switcher-icon--expanded_10zdq_29"
158
- }, z = {
159
- "bsy-all-member__all-option": "_bsy-all-member__all-option_tutqe_1",
160
- "bsy-all-member__all-option--selected": "_bsy-all-member__all-option--selected_tutqe_15",
161
- "bsy-all-member__all-option-icon": "_bsy-all-member__all-option-icon_tutqe_22"
162
- }, J = (t) => {
158
+ }, R = {
159
+ "bsy-all-member__all-option": "_bsy-all-member__all-option_8jfkj_1",
160
+ "bsy-all-member__all-option--selected": "_bsy-all-member__all-option--selected_8jfkj_14"
161
+ }, V = (t) => {
163
162
  const { t: l } = I();
164
163
  return /* @__PURE__ */ C(
165
164
  "div",
166
165
  {
167
- className: _(z["bsy-all-member__all-option"], {
168
- [z["bsy-all-member__all-option--selected"]]: t.selected
166
+ className: _(R["bsy-all-member__all-option"], {
167
+ [R["bsy-all-member__all-option--selected"]]: t.selected
169
168
  }),
170
169
  onClick: () => t.onSelect(!t.selected),
171
170
  children: [
172
- /* @__PURE__ */ e("div", { className: z["bsy-all-member__all-option-icon"], children: t.icon ? t.icon : /* @__PURE__ */ e(
171
+ /* @__PURE__ */ e("div", { className: R["bsy-all-member__all-option-icon"], children: t.icon ? t.icon : /* @__PURE__ */ e(
173
172
  "svg",
174
173
  {
175
174
  width: "20",
@@ -202,7 +201,7 @@ const D = (t) => {
202
201
  value: "dockcorpdept"
203
202
  /* DOCK_DEPARTMENT */
204
203
  }
205
- ], [s, o] = N(
204
+ ], [i, o] = N(
206
205
  "dockcorp"
207
206
  /* DOCK_PERSON_GROUP */
208
207
  ), m = (c, p) => {
@@ -215,188 +214,207 @@ const D = (t) => {
215
214
  children: n.children
216
215
  });
217
216
  else {
218
- const y = n.children ? m(n.children, p) : [];
217
+ const v = n.children ? m(n.children, p) : [];
219
218
  g.push({
220
219
  ...n,
221
- children: y.length > 0 ? y : void 0
220
+ children: v.length > 0 ? v : void 0
222
221
  });
223
222
  }
224
223
  else {
225
- const y = n.children ? m(n.children, p) : [];
226
- y.length > 0 && g.push({
224
+ const v = n.children ? m(n.children, p) : [];
225
+ v.length > 0 && g.push({
227
226
  ...n,
228
- children: y
227
+ children: v
229
228
  });
230
229
  }
231
230
  return g;
232
- }, h = m(t.data, s), v = h?.map((c) => c.departmentId);
233
- return /* @__PURE__ */ C("div", { className: K["bsy-external-member__container"], children: [
234
- /* @__PURE__ */ e(ee, { tabs: f, value: s, onChange: o }),
235
- /* @__PURE__ */ C(w, { style: { height: b - 34, padding: "4px" }, children: [
236
- /* @__PURE__ */ e(
237
- J,
238
- {
239
- title: s === "dockcorp" ? d("member.allContact") : void 0,
240
- selected: t.selectLevel === t.unique_all,
241
- onSelect: () => t.onSelect(t.unique_all),
242
- icon: /* @__PURE__ */ e(S, { name: "contactperson", size: 20 })
243
- }
244
- ),
245
- h.length > 0 && !l && /* @__PURE__ */ e(
246
- U,
247
- {
248
- data: h,
249
- fieldNames: {
250
- title: "name",
251
- value: "departmentId",
252
- children: "children"
253
- },
254
- selectedKeys: t.selectLevel ? [t.selectLevel] : [],
255
- onSelect: (c) => t.onSelect(c),
256
- parentCheckable: !0,
257
- defaultExpandedKeys: v.length === 1 ? v : [],
258
- icon: () => /* @__PURE__ */ e(S, { name: "dept-one", className: K["bsy-external-member__icon"] }),
259
- switcherIcon: (c) => /* @__PURE__ */ e(
260
- S,
231
+ }, h = m(t.data, i), y = h?.map((c) => c.departmentId);
232
+ return /* @__PURE__ */ C(P, { children: [
233
+ /* @__PURE__ */ e(ee, { tabs: f, value: i, onChange: o }),
234
+ /* @__PURE__ */ e(
235
+ w,
236
+ {
237
+ style: { height: b - 34 },
238
+ classNames: {
239
+ contentEl: "external-member-content-el"
240
+ },
241
+ children: /* @__PURE__ */ C("div", { style: { padding: "4px" }, children: [
242
+ /* @__PURE__ */ e(
243
+ V,
261
244
  {
262
- name: "xiangxiazhankai-11",
263
- className: _(K["bsy-external-member__switcher-icon"], {
264
- [K["bsy-external-member__switcher-icon--expanded"]]: c
265
- })
245
+ title: i === "dockcorp" ? d("member.allContact") : void 0,
246
+ selected: t.selectLevel === t.unique_all,
247
+ onSelect: () => t.onSelect(t.unique_all),
248
+ icon: /* @__PURE__ */ e(S, { name: "contactperson", size: 20, color: "#6f829e" })
249
+ }
250
+ ),
251
+ h.length > 0 && !l && /* @__PURE__ */ e(
252
+ z,
253
+ {
254
+ data: h,
255
+ fieldNames: {
256
+ title: "name",
257
+ value: "departmentId",
258
+ children: "children"
259
+ },
260
+ selectedKeys: t.selectLevel ? [t.selectLevel] : [],
261
+ onSelect: (c) => t.onSelect(c),
262
+ parentCheckable: !0,
263
+ defaultExpandedKeys: y.length === 1 ? y : [],
264
+ icon: () => /* @__PURE__ */ e(S, { name: "dept-one", className: j["bsy-external-member__icon"] }),
265
+ switcherIcon: (c) => /* @__PURE__ */ e(
266
+ S,
267
+ {
268
+ name: "xiangxiazhankai-11",
269
+ className: _(j["bsy-external-member__switcher-icon"], {
270
+ [j["bsy-external-member__switcher-icon--expanded"]]: c
271
+ })
272
+ }
273
+ )
266
274
  }
267
275
  )
268
- }
269
- )
270
- ] })
276
+ ] })
277
+ },
278
+ h.length
279
+ )
271
280
  ] });
272
281
  }, ce = (t) => {
273
- const { loading: l, onSelect: b, unique_all: d, selectLevel: f } = t, { containerHeight: s } = M(), o = t.data?.map((m) => m.departmentId);
274
- return /* @__PURE__ */ C(w, { style: { height: s - 8, padding: "4px" }, children: [
275
- /* @__PURE__ */ e(
276
- J,
277
- {
278
- selected: f === d,
279
- onSelect: () => b(d)
280
- }
281
- ),
282
- t.data.length > 0 && !l && /* @__PURE__ */ e(
283
- U,
284
- {
285
- data: t.data,
286
- fieldNames: {
287
- title: "name",
288
- value: "departmentId",
289
- children: "children"
290
- },
291
- selectedKeys: t.selectLevel ? [t.selectLevel] : [],
292
- onSelect: (m) => t.onSelect(m),
293
- parentCheckable: !0,
294
- defaultExpandedKeys: o.length === 1 ? o : [],
295
- icon: () => /* @__PURE__ */ e(S, { name: "dept-one", className: "text-[#0265ff]", size: 16 }),
296
- switcherIcon: (m) => /* @__PURE__ */ e(
297
- S,
282
+ const { loading: l, onSelect: b, unique_all: d, selectLevel: f } = t, { containerHeight: i } = M(), o = t.data?.map((m) => m.departmentId);
283
+ return /* @__PURE__ */ C(
284
+ w,
285
+ {
286
+ style: { height: i - 8, padding: "4px" },
287
+ classNames: {
288
+ contentEl: "internal-member-content-el"
289
+ },
290
+ children: [
291
+ /* @__PURE__ */ e(
292
+ V,
298
293
  {
299
- name: "xiangxiazhankai-11",
300
- className: _(
301
- "transition-transform text-base duration-300 ease-in-out text-[#666]",
294
+ selected: f === d,
295
+ onSelect: () => b(d)
296
+ }
297
+ ),
298
+ t.data.length > 0 && !l && /* @__PURE__ */ e(
299
+ z,
300
+ {
301
+ data: t.data,
302
+ fieldNames: {
303
+ title: "name",
304
+ value: "departmentId",
305
+ children: "children"
306
+ },
307
+ selectedKeys: t.selectLevel ? [t.selectLevel] : [],
308
+ onSelect: (m) => t.onSelect(m),
309
+ parentCheckable: !0,
310
+ defaultExpandedKeys: o.length === 1 ? o : [],
311
+ icon: () => /* @__PURE__ */ e(S, { name: "dept-one", className: "text-[#0265ff]", size: 16 }),
312
+ switcherIcon: (m) => /* @__PURE__ */ e(
313
+ S,
302
314
  {
303
- "rotate-90": m
315
+ name: "xiangxiazhankai-11",
316
+ className: _(
317
+ "transition-transform text-base duration-300 ease-in-out text-[#666]",
318
+ {
319
+ "rotate-90": m
320
+ }
321
+ )
304
322
  }
305
323
  )
306
324
  }
307
325
  )
308
- }
309
- )
310
- ] });
326
+ ]
327
+ }
328
+ );
311
329
  }, F = Symbol("all key"), oe = () => {
312
330
  const { containerHeight: t } = M(), { t: l } = I(), [b, d] = N([
313
331
  { key: "internal", label: l("member.internal"), visible: !1 },
314
332
  { key: "external", label: l("member.external"), visible: !1 }
315
- ]), f = P(!0), [s, o] = N("internal"), { data: m, loading: h } = L(
316
- () => Z({ hasDeptDock: s === "external" }),
333
+ ]), f = B(!0), [i, o] = N("internal"), { data: m, loading: h } = L(
334
+ () => O({ hasDeptDock: i === "external" }),
317
335
  {
318
- refreshDeps: [s],
319
- onSuccess: (i) => {
320
- if (i) {
321
- const u = i.departments_count > 0, k = i.label_corp_count > 0;
336
+ refreshDeps: [i],
337
+ onSuccess: (s) => {
338
+ if (s) {
339
+ const u = s.departments_count > 0, k = s.label_corp_count > 0;
322
340
  d(
323
- O((x) => {
341
+ J((x) => {
324
342
  x[0].visible = u, x[1].visible = k;
325
343
  })
326
344
  ), f.current && (f.current = !1, (u || k) && o(u ? b[0].key : b[1].key));
327
345
  }
328
346
  }
329
347
  }
330
- ), v = B(() => {
348
+ ), y = Z(() => {
331
349
  if (m) {
332
- if (s === "internal")
333
- return q(m.departments);
350
+ if (i === "internal")
351
+ return H(m.departments);
334
352
  {
335
- const i = (k) => k.filter((x) => (x.children && (x.children = i(x.children)), !((x.type === "label" || x.type === "dockcorpdept") && (!x.children || x.children.length === 0)))).map((x) => ({
353
+ const s = (k) => k.filter((x) => (x.children && (x.children = s(x.children)), !((x.type === "label" || x.type === "dockcorpdept") && (!x.children || x.children.length === 0)))).map((x) => ({
336
354
  ...x,
337
355
  checkable: x.type !== "label" && x.type !== "dockcorpdept",
338
- icon: /* @__PURE__ */ e(te, { type: x.type })
339
- })), u = m.label_corp_list.length ? q(m.label_corp_list)[0].children : [];
340
- return i(u);
356
+ icon: /* @__PURE__ */ e(te, { type: x.type, size: 16 })
357
+ })), u = m.label_corp_list.length ? H(m.label_corp_list)[0].children : [];
358
+ return s(u);
341
359
  }
342
360
  }
343
361
  return [];
344
- }, [m, s]), [c, p] = N(F), { data: g, loading: n } = L(
362
+ }, [m, i]), [c, p] = N(F), { data: g, loading: n } = L(
345
363
  () => {
346
- if (!s) return Promise.resolve({ users: [], dock_user_list: [] });
347
- const i = {
364
+ if (!i) return Promise.resolve({ users: [], dock_user_list: [] });
365
+ const s = {
348
366
  departmentId: c === F ? null : c,
349
367
  limit: 100,
350
- hasDeptDock: s === "external",
368
+ hasDeptDock: i === "external",
351
369
  current_corpid: null
352
370
  };
353
- if (s === "external" && c !== F) {
354
- const u = X(c, v, {
371
+ if (i === "external" && c !== F) {
372
+ const u = X(c, y, {
355
373
  title: "name",
356
374
  parentId: "parentId",
357
375
  value: "_id",
358
376
  children: "children"
359
377
  });
360
- i.current_corpid = u.owner_corpid;
378
+ s.current_corpid = u.owner_corpid;
361
379
  }
362
- return $(i);
380
+ return $(s);
363
381
  },
364
382
  {
365
- refreshDeps: [s, c]
383
+ refreshDeps: [i, c]
366
384
  }
367
- ), y = g ? g.users : [], a = g ? g.dock_user_list : [], r = (s === "external" ? a : y) || [];
385
+ ), v = g ? g.users : [], a = g ? g.dock_user_list : [], r = (i === "external" ? a : v) || [];
368
386
  return /* @__PURE__ */ C("div", { className: "member-entity flex line-height-normal h-full", children: [
369
- /* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: b.filter((i) => i.visible).map((i) => /* @__PURE__ */ e(
387
+ /* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: b.filter((s) => s.visible).map((s) => /* @__PURE__ */ e(
370
388
  "li",
371
389
  {
372
390
  onClick: () => {
373
- o(i.key), p(F);
391
+ o(s.key), p(F);
374
392
  },
375
393
  className: _("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
376
- "bg-[#F0F6FF] text-[#0265ff]": s === i.key,
377
- "text-black hover:bg-[#f3f3f3]": s !== i.key
394
+ "bg-[#F0F6FF] text-[#0265ff]": i === s.key,
395
+ "text-black hover:bg-[#f3f3f3]": i !== s.key
378
396
  }),
379
- children: i.label
397
+ children: s.label
380
398
  },
381
- i.key
399
+ s.key
382
400
  )) }) }),
383
401
  /* @__PURE__ */ e("section", { className: "flex-1 border-l border-[#E0E0E0]", children: /* @__PURE__ */ C(E, { spinning: h, children: [
384
- s === "internal" && /* @__PURE__ */ e(
402
+ i === "internal" && /* @__PURE__ */ e(
385
403
  ce,
386
404
  {
387
405
  unique_all: F,
388
406
  selectLevel: c,
389
407
  onSelect: p,
390
- data: v
408
+ data: y
391
409
  }
392
410
  ),
393
- s === "external" && /* @__PURE__ */ e(
411
+ i === "external" && /* @__PURE__ */ e(
394
412
  ae,
395
413
  {
396
414
  unique_all: F,
397
415
  selectLevel: c,
398
416
  onSelect: p,
399
- data: v
417
+ data: y
400
418
  }
401
419
  )
402
420
  ] }) }),
@@ -405,7 +423,7 @@ const D = (t) => {
405
423
  r.length === 0 && !n && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: l("member.noAvailable") }) })
406
424
  ] })
407
425
  ] });
408
- }, G = () => /* @__PURE__ */ C("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
426
+ }, q = () => /* @__PURE__ */ C("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
409
427
  /* @__PURE__ */ e(
410
428
  "path",
411
429
  {
@@ -424,23 +442,23 @@ const D = (t) => {
424
442
  const { containerHeight: t } = M(), { t: l } = I(), [b, d] = N([
425
443
  { key: "internal", label: l("role.internal"), visible: !1 },
426
444
  { key: "external", label: l("role.external"), visible: !1 }
427
- ]), [f, s] = N(), [o, m] = N();
428
- L(() => Z({ hasDeptDock: !1 }), {
445
+ ]), [f, i] = N(), [o, m] = N();
446
+ L(() => O({ hasDeptDock: !1 }), {
429
447
  onSuccess: (a) => {
430
448
  if (a) {
431
- const r = a.departments_count > 0, i = a.label_corp_count > 0;
449
+ const r = a.departments_count > 0, s = a.label_corp_count > 0;
432
450
  d(
433
- O((u) => {
434
- u[0].visible = r, u[1].visible = i;
451
+ J((u) => {
452
+ u[0].visible = r, u[1].visible = s;
435
453
  })
436
- ), r ? s("internal") : i && s("external");
454
+ ), r ? i("internal") : s && i("external");
437
455
  }
438
456
  }
439
457
  });
440
- const h = P({
458
+ const h = B({
441
459
  internal: [],
442
460
  external: []
443
- }), { loading: v } = L(
461
+ }), { loading: y } = L(
444
462
  () => Q({
445
463
  roleLimit: null
446
464
  }),
@@ -454,9 +472,9 @@ const D = (t) => {
454
472
  title: "name",
455
473
  value: "role_id",
456
474
  parentId: "parent"
457
- }), h.current.external = a.dock_role.map((u) => (u.children = [], u.icon = /* @__PURE__ */ e(G, {}), u));
458
- const r = h.current.internal, i = h.current.external;
459
- f === "internal" && r.length > 0 && m(r[0].role_id), f === "external" && i.length > 0 && m(i[0].role_id);
475
+ }), h.current.external = a.dock_role.map((u) => (u.children = [], u.icon = /* @__PURE__ */ e(q, {}), u));
476
+ const r = h.current.internal, s = h.current.external;
477
+ f === "internal" && r.length > 0 && m(r[0].role_id), f === "external" && s.length > 0 && m(s[0].role_id);
460
478
  }
461
479
  }
462
480
  }
@@ -468,12 +486,12 @@ const D = (t) => {
468
486
  {
469
487
  refreshDeps: [o]
470
488
  }
471
- ), g = c?.users || [], n = c?.dock_user_list || [], y = f === "external" ? n : g;
489
+ ), g = c?.users || [], n = c?.dock_user_list || [], v = f === "external" ? n : g;
472
490
  return /* @__PURE__ */ C("div", { className: "member-entity flex line-height-normal h-full", children: [
473
491
  /* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: b.filter((a) => a.visible).map((a) => /* @__PURE__ */ e(
474
492
  "li",
475
493
  {
476
- onClick: () => s(a.key),
494
+ onClick: () => i(a.key),
477
495
  className: _("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
478
496
  "bg-[#F0F6FF] text-[#0265ff]": f === a.key,
479
497
  "text-black hover:bg-[#f3f3f3]": f !== a.key
@@ -482,8 +500,8 @@ const D = (t) => {
482
500
  },
483
501
  a.key
484
502
  )) }) }),
485
- /* @__PURE__ */ e("section", { className: "flex-1 border-l border-[#E0E0E0] overflow-hidden", children: /* @__PURE__ */ e(E, { spinning: v, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8, padding: "4px" }, children: /* @__PURE__ */ e(
486
- U,
503
+ /* @__PURE__ */ e("section", { className: "flex-1 border-l border-[#E0E0E0] overflow-hidden", children: /* @__PURE__ */ e(E, { spinning: y, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8, padding: "4px" }, children: /* @__PURE__ */ e(
504
+ z,
487
505
  {
488
506
  showSwitcher: !1,
489
507
  data: f ? h.current[f] : [],
@@ -495,7 +513,7 @@ const D = (t) => {
495
513
  selectedKeys: o ? [o] : [],
496
514
  onSelect: (a) => m(a),
497
515
  parentCheckable: !0,
498
- icon: (a) => a.children && a.children.length > 0 ? /* @__PURE__ */ e(S, { name: "dept-one", className: "text-[#0265ff]", size: 16 }) : /* @__PURE__ */ e(G, {}),
516
+ icon: (a) => a.children && a.children.length > 0 ? /* @__PURE__ */ e(S, { name: "dept-one", className: "text-[#0265ff]", size: 16 }) : /* @__PURE__ */ e(q, {}),
499
517
  switcherIcon: (a) => /* @__PURE__ */ e(
500
518
  S,
501
519
  {
@@ -511,18 +529,18 @@ const D = (t) => {
511
529
  }
512
530
  ) }) }) }),
513
531
  /* @__PURE__ */ C("section", { className: "flex-1 border-l border-[#E0E0E0] relative", children: [
514
- /* @__PURE__ */ e(E, { spinning: p, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8, padding: "4px" }, children: y.length > 0 && /* @__PURE__ */ e(
532
+ /* @__PURE__ */ e(E, { spinning: p, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8, padding: "4px" }, children: v.length > 0 && /* @__PURE__ */ e(
515
533
  D,
516
534
  {
517
- list: y,
535
+ list: v,
518
536
  badge: (a) => /* @__PURE__ */ e("span", { className: "truncate flex-1 text-[#4d609f] text-sm", title: a.deptnames, children: a.deptnames })
519
537
  }
520
538
  ) }) }),
521
- y.length === 0 && !p && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: l("member.noAvailable") }) })
539
+ v.length === 0 && !p && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: l("member.noAvailable") }) })
522
540
  ] })
523
541
  ] });
524
542
  }, me = () => {
525
- const { containerHeight: t } = M(), { t: l } = I(), [b, d] = N(), { data: f, loading: s } = L(
543
+ const { containerHeight: t } = M(), { t: l } = I(), [b, d] = N(), { data: f, loading: i } = L(
526
544
  () => le({
527
545
  mode: "current",
528
546
  departmentLimit: []
@@ -543,9 +561,9 @@ const D = (t) => {
543
561
  {
544
562
  refreshDeps: [b]
545
563
  }
546
- ), v = m?.list || [];
564
+ ), y = m?.list || [];
547
565
  return /* @__PURE__ */ C("div", { className: "h-full flex line-height-normal", children: [
548
- /* @__PURE__ */ e("div", { className: "basis-[200px]", children: /* @__PURE__ */ e(E, { spinning: s, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8 }, children: /* @__PURE__ */ e("ul", { className: "flex flex-col p-1 text-[#121211]", children: o.map((c, p) => /* @__PURE__ */ e(
566
+ /* @__PURE__ */ e("div", { className: "basis-[200px]", children: /* @__PURE__ */ e(E, { spinning: i, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8 }, children: /* @__PURE__ */ e("ul", { className: "flex flex-col p-1 text-[#121211]", children: o.map((c, p) => /* @__PURE__ */ e(
549
567
  "li",
550
568
  {
551
569
  onClick: () => {
@@ -560,47 +578,47 @@ const D = (t) => {
560
578
  p
561
579
  )) }) }) }) }),
562
580
  /* @__PURE__ */ C("div", { className: "flex-1 p-1 border-l border-[#E0E0E0] relative", children: [
563
- /* @__PURE__ */ e(E, { spinning: h, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8 }, children: v.length > 0 && /* @__PURE__ */ e(
581
+ /* @__PURE__ */ e(E, { spinning: h, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8 }, children: y.length > 0 && /* @__PURE__ */ e(
564
582
  D,
565
583
  {
566
- list: v,
584
+ list: y,
567
585
  badge: (c) => /* @__PURE__ */ e("div", { className: "truncate flex-1 text-[#4d609f] text-sm", children: /* @__PURE__ */ e("span", { title: c.deptnames, children: c.deptnames }) })
568
586
  }
569
587
  ) }) }),
570
- v.length === 0 && !h && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: l("member.noAvailable") }) })
588
+ y.length === 0 && !h && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: l("member.noAvailable") }) })
571
589
  ] })
572
590
  ] });
573
591
  }, he = () => {
574
592
  const { containerHeight: t } = M(), { t: l } = I(), [b] = N([
575
593
  { key: "default", label: l("externalContact.defaultGroup"), visible: !0 },
576
594
  { key: "custom", label: l("externalContact.customGroup"), visible: !0 }
577
- ]), [d, f] = N("default"), [s, o] = N(), { data: m, loading: h } = L(
595
+ ]), [d, f] = N("default"), [i, o] = N(), { data: m, loading: h } = L(
578
596
  () => re(),
579
597
  {
580
598
  refreshDeps: [d],
581
599
  onSuccess: (n) => {
582
600
  if (n && d === "custom") {
583
- const y = n.list.filter((a) => a.type !== "1");
584
- o(y[0]?._id);
601
+ const v = n.list.filter((a) => a.type !== "1");
602
+ o(v[0]?._id);
585
603
  }
586
604
  if (n && d === "default") {
587
- const y = n.list.filter((a) => a.type === "1");
588
- o(y[0]._id);
605
+ const v = n.list.filter((a) => a.type === "1");
606
+ o(v[0]._id);
589
607
  }
590
608
  }
591
609
  }
592
- ), { data: v, loading: c } = L(
593
- () => s ? ie({
594
- group_id: s,
610
+ ), { data: y, loading: c } = L(
611
+ () => i ? se({
612
+ group_id: i,
595
613
  limit: 100
596
614
  }) : Promise.resolve([]),
597
615
  {
598
- refreshDeps: [s]
616
+ refreshDeps: [i]
599
617
  }
600
618
  );
601
619
  let p = [];
602
620
  d === "custom" && (p = m?.list?.filter((n) => n.type !== "1") || []);
603
- const g = v?.list || [];
621
+ const g = y?.list || [];
604
622
  return /* @__PURE__ */ C("div", { className: "external-contact-entity flex line-height-normal h-full", children: [
605
623
  /* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: b.filter((n) => n.visible).map((n) => /* @__PURE__ */ e(
606
624
  "li",
@@ -631,7 +649,7 @@ const D = (t) => {
631
649
  className: _(
632
650
  "px-[10px] py-[7px] rounded cursor-pointer text-sm hover:bg-[#f3f3f3]",
633
651
  {
634
- "bg-[#F0F6FF] text-[#0265ff]": s === n._id
652
+ "bg-[#F0F6FF] text-[#0265ff]": i === n._id
635
653
  }
636
654
  ),
637
655
  children: n.name
@@ -648,11 +666,11 @@ const D = (t) => {
648
666
  ] })
649
667
  ] });
650
668
  }, ue = () => {
651
- const { data: t } = L(() => se()), l = t?.user;
669
+ const { data: t } = L(() => ie()), l = t?.user;
652
670
  return /* @__PURE__ */ e("div", { className: "p-1 current-entity h-full", children: /* @__PURE__ */ e(D, { list: l ? [l] : [], showCheckAll: !1 }) });
653
671
  }, Se = () => {
654
672
  const { t } = I();
655
- return B(
673
+ return Z(
656
674
  () => [
657
675
  {
658
676
  label: t("member.title"),