@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,25 +1,26 @@
1
1
  "use client";
2
2
  import { n as e } from "./auth-provider-Bnox5gsx.js";
3
3
  import { t } from "./format-date-time-CB-LxzqT.js";
4
- import { t as n } from "./app-navigation-uwbNEw9P.js";
5
- import { t as r } from "./bpm-form-field-Cao0rMol.js";
6
- import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
7
- import { AutoComplete as c, Badge as l, Button as ee, DateTimePicker as u, Filter as d, FilterArea as f, FilterLine as te, FormField as ne, Input as re, Modal as ie, PageHeader as ae, Section as oe, SectionGroup as se, Select as ce, Tab as le, TabItem as ue, Table as de, Tooltip as p, Typography as m } from "@mezzanine-ui/react";
4
+ import { t as n } from "./app-navigation-BSkMsEhy.js";
5
+ import { r } from "./routes-config-dxahImVe.js";
6
+ import { t as i } from "./bpm-form-field-Cao0rMol.js";
7
+ import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
8
+ import { AutoComplete as ee, Badge as l, Button as te, DateTimePicker as u, Filter as d, FilterArea as ne, FilterLine as re, FormField as f, Input as ie, Modal as ae, PageHeader as oe, Section as se, SectionGroup as ce, Select as le, Tab as ue, TabItem as de, Table as fe, Tooltip as p, Typography as m } from "@mezzanine-ui/react";
8
9
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
9
- import { createDelegationRule as fe, listDelegationRulesPage as pe, revokeDelegationRule as me, searchMembers as he } from "@rytass/bpm-core-client/workflow";
10
- import { PlusIcon as ge } from "@mezzanine-ui/icons";
11
- import _e from "@mezzanine-ui/react/ContentHeader";
10
+ import { createDelegationRule as pe, listDelegationRulesPage as me, revokeDelegationRule as he, searchMembers as ge } from "@rytass/bpm-core-client/workflow";
11
+ import { PlusIcon as _e } from "@mezzanine-ui/icons";
12
+ import ve from "@mezzanine-ui/react/ContentHeader";
12
13
  import { FormFieldLayout as _ } from "@mezzanine-ui/core/form";
13
- import { listApprovalTemplates as ve } from "@rytass/bpm-core-client/template";
14
+ import { listApprovalTemplates as ye } from "@rytass/bpm-core-client/template";
14
15
  import '../delegations.css';var v = {
15
16
  delegationModalFields: "bpm_delegationModalFields_gUlCQ",
16
17
  delegationFilterArea: "bpm_delegationFilterArea_QDZkw",
17
18
  memberNameWithTooltip: "bpm_memberNameWithTooltip_RggTW"
18
- }, y = _.HORIZONTAL, ye = [
19
+ }, be = _.HORIZONTAL, xe = [
19
20
  10,
20
21
  20,
21
22
  50
22
- ], be = [
23
+ ], Se = [
23
24
  {
24
25
  key: "ALL",
25
26
  label: "全部"
@@ -36,13 +37,13 @@ import '../delegations.css';var v = {
36
37
  key: "EXPIRED",
37
38
  label: "已過期"
38
39
  }
39
- ], b = [{
40
+ ], y = [{
40
41
  id: "ALL",
41
42
  name: "全部簽核"
42
43
  }, {
43
44
  id: "TEMPLATE_LIST",
44
45
  name: "指定模板"
45
- }], x = [
46
+ }], b = [
46
47
  {
47
48
  id: "ALL_SCOPES",
48
49
  name: "全部範圍",
@@ -59,48 +60,48 @@ import '../delegations.css';var v = {
59
60
  scopeType: "TEMPLATE_LIST"
60
61
  }
61
62
  ];
62
- function S({ activeHref: l = "/admin/delegations" } = {}) {
63
- let { member: p } = e(), y = p?.memberId ?? null, [S, w] = s(null), [T, D] = s(""), [k, A] = s(null), [j, N] = s(!0), [P, Ne] = s(!1), [F, Pe] = s([]), [I, Fe] = s(null), [L, Ie] = s(null), [Le, R] = s(!1), [z, Re] = s(null), [ze, Be] = s("100"), [B, V] = s(1), [H, Ve] = s(10), [U, He] = s("ALL"), [Ue, We] = s(0), [Ge, Ke] = s([]), [qe, Je] = s(!1), [W, Ye] = s([]), [G, Xe] = s(x[0]), [Ze, Qe] = s(b[0]), [K, $e] = s(""), [et, q] = s(!1), [tt, J] = s([]), Y = i(async () => {
64
- N(!0), A(null);
63
+ function x({ activeHref: l } = {}) {
64
+ let p = r(), be = l ?? p.adminDelegations(), { member: x } = e(), w = x?.memberId ?? null, [T, E] = c(null), [D, O] = c(""), [k, j] = c(null), [Ie, Le] = c(!0), [M, N] = c(!1), [P, F] = c([]), [I, Re] = c(null), [L, ze] = c(null), [Be, R] = c(!1), [z, Ve] = c(null), [B, He] = c("100"), [V, H] = c(1), [U, Ue] = c(10), [W, We] = c("ALL"), [Ge, Ke] = c(0), [qe, Je] = c([]), [Ye, Xe] = c(!1), [G, Ze] = c([]), [K, Qe] = c(b[0]), [$e, et] = c(y[0]), [q, tt] = c(""), [nt, rt] = c(!1), [it, J] = c([]), Y = a(async () => {
65
+ Le(!0), j(null);
65
66
  try {
66
- let [e, t] = await Promise.all([pe({
67
+ let [e, t] = await Promise.all([me({
67
68
  agentMemberId: L?.id ?? null,
68
69
  includeInactive: !0,
69
- page: B,
70
- pageSize: H,
70
+ page: V,
71
+ pageSize: U,
71
72
  principalMemberId: I?.id ?? null,
72
- scopeType: G.scopeType,
73
- status: U === "ALL" ? null : U
74
- }), he("")]);
75
- Ke(e.rules), We(e.totalCount), Pe(t.map(xe));
73
+ scopeType: K.scopeType,
74
+ status: W === "ALL" ? null : W
75
+ }), ge("")]);
76
+ Je(e.rules), Ke(e.totalCount), F(t.map(C));
76
77
  } catch (e) {
77
- A(M(e));
78
+ j(A(e));
78
79
  } finally {
79
- N(!1);
80
+ Le(!1);
80
81
  }
81
82
  }, [
82
83
  L,
83
84
  I,
84
- B,
85
- H,
85
+ V,
86
86
  U,
87
- G
87
+ W,
88
+ K
88
89
  ]);
89
- a(() => {
90
+ o(() => {
90
91
  Y();
91
92
  }, [Y]);
92
- let X = o(() => new Map(F.map((e) => [e.id, e])), [F]), nt = o(() => Ge.map((e) => ({
93
+ let X = s(() => new Map(P.map((e) => [e.id, e])), [P]), at = s(() => qe.map((e) => ({
93
94
  ...e,
94
95
  agentEmail: X.get(e.agentMemberId)?.email ?? null,
95
96
  agentName: X.get(e.agentMemberId)?.displayName ?? e.agentMemberId,
96
97
  key: e.id,
97
98
  principalEmail: X.get(e.principalMemberId)?.email ?? null,
98
99
  principalName: X.get(e.principalMemberId)?.displayName ?? e.principalMemberId,
99
- scopeLabel: Oe(e)
100
- })), [X, Ge]), Z = b.find((e) => e.id === Ze.id) ?? b[0], rt = o(() => [
100
+ scopeLabel: Ae(e)
101
+ })), [X, qe]), Z = y.find((e) => e.id === $e.id) ?? y[0], ot = s(() => [
101
102
  {
102
103
  key: "principal",
103
- render: (e) => /* @__PURE__ */ h(Se, {
104
+ render: (e) => /* @__PURE__ */ h(Ce, {
104
105
  email: e.principalEmail,
105
106
  name: e.principalName
106
107
  }),
@@ -109,7 +110,7 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
109
110
  },
110
111
  {
111
112
  key: "agent",
112
- render: (e) => /* @__PURE__ */ h(Se, {
113
+ render: (e) => /* @__PURE__ */ h(Ce, {
113
114
  email: e.agentEmail,
114
115
  name: e.agentName
115
116
  }),
@@ -124,7 +125,7 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
124
125
  },
125
126
  {
126
127
  key: "status",
127
- render: (e) => /* @__PURE__ */ h(ke, { status: e.status }),
128
+ render: (e) => /* @__PURE__ */ h(je, { status: e.status }),
128
129
  title: "狀態",
129
130
  width: 120
130
131
  },
@@ -154,117 +155,117 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
154
155
  title: "結束時間",
155
156
  width: 220
156
157
  }
157
- ], []), it = i(async (e) => {
158
- if (y) {
159
- A(null);
158
+ ], []), st = a(async (e) => {
159
+ if (w) {
160
+ j(null);
160
161
  try {
161
- await me({
162
+ await he({
162
163
  id: e,
163
- revokedByMemberId: y
164
+ revokedByMemberId: w
164
165
  }), await Y();
165
166
  } catch (e) {
166
- A(M(e));
167
+ j(A(e));
167
168
  }
168
169
  }
169
- }, [y, Y]), at = o(() => ({
170
+ }, [w, Y]), ct = s(() => ({
170
171
  render: (e) => e.status === "ACTIVE" ? [{
171
172
  name: "撤銷",
172
- onClick: () => void it(e.id)
173
+ onClick: () => void st(e.id)
173
174
  }] : [],
174
175
  variant: "destructive-secondary",
175
176
  width: 88
176
- }), [it]);
177
+ }), [st]);
177
178
  async function Q(e) {
178
- Ne(!0);
179
+ N(!0);
179
180
  try {
180
- Pe((await he(e)).map(xe));
181
+ F((await ge(e)).map(C));
181
182
  } catch (e) {
182
- A(M(e));
183
+ j(A(e));
183
184
  } finally {
184
- Ne(!1);
185
+ N(!1);
185
186
  }
186
187
  }
187
- async function $(e, t = W) {
188
- q(!0);
188
+ async function $(e, t = G) {
189
+ rt(!0);
189
190
  try {
190
- J(E(t, Te((await ve()).map(Ce), e)));
191
+ J(De(t, Ee((await ye()).map(we), e)));
191
192
  } catch (e) {
192
- A(M(e));
193
+ j(A(e));
193
194
  } finally {
194
- q(!1);
195
+ rt(!1);
195
196
  }
196
197
  }
197
- function ot() {
198
- w(null), D(""), Re(null), Be("100"), Ye([]), Qe(b[0]), $e(""), J([]), $("", []), R(!0);
198
+ function lt() {
199
+ E(null), O(""), Ve(null), He("100"), Ze([]), et(y[0]), tt(""), J([]), $("", []), R(!0);
199
200
  }
200
- function st() {
201
- qe || R(!1);
201
+ function ut() {
202
+ Ye || R(!1);
202
203
  }
203
- async function ct() {
204
- if (y) {
205
- if (!z || !S) {
206
- A("請選擇原簽核人與代理人");
204
+ async function dt() {
205
+ if (w) {
206
+ if (!z || !T) {
207
+ j("請選擇原簽核人與代理人");
207
208
  return;
208
209
  }
209
- if (Z.id === "TEMPLATE_LIST" && W.length < 1) {
210
- A("請選擇至少一個簽核模板");
210
+ if (Z.id === "TEMPLATE_LIST" && G.length < 1) {
211
+ j("請選擇至少一個簽核模板");
211
212
  return;
212
213
  }
213
- if (Me(K, T)) {
214
- A("結束時間必須晚於起始時間");
214
+ if (Fe(q, D)) {
215
+ j("結束時間必須晚於起始時間");
215
216
  return;
216
217
  }
217
- Je(!0), A(null);
218
+ Xe(!0), j(null);
218
219
  try {
219
- await fe({
220
- agentMemberId: S.id,
221
- createdByMemberId: y,
222
- endAt: T || null,
220
+ await pe({
221
+ agentMemberId: T.id,
222
+ createdByMemberId: w,
223
+ endAt: D || null,
223
224
  principalMemberId: z.id,
224
- priority: Number(ze) || 100,
225
+ priority: Number(B) || 100,
225
226
  requiresConfirmation: !1,
226
227
  scopeConditionCel: null,
227
- scopeTemplateIds: Z.id === "TEMPLATE_LIST" ? W.map((e) => e.id) : [],
228
+ scopeTemplateIds: Z.id === "TEMPLATE_LIST" ? G.map((e) => e.id) : [],
228
229
  scopeType: Z.id,
229
- startAt: K || null
230
- }), R(!1), B === 1 ? await Y() : V(1);
230
+ startAt: q || null
231
+ }), R(!1), V === 1 ? await Y() : H(1);
231
232
  } catch (e) {
232
- A(M(e));
233
+ j(A(e));
233
234
  } finally {
234
- Je(!1);
235
+ Xe(!1);
235
236
  }
236
237
  }
237
238
  }
238
239
  return /* @__PURE__ */ g(n, {
239
- activeHref: l,
240
+ activeHref: be,
240
241
  children: [
241
- /* @__PURE__ */ h(ae, { children: /* @__PURE__ */ h(_e, {
242
+ /* @__PURE__ */ h(oe, { children: /* @__PURE__ */ h(ve, {
242
243
  description: "設定簽核代理規則,讓符合範圍的待簽任務自動改派給代理人。",
243
244
  title: "代理設定",
244
- children: /* @__PURE__ */ h(ee, {
245
- icon: ge,
245
+ children: /* @__PURE__ */ h(te, {
246
+ icon: _e,
246
247
  iconType: "leading",
247
- onClick: ot,
248
+ onClick: lt,
248
249
  variant: "base-primary",
249
250
  children: "建立代理"
250
251
  })
251
252
  }) }),
252
- /* @__PURE__ */ h(se, { children: /* @__PURE__ */ g(oe, {
253
- filterArea: /* @__PURE__ */ h(f, {
253
+ /* @__PURE__ */ h(ce, { children: /* @__PURE__ */ g(se, {
254
+ filterArea: /* @__PURE__ */ h(ne, {
254
255
  className: v.delegationFilterArea,
255
- children: /* @__PURE__ */ g(te, { children: [
256
+ children: /* @__PURE__ */ g(re, { children: [
256
257
  /* @__PURE__ */ h(d, {
257
258
  span: 2,
258
- children: /* @__PURE__ */ h(C, {
259
+ children: /* @__PURE__ */ h(S, {
259
260
  hideLabel: !0,
260
261
  label: "原簽核人",
261
- loading: P,
262
+ loading: M,
262
263
  name: "principalFilterMemberId",
263
264
  onChange: (e) => {
264
- Fe(e), V(1);
265
+ Re(e), H(1);
265
266
  },
266
267
  onSearch: Q,
267
- options: F,
268
+ options: P,
268
269
  required: !1,
269
270
  layout: _.VERTICAL,
270
271
  size: "sub",
@@ -273,16 +274,16 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
273
274
  }),
274
275
  /* @__PURE__ */ h(d, {
275
276
  span: 2,
276
- children: /* @__PURE__ */ h(C, {
277
+ children: /* @__PURE__ */ h(S, {
277
278
  hideLabel: !0,
278
279
  label: "代理人",
279
- loading: P,
280
+ loading: M,
280
281
  name: "agentFilterMemberId",
281
282
  onChange: (e) => {
282
- Ie(e), V(1);
283
+ ze(e), H(1);
283
284
  },
284
285
  onSearch: Q,
285
- options: F,
286
+ options: P,
286
287
  required: !1,
287
288
  layout: _.VERTICAL,
288
289
  size: "sub",
@@ -291,69 +292,69 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
291
292
  }),
292
293
  /* @__PURE__ */ h(d, {
293
294
  span: 2,
294
- children: /* @__PURE__ */ h(ne, {
295
+ children: /* @__PURE__ */ h(f, {
295
296
  fullWidth: !0,
296
297
  layout: _.VERTICAL,
297
298
  name: "scopeFilterType",
298
- children: /* @__PURE__ */ h(ce, {
299
+ children: /* @__PURE__ */ h(le, {
299
300
  clearable: !1,
300
301
  fullWidth: !0,
301
302
  onChange: (e) => {
302
- Xe(De(e)), V(1);
303
+ Qe(ke(e)), H(1);
303
304
  },
304
- options: [...x],
305
+ options: [...b],
305
306
  placeholder: "代理範圍",
306
307
  size: "sub",
307
- value: G
308
+ value: K
308
309
  })
309
310
  })
310
311
  })
311
312
  ] })
312
313
  }),
313
- tab: /* @__PURE__ */ h(le, {
314
- activeKey: U,
314
+ tab: /* @__PURE__ */ h(ue, {
315
+ activeKey: W,
315
316
  onChange: (e) => {
316
- He(Ae(e)), V(1);
317
+ We(Me(e)), H(1);
317
318
  },
318
- children: be.map((e) => /* @__PURE__ */ h(ue, { children: e.label }, e.key))
319
+ children: Se.map((e) => /* @__PURE__ */ h(de, { children: e.label }, e.key))
319
320
  }),
320
321
  children: [k ? /* @__PURE__ */ h(m, {
321
322
  color: "text-error",
322
323
  variant: "body",
323
324
  children: k
324
- }) : null, /* @__PURE__ */ h(de, {
325
- actions: at,
326
- columns: rt,
327
- dataSource: nt,
325
+ }) : null, /* @__PURE__ */ h(fe, {
326
+ actions: ct,
327
+ columns: ot,
328
+ dataSource: at,
328
329
  fullWidth: !0,
329
- loading: j,
330
+ loading: Ie,
330
331
  pagination: {
331
- current: B,
332
+ current: V,
332
333
  onChange: (e) => {
333
- V(e);
334
+ H(e);
334
335
  },
335
336
  onChangePageSize: (e) => {
336
- V(1), Ve(e);
337
+ H(1), Ue(e);
337
338
  },
338
- pageSize: H,
339
+ pageSize: U,
339
340
  pageSizeLabel: "每頁筆數",
340
- pageSizeOptions: ye,
341
+ pageSizeOptions: xe,
341
342
  renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
342
343
  showPageSizeOptions: !0,
343
- total: Ue
344
+ total: Ge
344
345
  }
345
346
  })]
346
347
  }) }),
347
- /* @__PURE__ */ h(ie, {
348
+ /* @__PURE__ */ h(ae, {
348
349
  cancelText: "取消",
349
- confirmButtonProps: { disabled: !z || !S },
350
+ confirmButtonProps: { disabled: !z || !T },
350
351
  confirmText: "建立代理",
351
- loading: qe,
352
+ loading: Ye,
352
353
  modalType: "standard",
353
- onCancel: st,
354
- onClose: st,
355
- onConfirm: () => void ct(),
356
- open: Le,
354
+ onCancel: ut,
355
+ onClose: ut,
356
+ onConfirm: () => void dt(),
357
+ open: Be,
357
358
  showModalFooter: !0,
358
359
  showModalHeader: !0,
359
360
  size: "regular",
@@ -362,41 +363,41 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
362
363
  children: /* @__PURE__ */ g("div", {
363
364
  className: v.delegationModalFields,
364
365
  children: [
365
- /* @__PURE__ */ h(C, {
366
+ /* @__PURE__ */ h(S, {
366
367
  label: "原簽核人",
367
- loading: P,
368
+ loading: M,
368
369
  name: "principalMemberId",
369
- onChange: Re,
370
+ onChange: Ve,
370
371
  onSearch: Q,
371
- options: F,
372
+ options: P,
372
373
  value: z
373
374
  }),
374
- /* @__PURE__ */ h(C, {
375
+ /* @__PURE__ */ h(S, {
375
376
  label: "代理人",
376
- loading: P,
377
+ loading: M,
377
378
  name: "agentMemberId",
378
- onChange: w,
379
+ onChange: E,
379
380
  onSearch: Q,
380
- options: F,
381
- value: S
381
+ options: P,
382
+ value: T
382
383
  }),
383
- /* @__PURE__ */ h(r, {
384
+ /* @__PURE__ */ h(i, {
384
385
  label: "代理範圍",
385
386
  name: "scopeType",
386
387
  required: !0,
387
- children: /* @__PURE__ */ h(ce, {
388
+ children: /* @__PURE__ */ h(le, {
388
389
  clearable: !1,
389
390
  fullWidth: !0,
390
- onChange: (e) => Qe(Ee(e)),
391
- options: [...b],
391
+ onChange: (e) => et(Oe(e)),
392
+ options: [...y],
392
393
  value: Z
393
394
  })
394
395
  }),
395
- Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */ h(r, {
396
+ Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */ h(i, {
396
397
  label: "簽核模板",
397
398
  name: "scopeTemplateIds",
398
399
  required: !0,
399
- children: /* @__PURE__ */ h(c, {
400
+ children: /* @__PURE__ */ h(ee, {
400
401
  asyncData: !0,
401
402
  disabledOptionsFilter: !0,
402
403
  emptyText: "沒有符合的模板",
@@ -406,35 +407,35 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
406
407
  name: "scopeTemplateIds",
407
408
  spellCheck: !1
408
409
  },
409
- loading: et,
410
+ loading: nt,
410
411
  loadingText: "搜尋模板中...",
411
412
  mode: "multiple",
412
413
  onChange: (e) => {
413
- let t = we(e);
414
- Ye(t), J((e) => E(t, e));
414
+ let t = Te(e);
415
+ Ze(t), J((e) => De(t, e));
415
416
  },
416
417
  onSearch: $,
417
418
  onVisibilityChange: (e) => {
418
419
  e && $("");
419
420
  },
420
- options: [...tt],
421
+ options: [...it],
421
422
  overflowStrategy: "wrap",
422
423
  placeholder: "搜尋並選取簽核模板",
423
424
  searchDebounceTime: 300,
424
- value: [...W]
425
+ value: [...G]
425
426
  })
426
427
  }) : null,
427
- /* @__PURE__ */ h(r, {
428
+ /* @__PURE__ */ h(i, {
428
429
  label: "優先序",
429
430
  name: "priority",
430
- children: /* @__PURE__ */ h(re, {
431
+ children: /* @__PURE__ */ h(ie, {
431
432
  fullWidth: !0,
432
- onChange: (e) => Be(e.target.value),
433
- value: ze,
433
+ onChange: (e) => He(e.target.value),
434
+ value: B,
434
435
  variant: "base"
435
436
  })
436
437
  }),
437
- /* @__PURE__ */ h(r, {
438
+ /* @__PURE__ */ h(i, {
438
439
  label: "起始時間",
439
440
  name: "startAt",
440
441
  children: /* @__PURE__ */ h(u, {
@@ -442,13 +443,13 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
442
443
  formatTime: "HH:mm",
443
444
  fullWidth: !0,
444
445
  hideSecond: !0,
445
- onChange: (e) => $e(je(e)),
446
+ onChange: (e) => tt(Pe(e)),
446
447
  placeholderLeft: "留空立即生效",
447
448
  placeholderRight: "選擇時間",
448
- value: O(K)
449
+ value: Ne(q)
449
450
  })
450
451
  }),
451
- /* @__PURE__ */ h(r, {
452
+ /* @__PURE__ */ h(i, {
452
453
  label: "結束時間",
453
454
  name: "endAt",
454
455
  children: /* @__PURE__ */ h(u, {
@@ -456,10 +457,10 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
456
457
  formatTime: "HH:mm",
457
458
  fullWidth: !0,
458
459
  hideSecond: !0,
459
- onChange: (e) => D(je(e)),
460
+ onChange: (e) => O(Pe(e)),
460
461
  placeholderLeft: "可留空",
461
462
  placeholderRight: "選擇時間",
462
- value: O(T)
463
+ value: Ne(D)
463
464
  })
464
465
  })
465
466
  ]
@@ -468,8 +469,8 @@ function S({ activeHref: l = "/admin/delegations" } = {}) {
468
469
  ]
469
470
  });
470
471
  }
471
- function C({ hideLabel: e = !1, label: t, layout: n = y, loading: i, name: a, onChange: o, onSearch: s, options: l, required: ee = !0, size: u, value: d }) {
472
- let f = /* @__PURE__ */ h(c, {
472
+ function S({ hideLabel: e = !1, label: t, layout: n = be, loading: r, name: a, onChange: o, onSearch: s, options: c, required: l = !0, size: te, value: u }) {
473
+ let d = /* @__PURE__ */ h(ee, {
473
474
  asyncData: !0,
474
475
  disabledOptionsFilter: !0,
475
476
  emptyText: "沒有符合的成員",
@@ -479,35 +480,35 @@ function C({ hideLabel: e = !1, label: t, layout: n = y, loading: i, name: a, on
479
480
  name: a,
480
481
  spellCheck: !1
481
482
  },
482
- loading: i,
483
+ loading: r,
483
484
  loadingText: "搜尋成員中...",
484
485
  mode: "single",
485
486
  onChange: (e) => o(w(e)),
486
487
  onSearch: s,
487
- onSearchTextChange: (e) => o(T(e, l)),
488
+ onSearchTextChange: (e) => o(T(e, c)),
488
489
  onVisibilityChange: (e) => {
489
490
  e && s("");
490
491
  },
491
- options: [...l],
492
+ options: [...c],
492
493
  placeholder: e ? t : "搜尋姓名或信箱",
493
494
  searchDebounceTime: 300,
494
- size: u,
495
- value: d
495
+ size: te,
496
+ value: u
496
497
  });
497
- return e ? /* @__PURE__ */ h(ne, {
498
+ return e ? /* @__PURE__ */ h(f, {
498
499
  fullWidth: !0,
499
500
  layout: n,
500
501
  name: a,
501
- children: f
502
- }) : /* @__PURE__ */ h(r, {
502
+ children: d
503
+ }) : /* @__PURE__ */ h(i, {
503
504
  label: t,
504
505
  layout: n,
505
506
  name: a,
506
- required: ee,
507
- children: f
507
+ required: l,
508
+ children: d
508
509
  });
509
510
  }
510
- function xe(e) {
511
+ function C(e) {
511
512
  return {
512
513
  displayName: e.name,
513
514
  email: e.email,
@@ -516,7 +517,7 @@ function xe(e) {
516
517
  };
517
518
  }
518
519
  function w(e) {
519
- if (!N(e)) return null;
520
+ if (!j(e)) return null;
520
521
  let t = e.id, n = e.name, r = e.email, i = e.displayName;
521
522
  return typeof t == "string" && typeof n == "string" ? {
522
523
  displayName: typeof i == "string" ? i : n,
@@ -525,7 +526,7 @@ function w(e) {
525
526
  name: n
526
527
  } : null;
527
528
  }
528
- function Se({ email: e, name: t }) {
529
+ function Ce({ email: e, name: t }) {
529
530
  return e ? /* @__PURE__ */ h(p, {
530
531
  title: e,
531
532
  children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */ h("span", {
@@ -547,15 +548,15 @@ function T(e, t) {
547
548
  ].some((e) => e.toLocaleLowerCase().includes(n)));
548
549
  return r.length === 1 ? r[0] ?? null : null;
549
550
  }
550
- function Ce(e) {
551
+ function we(e) {
551
552
  return {
552
553
  id: e.id,
553
554
  name: e.name
554
555
  };
555
556
  }
556
- function we(e) {
557
+ function Te(e) {
557
558
  return e.flatMap((e) => {
558
- if (!N(e)) return [];
559
+ if (!j(e)) return [];
559
560
  let t = e.id, n = e.name;
560
561
  return typeof t == "string" && typeof n == "string" ? [{
561
562
  id: t,
@@ -563,28 +564,28 @@ function we(e) {
563
564
  }] : [];
564
565
  });
565
566
  }
566
- function Te(e, t) {
567
+ function Ee(e, t) {
567
568
  let n = t.trim().toLocaleLowerCase();
568
569
  return n ? e.filter((e) => [e.id, e.name].some((e) => e.toLocaleLowerCase().includes(n))) : e;
569
570
  }
570
- function E(e, t) {
571
+ function De(e, t) {
571
572
  return [...e, ...t].reduce((e, t) => e.some((e) => e.id === t.id) ? e : [...e, t], []);
572
573
  }
573
- function Ee(e) {
574
- return !N(e) || !D(e.id) ? b[0] : b.find((t) => t.id === e.id) ?? b[0];
574
+ function Oe(e) {
575
+ return !j(e) || !E(e.id) ? y[0] : y.find((t) => t.id === e.id) ?? y[0];
575
576
  }
576
- function De(e) {
577
- if (!N(e)) return x[0];
577
+ function ke(e) {
578
+ if (!j(e)) return b[0];
578
579
  let t = e.id;
579
- return x.find((e) => e.id === t) ?? x[0];
580
+ return b.find((e) => e.id === t) ?? b[0];
580
581
  }
581
- function D(e) {
582
+ function E(e) {
582
583
  return e === "ALL" || e === "TEMPLATE_LIST";
583
584
  }
584
- function Oe(e) {
585
+ function Ae(e) {
585
586
  return e.scopeType === "ALL" ? "全部簽核" : e.scopeType === "TEMPLATE_LIST" ? `指定模板:${e.scopeTemplateIds.length}` : e.scopeConditionCel ? `條件:${e.scopeConditionCel}` : "條件式";
586
587
  }
587
- function ke({ status: e }) {
588
+ function je({ status: e }) {
588
589
  return e === "ACTIVE" ? /* @__PURE__ */ h(l, {
589
590
  size: "sub",
590
591
  text: "啟用中",
@@ -603,23 +604,23 @@ function ke({ status: e }) {
603
604
  variant: "dot-info"
604
605
  });
605
606
  }
606
- function Ae(e) {
607
+ function Me(e) {
607
608
  return e === "ACTIVE" || e === "REVOKED" || e === "EXPIRED" ? e : "ALL";
608
609
  }
609
- function O(e) {
610
- let t = e ? k(e) : null;
611
- return t ? `${A(t)}T${j(t.getHours())}:${j(t.getMinutes())}` : void 0;
610
+ function Ne(e) {
611
+ let t = e ? D(e) : null;
612
+ return t ? `${O(t)}T${k(t.getHours())}:${k(t.getMinutes())}` : void 0;
612
613
  }
613
- function je(e) {
614
- let t = e ? k(e) : null;
614
+ function Pe(e) {
615
+ let t = e ? D(e) : null;
615
616
  return t ? t.toISOString() : "";
616
617
  }
617
- function Me(e, t) {
618
+ function Fe(e, t) {
618
619
  if (!e || !t) return !1;
619
- let n = k(e), r = k(t);
620
+ let n = D(e), r = D(t);
620
621
  return !!n && !!r && r.getTime() <= n.getTime();
621
622
  }
622
- function k(e) {
623
+ function D(e) {
623
624
  if (e.endsWith("Z") || /[+-]\d{2}:\d{2}$/.test(e)) {
624
625
  let t = new Date(e);
625
626
  return Number.isNaN(t.getTime()) ? null : t;
@@ -627,19 +628,19 @@ function k(e) {
627
628
  let [t = "", n = "00:00"] = e.split("T"), [r = 0, i = 1, a = 1] = t.split("-").map(Number), [o = 0, s = 0] = n.split(":").map(Number), c = new Date(r, i - 1, a, o, s);
628
629
  return Number.isNaN(c.getTime()) ? null : c;
629
630
  }
630
- function A(e) {
631
- return `${e.getFullYear()}-${j(e.getMonth() + 1)}-${j(e.getDate())}`;
631
+ function O(e) {
632
+ return `${e.getFullYear()}-${k(e.getMonth() + 1)}-${k(e.getDate())}`;
632
633
  }
633
- function j(e) {
634
+ function k(e) {
634
635
  return String(e).padStart(2, "0");
635
636
  }
636
- function M(e) {
637
+ function A(e) {
637
638
  return e instanceof Error ? e.message : "發生未知錯誤";
638
639
  }
639
- function N(e) {
640
+ function j(e) {
640
641
  return typeof e == "object" && !!e;
641
642
  }
642
643
  //#endregion
643
- export { S as t };
644
+ export { x as t };
644
645
 
645
- //# sourceMappingURL=delegations-C5PzZ5Kn.js.map
646
+ //# sourceMappingURL=delegations-B2j-wNEO.js.map