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