@baishuyun/ui-business 2.0.0 → 2.0.3

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