@baishuyun/ui-business 2.0.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.
- package/README.md +67 -0
- package/dist/ConfigProvider/ConfigProvider-CE-neQMa.js +9 -0
- package/dist/ConfigProvider/configContext-lDqg07Z3.js +7 -0
- package/dist/ConfigProvider/index.d.ts +4 -0
- package/dist/ConfigProvider/index.js +4 -0
- package/dist/DeptsMember/DeptsMember-C54jKU8C.js +685 -0
- package/dist/DeptsMember/TabGroup-B_2npRbC.js +121 -0
- package/dist/DeptsMember/index.d.ts +6 -0
- package/dist/DeptsMember/index.js +6 -0
- package/dist/DeptsMember/subcomponents/Entity/Department/index.d.ts +2 -0
- package/dist/DeptsMember/subcomponents/Entity/Department/index.js +363 -0
- package/dist/DeptsMember/subcomponents/Entity/Member/index.d.ts +2 -0
- package/dist/DeptsMember/subcomponents/Entity/Member/index.js +671 -0
- package/dist/DeptsMember/utils/index.d.ts +2 -0
- package/dist/DeptsMember/utils/index.js +77 -0
- package/dist/components/ConfigProvider/ConfigProvider.d.ts +4 -0
- package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +5 -0
- package/dist/components/ConfigProvider/context/configContext.d.ts +3 -0
- package/dist/components/ConfigProvider/index.d.ts +2 -0
- package/dist/components/DeptsMember/DeptsMember.d.ts +3 -0
- package/dist/components/DeptsMember/DeptsMember.type.d.ts +23 -0
- package/dist/components/DeptsMember/context/DeptsMemberContext.d.ts +45 -0
- package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +7 -0
- package/dist/components/DeptsMember/index.d.ts +4 -0
- package/dist/components/DeptsMember/reducers/deptsMemberReducer.d.ts +3 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/CurrentDepartmentEntity/CurrentDepartmentEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/DepartmentSearch/DepartmentSearch.d.ts +4 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/ExternalContactEntity/ExternalContactEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/GroupList/GroupList.d.ts +9 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/OrganizationalEntity/ExternalOrganization/ExternalOrganization.d.ts +7 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/OrganizationalEntity/InternalOrganization/InternalOrganization.d.ts +7 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/OrganizationalEntity/OrganizationalEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/index.d.ts +6 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/CurrentEntity/CurrentEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/ExternalContactEntity/ExternalContactEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MajorEntity/MajorEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/AllMemeberCheck/AllMemeberCheck.d.ts +5 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/ExternalMember/ExternalMember.d.ts +8 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/InternalMemeber/InternalMemeber.d.ts +8 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/MemberEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberEntity/MemerList/MemberList.d.ts +7 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/MemberSearch/MemberSearch.d.ts +4 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/RoleEntity/RoleEntity.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/index.d.ts +6 -0
- package/dist/components/DeptsMember/subcomponents/SelectionArea/SelectionArea.d.ts +6 -0
- package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabList/SelectionTabList.d.ts +14 -0
- package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabPanel/SelectionTabPanel.d.ts +3 -0
- package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabs.d.ts +2 -0
- package/dist/components/DeptsMember/subcomponents/TabGroup/TabGroup.d.ts +9 -0
- package/dist/components/DeptsMember/subcomponents/TagIcon/TagIcon.d.ts +4 -0
- package/dist/components/DeptsMember/utils/constants.d.ts +25 -0
- package/dist/components/DeptsMember/utils/index.d.ts +43 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/hooks/useLocale.d.ts +10 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -0
- package/dist/lang/en-US.json.d.ts +58 -0
- package/dist/lang/zh-CN.json.d.ts +58 -0
- package/dist/services/apiService.d.ts +12 -0
- package/dist/services/corp/outsider.service.d.ts +6 -0
- package/dist/services/data/department.service.d.ts +12 -0
- package/dist/services/data/member.service.d.ts +19 -0
- package/dist/services/data/member_limit.service.d.ts +5 -0
- package/dist/services/data/outsider.service.d.ts +11 -0
- package/dist/services/team/team.services.d.ts +10 -0
- package/dist/vendors/axios.js +1720 -0
- package/dist/vendors/clsx.js +16 -0
- package/dist/vendors/lodash-es.js +124 -0
- package/dist/vendors/services/apiService.js +88 -0
- package/dist/vendors/services/corp/outsider.service.js +6 -0
- package/dist/vendors/services/data/department.service.js +6 -0
- package/dist/vendors/services/data/member.service.js +9 -0
- package/dist/vendors/services/data/member_limit.service.js +5 -0
- package/dist/vendors/services/data/outsider.service.js +6 -0
- package/dist/vendors/services/team/team.services.js +5 -0
- package/dist/vendors/simplebar-react.js +408 -0
- package/dist/vite-env.d.ts +6 -0
- package/package.json +87 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { createContext as h, useContext as x, useMemo as p, useCallback as E, forwardRef as v, useRef as A, useState as D, useEffect as N } from "react";
|
|
2
|
+
import { n as b } from "../vendors/lodash-es.js";
|
|
3
|
+
import { jsx as r, jsxs as G } from "react/jsx-runtime";
|
|
4
|
+
import { Icon as s } from "bsy-react-ui";
|
|
5
|
+
import { C as R } from "../ConfigProvider/configContext-lDqg07Z3.js";
|
|
6
|
+
import { c as S } from "../vendors/clsx.js";
|
|
7
|
+
var f = /* @__PURE__ */ ((e) => (e[e.USER = 0] = "USER", e[e.USER_GROUP = 1] = "USER_GROUP", e[e.DEPARMENT = 2] = "DEPARMENT", e[e.DEPARMENT_GROUP = 3] = "DEPARMENT_GROUP", e))(f || {});
|
|
8
|
+
const te = 110, ae = 68, ne = 30, re = 8, oe = 90, M = h({
|
|
9
|
+
dispatch: b,
|
|
10
|
+
setValue: b,
|
|
11
|
+
type: f.DEPARMENT,
|
|
12
|
+
containerHeight: 0
|
|
13
|
+
}), le = () => x(M), ce = ({ type: e }) => {
|
|
14
|
+
switch (e) {
|
|
15
|
+
case "label":
|
|
16
|
+
return /* @__PURE__ */ r(s, { name: "Enterpriselabel", className: "text-[#0265ff] text-lg" });
|
|
17
|
+
case "dockcorp":
|
|
18
|
+
case "dockcorpdept":
|
|
19
|
+
return /* @__PURE__ */ r(s, { name: "company", className: "text-[#0265ff] text-lg" });
|
|
20
|
+
case "dockdept":
|
|
21
|
+
case "member":
|
|
22
|
+
return /* @__PURE__ */ r(s, { name: "dept-one", className: "text-[#0265ff] text-lg" });
|
|
23
|
+
case "group":
|
|
24
|
+
return /* @__PURE__ */ r(s, { name: "Outreach", className: "text-[#70c911] text-lg" });
|
|
25
|
+
default:
|
|
26
|
+
return /* @__PURE__ */ r(s, { name: "dept-one", className: "text-[#0265ff] text-lg" });
|
|
27
|
+
}
|
|
28
|
+
}, I = { loading: "加载中...", cancel: "取消", confirm: "确认", clearAll: "清空所选项", viewAll: "查看全部{count}个", selected: "已选 {selected}/{total}", collapseAll: "收起全部", noAvailable: "没有可选成员" }, U = { title: "部门", search: "搜索部门", noAvailable: "没有可选部门", contact: "对接部门", organizationalStructure: "组织架构", currentUserDepartment: "当前用户所处部门", internal: "内部组织", external: "外部组织", externalContactGroup: "对接人小组", externalContactDepartment: "对接部门" }, P = { title: "成员", search: "搜索成员", contact: "对接人", all: "全部成员", internal: "内部成员", external: "外部成员", noAvailable: "没有可选成员" }, T = { title: "角色", internal: "内部角色", external: "互联角色" }, k = { title: "职位" }, O = { title: "当前用户" }, $ = { title: "外部联系人", defaultGroup: "默认分组", customGroup: "自定义分组", group: "外部联系人分组", noAvailableGroup: "没有可选分组" }, w = { searchMember: "搜索成员", searchDepartment: "搜索部门" }, d = {
|
|
29
|
+
common: I,
|
|
30
|
+
department: U,
|
|
31
|
+
member: P,
|
|
32
|
+
role: T,
|
|
33
|
+
position: k,
|
|
34
|
+
currentUser: O,
|
|
35
|
+
externalContact: $,
|
|
36
|
+
tabs: w
|
|
37
|
+
}, H = { loading: "Loading...", cancel: "Cancel", confirm: "Confirm", clearAll: "Clear All", viewAll: "View All {count}", selected: "Selected {selected}/{total}", collapseAll: "Collapse All", noAvailable: "No available members" }, L = { title: "Department", search: "Search Department", noAvailable: "No available departments", contact: "Contact Department", organizationalStructure: "Organizational Structure", currentUserDepartment: "Current User Department", internal: "Internal Organization", external: "External Organization", externalContactGroup: "External Contact Group", externalContactDepartment: "External Contact Department" }, z = { title: "Member", search: "Search Member", contact: "Contact Person", all: "All Members", internal: "Internal Members", external: "External Members", noAvailable: "No available members" }, y = { title: "Role", internal: "Internal Role", external: "Interconnected Role" }, B = { title: "Position" }, W = { title: "Current User" }, j = { title: "External Contact", defaultGroup: "Default Group", customGroup: "Custom Group", group: "External Contact Group", noAvailableGroup: "No available groups" }, V = { searchMember: "Search Member", searchDepartment: "Search Department" }, X = {
|
|
38
|
+
common: H,
|
|
39
|
+
department: L,
|
|
40
|
+
member: z,
|
|
41
|
+
role: y,
|
|
42
|
+
position: B,
|
|
43
|
+
currentUser: W,
|
|
44
|
+
externalContact: j,
|
|
45
|
+
tabs: V
|
|
46
|
+
}, q = (e, t, n) => {
|
|
47
|
+
const c = t.split(".");
|
|
48
|
+
let a = e;
|
|
49
|
+
try {
|
|
50
|
+
for (const o of c)
|
|
51
|
+
a = a[o];
|
|
52
|
+
return typeof a == "string" ? n ? a.replace(/\{(\w+)\}/g, (o, i) => n[i] !== void 0 ? String(n[i]) : o) : a : t;
|
|
53
|
+
} catch {
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
}, se = () => {
|
|
57
|
+
const e = x(R), t = p(() => ({ "zh-CN": d, "en-US": X }), []), n = p(() => t[e.locale] || d, [e.locale, t]);
|
|
58
|
+
return {
|
|
59
|
+
t: E(
|
|
60
|
+
(a, o) => q(n, a, o),
|
|
61
|
+
[n]
|
|
62
|
+
)
|
|
63
|
+
};
|
|
64
|
+
}, F = "_active_nkgxh_15", u = {
|
|
65
|
+
"tabgroup-container": "_tabgroup-container_nkgxh_1",
|
|
66
|
+
"tabgroup-container__tab-item": "_tabgroup-container__tab-item_nkgxh_7",
|
|
67
|
+
active: F,
|
|
68
|
+
"tabgroup-container__indicator": "_tabgroup-container__indicator_nkgxh_18"
|
|
69
|
+
}, ie = v(({ tabs: e, value: t, onChange: n }) => {
|
|
70
|
+
const c = A(null), [a, o] = D({
|
|
71
|
+
width: 0,
|
|
72
|
+
transform: "translateX(0)"
|
|
73
|
+
}), i = (l) => {
|
|
74
|
+
const m = c.current?.querySelector(`[data-key="${l}"]`);
|
|
75
|
+
if (m) {
|
|
76
|
+
const { width: g, left: _ } = m.getBoundingClientRect(), C = m.parentElement?.parentElement?.getBoundingClientRect().left || 0;
|
|
77
|
+
o({
|
|
78
|
+
width: g,
|
|
79
|
+
transform: `translateX(${_ - C}px)`
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return N(() => {
|
|
84
|
+
i(t);
|
|
85
|
+
}, [t]), /* @__PURE__ */ G("div", { className: u["tabgroup-container"], ref: c, children: [
|
|
86
|
+
/* @__PURE__ */ r(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: u["tabgroup-container__indicator"],
|
|
90
|
+
style: {
|
|
91
|
+
width: `${a.width}px`,
|
|
92
|
+
transform: a.transform
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
e.map((l) => /* @__PURE__ */ r(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: S(u["tabgroup-container__tab-item"], {
|
|
100
|
+
[u.active]: t === l.value
|
|
101
|
+
}),
|
|
102
|
+
onClick: () => n(l.value),
|
|
103
|
+
children: /* @__PURE__ */ r("span", { "data-key": l.value, children: l.label })
|
|
104
|
+
},
|
|
105
|
+
l.value
|
|
106
|
+
))
|
|
107
|
+
] });
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
M as D,
|
|
111
|
+
f as E,
|
|
112
|
+
re as G,
|
|
113
|
+
ne as M,
|
|
114
|
+
oe as P,
|
|
115
|
+
ae as T,
|
|
116
|
+
se as a,
|
|
117
|
+
te as b,
|
|
118
|
+
ce as c,
|
|
119
|
+
ie as d,
|
|
120
|
+
le as u
|
|
121
|
+
};
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { jsxs as b, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { g as z, d as P } from "../../../../vendors/services/data/member.service.js";
|
|
3
|
+
import { useRequest as T } from "ahooks";
|
|
4
|
+
import { Spin as A, Radio as R } from "antd";
|
|
5
|
+
import { c as v } from "../../../../vendors/clsx.js";
|
|
6
|
+
import { useState as D, useMemo as G, useCallback as M } from "react";
|
|
7
|
+
import { u as N, a as k, E, d as L, c as H } from "../../../TabGroup-B_2npRbC.js";
|
|
8
|
+
import { buildDeptTree as B, buildTree as U, findNodeInTree as q } from "../../../utils/index.js";
|
|
9
|
+
import { S } from "../../../../vendors/simplebar-react.js";
|
|
10
|
+
import { Tree as w, Icon as C, Checkbox as O } from "bsy-react-ui";
|
|
11
|
+
import { g as J } from "../../../../vendors/services/corp/outsider.service.js";
|
|
12
|
+
const Q = (t) => {
|
|
13
|
+
const { type: r, containerHeight: p, value: o } = N(), { t: a } = k(), f = o?.map((d) => d._id) || [], i = t.data?.map((d) => d._id);
|
|
14
|
+
return /* @__PURE__ */ b(
|
|
15
|
+
S,
|
|
16
|
+
{
|
|
17
|
+
style: { height: p - 8, padding: "4px" },
|
|
18
|
+
className: "internal-container",
|
|
19
|
+
children: [
|
|
20
|
+
t.data.length > 0 && /* @__PURE__ */ e(
|
|
21
|
+
w,
|
|
22
|
+
{
|
|
23
|
+
parentCheckable: !0,
|
|
24
|
+
checkType: r === E.DEPARMENT ? "radio" : "checkbox",
|
|
25
|
+
data: t.data,
|
|
26
|
+
fieldNames: {
|
|
27
|
+
title: "name",
|
|
28
|
+
value: "_id",
|
|
29
|
+
children: "children"
|
|
30
|
+
},
|
|
31
|
+
selectedKeys: f,
|
|
32
|
+
onSelect: t.onSelect,
|
|
33
|
+
onDeSelect: t.onDeselect,
|
|
34
|
+
defaultExpandedKeys: i,
|
|
35
|
+
icon: () => /* @__PURE__ */ e(C, { name: "dept-one", className: "internal-container__icon" }),
|
|
36
|
+
switcherIcon: (d) => /* @__PURE__ */ e(
|
|
37
|
+
C,
|
|
38
|
+
{
|
|
39
|
+
name: "xiangxiazhankai-11",
|
|
40
|
+
className: v("internal-container__arrow-icon", {
|
|
41
|
+
"rotate-90": d
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
t.data.length === 0 && !t.loading && /* @__PURE__ */ e("div", { className: "internal-container__empty", children: /* @__PURE__ */ e("span", { children: a("department.noAvailable") }) })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}, V = (t) => {
|
|
52
|
+
const { type: r, containerHeight: p, value: o } = N(), { t: a } = k(), [f, i] = D(
|
|
53
|
+
"dockcorp"
|
|
54
|
+
/* DOCK_PERSON_GROUP */
|
|
55
|
+
), d = o?.map((n) => n._id) || [], g = [
|
|
56
|
+
{
|
|
57
|
+
label: a("department.externalContactGroup"),
|
|
58
|
+
value: "dockcorp"
|
|
59
|
+
/* DOCK_PERSON_GROUP */
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: a("department.externalContactDepartment"),
|
|
63
|
+
value: "dockcorpdept"
|
|
64
|
+
/* DOCK_DEPARTMENT */
|
|
65
|
+
}
|
|
66
|
+
], s = (n, u) => {
|
|
67
|
+
const m = [];
|
|
68
|
+
for (const c of n)
|
|
69
|
+
if (c.type === u)
|
|
70
|
+
if (u === "dockcorpdept")
|
|
71
|
+
m.push({
|
|
72
|
+
...c,
|
|
73
|
+
children: c.children
|
|
74
|
+
});
|
|
75
|
+
else {
|
|
76
|
+
const l = c.children ? s(c.children, u) : [];
|
|
77
|
+
m.push({
|
|
78
|
+
...c,
|
|
79
|
+
children: l.length > 0 ? l : void 0
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const l = c.children ? s(c.children, u) : [];
|
|
84
|
+
l.length > 0 && m.push({
|
|
85
|
+
...c,
|
|
86
|
+
children: l
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return m;
|
|
90
|
+
}, x = s(t.data, f), _ = x?.map((n) => n._id);
|
|
91
|
+
return /* @__PURE__ */ b("div", { className: "external-container", children: [
|
|
92
|
+
/* @__PURE__ */ e(L, { tabs: g, value: f, onChange: i }),
|
|
93
|
+
/* @__PURE__ */ e("div", { className: "external-container__content", children: /* @__PURE__ */ b(S, { style: { height: p - 42, padding: "4px" }, children: [
|
|
94
|
+
x.length > 0 && /* @__PURE__ */ e(
|
|
95
|
+
w,
|
|
96
|
+
{
|
|
97
|
+
parentCheckable: !0,
|
|
98
|
+
checkType: r === E.DEPARMENT ? "radio" : "checkbox",
|
|
99
|
+
data: x,
|
|
100
|
+
fieldNames: {
|
|
101
|
+
title: "name",
|
|
102
|
+
value: "_id",
|
|
103
|
+
children: "children"
|
|
104
|
+
},
|
|
105
|
+
selectedKeys: d,
|
|
106
|
+
onSelect: t.onSelect,
|
|
107
|
+
onDeSelect: t.onDeselect,
|
|
108
|
+
defaultExpandedKeys: _,
|
|
109
|
+
icon: () => /* @__PURE__ */ e(C, { name: "dept-one", className: "text-[#0265ff] text-lg" }),
|
|
110
|
+
switcherIcon: (n) => /* @__PURE__ */ e(
|
|
111
|
+
C,
|
|
112
|
+
{
|
|
113
|
+
name: "xiangxiazhankai-11",
|
|
114
|
+
className: v(
|
|
115
|
+
"transition-transform text-base duration-300 ease-in-out text-[#666]",
|
|
116
|
+
{
|
|
117
|
+
"rotate-90": n
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
x.length === 0 && !t.loading && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: a("department.noAvailable") }) })
|
|
125
|
+
] }) })
|
|
126
|
+
] });
|
|
127
|
+
}, W = () => {
|
|
128
|
+
const { type: t, dispatch: r } = N(), { t: p } = k(), [o] = D([
|
|
129
|
+
{ key: 0, label: p("department.internal"), visible: !0 },
|
|
130
|
+
{ key: 1, label: p("department.external"), visible: !0 }
|
|
131
|
+
]), [a, f] = D(
|
|
132
|
+
0
|
|
133
|
+
/* INTERNAL */
|
|
134
|
+
), { data: i, loading: d } = T(
|
|
135
|
+
() => z({
|
|
136
|
+
departmentLimit: [],
|
|
137
|
+
hasDeptDock: a === 1
|
|
138
|
+
/* EXTERNAL */
|
|
139
|
+
}),
|
|
140
|
+
{
|
|
141
|
+
refreshDeps: [a]
|
|
142
|
+
}
|
|
143
|
+
), g = G(() => {
|
|
144
|
+
const l = i?.departments || [];
|
|
145
|
+
return l.length > 0 ? B(l) : [];
|
|
146
|
+
}, [i]), s = G(() => {
|
|
147
|
+
const l = i?.label_corp_list || [];
|
|
148
|
+
if (!l.length)
|
|
149
|
+
return [];
|
|
150
|
+
const y = l.filter((h) => h.type === "dockcorp" || h.type === "dockdept" ? !0 : h.parentId === 0 ? !1 : l.some((K) => K.parentId === h.departmentId)), I = y.map((h) => ({
|
|
151
|
+
...h,
|
|
152
|
+
checkable: h.type !== "dockcorpdept" && h.type !== "label",
|
|
153
|
+
icon: /* @__PURE__ */ e(H, { type: h.type })
|
|
154
|
+
// name: (
|
|
155
|
+
// <div>
|
|
156
|
+
// <span>{dept.name}</span>
|
|
157
|
+
// {showBadge && (
|
|
158
|
+
// <span className="text-xs text-[#4d609f]">({badgeText[dept.type]})</span>
|
|
159
|
+
// )}
|
|
160
|
+
// </div>
|
|
161
|
+
// ),
|
|
162
|
+
}));
|
|
163
|
+
return y.length > 0 ? U(I, {
|
|
164
|
+
parentId: "parentId",
|
|
165
|
+
children: "children",
|
|
166
|
+
value: "_id",
|
|
167
|
+
title: "name"
|
|
168
|
+
}) : [];
|
|
169
|
+
}, [i]), x = {
|
|
170
|
+
0: g,
|
|
171
|
+
1: s
|
|
172
|
+
}, _ = M(
|
|
173
|
+
(l) => {
|
|
174
|
+
const y = a === 1 ? i?.label_corp_list : i?.departments;
|
|
175
|
+
if (!y)
|
|
176
|
+
return;
|
|
177
|
+
const I = y.find((h) => h._id === l);
|
|
178
|
+
I && r({
|
|
179
|
+
type: "insertOnly",
|
|
180
|
+
payload: {
|
|
181
|
+
...I
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
[r, i, a]
|
|
186
|
+
), n = M(
|
|
187
|
+
(l, y) => {
|
|
188
|
+
r({
|
|
189
|
+
type: "addOne",
|
|
190
|
+
payload: {
|
|
191
|
+
...y
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
[r]
|
|
196
|
+
), u = (l) => {
|
|
197
|
+
const y = q(l, x[a], {
|
|
198
|
+
children: "children",
|
|
199
|
+
value: "_id"
|
|
200
|
+
});
|
|
201
|
+
y && r({
|
|
202
|
+
type: "deleteOne",
|
|
203
|
+
payload: y._id
|
|
204
|
+
});
|
|
205
|
+
}, m = E.DEPARMENT === t ? _ : n, c = i?.label_corp_count || 0;
|
|
206
|
+
return /* @__PURE__ */ b("div", { className: "flex line-height-normal h-full", children: [
|
|
207
|
+
c > 0 && /* @__PURE__ */ e("aside", { className: "basis-[200px] p-1 shrink-0", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: o.filter((l) => l.visible).map((l) => /* @__PURE__ */ e(
|
|
208
|
+
"li",
|
|
209
|
+
{
|
|
210
|
+
onClick: () => f(l.key),
|
|
211
|
+
className: v("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
|
|
212
|
+
"bg-[#F0F6FF] text-[#0265ff]": a === l.key,
|
|
213
|
+
"text-black hover:bg-[#f3f3f3]": a !== l.key
|
|
214
|
+
}),
|
|
215
|
+
children: l.label
|
|
216
|
+
},
|
|
217
|
+
l.key
|
|
218
|
+
)) }) }),
|
|
219
|
+
/* @__PURE__ */ e(
|
|
220
|
+
"section",
|
|
221
|
+
{
|
|
222
|
+
className: v("flex-1 border-[#E0E0E0] overflow-hidden", {
|
|
223
|
+
"border-l": c > 0
|
|
224
|
+
}),
|
|
225
|
+
children: /* @__PURE__ */ b(A, { spinning: d, children: [
|
|
226
|
+
a === 0 && /* @__PURE__ */ e(
|
|
227
|
+
Q,
|
|
228
|
+
{
|
|
229
|
+
onSelect: m,
|
|
230
|
+
onDeselect: u,
|
|
231
|
+
loading: !0,
|
|
232
|
+
data: x[a]
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
a === 1 && /* @__PURE__ */ e(
|
|
236
|
+
V,
|
|
237
|
+
{
|
|
238
|
+
data: x[a],
|
|
239
|
+
onSelect: m,
|
|
240
|
+
onDeselect: u,
|
|
241
|
+
loading: !0
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
] })
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] });
|
|
248
|
+
}, F = (t) => {
|
|
249
|
+
const { list: r } = t, { value: p, type: o, dispatch: a } = N(), f = o === E.DEPARMENT, i = o === E.DEPARMENT_GROUP, d = p?.[0]?._id, g = (n) => {
|
|
250
|
+
const u = r?.find((m) => m._id === n.target.value);
|
|
251
|
+
u && a({
|
|
252
|
+
type: "insertOnly",
|
|
253
|
+
payload: Object.assign({}, u, {
|
|
254
|
+
type: t.type || u.type
|
|
255
|
+
})
|
|
256
|
+
});
|
|
257
|
+
}, s = (n) => {
|
|
258
|
+
a({
|
|
259
|
+
type: "deleteOne",
|
|
260
|
+
payload: n
|
|
261
|
+
});
|
|
262
|
+
}, x = p?.map((n) => n._id) || [], _ = (n) => {
|
|
263
|
+
const u = r.filter((c) => !n.includes(c._id)), m = r.filter((c) => n.includes(c._id));
|
|
264
|
+
a({
|
|
265
|
+
type: "deleteAndInsert",
|
|
266
|
+
payload: {
|
|
267
|
+
oldIds: u.map((c) => c._id),
|
|
268
|
+
newItems: m.map((c) => Object.assign({}, c, {
|
|
269
|
+
type: t.type || c.type
|
|
270
|
+
}))
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
return /* @__PURE__ */ e("div", { className: "entity-group-list", children: /* @__PURE__ */ b("ul", { className: "font-0", children: [
|
|
275
|
+
f && /* @__PURE__ */ e(R.Group, { value: d, onChange: g, className: "w-full", children: r.map((n) => /* @__PURE__ */ e(
|
|
276
|
+
"li",
|
|
277
|
+
{
|
|
278
|
+
className: v("rounded-[4px] cursor-pointer font-0", {
|
|
279
|
+
"hover:bg-[#f3f3f3]": !0
|
|
280
|
+
}),
|
|
281
|
+
children: /* @__PURE__ */ e(
|
|
282
|
+
R,
|
|
283
|
+
{
|
|
284
|
+
value: n._id,
|
|
285
|
+
className: "px-[10px] py-[6px]",
|
|
286
|
+
onClick: () => {
|
|
287
|
+
s(n._id);
|
|
288
|
+
},
|
|
289
|
+
children: /* @__PURE__ */ e("div", { className: "flex gap-[6px] items-center", children: /* @__PURE__ */ e("span", { className: "text-sm select-none", children: n.name }) })
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
},
|
|
293
|
+
n._id
|
|
294
|
+
)) }),
|
|
295
|
+
i && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(O.Group, { value: x, onChange: _, children: r.map((n) => /* @__PURE__ */ e(
|
|
296
|
+
"li",
|
|
297
|
+
{
|
|
298
|
+
className: v("rounded-[4px] cursor-pointer font-0 px-[10px]", {
|
|
299
|
+
"hover:bg-[#f3f3f3]": !0
|
|
300
|
+
}),
|
|
301
|
+
children: /* @__PURE__ */ e(O, { labelPosition: "left", value: n._id, children: /* @__PURE__ */ e("div", { className: "flex flex-1 gap-[6px] items-center py-[6px]", children: /* @__PURE__ */ e("span", { className: "text-sm select-none", children: n.name }) }) })
|
|
302
|
+
},
|
|
303
|
+
n._id
|
|
304
|
+
)) }) })
|
|
305
|
+
] }) });
|
|
306
|
+
}, X = () => {
|
|
307
|
+
const { containerHeight: t } = N(), { t: r } = k(), { data: p, loading: o } = T(
|
|
308
|
+
() => P({
|
|
309
|
+
departmentLimit: []
|
|
310
|
+
})
|
|
311
|
+
), a = p?.departmentList || [];
|
|
312
|
+
return /* @__PURE__ */ e("div", { className: "p-1 external-contact-entit relative", children: /* @__PURE__ */ e(A, { spinning: o, tip: r("common.loading"), children: /* @__PURE__ */ b(S, { style: { height: t - 8 }, children: [
|
|
313
|
+
/* @__PURE__ */ e(F, { list: a }),
|
|
314
|
+
a.length === 0 && !o && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: r("department.noAvailable") }) })
|
|
315
|
+
] }) }) });
|
|
316
|
+
}, Y = () => {
|
|
317
|
+
const { containerHeight: t } = N(), { t: r } = k(), [p] = D([
|
|
318
|
+
{ key: "default", label: r("externalContact.defaultGroup") },
|
|
319
|
+
{ key: "custom", label: r("externalContact.customGroup") }
|
|
320
|
+
]), [o, a] = D("default"), { data: f, loading: i } = T(() => J()), d = f?.list || [], g = o === "default" ? d.filter((s) => s.type === "1") : d.filter((s) => s.type !== "1");
|
|
321
|
+
return /* @__PURE__ */ b("div", { className: "external-contact-entity relative flex", children: [
|
|
322
|
+
/* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: p.map((s) => /* @__PURE__ */ e(
|
|
323
|
+
"li",
|
|
324
|
+
{
|
|
325
|
+
onClick: () => {
|
|
326
|
+
a(s.key);
|
|
327
|
+
},
|
|
328
|
+
className: v("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
|
|
329
|
+
"bg-[#F0F6FF] text-[#0265ff]": o === s.key,
|
|
330
|
+
"text-black hover:bg-[#f3f3f3]": o !== s.key
|
|
331
|
+
}),
|
|
332
|
+
children: s.label
|
|
333
|
+
},
|
|
334
|
+
s.key
|
|
335
|
+
)) }) }),
|
|
336
|
+
/* @__PURE__ */ e("div", { className: "flex-1 border-l border-[#E0E0E0]", children: /* @__PURE__ */ e(A, { spinning: i, tip: r("common.loading"), children: /* @__PURE__ */ b(S, { style: { height: t - 8, padding: "4px" }, children: [
|
|
337
|
+
g.length > 0 && /* @__PURE__ */ e(F, { list: g, type: "group" }),
|
|
338
|
+
g.length === 0 && !i && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: r("externalContact.noAvailableGroup") }) })
|
|
339
|
+
] }) }) })
|
|
340
|
+
] });
|
|
341
|
+
}, oe = () => {
|
|
342
|
+
const { t } = k();
|
|
343
|
+
return G(() => [
|
|
344
|
+
{
|
|
345
|
+
label: t("department.organizationalStructure"),
|
|
346
|
+
value: "organizational",
|
|
347
|
+
view: /* @__PURE__ */ e(W, {})
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
label: t("externalContact.group"),
|
|
351
|
+
value: "externalContactGroup",
|
|
352
|
+
view: /* @__PURE__ */ e(Y, {})
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
label: t("department.currentUserDepartment"),
|
|
356
|
+
value: "currentDepartment",
|
|
357
|
+
view: /* @__PURE__ */ e(X, {})
|
|
358
|
+
}
|
|
359
|
+
], [t]);
|
|
360
|
+
};
|
|
361
|
+
export {
|
|
362
|
+
oe as useDepartmentTabItems
|
|
363
|
+
};
|