@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.
@@ -1,15 +1,15 @@
1
- import { createContext as h, useContext as g, useMemo as p, useCallback as v, useRef as E, useState as A, useEffect as D } from "react";
2
- import { n as b } from "../vendors/lodash-es.js";
3
- import { jsx as o, jsxs as G } from "react/jsx-runtime";
1
+ import { createContext as v, useContext as f, useMemo as p, useCallback as E, useRef as h, useState as A, useEffect as D } from "react";
2
+ import { n as d } from "../vendors/lodash-es.js";
3
+ import { C as G } from "../ConfigProvider/configContext-lDqg07Z3.js";
4
+ import { jsx as o, jsxs as N } from "react/jsx-runtime";
4
5
  import { Icon as c } from "bsy-react-ui";
5
- import { C as N } from "../ConfigProvider/configContext-lDqg07Z3.js";
6
6
  import { c as S } from "../vendors/clsx.js";
7
- const I = h({
7
+ const I = v({
8
8
  type: "user",
9
- setValue: b,
10
- dispatch: b,
9
+ setValue: d,
10
+ dispatch: d,
11
11
  containerHeight: 0
12
- }), tt = () => g(I), et = {
12
+ }), tt = () => f(I), et = {
13
13
  /**
14
14
  * @description 表示单个成员
15
15
  */
@@ -26,35 +26,20 @@ const I = h({
26
26
  * @description 表示多个部门组
27
27
  */
28
28
  DEPARMENT_GROUP: "deptgroup"
29
- }, nt = 110, at = 68, rt = 30, ot = 8, lt = 90, ct = ({ type: n }) => {
30
- switch (n) {
31
- case "label":
32
- return /* @__PURE__ */ o(c, { name: "Enterpriselabel", className: "text-[#0265ff] text-lg" });
33
- case "dockcorp":
34
- case "dockcorpdept":
35
- return /* @__PURE__ */ o(c, { name: "company", className: "text-[#0265ff] text-lg" });
36
- case "dockdept":
37
- case "member":
38
- return /* @__PURE__ */ o(c, { name: "dept-one", className: "text-[#0265ff] text-lg" });
39
- case "group":
40
- return /* @__PURE__ */ o(c, { name: "Outreach", className: "text-[#70c911] text-lg" });
41
- default:
42
- return /* @__PURE__ */ o(c, { name: "dept-one", className: "text-[#0265ff] text-lg" });
43
- }
44
- }, M = { loading: "加载中...", cancel: "取消", confirm: "确认", clearAll: "清空所选项", viewAll: "查看全部{count}个", selected: "已选 {selected}/{total}", collapseAll: "收起全部", noAvailable: "没有可选成员" }, y = { title: "部门", search: "搜索部门", noAvailable: "没有可选部门", contact: "对接部门", organizationalStructure: "组织架构", currentUserDepartment: "当前用户所处部门", internal: "内部组织", external: "外部组织", externalContactGroup: "对接人小组", externalContactDepartment: "对接部门" }, R = { title: "成员", search: "搜索成员", contact: "对接人", all: "全部成员", allContact: "全部对接人", internal: "内部成员", external: "外部成员", noAvailable: "没有可选成员" }, U = { title: "角色", internal: "内部角色", external: "互联角色" }, k = { title: "职位" }, T = { title: "当前用户" }, P = { title: "外部联系人", defaultGroup: "默认分组", customGroup: "自定义分组", group: "外部联系人分组", noAvailableGroup: "没有可选分组" }, $ = { searchMember: "搜索成员", searchDepartment: "搜索部门" }, d = {
29
+ }, nt = 110, at = 68, rt = 30, ot = 8, lt = 90, M = { loading: "加载中...", cancel: "取消", confirm: "确认", clearAll: "清空所选项", viewAll: "查看全部{count}个", selected: "已选 {selected}/{total}", collapseAll: "收起全部", noAvailable: "没有可选成员" }, y = { title: "部门", search: "搜索部门", noAvailable: "没有可选部门", contact: "对接部门", organizationalStructure: "组织架构", currentUserDepartment: "当前用户所处部门", internal: "内部组织", external: "外部组织", externalContactGroup: "对接人小组", externalContactDepartment: "对接部门" }, R = { title: "成员", search: "搜索成员", contact: "对接人", all: "全部成员", allContact: "全部对接人", internal: "内部成员", external: "外部成员", noAvailable: "没有可选成员" }, U = { title: "角色", internal: "内部角色", external: "互联角色" }, T = { title: "职位" }, P = { title: "当前用户" }, $ = { title: "外部联系人", defaultGroup: "默认分组", customGroup: "自定义分组", group: "外部联系人分组", noAvailableGroup: "没有可选分组" }, H = { searchMember: "搜索成员", searchDepartment: "搜索部门" }, b = {
45
30
  common: M,
46
31
  department: y,
47
32
  member: R,
48
33
  role: U,
49
- position: k,
50
- currentUser: T,
51
- externalContact: P,
52
- tabs: $
53
- }, 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" }, O = { title: "Member", search: "Search Member", contact: "Contact Person", allContact: "All Contact Persons", all: "All Members", internal: "Internal Members", external: "External Members", noAvailable: "No available members" }, w = { title: "Role", internal: "Internal Role", external: "Interconnected Role" }, z = { title: "Position" }, B = { title: "Current User" }, W = { title: "External Contact", defaultGroup: "Default Group", customGroup: "Custom Group", group: "External Contact Group", noAvailableGroup: "No available groups" }, j = { searchMember: "Search Member", searchDepartment: "Search Department" }, V = {
54
- common: H,
55
- department: L,
56
- member: O,
57
- role: w,
34
+ position: T,
35
+ currentUser: P,
36
+ externalContact: $,
37
+ tabs: H
38
+ }, L = { loading: "Loading...", cancel: "Cancel", confirm: "Confirm", clearAll: "Clear All", viewAll: "View All {count}", selected: "Selected {selected}/{total}", collapseAll: "Collapse All", noAvailable: "No available members" }, O = { 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" }, w = { title: "Member", search: "Search Member", contact: "Contact Person", allContact: "All Contact Persons", all: "All Members", internal: "Internal Members", external: "External Members", noAvailable: "No available members" }, k = { title: "Role", internal: "Internal Role", external: "Interconnected Role" }, z = { title: "Position" }, B = { title: "Current User" }, W = { title: "External Contact", defaultGroup: "Default Group", customGroup: "Custom Group", group: "External Contact Group", noAvailableGroup: "No available groups" }, j = { searchMember: "Search Member", searchDepartment: "Search Department" }, V = {
39
+ common: L,
40
+ department: O,
41
+ member: w,
42
+ role: k,
58
43
  position: z,
59
44
  currentUser: B,
60
45
  externalContact: W,
@@ -69,36 +54,51 @@ const I = h({
69
54
  } catch {
70
55
  return a;
71
56
  }
72
- }, st = () => {
73
- const n = g(N), a = p(() => ({ "zh-CN": d, "en-US": V }), []), t = p(() => a[n.locale] || d, [n.locale, a]);
57
+ }, ct = () => {
58
+ const n = f(G), a = p(() => ({ "zh-CN": b, "en-US": V }), []), t = p(() => a[n.locale] || b, [n.locale, a]);
74
59
  return {
75
- t: v(
60
+ t: E(
76
61
  (e, r) => X(t, e, r),
77
62
  [t]
78
63
  )
79
64
  };
80
- }, q = "_active_nkgxh_15", u = {
81
- "tabgroup-container": "_tabgroup-container_nkgxh_1",
82
- "tabgroup-container__tab-item": "_tabgroup-container__tab-item_nkgxh_7",
65
+ }, st = ({ type: n }) => {
66
+ switch (n) {
67
+ case "label":
68
+ return /* @__PURE__ */ o(c, { name: "Enterpriselabel", className: "text-[#0265ff] text-lg" });
69
+ case "dockcorp":
70
+ case "dockcorpdept":
71
+ return /* @__PURE__ */ o(c, { name: "company", className: "text-[#0265ff] text-lg" });
72
+ case "dockdept":
73
+ case "member":
74
+ return /* @__PURE__ */ o(c, { name: "dept-one", className: "text-[#0265ff] text-lg" });
75
+ case "group":
76
+ return /* @__PURE__ */ o(c, { name: "Outreach", className: "text-[#70c911] text-lg" });
77
+ default:
78
+ return /* @__PURE__ */ o(c, { name: "dept-one", className: "text-[#0265ff] text-lg" });
79
+ }
80
+ }, q = "_active_1vd3c_15", u = {
81
+ "tabgroup-container": "_tabgroup-container_1vd3c_1",
82
+ "tabgroup-container__tab-item": "_tabgroup-container__tab-item_1vd3c_7",
83
83
  active: q,
84
- "tabgroup-container__indicator": "_tabgroup-container__indicator_nkgxh_18"
84
+ "tabgroup-container__indicator": "_tabgroup-container__indicator_1vd3c_18"
85
85
  }, it = (n) => {
86
- const { tabs: a, value: t, onChange: s } = n, e = E(null), [r, i] = A({
86
+ const { tabs: a, value: t, onChange: s } = n, e = h(null), [r, i] = A({
87
87
  width: 0,
88
88
  transform: "translateX(0)"
89
- }), x = (l) => {
89
+ }), g = (l) => {
90
90
  const m = e.current?.querySelector(`[data-key="${l}"]`);
91
91
  if (m) {
92
- const { width: f, left: C } = m.getBoundingClientRect(), _ = m.parentElement?.parentElement?.getBoundingClientRect().left || 0;
92
+ const { width: x, left: C } = m.getBoundingClientRect(), _ = m.parentElement?.parentElement?.getBoundingClientRect().left || 0;
93
93
  i({
94
- width: f,
94
+ width: x,
95
95
  transform: `translateX(${C - _}px)`
96
96
  });
97
97
  }
98
98
  };
99
99
  return D(() => {
100
- x(t);
101
- }, [t]), /* @__PURE__ */ G("div", { className: u["tabgroup-container"], ref: e, children: [
100
+ g(t);
101
+ }, [t]), /* @__PURE__ */ N("div", { className: u["tabgroup-container"], ref: e, children: [
102
102
  /* @__PURE__ */ o(
103
103
  "div",
104
104
  {
@@ -129,9 +129,9 @@ export {
129
129
  rt as M,
130
130
  lt as P,
131
131
  at as T,
132
- st as a,
133
- nt as b,
134
- ct as c,
132
+ tt as a,
133
+ st as b,
134
+ nt as c,
135
135
  it as d,
136
- tt as u
136
+ ct as u
137
137
  };
@@ -1,5 +1,5 @@
1
- import { D as t } from "./DeptsMember-C4fZKTp3.js";
2
- import { E as a } from "./TabGroup-C4h1Oi7h.js";
1
+ import { D as t } from "./DeptsMember-Ct8CJLvk.js";
2
+ import { E as a } from "./TabGroup-LsBzSRvu.js";
3
3
  export {
4
4
  a as Entity,
5
5
  t as default
@@ -1,17 +1,17 @@
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";
1
+ import { jsxs as g, jsx as e, Fragment as K } from "react/jsx-runtime";
2
+ import { g as j, d as P } from "../../../../vendors/services/data/member.service.js";
3
3
  import { useRequest as T } from "ahooks";
4
4
  import { Spin as A, Radio as R } from "antd";
5
5
  import { c as v } from "../../../../vendors/clsx.js";
6
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-C4h1Oi7h.js";
7
+ import { a as N, u as k, E, d as L, b as H } from "../../../TabGroup-LsBzSRvu.js";
8
8
  import { buildDeptTree as B, buildTree as U, findNodeInTree as q } from "../../../utils/index.js";
9
9
  import { S } from "../../../../vendors/simplebar-react.js";
10
10
  import { Tree as w, Icon as C, Checkbox as O } from "bsy-react-ui";
11
11
  import { g as J } from "../../../../vendors/services/corp/outsider.service.js";
12
12
  const Q = (t) => {
13
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(
14
+ return /* @__PURE__ */ g(
15
15
  S,
16
16
  {
17
17
  style: { height: p - 8, padding: "4px" },
@@ -52,7 +52,7 @@ const Q = (t) => {
52
52
  const { type: r, containerHeight: p, value: o } = N(), { t: a } = k(), [f, i] = D(
53
53
  "dockcorp"
54
54
  /* DOCK_PERSON_GROUP */
55
- ), d = o?.map((n) => n._id) || [], g = [
55
+ ), d = o?.map((n) => n._id) || [], b = [
56
56
  {
57
57
  label: a("department.externalContactGroup"),
58
58
  value: "dockcorp"
@@ -88,9 +88,9 @@ const Q = (t) => {
88
88
  }
89
89
  return m;
90
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: [
91
+ return /* @__PURE__ */ g("div", { className: "external-container", children: [
92
+ /* @__PURE__ */ e(L, { tabs: b, value: f, onChange: i }),
93
+ /* @__PURE__ */ e("div", { className: "external-container__content", children: /* @__PURE__ */ g(S, { style: { height: p - 42, padding: "4px" }, children: [
94
94
  x.length > 0 && /* @__PURE__ */ e(
95
95
  w,
96
96
  {
@@ -106,7 +106,7 @@ const Q = (t) => {
106
106
  onSelect: t.onSelect,
107
107
  onDeSelect: t.onDeselect,
108
108
  defaultExpandedKeys: _,
109
- icon: () => /* @__PURE__ */ e(C, { name: "dept-one", className: "text-[#0265ff] text-lg" }),
109
+ icon: () => /* @__PURE__ */ e(C, { name: "dept-one", className: "text-[#0265ff]", size: 16 }),
110
110
  switcherIcon: (n) => /* @__PURE__ */ e(
111
111
  C,
112
112
  {
@@ -132,7 +132,7 @@ const Q = (t) => {
132
132
  0
133
133
  /* INTERNAL */
134
134
  ), { data: i, loading: d } = T(
135
- () => z({
135
+ () => j({
136
136
  departmentLimit: [],
137
137
  hasDeptDock: a === 1
138
138
  /* EXTERNAL */
@@ -140,14 +140,14 @@ const Q = (t) => {
140
140
  {
141
141
  refreshDeps: [a]
142
142
  }
143
- ), g = G(() => {
143
+ ), b = G(() => {
144
144
  const l = i?.departments || [];
145
145
  return l.length > 0 ? B(l) : [];
146
146
  }, [i]), s = G(() => {
147
147
  const l = i?.label_corp_list || [];
148
148
  if (!l.length)
149
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) => ({
150
+ const y = l.filter((h) => h.type === "dockcorp" || h.type === "dockdept" ? !0 : h.parentId === 0 ? !1 : l.some((z) => z.parentId === h.departmentId)), I = y.map((h) => ({
151
151
  ...h,
152
152
  checkable: h.type !== "dockcorpdept" && h.type !== "label",
153
153
  icon: /* @__PURE__ */ e(H, { type: h.type })
@@ -159,7 +159,7 @@ const Q = (t) => {
159
159
  title: "name"
160
160
  }) : [];
161
161
  }, [i]), x = {
162
- 0: g,
162
+ 0: b,
163
163
  1: s
164
164
  }, _ = M(
165
165
  (l) => {
@@ -195,7 +195,7 @@ const Q = (t) => {
195
195
  payload: y._id
196
196
  });
197
197
  }, m = E.DEPARMENT === t ? _ : n, c = i?.label_corp_count || 0;
198
- return /* @__PURE__ */ b("div", { className: "flex line-height-normal h-full", children: [
198
+ return /* @__PURE__ */ g("div", { className: "flex line-height-normal h-full", children: [
199
199
  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(
200
200
  "li",
201
201
  {
@@ -214,7 +214,7 @@ const Q = (t) => {
214
214
  className: v("flex-1 border-[#E0E0E0] overflow-hidden", {
215
215
  "border-l": c > 0
216
216
  }),
217
- children: /* @__PURE__ */ b(A, { spinning: d, children: [
217
+ children: /* @__PURE__ */ g(A, { spinning: d, children: [
218
218
  a === 0 && /* @__PURE__ */ e(
219
219
  Q,
220
220
  {
@@ -238,7 +238,7 @@ const Q = (t) => {
238
238
  )
239
239
  ] });
240
240
  }, F = (t) => {
241
- 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) => {
241
+ const { list: r } = t, { value: p, type: o, dispatch: a } = N(), f = o === E.DEPARMENT, i = o === E.DEPARMENT_GROUP, d = p?.[0]?._id, b = (n) => {
242
242
  const u = r?.find((m) => m._id === n.target.value);
243
243
  u && a({
244
244
  type: "insertOnly",
@@ -263,8 +263,8 @@ const Q = (t) => {
263
263
  }
264
264
  });
265
265
  };
266
- return /* @__PURE__ */ e("div", { className: "entity-group-list", children: /* @__PURE__ */ b("ul", { className: "font-0", children: [
267
- f && /* @__PURE__ */ e(R.Group, { value: d, onChange: g, className: "w-full", children: r.map((n) => /* @__PURE__ */ e(
266
+ return /* @__PURE__ */ e("div", { className: "entity-group-list", children: /* @__PURE__ */ g("ul", { className: "font-0", children: [
267
+ f && /* @__PURE__ */ e(R.Group, { value: d, onChange: b, className: "w-full", children: r.map((n) => /* @__PURE__ */ e(
268
268
  "li",
269
269
  {
270
270
  className: v("rounded-[4px] cursor-pointer font-0", {
@@ -284,7 +284,7 @@ const Q = (t) => {
284
284
  },
285
285
  n._id
286
286
  )) }),
287
- i && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(O.Group, { value: x, onChange: _, children: r.map((n) => /* @__PURE__ */ e(
287
+ i && /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(O.Group, { value: x, onChange: _, children: r.map((n) => /* @__PURE__ */ e(
288
288
  "li",
289
289
  {
290
290
  className: v("rounded-[4px] cursor-pointer font-0 px-[10px]", {
@@ -301,7 +301,7 @@ const Q = (t) => {
301
301
  departmentLimit: []
302
302
  })
303
303
  ), a = p?.departmentList || [];
304
- 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: [
304
+ return /* @__PURE__ */ e("div", { className: "p-1 external-contact-entit relative", children: /* @__PURE__ */ e(A, { spinning: o, tip: r("common.loading"), children: /* @__PURE__ */ g(S, { style: { height: t - 8 }, children: [
305
305
  /* @__PURE__ */ e(F, { list: a }),
306
306
  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") }) })
307
307
  ] }) }) });
@@ -309,8 +309,8 @@ const Q = (t) => {
309
309
  const { containerHeight: t } = N(), { t: r } = k(), [p] = D([
310
310
  { key: "default", label: r("externalContact.defaultGroup") },
311
311
  { key: "custom", label: r("externalContact.customGroup") }
312
- ]), [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");
313
- return /* @__PURE__ */ b("div", { className: "external-contact-entity relative flex", children: [
312
+ ]), [o, a] = D("default"), { data: f, loading: i } = T(() => J()), d = f?.list || [], b = o === "default" ? d.filter((s) => s.type === "1") : d.filter((s) => s.type !== "1");
313
+ return /* @__PURE__ */ g("div", { className: "external-contact-entity relative flex", children: [
314
314
  /* @__PURE__ */ e("aside", { className: "basis-[192px] p-1", children: /* @__PURE__ */ e("ul", { className: "flex flex-col", children: p.map((s) => /* @__PURE__ */ e(
315
315
  "li",
316
316
  {
@@ -325,9 +325,9 @@ const Q = (t) => {
325
325
  },
326
326
  s.key
327
327
  )) }) }),
328
- /* @__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: [
329
- g.length > 0 && /* @__PURE__ */ e(F, { list: g, type: "group" }),
330
- 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") }) })
328
+ /* @__PURE__ */ e("div", { className: "flex-1 border-l border-[#E0E0E0]", children: /* @__PURE__ */ e(A, { spinning: i, tip: r("common.loading"), children: /* @__PURE__ */ g(S, { style: { height: t - 8, padding: "4px" }, children: [
329
+ b.length > 0 && /* @__PURE__ */ e(F, { list: b, type: "group" }),
330
+ b.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") }) })
331
331
  ] }) }) })
332
332
  ] });
333
333
  }, oe = () => {