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