@baishuyun/ui-business 5.1.4 → 5.1.6

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.
Files changed (42) hide show
  1. package/dist/BubbleChart/{AutoGridEChart-B2a7zGgi.js → AutoGridEChart-nA3DwlqB.js} +27 -25
  2. package/dist/BubbleChart/{BubbleChart-BPIsaE-C.js → BubbleChart-Bq-qzSTk.js} +3 -2
  3. package/dist/BubbleChart/index.js +2 -2
  4. package/dist/DeptsMemberSelector/{Department-CkzkA99U.js → Department-12ftZfXD.js} +4 -4
  5. package/dist/DeptsMemberSelector/{DeptsMemberSelector-CGggVPiJ.js → DeptsMemberSelector-BXWGwgUq.js} +160 -154
  6. package/dist/DeptsMemberSelector/DeptsUser-C8hYQ6z-.js +790 -0
  7. package/dist/DeptsMemberSelector/ExtraConcactPanel-BDNrz5rV.js +647 -0
  8. package/dist/DeptsMemberSelector/Member-B4tEHksu.js +375 -0
  9. package/dist/DeptsMemberSelector/{OrganizationPanel-BAhvhgOL.js → OrganizationPanel-DoM4UNxv.js} +3 -3
  10. package/dist/DeptsMemberSelector/{RelationShipDepts-DadyalUU.js → RelationShipDepts-kpemRPz1.js} +1 -1
  11. package/dist/DeptsMemberSelector/{RelationShipList-BVTUyw1-.js → RelationShipList-BhiAdVjm.js} +1 -1
  12. package/dist/DeptsMemberSelector/{TabGroup-DjfuvblW.js → TabGroup-Ds7bTbKL.js} +20 -4
  13. package/dist/DeptsMemberSelector/index.js +10 -10
  14. package/dist/DeptsMemberSelector/services/contact/{selector.service-cz8fZZaA.js → selector.service-CY5vQea8.js} +5 -3
  15. package/dist/DeptsMemberSelector/subcomponents/Entity/Department/index.js +4 -4
  16. package/dist/DeptsMemberSelector/subcomponents/Entity/DeptsUser/index.js +7 -7
  17. package/dist/DeptsMemberSelector/subcomponents/Entity/Member/index.js +4 -4
  18. package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +2 -2
  19. package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +2 -2
  20. package/dist/DeptsMemberSelector/{useDeptsMemberSelector-xc9GWJaL.js → useDeptsMemberSelector-t7b8yu-A.js} +1 -1
  21. package/dist/DeptsMemberSelector/utils/index.js +7 -4
  22. package/dist/Scatterplot/{Scatterplot-C1XSsAKR.js → Scatterplot-COVrzURp.js} +3 -2
  23. package/dist/Scatterplot/index.js +2 -2
  24. package/dist/components/BubbleChart/BubbleChart.type.d.ts +1 -0
  25. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersPositionPanel/DeptUsersPositionPanel.d.ts +2 -0
  26. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersPositionPanel/useDeptUsersPositionPanelData.d.ts +50 -0
  27. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersRolePanel/DeptUsersRolePanel.d.ts +2 -0
  28. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersRolePanel/useDeptUsersRolePanelData.d.ts +40 -0
  29. package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipMember/RelationShipMember.d.ts +1 -1
  30. package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/useMemberRelationShipPanelData.d.ts +1 -1
  31. package/dist/components/DeptsMemberSelector/utils/index.d.ts +2 -1
  32. package/dist/components/Scatterplot/Scatterplot.type.d.ts +1 -0
  33. package/dist/index.css +1 -1
  34. package/dist/index.js +13 -13
  35. package/dist/lang/en-US.json.d.ts +4 -1
  36. package/dist/lang/zh-CN.json.d.ts +4 -1
  37. package/dist/services/contact/selector.service.d.ts +6 -1
  38. package/dist/vendors/useLocale.js +8 -2
  39. package/package.json +3 -3
  40. package/dist/DeptsMemberSelector/DeptsUser-CaXbrm8n.js +0 -366
  41. package/dist/DeptsMemberSelector/ExtraConcactPanel-D5luX4_D.js +0 -953
  42. package/dist/DeptsMemberSelector/Member-DeBpChCx.js +0 -64
@@ -1,953 +0,0 @@
1
- import { t as e } from "../vendors/simplebar-react.js";
2
- import { t } from "../vendors/clsx.js";
3
- import { c as n, o as r, t as i } from "./useDeptsMemberSelector-xc9GWJaL.js";
4
- import { _ as a, a as o, c as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, t as _, u as v, v as y } from "./services/contact/selector.service-cz8fZZaA.js";
5
- import { n as b, r as x, t as S } from "./TabGroup-DjfuvblW.js";
6
- import { t as C } from "../vendors/useLocale.js";
7
- import { buildDeptTree as w, buildTree as T, findNodeInTree as ee, getColorByName as E } from "./utils/index.js";
8
- import { useMemo as D, useRef as O, useState as k } from "react";
9
- import { Avatar as A, Radio as j, Spin as M } from "antd";
10
- import { Checkbox as N, Icon as P, Tree as F } from "@baishuyun/ui-base";
11
- import { useRequest as I } from "ahooks";
12
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
13
- import { produce as B } from "immer";
14
- //#region src/components/DeptsMemberSelector/subcomponents/Entity/Member/MemerList/MemerList.module.scss
15
- var V = {
16
- "memer-list__option": "_memer-list__option_1txby_1",
17
- "memer-list__option--checkbox": "_memer-list__option--checkbox_1txby_9",
18
- "memer-list__option-inner": "_memer-list__option-inner_1txby_12",
19
- "memer-list__row": "_memer-list__row_1txby_15",
20
- "memer-list__name": "_memer-list__name_1txby_20",
21
- "memer-list__checkbox-row": "_memer-list__checkbox-row_1txby_27",
22
- "memer-list__selected-summary": "_memer-list__selected-summary_1txby_35",
23
- "memer-list__radio": "_memer-list__radio_1txby_40",
24
- "memer-list__checkbox": "_memer-list__checkbox_1txby_27",
25
- "memer-list__group": "_memer-list__group_1txby_46",
26
- "memer-list": "_memer-list_1txby_1"
27
- }, H = (e) => {
28
- let { list: n, showCheckAll: r = !0 } = e, { t: a } = C(), { value: o, type: s, dispatch: c } = i(), l = s === x.USER, u = s === x.USER_GROUP || s === x.DEPT_USERS, d = o?.[0]?._id, f = (e) => {
29
- let t = n?.find((t) => t._id === e.target.value);
30
- t && c({
31
- type: "insertOnly",
32
- payload: { ...t }
33
- });
34
- }, p = (e) => {
35
- c({
36
- type: "deleteOne",
37
- payload: e
38
- });
39
- }, m = o?.map((e) => e._id) || [], h = n.filter((e) => m.includes(e._id)).length;
40
- return /* @__PURE__ */ R("div", {
41
- className: V["memer-list"],
42
- children: /* @__PURE__ */ z("ul", {
43
- className: V["memer-list__list"],
44
- children: [l && /* @__PURE__ */ R(j.Group, {
45
- value: d,
46
- onChange: f,
47
- className: V["memer-list__group"],
48
- prefixCls: "ant-radio",
49
- children: n.map((t) => {
50
- let n = t.nickname || t.name, r = E(n);
51
- return /* @__PURE__ */ R("li", {
52
- className: V["memer-list__option"],
53
- children: /* @__PURE__ */ R(j, {
54
- value: t._id,
55
- className: V["memer-list__radio"],
56
- onClick: (e) => {
57
- p(e.target?.value);
58
- },
59
- children: /* @__PURE__ */ z("div", {
60
- className: V["memer-list__row"],
61
- children: [
62
- t.avatarurl ? /* @__PURE__ */ R(A, {
63
- src: t.avatarurl,
64
- size: 20,
65
- style: { flexShrink: 0 }
66
- }) : /* @__PURE__ */ R(A, {
67
- style: {
68
- backgroundColor: r,
69
- fontSize: "12px",
70
- lineHeight: "13px",
71
- width: "20px",
72
- height: "20px",
73
- flexShrink: 0
74
- },
75
- children: n.charAt(0)
76
- }),
77
- /* @__PURE__ */ R("span", {
78
- className: V["memer-list__name"],
79
- children: n
80
- }),
81
- e.badge && e.badge(t)
82
- ]
83
- })
84
- })
85
- }, t._id);
86
- })
87
- }), u && /* @__PURE__ */ z(L, { children: [r && /* @__PURE__ */ R("li", {
88
- className: t(V["memer-list__option"], V["memer-list__option--checkbox"]),
89
- children: /* @__PURE__ */ R(N, {
90
- labelPosition: "left",
91
- checked: h === n.length,
92
- indeterminate: h > 0 && h < n.length,
93
- className: V["memer-list__checkbox"],
94
- onChange: () => {
95
- h === n.length ? c({
96
- type: "removeMany",
97
- payload: n.map((e) => e._id)
98
- }) : c({
99
- type: "addMany",
100
- payload: n.map((e) => ({ ...e }))
101
- });
102
- },
103
- children: /* @__PURE__ */ R("div", {
104
- className: V["memer-list__selected-summary"],
105
- children: /* @__PURE__ */ R("span", { children: a("common.selected", {
106
- selected: h,
107
- total: n.length
108
- }) })
109
- })
110
- })
111
- }), /* @__PURE__ */ R(N.Group, {
112
- value: m,
113
- onChange: (e) => {
114
- let t = [], r = [];
115
- for (let i = 0; i < n.length; i++) {
116
- let a = n[i];
117
- e.includes(a._id) ? t.push(a) : r.push(a);
118
- }
119
- c({
120
- type: "deleteAndInsert",
121
- payload: {
122
- oldIds: r.map((e) => e._id),
123
- newItems: t
124
- }
125
- });
126
- },
127
- className: V["memer-list__group"],
128
- children: n.map((n) => {
129
- let r = n.nickname || n.name, i = E(r);
130
- return /* @__PURE__ */ R("li", {
131
- className: t(V["memer-list__option"], V["memer-list__option--checkbox"]),
132
- children: /* @__PURE__ */ R(N, {
133
- labelPosition: "left",
134
- value: n._id,
135
- className: V["memer-list__checkbox"],
136
- children: /* @__PURE__ */ z("div", {
137
- className: V["memer-list__checkbox-row"],
138
- children: [
139
- n.avatarurl ? /* @__PURE__ */ R(A, {
140
- src: n.avatarurl,
141
- size: 20,
142
- style: { flexShrink: 0 }
143
- }) : /* @__PURE__ */ R(A, {
144
- style: {
145
- backgroundColor: i,
146
- fontSize: "12px",
147
- lineHeight: "13px",
148
- width: "20px",
149
- height: "20px",
150
- flexShrink: 0
151
- },
152
- children: r.charAt(0)
153
- }),
154
- /* @__PURE__ */ R("span", {
155
- className: V["memer-list__name"],
156
- children: r
157
- }),
158
- e.badge && e.badge(n)
159
- ]
160
- })
161
- })
162
- }, n._id);
163
- })
164
- })] })]
165
- })
166
- });
167
- }, U = {
168
- "bsy-external-member__all-option": "_bsy-external-member__all-option_1jd7j_1",
169
- "bsy-external-member__all-option--selected": "_bsy-external-member__all-option--selected_1jd7j_13",
170
- "bsy-external-member__icon": "_bsy-external-member__icon_1jd7j_20",
171
- "bsy-external-member__switcher-icon": "_bsy-external-member__switcher-icon_1jd7j_24",
172
- "bsy-external-member__switcher-icon--expanded": "_bsy-external-member__switcher-icon--expanded_1jd7j_29",
173
- "bsy-external-member__content": "_bsy-external-member__content_1jd7j_32"
174
- }, W = {
175
- "bsy-all-member__all-option": "_bsy-all-member__all-option_8jfkj_1",
176
- "bsy-all-member__all-option--selected": "_bsy-all-member__all-option--selected_8jfkj_14"
177
- }, G = (e) => {
178
- let { t: n } = C();
179
- return /* @__PURE__ */ z("div", {
180
- className: t(W["bsy-all-member__all-option"], { [W["bsy-all-member__all-option--selected"]]: e.selected }),
181
- onClick: () => e.onSelect(!e.selected),
182
- children: [/* @__PURE__ */ R("div", {
183
- className: W["bsy-all-member__all-option-icon"],
184
- children: e.icon ? e.icon : /* @__PURE__ */ R("svg", {
185
- width: "20",
186
- height: "20",
187
- viewBox: "0 0 20 20",
188
- fill: "none",
189
- xmlns: "http://www.w3.org/2000/svg",
190
- children: /* @__PURE__ */ R("path", {
191
- d: "M10 1.25C12.3206 1.25 14.5462 2.17187 16.1872 3.81282C17.8281 5.45376 18.75 7.67936 18.75 10C18.75 12.3206 17.8281 14.5462 16.1872 16.1872C14.5462 17.8281 12.3206 18.75 10 18.75C7.67936 18.75 5.45376 17.8281 3.81282 16.1872C2.17187 14.5462 1.25 12.3206 1.25 10C1.25 7.67936 2.17187 5.45376 3.81282 3.81282C5.45376 2.17187 7.67936 1.25 10 1.25ZM9.4325 5H9.325L9.1125 5.00875C7.60875 5.13 7.165 6.5525 7.165 7.37875C7.13187 7.91241 7.22744 8.44621 7.44367 8.93523C7.6599 9.42424 7.99045 9.85415 8.4075 10.1888C8.52 10.3263 8.57625 10.4987 8.5675 10.675C8.53114 10.7896 8.45307 10.8864 8.34875 10.9462C7.645 11.48 5.14875 12.0837 4.99875 13.2712C4.8925 13.7575 4.13625 14.5675 6.59875 14.8713C7.54875 14.9963 8.50625 15.0487 9.4625 15.0325C15.1913 15.0325 14.0013 13.895 13.8412 13.2512L13.7887 13.0675C13.385 12.0588 11.2987 11.505 10.5062 11.0112L10.3837 10.9275L10.39 10.94L10.35 10.86C10.3352 10.8247 10.3231 10.7884 10.3138 10.7512L10.295 10.6375C10.284 10.4912 10.3023 10.3442 10.3488 10.205C10.3488 10.205 11.5912 9.5125 11.5912 7.37875C11.5375 6.515 11.0588 5 9.4325 5ZM12.9838 6.13125H12.785C12.5898 6.14356 12.3995 6.19815 12.2275 6.29125C12.4987 7.26125 12.8775 8.995 11.4163 10.125C10.8825 10.9363 12.7125 11.475 12.4462 11.315C14.1213 12.0725 14.6062 12.665 14.7175 13.2613C14.8238 13.7463 14.8775 14.0725 14.8775 14.0725C15.4241 13.9831 15.9602 13.8382 16.4775 13.64C16.512 13.3512 16.4937 13.0585 16.4237 12.7762L16.44 12.7863L16.4025 12.6213C16.11 11.765 14.355 11.355 13.8488 10.8938C13.7898 10.8138 13.7528 10.7199 13.7413 10.6213C13.7413 10.3488 13.795 10.2963 13.795 10.2963C14.1359 10.0305 14.4038 9.68268 14.5737 9.28524C14.7435 8.8878 14.8098 8.45377 14.7662 8.02375C14.7125 7.32 14.3337 6.13125 12.9838 6.13125ZM5.9225 6.14125H5.87L5.69 6.155C5.24076 6.2117 4.83017 6.43794 4.54227 6.78743C4.25436 7.13691 4.1109 7.58321 4.14125 8.035C4.08125 8.90375 4.44125 9.75 5.1125 10.3062C5.15324 10.4096 5.17156 10.5203 5.16625 10.6313C5.15471 10.7299 5.11766 10.8238 5.05875 10.9037C4.52625 11.3362 2.68 11.8212 2.52125 12.7975C2.49421 13.0668 2.49421 13.3382 2.52125 13.6075C2.93375 13.8025 3.36875 13.9475 3.81625 14.04C3.81625 14.04 3.87 13.7675 3.97625 13.39C4.03 12.8562 4.84 11.875 6.84 11.1125L6.97 11.0675C7.05625 11.035 7.13875 10.9963 7.22 10.9525C7.4375 10.7925 7.65125 10.52 7.22 10.1412C5.81625 8.0875 6.30125 6.73875 6.515 6.2475C6.32423 6.18149 6.12432 6.14564 5.9225 6.14125Z",
192
- fill: "#0265FF"
193
- })
194
- })
195
- }), /* @__PURE__ */ R("span", { children: e.title || n("member.all") })]
196
- });
197
- }, K = /* @__PURE__ */ function(e) {
198
- return e.DOCK_PERSON_GROUP = "dockcorp", e.DOCK_DEPARTMENT = "dockcorpdept", e;
199
- }(K || {}), q = (n) => {
200
- let { loading: r = !1 } = n, { containerHeight: a } = i(), { t: o } = C(), s = [{
201
- label: o("member.contact"),
202
- value: K.DOCK_PERSON_GROUP
203
- }, {
204
- label: o("department.title"),
205
- value: K.DOCK_DEPARTMENT
206
- }], [c, l] = k(K.DOCK_PERSON_GROUP), u = (e, t) => {
207
- let n = [];
208
- for (let r of e) if (r.type === t) if (t === "dockcorpdept") n.push({
209
- ...r,
210
- children: r.children
211
- });
212
- else {
213
- let e = r.children ? u(r.children, t) : [];
214
- n.push({
215
- ...r,
216
- children: e.length > 0 ? e : void 0
217
- });
218
- }
219
- else {
220
- let e = r.children ? u(r.children, t) : [];
221
- e.length > 0 && n.push({
222
- ...r,
223
- children: e
224
- });
225
- }
226
- return n;
227
- }, d = u(n.data, c), f = d?.map((e) => e.departmentId);
228
- return /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(S, {
229
- tabs: s,
230
- value: c,
231
- onChange: l
232
- }), /* @__PURE__ */ R(e, {
233
- style: { height: a - 34 },
234
- classNames: { contentEl: U["bsy-external-member__content"] },
235
- children: /* @__PURE__ */ z("div", {
236
- className: U["bsy-external-member__content"],
237
- children: [/* @__PURE__ */ R(G, {
238
- title: c === K.DOCK_PERSON_GROUP ? o("member.allContact") : void 0,
239
- selected: n.selectLevel === n.unique_all,
240
- onSelect: () => n.onSelect(n.unique_all),
241
- icon: /* @__PURE__ */ R(P, {
242
- name: "contactperson",
243
- size: 20,
244
- color: "#6f829e"
245
- })
246
- }), d.length > 0 && !r && /* @__PURE__ */ R(F, {
247
- data: d,
248
- fieldNames: {
249
- title: "name",
250
- value: "departmentId",
251
- children: "children"
252
- },
253
- selectedKeys: n.selectLevel ? [n.selectLevel] : [],
254
- onSelect: (e) => n.onSelect(e),
255
- parentCheckable: !0,
256
- defaultExpandedKeys: f.length === 1 ? f : [],
257
- icon: () => /* @__PURE__ */ R(P, {
258
- name: "dept-one",
259
- className: U["bsy-external-member__icon"]
260
- }),
261
- switcherIcon: (e) => /* @__PURE__ */ R(P, {
262
- name: "xiangxiazhankai-11",
263
- className: t(U["bsy-external-member__switcher-icon"], { [U["bsy-external-member__switcher-icon--expanded"]]: e })
264
- })
265
- })]
266
- })
267
- }, d.length)] });
268
- }, J = {
269
- "internal-member__content": "_internal-member__content_1aszs_1",
270
- "internal-member__icon": "_internal-member__icon_1aszs_4",
271
- "internal-member__switcher": "_internal-member__switcher_1aszs_8",
272
- "internal-member__switcher--expanded": "_internal-member__switcher--expanded_1aszs_13"
273
- }, te = (n) => {
274
- let { loading: r, onSelect: a, unique_all: o, selectLevel: s } = n, { containerHeight: c } = i(), l = n.data?.map((e) => e.departmentId);
275
- return /* @__PURE__ */ z(e, {
276
- style: {
277
- height: c - 8,
278
- padding: "4px"
279
- },
280
- classNames: { contentEl: J["internal-member__content"] },
281
- children: [/* @__PURE__ */ R(G, {
282
- selected: s === o,
283
- onSelect: () => a(o)
284
- }), n.data.length > 0 && !r && /* @__PURE__ */ R(F, {
285
- data: n.data,
286
- fieldNames: {
287
- title: "name",
288
- value: "departmentId",
289
- children: "children"
290
- },
291
- selectedKeys: n.selectLevel ? [n.selectLevel] : [],
292
- onSelect: (e) => n.onSelect(e),
293
- parentCheckable: !0,
294
- defaultExpandedKeys: l.length === 1 ? l : [],
295
- icon: () => /* @__PURE__ */ R(P, {
296
- name: "dept-one",
297
- className: J["internal-member__icon"],
298
- size: 16
299
- }),
300
- switcherIcon: (e) => /* @__PURE__ */ R(P, {
301
- name: "xiangxiazhankai-11",
302
- className: t(J["internal-member__switcher"], { [J["internal-member__switcher--expanded"]]: e })
303
- })
304
- })]
305
- });
306
- }, Y = {
307
- "member-panel": "_member-panel_1lhyj_1",
308
- "member-panel__overlay-empty": "_member-panel__overlay-empty_1lhyj_6",
309
- "member-panel__sidebar": "_member-panel__sidebar_1lhyj_13",
310
- "member-panel__menu": "_member-panel__menu_1lhyj_18",
311
- "member-panel__menu-item": "_member-panel__menu-item_1lhyj_23",
312
- "member-panel__menu-item--active": "_member-panel__menu-item--active_1lhyj_34",
313
- "member-panel__panel": "_member-panel__panel_1lhyj_38",
314
- "member-panel__panel--list": "_member-panel__panel--list_1lhyj_42",
315
- "member-panel__list-wrapper": "_member-panel__list-wrapper_1lhyj_45",
316
- "member-panel__empty": "_member-panel__empty_1lhyj_48",
317
- "member-panel__empty-text": "_member-panel__empty-text_1lhyj_55"
318
- }, X = Symbol("all key"), ne = () => {
319
- let e = i(), { containerHeight: t, type: a, requestContext: o, limits: s } = e, c = e.memberPanelRequestGuard ?? r, { t: l } = C(), [u, d] = k([{
320
- key: "internal",
321
- label: l("member.internal"),
322
- visible: !1
323
- }, {
324
- key: "external",
325
- label: l("member.external"),
326
- visible: !1
327
- }]), m = O(!0), v = O({
328
- internal: !1,
329
- external: !1
330
- }), y = O(), [x, S] = k("internal"), [E, A] = k(X), j = JSON.stringify({
331
- type: a,
332
- requestContext: o,
333
- limits: s,
334
- memberPanelRequestGuardEnabled: c.enabled
335
- });
336
- y.current !== j && (y.current = j, m.current = !0, v.current = {
337
- internal: !1,
338
- external: !1
339
- });
340
- let M = (e) => {
341
- S(e), A(X);
342
- }, { data: N, loading: P } = I(async () => a !== "deptusers" && !c.enabled ? {
343
- departments: [],
344
- departments_count: 0,
345
- label_corp_list: [],
346
- label_corp_count: 0
347
- } : a === "deptusers" ? p({
348
- requestContext: o,
349
- hasDeptDock: x === "external"
350
- }) : h({
351
- requestContext: o,
352
- limits: s,
353
- hasDeptDock: x === "external"
354
- }), {
355
- refreshDeps: [
356
- x,
357
- a,
358
- o,
359
- s,
360
- c.enabled
361
- ],
362
- onSuccess: (e) => {
363
- if (!e) return;
364
- let t = e.departments_count > 0, n = e.label_corp_count > 0, r = {
365
- internal: v.current.internal || t,
366
- external: v.current.external || n
367
- };
368
- v.current = r, d(B((e) => {
369
- e[0].visible = r.internal, e[1].visible = r.external;
370
- })), m.current && (m.current = !1, (t || n) && S(t ? "internal" : "external"));
371
- }
372
- }), F = D(() => {
373
- if (!N) return {
374
- internal: [],
375
- external: []
376
- };
377
- let e = w(N.departments || []), t = (e) => e.filter((e) => (e.children &&= t(e.children), !((e.type === "label" || e.type === "dockcorpdept") && (!e.children || e.children.length === 0)))).map((e) => ({
378
- ...e,
379
- checkable: e.type !== "label" && e.type !== "dockcorpdept",
380
- icon: /* @__PURE__ */ R(b, {
381
- type: e.type,
382
- size: 16
383
- })
384
- })), n = N.label_corp_list || [], r = n.length ? T(n, {
385
- value: "departmentId",
386
- children: "children",
387
- parentId: "parentId"
388
- }) : [];
389
- return {
390
- internal: e,
391
- external: t(r.length === 1 && r[0]?.type === "label" ? r[0].children || [] : r)
392
- };
393
- }, [N]), L = x === "internal" ? F.internal : F.external, z = D(() => {
394
- if (!(x !== "external" || E === X)) return ee(E, F.external, {
395
- title: "name",
396
- parentId: "parentId",
397
- value: "_id",
398
- children: "children"
399
- })?.owner_corpid;
400
- }, [
401
- x,
402
- E,
403
- F.external
404
- ]), { data: V, loading: H } = I(async () => {
405
- if (!x || a !== "deptusers" && !c.enabled) return [];
406
- if (a === "deptusers") return (await g({
407
- requestContext: o,
408
- deptId: E === X ? "" : E,
409
- limit: 1e4
410
- })).users || [];
411
- let e = await f({
412
- requestContext: o,
413
- limits: s,
414
- departmentId: E === X ? null : E,
415
- limit: _,
416
- hasDeptDock: x === "external",
417
- currentCorpId: z
418
- });
419
- return x === "external" ? e.dock_user_list || [] : e.users || [];
420
- }, { refreshDeps: [[
421
- a,
422
- x,
423
- String(E),
424
- z || "",
425
- o?.appId || "",
426
- o?.entryId || ""
427
- ].join(":"), c.enabled] });
428
- return {
429
- containerHeight: t,
430
- menuItems: u,
431
- activeKey: x,
432
- setActiveKey: M,
433
- selectKey: E,
434
- setSelectKey: A,
435
- uniqueAllKey: X,
436
- treeData: F,
437
- currentTreeData: L,
438
- userList: V || [],
439
- loading: P,
440
- memberLoading: H,
441
- showUnavailableOverlay: c.reason === n.LIMIT_WIDGET_EMPTY_ARRAY
442
- };
443
- }, re = () => {
444
- let { t: n } = C(), r = ne(), i = r.userList;
445
- return r.showUnavailableOverlay ? /* @__PURE__ */ R("div", {
446
- className: Y["member-panel"],
447
- children: /* @__PURE__ */ R("div", {
448
- className: Y["member-panel__overlay-empty"],
449
- children: /* @__PURE__ */ R("span", {
450
- className: Y["member-panel__empty-text"],
451
- children: n("member.noAvailable")
452
- })
453
- })
454
- }) : /* @__PURE__ */ z("div", {
455
- className: Y["member-panel"],
456
- children: [
457
- /* @__PURE__ */ R("aside", {
458
- className: Y["member-panel__sidebar"],
459
- children: /* @__PURE__ */ R("ul", {
460
- className: Y["member-panel__menu"],
461
- children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ R("li", {
462
- onClick: () => {
463
- r.setActiveKey(e.key);
464
- },
465
- className: t(Y["member-panel__menu-item"], { [Y["member-panel__menu-item--active"]]: r.activeKey === e.key }),
466
- children: e.label
467
- }, e.key))
468
- })
469
- }),
470
- /* @__PURE__ */ R("section", {
471
- className: Y["member-panel__panel"],
472
- children: /* @__PURE__ */ z(M, {
473
- spinning: r.loading,
474
- children: [r.activeKey === "internal" && /* @__PURE__ */ R(te, {
475
- unique_all: r.uniqueAllKey,
476
- selectLevel: r.selectKey,
477
- onSelect: r.setSelectKey,
478
- data: r.currentTreeData
479
- }), r.activeKey === "external" && /* @__PURE__ */ R(q, {
480
- unique_all: r.uniqueAllKey,
481
- selectLevel: r.selectKey,
482
- onSelect: r.setSelectKey,
483
- data: r.currentTreeData
484
- })]
485
- })
486
- }),
487
- /* @__PURE__ */ z("section", {
488
- className: t(Y["member-panel__panel"], Y["member-panel__panel--list"]),
489
- children: [/* @__PURE__ */ R(M, {
490
- spinning: r.memberLoading,
491
- children: /* @__PURE__ */ R(e, {
492
- style: { height: r.containerHeight - 8 },
493
- children: i.length > 0 && /* @__PURE__ */ R("div", {
494
- className: Y["member-panel__list-wrapper"],
495
- children: /* @__PURE__ */ R(H, { list: i })
496
- })
497
- })
498
- }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ R("div", {
499
- className: Y["member-panel__empty"],
500
- children: /* @__PURE__ */ R("span", {
501
- className: Y["member-panel__empty-text"],
502
- children: n("member.noAvailable")
503
- })
504
- })]
505
- })
506
- ]
507
- });
508
- }, Z = {
509
- "position-panel": "_position-panel_14wpw_1",
510
- "position-panel__menu": "_position-panel__menu_14wpw_6",
511
- "position-panel__menu-list": "_position-panel__menu-list_14wpw_9",
512
- "position-panel__menu-item": "_position-panel__menu-item_14wpw_15",
513
- "position-panel__menu-item--active": "_position-panel__menu-item--active_14wpw_25",
514
- "position-panel__list": "_position-panel__list_14wpw_32",
515
- "position-panel__badge": "_position-panel__badge_14wpw_38",
516
- "position-panel__empty": "_position-panel__empty_14wpw_48"
517
- }, ie = () => {
518
- let { containerHeight: e, type: t, requestContext: n, limits: r } = i(), [o, s] = k(), { data: c, loading: l } = I(() => t === x.DEPT_USERS ? m({ requestContext: n }) : a({
519
- requestContext: n,
520
- limits: r
521
- }), {
522
- onSuccess: (e) => {
523
- e.items?.length && s(0);
524
- },
525
- refreshDeps: [
526
- t,
527
- n,
528
- r
529
- ]
530
- }), u = c?.items || [], f = o === void 0 ? void 0 : u[o], p = typeof f == "string" ? f : f?.job_title || f?.name || "", h = typeof f == "string" ? void 0 : f?._id || f?.id, { data: g, loading: _ } = I(async () => p && (await d({
531
- requestContext: n,
532
- jobTitle: p,
533
- jobTitleId: h,
534
- limit: 1e4
535
- })).list || [], { refreshDeps: [
536
- t,
537
- o,
538
- p,
539
- h,
540
- n?.appId,
541
- n?.entryId
542
- ] });
543
- return {
544
- containerHeight: e,
545
- positionList: u,
546
- activePositionIndex: o,
547
- setActivePositionIndex: s,
548
- memberList: g || [],
549
- jobLoading: l,
550
- memberLoading: _
551
- };
552
- }, ae = () => {
553
- let { t: n } = C(), r = ie(), i = r.memberList;
554
- return /* @__PURE__ */ z("div", {
555
- className: Z["position-panel"],
556
- children: [/* @__PURE__ */ R("div", {
557
- className: Z["position-panel__menu"],
558
- children: /* @__PURE__ */ R(M, {
559
- spinning: r.jobLoading,
560
- tip: n("common.loading"),
561
- children: /* @__PURE__ */ R(e, {
562
- style: { height: r.containerHeight - 8 },
563
- children: /* @__PURE__ */ R("ul", {
564
- className: Z["position-panel__menu-list"],
565
- children: r.positionList.map((e, n) => /* @__PURE__ */ R("li", {
566
- onClick: () => {
567
- r.setActivePositionIndex(n);
568
- },
569
- className: t(Z["position-panel__menu-item"], { [Z["position-panel__menu-item--active"]]: r.activePositionIndex === n }),
570
- children: typeof e == "string" ? e : e.job_title || e.name || ""
571
- }, n))
572
- })
573
- })
574
- })
575
- }), /* @__PURE__ */ z("div", {
576
- className: Z["position-panel__list"],
577
- children: [/* @__PURE__ */ R(M, {
578
- spinning: r.memberLoading,
579
- tip: n("common.loading"),
580
- children: /* @__PURE__ */ R(e, {
581
- style: { height: r.containerHeight - 8 },
582
- children: i.length > 0 && /* @__PURE__ */ R(H, {
583
- list: i,
584
- badge: (e) => /* @__PURE__ */ R("div", {
585
- className: Z["position-panel__badge"],
586
- children: /* @__PURE__ */ R("span", {
587
- title: e.deptnames,
588
- children: e.deptnames
589
- })
590
- })
591
- })
592
- })
593
- }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ R("div", {
594
- className: Z["position-panel__empty"],
595
- children: /* @__PURE__ */ R("span", { children: n("member.noAvailable") })
596
- })]
597
- })]
598
- });
599
- }, Q = {
600
- "role-panel": "_role-panel_1efoc_1",
601
- "role-panel__menu": "_role-panel__menu_1efoc_6",
602
- "role-panel__menu-list": "_role-panel__menu-list_1efoc_10",
603
- "role-panel__menu-item": "_role-panel__menu-item_1efoc_14",
604
- "role-panel__menu-item--active": "_role-panel__menu-item--active_1efoc_25",
605
- "role-panel__tree-section": "_role-panel__tree-section_1efoc_32",
606
- "role-panel__tree-empty": "_role-panel__tree-empty_1efoc_38",
607
- "role-panel__tree-empty-text": "_role-panel__tree-empty-text_1efoc_45",
608
- "role-panel__tree-icon": "_role-panel__tree-icon_1efoc_48",
609
- "role-panel__switcher-icon": "_role-panel__switcher-icon_1efoc_51",
610
- "role-panel__switcher-icon--expanded": "_role-panel__switcher-icon--expanded_1efoc_56",
611
- "role-panel__list-section": "_role-panel__list-section_1efoc_59",
612
- "role-panel__badge": "_role-panel__badge_1efoc_64",
613
- "role-panel__empty": "_role-panel__empty_1efoc_72",
614
- "role-panel__empty-text": "_role-panel__empty-text_1efoc_79"
615
- }, oe = () => {
616
- let { containerHeight: e, type: t, requestContext: n, limits: r } = i(), { t: a } = C(), [o, c] = k([{
617
- key: "internal",
618
- label: a("role.internal"),
619
- visible: !1
620
- }, {
621
- key: "external",
622
- label: a("role.external"),
623
- visible: !1
624
- }]), [l, u] = k(), [d, f] = k(), m = O(), g = O({
625
- internal: [],
626
- external: []
627
- });
628
- I(() => t === x.DEPT_USERS ? p({
629
- requestContext: n,
630
- hasDeptDock: !1
631
- }) : h({
632
- requestContext: n,
633
- limits: r,
634
- hasDeptDock: !1
635
- }), {
636
- onSuccess: (e) => {
637
- if (!e) return;
638
- let t = e.departments_count > 0, n = e.label_corp_count > 0;
639
- c(B((e) => {
640
- e[0].visible = t, e[1].visible = n;
641
- })), t ? (m.current = "internal", u("internal")) : n ? (m.current = "external", u("external")) : m.current = void 0;
642
- },
643
- refreshDeps: [
644
- t,
645
- n,
646
- r
647
- ]
648
- });
649
- let { loading: b } = I(() => l ? t === x.DEPT_USERS ? s({ requestContext: n }) : y({
650
- requestContext: n,
651
- limits: r
652
- }) : Promise.resolve({
653
- roles: [],
654
- dock_role: []
655
- }), {
656
- onSuccess: (e) => {
657
- if (!e) {
658
- g.current.internal = [], g.current.external = [];
659
- return;
660
- }
661
- let t = Array.isArray(e.roles) ? e.roles : [], n = Array.isArray(e.dock_role) ? e.dock_role : [];
662
- g.current.internal = T(t, {
663
- children: "children",
664
- title: "name",
665
- value: "role_id",
666
- parentId: "parent"
667
- }), g.current.external = n.map((e) => ({
668
- ...e,
669
- children: []
670
- }));
671
- let r = l || m.current;
672
- if (r === "internal") {
673
- f(g.current.internal[0]?.role_id);
674
- return;
675
- }
676
- if (r === "external") {
677
- f(g.current.external[0]?.role_id);
678
- return;
679
- }
680
- f(void 0);
681
- },
682
- refreshDeps: [
683
- t,
684
- n,
685
- r,
686
- l
687
- ]
688
- }), { data: S, loading: w } = I(async () => {
689
- if (!d) return [];
690
- let e = await v({
691
- requestContext: n,
692
- roleId: d,
693
- roleLimit: r?.roleLimit || [],
694
- limit: _
695
- });
696
- return l === "external" ? e.dock_user_list || [] : e.users || [];
697
- }, { refreshDeps: [
698
- t,
699
- l,
700
- d,
701
- n,
702
- r
703
- ] });
704
- return {
705
- containerHeight: e,
706
- menuItems: o,
707
- activeKey: l,
708
- setActiveKey: u,
709
- roleId: d,
710
- setRoleId: f,
711
- roleTreeList: l ? g.current[l] : [],
712
- userList: S || [],
713
- loading: b,
714
- memberLoading: w
715
- };
716
- }, se = () => /* @__PURE__ */ z("svg", {
717
- xmlns: "http://www.w3.org/2000/svg",
718
- width: "16",
719
- height: "16",
720
- viewBox: "0 0 16 16",
721
- fill: "none",
722
- children: [/* @__PURE__ */ R("path", {
723
- d: "M6.91689 1.17578C8.59289 1.17578 10.0489 2.29878 10.4369 3.88878C10.8249 5.47878 10.0419 7.11978 8.54589 7.85578C8.49878 7.86731 8.4554 7.89073 8.41989 7.92378C8.40916 7.92486 8.3992 7.92984 8.39189 7.93778C8.3375 8.00344 8.30773 8.08602 8.30773 8.17128C8.30773 8.25654 8.3375 8.33913 8.39189 8.40478C8.40589 8.40478 8.40589 8.40478 8.40589 8.41978C8.51089 8.43478 8.61389 8.45778 8.71589 8.48878C9.67047 8.74298 10.5595 9.19889 11.3229 9.82578C10.634 9.60133 9.89434 9.58375 9.19553 9.77522C8.49671 9.96669 7.86935 10.3588 7.39105 10.9031C6.91274 11.4474 6.60448 12.1199 6.50439 12.8375C6.4043 13.5552 6.51677 14.2864 6.82789 14.9408H0.941894C0.824535 14.9397 0.708692 14.9141 0.601765 14.8658C0.494839 14.8174 0.399178 14.7472 0.320894 14.6598C0.243944 14.5736 0.186578 14.4717 0.152743 14.3613C0.118908 14.2508 0.109407 14.1343 0.124894 14.0198C0.507894 11.3728 2.46389 9.19978 5.10489 8.48878C5.20689 8.46078 5.30989 8.43778 5.41489 8.41878L5.42889 8.40478C5.46029 8.37464 5.48527 8.33846 5.50234 8.29842C5.5194 8.25838 5.5282 8.21531 5.5282 8.17178C5.5282 8.12826 5.5194 8.08518 5.50234 8.04514C5.48527 8.0051 5.46029 7.96892 5.42889 7.93878C5.41605 7.93306 5.40549 7.9232 5.39889 7.91078C5.36507 7.88725 5.32802 7.86872 5.28889 7.85578C3.79089 7.11978 3.00789 5.47978 3.39589 3.88978C3.78389 2.29978 5.23989 1.17678 6.91589 1.17678L6.91689 1.17578Z",
724
- fill: "#6F81BD"
725
- }), /* @__PURE__ */ R("path", {
726
- d: "M13.7918 11.8018C14.2438 11.8068 14.6598 12.0028 14.9758 12.3078C15.2878 12.6258 15.4588 13.0558 15.4528 13.5008L15.4488 13.5398C15.4463 13.9749 15.2741 14.3918 14.9688 14.7018C14.8161 14.8609 14.6329 14.9876 14.4302 15.0745C14.2275 15.1614 14.0094 15.2068 13.7888 15.2078L12.7458 15.1898C12.626 15.1876 12.5119 15.1378 12.4287 15.0514C12.3455 14.965 12.3001 14.8492 12.3023 14.7293C12.3046 14.6094 12.3544 14.4954 12.4407 14.4122C12.5271 14.329 12.643 14.2836 12.7628 14.2858L13.7988 14.3028C13.8967 14.3014 13.9933 14.2804 14.083 14.2411C14.1726 14.2017 14.2535 14.1449 14.3208 14.0738C14.4694 13.9206 14.552 13.7152 14.5508 13.5018C14.5541 13.3989 14.5367 13.2963 14.4998 13.2001C14.4629 13.104 14.4071 13.0161 14.3358 12.9418C14.2665 12.8663 14.1823 12.806 14.0885 12.7647C13.9947 12.7233 13.8933 12.7019 13.7908 12.7018L12.1528 12.7048C12.0534 12.7057 11.9552 12.7265 11.864 12.766C11.7728 12.8055 11.6905 12.8629 11.6218 12.9348C11.4735 13.0878 11.3909 13.2927 11.3918 13.5058C11.3922 13.5652 11.3808 13.6241 11.3584 13.6792C11.3359 13.7342 11.3029 13.7843 11.2611 13.8265C11.2193 13.8688 11.1696 13.9024 11.1148 13.9254C11.06 13.9485 11.0013 13.9605 10.9418 13.9608C10.8824 13.9611 10.8235 13.9498 10.7685 13.9273C10.7135 13.9049 10.6634 13.8718 10.6211 13.83C10.5789 13.7883 10.5453 13.7386 10.5222 13.6838C10.4992 13.629 10.4872 13.5702 10.4868 13.5108C10.4845 13.063 10.6579 12.6321 10.9698 12.3108C11.1226 12.1511 11.306 12.0239 11.5091 11.9368C11.7122 11.8496 11.9308 11.8044 12.1518 11.8038L13.7918 11.8018ZM10.2688 11.7648C10.3885 11.7616 10.5044 11.8061 10.5913 11.8884C10.6781 11.9707 10.7287 12.0842 10.7318 12.2038C10.735 12.3234 10.6906 12.4394 10.6082 12.5262C10.5259 12.6131 10.4125 12.6636 10.2928 12.6668L9.19984 12.6968C8.99213 12.7035 8.79511 12.7905 8.6503 12.9396C8.50549 13.0886 8.4242 13.2881 8.42355 13.4959C8.4229 13.7037 8.50295 13.9037 8.64682 14.0536C8.7907 14.2036 8.98717 14.2919 9.19484 14.2998L10.8308 14.2968C10.9303 14.2961 11.0285 14.2754 11.1198 14.2359C11.211 14.1963 11.2933 14.1389 11.3618 14.0668C11.5102 13.9134 11.5927 13.7082 11.5918 13.4948C11.593 13.4352 11.6059 13.3764 11.6298 13.3217C11.6537 13.2671 11.6882 13.2177 11.7312 13.1764C11.7741 13.1351 11.8249 13.1026 11.8804 13.0809C11.9359 13.0592 11.9952 13.0486 12.0548 13.0498C12.2948 13.0568 12.4868 13.2478 12.4948 13.4878C12.4988 13.9378 12.3248 14.3698 12.0118 14.6928C11.7028 15.0148 11.2768 15.1978 10.8318 15.1998L9.18884 15.2008C8.9745 15.2015 8.76215 15.1598 8.56407 15.0779C8.36598 14.996 8.18611 14.8757 8.03484 14.7238C7.87424 14.563 7.74689 14.3722 7.66007 14.1621C7.57325 13.9521 7.52866 13.7271 7.52884 13.4998C7.52611 13.0548 7.6984 12.6265 8.00857 12.3074C8.31873 11.9882 8.74192 11.8038 9.18684 11.7938L10.2688 11.7648Z",
727
- fill: "#6F81BD"
728
- })]
729
- }), ce = () => {
730
- let { t: n } = C(), r = oe(), i = r.userList, a = r.roleTreeList;
731
- return /* @__PURE__ */ z("div", {
732
- className: Q["role-panel"],
733
- children: [
734
- /* @__PURE__ */ R("aside", {
735
- className: Q["role-panel__menu"],
736
- children: /* @__PURE__ */ R("ul", {
737
- className: Q["role-panel__menu-list"],
738
- children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ R("li", {
739
- onClick: () => r.setActiveKey(e.key),
740
- className: t(Q["role-panel__menu-item"], { [Q["role-panel__menu-item--active"]]: r.activeKey === e.key }),
741
- children: e.label
742
- }, e.key))
743
- })
744
- }),
745
- /* @__PURE__ */ R("section", {
746
- className: Q["role-panel__tree-section"],
747
- children: /* @__PURE__ */ R(M, {
748
- spinning: r.loading,
749
- tip: n("common.loading"),
750
- children: /* @__PURE__ */ z(e, {
751
- style: {
752
- height: r.containerHeight - 8,
753
- padding: "4px"
754
- },
755
- children: [a.length > 0 && /* @__PURE__ */ R(F, {
756
- showSwitcher: !1,
757
- data: a,
758
- fieldNames: {
759
- title: "name",
760
- value: "role_id",
761
- children: "children"
762
- },
763
- selectedKeys: r.roleId ? [r.roleId] : [],
764
- onSelect: (e) => r.setRoleId(e),
765
- parentCheckable: !0,
766
- icon: (e) => e.children && e.children.length > 0 ? /* @__PURE__ */ R(P, {
767
- name: "dept-one",
768
- className: Q["role-panel__tree-icon"],
769
- size: 16
770
- }) : /* @__PURE__ */ R(se, {}),
771
- switcherIcon: (e) => /* @__PURE__ */ R(P, {
772
- name: "xiangxiazhankai-11",
773
- className: t(Q["role-panel__switcher-icon"], { [Q["role-panel__switcher-icon--expanded"]]: e })
774
- })
775
- }), a.length === 0 && !r.loading && /* @__PURE__ */ R("div", {
776
- className: Q["role-panel__tree-empty"],
777
- children: /* @__PURE__ */ R("span", {
778
- className: Q["role-panel__tree-empty-text"],
779
- children: n("role.noAvailable")
780
- })
781
- })]
782
- })
783
- })
784
- }),
785
- /* @__PURE__ */ z("section", {
786
- className: Q["role-panel__list-section"],
787
- children: [/* @__PURE__ */ R(M, {
788
- spinning: r.memberLoading,
789
- tip: n("common.loading"),
790
- children: /* @__PURE__ */ R(e, {
791
- style: {
792
- height: r.containerHeight - 8,
793
- padding: "4px"
794
- },
795
- children: i.length > 0 && /* @__PURE__ */ R(H, {
796
- list: i,
797
- badge: (e) => /* @__PURE__ */ R("span", {
798
- className: Q["role-panel__badge"],
799
- title: e.deptnames,
800
- children: e.deptnames
801
- })
802
- })
803
- })
804
- }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ R("div", {
805
- className: Q["role-panel__empty"],
806
- children: /* @__PURE__ */ R("span", {
807
- className: Q["role-panel__empty-text"],
808
- children: n("member.noAvailable")
809
- })
810
- })]
811
- })
812
- ]
813
- });
814
- }, $ = {
815
- "extra-contact-panel": "_extra-contact-panel_4tyr0_1",
816
- "extra-contact-panel__menu": "_extra-contact-panel__menu_4tyr0_6",
817
- "extra-contact-panel__menu-list": "_extra-contact-panel__menu-list_4tyr0_10",
818
- "extra-contact-panel__menu-item": "_extra-contact-panel__menu-item_4tyr0_14",
819
- "extra-contact-panel__menu-item--active": "_extra-contact-panel__menu-item--active_4tyr0_26",
820
- "extra-contact-panel__groups": "_extra-contact-panel__groups_4tyr0_33",
821
- "extra-contact-panel__groups--expanded": "_extra-contact-panel__groups--expanded_4tyr0_37",
822
- "extra-contact-panel__groups--collapsed": "_extra-contact-panel__groups--collapsed_4tyr0_42",
823
- "extra-contact-panel__group-list": "_extra-contact-panel__group-list_4tyr0_46",
824
- "extra-contact-panel__group-item": "_extra-contact-panel__group-item_4tyr0_50",
825
- "extra-contact-panel__group-item--active": "_extra-contact-panel__group-item--active_4tyr0_61",
826
- "extra-contact-panel__members": "_extra-contact-panel__members_4tyr0_68",
827
- "extra-contact-panel__empty": "_extra-contact-panel__empty_4tyr0_74",
828
- "extra-contact-panel__empty-text": "_extra-contact-panel__empty-text_4tyr0_83"
829
- }, le = () => {
830
- let { containerHeight: e, type: t, requestContext: n, limits: r } = i(), { t: a } = C(), [s] = k([{
831
- key: "default",
832
- label: a("externalContact.defaultGroup"),
833
- visible: !0
834
- }, {
835
- key: "custom",
836
- label: a("externalContact.customGroup"),
837
- visible: !0
838
- }]), [d, f] = k("default"), [p, m] = k(), h = (e) => {
839
- f(e), e === "default" && m(void 0);
840
- }, { data: g, loading: _ } = I(() => t === x.DEPT_USERS ? u({ requestContext: n }) : l({
841
- requestContext: n,
842
- limits: r
843
- }), {
844
- refreshDeps: [
845
- d,
846
- t,
847
- n,
848
- r
849
- ],
850
- onSuccess: (e) => {
851
- e && (d === "custom" && m(e.list.filter((e) => e.type !== "1")[0]?._id), d === "default" && m(e.list.filter((e) => e.type === "1")[0]?._id));
852
- }
853
- }), { data: v, loading: y } = I(async () => p ? t === x.DEPT_USERS ? (await o({
854
- requestContext: n,
855
- groupId: p,
856
- limit: 1e4
857
- })).list || [] : (await c({
858
- requestContext: n,
859
- groupId: p,
860
- groupLimit: r?.groupLimit || [],
861
- memberLimit: r?.memberLimit || [],
862
- limit: 1e4
863
- })).list || [] : [], { refreshDeps: [
864
- t,
865
- d,
866
- p,
867
- n
868
- ] });
869
- return {
870
- containerHeight: e,
871
- menuItems: s,
872
- activeKey: d,
873
- setActiveKey: h,
874
- groupId: p,
875
- setGroupId: m,
876
- groupList: d === "custom" && g?.list?.filter((e) => e.type !== "1") || [],
877
- memberList: v || [],
878
- groupListLoading: _,
879
- memberLoading: y
880
- };
881
- }, ue = () => {
882
- let { t: n } = C(), r = le(), i = r.memberList;
883
- return /* @__PURE__ */ z("div", {
884
- className: $["extra-contact-panel"],
885
- children: [
886
- /* @__PURE__ */ R("aside", {
887
- className: $["extra-contact-panel__menu"],
888
- children: /* @__PURE__ */ R("ul", {
889
- className: $["extra-contact-panel__menu-list"],
890
- children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ R("li", {
891
- onClick: () => {
892
- e.key !== r.activeKey && r.setActiveKey(e.key);
893
- },
894
- className: t($["extra-contact-panel__menu-item"], { [$["extra-contact-panel__menu-item--active"]]: r.activeKey === e.key }),
895
- children: e.label
896
- }, e.key))
897
- })
898
- }),
899
- /* @__PURE__ */ R("section", {
900
- className: t($["extra-contact-panel__groups"], {
901
- [$["extra-contact-panel__groups--expanded"]]: r.activeKey === "custom",
902
- [$["extra-contact-panel__groups--collapsed"]]: r.activeKey === "default"
903
- }),
904
- children: /* @__PURE__ */ R(M, {
905
- spinning: r.groupListLoading && r.activeKey === "custom",
906
- tip: n("common.loading"),
907
- children: /* @__PURE__ */ R(e, {
908
- style: {
909
- height: r.containerHeight - 8,
910
- padding: "4px"
911
- },
912
- children: /* @__PURE__ */ z("ul", {
913
- className: $["extra-contact-panel__group-list"],
914
- children: [r.groupList.map((e) => /* @__PURE__ */ R("li", {
915
- onClick: () => r.setGroupId(e._id),
916
- className: t($["extra-contact-panel__group-item"], { [$["extra-contact-panel__group-item--active"]]: r.groupId === e._id }),
917
- children: e.name
918
- }, e._id)), r.groupList.length === 0 && !r.groupListLoading && /* @__PURE__ */ R("div", {
919
- className: $["extra-contact-panel__empty"],
920
- children: /* @__PURE__ */ R("span", {
921
- className: $["extra-contact-panel__empty-text"],
922
- children: n("externalContact.noAvailableGroup")
923
- })
924
- })]
925
- })
926
- })
927
- })
928
- }),
929
- /* @__PURE__ */ z("section", {
930
- className: $["extra-contact-panel__members"],
931
- children: [/* @__PURE__ */ R(M, {
932
- spinning: r.memberLoading || r.groupListLoading,
933
- tip: n("common.loading"),
934
- children: /* @__PURE__ */ R(e, {
935
- style: {
936
- height: r.containerHeight - 8,
937
- padding: "4px"
938
- },
939
- children: i.length > 0 && /* @__PURE__ */ R(H, { list: i })
940
- })
941
- }), i.length === 0 && !r.memberLoading && !r.groupListLoading && /* @__PURE__ */ R("div", {
942
- className: $["extra-contact-panel__empty"],
943
- children: /* @__PURE__ */ R("span", {
944
- className: $["extra-contact-panel__empty-text"],
945
- children: n("member.noAvailable")
946
- })
947
- })]
948
- })
949
- ]
950
- });
951
- };
952
- //#endregion
953
- export { H as a, re as i, ce as n, ae as r, ue as t };