@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.
Files changed (56) hide show
  1. package/dist/ConfigProvider/ConfigProvider-CAq3dN6-.js +15 -0
  2. package/dist/ConfigProvider/configContext-_BAslzM-.js +9 -0
  3. package/dist/ConfigProvider/index.d.ts +2 -0
  4. package/dist/ConfigProvider/index.js +1 -1
  5. package/dist/DeptsMember/DeptsMember-BNuoQ8y4.js +865 -0
  6. package/dist/DeptsMember/ExtraConcactPanel-BoSCI3s5.js +738 -0
  7. package/dist/DeptsMember/OrganizationPanel-ByWU1PWX.js +275 -0
  8. package/dist/DeptsMember/TabGroup-DZC7i-Yr.js +104 -0
  9. package/dist/DeptsMember/index-BRIA1uOQ.js +88 -0
  10. package/dist/DeptsMember/index.js +6 -4
  11. package/dist/DeptsMember/subcomponents/Entity/Department/index.js +115 -76
  12. package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +256 -27
  13. package/dist/DeptsMember/subcomponents/Entity/Member/index.js +15 -12
  14. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +4 -0
  15. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +15 -0
  16. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +4 -0
  17. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +67 -0
  18. package/dist/DeptsMember/useDeptsMemberSelector-D3rvDuVf.js +13 -0
  19. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +13 -1
  20. package/dist/components/ConfigProvider/index.d.ts +1 -0
  21. package/dist/components/DeptsMember/DeptsMember.type.d.ts +15 -0
  22. package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +4 -0
  23. package/dist/components/DeptsMember/index.d.ts +1 -0
  24. package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/MemberRelationShip.d.ts +2 -0
  25. package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.d.ts +5 -0
  26. package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.d.ts +15 -0
  27. package/dist/components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipMember/RelationShipMember.d.ts +6 -0
  28. package/dist/components/DeptsMember/subcomponents/Panels/OtherPanel/OtherPanel.d.ts +5 -0
  29. package/dist/components/index.d.ts +1 -0
  30. package/dist/index.css +1 -1
  31. package/dist/index.d.ts +2 -1
  32. package/dist/index.js +11 -6
  33. package/dist/lang/en-US.json.d.ts +7 -2
  34. package/dist/lang/zh-CN.json.d.ts +7 -2
  35. package/dist/services/apiService.d.ts +1 -0
  36. package/dist/services/ncorp/department.service.d.ts +11 -0
  37. package/dist/services/ncorp/relation.service.d.ts +4 -0
  38. package/dist/utils/getRelationNodeName.d.ts +9 -0
  39. package/dist/utils/index.d.ts +2 -0
  40. package/dist/utils/recordSelectedNode.d.ts +8 -0
  41. package/dist/vendors/services/apiService.js +18 -10
  42. package/dist/vendors/services/corp/outsider.service.js +4 -4
  43. package/dist/vendors/services/data/department.service.js +3 -3
  44. package/dist/vendors/services/data/member.service.js +6 -6
  45. package/dist/vendors/services/data/member_limit.service.js +3 -3
  46. package/dist/vendors/services/data/outsider.service.js +4 -4
  47. package/dist/vendors/services/ncorp/department.service.js +6 -0
  48. package/dist/vendors/services/ncorp/relation.service.js +5 -0
  49. package/dist/vendors/useLocale.js +42 -0
  50. package/package.json +8 -10
  51. package/dist/ConfigProvider/ConfigProvider-CE-neQMa.js +0 -9
  52. package/dist/ConfigProvider/configContext-lDqg07Z3.js +0 -7
  53. package/dist/DeptsMember/DeptsMember-CzJqr_LX.js +0 -721
  54. package/dist/DeptsMember/ExtraConcactPanel-BI9emYpp.js +0 -674
  55. package/dist/DeptsMember/OrganizationPanel-DcwvZ6X4.js +0 -254
  56. package/dist/DeptsMember/TabGroup-wNM86-Zq.js +0 -141
@@ -1,127 +1,166 @@
1
- import { jsx as e, jsxs as u, Fragment as S } from "react/jsx-runtime";
2
- import { O as M } from "../../../OrganizationPanel-DcwvZ6X4.js";
3
- import { useRequest as k } from "ahooks";
1
+ import { jsx as t, jsxs as g, Fragment as q } from "react/jsx-runtime";
2
+ import { O as M } from "../../../OrganizationPanel-ByWU1PWX.js";
3
+ import { useRequest as j } from "ahooks";
4
4
  import { d as R } from "../../../../vendors/services/data/member.service.js";
5
- import { c as x } from "../../../../vendors/clsx.js";
6
- import { Radio as b, Spin as E } from "antd";
7
- import { a as y, E as v, u as g } from "../../../TabGroup-wNM86-Zq.js";
8
- import { Checkbox as N } from "bsy-react-ui";
9
- import { S as C } from "../../../../vendors/simplebar-react.js";
5
+ import { c as C } from "../../../../vendors/clsx.js";
6
+ import { Radio as f, Spin as E } from "antd";
7
+ import { u as y } from "../../../useDeptsMemberSelector-D3rvDuVf.js";
8
+ import { E as k } from "../../../TabGroup-DZC7i-Yr.js";
9
+ import { Checkbox as v } from "@baishuyun/ui-base";
10
+ import { S as I } from "../../../../vendors/simplebar-react.js";
11
+ import { u as b } from "../../../../vendors/useLocale.js";
10
12
  import { g as O } from "../../../../vendors/services/corp/outsider.service.js";
11
- import { useState as G, useMemo as j } from "react";
12
- const _ = (a) => {
13
- const { list: n } = a, { value: o, type: r, dispatch: s } = y(), h = r === v.DEPARMENT, d = r === v.DEPARMENT_GROUP, m = o?.[0]?._id, c = (t) => {
14
- const p = n?.find((f) => f._id === t.target.value);
15
- p && s({
13
+ import { useState as N, useMemo as A } from "react";
14
+ const r = {
15
+ "group-list__list": "_group-list__list_1ncb5_1",
16
+ "group-list__option": "_group-list__option_1ncb5_4",
17
+ "group-list__option--checkbox": "_group-list__option--checkbox_1ncb5_13",
18
+ "group-list__radio": "_group-list__radio_1ncb5_16",
19
+ "group-list__row": "_group-list__row_1ncb5_19",
20
+ "group-list__name": "_group-list__name_1ncb5_24",
21
+ "group-list__checkbox-row": "_group-list__checkbox-row_1ncb5_28",
22
+ "group-list__checkbox": "_group-list__checkbox_1ncb5_28",
23
+ "group-list__group": "_group-list__group_1ncb5_38",
24
+ "group-list": "_group-list_1ncb5_1"
25
+ }, w = (a) => {
26
+ const { list: n } = a, { value: i, type: l, dispatch: c } = y(), h = l === k.DEPARMENT, m = l === k.DEPARMENT_GROUP, d = i?.[0]?._id, _ = (e) => {
27
+ const u = n?.find((x) => x._id === e.target.value);
28
+ u && c({
16
29
  type: "insertOnly",
17
- payload: Object.assign({}, p, {
18
- type: a.type || p.type
30
+ payload: Object.assign({}, u, {
31
+ type: a.type || u.type
19
32
  })
20
33
  });
21
- }, l = (t) => {
22
- s({
34
+ }, o = (e) => {
35
+ c({
23
36
  type: "deleteOne",
24
- payload: t
37
+ payload: e
25
38
  });
26
- }, I = o?.map((t) => t._id) || [], D = (t) => {
27
- const p = n.filter((i) => !t.includes(i._id)), f = n.filter((i) => t.includes(i._id));
28
- s({
39
+ }, D = i?.map((e) => e._id) || [], S = (e) => {
40
+ const u = n.filter((s) => !e.includes(s._id)), x = n.filter((s) => e.includes(s._id));
41
+ c({
29
42
  type: "deleteAndInsert",
30
43
  payload: {
31
- oldIds: p.map((i) => i._id),
32
- newItems: f.map((i) => Object.assign({}, i, {
33
- type: a.type || i.type
44
+ oldIds: u.map((s) => s._id),
45
+ newItems: x.map((s) => Object.assign({}, s, {
46
+ type: a.type || s.type
34
47
  }))
35
48
  }
36
49
  });
37
50
  };
38
- return /* @__PURE__ */ e("div", { className: "entity-group-list", children: /* @__PURE__ */ u("ul", { className: "font-0", children: [
39
- h && /* @__PURE__ */ e(b.Group, { value: m, onChange: c, className: "w-full", children: n.map((t) => /* @__PURE__ */ e(
40
- "li",
51
+ return /* @__PURE__ */ t("div", { className: r["group-list"], children: /* @__PURE__ */ g("ul", { className: r["group-list__list"], children: [
52
+ h && /* @__PURE__ */ t(
53
+ f.Group,
41
54
  {
42
- className: x("rounded-[4px] cursor-pointer font-0", {
43
- "hover:bg-[#f3f3f3]": !0
44
- }),
45
- children: /* @__PURE__ */ e(
46
- b,
55
+ value: d,
56
+ onChange: _,
57
+ className: r["group-list__group"],
58
+ children: n.map((e) => /* @__PURE__ */ t("li", { className: r["group-list__option"], children: /* @__PURE__ */ t(
59
+ f,
47
60
  {
48
- value: t._id,
49
- className: "px-[10px] py-[6px]",
61
+ value: e._id,
62
+ className: r["group-list__radio"],
50
63
  onClick: () => {
51
- l(t._id);
64
+ o(e._id);
52
65
  },
53
- children: /* @__PURE__ */ e("div", { className: "flex gap-[6px] items-center", children: /* @__PURE__ */ e("span", { className: "text-sm select-none", children: t.name }) })
66
+ children: /* @__PURE__ */ t("div", { className: r["group-list__row"], children: /* @__PURE__ */ t("span", { className: r["group-list__name"], children: e.name }) })
54
67
  }
55
- )
56
- },
57
- t._id
58
- )) }),
59
- d && /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(N.Group, { value: I, onChange: D, children: n.map((t) => /* @__PURE__ */ e(
60
- "li",
68
+ ) }, e._id))
69
+ }
70
+ ),
71
+ m && /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(
72
+ v.Group,
61
73
  {
62
- className: x("rounded-[4px] cursor-pointer font-0 px-[10px]", {
63
- "hover:bg-[#f3f3f3]": !0
64
- }),
65
- children: /* @__PURE__ */ e(N, { labelPosition: "left", value: t._id, children: /* @__PURE__ */ e("div", { className: "flex flex-1 gap-[6px] items-center py-[7px]", children: /* @__PURE__ */ e("span", { className: "text-sm select-none", children: t.name }) }) })
66
- },
67
- t._id
68
- )) }) })
74
+ value: D,
75
+ onChange: S,
76
+ className: r["group-list__group"],
77
+ children: n.map((e) => /* @__PURE__ */ t(
78
+ "li",
79
+ {
80
+ className: C(
81
+ r["group-list__option"],
82
+ r["group-list__option--checkbox"]
83
+ ),
84
+ children: /* @__PURE__ */ t(
85
+ v,
86
+ {
87
+ labelPosition: "left",
88
+ value: e._id,
89
+ className: r["group-list__checkbox"],
90
+ children: /* @__PURE__ */ t("div", { className: r["group-list__checkbox-row"], children: /* @__PURE__ */ t("span", { className: r["group-list__name"], children: e.name }) })
91
+ }
92
+ )
93
+ },
94
+ e._id
95
+ ))
96
+ }
97
+ ) })
69
98
  ] }) });
70
- }, A = () => {
71
- const { containerHeight: a } = y(), { t: n } = g(), { data: o, loading: r } = k(
99
+ }, G = {
100
+ "current-user-depts-panel": "_current-user-depts-panel_cjkm1_1",
101
+ "current-user-depts-panel__empty": "_current-user-depts-panel__empty_cjkm1_5"
102
+ }, L = () => {
103
+ const { containerHeight: a } = y(), { t: n } = b(), { data: i, loading: l } = j(
72
104
  () => R({
73
105
  departmentLimit: []
74
106
  })
75
- ), s = o?.departmentList || [];
76
- return /* @__PURE__ */ e("div", { className: "p-1 external-contact-entit relative", children: /* @__PURE__ */ e(E, { spinning: r, tip: n("common.loading"), children: /* @__PURE__ */ u(C, { style: { height: a - 8 }, children: [
77
- /* @__PURE__ */ e(_, { list: s }),
78
- s.length === 0 && !r && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: n("department.noAvailable") }) })
107
+ ), c = i?.departmentList || [];
108
+ return /* @__PURE__ */ t("div", { className: G["current-user-depts-panel"], children: /* @__PURE__ */ t(E, { spinning: l, tip: n("common.loading"), children: /* @__PURE__ */ g(I, { style: { height: a - 8 }, children: [
109
+ /* @__PURE__ */ t(w, { list: c }),
110
+ c.length === 0 && !l && /* @__PURE__ */ t("div", { className: G["current-user-depts-panel__empty"], children: /* @__PURE__ */ t("span", { children: n("department.noAvailable") }) })
79
111
  ] }) }) });
80
- }, w = () => {
81
- const { containerHeight: a } = y(), { t: n } = g(), [o] = G([
112
+ }, p = {
113
+ "extra-contact-group-panel": "_extra-contact-group-panel_jf0qd_1",
114
+ "extra-contact-group-panel__menu": "_extra-contact-group-panel__menu_jf0qd_6",
115
+ "extra-contact-group-panel__menu-list": "_extra-contact-group-panel__menu-list_jf0qd_10",
116
+ "extra-contact-group-panel__menu-item": "_extra-contact-group-panel__menu-item_jf0qd_14",
117
+ "extra-contact-group-panel__menu-item--active": "_extra-contact-group-panel__menu-item--active_jf0qd_25",
118
+ "extra-contact-group-panel__content": "_extra-contact-group-panel__content_jf0qd_32",
119
+ "extra-contact-group-panel__empty": "_extra-contact-group-panel__empty_jf0qd_37"
120
+ }, P = () => {
121
+ const { containerHeight: a } = y(), { t: n } = b(), [i] = N([
82
122
  { key: "default", label: n("externalContact.defaultGroup") },
83
123
  { key: "custom", label: n("externalContact.customGroup") }
84
- ]), [r, s] = G("default"), { data: h, loading: d } = k(() => O()), m = h?.list || [], c = r === "default" ? m.filter((l) => l.type === "1") : m.filter((l) => l.type !== "1");
85
- return /* @__PURE__ */ u("div", { className: "external-contact-entity relative flex", children: [
86
- /* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: o.map((l) => /* @__PURE__ */ e(
124
+ ]), [l, c] = N("default"), { data: h, loading: m } = j(() => O()), d = h?.list || [], _ = l === "default" ? d.filter((o) => o.type === "1") : d.filter((o) => o.type !== "1");
125
+ return /* @__PURE__ */ g("div", { className: p["extra-contact-group-panel"], children: [
126
+ /* @__PURE__ */ t("aside", { className: p["extra-contact-group-panel__menu"], children: /* @__PURE__ */ t("ul", { className: p["extra-contact-group-panel__menu-list"], children: i.map((o) => /* @__PURE__ */ t(
87
127
  "li",
88
128
  {
89
129
  onClick: () => {
90
- s(l.key);
130
+ c(o.key);
91
131
  },
92
- className: x("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
93
- "bg-[#F0F6FF] text-[#0265ff]": r === l.key,
94
- "text-black hover:bg-[#f3f3f3]": r !== l.key
132
+ className: C(p["extra-contact-group-panel__menu-item"], {
133
+ [p["extra-contact-group-panel__menu-item--active"]]: l === o.key
95
134
  }),
96
- children: l.label
135
+ children: o.label
97
136
  },
98
- l.key
137
+ o.key
99
138
  )) }) }),
100
- /* @__PURE__ */ e("div", { className: "flex-1 border-l border-[#E0E0E0]", children: /* @__PURE__ */ e(E, { spinning: d, tip: n("common.loading"), children: /* @__PURE__ */ u(C, { style: { height: a - 8, padding: "4px" }, children: [
101
- c.length > 0 && /* @__PURE__ */ e(_, { list: c, type: "group" }),
102
- c.length === 0 && !d && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-[#999]", children: n("externalContact.noAvailableGroup") }) })
139
+ /* @__PURE__ */ t("div", { className: p["extra-contact-group-panel__content"], children: /* @__PURE__ */ t(E, { spinning: m, tip: n("common.loading"), children: /* @__PURE__ */ g(I, { style: { height: a - 8, padding: "4px" }, children: [
140
+ _.length > 0 && /* @__PURE__ */ t(w, { list: _, type: "group" }),
141
+ _.length === 0 && !m && /* @__PURE__ */ t("div", { className: p["extra-contact-group-panel__empty"], children: /* @__PURE__ */ t("span", { children: n("externalContact.noAvailableGroup") }) })
103
142
  ] }) }) })
104
143
  ] });
105
- }, Q = () => {
106
- const { t: a } = g();
107
- return j(() => [
144
+ }, Y = () => {
145
+ const { t: a } = b();
146
+ return A(() => [
108
147
  {
109
148
  label: a("department.organizationalStructure"),
110
149
  key: "organizational",
111
- view: /* @__PURE__ */ e(M, {})
150
+ view: /* @__PURE__ */ t(M, {})
112
151
  },
113
152
  {
114
153
  label: a("externalContact.group"),
115
154
  key: "externalContactGroup",
116
- view: /* @__PURE__ */ e(w, {})
155
+ view: /* @__PURE__ */ t(P, {})
117
156
  },
118
157
  {
119
158
  label: a("department.currentUserDepartment"),
120
159
  key: "currentDepartment",
121
- view: /* @__PURE__ */ e(A, {})
160
+ view: /* @__PURE__ */ t(L, {})
122
161
  }
123
162
  ], [a]);
124
163
  };
125
164
  export {
126
- Q as useDepartmentTabItems
165
+ Y as useDepartmentTabItems
127
166
  };
@@ -1,38 +1,267 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { O as a } from "../../../OrganizationPanel-DcwvZ6X4.js";
3
- import { a as o, b as r, R as i, E as n } from "../../../ExtraConcactPanel-BI9emYpp.js";
4
- import { u as l } from "../../../TabGroup-wNM86-Zq.js";
5
- import { useMemo as m } from "react";
6
- const E = () => {
7
- const { t } = l();
8
- return m(() => [
1
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
+ import { O as I } from "../../../OrganizationPanel-ByWU1PWX.js";
3
+ import { a as E, b as S, R as C, E as P } from "../../../ExtraConcactPanel-BoSCI3s5.js";
4
+ import { useState as y, useMemo as F } from "react";
5
+ import { c as d } from "../../../../vendors/clsx.js";
6
+ import { u as v } from "../../../../vendors/useLocale.js";
7
+ import w from "../../Panels/MemberRelationShipPanel/RelationShipList/index.js";
8
+ import { r as k, R } from "../../../index-BRIA1uOQ.js";
9
+ import { g as j } from "../../../../vendors/services/ncorp/department.service.js";
10
+ import { useRequest as D } from "ahooks";
11
+ import { Spin as M, Avatar as g } from "antd";
12
+ import { S as A } from "../../../../vendors/simplebar-react.js";
13
+ import { getColorByName as z } from "../../../utils/index.js";
14
+ import { u as f } from "../../../useDeptsMemberSelector-D3rvDuVf.js";
15
+ import { Checkbox as N } from "@baishuyun/ui-base";
16
+ const l = {
17
+ "member-relation-ship": "_member-relation-ship_1fjcv_1",
18
+ "member-relation-ship__menu": "_member-relation-ship__menu_1fjcv_6",
19
+ "member-relation-ship__menu-list": "_member-relation-ship__menu-list_1fjcv_11",
20
+ "member-relation-ship__menu-item": "_member-relation-ship__menu-item_1fjcv_15",
21
+ "member-relation-ship__menu-item--active": "_member-relation-ship__menu-item--active_1fjcv_26",
22
+ "member-relation-ship__column": "_member-relation-ship__column_1fjcv_33"
23
+ }, _ = {
24
+ "relation-ship-member": "_relation-ship-member_h6xr2_1",
25
+ "relation-ship-member__list": "_relation-ship-member__list_h6xr2_4",
26
+ "relation-ship-member__item": "_relation-ship-member__item_h6xr2_9",
27
+ "relation-ship-member__item--active": "_relation-ship-member__item--active_h6xr2_22",
28
+ "relation-ship-member__avatar": "_relation-ship-member__avatar_h6xr2_28",
29
+ "relation-ship-member__nickname": "_relation-ship-member__nickname_h6xr2_31",
30
+ "relation-ship-member__deptnames": "_relation-ship-member__deptnames_h6xr2_40",
31
+ "relation-ship-member__empty": "_relation-ship-member__empty_h6xr2_47"
32
+ }, L = (t) => {
33
+ const { t: r } = v(), { containerHeight: c } = f(), { data: o, loading: p } = D(
34
+ () => j({
35
+ deptId: t.deptId,
36
+ hasDock: !0,
37
+ hasAdmin: !1,
38
+ hasGuest: !1,
39
+ limit: 100
40
+ }),
9
41
  {
10
- label: t("department.organizationalStructure"),
11
- key: "organizational",
12
- view: /* @__PURE__ */ e(a, {})
13
- },
42
+ refreshDeps: [t.deptId],
43
+ ready: !!t.deptId,
44
+ onSuccess: (i) => {
45
+ i?.users && i.users.length > 0 && (t.onChange?.(i.users[0]._id), k(i.users[0]._id, i.users));
46
+ }
47
+ }
48
+ ), n = o?.users || [], m = (i) => {
49
+ t.onChange?.(i._id), k(i._id, n);
50
+ };
51
+ return /* @__PURE__ */ e(M, { spinning: p, children: /* @__PURE__ */ e(
52
+ A,
14
53
  {
15
- label: t("member.title"),
16
- key: "member",
17
- view: /* @__PURE__ */ e(o, {})
18
- },
54
+ className: _["relation-ship-member"],
55
+ style: { height: c - 8 },
56
+ children: n.length > 0 ? /* @__PURE__ */ e("ul", { className: _["relation-ship-member__list"], children: n.map((i) => /* @__PURE__ */ u(
57
+ "li",
58
+ {
59
+ onClick: () => m(i),
60
+ className: d(_["relation-ship-member__item"], {
61
+ [_["relation-ship-member__item--active"]]: t.value === i._id
62
+ }),
63
+ children: [
64
+ /* @__PURE__ */ e("div", { className: _["relation-ship-member__avatar"], children: i.avatarurl ? /* @__PURE__ */ e(g, { src: i.avatarurl, size: 20 }) : /* @__PURE__ */ e(
65
+ g,
66
+ {
67
+ size: 20,
68
+ style: {
69
+ backgroundColor: z(i.nickname),
70
+ fontSize: "12px",
71
+ lineHeight: "13px"
72
+ },
73
+ children: i.nickname?.charAt(0) || "?"
74
+ }
75
+ ) }),
76
+ /* @__PURE__ */ e("div", { className: _["relation-ship-member__nickname"], children: i.nickname }),
77
+ /* @__PURE__ */ e("div", { className: _["relation-ship-member__deptnames"], children: i.deptnames })
78
+ ]
79
+ },
80
+ i._id
81
+ )) }) : !p && /* @__PURE__ */ e(
82
+ "div",
83
+ {
84
+ className: _["relation-ship-member__empty"],
85
+ style: { height: c - 8 + "px" },
86
+ children: /* @__PURE__ */ e("span", { children: r("member.noAvailable") })
87
+ }
88
+ )
89
+ }
90
+ ) });
91
+ }, O = () => {
92
+ const { t } = v(), [r, c] = y(
93
+ 0
94
+ /* DEPARTMENT */
95
+ ), o = [
19
96
  {
20
- label: t("position.title"),
21
- key: "position",
22
- view: /* @__PURE__ */ e(r, {})
97
+ key: 0,
98
+ label: t("department.title")
23
99
  },
24
100
  {
25
- label: t("role.title"),
26
- key: "role",
27
- view: /* @__PURE__ */ e(i, {})
101
+ key: 1,
102
+ label: t("member.title")
103
+ }
104
+ ], p = [
105
+ {
106
+ key: "relation",
107
+ label: "当前部门的所有关系"
28
108
  },
29
109
  {
30
- label: t("externalContact.title"),
31
- key: "extraContact",
32
- view: /* @__PURE__ */ e(n, {})
110
+ key: "relationSub",
111
+ label: "当前部门及子部门的所有关系"
112
+ }
113
+ ], [n, m] = y({
114
+ deptFrom: "relation",
115
+ memberFrom: "relationUser"
116
+ }), i = r === 0 ? n.deptFrom : n.memberFrom, b = r === 0 ? n.deptFromId : n.memberFromId;
117
+ return /* @__PURE__ */ u("div", { className: l["member-relation-ship"], children: [
118
+ /* @__PURE__ */ e("aside", { className: l["member-relation-ship__menu"], children: /* @__PURE__ */ e("ul", { className: l["member-relation-ship__menu-list"], children: o.map((a) => /* @__PURE__ */ e(
119
+ "li",
120
+ {
121
+ onClick: () => c(a.key),
122
+ className: d(l["member-relation-ship__menu-item"], {
123
+ [l["member-relation-ship__menu-item--active"]]: r === a.key
124
+ }),
125
+ children: a.label
126
+ },
127
+ a.key
128
+ )) }) }),
129
+ /* @__PURE__ */ e("section", { className: l["member-relation-ship__column"], children: /* @__PURE__ */ e(
130
+ R,
131
+ {
132
+ value: n.deptFromId,
133
+ onSelect: (a, s) => {
134
+ m((x) => ({
135
+ ...x,
136
+ deptFromId: a,
137
+ deptId: s.departmentId
138
+ }));
139
+ }
140
+ }
141
+ ) }),
142
+ /* @__PURE__ */ u("section", { className: l["member-relation-ship__column"], children: [
143
+ r === 0 && /* @__PURE__ */ e("ul", { className: l["member-relation-ship__menu-list"], children: p.map((a) => /* @__PURE__ */ e(
144
+ "li",
145
+ {
146
+ onClick: () => {
147
+ m((s) => ({
148
+ ...s,
149
+ deptFrom: a.key
150
+ }));
151
+ },
152
+ className: d(l["member-relation-ship__menu-item"], {
153
+ [l["member-relation-ship__menu-item--active"]]: n.deptFrom === a.key
154
+ }),
155
+ children: a.label
156
+ },
157
+ a.key
158
+ )) }),
159
+ r === 1 && /* @__PURE__ */ e(
160
+ L,
161
+ {
162
+ deptId: n.deptId,
163
+ value: n.memberFromId,
164
+ onChange: (a) => m((s) => ({ ...s, memberFromId: a }))
165
+ }
166
+ )
167
+ ] }),
168
+ /* @__PURE__ */ e("section", { className: l["member-relation-ship__column"], children: /* @__PURE__ */ e(w, { from: i, fromId: b }) })
169
+ ] });
170
+ }, h = {
171
+ "other-panel": "_other-panel_1fapn_1",
172
+ "other-panel__list": "_other-panel__list_1fapn_4",
173
+ "other-panel__item": "_other-panel__item_1fapn_10",
174
+ "other-panel__checkbox-row": "_other-panel__checkbox-row_1fapn_23",
175
+ "other-panel__name": "_other-panel__name_1fapn_28"
176
+ }, U = (t) => {
177
+ const r = [], { dispatch: c, value: o } = f();
178
+ t.publicPermissionEnable && r.push({ _id: "111000000000000000000001", name: "公开权限", type: "public" }), t.managerPermissionEnable && r.push({ _id: "111000000000000000000002", name: "系统管理员组", type: "public" });
179
+ const p = o?.map((m) => m._id) || [], n = (m) => {
180
+ const i = [], b = [];
181
+ for (let a = 0; a < r.length; a++) {
182
+ const s = r[a];
183
+ m.includes(s._id) ? i.push(s) : b.push(s);
184
+ }
185
+ c({
186
+ type: "deleteAndInsert",
187
+ payload: {
188
+ oldIds: b.map((a) => a._id),
189
+ newItems: i
190
+ }
191
+ });
192
+ };
193
+ return /* @__PURE__ */ e("div", { className: h["other-panel"], children: /* @__PURE__ */ e(
194
+ N.Group,
195
+ {
196
+ value: p,
197
+ onChange: n,
198
+ className: h["other-panel__list"],
199
+ children: r.map((m) => /* @__PURE__ */ e(
200
+ "li",
201
+ {
202
+ className: d(h["other-panel__item"], h["other-panel__item--checkbox"]),
203
+ children: /* @__PURE__ */ e(
204
+ N,
205
+ {
206
+ labelPosition: "left",
207
+ value: m._id,
208
+ className: h["other-panel__checkbox"],
209
+ children: /* @__PURE__ */ e("div", { className: h["other-panel__checkbox-row"], children: /* @__PURE__ */ e("span", { className: h["other-panel__name"], children: m.name }) })
210
+ }
211
+ )
212
+ },
213
+ m._id
214
+ ))
33
215
  }
34
- ], [t]);
216
+ ) });
217
+ }, ie = () => {
218
+ const { t } = v(), { auth: r } = f();
219
+ return F(() => {
220
+ const o = [
221
+ {
222
+ label: t("department.organizationalStructure"),
223
+ key: "organizational",
224
+ view: /* @__PURE__ */ e(I, {})
225
+ },
226
+ {
227
+ label: t("member.title"),
228
+ key: "member",
229
+ view: /* @__PURE__ */ e(E, {})
230
+ },
231
+ {
232
+ label: t("position.title"),
233
+ key: "position",
234
+ view: /* @__PURE__ */ e(S, {})
235
+ },
236
+ {
237
+ label: t("member.relation"),
238
+ key: "relation",
239
+ view: /* @__PURE__ */ e(O, {})
240
+ },
241
+ {
242
+ label: t("role.title"),
243
+ key: "role",
244
+ view: /* @__PURE__ */ e(C, {})
245
+ },
246
+ {
247
+ label: t("externalContact.title"),
248
+ key: "extraContact",
249
+ view: /* @__PURE__ */ e(P, {})
250
+ }
251
+ ];
252
+ return (r.managerPermissionEnable || r.publicPermissionEnable) && o.push({
253
+ label: t("common.other"),
254
+ key: "other",
255
+ view: /* @__PURE__ */ e(
256
+ U,
257
+ {
258
+ managerPermissionEnable: r.managerPermissionEnable,
259
+ publicPermissionEnable: r.publicPermissionEnable
260
+ }
261
+ )
262
+ }), o;
263
+ }, [t, r.managerPermissionEnable, r.publicPermissionEnable]);
35
264
  };
36
265
  export {
37
- E as useDeptUserTabItems
266
+ ie as useDeptUserTabItems
38
267
  };
@@ -1,28 +1,31 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { M as r, a as l, R as s, b as a, E as o } from "../../../ExtraConcactPanel-BI9emYpp.js";
3
- import { a as i, u as n } from "../../../TabGroup-wNM86-Zq.js";
2
+ import { M as r, a as s, R as l, b as n, E as o } from "../../../ExtraConcactPanel-BoSCI3s5.js";
3
+ import { u as a } from "../../../useDeptsMemberSelector-D3rvDuVf.js";
4
+ import { u as i } from "../../../../vendors/useLocale.js";
4
5
  import { useMemo as m } from "react";
5
- const c = () => {
6
- const { currentUser: e } = i();
7
- return /* @__PURE__ */ t("div", { className: "p-1 current-entity h-full", children: /* @__PURE__ */ t(r, { list: e ? [e] : [], showCheckAll: !1 }) });
8
- }, M = () => {
9
- const { t: e } = n();
6
+ const c = {
7
+ "current-user-panel": "_current-user-panel_184e6_1"
8
+ }, u = () => {
9
+ const { currentUser: e } = a();
10
+ return /* @__PURE__ */ t("div", { className: c["current-user-panel"], children: /* @__PURE__ */ t(r, { list: e ? [e] : [], showCheckAll: !1 }) });
11
+ }, k = () => {
12
+ const { t: e } = i();
10
13
  return m(
11
14
  () => [
12
15
  {
13
16
  label: e("member.title"),
14
17
  key: "member",
15
- view: /* @__PURE__ */ t(l, {})
18
+ view: /* @__PURE__ */ t(s, {})
16
19
  },
17
20
  {
18
21
  label: e("role.title"),
19
22
  key: "role",
20
- view: /* @__PURE__ */ t(s, {})
23
+ view: /* @__PURE__ */ t(l, {})
21
24
  },
22
25
  {
23
26
  label: e("position.title"),
24
27
  key: "job",
25
- view: /* @__PURE__ */ t(a, {})
28
+ view: /* @__PURE__ */ t(n, {})
26
29
  },
27
30
  {
28
31
  label: e("externalContact.title"),
@@ -32,12 +35,12 @@ const c = () => {
32
35
  {
33
36
  label: e("currentUser.title"),
34
37
  key: "currentUser",
35
- view: /* @__PURE__ */ t(c, {})
38
+ view: /* @__PURE__ */ t(u, {})
36
39
  }
37
40
  ],
38
41
  [e]
39
42
  );
40
43
  };
41
44
  export {
42
- M as useMemberTabItems
45
+ k as useMemberTabItems
43
46
  };
@@ -0,0 +1,4 @@
1
+ export {}
2
+ import _default from '../../../../../components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index'
3
+ export default _default
4
+ export {}
@@ -0,0 +1,15 @@
1
+ import "react/jsx-runtime";
2
+ import "../../../../../vendors/simplebar-react.js";
3
+ import "@baishuyun/ui-base";
4
+ import "../../../../useDeptsMemberSelector-D3rvDuVf.js";
5
+ import "../../../../../vendors/clsx.js";
6
+ import "../../../../../vendors/useLocale.js";
7
+ import "../../../../../vendors/services/ncorp/department.service.js";
8
+ import "ahooks";
9
+ import "react";
10
+ import "../../../../utils/index.js";
11
+ import { R as x } from "../../../../index-BRIA1uOQ.js";
12
+ import "antd";
13
+ export {
14
+ x as default
15
+ };
@@ -0,0 +1,4 @@
1
+ export {}
2
+ import _default from '../../../../../components/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index'
3
+ export default _default
4
+ export {}