@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.
- package/CHANGELOG.md +131 -0
- package/dist/chunks/app-navigation-BSkMsEhy.js +268 -0
- package/dist/chunks/app-navigation-BSkMsEhy.js.map +1 -0
- package/dist/chunks/app-navigation-KnlJCUp1.cjs +2 -0
- package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +1 -0
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +2 -0
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +1 -0
- package/dist/chunks/{approval-instance-list-page-nmzMrj0b.js → approval-instance-list-page-CqNdoZqx.js} +73 -72
- package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +1 -0
- package/dist/chunks/builder-CMlJfQHE.cjs +3 -0
- package/dist/chunks/builder-CMlJfQHE.cjs.map +1 -0
- package/dist/chunks/{builder-DqZskyXC.js → builder-D950gct_.js} +492 -491
- package/dist/chunks/builder-D950gct_.js.map +1 -0
- package/dist/chunks/categories-5yEM3p3N.cjs +2 -0
- package/dist/chunks/categories-5yEM3p3N.cjs.map +1 -0
- package/dist/chunks/{categories-DTEl182t.js → categories-BIpOG451.js} +115 -114
- package/dist/chunks/categories-BIpOG451.js.map +1 -0
- package/dist/chunks/dashboard-page-1K_jQXQk.cjs +2 -0
- package/dist/chunks/dashboard-page-1K_jQXQk.cjs.map +1 -0
- package/dist/chunks/dashboard-page-R_T2OEiE.js +122 -0
- package/dist/chunks/dashboard-page-R_T2OEiE.js.map +1 -0
- package/dist/chunks/{delegations-C5PzZ5Kn.js → delegations-B2j-wNEO.js} +193 -192
- package/dist/chunks/delegations-B2j-wNEO.js.map +1 -0
- package/dist/chunks/delegations-CsB9ozLu.cjs +2 -0
- package/dist/chunks/delegations-CsB9ozLu.cjs.map +1 -0
- package/dist/chunks/delegations-CvtwTXNP.cjs +2 -0
- package/dist/chunks/delegations-CvtwTXNP.cjs.map +1 -0
- package/dist/chunks/{delegations-C-ZrwzvU.js → delegations-dKodb0WW.js} +175 -174
- package/dist/chunks/delegations-dKodb0WW.js.map +1 -0
- package/dist/chunks/{detail-CfFyU5zC.js → detail-BcGAqJ_R.js} +465 -464
- package/dist/chunks/detail-BcGAqJ_R.js.map +1 -0
- package/dist/chunks/detail-CqjqLd65.cjs +2 -0
- package/dist/chunks/detail-CqjqLd65.cjs.map +1 -0
- package/dist/chunks/{format-date-time-isOa3e9q.cjs → format-date-time-26_pFvv4.cjs} +2 -2
- package/dist/chunks/{format-date-time-isOa3e9q.cjs.map → format-date-time-26_pFvv4.cjs.map} +1 -1
- package/dist/chunks/notifications-2swRqDPF.js +198 -0
- package/dist/chunks/notifications-2swRqDPF.js.map +1 -0
- package/dist/chunks/notifications-BaYDebFt.cjs +2 -0
- package/dist/chunks/notifications-BaYDebFt.cjs.map +1 -0
- package/dist/chunks/{orgs-xrdhb3hS.js → orgs-CuHxxd_n.js} +608 -607
- package/dist/chunks/orgs-CuHxxd_n.js.map +1 -0
- package/dist/chunks/orgs-YMiVLNvL.cjs +2 -0
- package/dist/chunks/orgs-YMiVLNvL.cjs.map +1 -0
- package/dist/chunks/routes-config-2aKbWq2H.cjs +2 -0
- package/dist/chunks/routes-config-2aKbWq2H.cjs.map +1 -0
- package/dist/chunks/routes-config-dxahImVe.js +43 -0
- package/dist/chunks/routes-config-dxahImVe.js.map +1 -0
- package/dist/chunks/templates-DTkbSgFY.cjs +2 -0
- package/dist/chunks/templates-DTkbSgFY.cjs.map +1 -0
- package/dist/chunks/templates-DoDWM68t.js +384 -0
- package/dist/chunks/templates-DoDWM68t.js.map +1 -0
- package/dist/chunks/users-3ySyUW4u.cjs +2 -0
- package/dist/chunks/users-3ySyUW4u.cjs.map +1 -0
- package/dist/chunks/{users-CY4-NK3j.js → users-sMfrSjRQ.js} +75 -74
- package/dist/chunks/users-sMfrSjRQ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +101 -99
- package/dist/index.js.map +1 -1
- package/dist/lib/routes-config.d.ts +96 -0
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.ts +1 -0
- package/dist/next/index.js +22 -21
- package/dist/next/index.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/forms/builder/index.cjs +1 -1
- package/dist/pages/forms/builder/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/index.js +1 -1
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/index.cjs +1 -1
- package/dist/pages/templates/index.js +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +3 -3
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/index.cjs +1 -1
- package/dist/views/forms/index.cjs.map +1 -1
- package/dist/views/forms/index.js +78 -77
- package/dist/views/forms/index.js.map +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +106 -105
- package/dist/views/inbox/index.js.map +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +90 -89
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/search/index.cjs +1 -1
- package/dist/views/search/index.js +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.js +1 -1
- package/dist/views/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/index.js +1 -1
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.js +1 -1
- package/dist/views/templates/designer/index.cjs +6 -6
- package/dist/views/templates/designer/index.cjs.map +1 -1
- package/dist/views/templates/designer/index.js +589 -588
- package/dist/views/templates/designer/index.js.map +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.js +2 -2
- package/dist/views/templates/versions/index.cjs +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js +44 -43
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/app-navigation-C_mbz7jx.cjs +0 -2
- package/dist/chunks/app-navigation-C_mbz7jx.cjs.map +0 -1
- package/dist/chunks/app-navigation-uwbNEw9P.js +0 -262
- package/dist/chunks/app-navigation-uwbNEw9P.js.map +0 -1
- package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs +0 -2
- package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-nmzMrj0b.js.map +0 -1
- package/dist/chunks/builder-DPhAH381.cjs +0 -3
- package/dist/chunks/builder-DPhAH381.cjs.map +0 -1
- package/dist/chunks/builder-DqZskyXC.js.map +0 -1
- package/dist/chunks/categories-DEijUOnw.cjs +0 -2
- package/dist/chunks/categories-DEijUOnw.cjs.map +0 -1
- package/dist/chunks/categories-DTEl182t.js.map +0 -1
- package/dist/chunks/dashboard-page-DCmuB0Rw.cjs +0 -2
- package/dist/chunks/dashboard-page-DCmuB0Rw.cjs.map +0 -1
- package/dist/chunks/dashboard-page-Dx5PeEeN.js +0 -117
- package/dist/chunks/dashboard-page-Dx5PeEeN.js.map +0 -1
- package/dist/chunks/delegations-C-ZrwzvU.js.map +0 -1
- package/dist/chunks/delegations-C5PzZ5Kn.js.map +0 -1
- package/dist/chunks/delegations-DOGDvybX.cjs +0 -2
- package/dist/chunks/delegations-DOGDvybX.cjs.map +0 -1
- package/dist/chunks/delegations-DkDBWOQ7.cjs +0 -2
- package/dist/chunks/delegations-DkDBWOQ7.cjs.map +0 -1
- package/dist/chunks/detail-B2gcOPkd.cjs +0 -2
- package/dist/chunks/detail-B2gcOPkd.cjs.map +0 -1
- package/dist/chunks/detail-CfFyU5zC.js.map +0 -1
- package/dist/chunks/notifications-CPQ-nVar.cjs +0 -2
- package/dist/chunks/notifications-CPQ-nVar.cjs.map +0 -1
- package/dist/chunks/notifications-DweexUVy.js +0 -197
- package/dist/chunks/notifications-DweexUVy.js.map +0 -1
- package/dist/chunks/orgs-DgZ0DQ3-.cjs +0 -2
- package/dist/chunks/orgs-DgZ0DQ3-.cjs.map +0 -1
- package/dist/chunks/orgs-xrdhb3hS.js.map +0 -1
- package/dist/chunks/templates-PK_VYvcy.js +0 -383
- package/dist/chunks/templates-PK_VYvcy.js.map +0 -1
- package/dist/chunks/templates-x1OJZmsG.cjs +0 -2
- package/dist/chunks/templates-x1OJZmsG.cjs.map +0 -1
- package/dist/chunks/users-CY4-NK3j.js.map +0 -1
- package/dist/chunks/users-DHnu_056.cjs +0 -2
- 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-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import ge from "@mezzanine-ui/
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
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 l, Badge as u, Button as ee, DateTimePicker as d, Filter as te, FilterArea as ne, FilterLine as re, FormField as ie, Modal as ae, PageHeader as oe, Section as se, SectionGroup as ce, Select as f, Tab as le, TabItem as ue, Table as de, Tooltip as p, Typography as m } from "@mezzanine-ui/react";
|
|
9
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
+
import { createDelegationRule as fe, listDelegationRulesPage as pe, revokeDelegationRule as me, searchMembers as he } from "@rytass/bpm-core-client/workflow";
|
|
11
|
+
import { PlusIcon as ge } from "@mezzanine-ui/icons";
|
|
12
|
+
import _e from "@mezzanine-ui/react/ContentHeader";
|
|
13
|
+
import { FormFieldLayout as ve } from "@mezzanine-ui/core/form";
|
|
14
|
+
import { listApprovalTemplates as ye } from "@rytass/bpm-core-client/template";
|
|
14
15
|
import '../delegations2.css';var _ = {
|
|
15
16
|
delegationFilterArea: "bpm_delegationFilterArea_hAA4C",
|
|
16
17
|
delegationModalFields: "bpm_delegationModalFields_1aOVW",
|
|
17
18
|
memberNameWithTooltip: "bpm_memberNameWithTooltip_6Mojc"
|
|
18
|
-
},
|
|
19
|
+
}, be = ve.HORIZONTAL, xe = [
|
|
19
20
|
10,
|
|
20
21
|
20,
|
|
21
22
|
50
|
|
22
|
-
],
|
|
23
|
+
], Se = [
|
|
23
24
|
{
|
|
24
25
|
key: "ALL",
|
|
25
26
|
label: "全部"
|
|
@@ -36,7 +37,7 @@ import '../delegations2.css';var _ = {
|
|
|
36
37
|
key: "EXPIRED",
|
|
37
38
|
label: "已過期"
|
|
38
39
|
}
|
|
39
|
-
],
|
|
40
|
+
], v = [
|
|
40
41
|
{
|
|
41
42
|
id: "ALL_SCOPES",
|
|
42
43
|
name: "全部範圍",
|
|
@@ -52,55 +53,55 @@ import '../delegations2.css';var _ = {
|
|
|
52
53
|
name: "指定模板",
|
|
53
54
|
scopeType: "TEMPLATE_LIST"
|
|
54
55
|
}
|
|
55
|
-
],
|
|
56
|
+
], y = [{
|
|
56
57
|
id: "ALL",
|
|
57
58
|
name: "全部簽核"
|
|
58
59
|
}, {
|
|
59
60
|
id: "TEMPLATE_LIST",
|
|
60
61
|
name: "指定模板"
|
|
61
62
|
}];
|
|
62
|
-
function
|
|
63
|
-
let { member:
|
|
64
|
-
if (!
|
|
63
|
+
function b({ activeHref: u } = {}) {
|
|
64
|
+
let p = r(), be = u ?? p.delegations(), { member: b } = e(), S = b?.memberId ?? null, [C, T] = c(null), [O, k] = c(""), [A, M] = c(null), [Pe, N] = c(!0), [Fe, P] = c(!1), [F, I] = c([]), [Ie, L] = c(!1), [R, z] = c(1), [B, Le] = c(10), [V, Re] = c("ALL"), [ze, Be] = c(0), [H, Ve] = c([]), [U, W] = c(!1), [G, He] = c(v[0]), [K, Ue] = c([]), [We, Ge] = c(y[0]), [q, Ke] = c(""), [qe, Je] = c(!1), [Ye, J] = c([]), Y = a(async () => {
|
|
65
|
+
if (!S) {
|
|
65
66
|
N(!1);
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
N(!0),
|
|
69
|
+
N(!0), M(null);
|
|
69
70
|
try {
|
|
70
71
|
let [e, t] = await Promise.all([pe({
|
|
71
72
|
includeInactive: !0,
|
|
72
73
|
page: R,
|
|
73
74
|
pageSize: B,
|
|
74
|
-
principalMemberId:
|
|
75
|
-
scopeType:
|
|
75
|
+
principalMemberId: S,
|
|
76
|
+
scopeType: G.scopeType,
|
|
76
77
|
status: V === "ALL" ? null : V
|
|
77
|
-
}),
|
|
78
|
-
|
|
78
|
+
}), he("")]);
|
|
79
|
+
Ve(e.rules), Be(e.totalCount), I(t.map(x));
|
|
79
80
|
} catch (e) {
|
|
80
|
-
|
|
81
|
+
M(j(e));
|
|
81
82
|
} finally {
|
|
82
83
|
N(!1);
|
|
83
84
|
}
|
|
84
85
|
}, [
|
|
85
|
-
|
|
86
|
+
S,
|
|
86
87
|
R,
|
|
87
88
|
B,
|
|
88
89
|
V,
|
|
89
|
-
|
|
90
|
+
G
|
|
90
91
|
]);
|
|
91
|
-
|
|
92
|
+
o(() => {
|
|
92
93
|
Y();
|
|
93
94
|
}, [Y]);
|
|
94
|
-
let X =
|
|
95
|
+
let X = s(() => new Map(F.map((e) => [e.id, e])), [F]), Xe = s(() => H.map((e) => ({
|
|
95
96
|
...e,
|
|
96
97
|
agentEmail: X.get(e.agentMemberId)?.email ?? null,
|
|
97
98
|
agentName: X.get(e.agentMemberId)?.displayName ?? e.agentMemberId,
|
|
98
99
|
key: e.id,
|
|
99
|
-
scopeLabel:
|
|
100
|
-
})), [X, H]), Z =
|
|
100
|
+
scopeLabel: ke(e)
|
|
101
|
+
})), [X, H]), Z = y.find((e) => e.id === We.id) ?? y[0], Ze = s(() => [
|
|
101
102
|
{
|
|
102
103
|
key: "agent",
|
|
103
|
-
render: (e) => /* @__PURE__ */
|
|
104
|
+
render: (e) => /* @__PURE__ */ h(we, {
|
|
104
105
|
email: e.agentEmail,
|
|
105
106
|
name: e.agentName
|
|
106
107
|
}),
|
|
@@ -115,13 +116,13 @@ function x({ activeHref: l = "/delegations" } = {}) {
|
|
|
115
116
|
},
|
|
116
117
|
{
|
|
117
118
|
key: "status",
|
|
118
|
-
render: (e) => /* @__PURE__ */
|
|
119
|
+
render: (e) => /* @__PURE__ */ h(je, { status: e.status }),
|
|
119
120
|
title: "狀態",
|
|
120
121
|
width: 120
|
|
121
122
|
},
|
|
122
123
|
{
|
|
123
124
|
key: "startAt",
|
|
124
|
-
render: (e) => /* @__PURE__ */ m
|
|
125
|
+
render: (e) => /* @__PURE__ */ h(m, {
|
|
125
126
|
component: "span",
|
|
126
127
|
variant: "body",
|
|
127
128
|
children: t(e.startAt)
|
|
@@ -131,7 +132,7 @@ function x({ activeHref: l = "/delegations" } = {}) {
|
|
|
131
132
|
},
|
|
132
133
|
{
|
|
133
134
|
key: "endAt",
|
|
134
|
-
render: (e) => /* @__PURE__ */ m
|
|
135
|
+
render: (e) => /* @__PURE__ */ h(m, {
|
|
135
136
|
component: "span",
|
|
136
137
|
variant: "body",
|
|
137
138
|
children: e.endAt ? t(e.endAt) : "-"
|
|
@@ -139,208 +140,208 @@ function x({ activeHref: l = "/delegations" } = {}) {
|
|
|
139
140
|
title: "結束時間",
|
|
140
141
|
width: 220
|
|
141
142
|
}
|
|
142
|
-
], []),
|
|
143
|
-
if (
|
|
144
|
-
|
|
143
|
+
], []), Qe = a(async (e) => {
|
|
144
|
+
if (S) {
|
|
145
|
+
M(null);
|
|
145
146
|
try {
|
|
146
147
|
await me({
|
|
147
148
|
id: e,
|
|
148
|
-
revokedByMemberId:
|
|
149
|
+
revokedByMemberId: S
|
|
149
150
|
}), await Y();
|
|
150
151
|
} catch (e) {
|
|
151
|
-
|
|
152
|
+
M(j(e));
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
}, [
|
|
155
|
+
}, [S, Y]), $e = s(() => ({
|
|
155
156
|
render: (e) => e.status === "ACTIVE" ? [{
|
|
156
157
|
name: "撤銷",
|
|
157
|
-
onClick: () => void
|
|
158
|
+
onClick: () => void Qe(e.id)
|
|
158
159
|
}] : [],
|
|
159
160
|
variant: "destructive-secondary",
|
|
160
161
|
width: 88
|
|
161
|
-
}), [
|
|
162
|
-
async function
|
|
162
|
+
}), [Qe]);
|
|
163
|
+
async function et(e) {
|
|
163
164
|
P(!0);
|
|
164
165
|
try {
|
|
165
|
-
I((await
|
|
166
|
+
I((await he(e)).map(x));
|
|
166
167
|
} catch (e) {
|
|
167
|
-
|
|
168
|
+
M(j(e));
|
|
168
169
|
} finally {
|
|
169
170
|
P(!1);
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
async function Q(e, t =
|
|
173
|
-
|
|
173
|
+
async function Q(e, t = K) {
|
|
174
|
+
Je(!0);
|
|
174
175
|
try {
|
|
175
|
-
J(
|
|
176
|
+
J(w(t, De((await ye()).map(Te), e)));
|
|
176
177
|
} catch (e) {
|
|
177
|
-
|
|
178
|
+
M(j(e));
|
|
178
179
|
} finally {
|
|
179
|
-
|
|
180
|
+
Je(!1);
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
183
|
+
function tt() {
|
|
184
|
+
T(null), k(""), Ue([]), Ge(y[0]), Ke(""), J([]), Q("", []), L(!0);
|
|
184
185
|
}
|
|
185
186
|
function $() {
|
|
186
187
|
U || L(!1);
|
|
187
188
|
}
|
|
188
|
-
async function
|
|
189
|
-
if (
|
|
190
|
-
if (!
|
|
191
|
-
|
|
189
|
+
async function nt() {
|
|
190
|
+
if (S) {
|
|
191
|
+
if (!C) {
|
|
192
|
+
M("請選擇代理人");
|
|
192
193
|
return;
|
|
193
194
|
}
|
|
194
|
-
if (
|
|
195
|
-
|
|
195
|
+
if (C.id === S) {
|
|
196
|
+
M("代理人不可設定為自己");
|
|
196
197
|
return;
|
|
197
198
|
}
|
|
198
|
-
if (Z.id === "TEMPLATE_LIST" &&
|
|
199
|
-
|
|
199
|
+
if (Z.id === "TEMPLATE_LIST" && K.length < 1) {
|
|
200
|
+
M("請選擇至少一個簽核模板");
|
|
200
201
|
return;
|
|
201
202
|
}
|
|
202
|
-
if (
|
|
203
|
-
|
|
203
|
+
if (Ne(q, O)) {
|
|
204
|
+
M("結束時間必須晚於起始時間");
|
|
204
205
|
return;
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
+
W(!0), M(null);
|
|
207
208
|
try {
|
|
208
209
|
await fe({
|
|
209
|
-
agentMemberId:
|
|
210
|
-
createdByMemberId:
|
|
211
|
-
endAt:
|
|
212
|
-
principalMemberId:
|
|
210
|
+
agentMemberId: C.id,
|
|
211
|
+
createdByMemberId: S,
|
|
212
|
+
endAt: O || null,
|
|
213
|
+
principalMemberId: S,
|
|
213
214
|
priority: 100,
|
|
214
215
|
requiresConfirmation: !1,
|
|
215
216
|
scopeConditionCel: null,
|
|
216
|
-
scopeTemplateIds: Z.id === "TEMPLATE_LIST" ?
|
|
217
|
+
scopeTemplateIds: Z.id === "TEMPLATE_LIST" ? K.map((e) => e.id) : [],
|
|
217
218
|
scopeType: Z.id,
|
|
218
|
-
startAt:
|
|
219
|
+
startAt: q || null
|
|
219
220
|
}), L(!1), R === 1 ? await Y() : z(1);
|
|
220
221
|
} catch (e) {
|
|
221
|
-
|
|
222
|
+
M(j(e));
|
|
222
223
|
} finally {
|
|
223
|
-
|
|
224
|
+
W(!1);
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
|
-
return /* @__PURE__ */
|
|
228
|
-
activeHref:
|
|
228
|
+
return /* @__PURE__ */ g(n, {
|
|
229
|
+
activeHref: be,
|
|
229
230
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ h(oe, { children: /* @__PURE__ */ h(_e, {
|
|
231
232
|
description: "設定自己的簽核代理,讓指定期間內的新待簽任務自動交由代理人處理。",
|
|
232
233
|
title: "我的代理",
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
-
icon:
|
|
234
|
+
children: /* @__PURE__ */ h(ee, {
|
|
235
|
+
icon: ge,
|
|
235
236
|
iconType: "leading",
|
|
236
|
-
onClick:
|
|
237
|
+
onClick: tt,
|
|
237
238
|
variant: "base-primary",
|
|
238
239
|
children: "建立代理"
|
|
239
240
|
})
|
|
240
241
|
}) }),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
filterArea: /* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ h(ce, { children: /* @__PURE__ */ g(se, {
|
|
243
|
+
filterArea: /* @__PURE__ */ h(ne, {
|
|
243
244
|
className: _.delegationFilterArea,
|
|
244
245
|
size: "sub",
|
|
245
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ h(re, { children: /* @__PURE__ */ h(te, {
|
|
246
247
|
span: 2,
|
|
247
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ h(ie, {
|
|
248
249
|
fullWidth: !0,
|
|
249
|
-
layout:
|
|
250
|
+
layout: ve.VERTICAL,
|
|
250
251
|
name: "scopeFilterType",
|
|
251
|
-
children: /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ h(f, {
|
|
252
253
|
clearable: !1,
|
|
253
254
|
fullWidth: !0,
|
|
254
255
|
onChange: (e) => {
|
|
255
|
-
|
|
256
|
+
He(Oe(e)), z(1);
|
|
256
257
|
},
|
|
257
|
-
options: [...
|
|
258
|
+
options: [...v],
|
|
258
259
|
placeholder: "代理範圍",
|
|
259
260
|
size: "sub",
|
|
260
|
-
value:
|
|
261
|
+
value: G
|
|
261
262
|
})
|
|
262
263
|
})
|
|
263
264
|
}) })
|
|
264
265
|
}),
|
|
265
|
-
tab: /* @__PURE__ */
|
|
266
|
+
tab: /* @__PURE__ */ h(le, {
|
|
266
267
|
activeKey: V,
|
|
267
268
|
onChange: (e) => {
|
|
268
|
-
|
|
269
|
+
Re(Me(e)), z(1);
|
|
269
270
|
},
|
|
270
|
-
children:
|
|
271
|
+
children: Se.map((e) => /* @__PURE__ */ h(ue, { children: e.label }, e.key))
|
|
271
272
|
}),
|
|
272
|
-
children: [
|
|
273
|
+
children: [A ? /* @__PURE__ */ h(m, {
|
|
273
274
|
color: "text-error",
|
|
274
275
|
variant: "body",
|
|
275
|
-
children:
|
|
276
|
-
}) : null, /* @__PURE__ */
|
|
277
|
-
actions:
|
|
278
|
-
columns:
|
|
279
|
-
dataSource:
|
|
276
|
+
children: A
|
|
277
|
+
}) : null, /* @__PURE__ */ h(de, {
|
|
278
|
+
actions: $e,
|
|
279
|
+
columns: Ze,
|
|
280
|
+
dataSource: Xe,
|
|
280
281
|
fullWidth: !0,
|
|
281
|
-
loading:
|
|
282
|
+
loading: Pe,
|
|
282
283
|
pagination: {
|
|
283
284
|
current: R,
|
|
284
285
|
onChange: (e) => {
|
|
285
286
|
z(e);
|
|
286
287
|
},
|
|
287
288
|
onChangePageSize: (e) => {
|
|
288
|
-
z(1),
|
|
289
|
+
z(1), Le(e);
|
|
289
290
|
},
|
|
290
291
|
pageSize: B,
|
|
291
292
|
pageSizeLabel: "每頁筆數",
|
|
292
|
-
pageSizeOptions:
|
|
293
|
+
pageSizeOptions: xe,
|
|
293
294
|
renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
|
|
294
295
|
showPageSizeOptions: !0,
|
|
295
|
-
total:
|
|
296
|
+
total: ze
|
|
296
297
|
}
|
|
297
298
|
})]
|
|
298
299
|
}) }),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ h(ae, {
|
|
300
301
|
cancelText: "取消",
|
|
301
|
-
confirmButtonProps: { disabled: !
|
|
302
|
+
confirmButtonProps: { disabled: !C },
|
|
302
303
|
confirmText: "建立代理",
|
|
303
304
|
loading: U,
|
|
304
305
|
modalType: "standard",
|
|
305
306
|
onCancel: $,
|
|
306
307
|
onClose: $,
|
|
307
|
-
onConfirm: () => void
|
|
308
|
-
open:
|
|
308
|
+
onConfirm: () => void nt(),
|
|
309
|
+
open: Ie,
|
|
309
310
|
showModalFooter: !0,
|
|
310
311
|
showModalHeader: !0,
|
|
311
312
|
size: "regular",
|
|
312
313
|
supportingText: "代理生效後,後續建立的待簽任務會依範圍自動指派給代理人。",
|
|
313
314
|
title: "建立個人代理",
|
|
314
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ g("div", {
|
|
315
316
|
className: _.delegationModalFields,
|
|
316
317
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ h(Ce, {
|
|
318
319
|
label: "代理人",
|
|
319
|
-
loading:
|
|
320
|
+
loading: Fe,
|
|
320
321
|
name: "agentMemberId",
|
|
321
|
-
onChange:
|
|
322
|
-
onSearch:
|
|
322
|
+
onChange: T,
|
|
323
|
+
onSearch: et,
|
|
323
324
|
options: F,
|
|
324
|
-
value:
|
|
325
|
+
value: C
|
|
325
326
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ h(i, {
|
|
327
328
|
label: "代理範圍",
|
|
328
329
|
name: "scopeType",
|
|
329
330
|
required: !0,
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ h(f, {
|
|
331
332
|
clearable: !1,
|
|
332
333
|
fullWidth: !0,
|
|
333
|
-
onChange: (e) =>
|
|
334
|
-
options: [...
|
|
334
|
+
onChange: (e) => Ge(Ae(e)),
|
|
335
|
+
options: [...y],
|
|
335
336
|
placeholder: "選擇代理範圍",
|
|
336
337
|
value: Z
|
|
337
338
|
})
|
|
338
339
|
}),
|
|
339
|
-
Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */
|
|
340
|
+
Z.id === "TEMPLATE_LIST" ? /* @__PURE__ */ h(i, {
|
|
340
341
|
label: "簽核模板",
|
|
341
342
|
name: "scopeTemplateIds",
|
|
342
343
|
required: !0,
|
|
343
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ h(l, {
|
|
344
345
|
asyncData: !0,
|
|
345
346
|
disabledOptionsFilter: !0,
|
|
346
347
|
emptyText: "沒有符合的模板",
|
|
@@ -350,50 +351,50 @@ function x({ activeHref: l = "/delegations" } = {}) {
|
|
|
350
351
|
name: "scopeTemplateIds",
|
|
351
352
|
spellCheck: !1
|
|
352
353
|
},
|
|
353
|
-
loading:
|
|
354
|
+
loading: qe,
|
|
354
355
|
loadingText: "搜尋模板中...",
|
|
355
356
|
mode: "multiple",
|
|
356
357
|
onChange: (e) => {
|
|
357
|
-
let t =
|
|
358
|
-
|
|
358
|
+
let t = Ee(e);
|
|
359
|
+
Ue(t), J((e) => w(t, e));
|
|
359
360
|
},
|
|
360
361
|
onSearch: Q,
|
|
361
362
|
onVisibilityChange: (e) => {
|
|
362
363
|
e && Q("");
|
|
363
364
|
},
|
|
364
|
-
options: [...
|
|
365
|
+
options: [...Ye],
|
|
365
366
|
overflowStrategy: "wrap",
|
|
366
367
|
placeholder: "搜尋並選取簽核模板",
|
|
367
368
|
searchDebounceTime: 300,
|
|
368
|
-
value: [...
|
|
369
|
+
value: [...K]
|
|
369
370
|
})
|
|
370
371
|
}) : null,
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ h(i, {
|
|
372
373
|
label: "起始時間",
|
|
373
374
|
name: "startAt",
|
|
374
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ h(d, {
|
|
375
376
|
formatDate: "YYYY-MM-DD",
|
|
376
377
|
formatTime: "HH:mm",
|
|
377
378
|
fullWidth: !0,
|
|
378
379
|
hideSecond: !0,
|
|
379
|
-
onChange: (e) =>
|
|
380
|
+
onChange: (e) => Ke(D(e)),
|
|
380
381
|
placeholderLeft: "留空立即生效",
|
|
381
382
|
placeholderRight: "選擇時間",
|
|
382
|
-
value:
|
|
383
|
+
value: E(q)
|
|
383
384
|
})
|
|
384
385
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ h(i, {
|
|
386
387
|
label: "結束時間",
|
|
387
388
|
name: "endAt",
|
|
388
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ h(d, {
|
|
389
390
|
formatDate: "YYYY-MM-DD",
|
|
390
391
|
formatTime: "HH:mm",
|
|
391
392
|
fullWidth: !0,
|
|
392
393
|
hideSecond: !0,
|
|
393
|
-
onChange: (e) =>
|
|
394
|
+
onChange: (e) => k(D(e)),
|
|
394
395
|
placeholderLeft: "可留空",
|
|
395
396
|
placeholderRight: "選擇時間",
|
|
396
|
-
value:
|
|
397
|
+
value: E(O)
|
|
397
398
|
})
|
|
398
399
|
})
|
|
399
400
|
]
|
|
@@ -402,13 +403,13 @@ function x({ activeHref: l = "/delegations" } = {}) {
|
|
|
402
403
|
]
|
|
403
404
|
});
|
|
404
405
|
}
|
|
405
|
-
function
|
|
406
|
-
return /* @__PURE__ */
|
|
406
|
+
function Ce({ label: e, loading: t, name: n, onChange: r, onSearch: a, options: o, value: s }) {
|
|
407
|
+
return /* @__PURE__ */ h(i, {
|
|
407
408
|
label: e,
|
|
408
|
-
layout:
|
|
409
|
+
layout: be,
|
|
409
410
|
name: n,
|
|
410
411
|
required: !0,
|
|
411
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ h(l, {
|
|
412
413
|
asyncData: !0,
|
|
413
414
|
disabledOptionsFilter: !0,
|
|
414
415
|
emptyText: "沒有符合的成員",
|
|
@@ -421,9 +422,9 @@ function xe({ label: e, loading: t, name: n, onChange: i, onSearch: a, options:
|
|
|
421
422
|
loading: t,
|
|
422
423
|
loadingText: "搜尋成員中...",
|
|
423
424
|
mode: "single",
|
|
424
|
-
onChange: (e) =>
|
|
425
|
+
onChange: (e) => r(S(e)),
|
|
425
426
|
onSearch: a,
|
|
426
|
-
onSearchTextChange: (e) =>
|
|
427
|
+
onSearchTextChange: (e) => r(C(e, o)),
|
|
427
428
|
onVisibilityChange: (e) => {
|
|
428
429
|
e && a("");
|
|
429
430
|
},
|
|
@@ -434,19 +435,19 @@ function xe({ label: e, loading: t, name: n, onChange: i, onSearch: a, options:
|
|
|
434
435
|
})
|
|
435
436
|
});
|
|
436
437
|
}
|
|
437
|
-
function
|
|
438
|
-
return e ? /* @__PURE__ */
|
|
438
|
+
function we({ email: e, name: t }) {
|
|
439
|
+
return e ? /* @__PURE__ */ h(p, {
|
|
439
440
|
title: e,
|
|
440
|
-
children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */
|
|
441
|
+
children: ({ onMouseEnter: e, onMouseLeave: n, ref: r }) => /* @__PURE__ */ h("span", {
|
|
441
442
|
className: _.memberNameWithTooltip,
|
|
442
443
|
onMouseEnter: e,
|
|
443
444
|
onMouseLeave: n,
|
|
444
445
|
ref: r,
|
|
445
446
|
children: t
|
|
446
447
|
})
|
|
447
|
-
}) : /* @__PURE__ */
|
|
448
|
+
}) : /* @__PURE__ */ h("span", { children: t });
|
|
448
449
|
}
|
|
449
|
-
function
|
|
450
|
+
function x(e) {
|
|
450
451
|
return {
|
|
451
452
|
displayName: e.name,
|
|
452
453
|
email: e.email,
|
|
@@ -454,8 +455,8 @@ function S(e) {
|
|
|
454
455
|
name: `${e.name} (${e.email})`
|
|
455
456
|
};
|
|
456
457
|
}
|
|
457
|
-
function
|
|
458
|
-
if (!
|
|
458
|
+
function S(e) {
|
|
459
|
+
if (!M(e)) return null;
|
|
459
460
|
let t = e.displayName, n = e.email, r = e.id, i = e.name;
|
|
460
461
|
return typeof r == "string" && typeof i == "string" ? {
|
|
461
462
|
displayName: typeof t == "string" ? t : i,
|
|
@@ -464,7 +465,7 @@ function C(e) {
|
|
|
464
465
|
name: i
|
|
465
466
|
} : null;
|
|
466
467
|
}
|
|
467
|
-
function
|
|
468
|
+
function C(e, t) {
|
|
468
469
|
let n = e.trim().toLocaleLowerCase();
|
|
469
470
|
if (!n) return null;
|
|
470
471
|
let r = t.filter((e) => [
|
|
@@ -474,15 +475,15 @@ function w(e, t) {
|
|
|
474
475
|
].some((e) => e.toLocaleLowerCase().includes(n)));
|
|
475
476
|
return r.length === 1 ? r[0] ?? null : null;
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
+
function Te(e) {
|
|
478
479
|
return {
|
|
479
480
|
id: e.id,
|
|
480
481
|
name: e.name
|
|
481
482
|
};
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function Ee(e) {
|
|
484
485
|
return e.flatMap((e) => {
|
|
485
|
-
if (!
|
|
486
|
+
if (!M(e)) return [];
|
|
486
487
|
let t = e.id, n = e.name;
|
|
487
488
|
return typeof t == "string" && typeof n == "string" ? [{
|
|
488
489
|
id: t,
|
|
@@ -490,63 +491,63 @@ function we(e) {
|
|
|
490
491
|
}] : [];
|
|
491
492
|
});
|
|
492
493
|
}
|
|
493
|
-
function
|
|
494
|
+
function De(e, t) {
|
|
494
495
|
let n = t.trim().toLocaleLowerCase();
|
|
495
496
|
return n ? e.filter((e) => [e.id, e.name].some((e) => e.toLocaleLowerCase().includes(n))) : e;
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
+
function w(e, t) {
|
|
498
499
|
return [...e, ...t].reduce((e, t) => e.some((e) => e.id === t.id) ? e : [...e, t], []);
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
-
if (!
|
|
501
|
+
function Oe(e) {
|
|
502
|
+
if (!M(e)) return v[0];
|
|
502
503
|
let t = e.id;
|
|
503
|
-
return
|
|
504
|
+
return v.find((e) => e.id === t) ?? v[0];
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
+
function ke(e) {
|
|
506
507
|
return e.scopeType === "ALL" ? "全部簽核" : e.scopeType === "TEMPLATE_LIST" ? `指定模板:${e.scopeTemplateIds.length}` : e.scopeConditionCel ? `條件:${e.scopeConditionCel}` : "條件式";
|
|
507
508
|
}
|
|
508
|
-
function
|
|
509
|
-
return !
|
|
509
|
+
function Ae(e) {
|
|
510
|
+
return !M(e) || !T(e.id) ? y[0] : y.find((t) => t.id === e.id) ?? y[0];
|
|
510
511
|
}
|
|
511
|
-
function
|
|
512
|
+
function T(e) {
|
|
512
513
|
return e === "ALL" || e === "TEMPLATE_LIST";
|
|
513
514
|
}
|
|
514
|
-
function
|
|
515
|
-
return e === "ACTIVE" ? /* @__PURE__ */
|
|
515
|
+
function je({ status: e }) {
|
|
516
|
+
return e === "ACTIVE" ? /* @__PURE__ */ h(u, {
|
|
516
517
|
size: "sub",
|
|
517
518
|
text: "啟用中",
|
|
518
519
|
variant: "dot-success"
|
|
519
|
-
}) : e === "REVOKED" ? /* @__PURE__ */
|
|
520
|
+
}) : e === "REVOKED" ? /* @__PURE__ */ h(u, {
|
|
520
521
|
size: "sub",
|
|
521
522
|
text: "已撤銷",
|
|
522
523
|
variant: "dot-inactive"
|
|
523
|
-
}) : e === "EXPIRED" ? /* @__PURE__ */
|
|
524
|
+
}) : e === "EXPIRED" ? /* @__PURE__ */ h(u, {
|
|
524
525
|
size: "sub",
|
|
525
526
|
text: "已過期",
|
|
526
527
|
variant: "dot-warning"
|
|
527
|
-
}) : /* @__PURE__ */
|
|
528
|
+
}) : /* @__PURE__ */ h(u, {
|
|
528
529
|
size: "sub",
|
|
529
530
|
text: e,
|
|
530
531
|
variant: "dot-info"
|
|
531
532
|
});
|
|
532
533
|
}
|
|
533
|
-
function
|
|
534
|
+
function Me(e) {
|
|
534
535
|
return e === "ACTIVE" || e === "REVOKED" || e === "EXPIRED" ? e : "ALL";
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
-
let t = e ?
|
|
538
|
-
return t ? `${
|
|
537
|
+
function E(e) {
|
|
538
|
+
let t = e ? O(e) : null;
|
|
539
|
+
return t ? `${k(t)}T${A(t.getHours())}:${A(t.getMinutes())}` : void 0;
|
|
539
540
|
}
|
|
540
|
-
function
|
|
541
|
-
let t = e ?
|
|
541
|
+
function D(e) {
|
|
542
|
+
let t = e ? O(e) : null;
|
|
542
543
|
return t ? t.toISOString() : "";
|
|
543
544
|
}
|
|
544
|
-
function
|
|
545
|
+
function Ne(e, t) {
|
|
545
546
|
if (!e || !t) return !1;
|
|
546
|
-
let n =
|
|
547
|
+
let n = O(e), r = O(t);
|
|
547
548
|
return !!n && !!r && r.getTime() <= n.getTime();
|
|
548
549
|
}
|
|
549
|
-
function
|
|
550
|
+
function O(e) {
|
|
550
551
|
if (e.endsWith("Z") || /[+-]\d{2}:\d{2}$/.test(e)) {
|
|
551
552
|
let t = new Date(e);
|
|
552
553
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
@@ -554,19 +555,19 @@ function k(e) {
|
|
|
554
555
|
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);
|
|
555
556
|
return Number.isNaN(c.getTime()) ? null : c;
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
-
return `${e.getFullYear()}-${
|
|
558
|
+
function k(e) {
|
|
559
|
+
return `${e.getFullYear()}-${A(e.getMonth() + 1)}-${A(e.getDate())}`;
|
|
559
560
|
}
|
|
560
|
-
function
|
|
561
|
+
function A(e) {
|
|
561
562
|
return String(e).padStart(2, "0");
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function j(e) {
|
|
564
565
|
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
565
566
|
}
|
|
566
|
-
function
|
|
567
|
+
function M(e) {
|
|
567
568
|
return typeof e == "object" && !!e;
|
|
568
569
|
}
|
|
569
570
|
//#endregion
|
|
570
|
-
export {
|
|
571
|
+
export { b as t };
|
|
571
572
|
|
|
572
|
-
//# sourceMappingURL=delegations-
|
|
573
|
+
//# sourceMappingURL=delegations-dKodb0WW.js.map
|