@baishuyun/ui-business 3.0.4 → 4.0.2
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/dist/ConfigProvider/ConfigProvider-CAq3dN6-.js +15 -0
- package/dist/ConfigProvider/configContext-_BAslzM-.js +9 -0
- package/dist/ConfigProvider/index.d.ts +2 -0
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DeptsMember/DeptsMember-BNuoQ8y4.js +865 -0
- package/dist/DeptsMember/ExtraConcactPanel-BoSCI3s5.js +738 -0
- package/dist/DeptsMember/OrganizationPanel-ByWU1PWX.js +275 -0
- package/dist/DeptsMember/TabGroup-DZC7i-Yr.js +104 -0
- package/dist/DeptsMember/index-BRIA1uOQ.js +88 -0
- package/dist/DeptsMember/index.js +6 -4
- package/dist/DeptsMember/subcomponents/Entity/Department/index.js +115 -76
- package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +256 -27
- package/dist/DeptsMember/subcomponents/Entity/Member/index.js +15 -12
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +4 -0
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +15 -0
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +4 -0
- package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +67 -0
- package/dist/DeptsMember/useDeptsMemberSelector-D3rvDuVf.js +13 -0
- package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +13 -1
- package/dist/components/ConfigProvider/index.d.ts +1 -0
- package/dist/components/DeptsMember/DeptsMember.type.d.ts +15 -0
- package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +4 -0
- package/dist/components/DeptsMember/index.d.ts +1 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/MemberRelationShip.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +5 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +15 -0
- package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipMember/RelationShipMember.d.ts +6 -0
- package/dist/components/DeptsMember/subcomponents/Panels/OtherPanel/OtherPanel.d.ts +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +11 -6
- package/dist/lang/en-US.json.d.ts +7 -2
- package/dist/lang/zh-CN.json.d.ts +7 -2
- package/dist/services/apiService.d.ts +1 -0
- package/dist/services/ncorp/department.service.d.ts +11 -0
- package/dist/services/ncorp/relation.service.d.ts +4 -0
- package/dist/utils/getRelationNodeName.d.ts +9 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/recordSelectedNode.d.ts +8 -0
- package/dist/vendors/services/apiService.js +18 -10
- package/dist/vendors/services/corp/outsider.service.js +4 -4
- package/dist/vendors/services/data/department.service.js +3 -3
- package/dist/vendors/services/data/member.service.js +6 -6
- package/dist/vendors/services/data/member_limit.service.js +3 -3
- package/dist/vendors/services/data/outsider.service.js +4 -4
- package/dist/vendors/services/ncorp/department.service.js +6 -0
- package/dist/vendors/services/ncorp/relation.service.js +5 -0
- package/dist/vendors/useLocale.js +42 -0
- package/package.json +8 -10
- package/dist/ConfigProvider/ConfigProvider-CE-neQMa.js +0 -9
- package/dist/ConfigProvider/configContext-lDqg07Z3.js +0 -7
- package/dist/DeptsMember/DeptsMember-CzJqr_LX.js +0 -721
- package/dist/DeptsMember/ExtraConcactPanel-BI9emYpp.js +0 -674
- package/dist/DeptsMember/OrganizationPanel-DcwvZ6X4.js +0 -254
- package/dist/DeptsMember/TabGroup-wNM86-Zq.js +0 -141
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { jsxs as y, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { g as M } from "../vendors/services/data/member.service.js";
|
|
3
|
+
import { useRequest as R } from "ahooks";
|
|
4
|
+
import { Spin as H } from "antd";
|
|
5
|
+
import { c as v } from "../vendors/clsx.js";
|
|
6
|
+
import { useState as E, useMemo as C, useCallback as w } from "react";
|
|
7
|
+
import { u as I } from "./useDeptsMemberSelector-D3rvDuVf.js";
|
|
8
|
+
import { E as S, c as L, a as P } from "./TabGroup-DZC7i-Yr.js";
|
|
9
|
+
import { buildDeptTree as j, buildTree as B, findNodeInTree as G } from "./utils/index.js";
|
|
10
|
+
import { u as T } from "../vendors/useLocale.js";
|
|
11
|
+
import { S as A } from "../vendors/simplebar-react.js";
|
|
12
|
+
import { Tree as O, Icon as k } from "@baishuyun/ui-base";
|
|
13
|
+
const q = (a) => {
|
|
14
|
+
const { type: c, containerHeight: u, value: f } = I(), { t } = T(), z = f?.map((s) => s._id) || [], i = a.data?.map((s) => s._id);
|
|
15
|
+
return /* @__PURE__ */ y(
|
|
16
|
+
A,
|
|
17
|
+
{
|
|
18
|
+
style: { height: u - 8, padding: "4px" },
|
|
19
|
+
className: "internal-container",
|
|
20
|
+
classNames: {
|
|
21
|
+
contentEl: "internal-container-content-el"
|
|
22
|
+
},
|
|
23
|
+
children: [
|
|
24
|
+
a.data.length > 0 && /* @__PURE__ */ n(
|
|
25
|
+
O,
|
|
26
|
+
{
|
|
27
|
+
parentCheckable: !0,
|
|
28
|
+
checkType: c === S.DEPARMENT ? "radio" : "checkbox",
|
|
29
|
+
data: a.data,
|
|
30
|
+
fieldNames: {
|
|
31
|
+
title: "name",
|
|
32
|
+
value: "_id",
|
|
33
|
+
children: "children"
|
|
34
|
+
},
|
|
35
|
+
selectedKeys: z,
|
|
36
|
+
onSelect: a.onSelect,
|
|
37
|
+
onDeSelect: a.onDeselect,
|
|
38
|
+
defaultExpandedKeys: i,
|
|
39
|
+
icon: () => /* @__PURE__ */ n(k, { name: "dept-one", className: "internal-container__icon" }),
|
|
40
|
+
switcherIcon: (s) => /* @__PURE__ */ n(
|
|
41
|
+
k,
|
|
42
|
+
{
|
|
43
|
+
name: "xiangxiazhankai-11",
|
|
44
|
+
className: v("internal-container__arrow-icon", {
|
|
45
|
+
"rotate-90": s
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
a.data.length === 0 && !a.loading && /* @__PURE__ */ n("div", { className: "internal-container__empty", children: /* @__PURE__ */ n("span", { children: t("department.noAvailable") }) })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}, h = {
|
|
56
|
+
"external-organization": "_external-organization_cz9md_1",
|
|
57
|
+
"external-organization__content": "_external-organization__content_cz9md_5",
|
|
58
|
+
"external-organization__scroll-content": "_external-organization__scroll-content_cz9md_8",
|
|
59
|
+
"external-organization__tree-icon": "_external-organization__tree-icon_cz9md_11",
|
|
60
|
+
"external-organization__switcher-icon": "_external-organization__switcher-icon_cz9md_14",
|
|
61
|
+
"external-organization__switcher-icon--expanded": "_external-organization__switcher-icon--expanded_cz9md_19",
|
|
62
|
+
"external-organization__empty": "_external-organization__empty_cz9md_22"
|
|
63
|
+
}, F = (a) => {
|
|
64
|
+
const { type: c, containerHeight: u, value: f } = I(), { t } = T(), [z, i] = E(
|
|
65
|
+
"dockcorp"
|
|
66
|
+
/* DOCK_PERSON_GROUP */
|
|
67
|
+
), s = f?.map((d) => d._id) || [], D = [
|
|
68
|
+
{
|
|
69
|
+
label: t("department.externalContactGroup"),
|
|
70
|
+
value: "dockcorp"
|
|
71
|
+
/* DOCK_PERSON_GROUP */
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: t("department.externalContactDepartment"),
|
|
75
|
+
value: "dockcorpdept"
|
|
76
|
+
/* DOCK_DEPARTMENT */
|
|
77
|
+
}
|
|
78
|
+
], x = (d, p) => {
|
|
79
|
+
const m = [];
|
|
80
|
+
for (const o of d)
|
|
81
|
+
if (o.type === p)
|
|
82
|
+
if (p === "dockcorpdept")
|
|
83
|
+
m.push({
|
|
84
|
+
...o,
|
|
85
|
+
children: o.children
|
|
86
|
+
});
|
|
87
|
+
else {
|
|
88
|
+
const e = o.children ? x(o.children, p) : [];
|
|
89
|
+
m.push({
|
|
90
|
+
...o,
|
|
91
|
+
children: e.length > 0 ? e : void 0
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const e = o.children ? x(o.children, p) : [];
|
|
96
|
+
e.length > 0 && m.push({
|
|
97
|
+
...o,
|
|
98
|
+
children: e
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return m;
|
|
102
|
+
}, _ = x(a.data, z), N = _?.map((d) => d._id);
|
|
103
|
+
return /* @__PURE__ */ y("div", { className: h["external-organization"], children: [
|
|
104
|
+
/* @__PURE__ */ n(L, { tabs: D, value: z, onChange: i }),
|
|
105
|
+
/* @__PURE__ */ n("div", { className: h["external-organization__content"], children: /* @__PURE__ */ y(
|
|
106
|
+
A,
|
|
107
|
+
{
|
|
108
|
+
style: { height: u - 42, padding: "4px" },
|
|
109
|
+
classNames: {
|
|
110
|
+
contentEl: h["external-organization__scroll-content"]
|
|
111
|
+
},
|
|
112
|
+
children: [
|
|
113
|
+
_.length > 0 && /* @__PURE__ */ n(
|
|
114
|
+
O,
|
|
115
|
+
{
|
|
116
|
+
parentCheckable: !0,
|
|
117
|
+
checkType: c === S.DEPARMENT ? "radio" : "checkbox",
|
|
118
|
+
data: _,
|
|
119
|
+
fieldNames: {
|
|
120
|
+
title: "name",
|
|
121
|
+
value: "_id",
|
|
122
|
+
children: "children"
|
|
123
|
+
},
|
|
124
|
+
selectedKeys: s,
|
|
125
|
+
onSelect: a.onSelect,
|
|
126
|
+
onDeSelect: a.onDeselect,
|
|
127
|
+
defaultExpandedKeys: N,
|
|
128
|
+
icon: () => /* @__PURE__ */ n(
|
|
129
|
+
k,
|
|
130
|
+
{
|
|
131
|
+
name: "dept-one",
|
|
132
|
+
className: h["external-organization__tree-icon"],
|
|
133
|
+
size: 16
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
switcherIcon: (d) => /* @__PURE__ */ n(
|
|
137
|
+
k,
|
|
138
|
+
{
|
|
139
|
+
name: "xiangxiazhankai-11",
|
|
140
|
+
className: v(h["external-organization__switcher-icon"], {
|
|
141
|
+
[h["external-organization__switcher-icon--expanded"]]: d
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
_.length === 0 && !a.loading && /* @__PURE__ */ n("div", { className: h["external-organization__empty"], children: /* @__PURE__ */ n("span", { children: t("department.noAvailable") }) })
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
) })
|
|
151
|
+
] });
|
|
152
|
+
}, g = {
|
|
153
|
+
"organization-panel": "_organization-panel_1dfed_1",
|
|
154
|
+
"organization-panel__menu": "_organization-panel__menu_1dfed_6",
|
|
155
|
+
"organization-panel__menu-list": "_organization-panel__menu-list_1dfed_10",
|
|
156
|
+
"organization-panel__menu-item": "_organization-panel__menu-item_1dfed_14",
|
|
157
|
+
"organization-panel__menu-item--active": "_organization-panel__menu-item--active_1dfed_25",
|
|
158
|
+
"organization-panel__content": "_organization-panel__content_1dfed_32",
|
|
159
|
+
"organization-panel__content--borderless": "_organization-panel__content--borderless_1dfed_37"
|
|
160
|
+
}, ae = () => {
|
|
161
|
+
const { type: a, dispatch: c } = I(), { t: u } = T(), [f] = E([
|
|
162
|
+
{ key: 0, label: u("department.internal"), visible: !0 },
|
|
163
|
+
{ key: 1, label: u("department.external"), visible: !0 }
|
|
164
|
+
]), [t, z] = E(
|
|
165
|
+
0
|
|
166
|
+
/* INTERNAL */
|
|
167
|
+
), { data: i, loading: s } = R(
|
|
168
|
+
() => M({
|
|
169
|
+
departmentLimit: [],
|
|
170
|
+
hasDeptDock: t === 1
|
|
171
|
+
/* EXTERNAL */
|
|
172
|
+
}),
|
|
173
|
+
{
|
|
174
|
+
refreshDeps: [t]
|
|
175
|
+
}
|
|
176
|
+
), D = C(() => {
|
|
177
|
+
const e = i?.departments || [];
|
|
178
|
+
return e.length > 0 ? j(e) : [];
|
|
179
|
+
}, [i]), x = C(() => {
|
|
180
|
+
const e = i?.label_corp_list || [];
|
|
181
|
+
if (!e.length)
|
|
182
|
+
return [];
|
|
183
|
+
const l = e.filter((r) => r.type === "dockcorp" || r.type === "dockdept" ? !0 : r.parentId === 0 ? !1 : e.some((K) => K.parentId === r.departmentId)), b = l.map((r) => ({
|
|
184
|
+
...r,
|
|
185
|
+
checkable: r.type !== "dockcorpdept" && r.type !== "label",
|
|
186
|
+
icon: /* @__PURE__ */ n(P, { type: r.type, size: 16 })
|
|
187
|
+
}));
|
|
188
|
+
return l.length > 0 ? B(b, {
|
|
189
|
+
parentId: "parentId",
|
|
190
|
+
children: "children",
|
|
191
|
+
value: "_id",
|
|
192
|
+
title: "name"
|
|
193
|
+
}) : [];
|
|
194
|
+
}, [i]), _ = {
|
|
195
|
+
0: D,
|
|
196
|
+
1: x
|
|
197
|
+
}, N = w(
|
|
198
|
+
(e) => {
|
|
199
|
+
const l = t === 1 ? i?.label_corp_list : i?.departments;
|
|
200
|
+
if (!l)
|
|
201
|
+
return;
|
|
202
|
+
const b = l.find((r) => r._id === e);
|
|
203
|
+
b && c({
|
|
204
|
+
type: "insertOnly",
|
|
205
|
+
payload: {
|
|
206
|
+
...b
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
[c, i, t]
|
|
211
|
+
), d = w(
|
|
212
|
+
(e, l) => {
|
|
213
|
+
c({
|
|
214
|
+
type: "addOne",
|
|
215
|
+
payload: {
|
|
216
|
+
...l
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
[c]
|
|
221
|
+
), p = (e) => {
|
|
222
|
+
const l = G(e, _[t], {
|
|
223
|
+
children: "children",
|
|
224
|
+
value: "_id"
|
|
225
|
+
});
|
|
226
|
+
l && c({
|
|
227
|
+
type: "deleteOne",
|
|
228
|
+
payload: l._id
|
|
229
|
+
});
|
|
230
|
+
}, m = S.DEPARMENT === a ? N : d, o = i?.label_corp_count || 0;
|
|
231
|
+
return /* @__PURE__ */ y("div", { className: g["organization-panel"], children: [
|
|
232
|
+
o > 0 && /* @__PURE__ */ n("aside", { className: g["organization-panel__menu"], children: /* @__PURE__ */ n("ul", { className: g["organization-panel__menu-list"], children: f.filter((e) => e.visible).map((e) => /* @__PURE__ */ n(
|
|
233
|
+
"li",
|
|
234
|
+
{
|
|
235
|
+
onClick: () => z(e.key),
|
|
236
|
+
className: v(g["organization-panel__menu-item"], {
|
|
237
|
+
[g["organization-panel__menu-item--active"]]: t === e.key
|
|
238
|
+
}),
|
|
239
|
+
children: e.label
|
|
240
|
+
},
|
|
241
|
+
e.key
|
|
242
|
+
)) }) }),
|
|
243
|
+
/* @__PURE__ */ n(
|
|
244
|
+
"section",
|
|
245
|
+
{
|
|
246
|
+
className: v(g["organization-panel__content"], {
|
|
247
|
+
[g["organization-panel__content--borderless"]]: o === 0
|
|
248
|
+
}),
|
|
249
|
+
children: /* @__PURE__ */ y(H, { spinning: s, children: [
|
|
250
|
+
t === 0 && /* @__PURE__ */ n(
|
|
251
|
+
q,
|
|
252
|
+
{
|
|
253
|
+
onSelect: m,
|
|
254
|
+
onDeselect: p,
|
|
255
|
+
loading: !0,
|
|
256
|
+
data: _[t]
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
t === 1 && /* @__PURE__ */ n(
|
|
260
|
+
F,
|
|
261
|
+
{
|
|
262
|
+
data: _[t],
|
|
263
|
+
onSelect: m,
|
|
264
|
+
onDeselect: p,
|
|
265
|
+
loading: !0
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] })
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
] });
|
|
272
|
+
};
|
|
273
|
+
export {
|
|
274
|
+
ae as O
|
|
275
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx as t, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as c } from "@baishuyun/ui-base";
|
|
3
|
+
import { useRef as f, useState as v, useEffect as y } from "react";
|
|
4
|
+
import { c as N } from "../vendors/clsx.js";
|
|
5
|
+
const H = {
|
|
6
|
+
/**
|
|
7
|
+
* @description 成员单选类型
|
|
8
|
+
*/
|
|
9
|
+
USER: "user",
|
|
10
|
+
/**
|
|
11
|
+
* @description 成员多选类型
|
|
12
|
+
*/
|
|
13
|
+
USER_GROUP: "usergroup",
|
|
14
|
+
/**
|
|
15
|
+
* @description 部门单选类型
|
|
16
|
+
*/
|
|
17
|
+
DEPARMENT: "dept",
|
|
18
|
+
/**
|
|
19
|
+
* @description 部门多选类型
|
|
20
|
+
*/
|
|
21
|
+
DEPARMENT_GROUP: "deptgroup",
|
|
22
|
+
/**
|
|
23
|
+
* @description 部门成员类型
|
|
24
|
+
*/
|
|
25
|
+
DEPT_USERS: "deptusers"
|
|
26
|
+
}, P = 110, G = 68, D = 30, L = 8, O = 90, n = {
|
|
27
|
+
"tag-icon--primary": "_tag-icon--primary_1jzei_1",
|
|
28
|
+
"tag-icon--success": "_tag-icon--success_1jzei_4",
|
|
29
|
+
"tag-icon--relation": "_tag-icon--relation_1jzei_7",
|
|
30
|
+
"tag-icon--public": "_tag-icon--public_1jzei_10"
|
|
31
|
+
}, j = ({ type: o, size: a }) => {
|
|
32
|
+
switch (o) {
|
|
33
|
+
case "label":
|
|
34
|
+
return /* @__PURE__ */ t(c, { name: "Enterpriselabel", className: n["tag-icon--primary"], size: a });
|
|
35
|
+
case "dockcorp":
|
|
36
|
+
case "dockcorpdept":
|
|
37
|
+
return /* @__PURE__ */ t(c, { name: "company", className: n["tag-icon--primary"], size: a });
|
|
38
|
+
case "dockdept":
|
|
39
|
+
case "member":
|
|
40
|
+
return /* @__PURE__ */ t(c, { name: "dept-one", className: n["tag-icon--primary"], size: a });
|
|
41
|
+
case "group":
|
|
42
|
+
return /* @__PURE__ */ t(c, { name: "Outreach", className: n["tag-icon--success"], size: a });
|
|
43
|
+
case "public":
|
|
44
|
+
return /* @__PURE__ */ t(c, { name: "publicaccess", className: n["tag-icon--public"], size: a });
|
|
45
|
+
case "relation":
|
|
46
|
+
return /* @__PURE__ */ t(c, { name: "membership", className: n["tag-icon--relation"], size: a });
|
|
47
|
+
default:
|
|
48
|
+
return /* @__PURE__ */ t(c, { name: "dept-one", className: n["tag-icon--primary"], size: a });
|
|
49
|
+
}
|
|
50
|
+
}, I = "_active_1vd3c_15", r = {
|
|
51
|
+
"tabgroup-container": "_tabgroup-container_1vd3c_1",
|
|
52
|
+
"tabgroup-container__tab-item": "_tabgroup-container__tab-item_1vd3c_7",
|
|
53
|
+
active: I,
|
|
54
|
+
"tabgroup-container__indicator": "_tabgroup-container__indicator_1vd3c_18"
|
|
55
|
+
}, k = (o) => {
|
|
56
|
+
const { tabs: a, value: s, onChange: u } = o, l = f(null), [p, _] = v({
|
|
57
|
+
width: 0,
|
|
58
|
+
transform: "translateX(0)"
|
|
59
|
+
}), m = (e) => {
|
|
60
|
+
const i = l.current?.querySelector(`[data-key="${e}"]`);
|
|
61
|
+
if (i) {
|
|
62
|
+
const { width: d, left: g } = i.getBoundingClientRect(), b = i.parentElement?.parentElement?.getBoundingClientRect().left || 0;
|
|
63
|
+
_({
|
|
64
|
+
width: d,
|
|
65
|
+
transform: `translateX(${g - b}px)`
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return y(() => {
|
|
70
|
+
m(s);
|
|
71
|
+
}, [s]), /* @__PURE__ */ E("div", { className: r["tabgroup-container"], ref: l, children: [
|
|
72
|
+
/* @__PURE__ */ t(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: r["tabgroup-container__indicator"],
|
|
76
|
+
style: {
|
|
77
|
+
width: `${p.width}px`,
|
|
78
|
+
transform: p.transform
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
a.map((e) => /* @__PURE__ */ t(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: N(r["tabgroup-container__tab-item"], {
|
|
86
|
+
[r.active]: s === e.value
|
|
87
|
+
}),
|
|
88
|
+
onClick: () => u(e.value),
|
|
89
|
+
children: /* @__PURE__ */ t("span", { "data-key": e.value, children: e.label })
|
|
90
|
+
},
|
|
91
|
+
e.value
|
|
92
|
+
))
|
|
93
|
+
] });
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
H as E,
|
|
97
|
+
L as G,
|
|
98
|
+
D as M,
|
|
99
|
+
O as P,
|
|
100
|
+
G as T,
|
|
101
|
+
j as a,
|
|
102
|
+
P as b,
|
|
103
|
+
k as c
|
|
104
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { S as f } from "../vendors/simplebar-react.js";
|
|
3
|
+
import { Tree as u, Icon as d } from "@baishuyun/ui-base";
|
|
4
|
+
import { u as S } from "./useDeptsMemberSelector-D3rvDuVf.js";
|
|
5
|
+
import { c as g } from "../vendors/clsx.js";
|
|
6
|
+
import { u as y } from "../vendors/useLocale.js";
|
|
7
|
+
import { a as N } from "../vendors/services/ncorp/department.service.js";
|
|
8
|
+
import { useRequest as b } from "ahooks";
|
|
9
|
+
import { useMemo as x } from "react";
|
|
10
|
+
import { buildDeptTree as D } from "./utils/index.js";
|
|
11
|
+
import { Spin as w } from "antd";
|
|
12
|
+
function v(o, c) {
|
|
13
|
+
const l = "bsy_dept_member";
|
|
14
|
+
try {
|
|
15
|
+
const t = sessionStorage.getItem(l), r = t ? JSON.parse(t) : [];
|
|
16
|
+
if (r.some((i) => i._id === o))
|
|
17
|
+
return;
|
|
18
|
+
const s = c.find((i) => i._id === o);
|
|
19
|
+
if (!s) {
|
|
20
|
+
console.warn(`未找到 id 为 ${o} 的节点信息`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
r.push(s), sessionStorage.setItem(l, JSON.stringify(r));
|
|
24
|
+
} catch (t) {
|
|
25
|
+
console.error("记录选中节点时发生错误:", t);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const a = {
|
|
29
|
+
"relation-ship-depts__icon": "_relation-ship-depts__icon_b3fo8_1",
|
|
30
|
+
"relation-ship-depts__arrow-icon": "_relation-ship-depts__arrow-icon_b3fo8_5",
|
|
31
|
+
"rotate-90": "_rotate-90_b3fo8_10",
|
|
32
|
+
"relation-ship-depts__empty": "_relation-ship-depts__empty_b3fo8_13"
|
|
33
|
+
}, M = (o) => {
|
|
34
|
+
const { containerHeight: c } = S(), { t: l } = y(), { data: t, loading: r } = b(() => N({ hasDock: !0 }), {
|
|
35
|
+
onSuccess: (e) => {
|
|
36
|
+
e.departments && o.onSelect(e.departments[0]._id, e.departments[0]);
|
|
37
|
+
}
|
|
38
|
+
}), p = t?.departments || [], s = x(() => t?.departments?.length ? D(t.departments) : [], [t?.departments]), i = s?.map((e) => e._id), m = (e, _) => {
|
|
39
|
+
v(e, p), o.onSelect(e, _);
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ n(w, { spinning: r, children: /* @__PURE__ */ h(
|
|
42
|
+
f,
|
|
43
|
+
{
|
|
44
|
+
className: a["relation-ship-depts"],
|
|
45
|
+
style: { height: c - 8 },
|
|
46
|
+
scrollableNodeProps: { style: { overflowX: "auto", overflowY: "auto" } },
|
|
47
|
+
children: [
|
|
48
|
+
s.length > 0 && /* @__PURE__ */ n(
|
|
49
|
+
u,
|
|
50
|
+
{
|
|
51
|
+
parentCheckable: !0,
|
|
52
|
+
data: s,
|
|
53
|
+
fieldNames: {
|
|
54
|
+
title: "name",
|
|
55
|
+
value: "_id",
|
|
56
|
+
children: "children"
|
|
57
|
+
},
|
|
58
|
+
selectedKeys: o.value ? [o.value] : [],
|
|
59
|
+
onSelect: m,
|
|
60
|
+
defaultExpandedKeys: i,
|
|
61
|
+
icon: () => /* @__PURE__ */ n(d, { name: "dept-one", className: a["relation-ship-depts__icon"] }),
|
|
62
|
+
switcherIcon: (e) => /* @__PURE__ */ n(
|
|
63
|
+
d,
|
|
64
|
+
{
|
|
65
|
+
name: "xiangxiazhankai-11",
|
|
66
|
+
className: g(a["relation-ship-depts__arrow-icon"], {
|
|
67
|
+
[a["rotate-90"]]: e
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
p.length === 0 && !r && /* @__PURE__ */ n(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: a["relation-ship-depts__empty"],
|
|
77
|
+
style: { height: c - 8 + "px" },
|
|
78
|
+
children: /* @__PURE__ */ n("span", { children: l("department.noAvailable") })
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
M as R,
|
|
87
|
+
v as r
|
|
88
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { E as
|
|
1
|
+
import { D as o } from "./DeptsMember-BNuoQ8y4.js";
|
|
2
|
+
import { E as m } from "./TabGroup-DZC7i-Yr.js";
|
|
3
|
+
import { getColorByName as p } from "./utils/index.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
m as Entity,
|
|
6
|
+
o as default,
|
|
7
|
+
p as getColorByName
|
|
6
8
|
};
|