@baishuyun/ui-business 2.0.1 → 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,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-C4h1Oi7h.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, y = 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, v = (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
- value: y,
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: v, 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",
@@ -190,7 +191,7 @@ const D = (t) => {
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,43 +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 v = 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
- children: v.length > 0 ? v : void 0
221
+ children: y.length > 0 ? y : void 0
221
222
  });
222
223
  }
223
224
  else {
224
- const v = n.children ? m(n.children, u) : [];
225
- v.length > 0 && C.push({
225
+ const y = n.children ? m(n.children, p) : [];
226
+ y.length > 0 && g.push({
226
227
  ...n,
227
- children: v
228
+ children: y
228
229
  });
229
230
  }
230
- return C;
231
- }, h = m(t.data, i), y = 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
  {
238
- title: i === "dockcorp" ? d("member.allContact") : void 0,
239
+ title: s === "dockcorp" ? d("member.allContact") : void 0,
239
240
  selected: t.selectLevel === t.unique_all,
240
- onSelect: () => t.onSelect(t.unique_all)
241
+ onSelect: () => t.onSelect(t.unique_all),
242
+ icon: /* @__PURE__ */ e(S, { name: "contactperson", size: 20 })
241
243
  }
242
244
  ),
243
245
  h.length > 0 && !l && /* @__PURE__ */ e(
@@ -252,10 +254,10 @@ const D = (t) => {
252
254
  selectedKeys: t.selectLevel ? [t.selectLevel] : [],
253
255
  onSelect: (c) => t.onSelect(c),
254
256
  parentCheckable: !0,
255
- defaultExpandedKeys: y.length === 1 ? y : [],
256
- icon: () => /* @__PURE__ */ e(M, { name: "dept-one", className: K["bsy-external-member__icon"] }),
257
+ defaultExpandedKeys: v.length === 1 ? v : [],
258
+ icon: () => /* @__PURE__ */ e(S, { name: "dept-one", className: K["bsy-external-member__icon"] }),
257
259
  switcherIcon: (c) => /* @__PURE__ */ e(
258
- M,
260
+ S,
259
261
  {
260
262
  name: "xiangxiazhankai-11",
261
263
  className: _(K["bsy-external-member__switcher-icon"], {
@@ -267,13 +269,13 @@ const D = (t) => {
267
269
  )
268
270
  ] })
269
271
  ] });
270
- }, ie = (t) => {
271
- const { loading: l, onSelect: b, unique_all: d, selectLevel: p } = t, { containerHeight: i } = I(), o = t.data?.map((m) => m.departmentId);
272
- 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: [
273
275
  /* @__PURE__ */ e(
274
276
  J,
275
277
  {
276
- selected: p === d,
278
+ selected: f === d,
277
279
  onSelect: () => b(d)
278
280
  }
279
281
  ),
@@ -290,9 +292,9 @@ const D = (t) => {
290
292
  onSelect: (m) => t.onSelect(m),
291
293
  parentCheckable: !0,
292
294
  defaultExpandedKeys: o.length === 1 ? o : [],
293
- 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 }),
294
296
  switcherIcon: (m) => /* @__PURE__ */ e(
295
- M,
297
+ S,
296
298
  {
297
299
  name: "xiangxiazhankai-11",
298
300
  className: _(
@@ -306,90 +308,104 @@ const D = (t) => {
306
308
  }
307
309
  )
308
310
  ] });
309
- }, F = Symbol("all key"), ce = () => {
310
- 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([
311
313
  { key: "internal", label: l("member.internal"), visible: !1 },
312
314
  { key: "external", label: l("member.external"), visible: !1 }
313
- ]), p = P(!0), [i, o] = N("internal"), { data: m, loading: h } = L(
314
- () => Z({ hasDeptDock: i === "external" }),
315
+ ]), f = P(!0), [s, o] = N("internal"), { data: m, loading: h } = L(
316
+ () => Z({ hasDeptDock: s === "external" }),
315
317
  {
316
- refreshDeps: [i],
317
- onSuccess: (r) => {
318
- if (r) {
319
- 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;
320
322
  d(
321
- O((g) => {
322
- g[0].visible = f, g[1].visible = k;
323
+ O((x) => {
324
+ x[0].visible = u, x[1].visible = k;
323
325
  })
324
- ), 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));
325
327
  }
326
328
  }
327
329
  }
328
- ), y = B(() => {
330
+ ), v = B(() => {
329
331
  if (m) {
330
- if (i === "internal")
331
- return H(m.departments);
332
+ if (s === "internal")
333
+ return q(m.departments);
332
334
  {
333
- 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) => ({
334
- ...g,
335
- checkable: g.type !== "label",
336
- icon: /* @__PURE__ */ e(ee, { type: g.type })
337
- })), f = m.label_corp_list.length ? H(m.label_corp_list)[0].children : [];
338
- 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);
339
341
  }
340
342
  }
341
343
  return [];
342
- }, [m, i]), [c, u] = N(F), { data: C, loading: n } = L(
343
- () => i ? $({
344
- departmentId: c === F ? null : c,
345
- limit: 100,
346
- hasDeptDock: i === "external"
347
- }) : 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
+ },
348
364
  {
349
- refreshDeps: [i, c]
365
+ refreshDeps: [s, c]
350
366
  }
351
- ), v = C ? C.users : [], a = C ? C.dock_user_list : [], s = (i === "external" ? a : v) || [];
352
- return /* @__PURE__ */ x("div", { className: "member-entity flex line-height-normal h-full", children: [
353
- /* @__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(
354
370
  "li",
355
371
  {
356
372
  onClick: () => {
357
- o(r.key), u(F);
373
+ o(i.key), p(F);
358
374
  },
359
375
  className: _("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
360
- "bg-[#F0F6FF] text-[#0265ff]": i === r.key,
361
- "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
362
378
  }),
363
- children: r.label
379
+ children: i.label
364
380
  },
365
- r.key
381
+ i.key
366
382
  )) }) }),
367
- /* @__PURE__ */ e("section", { className: "flex-1 border-l border-[#E0E0E0]", children: /* @__PURE__ */ x(E, { spinning: h, children: [
368
- i === "internal" && /* @__PURE__ */ e(
369
- 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,
370
386
  {
371
387
  unique_all: F,
372
388
  selectLevel: c,
373
- onSelect: u,
374
- data: y
389
+ onSelect: p,
390
+ data: v
375
391
  }
376
392
  ),
377
- i === "external" && /* @__PURE__ */ e(
393
+ s === "external" && /* @__PURE__ */ e(
378
394
  ae,
379
395
  {
380
396
  unique_all: F,
381
397
  selectLevel: c,
382
- onSelect: u,
383
- data: y
398
+ onSelect: p,
399
+ data: v
384
400
  }
385
401
  )
386
402
  ] }) }),
387
- /* @__PURE__ */ x("section", { className: "flex-1 border-l border-[#E0E0E0] relative", children: [
388
- /* @__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 }) }) }) }),
389
- 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") }) })
390
406
  ] })
391
407
  ] });
392
- }, 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: [
393
409
  /* @__PURE__ */ e(
394
410
  "path",
395
411
  {
@@ -404,27 +420,27 @@ const D = (t) => {
404
420
  fill: "#6F81BD"
405
421
  }
406
422
  )
407
- ] }), oe = () => {
408
- const { containerHeight: t } = I(), { t: l } = S(), [b, d] = N([
423
+ ] }), de = () => {
424
+ const { containerHeight: t } = M(), { t: l } = I(), [b, d] = N([
409
425
  { key: "internal", label: l("role.internal"), visible: !1 },
410
426
  { key: "external", label: l("role.external"), visible: !1 }
411
- ]), [p, i] = N(), [o, m] = N();
427
+ ]), [f, s] = N(), [o, m] = N();
412
428
  L(() => Z({ hasDeptDock: !1 }), {
413
429
  onSuccess: (a) => {
414
430
  if (a) {
415
- 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;
416
432
  d(
417
- O((f) => {
418
- f[0].visible = s, f[1].visible = r;
433
+ O((u) => {
434
+ u[0].visible = r, u[1].visible = i;
419
435
  })
420
- ), s ? i("internal") : r && i("external");
436
+ ), r ? s("internal") : i && s("external");
421
437
  }
422
438
  }
423
439
  });
424
440
  const h = P({
425
441
  internal: [],
426
442
  external: []
427
- }), { loading: y } = L(
443
+ }), { loading: v } = L(
428
444
  () => Q({
429
445
  roleLimit: null
430
446
  }),
@@ -433,18 +449,18 @@ const D = (t) => {
433
449
  if (!a)
434
450
  h.current.internal = [], h.current.external = [];
435
451
  else {
436
- h.current.internal = X(a.roles, {
452
+ h.current.internal = Y(a.roles, {
437
453
  children: "children",
438
454
  title: "name",
439
455
  value: "role_id",
440
456
  parentId: "parent"
441
- }), h.current.external = a.dock_role.map((f) => (f.children = [], f.icon = /* @__PURE__ */ e(q, {}), f));
442
- const s = h.current.internal, r = h.current.external;
443
- 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);
444
460
  }
445
461
  }
446
462
  }
447
- ), { data: c, loading: u } = L(
463
+ ), { data: c, loading: p } = L(
448
464
  () => o ? W({
449
465
  roleId: o,
450
466
  limit: 100
@@ -452,25 +468,25 @@ const D = (t) => {
452
468
  {
453
469
  refreshDeps: [o]
454
470
  }
455
- ), C = c?.users || [], n = c?.dock_user_list || [], v = p === "external" ? n : C;
456
- 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: [
457
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(
458
474
  "li",
459
475
  {
460
- onClick: () => i(a.key),
476
+ onClick: () => s(a.key),
461
477
  className: _("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
462
- "bg-[#F0F6FF] text-[#0265ff]": p === a.key,
463
- "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
464
480
  }),
465
481
  children: a.label
466
482
  },
467
483
  a.key
468
484
  )) }) }),
469
- /* @__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(
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(
470
486
  U,
471
487
  {
472
488
  showSwitcher: !1,
473
- data: p ? h.current[p] : [],
489
+ data: f ? h.current[f] : [],
474
490
  fieldNames: {
475
491
  title: "name",
476
492
  value: "role_id",
@@ -479,9 +495,9 @@ const D = (t) => {
479
495
  selectedKeys: o ? [o] : [],
480
496
  onSelect: (a) => m(a),
481
497
  parentCheckable: !0,
482
- 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, {}),
483
499
  switcherIcon: (a) => /* @__PURE__ */ e(
484
- M,
500
+ S,
485
501
  {
486
502
  name: "xiangxiazhankai-11",
487
503
  className: _(
@@ -494,20 +510,20 @@ const D = (t) => {
494
510
  )
495
511
  }
496
512
  ) }) }) }),
497
- /* @__PURE__ */ x("section", { className: "flex-1 border-l border-[#E0E0E0] relative", children: [
498
- /* @__PURE__ */ e(E, { spinning: u, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8, padding: "4px" }, children: v.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(
499
515
  D,
500
516
  {
501
- list: v,
517
+ list: y,
502
518
  badge: (a) => /* @__PURE__ */ e("span", { className: "truncate flex-1 text-[#4d609f] text-sm", title: a.deptnames, children: a.deptnames })
503
519
  }
504
520
  ) }) }),
505
- v.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") }) })
506
522
  ] })
507
523
  ] });
508
- }, de = () => {
509
- const { containerHeight: t } = I(), { t: l } = S(), [b, d] = N(), { data: p, loading: i } = L(
510
- () => te({
524
+ }, me = () => {
525
+ const { containerHeight: t } = M(), { t: l } = I(), [b, d] = N(), { data: f, loading: s } = L(
526
+ () => le({
511
527
  mode: "current",
512
528
  departmentLimit: []
513
529
  }),
@@ -516,8 +532,8 @@ const D = (t) => {
516
532
  c.items?.length && d(0);
517
533
  }
518
534
  }
519
- ), o = p?.items || [], { data: m, loading: h } = L(
520
- () => b === void 0 ? Promise.resolve({ list: [] }) : le({
535
+ ), o = f?.items || [], { data: m, loading: h } = L(
536
+ () => b === void 0 ? Promise.resolve({ list: [] }) : ne({
521
537
  job_title: o[b],
522
538
  // 职位名称
523
539
  limit: 100,
@@ -527,70 +543,70 @@ const D = (t) => {
527
543
  {
528
544
  refreshDeps: [b]
529
545
  }
530
- ), y = m?.list || [];
531
- return /* @__PURE__ */ x("div", { className: "h-full flex line-height-normal", children: [
532
- /* @__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(
546
+ ), v = m?.list || [];
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(
533
549
  "li",
534
550
  {
535
551
  onClick: () => {
536
- d(u);
552
+ d(p);
537
553
  },
538
554
  className: _("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
539
- "bg-[#F0F6FF] text-[#0265ff]": b === u,
540
- "text-black hover:bg-[#f3f3f3]": b !== u
555
+ "bg-[#F0F6FF] text-[#0265ff]": b === p,
556
+ "text-black hover:bg-[#f3f3f3]": b !== p
541
557
  }),
542
558
  children: c
543
559
  },
544
- u
560
+ p
545
561
  )) }) }) }) }),
546
- /* @__PURE__ */ x("div", { className: "flex-1 p-1 border-l border-[#E0E0E0] relative", children: [
547
- /* @__PURE__ */ e(E, { spinning: h, tip: l("common.loading"), children: /* @__PURE__ */ e(w, { style: { height: t - 8 }, children: y.length > 0 && /* @__PURE__ */ e(
562
+ /* @__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(
548
564
  D,
549
565
  {
550
- list: y,
566
+ list: v,
551
567
  badge: (c) => /* @__PURE__ */ e("div", { className: "truncate flex-1 text-[#4d609f] text-sm", children: /* @__PURE__ */ e("span", { title: c.deptnames, children: c.deptnames }) })
552
568
  }
553
569
  ) }) }),
554
- 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") }) })
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") }) })
555
571
  ] })
556
572
  ] });
557
- }, me = () => {
558
- const { containerHeight: t } = I(), { t: l } = S(), [b] = N([
573
+ }, he = () => {
574
+ const { containerHeight: t } = M(), { t: l } = I(), [b] = N([
559
575
  { key: "default", label: l("externalContact.defaultGroup"), visible: !0 },
560
576
  { key: "custom", label: l("externalContact.customGroup"), visible: !0 }
561
- ]), [d, p] = N("default"), [i, o] = N(), { data: m, loading: h } = L(
562
- () => ne(),
577
+ ]), [d, f] = N("default"), [s, o] = N(), { data: m, loading: h } = L(
578
+ () => re(),
563
579
  {
564
580
  refreshDeps: [d],
565
581
  onSuccess: (n) => {
566
582
  if (n && d === "custom") {
567
- const v = n.list.filter((a) => a.type !== "1");
568
- o(v[0]?._id);
583
+ const y = n.list.filter((a) => a.type !== "1");
584
+ o(y[0]?._id);
569
585
  }
570
586
  if (n && d === "default") {
571
- const v = n.list.filter((a) => a.type === "1");
572
- o(v[0]._id);
587
+ const y = n.list.filter((a) => a.type === "1");
588
+ o(y[0]._id);
573
589
  }
574
590
  }
575
591
  }
576
- ), { data: y, loading: c } = L(
577
- () => i ? se({
578
- group_id: i,
592
+ ), { data: v, loading: c } = L(
593
+ () => s ? ie({
594
+ group_id: s,
579
595
  limit: 100
580
596
  }) : Promise.resolve([]),
581
597
  {
582
- refreshDeps: [i]
598
+ refreshDeps: [s]
583
599
  }
584
600
  );
585
- let u = [];
586
- d === "custom" && (u = m?.list?.filter((n) => n.type !== "1") || []);
587
- const C = y?.list || [];
588
- 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: [
589
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(
590
606
  "li",
591
607
  {
592
608
  onClick: () => {
593
- 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));
594
610
  },
595
611
  className: _("px-[10px] py-[7px] rounded cursor-pointer text-sm select-none", {
596
612
  "bg-[#F0F6FF] text-[#0265ff]": d === n.key,
@@ -607,61 +623,61 @@ const D = (t) => {
607
623
  "flex-1 border-l border-[#E0E0E0] ": d === "custom",
608
624
  "flex-[0] p-0 flex-basis-0": d === "default"
609
625
  }),
610
- 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: [
611
- 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(
612
628
  "li",
613
629
  {
614
630
  onClick: () => o(n._id),
615
631
  className: _(
616
632
  "px-[10px] py-[7px] rounded cursor-pointer text-sm hover:bg-[#f3f3f3]",
617
633
  {
618
- "bg-[#F0F6FF] text-[#0265ff]": i === n._id
634
+ "bg-[#F0F6FF] text-[#0265ff]": s === n._id
619
635
  }
620
636
  ),
621
637
  children: n.name
622
638
  },
623
639
  n._id
624
640
  )),
625
- 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") }) })
626
642
  ] }) }) })
627
643
  }
628
644
  ),
629
- /* @__PURE__ */ x("section", { className: "flex-1 border-l border-[#E0E0E0] overflow-hidden relative", children: [
630
- /* @__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 }) }) }),
631
- 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") }) })
632
648
  ] })
633
649
  ] });
634
- }, he = () => {
635
- const { data: t } = L(() => re()), l = t?.user;
650
+ }, ue = () => {
651
+ const { data: t } = L(() => se()), l = t?.user;
636
652
  return /* @__PURE__ */ e("div", { className: "p-1 current-entity h-full", children: /* @__PURE__ */ e(D, { list: l ? [l] : [], showCheckAll: !1 }) });
637
653
  }, Se = () => {
638
- const { t } = S();
654
+ const { t } = I();
639
655
  return B(
640
656
  () => [
641
657
  {
642
658
  label: t("member.title"),
643
659
  value: "member",
644
- view: /* @__PURE__ */ e(ce, {})
660
+ view: /* @__PURE__ */ e(oe, {})
645
661
  },
646
662
  {
647
663
  label: t("role.title"),
648
664
  value: "role",
649
- view: /* @__PURE__ */ e(oe, {})
665
+ view: /* @__PURE__ */ e(de, {})
650
666
  },
651
667
  {
652
668
  label: t("position.title"),
653
669
  value: "job",
654
- view: /* @__PURE__ */ e(de, {})
670
+ view: /* @__PURE__ */ e(me, {})
655
671
  },
656
672
  {
657
673
  label: t("externalContact.title"),
658
674
  value: "externalContact",
659
- view: /* @__PURE__ */ e(me, {})
675
+ view: /* @__PURE__ */ e(he, {})
660
676
  },
661
677
  {
662
678
  label: t("currentUser.title"),
663
679
  value: "currentUser",
664
- view: /* @__PURE__ */ e(he, {})
680
+ view: /* @__PURE__ */ e(ue, {})
665
681
  }
666
682
  ],
667
683
  [t]