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