@rytass/bpm-core-react 0.3.0 → 0.3.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 (184) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/README.md +13 -1
  3. package/dist/chunks/app-navigation-BSkMsEhy.js +268 -0
  4. package/dist/chunks/app-navigation-BSkMsEhy.js.map +1 -0
  5. package/dist/chunks/app-navigation-KnlJCUp1.cjs +2 -0
  6. package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +1 -0
  7. package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +2 -0
  8. package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +1 -0
  9. package/dist/chunks/{approval-instance-list-page-BgE4vQw8.js → approval-instance-list-page-CqNdoZqx.js} +103 -99
  10. package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +1 -0
  11. package/dist/chunks/builder-CMlJfQHE.cjs +3 -0
  12. package/dist/chunks/builder-CMlJfQHE.cjs.map +1 -0
  13. package/dist/chunks/{builder-Du_0apkh.js → builder-D950gct_.js} +436 -432
  14. package/dist/chunks/builder-D950gct_.js.map +1 -0
  15. package/dist/chunks/categories-5yEM3p3N.cjs +2 -0
  16. package/dist/chunks/categories-5yEM3p3N.cjs.map +1 -0
  17. package/dist/chunks/categories-BIpOG451.js +387 -0
  18. package/dist/chunks/categories-BIpOG451.js.map +1 -0
  19. package/dist/chunks/dashboard-page-1K_jQXQk.cjs +2 -0
  20. package/dist/chunks/dashboard-page-1K_jQXQk.cjs.map +1 -0
  21. package/dist/chunks/dashboard-page-R_T2OEiE.js +122 -0
  22. package/dist/chunks/dashboard-page-R_T2OEiE.js.map +1 -0
  23. package/dist/chunks/delegations-B2j-wNEO.js +646 -0
  24. package/dist/chunks/delegations-B2j-wNEO.js.map +1 -0
  25. package/dist/chunks/delegations-CsB9ozLu.cjs +2 -0
  26. package/dist/chunks/delegations-CsB9ozLu.cjs.map +1 -0
  27. package/dist/chunks/delegations-CvtwTXNP.cjs +2 -0
  28. package/dist/chunks/delegations-CvtwTXNP.cjs.map +1 -0
  29. package/dist/chunks/delegations-dKodb0WW.js +573 -0
  30. package/dist/chunks/delegations-dKodb0WW.js.map +1 -0
  31. package/dist/chunks/detail-BcGAqJ_R.js +1523 -0
  32. package/dist/chunks/detail-BcGAqJ_R.js.map +1 -0
  33. package/dist/chunks/detail-CqjqLd65.cjs +2 -0
  34. package/dist/chunks/detail-CqjqLd65.cjs.map +1 -0
  35. package/dist/chunks/{format-date-time-hKLVMxq4.cjs → format-date-time-26_pFvv4.cjs} +2 -2
  36. package/dist/chunks/{format-date-time-hKLVMxq4.cjs.map → format-date-time-26_pFvv4.cjs.map} +1 -1
  37. package/dist/chunks/notifications-2swRqDPF.js +198 -0
  38. package/dist/chunks/notifications-2swRqDPF.js.map +1 -0
  39. package/dist/chunks/notifications-BaYDebFt.cjs +2 -0
  40. package/dist/chunks/notifications-BaYDebFt.cjs.map +1 -0
  41. package/dist/chunks/{orgs-c29y74w2.js → orgs-CuHxxd_n.js} +665 -661
  42. package/dist/chunks/orgs-CuHxxd_n.js.map +1 -0
  43. package/dist/chunks/orgs-YMiVLNvL.cjs +2 -0
  44. package/dist/chunks/orgs-YMiVLNvL.cjs.map +1 -0
  45. package/dist/chunks/routes-config-2aKbWq2H.cjs +2 -0
  46. package/dist/chunks/routes-config-2aKbWq2H.cjs.map +1 -0
  47. package/dist/chunks/routes-config-dxahImVe.js +43 -0
  48. package/dist/chunks/routes-config-dxahImVe.js.map +1 -0
  49. package/dist/chunks/templates-DTkbSgFY.cjs +2 -0
  50. package/dist/chunks/templates-DTkbSgFY.cjs.map +1 -0
  51. package/dist/chunks/{templates-Dn9QHFSy.js → templates-DoDWM68t.js} +136 -132
  52. package/dist/chunks/templates-DoDWM68t.js.map +1 -0
  53. package/dist/chunks/users-3ySyUW4u.cjs +2 -0
  54. package/dist/chunks/users-3ySyUW4u.cjs.map +1 -0
  55. package/dist/chunks/users-sMfrSjRQ.js +219 -0
  56. package/dist/chunks/users-sMfrSjRQ.js.map +1 -0
  57. package/dist/components/app-navigation.d.ts +17 -10
  58. package/dist/index.cjs +1 -1
  59. package/dist/index.cjs.map +1 -1
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.js +101 -99
  62. package/dist/index.js.map +1 -1
  63. package/dist/lib/notification-drawer-provider.d.ts +1 -1
  64. package/dist/lib/notification-unread-provider.d.ts +1 -1
  65. package/dist/lib/providers.d.ts +1 -1
  66. package/dist/lib/routes-config.d.ts +96 -0
  67. package/dist/next/index.cjs +1 -1
  68. package/dist/next/index.cjs.map +1 -1
  69. package/dist/next/index.d.ts +1 -0
  70. package/dist/next/index.js +22 -21
  71. package/dist/next/index.js.map +1 -1
  72. package/dist/pages/admin/delegations/index.cjs +1 -1
  73. package/dist/pages/admin/delegations/index.js +1 -1
  74. package/dist/pages/admin/orgs/index.cjs +1 -1
  75. package/dist/pages/admin/orgs/index.js +1 -1
  76. package/dist/pages/admin/users/index.cjs +1 -1
  77. package/dist/pages/admin/users/index.js +1 -1
  78. package/dist/pages/delegations/index.cjs +1 -1
  79. package/dist/pages/delegations/index.js +1 -1
  80. package/dist/pages/forms/builder/index.cjs +1 -1
  81. package/dist/pages/forms/builder/index.js +1 -1
  82. package/dist/pages/instances/detail/index.cjs +1 -1
  83. package/dist/pages/instances/detail/index.js +1 -1
  84. package/dist/pages/settings/notifications/index.cjs +1 -1
  85. package/dist/pages/settings/notifications/index.js +1 -1
  86. package/dist/pages/templates/categories/index.cjs +1 -1
  87. package/dist/pages/templates/categories/index.js +1 -1
  88. package/dist/pages/templates/index.cjs +1 -1
  89. package/dist/pages/templates/index.js +1 -1
  90. package/dist/views/admin/delegations/index.cjs +1 -1
  91. package/dist/views/admin/delegations/index.js +1 -1
  92. package/dist/views/admin/index.cjs +1 -1
  93. package/dist/views/admin/index.js +3 -3
  94. package/dist/views/admin/orgs/index.cjs +1 -1
  95. package/dist/views/admin/orgs/index.js +1 -1
  96. package/dist/views/admin/users/index.cjs +1 -1
  97. package/dist/views/admin/users/index.js +1 -1
  98. package/dist/views/cc/index.cjs +1 -1
  99. package/dist/views/cc/index.js +1 -1
  100. package/dist/views/dashboard/index.cjs +1 -1
  101. package/dist/views/dashboard/index.js +1 -1
  102. package/dist/views/delegations/index.cjs +1 -1
  103. package/dist/views/delegations/index.js +1 -1
  104. package/dist/views/forms/builder/index.cjs +1 -1
  105. package/dist/views/forms/builder/index.js +1 -1
  106. package/dist/views/forms/index.cjs +1 -1
  107. package/dist/views/forms/index.cjs.map +1 -1
  108. package/dist/views/forms/index.js +84 -80
  109. package/dist/views/forms/index.js.map +1 -1
  110. package/dist/views/inbox/index.cjs +1 -1
  111. package/dist/views/inbox/index.cjs.map +1 -1
  112. package/dist/views/inbox/index.js +83 -79
  113. package/dist/views/inbox/index.js.map +1 -1
  114. package/dist/views/instances/detail/index.cjs +1 -1
  115. package/dist/views/instances/detail/index.js +1 -1
  116. package/dist/views/instances/new/index.cjs +1 -1
  117. package/dist/views/instances/new/index.cjs.map +1 -1
  118. package/dist/views/instances/new/index.js +107 -100
  119. package/dist/views/instances/new/index.js.map +1 -1
  120. package/dist/views/search/index.cjs +1 -1
  121. package/dist/views/search/index.js +1 -1
  122. package/dist/views/sent/index.cjs +1 -1
  123. package/dist/views/sent/index.js +1 -1
  124. package/dist/views/settings/index.cjs +1 -1
  125. package/dist/views/settings/index.js +1 -1
  126. package/dist/views/settings/notifications/index.cjs +1 -1
  127. package/dist/views/settings/notifications/index.js +1 -1
  128. package/dist/views/templates/categories/index.cjs +1 -1
  129. package/dist/views/templates/categories/index.js +1 -1
  130. package/dist/views/templates/designer/index.cjs +6 -6
  131. package/dist/views/templates/designer/index.cjs.map +1 -1
  132. package/dist/views/templates/designer/index.js +758 -754
  133. package/dist/views/templates/designer/index.js.map +1 -1
  134. package/dist/views/templates/index.cjs +1 -1
  135. package/dist/views/templates/index.js +2 -2
  136. package/dist/views/templates/versions/index.cjs +1 -1
  137. package/dist/views/templates/versions/index.cjs.map +1 -1
  138. package/dist/views/templates/versions/index.js +47 -43
  139. package/dist/views/templates/versions/index.js.map +1 -1
  140. package/package.json +3 -3
  141. package/dist/chunks/app-navigation-BRRFCkxZ.cjs +0 -2
  142. package/dist/chunks/app-navigation-BRRFCkxZ.cjs.map +0 -1
  143. package/dist/chunks/app-navigation-rxhpHCch.js +0 -262
  144. package/dist/chunks/app-navigation-rxhpHCch.js.map +0 -1
  145. package/dist/chunks/approval-instance-list-page-2vUWc5-c.cjs +0 -2
  146. package/dist/chunks/approval-instance-list-page-2vUWc5-c.cjs.map +0 -1
  147. package/dist/chunks/approval-instance-list-page-BgE4vQw8.js.map +0 -1
  148. package/dist/chunks/builder-B8X-m6C5.cjs +0 -3
  149. package/dist/chunks/builder-B8X-m6C5.cjs.map +0 -1
  150. package/dist/chunks/builder-Du_0apkh.js.map +0 -1
  151. package/dist/chunks/categories-DG4k7S8V.js +0 -383
  152. package/dist/chunks/categories-DG4k7S8V.js.map +0 -1
  153. package/dist/chunks/categories-DshBQG33.cjs +0 -2
  154. package/dist/chunks/categories-DshBQG33.cjs.map +0 -1
  155. package/dist/chunks/dashboard-page-CTBwpu_D.js +0 -114
  156. package/dist/chunks/dashboard-page-CTBwpu_D.js.map +0 -1
  157. package/dist/chunks/dashboard-page-DcDiWQp2.cjs +0 -2
  158. package/dist/chunks/dashboard-page-DcDiWQp2.cjs.map +0 -1
  159. package/dist/chunks/delegations-BAZQbElH.js +0 -642
  160. package/dist/chunks/delegations-BAZQbElH.js.map +0 -1
  161. package/dist/chunks/delegations-DzrckrPp.js +0 -569
  162. package/dist/chunks/delegations-DzrckrPp.js.map +0 -1
  163. package/dist/chunks/delegations-Z8hTajLj.cjs +0 -2
  164. package/dist/chunks/delegations-Z8hTajLj.cjs.map +0 -1
  165. package/dist/chunks/delegations-hb9JoVZe.cjs +0 -2
  166. package/dist/chunks/delegations-hb9JoVZe.cjs.map +0 -1
  167. package/dist/chunks/detail-DilI0PPe.js +0 -1519
  168. package/dist/chunks/detail-DilI0PPe.js.map +0 -1
  169. package/dist/chunks/detail-DuRg3Y7b.cjs +0 -2
  170. package/dist/chunks/detail-DuRg3Y7b.cjs.map +0 -1
  171. package/dist/chunks/notifications-B2Lk3grg.js +0 -194
  172. package/dist/chunks/notifications-B2Lk3grg.js.map +0 -1
  173. package/dist/chunks/notifications-C8ADhnxF.cjs +0 -2
  174. package/dist/chunks/notifications-C8ADhnxF.cjs.map +0 -1
  175. package/dist/chunks/orgs-CGv3VNDR.cjs +0 -2
  176. package/dist/chunks/orgs-CGv3VNDR.cjs.map +0 -1
  177. package/dist/chunks/orgs-c29y74w2.js.map +0 -1
  178. package/dist/chunks/templates-Cd0WFheA.cjs +0 -2
  179. package/dist/chunks/templates-Cd0WFheA.cjs.map +0 -1
  180. package/dist/chunks/templates-Dn9QHFSy.js.map +0 -1
  181. package/dist/chunks/users-B-trMu0E.cjs +0 -2
  182. package/dist/chunks/users-B-trMu0E.cjs.map +0 -1
  183. package/dist/chunks/users-itVXXRj7.js +0 -215
  184. package/dist/chunks/users-itVXXRj7.js.map +0 -1
@@ -1,23 +1,24 @@
1
1
  "use client";
2
- import { t as e } from "./app-navigation-rxhpHCch.js";
3
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./admin-pickers-DLlG_1du.js";
4
- import { t as s } from "./bpm-form-field-Cao0rMol.js";
5
- import { forwardRef as c, useCallback as l, useEffect as u, useImperativeHandle as d, useMemo as f, useRef as p, useState as m } from "react";
6
- import { AutoComplete as h, Button as g, DatePicker as _, Filter as v, FilterArea as y, FilterLine as b, FormField as x, Input as S, Layout as C, Modal as w, PageHeader as T, Section as E, SectionGroup as D, Select as O, Tab as k, TabItem as A, Table as j, Typography as M } from "@mezzanine-ui/react";
2
+ import { t as e } from "./app-navigation-BSkMsEhy.js";
3
+ import { r as t } from "./routes-config-dxahImVe.js";
4
+ import { a as n, i as r, n as i, o as a, r as o, t as s } from "./admin-pickers-DLlG_1du.js";
5
+ import { t as c } from "./bpm-form-field-Cao0rMol.js";
6
+ import { forwardRef as l, useCallback as u, useEffect as d, useImperativeHandle as f, useMemo as p, useRef as m, useState as h } from "react";
7
+ import { AutoComplete as g, Button as _, DatePicker as v, Filter as y, FilterArea as b, FilterLine as x, FormField as S, Input as C, Modal as w, PageHeader as T, Section as E, SectionGroup as D, Select as O, Tab as k, TabItem as A, Table as j, Typography as M } from "@mezzanine-ui/react";
7
8
  import { resolveMembers as N } from "@rytass/bpm-core-client";
8
9
  import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
9
- import { CloseIcon as ee, EditIcon as te, PlusIcon as L, SaveIcon as ne } from "@mezzanine-ui/icons";
10
- import re from "@mezzanine-ui/react/ContentHeader";
11
- import { FormFieldLayout as R } from "@mezzanine-ui/core/form";
12
- import { commitOrgUnitTreeDraft as ie, createManagerResolution as ae, createMembership as oe, createOrgUnit as se, createPosition as ce, deleteManagerResolution as le, deleteMembership as ue, deleteOrgUnit as de, readOrganizationDashboard as fe, updateManagerResolution as pe, updateMembership as me, updateOrgUnit as he, updatePosition as ge } from "@rytass/bpm-core-client/organization";
13
- import { Background as _e, ConnectionMode as ve, Controls as ye, Handle as be, MiniMap as xe, Position as Se, ReactFlow as Ce, applyNodeChanges as we } from "@xyflow/react";
14
- import * as Te from "dagre";
10
+ import { CloseIcon as ee, EditIcon as te, PlusIcon as ne, SaveIcon as re } from "@mezzanine-ui/icons";
11
+ import ie from "@mezzanine-ui/react/ContentHeader";
12
+ import { FormFieldLayout as L } from "@mezzanine-ui/core/form";
13
+ import { commitOrgUnitTreeDraft as ae, createManagerResolution as oe, createMembership as se, createOrgUnit as ce, createPosition as le, deleteManagerResolution as ue, deleteMembership as de, deleteOrgUnit as fe, readOrganizationDashboard as pe, updateManagerResolution as me, updateMembership as he, updateOrgUnit as ge, updatePosition as _e } from "@rytass/bpm-core-client/organization";
14
+ import { Background as ve, ConnectionMode as ye, Controls as be, Handle as xe, MiniMap as Se, Position as R, ReactFlow as Ce, applyNodeChanges as we } from "@xyflow/react";
15
+ import * as z from "dagre";
15
16
  import '../orgs.css';//#region src/lib/org-tree-draft.ts
16
- function Ee(e) {
17
+ function B(e) {
17
18
  return new Map(e.map((e) => [e.id, e.parentId]));
18
19
  }
19
- function De({ orgUnitId: e, parentDraft: t, parentId: n }) {
20
- let r = n === e ? e : n, i = ke({
20
+ function Te({ orgUnitId: e, parentDraft: t, parentId: n }) {
21
+ let r = n === e ? e : n, i = De({
21
22
  orgUnitId: e,
22
23
  parentDraft: t,
23
24
  parentId: r
@@ -39,7 +40,7 @@ function De({ orgUnitId: e, parentDraft: t, parentId: n }) {
39
40
  status: "UPDATED"
40
41
  };
41
42
  }
42
- function Oe({ orgUnits: e, parentDraft: t }) {
43
+ function Ee({ orgUnits: e, parentDraft: t }) {
43
44
  return e.map((e) => {
44
45
  let n = t.get(e.id) ?? null;
45
46
  return n === e.parentId ? null : {
@@ -49,14 +50,14 @@ function Oe({ orgUnits: e, parentDraft: t }) {
49
50
  };
50
51
  }).filter((e) => !!e);
51
52
  }
52
- function ke({ orgUnitId: e, parentDraft: t, parentId: n }) {
53
- return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : Ae({
53
+ function De({ orgUnitId: e, parentDraft: t, parentId: n }) {
54
+ return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : Oe({
54
55
  orgUnitId: e,
55
56
  parentDraft: t,
56
57
  parentId: n
57
58
  }) ? "不可搬移到自己的下層組織。" : null : "找不到新的上層組織。" : null : "找不到要搬移的組織節點。";
58
59
  }
59
- function Ae({ orgUnitId: e, parentDraft: t, parentId: n }) {
60
+ function Oe({ orgUnitId: e, parentDraft: t, parentId: n }) {
60
61
  let r = /* @__PURE__ */ new Set(), i = n;
61
62
  for (; i;) {
62
63
  if (i === e || r.has(i)) return !0;
@@ -64,7 +65,7 @@ function Ae({ orgUnitId: e, parentDraft: t, parentId: n }) {
64
65
  }
65
66
  return !1;
66
67
  }
67
- var z = {
68
+ var V = {
68
69
  orgTreeEditor: "bpm_orgTreeEditor_TMOtD",
69
70
  orgTreeSummary: "bpm_orgTreeSummary_vpcV8",
70
71
  orgTreeChangeList: "bpm_orgTreeChangeList_EzmOv",
@@ -77,16 +78,16 @@ var z = {
77
78
  orgTreeNodeHeader: "bpm_orgTreeNodeHeader_LEXl-",
78
79
  orgTreeNodeBadge: "bpm_orgTreeNodeBadge_zLc7t",
79
80
  orgTreeNodeActions: "bpm_orgTreeNodeActions_cMldI"
80
- }, B = "__org-tree-root__", V = 232, je = 118, Me = 232, Ne = 86, Pe = 320, Fe = {
81
+ }, H = "__org-tree-root__", U = 232, ke = 118, Ae = 232, je = 86, Me = 320, Ne = {
81
82
  COMPANY: "公司",
82
83
  DEPARTMENT: "部門",
83
84
  DIVISION: "事業群",
84
85
  TEAM: "小組"
85
- }, Ie = { orgUnit: Re }, Le = c(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
86
- let [s, c] = m(!1), [p, h] = m(null), [g, _] = m(null), [v, y] = m(() => Ee(a)), [b, x] = m([]), S = f(() => new Map(a.map((e) => [e.id, e])), [a]), C = f(() => Oe({
86
+ }, Pe = { orgUnit: Ie }, Fe = l(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
87
+ let [s, c] = h(!1), [l, m] = h(null), [g, _] = h(null), [v, y] = h(() => B(a)), [b, x] = h([]), S = p(() => new Map(a.map((e) => [e.id, e])), [a]), C = p(() => Ee({
87
88
  orgUnits: a,
88
89
  parentDraft: v
89
- }), [a, v]), w = f(() => ze({
90
+ }), [a, v]), w = p(() => Le({
90
91
  isEditing: s,
91
92
  onCreateChild: (n) => {
92
93
  n ? e(n) : t();
@@ -109,11 +110,11 @@ var z = {
109
110
  v,
110
111
  g
111
112
  ]), T = C.length > 0;
112
- d(o, () => ({
113
+ f(o, () => ({
113
114
  cancelEditing: j,
114
115
  saveDraft: N,
115
116
  startEditing: A
116
- })), u(() => {
117
+ })), d(() => {
117
118
  i({
118
119
  hasDraftChanges: T,
119
120
  isEditing: s
@@ -122,93 +123,93 @@ var z = {
122
123
  T,
123
124
  s,
124
125
  i
125
- ]), u(() => {
126
- y(Ee(a)), _(null), h(null), c(!1);
127
- }, [a]), u(() => {
126
+ ]), d(() => {
127
+ y(B(a)), _(null), m(null), c(!1);
128
+ }, [a]), d(() => {
128
129
  x(w.nodes);
129
130
  }, [w.nodes]);
130
- let E = l((e, t) => {
131
+ let E = u((e, t) => {
131
132
  y((n) => {
132
- let r = De({
133
+ let r = Te({
133
134
  orgUnitId: e,
134
135
  parentDraft: n,
135
136
  parentId: t
136
137
  });
137
- return h(r.message), r.parentDraft;
138
+ return m(r.message), r.parentDraft;
138
139
  });
139
- }, []), D = l((e) => {
140
+ }, []), D = u((e) => {
140
141
  if (!s || !e.target || !e.source) return;
141
- let t = e.source === B ? null : e.source;
142
- if (e.target === B) {
143
- h("根節點不能搬移到其他節點下。");
142
+ let t = e.source === H ? null : e.source;
143
+ if (e.target === H) {
144
+ m("根節點不能搬移到其他節點下。");
144
145
  return;
145
146
  }
146
147
  E(e.target, t);
147
- }, [E, s]), O = l((e) => {
148
+ }, [E, s]), O = u((e) => {
148
149
  s && x((t) => we(e, [...t]));
149
- }, [s]), k = l((e, t, n) => {
150
- if (!s || t.id === B) return;
151
- let r = Ve(e, t.id) ?? H(t, n);
150
+ }, [s]), k = u((e, t, n) => {
151
+ if (!s || t.id === H) return;
152
+ let r = Be(e, t.id) ?? ze(t, n);
152
153
  if (r === void 0) {
153
- h("拖曳到目標父節點附近,或從父節點拉線到子節點。");
154
+ m("拖曳到目標父節點附近,或從父節點拉線到子節點。");
154
155
  return;
155
156
  }
156
- E(t.id, r === B ? null : r);
157
+ E(t.id, r === H ? null : r);
157
158
  }, [E, s]);
158
159
  function A() {
159
- c(!0), y(Ee(a)), h("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
160
+ c(!0), y(B(a)), m("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
160
161
  }
161
162
  function j() {
162
- c(!1), y(Ee(a)), h("已取消草稿變更。");
163
+ c(!1), y(B(a)), m("已取消草稿變更。");
163
164
  }
164
165
  async function N() {
165
166
  if (!r) {
166
- h("批次儲存 API 尚未接上,草稿仍保留在前端。");
167
+ m("批次儲存 API 尚未接上,草稿仍保留在前端。");
167
168
  return;
168
169
  }
169
- await r(C), c(!1), h("組織樹草稿已儲存。");
170
+ await r(C), c(!1), m("組織樹草稿已儲存。");
170
171
  }
171
172
  return /* @__PURE__ */ I("div", {
172
- className: z.orgTreeEditor,
173
+ className: V.orgTreeEditor,
173
174
  children: [/* @__PURE__ */ I("div", {
174
- className: z.orgTreeSummary,
175
+ className: V.orgTreeSummary,
175
176
  children: [/* @__PURE__ */ F(M, {
176
177
  color: "text-neutral",
177
178
  variant: "caption",
178
- children: p ?? (T ? `目前有 ${C.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
179
+ children: l ?? (T ? `目前有 ${C.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
179
180
  }), T ? /* @__PURE__ */ F("ul", {
180
- className: z.orgTreeChangeList,
181
+ className: V.orgTreeChangeList,
181
182
  children: C.map((e) => /* @__PURE__ */ I("li", { children: [
182
- U(e.orgUnitId, S),
183
+ Ge(e.orgUnitId, S),
183
184
  ":",
184
- U(e.previousParentId, S),
185
+ Ge(e.previousParentId, S),
185
186
  " -> ",
186
- U(e.parentId, S)
187
+ Ge(e.parentId, S)
187
188
  ] }, e.orgUnitId))
188
189
  }) : null]
189
190
  }), /* @__PURE__ */ F("div", {
190
- className: z.orgTreeCanvas,
191
+ className: V.orgTreeCanvas,
191
192
  children: /* @__PURE__ */ I(Ce, {
192
- connectionMode: ve.Strict,
193
+ connectionMode: ye.Strict,
193
194
  edges: [...w.edges],
194
195
  fitView: !0,
195
196
  fitViewOptions: { padding: .18 },
196
- isValidConnection: (e) => Ke({
197
+ isValidConnection: (e) => We({
197
198
  source: e.source,
198
199
  target: e.target
199
200
  }, v),
200
201
  maxZoom: 1.4,
201
202
  minZoom: .25,
202
- nodeTypes: Ie,
203
+ nodeTypes: Pe,
203
204
  nodes: [...b],
204
205
  nodesConnectable: s,
205
206
  nodesDraggable: s,
206
207
  onConnect: D,
207
208
  onNodeClick: (e, t) => {
208
- _(t.id === B ? null : t.id);
209
+ _(t.id === H ? null : t.id);
209
210
  },
210
211
  onNodeDoubleClick: (e, t) => {
211
- if (t.id !== B) {
212
+ if (t.id !== H) {
212
213
  let e = S.get(t.id);
213
214
  e && n(e);
214
215
  }
@@ -219,9 +220,9 @@ var z = {
219
220
  panOnDrag: !0,
220
221
  proOptions: { hideAttribution: !0 },
221
222
  children: [
222
- /* @__PURE__ */ F(_e, {}),
223
- /* @__PURE__ */ F(ye, {}),
224
- /* @__PURE__ */ F(xe, {
223
+ /* @__PURE__ */ F(ve, {}),
224
+ /* @__PURE__ */ F(be, {}),
225
+ /* @__PURE__ */ F(Se, {
225
226
  pannable: !0,
226
227
  zoomable: !0
227
228
  })
@@ -230,30 +231,30 @@ var z = {
230
231
  })]
231
232
  });
232
233
  });
233
- function Re({ data: e, selected: t }) {
234
+ function Ie({ data: e, selected: t }) {
234
235
  return /* @__PURE__ */ I("div", {
235
236
  className: [
236
- z.orgTreeNode,
237
- e.isSyntheticRoot ? z.orgTreeNodeRoot : "",
238
- e.changed ? z.orgTreeNodeChanged : "",
239
- e.deleted ? z.orgTreeNodeDeleted : "",
240
- t ? z.orgTreeNodeSelected : ""
237
+ V.orgTreeNode,
238
+ e.isSyntheticRoot ? V.orgTreeNodeRoot : "",
239
+ e.changed ? V.orgTreeNodeChanged : "",
240
+ e.deleted ? V.orgTreeNodeDeleted : "",
241
+ t ? V.orgTreeNodeSelected : ""
241
242
  ].filter(Boolean).join(" "),
242
243
  children: [
243
- e.isSyntheticRoot ? null : /* @__PURE__ */ F(be, {
244
+ e.isSyntheticRoot ? null : /* @__PURE__ */ F(xe, {
244
245
  id: "target",
245
246
  isConnectable: e.isEditing,
246
- position: Se.Top,
247
+ position: R.Top,
247
248
  type: "target"
248
249
  }),
249
- /* @__PURE__ */ F(be, {
250
+ /* @__PURE__ */ F(xe, {
250
251
  id: "source",
251
252
  isConnectable: e.isEditing,
252
- position: Se.Bottom,
253
+ position: R.Bottom,
253
254
  type: "source"
254
255
  }),
255
256
  /* @__PURE__ */ I("div", {
256
- className: z.orgTreeNodeHeader,
257
+ className: V.orgTreeNodeHeader,
257
258
  children: [/* @__PURE__ */ F(M, {
258
259
  component: "span",
259
260
  ellipsis: !0,
@@ -261,7 +262,7 @@ function Re({ data: e, selected: t }) {
261
262
  variant: "label-primary",
262
263
  children: e.name
263
264
  }), e.changed ? /* @__PURE__ */ F("span", {
264
- className: z.orgTreeNodeBadge,
265
+ className: V.orgTreeNodeBadge,
265
266
  children: "草稿"
266
267
  }) : null]
267
268
  }),
@@ -282,15 +283,15 @@ function Re({ data: e, selected: t }) {
282
283
  children: ["上層:", e.parentLabel]
283
284
  }),
284
285
  /* @__PURE__ */ F("div", {
285
- className: z.orgTreeNodeActions,
286
- children: e.isSyntheticRoot ? /* @__PURE__ */ F(g, {
287
- icon: L,
286
+ className: V.orgTreeNodeActions,
287
+ children: e.isSyntheticRoot ? /* @__PURE__ */ F(_, {
288
+ icon: ne,
288
289
  iconType: "leading",
289
290
  onClick: () => e.onCreateChild(null),
290
291
  size: "sub",
291
292
  variant: "base-secondary",
292
293
  children: "新增根節點"
293
- }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(g, {
294
+ }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(_, {
294
295
  icon: te,
295
296
  iconType: "leading",
296
297
  onClick: () => {
@@ -299,8 +300,8 @@ function Re({ data: e, selected: t }) {
299
300
  size: "sub",
300
301
  variant: "base-secondary",
301
302
  children: "編輯"
302
- }), /* @__PURE__ */ F(g, {
303
- icon: L,
303
+ }), /* @__PURE__ */ F(_, {
304
+ icon: ne,
304
305
  iconType: "leading",
305
306
  onClick: () => e.onCreateChild(e.orgUnitId),
306
307
  size: "sub",
@@ -311,29 +312,29 @@ function Re({ data: e, selected: t }) {
311
312
  ]
312
313
  });
313
314
  }
314
- function ze({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, orgUnitsById: i, parentDraft: a, selectedOrgUnitId: o }) {
315
- let s = new Te.graphlib.Graph();
315
+ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, orgUnitsById: i, parentDraft: a, selectedOrgUnitId: o }) {
316
+ let s = new z.graphlib.Graph();
316
317
  s.setDefaultEdgeLabel(() => ({})), s.setGraph({
317
318
  marginx: 36,
318
319
  marginy: 36,
319
320
  nodesep: 44,
320
321
  rankdir: "TB"
321
- }), s.setNode(B, {
322
- height: Ne,
323
- width: Me
322
+ }), s.setNode(H, {
323
+ height: je,
324
+ width: Ae
324
325
  }), r.forEach((e) => {
325
326
  s.setNode(e.id, {
326
- height: je,
327
- width: V
327
+ height: ke,
328
+ width: U
328
329
  });
329
330
  }), r.forEach((e) => {
330
331
  let t = a.get(e.id) ?? null;
331
- s.setEdge(t ?? B, e.id);
332
- }), Te.layout(s);
333
- let c = Be({
332
+ s.setEdge(t ?? H, e.id);
333
+ }), z.layout(s);
334
+ let c = Re({
334
335
  data: {
335
336
  changed: !1,
336
- code: B,
337
+ code: H,
337
338
  deleted: !1,
338
339
  isEditing: e,
339
340
  isSyntheticRoot: !0,
@@ -346,13 +347,13 @@ function ze({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
346
347
  typeLabel: ""
347
348
  },
348
349
  graph: s,
349
- height: Ne,
350
- id: B,
350
+ height: je,
351
+ id: H,
351
352
  selected: o === null,
352
- width: Me
353
+ width: Ae
353
354
  }), l = r.map((r) => {
354
- let c = a.get(r.id) ?? null, l = U(c, i);
355
- return Be({
355
+ let c = a.get(r.id) ?? null, l = Ge(c, i);
356
+ return Re({
356
357
  data: {
357
358
  changed: c !== r.parentId,
358
359
  code: r.code,
@@ -365,13 +366,13 @@ function ze({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
365
366
  orgUnitId: r.id,
366
367
  parentLabel: l,
367
368
  path: r.path,
368
- typeLabel: qe(r.type)
369
+ typeLabel: Ke(r.type)
369
370
  },
370
371
  graph: s,
371
- height: je,
372
+ height: ke,
372
373
  id: r.id,
373
374
  selected: o === r.id,
374
- width: V
375
+ width: U
375
376
  });
376
377
  });
377
378
  return {
@@ -381,7 +382,7 @@ function ze({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
381
382
  animated: e && r,
382
383
  data: {},
383
384
  id: `org-tree-edge-${n ?? "root"}-${t.id}`,
384
- source: n ?? B,
385
+ source: n ?? H,
385
386
  sourceHandle: "source",
386
387
  style: r ? {
387
388
  stroke: "var(--mzn-color-primary, #0057ff)",
@@ -395,7 +396,7 @@ function ze({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
395
396
  nodes: [c, ...l]
396
397
  };
397
398
  }
398
- function Be({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
399
+ function Re({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
399
400
  let o = t.node(r);
400
401
  return {
401
402
  data: e,
@@ -411,68 +412,68 @@ function Be({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
411
412
  y: 0
412
413
  },
413
414
  selected: i,
414
- sourcePosition: Se.Bottom,
415
- targetPosition: Se.Top,
415
+ sourcePosition: R.Bottom,
416
+ targetPosition: R.Top,
416
417
  type: "orgUnit",
417
418
  width: a
418
419
  };
419
420
  }
420
- function H(e, t) {
421
- let n = We(e);
421
+ function ze(e, t) {
422
+ let n = He(e);
422
423
  return t.filter((t) => t.id !== e.id).map((e) => ({
423
- distance: Ge(n, We(e)),
424
+ distance: Ue(n, He(e)),
424
425
  id: e.id
425
- })).filter((e) => e.distance <= Pe).sort((e, t) => e.distance - t.distance)[0]?.id;
426
+ })).filter((e) => e.distance <= Me).sort((e, t) => e.distance - t.distance)[0]?.id;
426
427
  }
427
- function Ve(e, t) {
428
- let n = He(e);
428
+ function Be(e, t) {
429
+ let n = W(e);
429
430
  if (n) return Array.from(document.querySelectorAll(".react-flow__node[data-id]")).map((e) => {
430
431
  let r = e.dataset.id;
431
432
  if (!r || r === t) return null;
432
433
  let i = e.getBoundingClientRect();
433
434
  return {
434
- distance: Ge(n, {
435
+ distance: Ue(n, {
435
436
  x: i.left + i.width / 2,
436
437
  y: i.top + i.height / 2
437
438
  }),
438
439
  id: r
439
440
  };
440
- }).filter((e) => !!e).filter((e) => e.distance <= Pe).sort((e, t) => e.distance - t.distance)[0]?.id;
441
+ }).filter((e) => !!e).filter((e) => e.distance <= Me).sort((e, t) => e.distance - t.distance)[0]?.id;
441
442
  }
442
- function He(e) {
443
- return Ue(e) ? {
443
+ function W(e) {
444
+ return Ve(e) ? {
444
445
  x: e.clientX,
445
446
  y: e.clientY
446
447
  } : null;
447
448
  }
448
- function Ue(e) {
449
+ function Ve(e) {
449
450
  return typeof e == "object" && !!e && "clientX" in e && "clientY" in e && typeof e.clientX == "number" && typeof e.clientY == "number";
450
451
  }
451
- function We(e) {
452
+ function He(e) {
452
453
  return {
453
- x: e.position.x + (e.width ?? V) / 2,
454
- y: e.position.y + (e.height ?? je) / 2
454
+ x: e.position.x + (e.width ?? U) / 2,
455
+ y: e.position.y + (e.height ?? ke) / 2
455
456
  };
456
457
  }
457
- function Ge(e, t) {
458
+ function Ue(e, t) {
458
459
  return Math.hypot(e.x - t.x, e.y - t.y);
459
460
  }
460
- function Ke(e, t) {
461
- return !e.source || !e.target || e.target === B ? !1 : ke({
461
+ function We(e, t) {
462
+ return !e.source || !e.target || e.target === H ? !1 : De({
462
463
  orgUnitId: e.target,
463
464
  parentDraft: t,
464
- parentId: e.source === B ? null : e.source
465
+ parentId: e.source === H ? null : e.source
465
466
  }) === null;
466
467
  }
467
- function U(e, t) {
468
+ function Ge(e, t) {
468
469
  if (!e) return "根節點";
469
470
  let n = t.get(e);
470
471
  return n ? `${n.name} · ${n.code}` : "未知組織";
471
472
  }
472
- function qe(e) {
473
- return Fe[e.toUpperCase()] ?? "未知類型";
473
+ function Ke(e) {
474
+ return Ne[e.toUpperCase()] ?? "未知類型";
474
475
  }
475
- var W = {
476
+ var G = {
476
477
  tableIntroActions: "bpm_tableIntroActions_WO4XU",
477
478
  modalFields: "bpm_modalFields_juyv6",
478
479
  tableIntro: "bpm_tableIntro_u3hcm",
@@ -480,10 +481,10 @@ var W = {
480
481
  orgFilterArea: "bpm_orgFilterArea_Xjbbp",
481
482
  membershipFilterArea: "bpm_membershipFilterArea_zob-Y",
482
483
  scopeLabel: "bpm_scopeLabel_TLHMC"
483
- }, Je = {
484
+ }, qe = {
484
485
  hasDraftChanges: !1,
485
486
  isEditing: !1
486
- }, G = [
487
+ }, K = [
487
488
  {
488
489
  id: "COMPANY",
489
490
  name: "公司"
@@ -500,10 +501,10 @@ var W = {
500
501
  id: "TEAM",
501
502
  name: "小組"
502
503
  }
503
- ], Ye = {
504
+ ], Je = {
504
505
  id: "ALL",
505
506
  name: "全部類型"
506
- }, Xe = [Ye, ...G], K = [
507
+ }, Ye = [Je, ...K], q = [
507
508
  {
508
509
  id: "MEMBER",
509
510
  name: "指定會員"
@@ -516,18 +517,18 @@ var W = {
516
517
  id: "POSITION",
517
518
  name: "指定職位"
518
519
  }
519
- ], Ze = {
520
+ ], Xe = {
520
521
  id: "ALL",
521
522
  name: "全部範圍"
522
- }, Qe = [Ze, ...K], $e = {
523
+ }, Ze = [Xe, ...q], Qe = {
523
524
  activeOnly: !1,
524
525
  id: "ALL",
525
526
  name: "全部狀態"
526
- }, et = [$e, {
527
+ }, $e = [Qe, {
527
528
  activeOnly: !0,
528
529
  id: "ACTIVE",
529
530
  name: "目前有效"
530
- }], q = [{
531
+ }], J = [{
531
532
  id: "true",
532
533
  name: "主要歸屬",
533
534
  value: !0
@@ -535,107 +536,107 @@ var W = {
535
536
  id: "false",
536
537
  name: "一般歸屬",
537
538
  value: !1
538
- }], tt = [
539
+ }], et = [
539
540
  10,
540
541
  20,
541
542
  50
542
- ], nt = 1368, rt = 908, it = 1292, at = 1124;
543
- function J({ activeHref: t = "/admin/orgs" } = {}) {
544
- let [n, r] = m("ORG_UNITS"), [i, a] = m(null), [o, s] = m(null), [c, d] = m(null), [p, h] = m(!0), [g, _] = m(null), [v, y] = m($e), [b, x] = m(1), [S, O] = m(10), [j, P] = m(Ze), [ee, te] = m(0), [L, ne] = m([]), [R, _e] = m(null), [ve, ye] = m(null), [be, xe] = m(null), [Se, Ce] = m(1), [we, Te] = m(10), [Ee, De] = m(null), [Oe, ke] = m(0), [Ae, z] = m(null), [B, V] = m(1), [je, Me] = m(10), [Ne, Pe] = m(""), [Fe, Ie] = m(0), [Le, Re] = m(Ye), [ze, Be] = m("TABLE"), [H, Ve] = m([]), [He, Ue] = m([]), [We, Ge] = m([]), [Ke, U] = m(null), [qe, W] = m(1), [Je, G] = m(10), [Xe, K] = m(""), [Qe, et] = m(0), [q, tt] = m([]), [nt, rt] = m([]), [it, at] = m([]), [J, Y] = m(!1);
545
- u(() => {
546
- i && s(i);
547
- }, [i]);
548
- let ut = i ?? o, dt = l(async () => {
549
- h(!0), d(null);
543
+ ], tt = 1368, nt = 908, rt = 1292, it = 1124;
544
+ function at({ activeHref: n } = {}) {
545
+ let r = t(), i = n ?? r.adminOrgs(), [a, o] = h("ORG_UNITS"), [s, c] = h(null), [l, f] = h(null), [m, g] = h(null), [_, v] = h(!0), [y, b] = h(null), [x, S] = h(Qe), [C, O] = h(1), [j, P] = h(10), [ee, te] = h(Xe), [ne, re] = h(0), [L, ve] = h([]), [ye, be] = h(null), [xe, Se] = h(null), [R, Ce] = h(null), [we, z] = h(1), [B, Te] = h(10), [Ee, De] = h(null), [Oe, V] = h(0), [H, U] = h(null), [ke, Ae] = h(1), [je, Me] = h(10), [Ne, Pe] = h(""), [Fe, Ie] = h(0), [Le, Re] = h(Je), [ze, Be] = h("TABLE"), [W, Ve] = h([]), [He, Ue] = h([]), [We, Ge] = h([]), [Ke, G] = h(null), [qe, K] = h(1), [Ye, q] = h(10), [Ze, $e] = h(""), [J, et] = h(0), [tt, nt] = h([]), [rt, it] = h([]), [at, ut] = h([]), [Y, dt] = h(!1);
546
+ d(() => {
547
+ s && f(s);
548
+ }, [s]);
549
+ let ft = s ?? l, X = u(async () => {
550
+ v(!0), g(null);
550
551
  try {
551
- let e = await fe({
552
- managerActiveOnly: v.activeOnly,
553
- managerPage: b,
554
- managerPageSize: S,
555
- managerScopeType: j.id === "ALL" ? null : j.id,
556
- membershipActiveOnly: R?.activeOnly ?? !1,
557
- membershipOrgUnitId: be?.id ?? null,
558
- membershipPage: Se,
559
- membershipPageSize: we,
552
+ let e = await pe({
553
+ managerActiveOnly: x.activeOnly,
554
+ managerPage: C,
555
+ managerPageSize: j,
556
+ managerScopeType: ee.id === "ALL" ? null : ee.id,
557
+ membershipActiveOnly: ye?.activeOnly ?? !1,
558
+ membershipOrgUnitId: R?.id ?? null,
559
+ membershipPage: we,
560
+ membershipPageSize: B,
560
561
  membershipPositionId: Ee?.id ?? null,
561
- orgUnitPage: B,
562
+ orgUnitPage: ke,
562
563
  orgUnitPageSize: je,
563
564
  orgUnitSearchText: Ne,
564
565
  orgUnitType: Le.id === "ALL" ? null : Le.id,
565
566
  positionPage: qe,
566
- positionPageSize: Je,
567
- positionSearchText: Xe
567
+ positionPageSize: Ye,
568
+ positionSearchText: Ze
568
569
  });
569
- ne(await N(_t(e.memberships, e.managerResolutions))), Ve(e.orgUnits), Ie(e.orgUnitCount), Ue(e.filteredOrgUnits), tt(e.positions), et(e.positionCount), Ge(e.filteredPositions), ke(e.membershipCount), at(e.filteredMemberships), te(e.managerResolutionCount), rt(e.filteredManagerResolutions);
570
+ ve(await N(_t(e.memberships, e.managerResolutions))), Ve(e.orgUnits), Ie(e.orgUnitCount), Ue(e.filteredOrgUnits), nt(e.positions), et(e.positionCount), Ge(e.filteredPositions), V(e.membershipCount), ut(e.filteredMemberships), re(e.managerResolutionCount), it(e.filteredManagerResolutions);
570
571
  } catch (e) {
571
- d(zt(e));
572
+ g(zt(e));
572
573
  } finally {
573
- h(!1);
574
+ v(!1);
574
575
  }
575
576
  }, [
576
- v,
577
- b,
578
- S,
577
+ x,
578
+ C,
579
579
  j,
580
+ ee,
581
+ ye,
580
582
  R,
581
- be,
582
- Se,
583
583
  we,
584
- Ee,
585
584
  B,
585
+ Ee,
586
+ ke,
586
587
  je,
587
588
  Ne,
588
589
  Le,
589
590
  qe,
590
- Je,
591
- Xe
591
+ Ye,
592
+ Ze
592
593
  ]);
593
- u(() => {
594
- dt();
595
- }, [dt]);
596
- let X = f(() => new Map(H.map((e) => [e.id, e])), [H]), Z = f(() => new Map(q.map((e) => [e.id, e])), [q]), Q = f(() => new Map(L.map((e) => [e.memberId, e])), [L]), gt = f(() => He.map((e) => ({
594
+ d(() => {
595
+ X();
596
+ }, [X]);
597
+ let Z = p(() => new Map(W.map((e) => [e.id, e])), [W]), Q = p(() => new Map(tt.map((e) => [e.id, e])), [tt]), $ = p(() => new Map(L.map((e) => [e.memberId, e])), [L]), wt = p(() => He.map((e) => ({
597
598
  ...e,
598
599
  key: e.id,
599
- parentName: e.parentId ? bt(X.get(e.parentId)) : "根節點",
600
+ parentName: e.parentId ? bt(Z.get(e.parentId)) : "根節點",
600
601
  typeLabel: xt(e.type)
601
- })), [He, X]), wt = f(() => We.map((e) => ({
602
+ })), [He, Z]), Tt = p(() => We.map((e) => ({
602
603
  ...e,
603
604
  key: e.id
604
- })), [We]), Tt = f(() => it.map((e) => ({
605
+ })), [We]), Et = p(() => at.map((e) => ({
605
606
  ...e,
606
607
  key: e.id,
607
- memberName: yt(Q.get(e.memberId)),
608
- orgUnitName: bt(X.get(e.orgUnitId)),
609
- positionName: e.positionId ? St(Z.get(e.positionId)) : "未指定"
608
+ memberName: yt($.get(e.memberId)),
609
+ orgUnitName: bt(Z.get(e.orgUnitId)),
610
+ positionName: e.positionId ? St(Q.get(e.positionId)) : "未指定"
610
611
  })), [
611
- Q,
612
- it,
613
- X,
614
- Z
615
- ]), Et = f(() => nt.map((e) => ({
612
+ $,
613
+ at,
614
+ Z,
615
+ Q
616
+ ]), Dt = p(() => rt.map((e) => ({
616
617
  ...e,
617
618
  key: e.id,
618
- managerName: yt(Q.get(e.managerMemberId)),
619
+ managerName: yt($.get(e.managerMemberId)),
619
620
  scopeLabel: vt(e, {
620
- membersById: Q,
621
- orgUnitsById: X,
622
- positionsById: Z
621
+ membersById: $,
622
+ orgUnitsById: Z,
623
+ positionsById: Q
623
624
  })
624
625
  })), [
625
- nt,
626
- Q,
627
- X,
628
- Z
629
- ]), Dt = f(() => ({
626
+ rt,
627
+ $,
628
+ Z,
629
+ Q
630
+ ]), Ot = p(() => ({
630
631
  render: (e) => [{
631
632
  name: "編輯",
632
- onClick: () => z({
633
+ onClick: () => U({
633
634
  record: e,
634
635
  type: "EDIT"
635
636
  })
636
637
  }, {
637
638
  name: "停用",
638
- onClick: () => a({
639
+ onClick: () => c({
639
640
  confirmText: "停用組織",
640
641
  description: `停用「${e.name}」後,這個組織節點將不再出現在可用組織清單中。`,
641
642
  id: e.id,
@@ -646,26 +647,26 @@ function J({ activeHref: t = "/admin/orgs" } = {}) {
646
647
  }],
647
648
  variant: "base-secondary",
648
649
  width: 128
649
- }), []), Ot = f(() => ({
650
+ }), []), kt = p(() => ({
650
651
  render: (e) => [{
651
652
  name: "編輯",
652
- onClick: () => U({
653
+ onClick: () => G({
653
654
  record: e,
654
655
  type: "EDIT"
655
656
  })
656
657
  }],
657
658
  variant: "base-secondary",
658
659
  width: 88
659
- }), []), kt = f(() => ({
660
+ }), []), At = p(() => ({
660
661
  render: (e) => [{
661
662
  name: "編輯",
662
- onClick: () => ye({
663
+ onClick: () => Se({
663
664
  record: e,
664
665
  type: "EDIT"
665
666
  })
666
667
  }, {
667
668
  name: "刪除",
668
- onClick: () => a({
669
+ onClick: () => c({
669
670
  confirmText: "刪除歸屬",
670
671
  description: `刪除「${e.memberName}」在「${e.orgUnitName}」的會員歸屬。`,
671
672
  id: e.id,
@@ -676,16 +677,16 @@ function J({ activeHref: t = "/admin/orgs" } = {}) {
676
677
  }],
677
678
  variant: "base-secondary",
678
679
  width: 128
679
- }), []), At = f(() => ({
680
+ }), []), jt = p(() => ({
680
681
  render: (e) => [{
681
682
  name: "編輯",
682
- onClick: () => _({
683
+ onClick: () => b({
683
684
  record: e,
684
685
  type: "EDIT"
685
686
  })
686
687
  }, {
687
688
  name: "刪除",
688
- onClick: () => a({
689
+ onClick: () => c({
689
690
  confirmText: "刪除主管規則",
690
691
  description: `刪除「${e.scopeLabel}」指派給「${e.managerName}」的主管解析規則。`,
691
692
  id: e.id,
@@ -697,299 +698,302 @@ function J({ activeHref: t = "/admin/orgs" } = {}) {
697
698
  variant: "base-secondary",
698
699
  width: 128
699
700
  }), []);
700
- function jt(e) {
701
- V(1), Pe(e);
702
- }
703
701
  function Mt(e) {
704
- V(1), Re(e);
702
+ Ae(1), Pe(e);
705
703
  }
706
704
  function Nt(e) {
707
- W(1), K(e);
708
- }
709
- function $(e) {
710
- Ce(1), _e(e);
705
+ Ae(1), Re(e);
711
706
  }
712
707
  function Pt(e) {
713
- Ce(1), xe(e);
708
+ K(1), $e(e);
714
709
  }
715
710
  function It(e) {
716
- Ce(1), De(e);
711
+ z(1), be(e);
717
712
  }
718
713
  function Lt(e) {
719
- x(1), y(e);
714
+ z(1), Ce(e);
720
715
  }
721
716
  function Rt(e) {
722
- x(1), P(e);
717
+ z(1), De(e);
723
718
  }
724
- function Bt() {
725
- J || a(null);
719
+ function Bt(e) {
720
+ O(1), S(e);
726
721
  }
727
- async function Vt() {
728
- i && await Ut(async () => {
729
- i.type === "ORG_UNIT" && await de(i.id), i.type === "MEMBERSHIP" && await ue(i.id), i.type === "MANAGER_RESOLUTION" && await le(i.id), a(null);
722
+ function Vt(e) {
723
+ O(1), te(e);
724
+ }
725
+ function Ht() {
726
+ Y || c(null);
727
+ }
728
+ async function Ut() {
729
+ s && await Gt(async () => {
730
+ s.type === "ORG_UNIT" && await fe(s.id), s.type === "MEMBERSHIP" && await de(s.id), s.type === "MANAGER_RESOLUTION" && await ue(s.id), c(null);
730
731
  });
731
732
  }
732
- async function Ht(e) {
733
- Y(!0), d(null);
733
+ async function Wt(e) {
734
+ dt(!0), g(null);
734
735
  try {
735
- await ie({ moves: e.map((e) => ({
736
- baseUpdatedAt: X.get(e.orgUnitId)?.updatedAt ?? "",
736
+ await ae({ moves: e.map((e) => ({
737
+ baseUpdatedAt: Z.get(e.orgUnitId)?.updatedAt ?? "",
737
738
  id: e.orgUnitId,
738
739
  parentId: e.parentId
739
- })) }), await dt();
740
+ })) }), await X();
740
741
  } catch (e) {
741
- throw d(zt(e)), e;
742
+ throw g(zt(e)), e;
742
743
  } finally {
743
- Y(!1);
744
+ dt(!1);
744
745
  }
745
746
  }
746
- async function Ut(e) {
747
- Y(!0), d(null);
747
+ async function Gt(e) {
748
+ dt(!0), g(null);
748
749
  try {
749
- await e(), await dt();
750
+ await e(), await X();
750
751
  } catch (e) {
751
- d(zt(e));
752
+ g(zt(e));
752
753
  } finally {
753
- Y(!1);
754
+ dt(!1);
754
755
  }
755
756
  }
756
- return /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(e, { activeHref: t }), /* @__PURE__ */ I(C.Main, { children: [
757
- /* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(re, {
758
- description: "維護組織樹、職位、會員歸屬與簽核主管解析規則。",
759
- title: "組織管理"
760
- }) }),
761
- /* @__PURE__ */ F(D, { children: /* @__PURE__ */ I(E, {
762
- tab: /* @__PURE__ */ I(k, {
763
- activeKey: n,
764
- onChange: (e) => r(Ct(e)),
757
+ return /* @__PURE__ */ I(e, {
758
+ activeHref: i,
759
+ children: [
760
+ /* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(ie, {
761
+ description: "維護組織樹、職位、會員歸屬與簽核主管解析規則。",
762
+ title: "組織管理"
763
+ }) }),
764
+ /* @__PURE__ */ F(D, { children: /* @__PURE__ */ I(E, {
765
+ tab: /* @__PURE__ */ I(k, {
766
+ activeKey: a,
767
+ onChange: (e) => o(Ct(e)),
768
+ children: [
769
+ /* @__PURE__ */ F(A, { children: "組織樹" }, "ORG_UNITS"),
770
+ /* @__PURE__ */ F(A, { children: "職位" }, "POSITIONS"),
771
+ /* @__PURE__ */ F(A, { children: "會員歸屬" }, "MEMBERSHIPS"),
772
+ /* @__PURE__ */ F(A, { children: "簽核主管" }, "MANAGERS")
773
+ ]
774
+ }),
765
775
  children: [
766
- /* @__PURE__ */ F(A, { children: "組織樹" }, "ORG_UNITS"),
767
- /* @__PURE__ */ F(A, { children: "職位" }, "POSITIONS"),
768
- /* @__PURE__ */ F(A, { children: "會員歸屬" }, "MEMBERSHIPS"),
769
- /* @__PURE__ */ F(A, { children: "簽核主管" }, "MANAGERS")
776
+ m ? /* @__PURE__ */ F(M, {
777
+ color: "text-error",
778
+ variant: "body",
779
+ children: m
780
+ }) : null,
781
+ a === "ORG_UNITS" ? /* @__PURE__ */ F(ot, {
782
+ actions: Ot,
783
+ loading: _,
784
+ onCreate: () => U({
785
+ parentId: null,
786
+ record: null,
787
+ type: "CREATE"
788
+ }),
789
+ onCreateChild: (e) => U({
790
+ parentId: e,
791
+ record: null,
792
+ type: "CREATE"
793
+ }),
794
+ onEditOrgUnit: (e) => U({
795
+ record: e,
796
+ type: "EDIT"
797
+ }),
798
+ onPageChange: Ae,
799
+ onSaveDraft: Wt,
800
+ onPageSizeChange: (e) => {
801
+ Ae(1), Me(e);
802
+ },
803
+ onSearchTextChange: Mt,
804
+ onTypeFilterChange: Nt,
805
+ orgUnits: W,
806
+ page: ke,
807
+ pageSize: je,
808
+ rows: wt,
809
+ searchText: Ne,
810
+ saving: Y,
811
+ total: Fe,
812
+ typeFilter: Le,
813
+ viewMode: ze,
814
+ onViewModeChange: Be
815
+ }) : null,
816
+ a === "POSITIONS" ? /* @__PURE__ */ F(st, {
817
+ actions: kt,
818
+ loading: _,
819
+ onCreate: () => G({
820
+ record: null,
821
+ type: "CREATE"
822
+ }),
823
+ onPageChange: K,
824
+ onPageSizeChange: (e) => {
825
+ K(1), q(e);
826
+ },
827
+ onSearchTextChange: Pt,
828
+ page: qe,
829
+ pageSize: Ye,
830
+ rows: Tt,
831
+ searchText: Ze,
832
+ total: J
833
+ }) : null,
834
+ a === "MEMBERSHIPS" ? /* @__PURE__ */ F(ct, {
835
+ actions: At,
836
+ loading: _,
837
+ onCreate: () => Se({
838
+ record: null,
839
+ type: "CREATE"
840
+ }),
841
+ onActiveFilterChange: It,
842
+ onOrgUnitFilterChange: Lt,
843
+ onPageChange: z,
844
+ onPageSizeChange: (e) => {
845
+ z(1), Te(e);
846
+ },
847
+ onPositionFilterChange: Rt,
848
+ orgUnitFilter: R,
849
+ orgUnits: W,
850
+ page: we,
851
+ pageSize: B,
852
+ positionFilter: Ee,
853
+ positions: tt,
854
+ rows: Et,
855
+ statusFilter: ye,
856
+ total: Oe
857
+ }) : null,
858
+ a === "MANAGERS" ? /* @__PURE__ */ F(lt, {
859
+ actions: jt,
860
+ loading: _,
861
+ onCreate: () => b({
862
+ record: null,
863
+ type: "CREATE"
864
+ }),
865
+ onActiveFilterChange: Bt,
866
+ onPageChange: O,
867
+ onPageSizeChange: (e) => {
868
+ O(1), P(e);
869
+ },
870
+ onScopeTypeFilterChange: Vt,
871
+ page: C,
872
+ pageSize: j,
873
+ rows: Dt,
874
+ scopeTypeFilter: ee,
875
+ statusFilter: x,
876
+ total: ne
877
+ }) : null
770
878
  ]
879
+ }) }),
880
+ /* @__PURE__ */ F(pt, {
881
+ modal: H,
882
+ onClose: () => U(null),
883
+ onSubmit: (e) => Gt(async () => {
884
+ H?.type === "EDIT" && H.record ? await ge({
885
+ ...e,
886
+ id: H.record.id,
887
+ metadataJson: null
888
+ }) : await ce({
889
+ code: e.code ?? "",
890
+ metadataJson: "{}",
891
+ name: e.name ?? "",
892
+ parentId: e.parentId,
893
+ type: e.type ?? "DEPARTMENT"
894
+ }), U(null);
895
+ }),
896
+ orgUnits: W,
897
+ saving: Y
771
898
  }),
772
- children: [
773
- c ? /* @__PURE__ */ F(M, {
774
- color: "text-error",
775
- variant: "body",
776
- children: c
777
- }) : null,
778
- n === "ORG_UNITS" ? /* @__PURE__ */ F(ot, {
779
- actions: Dt,
780
- loading: p,
781
- onCreate: () => z({
782
- parentId: null,
783
- record: null,
784
- type: "CREATE"
785
- }),
786
- onCreateChild: (e) => z({
787
- parentId: e,
788
- record: null,
789
- type: "CREATE"
790
- }),
791
- onEditOrgUnit: (e) => z({
792
- record: e,
793
- type: "EDIT"
794
- }),
795
- onPageChange: V,
796
- onSaveDraft: Ht,
797
- onPageSizeChange: (e) => {
798
- V(1), Me(e);
799
- },
800
- onSearchTextChange: jt,
801
- onTypeFilterChange: Mt,
802
- orgUnits: H,
803
- page: B,
804
- pageSize: je,
805
- rows: gt,
806
- searchText: Ne,
807
- saving: J,
808
- total: Fe,
809
- typeFilter: Le,
810
- viewMode: ze,
811
- onViewModeChange: Be
812
- }) : null,
813
- n === "POSITIONS" ? /* @__PURE__ */ F(st, {
814
- actions: Ot,
815
- loading: p,
816
- onCreate: () => U({
817
- record: null,
818
- type: "CREATE"
819
- }),
820
- onPageChange: W,
821
- onPageSizeChange: (e) => {
822
- W(1), G(e);
823
- },
824
- onSearchTextChange: Nt,
825
- page: qe,
826
- pageSize: Je,
827
- rows: wt,
828
- searchText: Xe,
829
- total: Qe
830
- }) : null,
831
- n === "MEMBERSHIPS" ? /* @__PURE__ */ F(ct, {
832
- actions: kt,
833
- loading: p,
834
- onCreate: () => ye({
835
- record: null,
836
- type: "CREATE"
837
- }),
838
- onActiveFilterChange: $,
839
- onOrgUnitFilterChange: Pt,
840
- onPageChange: Ce,
841
- onPageSizeChange: (e) => {
842
- Ce(1), Te(e);
843
- },
844
- onPositionFilterChange: It,
845
- orgUnitFilter: be,
846
- orgUnits: H,
847
- page: Se,
848
- pageSize: we,
849
- positionFilter: Ee,
850
- positions: q,
851
- rows: Tt,
852
- statusFilter: R,
853
- total: Oe
854
- }) : null,
855
- n === "MANAGERS" ? /* @__PURE__ */ F(lt, {
856
- actions: At,
857
- loading: p,
858
- onCreate: () => _({
859
- record: null,
860
- type: "CREATE"
861
- }),
862
- onActiveFilterChange: Lt,
863
- onPageChange: x,
864
- onPageSizeChange: (e) => {
865
- x(1), O(e);
866
- },
867
- onScopeTypeFilterChange: Rt,
868
- page: b,
869
- pageSize: S,
870
- rows: Et,
871
- scopeTypeFilter: j,
872
- statusFilter: v,
873
- total: ee
874
- }) : null
875
- ]
876
- }) }),
877
- /* @__PURE__ */ F(ft, {
878
- modal: Ae,
879
- onClose: () => z(null),
880
- onSubmit: (e) => Ut(async () => {
881
- Ae?.type === "EDIT" && Ae.record ? await he({
882
- ...e,
883
- id: Ae.record.id,
884
- metadataJson: null
885
- }) : await se({
886
- code: e.code ?? "",
887
- metadataJson: "{}",
888
- name: e.name ?? "",
889
- parentId: e.parentId,
890
- type: e.type ?? "DEPARTMENT"
891
- }), z(null);
892
- }),
893
- orgUnits: H,
894
- saving: J
895
- }),
896
- /* @__PURE__ */ F(pt, {
897
- modal: Ke,
898
- onClose: () => U(null),
899
- onSubmit: (e) => Ut(async () => {
900
- Ke?.type === "EDIT" && Ke.record ? await ge({
901
- ...e,
902
- id: Ke.record.id,
903
- metadataJson: null
904
- }) : await ce({
905
- code: e.code ?? "",
906
- level: e.level ?? 0,
907
- metadataJson: "{}",
908
- name: e.name ?? ""
909
- }), U(null);
899
+ /* @__PURE__ */ F(mt, {
900
+ modal: Ke,
901
+ onClose: () => G(null),
902
+ onSubmit: (e) => Gt(async () => {
903
+ Ke?.type === "EDIT" && Ke.record ? await _e({
904
+ ...e,
905
+ id: Ke.record.id,
906
+ metadataJson: null
907
+ }) : await le({
908
+ code: e.code ?? "",
909
+ level: e.level ?? 0,
910
+ metadataJson: "{}",
911
+ name: e.name ?? ""
912
+ }), G(null);
913
+ }),
914
+ saving: Y
910
915
  }),
911
- saving: J
912
- }),
913
- /* @__PURE__ */ F(mt, {
914
- membersById: Q,
915
- modal: ve,
916
- onClose: () => ye(null),
917
- onSubmit: (e) => Ut(async () => {
918
- ve?.type === "EDIT" && ve.record ? await me({
919
- ...e,
920
- id: ve.record.id
921
- }) : await oe({
922
- effectiveFrom: e.effectiveFrom ?? Ft(),
923
- effectiveTo: e.effectiveTo,
924
- isPrimary: e.isPrimary ?? !1,
925
- memberId: e.memberId ?? "",
926
- orgUnitId: e.orgUnitId ?? "",
927
- positionId: e.positionId
928
- }), ye(null);
916
+ /* @__PURE__ */ F(ht, {
917
+ membersById: $,
918
+ modal: xe,
919
+ onClose: () => Se(null),
920
+ onSubmit: (e) => Gt(async () => {
921
+ xe?.type === "EDIT" && xe.record ? await he({
922
+ ...e,
923
+ id: xe.record.id
924
+ }) : await se({
925
+ effectiveFrom: e.effectiveFrom ?? Ft(),
926
+ effectiveTo: e.effectiveTo,
927
+ isPrimary: e.isPrimary ?? !1,
928
+ memberId: e.memberId ?? "",
929
+ orgUnitId: e.orgUnitId ?? "",
930
+ positionId: e.positionId
931
+ }), Se(null);
932
+ }),
933
+ orgUnits: W,
934
+ positions: tt,
935
+ saving: Y
929
936
  }),
930
- orgUnits: H,
931
- positions: q,
932
- saving: J
933
- }),
934
- /* @__PURE__ */ F(ht, {
935
- membersById: Q,
936
- modal: g,
937
- onClose: () => _(null),
938
- onSubmit: (e) => Ut(async () => {
939
- g?.type === "EDIT" && g.record ? await pe({
940
- ...e,
941
- id: g.record.id
942
- }) : await ae({
943
- effectiveFrom: e.effectiveFrom ?? Ft(),
944
- effectiveTo: e.effectiveTo,
945
- managerMemberId: e.managerMemberId ?? "",
946
- priority: e.priority ?? 0,
947
- scopeId: e.scopeId ?? "",
948
- scopeType: e.scopeType ?? "MEMBER"
949
- }), _(null);
937
+ /* @__PURE__ */ F(gt, {
938
+ membersById: $,
939
+ modal: y,
940
+ onClose: () => b(null),
941
+ onSubmit: (e) => Gt(async () => {
942
+ y?.type === "EDIT" && y.record ? await me({
943
+ ...e,
944
+ id: y.record.id
945
+ }) : await oe({
946
+ effectiveFrom: e.effectiveFrom ?? Ft(),
947
+ effectiveTo: e.effectiveTo,
948
+ managerMemberId: e.managerMemberId ?? "",
949
+ priority: e.priority ?? 0,
950
+ scopeId: e.scopeId ?? "",
951
+ scopeType: e.scopeType ?? "MEMBER"
952
+ }), b(null);
953
+ }),
954
+ orgUnits: W,
955
+ positions: tt,
956
+ saving: Y
950
957
  }),
951
- orgUnits: H,
952
- positions: q,
953
- saving: J
954
- }),
955
- /* @__PURE__ */ F(w, {
956
- cancelText: "取消",
957
- confirmButtonProps: { variant: "destructive-primary" },
958
- confirmText: ut?.confirmText ?? "",
959
- loading: J,
960
- modalStatusType: "error",
961
- modalType: "standard",
962
- onCancel: Bt,
963
- onClose: Bt,
964
- onConfirm: () => void Vt(),
965
- open: !!i,
966
- showModalFooter: !0,
967
- showModalHeader: !0,
968
- size: "regular",
969
- supportingText: "此操作會立即套用,請確認後再繼續。",
970
- title: ut?.title ?? "",
971
- children: /* @__PURE__ */ F(M, {
972
- color: "text-neutral",
973
- variant: "body",
974
- children: ut?.description ?? ""
958
+ /* @__PURE__ */ F(w, {
959
+ cancelText: "取消",
960
+ confirmButtonProps: { variant: "destructive-primary" },
961
+ confirmText: ft?.confirmText ?? "",
962
+ loading: Y,
963
+ modalStatusType: "error",
964
+ modalType: "standard",
965
+ onCancel: Ht,
966
+ onClose: Ht,
967
+ onConfirm: () => void Ut(),
968
+ open: !!s,
969
+ showModalFooter: !0,
970
+ showModalHeader: !0,
971
+ size: "regular",
972
+ supportingText: "此操作會立即套用,請確認後再繼續。",
973
+ title: ft?.title ?? "",
974
+ children: /* @__PURE__ */ F(M, {
975
+ color: "text-neutral",
976
+ variant: "body",
977
+ children: ft?.description ?? ""
978
+ })
975
979
  })
976
- })
977
- ] })] });
980
+ ]
981
+ });
978
982
  }
979
- function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUnit: i, onPageChange: a, onSaveDraft: o, onPageSizeChange: s, onSearchTextChange: c, onTypeFilterChange: l, onViewModeChange: d, orgUnits: h, page: _, pageSize: C, rows: w, searchText: T, saving: E, total: D, typeFilter: k, viewMode: A }) {
980
- let M = p(null), [N, te] = m(Je), L = A === "TABLE" ? "FLOW" : "TABLE", ne = A === "TABLE" ? "切換樹狀圖" : "切換表格", re = A === "FLOW", ie = ut({
981
- isTreeMode: re,
983
+ function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUnit: i, onPageChange: a, onSaveDraft: o, onPageSizeChange: s, onSearchTextChange: c, onTypeFilterChange: l, onViewModeChange: u, orgUnits: f, page: g, pageSize: v, rows: w, searchText: T, saving: E, total: D, typeFilter: k, viewMode: A }) {
984
+ let M = m(null), [N, te] = h(qe), ne = A === "TABLE" ? "FLOW" : "TABLE", re = A === "TABLE" ? "切換樹狀圖" : "切換表格", ie = A === "FLOW", ae = Y({
985
+ isTreeMode: ie,
982
986
  isTreeEditing: N.isEditing
983
- }), ae = dt({
984
- isTreeMode: re,
987
+ }), oe = dt({
988
+ isTreeMode: ie,
985
989
  isTreeEditing: N.isEditing
986
- }), oe = X({
990
+ }), se = ft({
987
991
  hasDraftChanges: N.hasDraftChanges,
988
992
  isTreeEditing: N.isEditing,
989
- isTreeMode: re,
993
+ isTreeMode: ie,
990
994
  loading: t,
991
995
  saving: E
992
- }), se = f(() => [
996
+ }), ce = p(() => [
993
997
  {
994
998
  dataIndex: "code",
995
999
  key: "code",
@@ -1021,17 +1025,17 @@ function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1021
1025
  width: 420
1022
1026
  }
1023
1027
  ], []);
1024
- return u(() => {
1025
- A === "TABLE" && te(Je);
1026
- }, [A]), /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Z, {
1027
- actionDisabled: oe,
1028
- actionIcon: ae,
1029
- actionLabel: ie,
1030
- actions: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(g, {
1031
- onClick: () => d(L),
1028
+ return d(() => {
1029
+ A === "TABLE" && te(qe);
1030
+ }, [A]), /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(X, {
1031
+ actionDisabled: se,
1032
+ actionIcon: oe,
1033
+ actionLabel: ae,
1034
+ actions: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(_, {
1035
+ onClick: () => u(ne),
1032
1036
  variant: "base-secondary",
1033
- children: ne
1034
- }), re && N.isEditing ? /* @__PURE__ */ F(g, {
1037
+ children: re
1038
+ }), ie && N.isEditing ? /* @__PURE__ */ F(_, {
1035
1039
  disabled: E,
1036
1040
  icon: ee,
1037
1041
  iconType: "leading",
@@ -1041,7 +1045,7 @@ function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1041
1045
  }) : null] }),
1042
1046
  description: "組織節點使用 ltree path 維護階層,搬移節點會同步更新子節點 path。",
1043
1047
  onCreate: () => {
1044
- if (!re) {
1048
+ if (!ie) {
1045
1049
  n();
1046
1050
  return;
1047
1051
  }
@@ -1052,16 +1056,16 @@ function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1052
1056
  M.current?.startEditing();
1053
1057
  },
1054
1058
  title: "組織樹"
1055
- }), A === "TABLE" ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(y, {
1056
- className: W.orgFilterArea,
1059
+ }), A === "TABLE" ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(b, {
1060
+ className: G.orgFilterArea,
1057
1061
  size: "sub",
1058
- children: /* @__PURE__ */ I(b, { children: [/* @__PURE__ */ F(v, {
1062
+ children: /* @__PURE__ */ I(x, { children: [/* @__PURE__ */ F(y, {
1059
1063
  span: 3,
1060
- children: /* @__PURE__ */ F(x, {
1064
+ children: /* @__PURE__ */ F(S, {
1061
1065
  fullWidth: !0,
1062
- layout: R.VERTICAL,
1066
+ layout: L.VERTICAL,
1063
1067
  name: "orgUnitSearchText",
1064
- children: /* @__PURE__ */ F(S, {
1068
+ children: /* @__PURE__ */ F(C, {
1065
1069
  fullWidth: !0,
1066
1070
  onChange: (e) => c(e.target.value),
1067
1071
  placeholder: "搜尋組織名稱或代碼",
@@ -1070,17 +1074,17 @@ function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1070
1074
  variant: "base"
1071
1075
  })
1072
1076
  })
1073
- }), /* @__PURE__ */ F(v, {
1077
+ }), /* @__PURE__ */ F(y, {
1074
1078
  span: 2,
1075
- children: /* @__PURE__ */ F(x, {
1079
+ children: /* @__PURE__ */ F(S, {
1076
1080
  fullWidth: !0,
1077
- layout: R.VERTICAL,
1081
+ layout: L.VERTICAL,
1078
1082
  name: "orgUnitTypeFilter",
1079
1083
  children: /* @__PURE__ */ F(O, {
1080
1084
  clearable: !1,
1081
1085
  fullWidth: !0,
1082
- onChange: (e) => l(Tt(e)),
1083
- options: [...Xe],
1086
+ onChange: (e) => l(wt(e)),
1087
+ options: [...Ye],
1084
1088
  placeholder: "類型",
1085
1089
  size: "sub",
1086
1090
  value: k
@@ -1088,35 +1092,35 @@ function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1088
1092
  })
1089
1093
  })] })
1090
1094
  }), /* @__PURE__ */ F("div", {
1091
- className: W.tableFrame,
1095
+ className: G.tableFrame,
1092
1096
  children: /* @__PURE__ */ F(j, {
1093
1097
  actions: e,
1094
- columns: se,
1098
+ columns: ce,
1095
1099
  dataSource: [...w],
1096
1100
  fullWidth: !0,
1097
1101
  loading: t,
1098
- pagination: Y({
1102
+ pagination: ut({
1099
1103
  onPageChange: a,
1100
1104
  onPageSizeChange: s,
1101
- page: _,
1102
- pageSize: C,
1105
+ page: g,
1106
+ pageSize: v,
1103
1107
  total: D
1104
1108
  }),
1105
- style: { minWidth: nt }
1109
+ style: { minWidth: tt }
1106
1110
  })
1107
- })] }) : /* @__PURE__ */ F(Le, {
1111
+ })] }) : /* @__PURE__ */ F(Fe, {
1108
1112
  ref: M,
1109
1113
  onCreateChild: r,
1110
1114
  onCreateRoot: n,
1111
1115
  onEditOrgUnit: i,
1112
1116
  onSaveDraft: o,
1113
1117
  onStateChange: te,
1114
- orgUnits: h,
1118
+ orgUnits: f,
1115
1119
  saving: E
1116
1120
  })] });
1117
1121
  }
1118
1122
  function st({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeChange: i, onSearchTextChange: a, page: o, pageSize: s, rows: c, searchText: l, total: u }) {
1119
- let d = f(() => [
1123
+ let d = p(() => [
1120
1124
  {
1121
1125
  dataIndex: "code",
1122
1126
  key: "code",
@@ -1143,22 +1147,22 @@ function st({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
1143
1147
  }
1144
1148
  ], []);
1145
1149
  return /* @__PURE__ */ I(P, { children: [
1146
- /* @__PURE__ */ F(Z, {
1150
+ /* @__PURE__ */ F(X, {
1147
1151
  actionLabel: "新增職位",
1148
1152
  description: "職位提供會員歸屬與主管解析規則使用。",
1149
1153
  onCreate: n,
1150
1154
  title: "職位"
1151
1155
  }),
1152
- /* @__PURE__ */ F(y, {
1153
- className: W.orgFilterArea,
1156
+ /* @__PURE__ */ F(b, {
1157
+ className: G.orgFilterArea,
1154
1158
  size: "sub",
1155
- children: /* @__PURE__ */ F(b, { children: /* @__PURE__ */ F(v, {
1159
+ children: /* @__PURE__ */ F(x, { children: /* @__PURE__ */ F(y, {
1156
1160
  span: 3,
1157
- children: /* @__PURE__ */ F(x, {
1161
+ children: /* @__PURE__ */ F(S, {
1158
1162
  fullWidth: !0,
1159
- layout: R.VERTICAL,
1163
+ layout: L.VERTICAL,
1160
1164
  name: "positionSearchText",
1161
- children: /* @__PURE__ */ F(S, {
1165
+ children: /* @__PURE__ */ F(C, {
1162
1166
  fullWidth: !0,
1163
1167
  onChange: (e) => a(e.target.value),
1164
1168
  placeholder: "搜尋職位名稱或代碼",
@@ -1170,27 +1174,27 @@ function st({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
1170
1174
  }) })
1171
1175
  }),
1172
1176
  /* @__PURE__ */ F("div", {
1173
- className: W.tableFrame,
1177
+ className: G.tableFrame,
1174
1178
  children: /* @__PURE__ */ F(j, {
1175
1179
  actions: e,
1176
1180
  columns: d,
1177
1181
  dataSource: [...c],
1178
1182
  fullWidth: !0,
1179
1183
  loading: t,
1180
- pagination: Y({
1184
+ pagination: ut({
1181
1185
  onPageChange: r,
1182
1186
  onPageSizeChange: i,
1183
1187
  page: o,
1184
1188
  pageSize: s,
1185
1189
  total: u
1186
1190
  }),
1187
- style: { minWidth: rt }
1191
+ style: { minWidth: nt }
1188
1192
  })
1189
1193
  })
1190
1194
  ] });
1191
1195
  }
1192
- function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOrgUnitFilterChange: o, onPageChange: s, onPageSizeChange: c, onPositionFilterChange: l, orgUnitFilter: u, orgUnits: d, page: p, pageSize: m, positionFilter: g, positions: _, rows: S, statusFilter: C, total: w }) {
1193
- let T = f(() => [
1196
+ function ct({ actions: e, loading: t, onCreate: r, onActiveFilterChange: i, onOrgUnitFilterChange: o, onPageChange: s, onPageSizeChange: c, onPositionFilterChange: l, orgUnitFilter: u, orgUnits: d, page: f, pageSize: m, positionFilter: h, positions: _, rows: v, statusFilter: C, total: w }) {
1197
+ let T = p(() => [
1194
1198
  {
1195
1199
  dataIndex: "memberName",
1196
1200
  key: "memberName",
@@ -1227,25 +1231,25 @@ function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1227
1231
  title: "結束日",
1228
1232
  width: 140
1229
1233
  }
1230
- ], []), E = f(() => d.map(t), [d]), D = f(() => _.map(i), [_]);
1234
+ ], []), E = p(() => d.map(n), [d]), D = p(() => _.map(a), [_]);
1231
1235
  return /* @__PURE__ */ I(P, { children: [
1232
- /* @__PURE__ */ F(Z, {
1236
+ /* @__PURE__ */ F(X, {
1233
1237
  actionLabel: "新增歸屬",
1234
1238
  description: "會員歸屬是 BPM 內部組織權限、主管解析與條件判斷的來源。",
1235
1239
  onCreate: r,
1236
1240
  title: "會員歸屬"
1237
1241
  }),
1238
- /* @__PURE__ */ F(y, {
1239
- className: [W.orgFilterArea, W.membershipFilterArea].join(" "),
1242
+ /* @__PURE__ */ F(b, {
1243
+ className: [G.orgFilterArea, G.membershipFilterArea].join(" "),
1240
1244
  size: "sub",
1241
- children: /* @__PURE__ */ I(b, { children: [
1242
- /* @__PURE__ */ F(v, {
1245
+ children: /* @__PURE__ */ I(x, { children: [
1246
+ /* @__PURE__ */ F(y, {
1243
1247
  span: 2,
1244
- children: /* @__PURE__ */ F(x, {
1248
+ children: /* @__PURE__ */ F(S, {
1245
1249
  fullWidth: !0,
1246
- layout: R.VERTICAL,
1250
+ layout: L.VERTICAL,
1247
1251
  name: "membershipOrgUnitFilter",
1248
- children: /* @__PURE__ */ F(h, {
1252
+ children: /* @__PURE__ */ F(g, {
1249
1253
  disabledOptionsFilter: !0,
1250
1254
  emptyText: "沒有符合的組織",
1251
1255
  inputProps: {
@@ -1256,7 +1260,7 @@ function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1256
1260
  },
1257
1261
  mode: "single",
1258
1262
  name: "membershipOrgUnitFilter",
1259
- onChange: (e) => o(At(e)),
1263
+ onChange: (e) => o(kt(e)),
1260
1264
  options: [...E],
1261
1265
  placeholder: "全部組織",
1262
1266
  size: "sub",
@@ -1264,13 +1268,13 @@ function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1264
1268
  })
1265
1269
  })
1266
1270
  }),
1267
- /* @__PURE__ */ F(v, {
1271
+ /* @__PURE__ */ F(y, {
1268
1272
  span: 2,
1269
- children: /* @__PURE__ */ F(x, {
1273
+ children: /* @__PURE__ */ F(S, {
1270
1274
  fullWidth: !0,
1271
- layout: R.VERTICAL,
1275
+ layout: L.VERTICAL,
1272
1276
  name: "membershipPositionFilter",
1273
- children: /* @__PURE__ */ F(h, {
1277
+ children: /* @__PURE__ */ F(g, {
1274
1278
  disabledOptionsFilter: !0,
1275
1279
  emptyText: "沒有符合的職位",
1276
1280
  inputProps: {
@@ -1281,21 +1285,21 @@ function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1281
1285
  },
1282
1286
  mode: "single",
1283
1287
  name: "membershipPositionFilter",
1284
- onChange: (e) => l(jt(e)),
1288
+ onChange: (e) => l(At(e)),
1285
1289
  options: [...D],
1286
1290
  placeholder: "全部職位",
1287
1291
  size: "sub",
1288
- value: g
1292
+ value: h
1289
1293
  })
1290
1294
  })
1291
1295
  }),
1292
- /* @__PURE__ */ F(v, {
1296
+ /* @__PURE__ */ F(y, {
1293
1297
  span: 2,
1294
- children: /* @__PURE__ */ F(x, {
1298
+ children: /* @__PURE__ */ F(S, {
1295
1299
  fullWidth: !0,
1296
- layout: R.VERTICAL,
1300
+ layout: L.VERTICAL,
1297
1301
  name: "membershipStatusFilter",
1298
- children: /* @__PURE__ */ F(h, {
1302
+ children: /* @__PURE__ */ F(g, {
1299
1303
  disabledOptionsFilter: !0,
1300
1304
  emptyText: "沒有符合的狀態",
1301
1305
  inputProps: {
@@ -1306,8 +1310,8 @@ function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1306
1310
  },
1307
1311
  mode: "single",
1308
1312
  name: "membershipStatusFilter",
1309
- onChange: (e) => a(kt(e)),
1310
- options: [...et],
1313
+ onChange: (e) => i(Ot(e)),
1314
+ options: [...$e],
1311
1315
  placeholder: "全部狀態",
1312
1316
  size: "sub",
1313
1317
  value: C
@@ -1317,27 +1321,27 @@ function ct({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1317
1321
  ] })
1318
1322
  }),
1319
1323
  /* @__PURE__ */ F("div", {
1320
- className: W.tableFrame,
1324
+ className: G.tableFrame,
1321
1325
  children: /* @__PURE__ */ F(j, {
1322
1326
  actions: e,
1323
1327
  columns: T,
1324
- dataSource: [...S],
1328
+ dataSource: [...v],
1325
1329
  fullWidth: !0,
1326
- loading: n,
1327
- pagination: Y({
1330
+ loading: t,
1331
+ pagination: ut({
1328
1332
  onPageChange: s,
1329
1333
  onPageSizeChange: c,
1330
- page: p,
1334
+ page: f,
1331
1335
  pageSize: m,
1332
1336
  total: w
1333
1337
  }),
1334
- style: { minWidth: it }
1338
+ style: { minWidth: rt }
1335
1339
  })
1336
1340
  })
1337
1341
  ] });
1338
1342
  }
1339
- function lt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPageChange: i, onPageSizeChange: a, onScopeTypeFilterChange: o, page: s, pageSize: c, rows: l, scopeTypeFilter: u, statusFilter: d, total: p }) {
1340
- let m = f(() => [
1343
+ function lt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPageChange: i, onPageSizeChange: a, onScopeTypeFilterChange: o, page: s, pageSize: c, rows: l, scopeTypeFilter: u, statusFilter: d, total: f }) {
1344
+ let m = p(() => [
1341
1345
  {
1342
1346
  dataIndex: "scopeLabel",
1343
1347
  key: "scopeLabel",
@@ -1370,42 +1374,42 @@ function lt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
1370
1374
  }
1371
1375
  ], []);
1372
1376
  return /* @__PURE__ */ I(P, { children: [
1373
- /* @__PURE__ */ F(Z, {
1377
+ /* @__PURE__ */ F(X, {
1374
1378
  actionLabel: "新增主管規則",
1375
1379
  description: "簽核主管規則獨立於組織樹 parent,解析優先序為會員、組織、職位。",
1376
1380
  onCreate: n,
1377
1381
  title: "簽核主管"
1378
1382
  }),
1379
- /* @__PURE__ */ F(y, {
1380
- className: W.orgFilterArea,
1383
+ /* @__PURE__ */ F(b, {
1384
+ className: G.orgFilterArea,
1381
1385
  size: "sub",
1382
- children: /* @__PURE__ */ I(b, { children: [/* @__PURE__ */ F(v, {
1386
+ children: /* @__PURE__ */ I(x, { children: [/* @__PURE__ */ F(y, {
1383
1387
  span: 3,
1384
- children: /* @__PURE__ */ F(x, {
1388
+ children: /* @__PURE__ */ F(S, {
1385
1389
  fullWidth: !0,
1386
- layout: R.VERTICAL,
1390
+ layout: L.VERTICAL,
1387
1391
  name: "managerScopeTypeFilter",
1388
1392
  children: /* @__PURE__ */ F(O, {
1389
1393
  clearable: !1,
1390
1394
  fullWidth: !0,
1391
- onChange: (e) => o(Dt(e)),
1392
- options: [...Qe],
1395
+ onChange: (e) => o(Et(e)),
1396
+ options: [...Ze],
1393
1397
  placeholder: "套用範圍",
1394
1398
  size: "sub",
1395
1399
  value: u
1396
1400
  })
1397
1401
  })
1398
- }), /* @__PURE__ */ F(v, {
1402
+ }), /* @__PURE__ */ F(y, {
1399
1403
  span: 2,
1400
- children: /* @__PURE__ */ F(x, {
1404
+ children: /* @__PURE__ */ F(S, {
1401
1405
  fullWidth: !0,
1402
- layout: R.VERTICAL,
1406
+ layout: L.VERTICAL,
1403
1407
  name: "managerStatusFilter",
1404
1408
  children: /* @__PURE__ */ F(O, {
1405
1409
  clearable: !1,
1406
1410
  fullWidth: !0,
1407
- onChange: (e) => r(Ot(e)),
1408
- options: [...et],
1411
+ onChange: (e) => r(Dt(e)),
1412
+ options: [...$e],
1409
1413
  placeholder: "狀態",
1410
1414
  size: "sub",
1411
1415
  value: d
@@ -1414,50 +1418,50 @@ function lt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
1414
1418
  })] })
1415
1419
  }),
1416
1420
  /* @__PURE__ */ F("div", {
1417
- className: W.tableFrame,
1421
+ className: G.tableFrame,
1418
1422
  children: /* @__PURE__ */ F(j, {
1419
1423
  actions: e,
1420
1424
  columns: m,
1421
1425
  dataSource: [...l],
1422
1426
  fullWidth: !0,
1423
1427
  loading: t,
1424
- pagination: Y({
1428
+ pagination: ut({
1425
1429
  onPageChange: i,
1426
1430
  onPageSizeChange: a,
1427
1431
  page: s,
1428
1432
  pageSize: c,
1429
- total: p
1433
+ total: f
1430
1434
  }),
1431
- style: { minWidth: at }
1435
+ style: { minWidth: it }
1432
1436
  })
1433
1437
  })
1434
1438
  ] });
1435
1439
  }
1436
- function Y({ onPageChange: e, onPageSizeChange: t, page: n, pageSize: r, total: i }) {
1440
+ function ut({ onPageChange: e, onPageSizeChange: t, page: n, pageSize: r, total: i }) {
1437
1441
  return {
1438
1442
  current: n,
1439
1443
  onChange: e,
1440
1444
  onChangePageSize: t,
1441
1445
  pageSize: r,
1442
1446
  pageSizeLabel: "每頁筆數",
1443
- pageSizeOptions: [...tt],
1447
+ pageSizeOptions: [...et],
1444
1448
  renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
1445
1449
  showPageSizeOptions: !0,
1446
1450
  total: i
1447
1451
  };
1448
1452
  }
1449
- function ut({ isTreeEditing: e, isTreeMode: t }) {
1453
+ function Y({ isTreeEditing: e, isTreeMode: t }) {
1450
1454
  return t ? e ? "儲存" : "開始編輯" : "新增組織";
1451
1455
  }
1452
1456
  function dt({ isTreeEditing: e, isTreeMode: t }) {
1453
- return t ? e ? ne : te : L;
1457
+ return t ? e ? re : te : ne;
1454
1458
  }
1455
- function X({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
1459
+ function ft({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
1456
1460
  return n ? t ? !e || i : r : !1;
1457
1461
  }
1458
- function Z({ actionDisabled: e = !1, actionIcon: t = L, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
1462
+ function X({ actionDisabled: e = !1, actionIcon: t = ne, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
1459
1463
  return /* @__PURE__ */ I("div", {
1460
- className: W.tableIntro,
1464
+ className: G.tableIntro,
1461
1465
  children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(M, {
1462
1466
  component: "h2",
1463
1467
  variant: "h3",
@@ -1467,8 +1471,8 @@ function Z({ actionDisabled: e = !1, actionIcon: t = L, actionLabel: n, actions:
1467
1471
  variant: "body",
1468
1472
  children: i
1469
1473
  })] }), /* @__PURE__ */ I("div", {
1470
- className: W.tableIntroActions,
1471
- children: [r, /* @__PURE__ */ F(g, {
1474
+ className: G.tableIntroActions,
1475
+ children: [r, /* @__PURE__ */ F(_, {
1472
1476
  disabled: e,
1473
1477
  icon: t,
1474
1478
  iconType: "leading",
@@ -1478,23 +1482,23 @@ function Z({ actionDisabled: e = !1, actionIcon: t = L, actionLabel: n, actions:
1478
1482
  })]
1479
1483
  });
1480
1484
  }
1481
- function ft({ modal: e, onClose: n, onSubmit: i, orgUnits: a, saving: o }) {
1482
- let [c, l] = m(""), [d, f] = m(""), [p, h] = m(null), [g, _] = m(G[2]);
1483
- return u(() => {
1485
+ function pt({ modal: e, onClose: t, onSubmit: r, orgUnits: a, saving: o }) {
1486
+ let [s, l] = h(""), [u, f] = h(""), [p, m] = h(null), [g, _] = h(K[2]);
1487
+ return d(() => {
1484
1488
  if (!e) return;
1485
- let n = e.record, r = n?.parentId ?? e.parentId ?? null, i = r ? a.find((e) => e.id === r) ?? null : null;
1486
- l(n?.code ?? ""), f(n?.name ?? ""), h(i ? t(i) : null), _(G.find((e) => e.id === n?.type) ?? G[2]);
1489
+ let t = e.record, r = t?.parentId ?? e.parentId ?? null, i = r ? a.find((e) => e.id === r) ?? null : null;
1490
+ l(t?.code ?? ""), f(t?.name ?? ""), m(i ? n(i) : null), _(K.find((e) => e.id === t?.type) ?? K[2]);
1487
1491
  }, [e, a]), /* @__PURE__ */ F(w, {
1488
1492
  cancelText: "取消",
1489
- confirmButtonProps: { disabled: !c || !d },
1493
+ confirmButtonProps: { disabled: !s || !u },
1490
1494
  confirmText: e?.type === "EDIT" ? "儲存" : "建立",
1491
1495
  loading: o,
1492
1496
  modalType: "standard",
1493
- onCancel: n,
1494
- onClose: n,
1495
- onConfirm: () => void i({
1496
- code: c,
1497
- name: d,
1497
+ onCancel: t,
1498
+ onClose: t,
1499
+ onConfirm: () => void r({
1500
+ code: s,
1501
+ name: u,
1498
1502
  parentId: p?.id ?? null,
1499
1503
  type: g.id
1500
1504
  }),
@@ -1504,40 +1508,40 @@ function ft({ modal: e, onClose: n, onSubmit: i, orgUnits: a, saving: o }) {
1504
1508
  size: "regular",
1505
1509
  title: e?.type === "EDIT" ? "編輯組織" : "新增組織",
1506
1510
  children: /* @__PURE__ */ I("div", {
1507
- className: W.modalFields,
1511
+ className: G.modalFields,
1508
1512
  children: [
1509
- /* @__PURE__ */ F(Q, {
1513
+ /* @__PURE__ */ F(Z, {
1510
1514
  label: "代碼",
1511
1515
  name: "orgCode",
1512
1516
  onChange: l,
1513
1517
  placeholder: "例如 FIN-TW",
1514
- value: c
1518
+ value: s
1515
1519
  }),
1516
- /* @__PURE__ */ F(Q, {
1520
+ /* @__PURE__ */ F(Z, {
1517
1521
  label: "名稱",
1518
1522
  name: "orgName",
1519
1523
  onChange: f,
1520
1524
  placeholder: "例如 財務部",
1521
- value: d
1525
+ value: u
1522
1526
  }),
1523
- /* @__PURE__ */ F(s, {
1527
+ /* @__PURE__ */ F(c, {
1524
1528
  label: "類型",
1525
1529
  name: "orgType",
1526
1530
  children: /* @__PURE__ */ F(O, {
1527
1531
  clearable: !1,
1528
1532
  fullWidth: !0,
1529
- onChange: (e) => _(wt(e)),
1530
- options: [...G],
1533
+ onChange: (e) => _($(e)),
1534
+ options: [...K],
1531
1535
  placeholder: "選擇組織類型",
1532
1536
  value: g
1533
1537
  })
1534
1538
  }),
1535
- /* @__PURE__ */ F(s, {
1539
+ /* @__PURE__ */ F(c, {
1536
1540
  label: "上層組織",
1537
1541
  name: "parentId",
1538
- children: /* @__PURE__ */ F(r, {
1542
+ children: /* @__PURE__ */ F(i, {
1539
1543
  name: "parentId",
1540
- onChange: h,
1544
+ onChange: m,
1541
1545
  orgUnits: a.filter((t) => t.id !== e?.record?.id),
1542
1546
  placeholder: "選擇上層組織",
1543
1547
  value: p
@@ -1547,9 +1551,9 @@ function ft({ modal: e, onClose: n, onSubmit: i, orgUnits: a, saving: o }) {
1547
1551
  })
1548
1552
  });
1549
1553
  }
1550
- function pt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1551
- let [i, a] = m(""), [o, s] = m("0"), [c, l] = m("");
1552
- return u(() => {
1554
+ function mt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1555
+ let [i, a] = h(""), [o, s] = h("0"), [c, l] = h("");
1556
+ return d(() => {
1553
1557
  e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), l(e.record?.name ?? ""));
1554
1558
  }, [e]), /* @__PURE__ */ F(w, {
1555
1559
  cancelText: "取消",
@@ -1570,23 +1574,23 @@ function pt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1570
1574
  size: "regular",
1571
1575
  title: e?.type === "EDIT" ? "編輯職位" : "新增職位",
1572
1576
  children: /* @__PURE__ */ I("div", {
1573
- className: W.modalFields,
1577
+ className: G.modalFields,
1574
1578
  children: [
1575
- /* @__PURE__ */ F(Q, {
1579
+ /* @__PURE__ */ F(Z, {
1576
1580
  label: "代碼",
1577
1581
  name: "positionCode",
1578
1582
  onChange: a,
1579
1583
  placeholder: "例如 FIN-MGR",
1580
1584
  value: i
1581
1585
  }),
1582
- /* @__PURE__ */ F(Q, {
1586
+ /* @__PURE__ */ F(Z, {
1583
1587
  label: "名稱",
1584
1588
  name: "positionName",
1585
1589
  onChange: l,
1586
1590
  placeholder: "例如 財務主管",
1587
1591
  value: c
1588
1592
  }),
1589
- /* @__PURE__ */ F(Q, {
1593
+ /* @__PURE__ */ F(Z, {
1590
1594
  label: "職等",
1591
1595
  name: "positionLevel",
1592
1596
  onChange: s,
@@ -1597,26 +1601,26 @@ function pt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1597
1601
  })
1598
1602
  });
1599
1603
  }
1600
- function mt({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, positions: p, saving: h }) {
1601
- let [g, _] = m(Ft()), [v, y] = m(""), [b, x] = m(q[1]), [S, C] = m(null), [T, E] = m(null), [D, k] = m(null);
1602
- return u(() => {
1603
- if (!c) return;
1604
- let r = c.record, a = r ? e.get(r.memberId) : null;
1605
- _(r?.effectiveFrom ?? Ft()), y(r?.effectiveTo ?? ""), x(q.find((e) => e.value === r?.isPrimary) ?? q[1]), C(a ? n(a) : null), E(Pt(f.find((e) => e.id === r?.orgUnitId), t)), k(Pt(p.find((e) => e.id === r?.positionId), i));
1604
+ function ht({ membersById: e, modal: t, onClose: l, onSubmit: u, orgUnits: f, positions: p, saving: m }) {
1605
+ let [g, _] = h(Ft()), [v, y] = h(""), [b, x] = h(J[1]), [S, C] = h(null), [T, E] = h(null), [D, k] = h(null);
1606
+ return d(() => {
1607
+ if (!t) return;
1608
+ let i = t.record, o = i ? e.get(i.memberId) : null;
1609
+ _(i?.effectiveFrom ?? Ft()), y(i?.effectiveTo ?? ""), x(J.find((e) => e.value === i?.isPrimary) ?? J[1]), C(o ? r(o) : null), E(Pt(f.find((e) => e.id === i?.orgUnitId), n)), k(Pt(p.find((e) => e.id === i?.positionId), a));
1606
1610
  }, [
1607
1611
  e,
1608
- c,
1612
+ t,
1609
1613
  f,
1610
1614
  p
1611
1615
  ]), /* @__PURE__ */ F(w, {
1612
1616
  cancelText: "取消",
1613
1617
  confirmButtonProps: { disabled: !S || !T },
1614
- confirmText: c?.type === "EDIT" ? "儲存" : "建立",
1615
- loading: h,
1618
+ confirmText: t?.type === "EDIT" ? "儲存" : "建立",
1619
+ loading: m,
1616
1620
  modalType: "standard",
1617
1621
  onCancel: l,
1618
1622
  onClose: l,
1619
- onConfirm: () => void d({
1623
+ onConfirm: () => void u({
1620
1624
  effectiveFrom: g,
1621
1625
  effectiveTo: v || null,
1622
1626
  isPrimary: b.value,
@@ -1624,28 +1628,28 @@ function mt({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1624
1628
  orgUnitId: T?.id ?? null,
1625
1629
  positionId: D?.id ?? null
1626
1630
  }),
1627
- open: !!c,
1631
+ open: !!t,
1628
1632
  showModalFooter: !0,
1629
1633
  showModalHeader: !0,
1630
1634
  size: "regular",
1631
- title: c?.type === "EDIT" ? "編輯會員歸屬" : "新增會員歸屬",
1635
+ title: t?.type === "EDIT" ? "編輯會員歸屬" : "新增會員歸屬",
1632
1636
  children: /* @__PURE__ */ I("div", {
1633
- className: W.modalFields,
1637
+ className: G.modalFields,
1634
1638
  children: [
1635
- /* @__PURE__ */ F(s, {
1639
+ /* @__PURE__ */ F(c, {
1636
1640
  label: "會員",
1637
1641
  name: "memberId",
1638
- children: /* @__PURE__ */ F(o, {
1642
+ children: /* @__PURE__ */ F(s, {
1639
1643
  name: "memberId",
1640
1644
  onChange: C,
1641
1645
  placeholder: "搜尋會員姓名或信箱",
1642
1646
  value: S
1643
1647
  })
1644
1648
  }),
1645
- /* @__PURE__ */ F(s, {
1649
+ /* @__PURE__ */ F(c, {
1646
1650
  label: "組織",
1647
1651
  name: "orgUnitId",
1648
- children: /* @__PURE__ */ F(r, {
1652
+ children: /* @__PURE__ */ F(i, {
1649
1653
  name: "orgUnitId",
1650
1654
  onChange: E,
1651
1655
  orgUnits: f,
@@ -1653,10 +1657,10 @@ function mt({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1653
1657
  value: T
1654
1658
  })
1655
1659
  }),
1656
- /* @__PURE__ */ F(s, {
1660
+ /* @__PURE__ */ F(c, {
1657
1661
  label: "職位",
1658
1662
  name: "positionId",
1659
- children: /* @__PURE__ */ F(a, {
1663
+ children: /* @__PURE__ */ F(o, {
1660
1664
  name: "positionId",
1661
1665
  onChange: k,
1662
1666
  placeholder: "選擇職位",
@@ -1664,26 +1668,26 @@ function mt({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1664
1668
  value: D
1665
1669
  })
1666
1670
  }),
1667
- /* @__PURE__ */ F(s, {
1671
+ /* @__PURE__ */ F(c, {
1668
1672
  label: "歸屬類型",
1669
1673
  name: "isPrimary",
1670
1674
  children: /* @__PURE__ */ F(O, {
1671
1675
  clearable: !1,
1672
1676
  fullWidth: !0,
1673
- onChange: (e) => x(Mt(e)),
1674
- options: [...q],
1677
+ onChange: (e) => x(jt(e)),
1678
+ options: [...J],
1675
1679
  placeholder: "選擇歸屬類型",
1676
1680
  value: b
1677
1681
  })
1678
1682
  }),
1679
- /* @__PURE__ */ F(gt, {
1683
+ /* @__PURE__ */ F(Q, {
1680
1684
  label: "生效日",
1681
1685
  name: "membershipEffectiveFrom",
1682
1686
  onChange: _,
1683
1687
  placeholder: "YYYY-MM-DD",
1684
1688
  value: g
1685
1689
  }),
1686
- /* @__PURE__ */ F(gt, {
1690
+ /* @__PURE__ */ F(Q, {
1687
1691
  label: "結束日",
1688
1692
  name: "membershipEffectiveTo",
1689
1693
  onChange: y,
@@ -1694,15 +1698,15 @@ function mt({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1694
1698
  })
1695
1699
  });
1696
1700
  }
1697
- function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, positions: p, saving: h }) {
1698
- let [g, _] = m(Ft()), [v, y] = m(""), [b, x] = m(null), [S, C] = m("0"), [T, E] = m(null), [D, k] = m(null), [A, j] = m(null), [N, P] = m(K[0]);
1699
- u(() => {
1700
- if (!c) return;
1701
- let r = c.record, a = K.find((e) => e.id === r?.scopeType) ?? K[0];
1702
- _(r?.effectiveFrom ?? Ft()), y(r?.effectiveTo ?? ""), x(Pt(r ? e.get(r.managerMemberId) : null, n)), C(String(r?.priority ?? 0)), E(a.id === "MEMBER" ? Pt(r ? e.get(r.scopeId) : null, n) : null), k(a.id === "ORG_UNIT" ? Pt(f.find((e) => e.id === r?.scopeId), t) : null), j(a.id === "POSITION" ? Pt(p.find((e) => e.id === r?.scopeId), i) : null), P(a);
1701
+ function gt({ membersById: e, modal: t, onClose: l, onSubmit: u, orgUnits: f, positions: p, saving: m }) {
1702
+ let [g, _] = h(Ft()), [v, y] = h(""), [b, x] = h(null), [S, C] = h("0"), [T, E] = h(null), [D, k] = h(null), [A, j] = h(null), [N, P] = h(q[0]);
1703
+ d(() => {
1704
+ if (!t) return;
1705
+ let i = t.record, o = q.find((e) => e.id === i?.scopeType) ?? q[0];
1706
+ _(i?.effectiveFrom ?? Ft()), y(i?.effectiveTo ?? ""), x(Pt(i ? e.get(i.managerMemberId) : null, r)), C(String(i?.priority ?? 0)), E(o.id === "MEMBER" ? Pt(i ? e.get(i.scopeId) : null, r) : null), k(o.id === "ORG_UNIT" ? Pt(f.find((e) => e.id === i?.scopeId), n) : null), j(o.id === "POSITION" ? Pt(p.find((e) => e.id === i?.scopeId), a) : null), P(o);
1703
1707
  }, [
1704
1708
  e,
1705
- c,
1709
+ t,
1706
1710
  f,
1707
1711
  p
1708
1712
  ]);
@@ -1710,12 +1714,12 @@ function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1710
1714
  return /* @__PURE__ */ F(w, {
1711
1715
  cancelText: "取消",
1712
1716
  confirmButtonProps: { disabled: !b || !ee || te },
1713
- confirmText: c?.type === "EDIT" ? "儲存" : "建立",
1714
- loading: h,
1717
+ confirmText: t?.type === "EDIT" ? "儲存" : "建立",
1718
+ loading: m,
1715
1719
  modalType: "standard",
1716
1720
  onCancel: l,
1717
1721
  onClose: l,
1718
- onConfirm: () => void d({
1722
+ onConfirm: () => void u({
1719
1723
  effectiveFrom: g,
1720
1724
  effectiveTo: v || null,
1721
1725
  managerMemberId: b?.id ?? null,
@@ -1723,40 +1727,40 @@ function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1723
1727
  scopeId: ee ?? null,
1724
1728
  scopeType: N.id
1725
1729
  }),
1726
- open: !!c,
1730
+ open: !!t,
1727
1731
  showModalFooter: !0,
1728
1732
  showModalHeader: !0,
1729
1733
  size: "regular",
1730
- title: c?.type === "EDIT" ? "編輯主管規則" : "新增主管規則",
1734
+ title: t?.type === "EDIT" ? "編輯主管規則" : "新增主管規則",
1731
1735
  children: /* @__PURE__ */ I("div", {
1732
- className: W.modalFields,
1736
+ className: G.modalFields,
1733
1737
  children: [
1734
- /* @__PURE__ */ F(s, {
1738
+ /* @__PURE__ */ F(c, {
1735
1739
  label: "套用範圍",
1736
1740
  name: "scopeType",
1737
1741
  children: /* @__PURE__ */ F(O, {
1738
1742
  clearable: !1,
1739
1743
  fullWidth: !0,
1740
- onChange: (e) => P(Et(e)),
1741
- options: [...K],
1744
+ onChange: (e) => P(Tt(e)),
1745
+ options: [...q],
1742
1746
  placeholder: "選擇套用範圍",
1743
1747
  value: N
1744
1748
  })
1745
1749
  }),
1746
- N.id === "MEMBER" ? /* @__PURE__ */ F(s, {
1750
+ N.id === "MEMBER" ? /* @__PURE__ */ F(c, {
1747
1751
  label: "會員",
1748
1752
  name: "scopeMemberId",
1749
- children: /* @__PURE__ */ F(o, {
1753
+ children: /* @__PURE__ */ F(s, {
1750
1754
  name: "scopeMemberId",
1751
1755
  onChange: E,
1752
1756
  placeholder: "搜尋套用會員",
1753
1757
  value: T
1754
1758
  })
1755
1759
  }) : null,
1756
- N.id === "ORG_UNIT" ? /* @__PURE__ */ F(s, {
1760
+ N.id === "ORG_UNIT" ? /* @__PURE__ */ F(c, {
1757
1761
  label: "組織",
1758
1762
  name: "scopeOrgUnitId",
1759
- children: /* @__PURE__ */ F(r, {
1763
+ children: /* @__PURE__ */ F(i, {
1760
1764
  name: "scopeOrgUnitId",
1761
1765
  onChange: k,
1762
1766
  orgUnits: f,
@@ -1764,10 +1768,10 @@ function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1764
1768
  value: D
1765
1769
  })
1766
1770
  }) : null,
1767
- N.id === "POSITION" ? /* @__PURE__ */ F(s, {
1771
+ N.id === "POSITION" ? /* @__PURE__ */ F(c, {
1768
1772
  label: "職位",
1769
1773
  name: "scopePositionId",
1770
- children: /* @__PURE__ */ F(a, {
1774
+ children: /* @__PURE__ */ F(o, {
1771
1775
  name: "scopePositionId",
1772
1776
  onChange: j,
1773
1777
  placeholder: "選擇套用職位",
@@ -1775,10 +1779,10 @@ function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1775
1779
  value: A
1776
1780
  })
1777
1781
  }) : null,
1778
- /* @__PURE__ */ F(s, {
1782
+ /* @__PURE__ */ F(c, {
1779
1783
  label: "簽核主管",
1780
1784
  name: "managerMemberId",
1781
- children: /* @__PURE__ */ F(o, {
1785
+ children: /* @__PURE__ */ F(s, {
1782
1786
  name: "managerMemberId",
1783
1787
  onChange: x,
1784
1788
  placeholder: "搜尋簽核主管",
@@ -1790,21 +1794,21 @@ function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1790
1794
  variant: "caption",
1791
1795
  children: "簽核主管不可設定為套用會員本人。"
1792
1796
  }) : null,
1793
- /* @__PURE__ */ F(Q, {
1797
+ /* @__PURE__ */ F(Z, {
1794
1798
  label: "優先序",
1795
1799
  name: "managerPriority",
1796
1800
  onChange: C,
1797
1801
  placeholder: "例如 10",
1798
1802
  value: S
1799
1803
  }),
1800
- /* @__PURE__ */ F(gt, {
1804
+ /* @__PURE__ */ F(Q, {
1801
1805
  label: "生效日",
1802
1806
  name: "managerEffectiveFrom",
1803
1807
  onChange: _,
1804
1808
  placeholder: "YYYY-MM-DD",
1805
1809
  value: g
1806
1810
  }),
1807
- /* @__PURE__ */ F(gt, {
1811
+ /* @__PURE__ */ F(Q, {
1808
1812
  label: "結束日",
1809
1813
  name: "managerEffectiveTo",
1810
1814
  onChange: y,
@@ -1815,11 +1819,11 @@ function ht({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
1815
1819
  })
1816
1820
  });
1817
1821
  }
1818
- function Q({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
1819
- return /* @__PURE__ */ F(s, {
1822
+ function Z({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
1823
+ return /* @__PURE__ */ F(c, {
1820
1824
  label: e,
1821
1825
  name: t,
1822
- children: /* @__PURE__ */ F(S, {
1826
+ children: /* @__PURE__ */ F(C, {
1823
1827
  fullWidth: !0,
1824
1828
  name: t,
1825
1829
  onChange: (e) => n(e.target.value),
@@ -1828,11 +1832,11 @@ function Q({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
1828
1832
  })
1829
1833
  });
1830
1834
  }
1831
- function gt({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
1832
- return /* @__PURE__ */ F(s, {
1835
+ function Q({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
1836
+ return /* @__PURE__ */ F(c, {
1833
1837
  label: e,
1834
1838
  name: t,
1835
- children: /* @__PURE__ */ F(_, {
1839
+ children: /* @__PURE__ */ F(v, {
1836
1840
  format: "YYYY-MM-DD",
1837
1841
  fullWidth: !0,
1838
1842
  inputProps: { name: t },
@@ -1859,7 +1863,7 @@ function bt(e) {
1859
1863
  return e ? `${e.name} · ${e.code}` : "未知組織";
1860
1864
  }
1861
1865
  function xt(e) {
1862
- return G.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
1866
+ return K.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
1863
1867
  }
1864
1868
  function St(e) {
1865
1869
  return e ? `${e.name} · ${e.code}` : "未指定";
@@ -1867,57 +1871,57 @@ function St(e) {
1867
1871
  function Ct(e) {
1868
1872
  return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
1869
1873
  }
1870
- function wt(e) {
1871
- let t = $(e) ? e : null;
1874
+ function $(e) {
1875
+ let t = Nt(e) ? e : null;
1872
1876
  if (typeof t?.id == "string") {
1873
1877
  let e = t.id;
1874
- return G.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? G[2];
1878
+ return K.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? K[2];
1875
1879
  }
1876
- return G[2];
1880
+ return K[2];
1877
1881
  }
1878
- function Tt(e) {
1879
- let t = $(e) ? e : null;
1882
+ function wt(e) {
1883
+ let t = Nt(e) ? e : null;
1880
1884
  if (typeof t?.id == "string") {
1881
1885
  let e = t.id;
1882
- return Xe.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? Ye;
1886
+ return Ye.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? Je;
1883
1887
  }
1884
- return Ye;
1888
+ return Je;
1889
+ }
1890
+ function Tt(e) {
1891
+ return Mt(e, q, q[0]);
1885
1892
  }
1886
1893
  function Et(e) {
1887
- return Nt(e, K, K[0]);
1894
+ return Mt(e, Ze, Xe);
1888
1895
  }
1889
1896
  function Dt(e) {
1890
- return Nt(e, Qe, Ze);
1897
+ return Mt(e, $e, Qe);
1891
1898
  }
1892
1899
  function Ot(e) {
1893
- return Nt(e, et, $e);
1900
+ let t = Nt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
1901
+ return $e.find((e) => e.id === n) ?? null;
1894
1902
  }
1895
1903
  function kt(e) {
1896
- let t = $(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
1897
- return et.find((e) => e.id === n) ?? null;
1898
- }
1899
- function At(e) {
1900
- let t = $(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
1904
+ let t = Nt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
1901
1905
  return n && r ? {
1902
1906
  id: n,
1903
1907
  name: r
1904
1908
  } : null;
1905
1909
  }
1906
- function jt(e) {
1907
- let t = $(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
1910
+ function At(e) {
1911
+ let t = Nt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
1908
1912
  return n && r ? {
1909
1913
  id: n,
1910
1914
  name: r
1911
1915
  } : null;
1912
1916
  }
1913
- function Mt(e) {
1914
- return Nt(e, q, q[1]);
1917
+ function jt(e) {
1918
+ return Mt(e, J, J[1]);
1915
1919
  }
1916
- function Nt(e, t, n) {
1917
- let r = $(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
1920
+ function Mt(e, t, n) {
1921
+ let r = Nt(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
1918
1922
  return t.find((e) => e.id === i) ?? n;
1919
1923
  }
1920
- function $(e) {
1924
+ function Nt(e) {
1921
1925
  return typeof e == "object" && !!e && !Array.isArray(e);
1922
1926
  }
1923
1927
  function Pt(e, t) {
@@ -1940,6 +1944,6 @@ function zt(e) {
1940
1944
  return e instanceof Error ? e.message : "讀取組織資料失敗。";
1941
1945
  }
1942
1946
  //#endregion
1943
- export { J as t };
1947
+ export { at as t };
1944
1948
 
1945
- //# sourceMappingURL=orgs-c29y74w2.js.map
1949
+ //# sourceMappingURL=orgs-CuHxxd_n.js.map