@baishuyun/ui-business 5.1.7 → 5.2.0

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,18 +1,19 @@
1
1
  import { t as e } from "../vendors/simplebar-react.js";
2
2
  import { t } from "../vendors/clsx.js";
3
3
  import { l as n, t as r } from "./useDeptsMemberSelector-t7b8yu-A.js";
4
- import { _ as i, l as a, p as o, t as s, u as c, v as l } from "./services/contact/selector.service-CY5vQea8.js";
5
- import { t as u } from "../vendors/useLocale.js";
6
- import { buildTree as d } from "./utils/index.js";
7
- import { n as f, r as p, t as m } from "./ExtraConcactPanel-CWKwVmbx.js";
8
- import { useMemo as h, useRef as g, useState as _ } from "react";
9
- import { Spin as v } from "antd";
10
- import { Icon as y, Tree as b } from "@baishuyun/ui-base";
11
- import { useRequest as x } from "ahooks";
12
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
13
- import { produce as w } from "immer";
4
+ import { _ as i, a, g as o, h as s, i as c, l, p as u, t as d, u as f, v as p } from "./services/contact/selector.service-CY5vQea8.js";
5
+ import { a as m } from "./TabGroup-Dht9ylk4.js";
6
+ import { t as h } from "../vendors/useLocale.js";
7
+ import { buildTree as g } from "./utils/index.js";
8
+ import { n as _, t as v } from "./MemberPanel-BhuVgJdO.js";
9
+ import { useMemo as y, useRef as b, useState as x } from "react";
10
+ import { Spin as S } from "antd";
11
+ import { Icon as C, Tree as w } from "@baishuyun/ui-base";
12
+ import { useRequest as T } from "ahooks";
13
+ import { jsx as E, jsxs as D } from "react/jsx-runtime";
14
+ import { produce as O } from "immer";
14
15
  //#region src/components/DeptsMemberSelector/subcomponents/Panels/RolePanel/RolePanel.module.scss
15
- var T = {
16
+ var k = {
16
17
  "role-panel": "_role-panel_144a4_1",
17
18
  "role-panel__menu": "_role-panel__menu_144a4_6",
18
19
  "role-panel__menu-list": "_role-panel__menu-list_144a4_10",
@@ -28,8 +29,8 @@ var T = {
28
29
  "role-panel__badge": "_role-panel__badge_144a4_64",
29
30
  "role-panel__empty": "_role-panel__empty_144a4_72",
30
31
  "role-panel__empty-text": "_role-panel__empty-text_144a4_79"
31
- }, E = () => {
32
- let { containerHeight: e, type: t, requestContext: n, limits: i } = r(), { t: a } = u(), [f, p] = _([{
32
+ }, A = () => {
33
+ let { containerHeight: e, type: t, requestContext: n, limits: i } = r(), { t: a } = h(), [o, s] = x([{
33
34
  key: "internal",
34
35
  label: a("role.internal"),
35
36
  visible: !1
@@ -37,11 +38,11 @@ var T = {
37
38
  key: "external",
38
39
  label: a("role.external"),
39
40
  visible: !1
40
- }]), [m, h] = _(), [v, y] = _(), b = g(), S = g({
41
+ }]), [c, l] = x(), [m, _] = x(), v = b(), y = b({
41
42
  internal: [],
42
43
  external: []
43
44
  });
44
- x(() => o({
45
+ T(() => u({
45
46
  requestContext: n,
46
47
  limits: i,
47
48
  hasDeptDock: !1
@@ -49,9 +50,9 @@ var T = {
49
50
  onSuccess: (e) => {
50
51
  if (!e) return;
51
52
  let t = e.departments_count > 0, n = e.label_corp_count > 0;
52
- p(w((e) => {
53
+ s(O((e) => {
53
54
  e[0].visible = t, e[1].visible = n;
54
- })), t ? (b.current = "internal", h("internal")) : n ? (b.current = "external", h("external")) : b.current = void 0;
55
+ })), t ? (v.current = "internal", l("internal")) : n ? (v.current = "external", l("external")) : v.current = void 0;
55
56
  },
56
57
  refreshDeps: [
57
58
  t,
@@ -59,7 +60,7 @@ var T = {
59
60
  i
60
61
  ]
61
62
  });
62
- let { loading: C } = x(() => m ? l({
63
+ let { loading: S } = T(() => c ? p({
63
64
  requestContext: n,
64
65
  limits: i
65
66
  }) : Promise.resolve({
@@ -68,105 +69,105 @@ var T = {
68
69
  }), {
69
70
  onSuccess: (e) => {
70
71
  if (!e) {
71
- S.current.internal = [], S.current.external = [];
72
+ y.current.internal = [], y.current.external = [];
72
73
  return;
73
74
  }
74
75
  let t = Array.isArray(e.roles) ? e.roles : [], n = Array.isArray(e.dock_role) ? e.dock_role : [];
75
- S.current.internal = d(t, {
76
+ y.current.internal = g(t, {
76
77
  children: "children",
77
78
  title: "name",
78
79
  value: "role_id",
79
80
  parentId: "parent"
80
- }), S.current.external = n.map((e) => ({
81
+ }), y.current.external = n.map((e) => ({
81
82
  ...e,
82
83
  children: []
83
84
  }));
84
- let r = m || b.current;
85
+ let r = c || v.current;
85
86
  if (r === "internal") {
86
- y(S.current.internal[0]?.role_id);
87
+ _(y.current.internal[0]?.role_id);
87
88
  return;
88
89
  }
89
90
  if (r === "external") {
90
- y(S.current.external[0]?.role_id);
91
+ _(y.current.external[0]?.role_id);
91
92
  return;
92
93
  }
93
- y(void 0);
94
+ _(void 0);
94
95
  },
95
96
  refreshDeps: [
96
97
  t,
97
98
  n,
98
99
  i,
99
- m
100
+ c
100
101
  ]
101
- }), { data: T, loading: E } = x(async () => {
102
- if (!v) return [];
103
- let e = await c({
102
+ }), { data: C, loading: w } = T(async () => {
103
+ if (!m) return [];
104
+ let e = await f({
104
105
  requestContext: n,
105
- roleId: v,
106
+ roleId: m,
106
107
  roleLimit: i?.roleLimit || [],
107
- limit: s
108
+ limit: d
108
109
  });
109
- return m === "external" ? e.dock_user_list || [] : e.users || [];
110
+ return c === "external" ? e.dock_user_list || [] : e.users || [];
110
111
  }, { refreshDeps: [
111
112
  t,
113
+ c,
112
114
  m,
113
- v,
114
115
  n,
115
116
  i
116
117
  ] });
117
118
  return {
118
119
  containerHeight: e,
119
- menuItems: f,
120
- activeKey: m,
121
- setActiveKey: h,
122
- roleId: v,
123
- setRoleId: y,
124
- roleTreeList: m ? S.current[m] : [],
125
- userList: T || [],
126
- loading: C,
127
- memberLoading: E
120
+ menuItems: o,
121
+ activeKey: c,
122
+ setActiveKey: l,
123
+ roleId: m,
124
+ setRoleId: _,
125
+ roleTreeList: c ? y.current[c] : [],
126
+ userList: C || [],
127
+ loading: S,
128
+ memberLoading: w
128
129
  };
129
- }, D = () => /* @__PURE__ */ C("svg", {
130
+ }, j = () => /* @__PURE__ */ D("svg", {
130
131
  xmlns: "http://www.w3.org/2000/svg",
131
132
  width: "16",
132
133
  height: "16",
133
134
  viewBox: "0 0 16 16",
134
135
  fill: "none",
135
- children: [/* @__PURE__ */ S("path", {
136
+ children: [/* @__PURE__ */ E("path", {
136
137
  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",
137
138
  fill: "#6F81BD"
138
- }), /* @__PURE__ */ S("path", {
139
+ }), /* @__PURE__ */ E("path", {
139
140
  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",
140
141
  fill: "#6F81BD"
141
142
  })]
142
- }), O = () => {
143
- let { t: n } = u(), r = E(), i = r.userList, a = r.roleTreeList, o = (e) => r.activeKey === "external" ? e.dock_corpname ? `(${e.dock_corpname})` : null : e.deptnames;
144
- return /* @__PURE__ */ C("div", {
145
- className: T["role-panel"],
143
+ }), M = () => {
144
+ let { t: n } = h(), r = A(), i = r.userList, a = r.roleTreeList, o = (e) => r.activeKey === "external" ? e.dock_corpname ? `(${e.dock_corpname})` : null : e.deptnames;
145
+ return /* @__PURE__ */ D("div", {
146
+ className: k["role-panel"],
146
147
  children: [
147
- /* @__PURE__ */ S("aside", {
148
- className: T["role-panel__menu"],
149
- children: /* @__PURE__ */ S("ul", {
150
- className: T["role-panel__menu-list"],
151
- children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ S("li", {
148
+ /* @__PURE__ */ E("aside", {
149
+ className: k["role-panel__menu"],
150
+ children: /* @__PURE__ */ E("ul", {
151
+ className: k["role-panel__menu-list"],
152
+ children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ E("li", {
152
153
  onClick: () => r.setActiveKey(e.key),
153
- className: t(T["role-panel__menu-item"], { [T["role-panel__menu-item--active"]]: r.activeKey === e.key }),
154
+ className: t(k["role-panel__menu-item"], { [k["role-panel__menu-item--active"]]: r.activeKey === e.key }),
154
155
  children: e.label
155
156
  }, e.key))
156
157
  })
157
158
  }),
158
- /* @__PURE__ */ S("section", {
159
- className: T["role-panel__tree-section"],
160
- children: /* @__PURE__ */ S(v, {
159
+ /* @__PURE__ */ E("section", {
160
+ className: k["role-panel__tree-section"],
161
+ children: /* @__PURE__ */ E(S, {
161
162
  spinning: r.loading,
162
163
  tip: n("common.loading"),
163
- children: /* @__PURE__ */ C(e, {
164
+ children: /* @__PURE__ */ D(e, {
164
165
  style: {
165
166
  height: r.containerHeight - 8,
166
167
  padding: "4px"
167
168
  },
168
- children: [a.length > 0 && /* @__PURE__ */ S(b, {
169
- showSwitcher: !1,
169
+ children: [a.length > 0 && /* @__PURE__ */ E(w, {
170
+ showSwitcher: !0,
170
171
  data: a,
171
172
  fieldNames: {
172
173
  title: "name",
@@ -174,60 +175,61 @@ var T = {
174
175
  children: "children"
175
176
  },
176
177
  selectedKeys: r.roleId ? [r.roleId] : [],
178
+ defaultExpandedKeys: [],
177
179
  onSelect: (e) => r.setRoleId(e),
178
180
  parentCheckable: !0,
179
- icon: (e) => e.children && e.children.length > 0 ? /* @__PURE__ */ S(y, {
181
+ icon: (e) => e.children && e.children.length > 0 ? /* @__PURE__ */ E(C, {
180
182
  name: "dept-one",
181
- className: T["role-panel__tree-icon"],
183
+ className: k["role-panel__tree-icon"],
182
184
  size: 16
183
- }) : /* @__PURE__ */ S(D, {}),
184
- switcherIcon: (e) => /* @__PURE__ */ S(y, {
185
+ }) : /* @__PURE__ */ E(j, {}),
186
+ switcherIcon: (e) => /* @__PURE__ */ E(C, {
185
187
  name: "xiangxiazhankai-11",
186
- className: t(T["role-panel__switcher-icon"], { [T["role-panel__switcher-icon--expanded"]]: e })
188
+ className: t(k["role-panel__switcher-icon"], { [k["role-panel__switcher-icon--expanded"]]: e })
187
189
  })
188
- }), a.length === 0 && !r.loading && /* @__PURE__ */ S("div", {
189
- className: T["role-panel__tree-empty"],
190
- children: /* @__PURE__ */ S("span", {
191
- className: T["role-panel__tree-empty-text"],
190
+ }), a.length === 0 && !r.loading && /* @__PURE__ */ E("div", {
191
+ className: k["role-panel__tree-empty"],
192
+ children: /* @__PURE__ */ E("span", {
193
+ className: k["role-panel__tree-empty-text"],
192
194
  children: n("role.noAvailable")
193
195
  })
194
196
  })]
195
197
  })
196
198
  })
197
199
  }),
198
- /* @__PURE__ */ C("section", {
199
- className: T["role-panel__list-section"],
200
- children: [/* @__PURE__ */ S(v, {
200
+ /* @__PURE__ */ D("section", {
201
+ className: k["role-panel__list-section"],
202
+ children: [/* @__PURE__ */ E(S, {
201
203
  spinning: r.memberLoading,
202
204
  tip: n("common.loading"),
203
- children: /* @__PURE__ */ S(e, {
205
+ children: /* @__PURE__ */ E(e, {
204
206
  style: {
205
207
  height: r.containerHeight - 8,
206
208
  padding: "4px"
207
209
  },
208
- children: i.length > 0 && /* @__PURE__ */ S(p, {
210
+ children: i.length > 0 && /* @__PURE__ */ E(_, {
209
211
  list: i,
210
212
  badge: (e) => {
211
213
  let t = o(e);
212
- return /* @__PURE__ */ S("span", {
213
- className: T["role-panel__badge"],
214
+ return /* @__PURE__ */ E("span", {
215
+ className: k["role-panel__badge"],
214
216
  title: t,
215
217
  children: t
216
218
  });
217
219
  }
218
220
  })
219
221
  })
220
- }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ S("div", {
221
- className: T["role-panel__empty"],
222
- children: /* @__PURE__ */ S("span", {
223
- className: T["role-panel__empty-text"],
222
+ }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ E("div", {
223
+ className: k["role-panel__empty"],
224
+ children: /* @__PURE__ */ E("span", {
225
+ className: k["role-panel__empty-text"],
224
226
  children: n("member.noAvailable")
225
227
  })
226
228
  })]
227
229
  })
228
230
  ]
229
231
  });
230
- }, k = {
232
+ }, N = {
231
233
  "position-panel": "_position-panel_14wpw_1",
232
234
  "position-panel__menu": "_position-panel__menu_14wpw_6",
233
235
  "position-panel__menu-list": "_position-panel__menu-list_14wpw_9",
@@ -236,27 +238,27 @@ var T = {
236
238
  "position-panel__list": "_position-panel__list_14wpw_32",
237
239
  "position-panel__badge": "_position-panel__badge_14wpw_38",
238
240
  "position-panel__empty": "_position-panel__empty_14wpw_48"
239
- }, A = () => {
240
- let { containerHeight: e, type: t, requestContext: n, limits: o } = r(), [s, c] = _(), { data: l, loading: u } = x(() => i({
241
+ }, P = () => {
242
+ let { containerHeight: e, type: t, requestContext: n, limits: a } = r(), [o, s] = x(), { data: c, loading: u } = T(() => i({
241
243
  requestContext: n,
242
- limits: o
244
+ limits: a
243
245
  }), {
244
246
  onSuccess: (e) => {
245
- e.items?.length && c(0);
247
+ e.items?.length && s(0);
246
248
  },
247
249
  refreshDeps: [
248
250
  t,
249
251
  n,
250
- o
252
+ a
251
253
  ]
252
- }), d = l?.items || [], f = s === void 0 ? void 0 : d[s], p = typeof f == "string" ? f : f?.job_title || f?.name || "", m = typeof f == "string" ? void 0 : f?._id || f?.id, { data: h, loading: g } = x(async () => p && (await a({
254
+ }), d = c?.items || [], f = o === void 0 ? void 0 : d[o], p = typeof f == "string" ? f : f?.job_title || f?.name || "", m = typeof f == "string" ? void 0 : f?._id || f?.id, { data: h, loading: g } = T(async () => p && (await l({
253
255
  requestContext: n,
254
256
  jobTitle: p,
255
257
  jobTitleId: m,
256
258
  limit: 1e4
257
259
  })).list || [], { refreshDeps: [
258
260
  t,
259
- s,
261
+ o,
260
262
  p,
261
263
  m,
262
264
  n?.appId,
@@ -265,97 +267,234 @@ var T = {
265
267
  return {
266
268
  containerHeight: e,
267
269
  positionList: d,
268
- activePositionIndex: s,
269
- setActivePositionIndex: c,
270
+ activePositionIndex: o,
271
+ setActivePositionIndex: s,
270
272
  memberList: h || [],
271
273
  jobLoading: u,
272
274
  memberLoading: g
273
275
  };
274
- }, j = () => {
275
- let { t: n } = u(), r = A(), i = r.memberList;
276
- return /* @__PURE__ */ C("div", {
277
- className: k["position-panel"],
278
- children: [/* @__PURE__ */ S("div", {
279
- className: k["position-panel__menu"],
280
- children: /* @__PURE__ */ S(v, {
276
+ }, F = () => {
277
+ let { t: n } = h(), r = P(), i = r.memberList;
278
+ return /* @__PURE__ */ D("div", {
279
+ className: N["position-panel"],
280
+ children: [/* @__PURE__ */ E("div", {
281
+ className: N["position-panel__menu"],
282
+ children: /* @__PURE__ */ E(S, {
281
283
  spinning: r.jobLoading,
282
284
  tip: n("common.loading"),
283
- children: /* @__PURE__ */ S(e, {
285
+ children: /* @__PURE__ */ E(e, {
284
286
  style: { height: r.containerHeight - 8 },
285
- children: /* @__PURE__ */ S("ul", {
286
- className: k["position-panel__menu-list"],
287
- children: r.positionList.map((e, n) => /* @__PURE__ */ S("li", {
287
+ children: /* @__PURE__ */ E("ul", {
288
+ className: N["position-panel__menu-list"],
289
+ children: r.positionList.map((e, n) => /* @__PURE__ */ E("li", {
288
290
  onClick: () => {
289
291
  r.setActivePositionIndex(n);
290
292
  },
291
- className: t(k["position-panel__menu-item"], { [k["position-panel__menu-item--active"]]: r.activePositionIndex === n }),
293
+ className: t(N["position-panel__menu-item"], { [N["position-panel__menu-item--active"]]: r.activePositionIndex === n }),
292
294
  children: typeof e == "string" ? e : e.job_title || e.name || ""
293
295
  }, n))
294
296
  })
295
297
  })
296
298
  })
297
- }), /* @__PURE__ */ C("div", {
298
- className: k["position-panel__list"],
299
- children: [/* @__PURE__ */ S(v, {
299
+ }), /* @__PURE__ */ D("div", {
300
+ className: N["position-panel__list"],
301
+ children: [/* @__PURE__ */ E(S, {
300
302
  spinning: r.memberLoading,
301
303
  tip: n("common.loading"),
302
- children: /* @__PURE__ */ S(e, {
304
+ children: /* @__PURE__ */ E(e, {
303
305
  style: { height: r.containerHeight - 8 },
304
- children: i.length > 0 && /* @__PURE__ */ S(p, {
306
+ children: i.length > 0 && /* @__PURE__ */ E(_, {
305
307
  list: i,
306
- badge: (e) => /* @__PURE__ */ S("div", {
307
- className: k["position-panel__badge"],
308
- children: /* @__PURE__ */ S("span", {
308
+ badge: (e) => /* @__PURE__ */ E("div", {
309
+ className: N["position-panel__badge"],
310
+ children: /* @__PURE__ */ E("span", {
309
311
  title: e.deptnames,
310
312
  children: e.deptnames
311
313
  })
312
314
  })
313
315
  })
314
316
  })
315
- }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ S("div", {
316
- className: k["position-panel__empty"],
317
- children: /* @__PURE__ */ S("span", { children: n("member.noAvailable") })
317
+ }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ E("div", {
318
+ className: N["position-panel__empty"],
319
+ children: /* @__PURE__ */ E("span", { children: n("member.noAvailable") })
318
320
  })]
319
321
  })]
320
322
  });
321
- }, M = { "current-user-panel": "_current-user-panel_184e6_1" }, N = () => {
323
+ }, I = {
324
+ "extra-contact-panel": "_extra-contact-panel_4tyr0_1",
325
+ "extra-contact-panel__menu": "_extra-contact-panel__menu_4tyr0_6",
326
+ "extra-contact-panel__menu-list": "_extra-contact-panel__menu-list_4tyr0_10",
327
+ "extra-contact-panel__menu-item": "_extra-contact-panel__menu-item_4tyr0_14",
328
+ "extra-contact-panel__menu-item--active": "_extra-contact-panel__menu-item--active_4tyr0_26",
329
+ "extra-contact-panel__groups": "_extra-contact-panel__groups_4tyr0_33",
330
+ "extra-contact-panel__groups--expanded": "_extra-contact-panel__groups--expanded_4tyr0_37",
331
+ "extra-contact-panel__groups--collapsed": "_extra-contact-panel__groups--collapsed_4tyr0_42",
332
+ "extra-contact-panel__group-list": "_extra-contact-panel__group-list_4tyr0_46",
333
+ "extra-contact-panel__group-item": "_extra-contact-panel__group-item_4tyr0_50",
334
+ "extra-contact-panel__group-item--active": "_extra-contact-panel__group-item--active_4tyr0_61",
335
+ "extra-contact-panel__members": "_extra-contact-panel__members_4tyr0_68",
336
+ "extra-contact-panel__empty": "_extra-contact-panel__empty_4tyr0_74",
337
+ "extra-contact-panel__empty-text": "_extra-contact-panel__empty-text_4tyr0_83"
338
+ }, L = () => {
339
+ let { containerHeight: e, type: t, requestContext: n, limits: i } = r(), { t: l } = h(), [u] = x([{
340
+ key: "default",
341
+ label: l("externalContact.defaultGroup"),
342
+ visible: !0
343
+ }, {
344
+ key: "custom",
345
+ label: l("externalContact.customGroup"),
346
+ visible: !0
347
+ }]), [d, f] = x("default"), [p, g] = x(), _ = (e) => {
348
+ f(e), e === "default" && g(void 0);
349
+ }, { data: v, loading: y } = T(() => t === m.DEPT_USERS ? c({ requestContext: n }) : s({
350
+ requestContext: n,
351
+ limits: i
352
+ }), {
353
+ refreshDeps: [
354
+ d,
355
+ t,
356
+ n,
357
+ i
358
+ ],
359
+ onSuccess: (e) => {
360
+ e && (d === "custom" && g(e.list.filter((e) => e.type !== "1")[0]?._id), d === "default" && g(e.list.filter((e) => e.type === "1")[0]?._id));
361
+ }
362
+ }), { data: b, loading: S } = T(async () => p ? t === m.DEPT_USERS ? (await a({
363
+ requestContext: n,
364
+ groupId: p,
365
+ limit: 1e4
366
+ })).list || [] : (await o({
367
+ requestContext: n,
368
+ groupId: p,
369
+ groupLimit: i?.groupLimit || [],
370
+ memberLimit: i?.memberLimit || [],
371
+ limit: 1e4
372
+ })).list || [] : [], { refreshDeps: [
373
+ t,
374
+ d,
375
+ p,
376
+ n
377
+ ] });
378
+ return {
379
+ containerHeight: e,
380
+ menuItems: u,
381
+ activeKey: d,
382
+ setActiveKey: _,
383
+ groupId: p,
384
+ setGroupId: g,
385
+ groupList: d === "custom" && v?.list?.filter((e) => e.type !== "1") || [],
386
+ memberList: b || [],
387
+ groupListLoading: y,
388
+ memberLoading: S
389
+ };
390
+ }, R = () => {
391
+ let { t: n } = h(), r = L(), i = r.memberList;
392
+ return /* @__PURE__ */ D("div", {
393
+ className: I["extra-contact-panel"],
394
+ children: [
395
+ /* @__PURE__ */ E("aside", {
396
+ className: I["extra-contact-panel__menu"],
397
+ children: /* @__PURE__ */ E("ul", {
398
+ className: I["extra-contact-panel__menu-list"],
399
+ children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ E("li", {
400
+ onClick: () => {
401
+ e.key !== r.activeKey && r.setActiveKey(e.key);
402
+ },
403
+ className: t(I["extra-contact-panel__menu-item"], { [I["extra-contact-panel__menu-item--active"]]: r.activeKey === e.key }),
404
+ children: e.label
405
+ }, e.key))
406
+ })
407
+ }),
408
+ /* @__PURE__ */ E("section", {
409
+ className: t(I["extra-contact-panel__groups"], {
410
+ [I["extra-contact-panel__groups--expanded"]]: r.activeKey === "custom",
411
+ [I["extra-contact-panel__groups--collapsed"]]: r.activeKey === "default"
412
+ }),
413
+ children: /* @__PURE__ */ E(S, {
414
+ spinning: r.groupListLoading && r.activeKey === "custom",
415
+ tip: n("common.loading"),
416
+ children: /* @__PURE__ */ E(e, {
417
+ style: {
418
+ height: r.containerHeight - 8,
419
+ padding: "4px"
420
+ },
421
+ children: /* @__PURE__ */ D("ul", {
422
+ className: I["extra-contact-panel__group-list"],
423
+ children: [r.groupList.map((e) => /* @__PURE__ */ E("li", {
424
+ onClick: () => r.setGroupId(e._id),
425
+ className: t(I["extra-contact-panel__group-item"], { [I["extra-contact-panel__group-item--active"]]: r.groupId === e._id }),
426
+ children: e.name
427
+ }, e._id)), r.groupList.length === 0 && !r.groupListLoading && /* @__PURE__ */ E("div", {
428
+ className: I["extra-contact-panel__empty"],
429
+ children: /* @__PURE__ */ E("span", {
430
+ className: I["extra-contact-panel__empty-text"],
431
+ children: n("externalContact.noAvailableGroup")
432
+ })
433
+ })]
434
+ })
435
+ })
436
+ })
437
+ }),
438
+ /* @__PURE__ */ D("section", {
439
+ className: I["extra-contact-panel__members"],
440
+ children: [/* @__PURE__ */ E(S, {
441
+ spinning: r.memberLoading || r.groupListLoading,
442
+ tip: n("common.loading"),
443
+ children: /* @__PURE__ */ E(e, {
444
+ style: {
445
+ height: r.containerHeight - 8,
446
+ padding: "4px"
447
+ },
448
+ children: i.length > 0 && /* @__PURE__ */ E(_, { list: i })
449
+ })
450
+ }), i.length === 0 && !r.memberLoading && !r.groupListLoading && /* @__PURE__ */ E("div", {
451
+ className: I["extra-contact-panel__empty"],
452
+ children: /* @__PURE__ */ E("span", {
453
+ className: I["extra-contact-panel__empty-text"],
454
+ children: n("member.noAvailable")
455
+ })
456
+ })]
457
+ })
458
+ ]
459
+ });
460
+ }, z = { "current-user-panel": "_current-user-panel_184e6_1" }, B = () => {
322
461
  let { currentUsers: e } = r();
323
- return /* @__PURE__ */ S("div", {
324
- className: M["current-user-panel"],
325
- children: /* @__PURE__ */ S(p, {
462
+ return /* @__PURE__ */ E("div", {
463
+ className: z["current-user-panel"],
464
+ children: /* @__PURE__ */ E(_, {
326
465
  list: e || [],
327
466
  showCheckAll: !1
328
467
  })
329
468
  });
330
- }, P = () => {
331
- let { t: e } = u(), { memberPanelVisibility: t = n } = r(), { source: i, member: a, role: o, job: s, externalContact: c, currentUser: l } = t, d = h(() => [
469
+ }, V = () => {
470
+ let { t: e } = h(), { memberPanelVisibility: t = n } = r(), { source: i, member: a, role: o, job: s, externalContact: c, currentUser: l } = t, u = y(() => [
332
471
  {
333
472
  label: e("member.title"),
334
473
  key: "member",
335
- view: /* @__PURE__ */ S(f, {})
474
+ view: /* @__PURE__ */ E(v, {})
336
475
  },
337
476
  {
338
477
  label: e("role.title"),
339
478
  key: "role",
340
- view: /* @__PURE__ */ S(O, {})
479
+ view: /* @__PURE__ */ E(M, {})
341
480
  },
342
481
  {
343
482
  label: e("position.title"),
344
483
  key: "job",
345
- view: /* @__PURE__ */ S(j, {})
484
+ view: /* @__PURE__ */ E(F, {})
346
485
  },
347
486
  {
348
487
  label: e("externalContact.title"),
349
488
  key: "externalContact",
350
- view: /* @__PURE__ */ S(m, {})
489
+ view: /* @__PURE__ */ E(R, {})
351
490
  },
352
491
  {
353
492
  label: e("currentUser.title"),
354
493
  key: "currentUser",
355
- view: /* @__PURE__ */ S(N, {})
494
+ view: /* @__PURE__ */ E(B, {})
356
495
  }
357
496
  ], [e]);
358
- return h(() => i === "widget" ? d.filter((e) => {
497
+ return y(() => i === "widget" ? u.filter((e) => {
359
498
  switch (e.key) {
360
499
  case "member": return a;
361
500
  case "role": return o;
@@ -364,8 +503,8 @@ var T = {
364
503
  case "currentUser": return l;
365
504
  default: return !0;
366
505
  }
367
- }) : d, [
368
- d,
506
+ }) : u, [
507
+ u,
369
508
  i,
370
509
  a,
371
510
  o,
@@ -375,4 +514,4 @@ var T = {
375
514
  ]);
376
515
  };
377
516
  //#endregion
378
- export { P as t };
517
+ export { V as t };