@rytass/bpm-core-react 0.17.7 → 0.17.8
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 +11 -0
- package/dist/chunks/{compose-DjEJi5Dv.cjs → compose-Cock_B2Q.cjs} +2 -2
- package/dist/chunks/{compose-DjEJi5Dv.cjs.map → compose-Cock_B2Q.cjs.map} +1 -1
- package/dist/chunks/{compose-WekGZj74.js → compose-jnvnnVfN.js} +2 -2
- package/dist/chunks/{compose-WekGZj74.js.map → compose-jnvnnVfN.js.map} +1 -1
- package/dist/chunks/{designer-D87ILhjz.js → designer-B8Gvew_k.js} +6 -2
- package/dist/chunks/designer-B8Gvew_k.js.map +1 -0
- package/dist/chunks/{designer-DESS0CMl.cjs → designer-CAEFV1ve.cjs} +2 -2
- package/dist/chunks/designer-CAEFV1ve.cjs.map +1 -0
- package/dist/chunks/detail-COh5sjAt.cjs +2 -0
- package/dist/chunks/detail-COh5sjAt.cjs.map +1 -0
- package/dist/chunks/{detail-URwxkcro.js → detail-D6X61pkg.js} +744 -739
- package/dist/chunks/detail-D6X61pkg.js.map +1 -0
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +7 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +7 -0
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/designer-D87ILhjz.js.map +0 -1
- package/dist/chunks/designer-DESS0CMl.cjs.map +0 -1
- package/dist/chunks/detail-D49NuNCn.cjs +0 -2
- package/dist/chunks/detail-D49NuNCn.cjs.map +0 -1
- package/dist/chunks/detail-URwxkcro.js.map +0 -1
|
@@ -5,22 +5,22 @@ import { t as n } from "./bpm-form-field-Cao0rMol.js";
|
|
|
5
5
|
import { t as r } from "./use-bpm-member-D57LKe_u.js";
|
|
6
6
|
import { t as i } from "./format-member-label-DudVI55w.js";
|
|
7
7
|
import { t as a } from "./task-node-label-CWZgOBj0.js";
|
|
8
|
-
import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as
|
|
9
|
-
import { o as
|
|
8
|
+
import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as te } from "./approver-filled-form-DuQGPtNB.js";
|
|
9
|
+
import { o as m, t as ne } from "./FormRendererView-BsTwZkqU.js";
|
|
10
10
|
import '../style.css';import '../detail.css';/* empty css */
|
|
11
|
-
import { Fragment as
|
|
11
|
+
import { Fragment as h, forwardRef as re, useCallback as g, useEffect as ie, useImperativeHandle as ae, useMemo as _, useRef as oe, useState as v } from "react";
|
|
12
12
|
import { AutoComplete as se, Badge as ce, Button as y, Description as b, DescriptionContent as le, InlineMessage as x, Input as ue, Message as de, Modal as S, PageHeader as fe, Section as pe, SectionGroup as me, Select as C, Stepper as he, Table as ge, Textarea as _e, Tooltip as ve, Typography as w } from "@mezzanine-ui/react";
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { cancelAdhocDirective as
|
|
15
|
-
import
|
|
16
|
-
import { CheckedIcon as
|
|
17
|
-
import { readNodeFillableFieldKeys as
|
|
18
|
-
import { buildFormRendererValues as
|
|
19
|
-
import { Background as
|
|
20
|
-
import * as
|
|
21
|
-
import { Document as
|
|
22
|
-
import { stepClasses as
|
|
23
|
-
var
|
|
13
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
14
|
+
import { cancelAdhocDirective as ye, cancelApprovalInstance as be, configureAdhocCompletionNotification as xe, configureAdhocStageNotification as Se, decideTask as Ce, listAdhocDirectives as we, listAttachments as Te, listTaskDecisions as O, listWorkflowWebhookDeliveries as Ee, readApprovalInstance as De, readAttachmentDownloadUrl as Oe, readAttachmentPreviewUrl as ke, readInstanceSignatures as Ae, requestAdhocCountersign as je, requestAdhocPreApproval as Me, resolveMemberProfiles as Ne, resubmitApprovalInstance as Pe, retryWorkflowWebhookDelivery as Fe, searchMembers as k, uploadAttachment as Ie } from "@rytass/bpm-core-client/workflow";
|
|
15
|
+
import Le from "@mezzanine-ui/react/ContentHeader";
|
|
16
|
+
import { CheckedIcon as Re, ChevronLeftIcon as ze, ChevronRightIcon as Be, DangerousOutlineIcon as Ve, DownloadIcon as He, FileSearchIcon as Ue, NotificationUnreadIcon as We, PlusIcon as Ge, RefreshCcwIcon as Ke, ResetIcon as qe, ShareIcon as A, UserIcon as Je, ZoomInIcon as Ye, ZoomOutIcon as j } from "@mezzanine-ui/icons";
|
|
17
|
+
import { readNodeFillableFieldKeys as M, readRevealedFieldKeys as Xe, readTopLevelFieldKey as Ze, resolveFieldAccess as Qe } from "@rytass/bpm-core-shared";
|
|
18
|
+
import { buildFormRendererValues as $e, focusFormRendererField as et, readFormDataSourceErrorMessage as N, validateFormRendererValues as tt } from "@rytass/bpm-core-client/form";
|
|
19
|
+
import { Background as nt, Controls as P, Handle as F, Position as I, ReactFlow as rt } from "@xyflow/react";
|
|
20
|
+
import * as L from "dagre";
|
|
21
|
+
import { Document as it, Page as at } from "react-pdf";
|
|
22
|
+
import { stepClasses as R } from "@mezzanine-ui/core/stepper";
|
|
23
|
+
var z = {
|
|
24
24
|
root: "bpm_root_ehm7w",
|
|
25
25
|
toolbar: "bpm_toolbar_R-tis",
|
|
26
26
|
pageControls: "bpm_pageControls_jM-rC",
|
|
@@ -29,10 +29,10 @@ var I = {
|
|
|
29
29
|
viewport: "bpm_viewport_DQXms",
|
|
30
30
|
page: "bpm_page_Cv5Rg",
|
|
31
31
|
state: "bpm_state_bpgp3"
|
|
32
|
-
},
|
|
33
|
-
function
|
|
34
|
-
let r = oe(null), [i, a] = v(null), [o, s] = v(1), [c, l] = v(1), [u, d] = v(
|
|
35
|
-
|
|
32
|
+
}, ot = 760, st = 920, ct = 320, lt = 32, ut = .75, dt = 1.75, ft = .25;
|
|
33
|
+
function pt({ filename: e, fileUrl: t, onDownload: n }) {
|
|
34
|
+
let r = oe(null), [i, a] = v(null), [o, s] = v(1), [c, l] = v(1), [u, d] = v(ot);
|
|
35
|
+
ie(() => {
|
|
36
36
|
let e = r.current;
|
|
37
37
|
if (!e || typeof ResizeObserver > "u") return;
|
|
38
38
|
let t = new ResizeObserver((e) => {
|
|
@@ -40,45 +40,45 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
40
40
|
t && d(t);
|
|
41
41
|
});
|
|
42
42
|
return t.observe(e), () => t.disconnect();
|
|
43
|
-
}, []),
|
|
43
|
+
}, []), ie(() => {
|
|
44
44
|
a(null), s(1), l(1);
|
|
45
45
|
}, [t]);
|
|
46
46
|
let f = _(() => {
|
|
47
|
-
let e = Math.max(
|
|
48
|
-
return Math.round(Math.min(
|
|
49
|
-
}, [c, u]), p =
|
|
47
|
+
let e = Math.max(ct, u - lt);
|
|
48
|
+
return Math.round(Math.min(st, e) * c);
|
|
49
|
+
}, [c, u]), p = g((e) => {
|
|
50
50
|
a(e.numPages), s(1);
|
|
51
|
-
}, []), ee = o > 1,
|
|
52
|
-
return /* @__PURE__ */
|
|
51
|
+
}, []), ee = o > 1, te = i !== null && o < i, m = c > ut, ne = c < dt, h = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, re = `${Math.round(c * 100)}%`;
|
|
52
|
+
return /* @__PURE__ */ D("section", {
|
|
53
53
|
"aria-label": `${e} PDF 預覽`,
|
|
54
|
-
className:
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
className:
|
|
54
|
+
className: z.root,
|
|
55
|
+
children: [/* @__PURE__ */ D("div", {
|
|
56
|
+
className: z.toolbar,
|
|
57
57
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
className:
|
|
58
|
+
/* @__PURE__ */ D("div", {
|
|
59
|
+
className: z.pageControls,
|
|
60
60
|
"aria-label": "頁面切換",
|
|
61
61
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ E(y, {
|
|
63
63
|
"aria-label": "上一頁",
|
|
64
64
|
disabled: !ee,
|
|
65
|
-
icon:
|
|
65
|
+
icon: ze,
|
|
66
66
|
onClick: () => {
|
|
67
67
|
s((e) => Math.max(1, e - 1));
|
|
68
68
|
},
|
|
69
69
|
size: "minor",
|
|
70
70
|
variant: "base-secondary"
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
className:
|
|
72
|
+
/* @__PURE__ */ E(w, {
|
|
73
|
+
className: z.counter,
|
|
74
74
|
component: "span",
|
|
75
75
|
variant: "body",
|
|
76
|
-
children:
|
|
76
|
+
children: h
|
|
77
77
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ E(y, {
|
|
79
79
|
"aria-label": "下一頁",
|
|
80
|
-
disabled: !
|
|
81
|
-
icon:
|
|
80
|
+
disabled: !te,
|
|
81
|
+
icon: Be,
|
|
82
82
|
onClick: () => {
|
|
83
83
|
s((e) => i === null ? e : Math.min(i, e + 1));
|
|
84
84
|
},
|
|
@@ -87,40 +87,40 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
87
87
|
})
|
|
88
88
|
]
|
|
89
89
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
className:
|
|
90
|
+
/* @__PURE__ */ D("div", {
|
|
91
|
+
className: z.zoomControls,
|
|
92
92
|
"aria-label": "縮放",
|
|
93
93
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ E(y, {
|
|
95
95
|
"aria-label": "縮小",
|
|
96
|
-
disabled: !
|
|
97
|
-
icon:
|
|
96
|
+
disabled: !m,
|
|
97
|
+
icon: j,
|
|
98
98
|
onClick: () => {
|
|
99
|
-
l((e) => Math.max(
|
|
99
|
+
l((e) => Math.max(ut, e - ft));
|
|
100
100
|
},
|
|
101
101
|
size: "minor",
|
|
102
102
|
variant: "base-secondary"
|
|
103
103
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
className:
|
|
104
|
+
/* @__PURE__ */ E(w, {
|
|
105
|
+
className: z.counter,
|
|
106
106
|
component: "span",
|
|
107
107
|
variant: "body",
|
|
108
|
-
children:
|
|
108
|
+
children: re
|
|
109
109
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ E(y, {
|
|
111
111
|
"aria-label": "放大",
|
|
112
112
|
disabled: !ne,
|
|
113
|
-
icon:
|
|
113
|
+
icon: Ye,
|
|
114
114
|
onClick: () => {
|
|
115
|
-
l((e) => Math.min(
|
|
115
|
+
l((e) => Math.min(dt, e + ft));
|
|
116
116
|
},
|
|
117
117
|
size: "minor",
|
|
118
118
|
variant: "base-secondary"
|
|
119
119
|
})
|
|
120
120
|
]
|
|
121
121
|
}),
|
|
122
|
-
n ? /* @__PURE__ */
|
|
123
|
-
icon:
|
|
122
|
+
n ? /* @__PURE__ */ E(y, {
|
|
123
|
+
icon: He,
|
|
124
124
|
iconType: "leading",
|
|
125
125
|
onClick: n,
|
|
126
126
|
size: "minor",
|
|
@@ -128,19 +128,19 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
128
128
|
children: "下載"
|
|
129
129
|
}) : null
|
|
130
130
|
]
|
|
131
|
-
}), /* @__PURE__ */
|
|
132
|
-
className:
|
|
131
|
+
}), /* @__PURE__ */ E("div", {
|
|
132
|
+
className: z.viewport,
|
|
133
133
|
ref: r,
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
error: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ E(it, {
|
|
135
|
+
error: /* @__PURE__ */ E(B, { message: "PDF 無法載入。" }),
|
|
136
136
|
file: t,
|
|
137
|
-
loading: /* @__PURE__ */
|
|
138
|
-
noData: /* @__PURE__ */
|
|
137
|
+
loading: /* @__PURE__ */ E(B, { message: "正在載入 PDF..." }),
|
|
138
|
+
noData: /* @__PURE__ */ E(B, { message: "沒有可預覽的 PDF。" }),
|
|
139
139
|
onLoadSuccess: p,
|
|
140
140
|
suspense: !1,
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
-
className:
|
|
143
|
-
loading: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ E(at, {
|
|
142
|
+
className: z.page,
|
|
143
|
+
loading: /* @__PURE__ */ E(B, { message: "正在載入頁面..." }),
|
|
144
144
|
pageNumber: o,
|
|
145
145
|
renderAnnotationLayer: !0,
|
|
146
146
|
renderTextLayer: !0,
|
|
@@ -150,10 +150,10 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
150
150
|
})]
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
return /* @__PURE__ */
|
|
155
|
-
className:
|
|
156
|
-
children: /* @__PURE__ */
|
|
153
|
+
function B({ message: e }) {
|
|
154
|
+
return /* @__PURE__ */ E("div", {
|
|
155
|
+
className: z.state,
|
|
156
|
+
children: /* @__PURE__ */ E(w, {
|
|
157
157
|
color: "text-neutral",
|
|
158
158
|
variant: "body",
|
|
159
159
|
children: e
|
|
@@ -162,110 +162,110 @@ function R({ message: e }) {
|
|
|
162
162
|
}
|
|
163
163
|
//#endregion
|
|
164
164
|
//#region src/views/instances/detail/submitted-by.ts
|
|
165
|
-
function
|
|
165
|
+
function mt({ initiatorMemberId: e, submittedByMemberId: t }) {
|
|
166
166
|
return t && t !== e ? t : null;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
let n =
|
|
168
|
+
function ht(e, t) {
|
|
169
|
+
let n = mt(e);
|
|
170
170
|
if (!n || !e.initiatorMemberId) return null;
|
|
171
171
|
let r = (e) => t.get(e)?.name ?? e;
|
|
172
172
|
return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/views/instances/detail/sections/shared.ts
|
|
176
|
-
function
|
|
177
|
-
let t =
|
|
176
|
+
function gt(e) {
|
|
177
|
+
let t = V(e, "from"), n = V(e, "to"), r = V(e, "reason");
|
|
178
178
|
return !t || !n || !r ? null : {
|
|
179
179
|
from: t,
|
|
180
180
|
reason: r,
|
|
181
|
-
ruleId:
|
|
181
|
+
ruleId: V(e, "ruleId"),
|
|
182
182
|
to: n
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function _t(e) {
|
|
186
186
|
try {
|
|
187
187
|
let t = JSON.parse(e);
|
|
188
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
188
|
+
return Array.isArray(t) ? t.map((e) => U(e) ? gt(e) : null).filter((e) => e !== null) : [];
|
|
189
189
|
} catch {
|
|
190
190
|
return [];
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function V(e, t) {
|
|
194
194
|
let n = e[t];
|
|
195
195
|
return typeof n == "string" ? n : null;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function vt(e, t) {
|
|
198
198
|
let n = e[t];
|
|
199
199
|
return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function yt(e, t) {
|
|
202
202
|
let n = e[t];
|
|
203
203
|
return typeof n == "number" ? n : null;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function H(e) {
|
|
206
206
|
return typeof e == "string" && e.trim().length > 0;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function U(e) {
|
|
209
209
|
return typeof e == "object" && !!e;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function bt(e) {
|
|
212
212
|
return e.status === "PENDING" || e.status === "IN_PROGRESS";
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
214
|
+
function W(e) {
|
|
215
|
+
return N(e) || (e instanceof Error ? e.message : "發生未知錯誤");
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function xt(e) {
|
|
218
218
|
return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function St(e) {
|
|
221
221
|
return e.length > 16 ? `${e.slice(0, 12)}...` : e;
|
|
222
222
|
}
|
|
223
223
|
function Ct(e) {
|
|
224
224
|
return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function G(e) {
|
|
227
227
|
return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function K(e) {
|
|
230
230
|
return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function wt(e) {
|
|
233
233
|
return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Tt(e, t) {
|
|
236
236
|
return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function q(e, t) {
|
|
239
239
|
if (!e) return "-";
|
|
240
240
|
let n = t.get(e);
|
|
241
241
|
return n ? i(n.name, n.email, "fullwidth") : e;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
let n =
|
|
245
|
-
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) =>
|
|
246
|
-
let r =
|
|
243
|
+
function Et(e, t = /* @__PURE__ */ new Map()) {
|
|
244
|
+
let n = _t(e.delegationChainJson);
|
|
245
|
+
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => q(e, t)).join("、")}` : "未指定";
|
|
246
|
+
let r = q(e.assigneeMemberId, t), i = q(e.originalAssigneeMemberId, t);
|
|
247
247
|
return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function Dt(e, t) {
|
|
250
250
|
return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
let n = e.filter((e) =>
|
|
252
|
+
function Ot(e, t) {
|
|
253
|
+
let n = e.filter((e) => Dt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
|
|
254
254
|
return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function kt(e, t) {
|
|
257
257
|
if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
|
|
258
258
|
if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
|
|
259
259
|
id: e.id,
|
|
260
|
-
name: `${e.data.label}(${
|
|
260
|
+
name: `${e.data.label}(${wt(e.type)})`
|
|
261
261
|
}));
|
|
262
262
|
let n = t.data.returnBehavior.allowedTargets === "INITIATOR" ? e.nodes.find((e) => e.type === "startEvent")?.id : e.edges.find((e) => e.target === t.id)?.source, r = e.nodes.find((e) => e.id === n);
|
|
263
263
|
return r ? [{
|
|
264
264
|
id: r.id,
|
|
265
|
-
name: `${r.data.label}(${
|
|
265
|
+
name: `${r.data.label}(${wt(r.type)})`
|
|
266
266
|
}] : [];
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function At(e) {
|
|
269
269
|
return {
|
|
270
270
|
email: e.email,
|
|
271
271
|
id: e.memberId,
|
|
@@ -297,11 +297,11 @@ function jt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
|
|
|
297
297
|
valid: !1
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function J(e) {
|
|
301
301
|
return !!e;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
if (!
|
|
303
|
+
function Mt(e) {
|
|
304
|
+
if (!U(e)) return null;
|
|
305
305
|
let t = e.email, n = e.id, r = e.name;
|
|
306
306
|
return typeof n == "string" && typeof r == "string" ? {
|
|
307
307
|
email: typeof t == "string" ? t : null,
|
|
@@ -309,7 +309,7 @@ function Nt(e) {
|
|
|
309
309
|
name: r
|
|
310
310
|
} : null;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Nt(e, t) {
|
|
313
313
|
let n = e.trim().toLocaleLowerCase();
|
|
314
314
|
if (!n) return null;
|
|
315
315
|
let r = t.filter((e) => [
|
|
@@ -319,21 +319,21 @@ function Pt(e, t) {
|
|
|
319
319
|
].some((e) => e.toLocaleLowerCase().includes(n)));
|
|
320
320
|
return r.length === 1 ? r[0] ?? null : null;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
return
|
|
322
|
+
function Y(e) {
|
|
323
|
+
return H(e) ? {
|
|
324
324
|
text: e,
|
|
325
325
|
type: "text"
|
|
326
326
|
} : null;
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
return
|
|
328
|
+
function Pt(e, t, n = "neutral") {
|
|
329
|
+
return H(t) ? {
|
|
330
330
|
label: e,
|
|
331
331
|
text: t,
|
|
332
332
|
tone: n,
|
|
333
333
|
type: "comment"
|
|
334
334
|
} : null;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Ft(e, t, n, r) {
|
|
337
337
|
let i = t ? n.get(t) : null;
|
|
338
338
|
return {
|
|
339
339
|
email: i?.email ?? null,
|
|
@@ -343,38 +343,38 @@ function It(e, t, n, r) {
|
|
|
343
343
|
type: "member"
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function It(e) {
|
|
347
347
|
return !!e;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function Lt(e) {
|
|
350
350
|
let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
|
|
351
351
|
return t === -1 ? e.length : t;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" ||
|
|
353
|
+
function X(e) {
|
|
354
|
+
return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Z(e) || zt(e.eventType, Ut(e));
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
return e.eventType === "TASK_CREATED" &&
|
|
356
|
+
function Z(e) {
|
|
357
|
+
return e.eventType === "TASK_CREATED" && vt(Ut(e), "sequentialCandidateMemberIds").length > 0;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Q(e) {
|
|
360
360
|
if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
|
|
361
361
|
let t = Ut(e);
|
|
362
362
|
return [
|
|
363
|
-
...
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
].filter(
|
|
363
|
+
...vt(t, "sequentialCandidateMemberIds"),
|
|
364
|
+
V(t, "candidateMemberId"),
|
|
365
|
+
V(t, "previousMemberId")
|
|
366
|
+
].filter(H);
|
|
367
367
|
}
|
|
368
|
-
var
|
|
368
|
+
var Rt = /* @__PURE__ */ new Set([
|
|
369
369
|
"SERVICE_TASK_EXECUTED",
|
|
370
370
|
"SERVICE_TASK_FAILED",
|
|
371
371
|
"WEBHOOK_DELIVERY_RETRIED"
|
|
372
372
|
]);
|
|
373
|
-
function
|
|
374
|
-
return
|
|
373
|
+
function zt(e, t) {
|
|
374
|
+
return Rt.has(e) && V(t, "action") === "NOTIFY_WEBHOOK";
|
|
375
375
|
}
|
|
376
376
|
function Bt(e) {
|
|
377
|
-
return
|
|
377
|
+
return V(e, "endpointLabel") ?? V(e, "endpointKey") ?? "外部系統";
|
|
378
378
|
}
|
|
379
379
|
function Vt(e) {
|
|
380
380
|
return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
|
|
@@ -388,10 +388,10 @@ function Ht(e, t) {
|
|
|
388
388
|
if (e === "TOKEN_ADVANCED") return "流程已前進";
|
|
389
389
|
if (e === "TASK_CREATED") return "待簽任務已建立";
|
|
390
390
|
if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
|
|
391
|
-
if (e === "TASK_DECIDED") return Vt(
|
|
391
|
+
if (e === "TASK_DECIDED") return Vt(V(t, "action"));
|
|
392
392
|
if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
|
|
393
393
|
if (e === "TASK_REASSIGNED") return "管理者改派待辦";
|
|
394
|
-
if (
|
|
394
|
+
if (zt(e, t)) {
|
|
395
395
|
let n = Bt(t);
|
|
396
396
|
return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
|
|
397
397
|
}
|
|
@@ -400,70 +400,70 @@ function Ht(e, t) {
|
|
|
400
400
|
function Ut(e) {
|
|
401
401
|
try {
|
|
402
402
|
let t = JSON.parse(e.payloadJson);
|
|
403
|
-
return
|
|
403
|
+
return U(t) ? t : {};
|
|
404
404
|
} catch {
|
|
405
405
|
return {};
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
function Wt(e, t) {
|
|
409
|
-
return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" &&
|
|
409
|
+
return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && zt(e.eventType, t) || V(t, "action") === "REJECTED" || V(t, "instanceState") === "REJECTED";
|
|
410
410
|
}
|
|
411
411
|
function Gt(e) {
|
|
412
412
|
return t(e);
|
|
413
413
|
}
|
|
414
414
|
function Kt(e, t, n, r) {
|
|
415
|
-
if (e.eventType === "INSTANCE_STARTED") return
|
|
415
|
+
if (e.eventType === "INSTANCE_STARTED") return ht({
|
|
416
416
|
initiatorMemberId: e.actorMemberId,
|
|
417
|
-
submittedByMemberId:
|
|
417
|
+
submittedByMemberId: V(t, "submittedByMemberId")
|
|
418
418
|
}, r);
|
|
419
419
|
if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
|
|
420
|
-
let e =
|
|
420
|
+
let e = V(t, "candidateMemberId"), n = V(t, "previousMemberId");
|
|
421
421
|
if (!e) return null;
|
|
422
|
-
let i =
|
|
423
|
-
return n ? `輪到:${i}(前一位:${
|
|
422
|
+
let i = q(e, r);
|
|
423
|
+
return n ? `輪到:${i}(前一位:${q(n, r)})` : `輪到:${i}`;
|
|
424
424
|
}
|
|
425
425
|
if (e.eventType === "TASK_CREATED") {
|
|
426
|
-
let e =
|
|
427
|
-
if (e.length) return `簽核順序:${e.map((e) =>
|
|
428
|
-
let n =
|
|
426
|
+
let e = vt(t, "sequentialCandidateMemberIds");
|
|
427
|
+
if (e.length) return `簽核順序:${e.map((e) => q(e, r)).join(" → ")}`;
|
|
428
|
+
let n = V(t, "assigneeMemberId"), i = V(t, "originalAssigneeMemberId");
|
|
429
429
|
if (!n) {
|
|
430
|
-
let e =
|
|
431
|
-
return e.length ? `候選簽核人:${e.map((e) =>
|
|
430
|
+
let e = vt(t, "candidateMemberIds");
|
|
431
|
+
return e.length ? `候選簽核人:${e.map((e) => q(e, r)).join("、")}` : null;
|
|
432
432
|
}
|
|
433
|
-
let a =
|
|
433
|
+
let a = q(n, r), o = q(i, r);
|
|
434
434
|
return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
|
|
435
435
|
}
|
|
436
436
|
if (e.eventType === "TASK_DECIDED") {
|
|
437
|
-
let e =
|
|
438
|
-
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(
|
|
437
|
+
let e = V(t, "action"), n = V(t, "comment"), i = e ? `決議:${K(e)}` : null, a = V(t, "transferToMemberId");
|
|
438
|
+
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(H).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(H).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${q(a, r)}`].filter(H).join(" · ") : i;
|
|
439
439
|
}
|
|
440
440
|
if (e.eventType === "TOKEN_ADVANCED") {
|
|
441
|
-
let e =
|
|
442
|
-
if (e) return `流程結果:${
|
|
443
|
-
let r =
|
|
441
|
+
let e = V(t, "action");
|
|
442
|
+
if (e) return `流程結果:${K(e)}`;
|
|
443
|
+
let r = yt(t, "arrivedCount"), i = yt(t, "requiredCount");
|
|
444
444
|
if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
|
|
445
|
-
let a =
|
|
446
|
-
if (a && o) return `由 ${
|
|
445
|
+
let a = V(t, "fromNodeId"), o = V(t, "toNodeId");
|
|
446
|
+
if (a && o) return `由 ${Tt(a, n)} 前進至 ${Tt(o, n)}`;
|
|
447
447
|
}
|
|
448
448
|
if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
|
|
449
|
-
let e =
|
|
449
|
+
let e = V(t, "state");
|
|
450
450
|
return e ? `案件狀態:${Ct(e)}` : null;
|
|
451
451
|
}
|
|
452
452
|
return null;
|
|
453
453
|
}
|
|
454
454
|
function qt(e, t, n, r, i, a, o, s = null) {
|
|
455
|
-
if (e.eventType !== "TASK_DECIDED") return [
|
|
456
|
-
let c = e.taskId ? r.get(e.taskId) : null, l =
|
|
455
|
+
if (e.eventType !== "TASK_DECIDED") return [Y(Kt(e, t, n, o))].filter(It);
|
|
456
|
+
let c = e.taskId ? r.get(e.taskId) : null, l = V(t, "action") ?? c?.action ?? null, u = V(t, "comment") ?? c?.comment ?? null, d = V(t, "transferToMemberId") ?? c?.transferToMemberId ?? null, f = V(t, "signatureId") ?? c?.signatureId ?? null, p = f ? i.get(f) : null;
|
|
457
457
|
return [
|
|
458
|
-
|
|
459
|
-
l === "REJECTED" ?
|
|
460
|
-
l === "APPROVED" ?
|
|
461
|
-
l === "RETURNED" ?
|
|
462
|
-
l === "TRANSFERRED" ?
|
|
463
|
-
l === "TRANSFERRED" ?
|
|
464
|
-
|
|
465
|
-
p ?
|
|
466
|
-
].filter(
|
|
458
|
+
Y(l ? `決議:${K(l)}` : null),
|
|
459
|
+
l === "REJECTED" ? Pt("拒絕原因", u ?? "-", "danger") : null,
|
|
460
|
+
l === "APPROVED" ? Pt("同意說明", u) : null,
|
|
461
|
+
l === "RETURNED" ? Pt("退回說明", u ?? "-") : null,
|
|
462
|
+
l === "TRANSFERRED" ? Y(`轉派給:${q(d, o)}`) : null,
|
|
463
|
+
l === "TRANSFERRED" ? Pt("轉派說明", u ?? "-") : null,
|
|
464
|
+
Y(Jt(t, s)),
|
|
465
|
+
p ? Y(a?.valid ? `簽章:已驗證(${St(p.signedPayloadHash)})` : `簽章:待檢查(${St(p.signedPayloadHash)})`) : null
|
|
466
|
+
].filter(It);
|
|
467
467
|
}
|
|
468
468
|
function Jt(e, t) {
|
|
469
469
|
let n = e.changedFieldKeys;
|
|
@@ -495,7 +495,7 @@ function Zt(e, t, n, r, i) {
|
|
|
495
495
|
return Qt(e, n, r, i).reduce((e, t) => tn(e, $t(t, o, a)), /* @__PURE__ */ new Map());
|
|
496
496
|
}
|
|
497
497
|
function Qt(e, t, n, r) {
|
|
498
|
-
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(
|
|
498
|
+
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(bt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
|
|
499
499
|
...i,
|
|
500
500
|
...a,
|
|
501
501
|
...o
|
|
@@ -525,30 +525,30 @@ function nn(e) {
|
|
|
525
525
|
return e.type === "userTask" ? `未來簽核:${e.data.label}` : e.type === "serviceTask" ? `未來知會:${e.data.label}` : e.type === "exclusiveGateway" ? `未來分流:${e.data.label}` : e.type === "parallelGateway" ? `未來匯合:${e.data.label}` : e.type === "endEvent" ? `流程完成:${e.data.label}` : `未來節點:${e.data.label}`;
|
|
526
526
|
}
|
|
527
527
|
function rn(e, t, n, r, i, a, o, s, c, l = null) {
|
|
528
|
-
let u = e.filter(
|
|
529
|
-
let t = Ut(e), n = e.nodeId ?
|
|
528
|
+
let u = e.filter(X).map((e) => {
|
|
529
|
+
let t = Ut(e), n = e.nodeId ? Tt(e.nodeId, r) : null;
|
|
530
530
|
return {
|
|
531
531
|
descriptionParts: [
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
532
|
+
Y(n ? `節點:${n}` : "節點:全流程"),
|
|
533
|
+
Ft("操作者", e.actorMemberId, a, "系統"),
|
|
534
|
+
Y(`時間:${Gt(e.createdAt)}`),
|
|
535
535
|
...qt(e, t, r, o, s, c, a, l)
|
|
536
|
-
].filter(
|
|
536
|
+
].filter(It),
|
|
537
537
|
error: Wt(e, t),
|
|
538
538
|
id: e.id,
|
|
539
539
|
title: Ht(e.eventType, t)
|
|
540
540
|
};
|
|
541
|
-
}), d = t.filter(
|
|
541
|
+
}), d = t.filter(bt).map((e) => ({
|
|
542
542
|
descriptionParts: [
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
].filter(
|
|
543
|
+
Y(`節點:${Tt(e.nodeId, r)}`),
|
|
544
|
+
Ft("處理者", e.assigneeMemberId, a, "未指定"),
|
|
545
|
+
Y(`建立時間:${Gt(e.createdAt)}`)
|
|
546
|
+
].filter(It),
|
|
547
547
|
error: !1,
|
|
548
548
|
id: `pending-task-${e.id}`,
|
|
549
549
|
title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
|
|
550
|
-
})), f = new Set([...e.filter(
|
|
551
|
-
descriptionParts: [
|
|
550
|
+
})), f = new Set([...e.filter(X).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(H)), p = r ? Xt(r, t, n, i, f).map((e) => ({
|
|
551
|
+
descriptionParts: [Y(`${wt(e.type)} · 尚未抵達`)].filter(It),
|
|
552
552
|
error: !1,
|
|
553
553
|
forcePending: !0,
|
|
554
554
|
id: `future-node-${e.id}`,
|
|
@@ -581,17 +581,17 @@ var an = {
|
|
|
581
581
|
function on(e, t, n, r) {
|
|
582
582
|
let i = t.filter((t) => t.nodeId === e.id), a = i.find((e) => e.status === "PENDING" || e.status === "IN_PROGRESS"), o = i.find((e) => e.status === "CANCELLED"), s = i.find((e) => e.status === "COMPLETED"), c = n.filter((t) => t.currentNodeId === e.id), l = c.find((e) => e.status === "ACTIVE"), u = c.find((e) => e.status === "WAITING");
|
|
583
583
|
if (a) return {
|
|
584
|
-
secondaryLabel: `處理者 ${
|
|
584
|
+
secondaryLabel: `處理者 ${Et(a)}`,
|
|
585
585
|
statusLabel: "待處理",
|
|
586
586
|
tone: "current"
|
|
587
587
|
};
|
|
588
588
|
if (o) return {
|
|
589
|
-
secondaryLabel: `已取消 ${
|
|
589
|
+
secondaryLabel: `已取消 ${Et(o)}`,
|
|
590
590
|
statusLabel: "已取消",
|
|
591
591
|
tone: "cancelled"
|
|
592
592
|
};
|
|
593
593
|
if (s) return {
|
|
594
|
-
secondaryLabel: `已完成 ${
|
|
594
|
+
secondaryLabel: `已完成 ${Et(s)}`,
|
|
595
595
|
statusLabel: "已完成",
|
|
596
596
|
tone: "completed"
|
|
597
597
|
};
|
|
@@ -615,7 +615,7 @@ function on(e, t, n, r) {
|
|
|
615
615
|
...d,
|
|
616
616
|
secondaryLabel: r
|
|
617
617
|
} : {
|
|
618
|
-
secondaryLabel:
|
|
618
|
+
secondaryLabel: wt(e.type),
|
|
619
619
|
statusLabel: "未抵達",
|
|
620
620
|
tone: "neutral"
|
|
621
621
|
};
|
|
@@ -627,15 +627,15 @@ async function sn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks
|
|
|
627
627
|
n?.initiatorMemberId ?? null,
|
|
628
628
|
n?.submittedByMemberId ?? null,
|
|
629
629
|
...e.map((e) => e.actorMemberId),
|
|
630
|
-
...e.flatMap(
|
|
630
|
+
...e.flatMap(Q),
|
|
631
631
|
...r.map((e) => e.assigneeMemberId),
|
|
632
632
|
...r.map((e) => e.originalAssigneeMemberId),
|
|
633
633
|
...r.flatMap((e) => e.candidateMemberIds),
|
|
634
|
-
...r.flatMap((e) =>
|
|
634
|
+
...r.flatMap((e) => _t(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
|
|
635
635
|
...t.flatMap((e) => [e.createdByMemberId, ...cn(e.targetValueJson)])
|
|
636
|
-
].filter(
|
|
636
|
+
].filter(H))];
|
|
637
637
|
try {
|
|
638
|
-
return await
|
|
638
|
+
return await Ne(i);
|
|
639
639
|
} catch {
|
|
640
640
|
return [];
|
|
641
641
|
}
|
|
@@ -648,7 +648,7 @@ function cn(e) {
|
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
async function ln(e) {
|
|
651
|
-
return (await Promise.all(e.map((e) =>
|
|
651
|
+
return (await Promise.all(e.map((e) => O(e.id)))).flat();
|
|
652
652
|
}
|
|
653
653
|
function un(e) {
|
|
654
654
|
return e.reduce((e, t) => {
|
|
@@ -658,44 +658,44 @@ function un(e) {
|
|
|
658
658
|
}
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region src/views/instances/detail/sections/InstanceFormSection.tsx
|
|
661
|
-
var
|
|
661
|
+
var dn = {
|
|
662
662
|
display: "grid",
|
|
663
663
|
gap: 16
|
|
664
|
-
},
|
|
664
|
+
}, $ = {
|
|
665
665
|
display: "flex",
|
|
666
666
|
flexWrap: "wrap",
|
|
667
667
|
gap: 8
|
|
668
668
|
};
|
|
669
|
-
function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fieldLabelMarkers: i, fill: a = null, instance: o, loading: s, onDataSourceStateChange: c, onResubmitFormChange: l, onReloadAfterConflict: d = null, onResubmitInstance: f, onUploadAttachment: p, resubmitFormData: ee, resubmitFormErrors:
|
|
670
|
-
let
|
|
669
|
+
function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fieldLabelMarkers: i, fill: a = null, instance: o, loading: s, onDataSourceStateChange: c, onResubmitFormChange: l, onReloadAfterConflict: d = null, onResubmitInstance: f, onUploadAttachment: p, resubmitFormData: ee, resubmitFormErrors: te }) {
|
|
670
|
+
let m = o?.formDefinitionSnapshot.schema, h = o?.workflowSnapshot, re = _(() => e && m && h ? u(m, h) : a?.schema ?? m, [
|
|
671
671
|
e,
|
|
672
672
|
a?.schema,
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
]),
|
|
676
|
-
return /* @__PURE__ */
|
|
677
|
-
style:
|
|
673
|
+
m,
|
|
674
|
+
h
|
|
675
|
+
]), g = !e && a !== null;
|
|
676
|
+
return /* @__PURE__ */ D("div", {
|
|
677
|
+
style: dn,
|
|
678
678
|
children: [
|
|
679
|
-
n ? /* @__PURE__ */
|
|
679
|
+
n ? /* @__PURE__ */ E(w, {
|
|
680
680
|
color: "text-error",
|
|
681
681
|
variant: "body",
|
|
682
682
|
children: n
|
|
683
683
|
}) : null,
|
|
684
|
-
s ? /* @__PURE__ */
|
|
684
|
+
s ? /* @__PURE__ */ E(w, {
|
|
685
685
|
color: "text-neutral",
|
|
686
686
|
variant: "body",
|
|
687
687
|
children: "載入中..."
|
|
688
688
|
}) : null,
|
|
689
|
-
d ? /* @__PURE__ */
|
|
690
|
-
style:
|
|
691
|
-
children: [/* @__PURE__ */
|
|
689
|
+
d ? /* @__PURE__ */ D("div", {
|
|
690
|
+
style: dn,
|
|
691
|
+
children: [/* @__PURE__ */ E(x, {
|
|
692
692
|
content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
|
|
693
693
|
severity: "error"
|
|
694
|
-
}), /* @__PURE__ */
|
|
695
|
-
style:
|
|
696
|
-
children: /* @__PURE__ */
|
|
694
|
+
}), /* @__PURE__ */ E("div", {
|
|
695
|
+
style: $,
|
|
696
|
+
children: /* @__PURE__ */ E(y, {
|
|
697
697
|
disabled: s,
|
|
698
|
-
icon:
|
|
698
|
+
icon: Ke,
|
|
699
699
|
iconType: "leading",
|
|
700
700
|
onClick: d,
|
|
701
701
|
variant: "base-secondary",
|
|
@@ -703,40 +703,40 @@ function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fie
|
|
|
703
703
|
})
|
|
704
704
|
})]
|
|
705
705
|
}) : null,
|
|
706
|
-
|
|
706
|
+
g && a.fieldCount > 0 ? /* @__PURE__ */ E(x, {
|
|
707
707
|
content: `本關需要你補填 ${a.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
|
|
708
708
|
severity: "info"
|
|
709
709
|
}) : null,
|
|
710
|
-
|
|
710
|
+
re && o?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ne, {
|
|
711
711
|
dataSourceContext: e ? {
|
|
712
712
|
instanceId: o.id,
|
|
713
713
|
kind: "runtime"
|
|
714
714
|
} : void 0,
|
|
715
715
|
dataSourceInitialValues: o.formData,
|
|
716
|
-
errors:
|
|
716
|
+
errors: g ? a.errors : te,
|
|
717
717
|
...!e && r ? { fieldAccess: r } : {},
|
|
718
718
|
...!e && i ? { fieldLabelMarkers: i } : {},
|
|
719
719
|
onChange: (e) => {
|
|
720
|
-
|
|
720
|
+
g ? a.onChange(e) : l(e);
|
|
721
721
|
},
|
|
722
722
|
onDataSourceStateChange: c,
|
|
723
723
|
onUploadAttachment: e ? p : void 0,
|
|
724
724
|
optionSnapshots: o.formDataOptionSnapshot,
|
|
725
725
|
readonly: !e,
|
|
726
|
-
schema:
|
|
726
|
+
schema: re,
|
|
727
727
|
uiSchema: o.formDefinitionSnapshot.uiSchema,
|
|
728
|
-
value: e ? ee :
|
|
729
|
-
}), e ? /* @__PURE__ */
|
|
730
|
-
style:
|
|
731
|
-
children: /* @__PURE__ */
|
|
728
|
+
value: e ? ee : g ? a.value : o.formData
|
|
729
|
+
}), e ? /* @__PURE__ */ E("div", {
|
|
730
|
+
style: $,
|
|
731
|
+
children: /* @__PURE__ */ E(y, {
|
|
732
732
|
disabled: t,
|
|
733
|
-
icon:
|
|
733
|
+
icon: Ke,
|
|
734
734
|
iconType: "leading",
|
|
735
735
|
onClick: f,
|
|
736
736
|
variant: "base-primary",
|
|
737
737
|
children: "重新送出"
|
|
738
738
|
})
|
|
739
|
-
}) : null] }) : /* @__PURE__ */
|
|
739
|
+
}) : null] }) : /* @__PURE__ */ E(w, {
|
|
740
740
|
color: "text-neutral",
|
|
741
741
|
variant: "body",
|
|
742
742
|
children: "此案件沒有可顯示的表單快照。"
|
|
@@ -758,7 +758,7 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
758
758
|
id: e.id,
|
|
759
759
|
key: e.id,
|
|
760
760
|
mimeType: e.mimeType,
|
|
761
|
-
sizeLabel:
|
|
761
|
+
sizeLabel: xt(Number(e.sizeBytes))
|
|
762
762
|
})), [e]), a = _(() => [
|
|
763
763
|
{
|
|
764
764
|
dataIndex: "filename",
|
|
@@ -780,7 +780,7 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
780
780
|
},
|
|
781
781
|
{
|
|
782
782
|
key: "createdAt",
|
|
783
|
-
render: (e) => /* @__PURE__ */
|
|
783
|
+
render: (e) => /* @__PURE__ */ E(w, {
|
|
784
784
|
component: "span",
|
|
785
785
|
variant: "body",
|
|
786
786
|
children: t(e.createdAt)
|
|
@@ -790,14 +790,14 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
790
790
|
}
|
|
791
791
|
], []), o = _(() => ({
|
|
792
792
|
render: (e) => [...e.mimeType === "application/pdf" ? [{
|
|
793
|
-
icon:
|
|
793
|
+
icon: Ue,
|
|
794
794
|
iconType: "leading",
|
|
795
795
|
name: "預覽",
|
|
796
796
|
onClick: () => {
|
|
797
797
|
r(e.attachment);
|
|
798
798
|
}
|
|
799
799
|
}] : [], {
|
|
800
|
-
icon:
|
|
800
|
+
icon: He,
|
|
801
801
|
iconType: "leading",
|
|
802
802
|
name: "下載",
|
|
803
803
|
onClick: () => {
|
|
@@ -807,18 +807,18 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
807
807
|
variant: "base-secondary",
|
|
808
808
|
width: 160
|
|
809
809
|
}), [n, r]);
|
|
810
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ D("div", {
|
|
811
811
|
style: pn,
|
|
812
|
-
children: [/* @__PURE__ */
|
|
812
|
+
children: [/* @__PURE__ */ E(w, {
|
|
813
813
|
component: "h2",
|
|
814
814
|
variant: "h3",
|
|
815
815
|
children: "附件"
|
|
816
|
-
}), i.length > 0 ? /* @__PURE__ */
|
|
816
|
+
}), i.length > 0 ? /* @__PURE__ */ E(ge, {
|
|
817
817
|
actions: o,
|
|
818
818
|
columns: a,
|
|
819
819
|
dataSource: i,
|
|
820
820
|
fullWidth: !0
|
|
821
|
-
}) : /* @__PURE__ */
|
|
821
|
+
}) : /* @__PURE__ */ E(w, {
|
|
822
822
|
color: "text-neutral",
|
|
823
823
|
variant: "body",
|
|
824
824
|
children: "此案件沒有附件。"
|
|
@@ -864,22 +864,26 @@ var xn = {
|
|
|
864
864
|
}, {
|
|
865
865
|
id: "WEBHOOK",
|
|
866
866
|
name: "Webhook"
|
|
867
|
-
}], Tn =
|
|
868
|
-
let [
|
|
867
|
+
}], Tn = re(function({ adhocDirectives: e, currentMemberId: r, fill: i = null, instance: o, memberProfilesById: s, onChanged: c, onDecidingChange: l, onFillApproveError: u, tasks: d }, f) {
|
|
868
|
+
let [p, ee] = v(!1), [te, m] = v(null);
|
|
869
|
+
ie(() => {
|
|
870
|
+
l?.(p);
|
|
871
|
+
}, [p, l]);
|
|
872
|
+
let [ne, h] = v(""), [re, g] = v(!1), [oe, x] = v(""), [de, fe] = v(null), [pe, me] = v(!1), [he, ve] = v(""), [be, we] = v(!1), [Te, O] = v(null), [Ee, De] = v(""), [Oe, ke] = v(null), [Ae, Ne] = v(!1), [Pe, Fe] = v([]), [Ie, Le] = v(!1), [Re, ze] = v(""), [Be, Ve] = v([]), [He, Ue] = v(!1), [We, Ge] = v([]), [Ke, qe] = v(!1), [A, Je] = v("COUNTERSIGN"), [Ye, j] = v("REJECT_INSTANCE"), [M, Xe] = v(!1), [Ze, Qe] = v("MEMBER"), [$e, et] = v(""), N = oe.trim(), tt = he.trim(), nt = Ee.trim(), P = _(() => Ot(d, r), [r, d]), F = _(() => P && o ? o.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, o]), I = _(() => F && o ? kt(o.workflowSnapshot, F) : [], [F, o]), rt = F?.type === "userTask" && F.data.returnBehavior.allowReturn, L = F?.type === "userTask" && F.data.allowReject !== !1, it = F?.type === "userTask" && F.data.allowTransfer !== !1, at = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, R = F?.type === "userTask" && F.data.allowAddSigner, z = _(() => e.filter((e) => e.status === "PENDING"), [e]), ot = I.find((e) => e.id === Te) ?? I[0] ?? null, st = _(() => d.map((e) => ({
|
|
869
873
|
...e,
|
|
870
|
-
assigneeLabel:
|
|
874
|
+
assigneeLabel: Et(e, s),
|
|
871
875
|
fillFieldCount: Dn(e, o?.workflowSnapshot ?? null),
|
|
872
876
|
key: e.id,
|
|
873
877
|
nodeLabel: a({
|
|
874
878
|
...e,
|
|
875
|
-
nodeLabel:
|
|
879
|
+
nodeLabel: Tt(e.nodeId, o?.workflowSnapshot ?? null)
|
|
876
880
|
}),
|
|
877
|
-
statusLabel:
|
|
881
|
+
statusLabel: G(e.status)
|
|
878
882
|
})), [
|
|
879
883
|
o,
|
|
880
884
|
s,
|
|
881
|
-
|
|
882
|
-
]),
|
|
885
|
+
d
|
|
886
|
+
]), ct = _(() => [
|
|
883
887
|
{
|
|
884
888
|
dataIndex: "nodeLabel",
|
|
885
889
|
key: "nodeLabel",
|
|
@@ -889,7 +893,7 @@ var xn = {
|
|
|
889
893
|
{
|
|
890
894
|
key: "assigneeMemberId",
|
|
891
895
|
title: "處理者",
|
|
892
|
-
render: (e) => /* @__PURE__ */
|
|
896
|
+
render: (e) => /* @__PURE__ */ E(w, {
|
|
893
897
|
component: "span",
|
|
894
898
|
variant: "body",
|
|
895
899
|
children: e.assigneeLabel
|
|
@@ -904,7 +908,7 @@ var xn = {
|
|
|
904
908
|
},
|
|
905
909
|
{
|
|
906
910
|
key: "fill",
|
|
907
|
-
render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */
|
|
911
|
+
render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ E(ce, {
|
|
908
912
|
size: "sub",
|
|
909
913
|
text: `需補填 ${e.fillFieldCount} 欄`,
|
|
910
914
|
variant: "dot-warning"
|
|
@@ -914,7 +918,7 @@ var xn = {
|
|
|
914
918
|
},
|
|
915
919
|
{
|
|
916
920
|
key: "createdAt",
|
|
917
|
-
render: (e) => /* @__PURE__ */
|
|
921
|
+
render: (e) => /* @__PURE__ */ E(w, {
|
|
918
922
|
component: "span",
|
|
919
923
|
variant: "body",
|
|
920
924
|
children: t(e.createdAt)
|
|
@@ -922,13 +926,13 @@ var xn = {
|
|
|
922
926
|
title: "建立時間",
|
|
923
927
|
width: 220
|
|
924
928
|
}
|
|
925
|
-
], []),
|
|
929
|
+
], []), lt = _(() => z.map((e) => ({
|
|
926
930
|
...e,
|
|
927
|
-
createdByLabel:
|
|
931
|
+
createdByLabel: q(e.createdByMemberId, s),
|
|
928
932
|
key: e.id,
|
|
929
933
|
targetLabel: En(e, s),
|
|
930
934
|
typeLabel: xn[e.type]
|
|
931
|
-
})), [s,
|
|
935
|
+
})), [s, z]), ut = _(() => [
|
|
932
936
|
{
|
|
933
937
|
dataIndex: "typeLabel",
|
|
934
938
|
key: "typeLabel",
|
|
@@ -937,7 +941,7 @@ var xn = {
|
|
|
937
941
|
},
|
|
938
942
|
{
|
|
939
943
|
key: "targetLabel",
|
|
940
|
-
render: (e) => /* @__PURE__ */
|
|
944
|
+
render: (e) => /* @__PURE__ */ E(w, {
|
|
941
945
|
component: "span",
|
|
942
946
|
variant: "body",
|
|
943
947
|
children: e.targetLabel
|
|
@@ -947,7 +951,7 @@ var xn = {
|
|
|
947
951
|
},
|
|
948
952
|
{
|
|
949
953
|
key: "createdByLabel",
|
|
950
|
-
render: (e) => /* @__PURE__ */
|
|
954
|
+
render: (e) => /* @__PURE__ */ E(w, {
|
|
951
955
|
component: "span",
|
|
952
956
|
variant: "body",
|
|
953
957
|
children: e.createdByLabel
|
|
@@ -957,7 +961,7 @@ var xn = {
|
|
|
957
961
|
},
|
|
958
962
|
{
|
|
959
963
|
key: "createdAt",
|
|
960
|
-
render: (e) => /* @__PURE__ */
|
|
964
|
+
render: (e) => /* @__PURE__ */ E(w, {
|
|
961
965
|
component: "span",
|
|
962
966
|
variant: "body",
|
|
963
967
|
children: t(e.createdAt)
|
|
@@ -967,129 +971,129 @@ var xn = {
|
|
|
967
971
|
},
|
|
968
972
|
{
|
|
969
973
|
key: "actions",
|
|
970
|
-
render: (e) => e.createdByMemberId === r ? /* @__PURE__ */
|
|
971
|
-
disabled:
|
|
972
|
-
onClick: () => void
|
|
974
|
+
render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ E(y, {
|
|
975
|
+
disabled: M,
|
|
976
|
+
onClick: () => void Dt(e.id),
|
|
973
977
|
size: "minor",
|
|
974
978
|
variant: "destructive-secondary",
|
|
975
979
|
children: "撤回"
|
|
976
|
-
}) : /* @__PURE__ */ T
|
|
980
|
+
}) : /* @__PURE__ */ E(T, {}),
|
|
977
981
|
title: "操作",
|
|
978
982
|
width: 100
|
|
979
983
|
}
|
|
980
|
-
], [
|
|
981
|
-
async function
|
|
982
|
-
if (!r || !
|
|
983
|
-
|
|
984
|
-
let o = e === "APPROVED" && i !== null && !
|
|
984
|
+
], [M, r]);
|
|
985
|
+
async function dt({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
|
|
986
|
+
if (!r || !P || e === "REJECTED" && !L || e === "TRANSFERRED" && !it) return !1;
|
|
987
|
+
ee(!0), m(null);
|
|
988
|
+
let o = e === "APPROVED" && i !== null && !P.isAdhoc ? {
|
|
985
989
|
expectedFormDataFingerprint: i.expectedFormDataFingerprint,
|
|
986
990
|
formData: i.formData
|
|
987
991
|
} : null;
|
|
988
992
|
try {
|
|
989
|
-
await
|
|
993
|
+
await Ce({
|
|
990
994
|
action: e,
|
|
991
995
|
comment: t,
|
|
992
996
|
decidedByMemberId: r,
|
|
993
997
|
fill: o,
|
|
994
998
|
returnToNodeId: n,
|
|
995
|
-
taskId:
|
|
999
|
+
taskId: P.id,
|
|
996
1000
|
transferToMemberId: a
|
|
997
|
-
}),
|
|
1001
|
+
}), me(!1), we(!1), Le(!1), x(""), ve(""), De(""), ke(null), O(null), fe(null);
|
|
998
1002
|
} catch (e) {
|
|
999
|
-
return
|
|
1003
|
+
return ee(!1), o !== null && e instanceof Error && u?.(e.message) === !0 ? (g(!1), !1) : (m(W(e)), !1);
|
|
1000
1004
|
}
|
|
1001
1005
|
try {
|
|
1002
1006
|
await c();
|
|
1003
1007
|
} catch (e) {
|
|
1004
|
-
m(
|
|
1008
|
+
m(W(e));
|
|
1005
1009
|
} finally {
|
|
1006
|
-
|
|
1010
|
+
ee(!1);
|
|
1007
1011
|
}
|
|
1008
1012
|
return !0;
|
|
1009
1013
|
}
|
|
1010
|
-
function
|
|
1011
|
-
r &&
|
|
1014
|
+
function ft() {
|
|
1015
|
+
r && P && (m(null), g(!0));
|
|
1012
1016
|
}
|
|
1013
|
-
function
|
|
1014
|
-
|
|
1017
|
+
function pt() {
|
|
1018
|
+
p || (g(!1), h(""));
|
|
1015
1019
|
}
|
|
1016
|
-
async function
|
|
1017
|
-
|
|
1020
|
+
async function B() {
|
|
1021
|
+
p || await dt({
|
|
1018
1022
|
action: "APPROVED",
|
|
1019
|
-
comment:
|
|
1020
|
-
}) && (
|
|
1023
|
+
comment: ne.trim() || null
|
|
1024
|
+
}) && (g(!1), h(""));
|
|
1021
1025
|
}
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1026
|
+
function mt() {
|
|
1027
|
+
L && (x(""), fe(null), me(!0));
|
|
1024
1028
|
}
|
|
1025
|
-
function
|
|
1026
|
-
|
|
1029
|
+
function ht() {
|
|
1030
|
+
p || (me(!1), x(""), fe(null));
|
|
1027
1031
|
}
|
|
1028
1032
|
function gt() {
|
|
1029
|
-
|
|
1033
|
+
ve(""), O(I[0]?.id ?? null), we(!0);
|
|
1030
1034
|
}
|
|
1031
1035
|
function _t() {
|
|
1032
|
-
|
|
1036
|
+
p || (we(!1), ve(""), O(null));
|
|
1033
1037
|
}
|
|
1034
|
-
function
|
|
1035
|
-
|
|
1038
|
+
function V() {
|
|
1039
|
+
it && (De(""), ke(null), Le(!0), yt(""));
|
|
1036
1040
|
}
|
|
1037
|
-
function
|
|
1038
|
-
|
|
1041
|
+
function vt() {
|
|
1042
|
+
p || (Le(!1), De(""), ke(null));
|
|
1039
1043
|
}
|
|
1040
|
-
async function
|
|
1041
|
-
|
|
1044
|
+
async function yt(e) {
|
|
1045
|
+
Ne(!0);
|
|
1042
1046
|
try {
|
|
1043
|
-
|
|
1047
|
+
Fe((await k(e)).filter((e) => e.memberId !== r).map(At));
|
|
1044
1048
|
} catch (e) {
|
|
1045
|
-
m(
|
|
1049
|
+
m(W(e));
|
|
1046
1050
|
} finally {
|
|
1047
|
-
|
|
1051
|
+
Ne(!1);
|
|
1048
1052
|
}
|
|
1049
1053
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
|
|
1054
|
+
async function H() {
|
|
1055
|
+
L && (N ? await dt({
|
|
1052
1056
|
action: "REJECTED",
|
|
1053
|
-
comment:
|
|
1054
|
-
}) :
|
|
1057
|
+
comment: N
|
|
1058
|
+
}) : fe("請輸入拒絕原因"));
|
|
1055
1059
|
}
|
|
1056
|
-
async function
|
|
1057
|
-
|
|
1060
|
+
async function U() {
|
|
1061
|
+
it && (Oe ? await dt({
|
|
1058
1062
|
action: "TRANSFERRED",
|
|
1059
|
-
comment:
|
|
1060
|
-
transferToMemberId:
|
|
1063
|
+
comment: nt || null,
|
|
1064
|
+
transferToMemberId: Oe.id
|
|
1061
1065
|
}) : m("請選擇轉派對象"));
|
|
1062
1066
|
}
|
|
1063
|
-
async function
|
|
1064
|
-
await
|
|
1067
|
+
async function bt() {
|
|
1068
|
+
await dt({
|
|
1065
1069
|
action: "RETURNED",
|
|
1066
|
-
comment:
|
|
1067
|
-
returnToNodeId:
|
|
1070
|
+
comment: tt || null,
|
|
1071
|
+
returnToNodeId: ot?.id ?? null
|
|
1068
1072
|
});
|
|
1069
1073
|
}
|
|
1070
1074
|
function xt() {
|
|
1071
|
-
|
|
1075
|
+
ze(""), Ve([]), j("REJECT_INSTANCE"), Qe("MEMBER"), et("");
|
|
1072
1076
|
}
|
|
1073
1077
|
function St(e) {
|
|
1074
|
-
|
|
1078
|
+
Je(e), xt(), qe(!0), K("");
|
|
1075
1079
|
}
|
|
1076
|
-
function
|
|
1077
|
-
|
|
1080
|
+
function Ct() {
|
|
1081
|
+
M || (qe(!1), xt());
|
|
1078
1082
|
}
|
|
1079
|
-
async function
|
|
1080
|
-
|
|
1083
|
+
async function K(e) {
|
|
1084
|
+
Ue(!0);
|
|
1081
1085
|
try {
|
|
1082
|
-
|
|
1086
|
+
Ge((await k(e)).map(At));
|
|
1083
1087
|
} catch (e) {
|
|
1084
|
-
m(
|
|
1088
|
+
m(W(e));
|
|
1085
1089
|
} finally {
|
|
1086
|
-
|
|
1090
|
+
Ue(!1);
|
|
1087
1091
|
}
|
|
1088
1092
|
}
|
|
1089
|
-
async function
|
|
1090
|
-
if (!
|
|
1091
|
-
let e = (
|
|
1092
|
-
memberIds:
|
|
1093
|
+
async function wt() {
|
|
1094
|
+
if (!P) return;
|
|
1095
|
+
let e = (A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY") && Ze === "WEBHOOK", t = jt({
|
|
1096
|
+
memberIds: Be.map((e) => e.id),
|
|
1093
1097
|
useWebhookTarget: e,
|
|
1094
1098
|
webhookUrl: $e
|
|
1095
1099
|
});
|
|
@@ -1097,103 +1101,103 @@ var xn = {
|
|
|
1097
1101
|
m(t.error);
|
|
1098
1102
|
return;
|
|
1099
1103
|
}
|
|
1100
|
-
let { target: n } = t, r =
|
|
1101
|
-
|
|
1104
|
+
let { target: n } = t, r = Re.trim() || null;
|
|
1105
|
+
Xe(!0), m(null);
|
|
1102
1106
|
try {
|
|
1103
|
-
|
|
1107
|
+
A === "COUNTERSIGN" ? await je({
|
|
1104
1108
|
comment: r,
|
|
1105
1109
|
target: n,
|
|
1106
|
-
taskId:
|
|
1107
|
-
}) :
|
|
1110
|
+
taskId: P.id
|
|
1111
|
+
}) : A === "PRE_APPROVAL" ? await Me({
|
|
1108
1112
|
comment: r,
|
|
1109
|
-
onReject:
|
|
1113
|
+
onReject: Ye,
|
|
1110
1114
|
target: n,
|
|
1111
|
-
taskId:
|
|
1112
|
-
}) :
|
|
1115
|
+
taskId: P.id
|
|
1116
|
+
}) : A === "STAGE_NOTIFY" ? await Se({
|
|
1113
1117
|
target: n,
|
|
1114
|
-
taskId:
|
|
1115
|
-
}) : await
|
|
1118
|
+
taskId: P.id
|
|
1119
|
+
}) : await xe({
|
|
1116
1120
|
target: n,
|
|
1117
|
-
taskId:
|
|
1118
|
-
}),
|
|
1121
|
+
taskId: P.id
|
|
1122
|
+
}), qe(!1), xt(), await c();
|
|
1119
1123
|
} catch (e) {
|
|
1120
|
-
m(
|
|
1124
|
+
m(W(e));
|
|
1121
1125
|
} finally {
|
|
1122
|
-
|
|
1126
|
+
Xe(!1);
|
|
1123
1127
|
}
|
|
1124
1128
|
}
|
|
1125
|
-
async function
|
|
1126
|
-
|
|
1129
|
+
async function Dt(e) {
|
|
1130
|
+
Xe(!0), m(null);
|
|
1127
1131
|
try {
|
|
1128
|
-
await
|
|
1132
|
+
await ye(e), await c();
|
|
1129
1133
|
} catch (e) {
|
|
1130
|
-
m(
|
|
1134
|
+
m(W(e));
|
|
1131
1135
|
} finally {
|
|
1132
|
-
|
|
1136
|
+
Xe(!1);
|
|
1133
1137
|
}
|
|
1134
1138
|
}
|
|
1135
|
-
ae(
|
|
1136
|
-
canAddSignerCurrentTask:
|
|
1137
|
-
canRejectCurrentTask:
|
|
1138
|
-
canReturnCurrentTask:
|
|
1139
|
-
canTransferCurrentTask:
|
|
1140
|
-
deciding:
|
|
1141
|
-
handleApprove:
|
|
1142
|
-
hasCurrentTask:
|
|
1139
|
+
ae(f, () => ({
|
|
1140
|
+
canAddSignerCurrentTask: R,
|
|
1141
|
+
canRejectCurrentTask: L,
|
|
1142
|
+
canReturnCurrentTask: rt,
|
|
1143
|
+
canTransferCurrentTask: it,
|
|
1144
|
+
deciding: p,
|
|
1145
|
+
handleApprove: ft,
|
|
1146
|
+
hasCurrentTask: P !== null,
|
|
1143
1147
|
openAdhocModal: St,
|
|
1144
|
-
openRejectModal:
|
|
1148
|
+
openRejectModal: mt,
|
|
1145
1149
|
openReturnModal: gt,
|
|
1146
|
-
openTransferModal:
|
|
1150
|
+
openTransferModal: V
|
|
1147
1151
|
}), [
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
+
R,
|
|
1153
|
+
L,
|
|
1154
|
+
rt,
|
|
1155
|
+
it,
|
|
1152
1156
|
r,
|
|
1153
|
-
|
|
1154
|
-
|
|
1157
|
+
P,
|
|
1158
|
+
p
|
|
1155
1159
|
]);
|
|
1156
|
-
let
|
|
1157
|
-
return /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1160
|
+
let Y = A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY", Pt = Y && Ze === "WEBHOOK" ? !$e.trim() : Be.length === 0, Ft = Cn.find((e) => e.id === Ye) ?? Cn[0], It = wn.find((e) => e.id === Ze) ?? wn[0];
|
|
1161
|
+
return /* @__PURE__ */ D(T, { children: [
|
|
1162
|
+
/* @__PURE__ */ E(w, {
|
|
1159
1163
|
component: "h2",
|
|
1160
1164
|
variant: "h3",
|
|
1161
1165
|
children: "任務"
|
|
1162
1166
|
}),
|
|
1163
|
-
|
|
1167
|
+
te ? /* @__PURE__ */ E(w, {
|
|
1164
1168
|
color: "text-error",
|
|
1165
1169
|
variant: "body",
|
|
1166
|
-
children:
|
|
1170
|
+
children: te
|
|
1167
1171
|
}) : null,
|
|
1168
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ E("div", {
|
|
1169
1173
|
style: vn,
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1171
|
-
columns:
|
|
1172
|
-
dataSource:
|
|
1174
|
+
children: /* @__PURE__ */ E(ge, {
|
|
1175
|
+
columns: ct,
|
|
1176
|
+
dataSource: st,
|
|
1173
1177
|
fullWidth: !0
|
|
1174
1178
|
})
|
|
1175
1179
|
}),
|
|
1176
|
-
|
|
1180
|
+
z.length > 0 ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(w, {
|
|
1177
1181
|
component: "h3",
|
|
1178
1182
|
style: yn,
|
|
1179
1183
|
variant: "h3",
|
|
1180
1184
|
children: "待生效的臨時設定"
|
|
1181
|
-
}), /* @__PURE__ */
|
|
1185
|
+
}), /* @__PURE__ */ E("div", {
|
|
1182
1186
|
style: vn,
|
|
1183
|
-
children: /* @__PURE__ */
|
|
1184
|
-
columns:
|
|
1185
|
-
dataSource:
|
|
1187
|
+
children: /* @__PURE__ */ E(ge, {
|
|
1188
|
+
columns: ut,
|
|
1189
|
+
dataSource: lt,
|
|
1186
1190
|
fullWidth: !0
|
|
1187
1191
|
})
|
|
1188
1192
|
})] }) : null,
|
|
1189
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ D(S, {
|
|
1190
1194
|
cancelText: "取消",
|
|
1191
1195
|
confirmText: "送出同意",
|
|
1192
|
-
loading:
|
|
1196
|
+
loading: p,
|
|
1193
1197
|
modalType: "standard",
|
|
1194
|
-
onCancel:
|
|
1195
|
-
onClose:
|
|
1196
|
-
onConfirm: () => void
|
|
1198
|
+
onCancel: pt,
|
|
1199
|
+
onClose: pt,
|
|
1200
|
+
onConfirm: () => void B(),
|
|
1197
1201
|
open: re,
|
|
1198
1202
|
showModalFooter: !0,
|
|
1199
1203
|
showModalHeader: !0,
|
|
@@ -1201,108 +1205,108 @@ var xn = {
|
|
|
1201
1205
|
supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
|
|
1202
1206
|
title: "簽核意見",
|
|
1203
1207
|
children: [
|
|
1204
|
-
|
|
1208
|
+
te ? /* @__PURE__ */ E(w, {
|
|
1205
1209
|
color: "text-error",
|
|
1206
1210
|
role: "alert",
|
|
1207
1211
|
variant: "body",
|
|
1208
|
-
children:
|
|
1212
|
+
children: te
|
|
1209
1213
|
}) : null,
|
|
1210
|
-
i !== null && i.summary.length > 0 ? /* @__PURE__ */
|
|
1214
|
+
i !== null && i.summary.length > 0 ? /* @__PURE__ */ D("div", {
|
|
1211
1215
|
style: hn,
|
|
1212
|
-
children: [/* @__PURE__ */
|
|
1216
|
+
children: [/* @__PURE__ */ E(w, {
|
|
1213
1217
|
variant: "body",
|
|
1214
1218
|
children: "將一併送出的補填欄位:"
|
|
1215
|
-
}), i.summary.map((e) => /* @__PURE__ */
|
|
1219
|
+
}), i.summary.map((e) => /* @__PURE__ */ E(b, {
|
|
1216
1220
|
title: e.label,
|
|
1217
|
-
children: /* @__PURE__ */
|
|
1221
|
+
children: /* @__PURE__ */ E(le, { children: e.text })
|
|
1218
1222
|
}, e.fieldKey))]
|
|
1219
1223
|
}) : null,
|
|
1220
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ E("div", {
|
|
1221
1225
|
style: hn,
|
|
1222
|
-
children: /* @__PURE__ */
|
|
1226
|
+
children: /* @__PURE__ */ E(n, {
|
|
1223
1227
|
label: "簽核意見",
|
|
1224
1228
|
name: "approveComment",
|
|
1225
|
-
children: /* @__PURE__ */
|
|
1229
|
+
children: /* @__PURE__ */ E(_e, {
|
|
1226
1230
|
autoFocus: !0,
|
|
1227
|
-
onChange: (e) =>
|
|
1231
|
+
onChange: (e) => h(e.target.value),
|
|
1228
1232
|
placeholder: "選填,例如補充核准的條件或提醒事項",
|
|
1229
1233
|
ref: bn,
|
|
1230
1234
|
resize: "vertical",
|
|
1231
1235
|
rows: 4,
|
|
1232
1236
|
style: gn,
|
|
1233
|
-
value:
|
|
1237
|
+
value: ne
|
|
1234
1238
|
})
|
|
1235
1239
|
})
|
|
1236
1240
|
})
|
|
1237
1241
|
]
|
|
1238
1242
|
}),
|
|
1239
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ E(S, {
|
|
1240
1244
|
cancelText: "取消",
|
|
1241
1245
|
confirmButtonProps: {
|
|
1242
|
-
disabled: !
|
|
1246
|
+
disabled: !N,
|
|
1243
1247
|
variant: "destructive-primary"
|
|
1244
1248
|
},
|
|
1245
1249
|
confirmText: "送出拒絕",
|
|
1246
|
-
loading:
|
|
1250
|
+
loading: p,
|
|
1247
1251
|
modalStatusType: "error",
|
|
1248
1252
|
modalType: "standard",
|
|
1249
|
-
onCancel:
|
|
1250
|
-
onClose:
|
|
1251
|
-
onConfirm: () => void
|
|
1252
|
-
open:
|
|
1253
|
+
onCancel: ht,
|
|
1254
|
+
onClose: ht,
|
|
1255
|
+
onConfirm: () => void H(),
|
|
1256
|
+
open: pe,
|
|
1253
1257
|
showModalFooter: !0,
|
|
1254
1258
|
showModalHeader: !0,
|
|
1255
1259
|
size: "regular",
|
|
1256
1260
|
supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
|
|
1257
1261
|
title: "拒絕原因",
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1262
|
+
children: /* @__PURE__ */ D("div", {
|
|
1259
1263
|
style: hn,
|
|
1260
|
-
children: [/* @__PURE__ */
|
|
1264
|
+
children: [/* @__PURE__ */ E(n, {
|
|
1261
1265
|
label: "拒絕原因",
|
|
1262
1266
|
name: "rejectReason",
|
|
1263
1267
|
required: !0,
|
|
1264
|
-
children: /* @__PURE__ */
|
|
1268
|
+
children: /* @__PURE__ */ E(_e, {
|
|
1265
1269
|
autoFocus: !0,
|
|
1266
1270
|
onChange: (e) => {
|
|
1267
|
-
|
|
1271
|
+
x(e.target.value), fe(null);
|
|
1268
1272
|
},
|
|
1269
1273
|
placeholder: "請說明拒絕原因",
|
|
1270
1274
|
ref: bn,
|
|
1271
1275
|
resize: "vertical",
|
|
1272
1276
|
rows: 4,
|
|
1273
1277
|
style: gn,
|
|
1274
|
-
type:
|
|
1275
|
-
value:
|
|
1278
|
+
type: de ? "error" : "default",
|
|
1279
|
+
value: oe
|
|
1276
1280
|
})
|
|
1277
|
-
}),
|
|
1281
|
+
}), de ? /* @__PURE__ */ E(w, {
|
|
1278
1282
|
color: "text-error",
|
|
1279
1283
|
variant: "body",
|
|
1280
|
-
children:
|
|
1284
|
+
children: de
|
|
1281
1285
|
}) : null]
|
|
1282
1286
|
})
|
|
1283
1287
|
}),
|
|
1284
|
-
/* @__PURE__ */
|
|
1288
|
+
/* @__PURE__ */ E(S, {
|
|
1285
1289
|
cancelText: "取消",
|
|
1286
|
-
confirmButtonProps: { disabled: !
|
|
1290
|
+
confirmButtonProps: { disabled: !Oe },
|
|
1287
1291
|
confirmText: "送出轉派",
|
|
1288
|
-
loading:
|
|
1292
|
+
loading: p,
|
|
1289
1293
|
modalType: "standard",
|
|
1290
|
-
onCancel:
|
|
1291
|
-
onClose:
|
|
1292
|
-
onConfirm: () => void
|
|
1293
|
-
open:
|
|
1294
|
+
onCancel: vt,
|
|
1295
|
+
onClose: vt,
|
|
1296
|
+
onConfirm: () => void U(),
|
|
1297
|
+
open: Ie,
|
|
1294
1298
|
showModalFooter: !0,
|
|
1295
1299
|
showModalHeader: !0,
|
|
1296
1300
|
size: "regular",
|
|
1297
1301
|
supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
|
|
1298
1302
|
title: "轉派簽核",
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1303
|
+
children: /* @__PURE__ */ D("div", {
|
|
1300
1304
|
style: _n,
|
|
1301
|
-
children: [/* @__PURE__ */
|
|
1305
|
+
children: [/* @__PURE__ */ E(n, {
|
|
1302
1306
|
label: "轉派對象",
|
|
1303
1307
|
name: "transferToMemberId",
|
|
1304
1308
|
required: !0,
|
|
1305
|
-
children: /* @__PURE__ */
|
|
1309
|
+
children: /* @__PURE__ */ E(se, {
|
|
1306
1310
|
asyncData: !0,
|
|
1307
1311
|
disabledOptionsFilter: !0,
|
|
1308
1312
|
emptyText: "沒有符合的成員",
|
|
@@ -1312,25 +1316,25 @@ var xn = {
|
|
|
1312
1316
|
name: "transfer-member-search",
|
|
1313
1317
|
spellCheck: !1
|
|
1314
1318
|
},
|
|
1315
|
-
loading:
|
|
1319
|
+
loading: Ae,
|
|
1316
1320
|
loadingText: "搜尋成員中...",
|
|
1317
1321
|
mode: "single",
|
|
1318
|
-
onChange: (e) =>
|
|
1319
|
-
onSearch:
|
|
1320
|
-
onSearchTextChange: (e) =>
|
|
1322
|
+
onChange: (e) => ke(Mt(e)),
|
|
1323
|
+
onSearch: yt,
|
|
1324
|
+
onSearchTextChange: (e) => ke(Nt(e, Pe)),
|
|
1321
1325
|
onVisibilityChange: (e) => {
|
|
1322
|
-
e &&
|
|
1326
|
+
e && yt("");
|
|
1323
1327
|
},
|
|
1324
|
-
options: [...
|
|
1328
|
+
options: [...Pe],
|
|
1325
1329
|
placeholder: "搜尋姓名或信箱",
|
|
1326
1330
|
searchDebounceTime: 300,
|
|
1327
|
-
value:
|
|
1331
|
+
value: Oe
|
|
1328
1332
|
})
|
|
1329
|
-
}), /* @__PURE__ */
|
|
1333
|
+
}), /* @__PURE__ */ E(n, {
|
|
1330
1334
|
label: "轉派說明",
|
|
1331
1335
|
name: "transferComment",
|
|
1332
|
-
children: /* @__PURE__ */
|
|
1333
|
-
onChange: (e) =>
|
|
1336
|
+
children: /* @__PURE__ */ E(_e, {
|
|
1337
|
+
onChange: (e) => De(e.target.value),
|
|
1334
1338
|
placeholder: "可補充轉派原因",
|
|
1335
1339
|
ref: bn,
|
|
1336
1340
|
resize: "vertical",
|
|
@@ -1341,78 +1345,78 @@ var xn = {
|
|
|
1341
1345
|
})]
|
|
1342
1346
|
})
|
|
1343
1347
|
}),
|
|
1344
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ E(S, {
|
|
1345
1349
|
cancelText: "取消",
|
|
1346
|
-
confirmButtonProps: { disabled: !
|
|
1350
|
+
confirmButtonProps: { disabled: !ot || at && !tt },
|
|
1347
1351
|
confirmText: "送出退回",
|
|
1348
|
-
loading:
|
|
1352
|
+
loading: p,
|
|
1349
1353
|
modalType: "standard",
|
|
1350
1354
|
onCancel: _t,
|
|
1351
1355
|
onClose: _t,
|
|
1352
|
-
onConfirm: () => void
|
|
1353
|
-
open:
|
|
1356
|
+
onConfirm: () => void bt(),
|
|
1357
|
+
open: be,
|
|
1354
1358
|
showModalFooter: !0,
|
|
1355
1359
|
showModalHeader: !0,
|
|
1356
1360
|
size: "regular",
|
|
1357
1361
|
supportingText: "退回後,流程會回到指定節點並等待重新處理。",
|
|
1358
1362
|
title: "退回簽核",
|
|
1359
|
-
children: /* @__PURE__ */
|
|
1363
|
+
children: /* @__PURE__ */ D("div", {
|
|
1360
1364
|
style: _n,
|
|
1361
|
-
children: [/* @__PURE__ */
|
|
1365
|
+
children: [/* @__PURE__ */ E(n, {
|
|
1362
1366
|
label: "退回節點",
|
|
1363
1367
|
name: "returnTargetNodeId",
|
|
1364
1368
|
required: !0,
|
|
1365
|
-
children: /* @__PURE__ */
|
|
1369
|
+
children: /* @__PURE__ */ E(C, {
|
|
1366
1370
|
clearable: !1,
|
|
1367
1371
|
fullWidth: !0,
|
|
1368
|
-
onChange: (e) =>
|
|
1369
|
-
options: [...
|
|
1372
|
+
onChange: (e) => O(e?.id ?? null),
|
|
1373
|
+
options: [...I],
|
|
1370
1374
|
placeholder: "選擇退回節點",
|
|
1371
|
-
value:
|
|
1375
|
+
value: ot
|
|
1372
1376
|
})
|
|
1373
|
-
}), /* @__PURE__ */
|
|
1374
|
-
hintText:
|
|
1377
|
+
}), /* @__PURE__ */ E(n, {
|
|
1378
|
+
hintText: at ? "此關卡設定退回時必須填寫意見。" : void 0,
|
|
1375
1379
|
label: "退回說明",
|
|
1376
1380
|
name: "returnComment",
|
|
1377
|
-
required:
|
|
1378
|
-
children: /* @__PURE__ */
|
|
1379
|
-
onChange: (e) =>
|
|
1380
|
-
placeholder:
|
|
1381
|
+
required: at,
|
|
1382
|
+
children: /* @__PURE__ */ E(_e, {
|
|
1383
|
+
onChange: (e) => ve(e.target.value),
|
|
1384
|
+
placeholder: at ? "請說明退回原因" : "可補充需要修改的內容",
|
|
1381
1385
|
ref: bn,
|
|
1382
1386
|
resize: "vertical",
|
|
1383
1387
|
rows: 4,
|
|
1384
1388
|
style: gn,
|
|
1385
|
-
value:
|
|
1389
|
+
value: he
|
|
1386
1390
|
})
|
|
1387
1391
|
})]
|
|
1388
1392
|
})
|
|
1389
1393
|
}),
|
|
1390
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ E(S, {
|
|
1391
1395
|
cancelText: "取消",
|
|
1392
|
-
confirmButtonProps: { disabled:
|
|
1396
|
+
confirmButtonProps: { disabled: Pt },
|
|
1393
1397
|
confirmText: "送出",
|
|
1394
|
-
loading:
|
|
1398
|
+
loading: M,
|
|
1395
1399
|
modalType: "standard",
|
|
1396
|
-
onCancel:
|
|
1397
|
-
onClose:
|
|
1398
|
-
onConfirm: () => void
|
|
1399
|
-
open:
|
|
1400
|
+
onCancel: Ct,
|
|
1401
|
+
onClose: Ct,
|
|
1402
|
+
onConfirm: () => void wt(),
|
|
1403
|
+
open: Ke,
|
|
1400
1404
|
showModalFooter: !0,
|
|
1401
1405
|
showModalHeader: !0,
|
|
1402
1406
|
size: "regular",
|
|
1403
|
-
supportingText: Sn[
|
|
1404
|
-
title: xn[
|
|
1405
|
-
children: /* @__PURE__ */
|
|
1407
|
+
supportingText: Sn[A],
|
|
1408
|
+
title: xn[A],
|
|
1409
|
+
children: /* @__PURE__ */ D("div", {
|
|
1406
1410
|
style: _n,
|
|
1407
1411
|
children: [
|
|
1408
|
-
|
|
1412
|
+
Y ? /* @__PURE__ */ E(n, {
|
|
1409
1413
|
label: "通知時機",
|
|
1410
1414
|
name: "adhocNotifyMode",
|
|
1411
1415
|
required: !0,
|
|
1412
|
-
children: /* @__PURE__ */
|
|
1416
|
+
children: /* @__PURE__ */ E(C, {
|
|
1413
1417
|
clearable: !1,
|
|
1414
1418
|
fullWidth: !0,
|
|
1415
|
-
onChange: (e) =>
|
|
1419
|
+
onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
|
|
1416
1420
|
options: [{
|
|
1417
1421
|
id: "STAGE_NOTIFY",
|
|
1418
1422
|
name: xn.STAGE_NOTIFY
|
|
@@ -1421,38 +1425,38 @@ var xn = {
|
|
|
1421
1425
|
name: xn.COMPLETION_NOTIFY
|
|
1422
1426
|
}],
|
|
1423
1427
|
value: {
|
|
1424
|
-
id:
|
|
1425
|
-
name: xn[
|
|
1428
|
+
id: A,
|
|
1429
|
+
name: xn[A]
|
|
1426
1430
|
}
|
|
1427
1431
|
})
|
|
1428
1432
|
}) : null,
|
|
1429
|
-
|
|
1433
|
+
Y ? /* @__PURE__ */ E(n, {
|
|
1430
1434
|
label: "通知對象類型",
|
|
1431
1435
|
name: "adhocTargetKind",
|
|
1432
1436
|
required: !0,
|
|
1433
|
-
children: /* @__PURE__ */
|
|
1437
|
+
children: /* @__PURE__ */ E(C, {
|
|
1434
1438
|
clearable: !1,
|
|
1435
1439
|
fullWidth: !0,
|
|
1436
1440
|
onChange: (e) => Qe(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
|
|
1437
1441
|
options: [...wn],
|
|
1438
|
-
value:
|
|
1442
|
+
value: It
|
|
1439
1443
|
})
|
|
1440
1444
|
}) : null,
|
|
1441
|
-
|
|
1445
|
+
Y && Ze === "WEBHOOK" ? /* @__PURE__ */ E(n, {
|
|
1442
1446
|
label: "Webhook URL",
|
|
1443
1447
|
name: "adhocWebhookUrl",
|
|
1444
1448
|
required: !0,
|
|
1445
|
-
children: /* @__PURE__ */
|
|
1449
|
+
children: /* @__PURE__ */ E(ue, {
|
|
1446
1450
|
fullWidth: !0,
|
|
1447
1451
|
onChange: (e) => et(e.target.value),
|
|
1448
1452
|
placeholder: "https://example.com/webhook",
|
|
1449
1453
|
value: $e
|
|
1450
1454
|
})
|
|
1451
|
-
}) : /* @__PURE__ */
|
|
1452
|
-
label:
|
|
1455
|
+
}) : /* @__PURE__ */ E(n, {
|
|
1456
|
+
label: Y ? "通知對象" : "簽核對象",
|
|
1453
1457
|
name: "adhocMemberId",
|
|
1454
1458
|
required: !0,
|
|
1455
|
-
children: /* @__PURE__ */
|
|
1459
|
+
children: /* @__PURE__ */ E(se, {
|
|
1456
1460
|
asyncData: !0,
|
|
1457
1461
|
disabledOptionsFilter: !0,
|
|
1458
1462
|
emptyText: "沒有符合的成員",
|
|
@@ -1462,45 +1466,45 @@ var xn = {
|
|
|
1462
1466
|
name: "adhoc-member-search",
|
|
1463
1467
|
spellCheck: !1
|
|
1464
1468
|
},
|
|
1465
|
-
loading:
|
|
1469
|
+
loading: He,
|
|
1466
1470
|
loadingText: "搜尋成員中...",
|
|
1467
1471
|
menuMaxHeight: 320,
|
|
1468
1472
|
mode: "multiple",
|
|
1469
|
-
onChange: (e) =>
|
|
1470
|
-
onSearch:
|
|
1473
|
+
onChange: (e) => Ve(e.map(Mt).filter(J)),
|
|
1474
|
+
onSearch: K,
|
|
1471
1475
|
onVisibilityChange: (e) => {
|
|
1472
|
-
e &&
|
|
1476
|
+
e && K("");
|
|
1473
1477
|
},
|
|
1474
|
-
options: [...
|
|
1478
|
+
options: [...We],
|
|
1475
1479
|
overflowStrategy: "wrap",
|
|
1476
1480
|
placeholder: "搜尋姓名或信箱,可加入多位",
|
|
1477
1481
|
searchDebounceTime: 300,
|
|
1478
|
-
value: [...
|
|
1482
|
+
value: [...Be]
|
|
1479
1483
|
})
|
|
1480
1484
|
}),
|
|
1481
|
-
|
|
1485
|
+
A === "PRE_APPROVAL" ? /* @__PURE__ */ E(n, {
|
|
1482
1486
|
label: "拒簽處理方式",
|
|
1483
1487
|
name: "adhocOnReject",
|
|
1484
1488
|
required: !0,
|
|
1485
|
-
children: /* @__PURE__ */
|
|
1489
|
+
children: /* @__PURE__ */ E(C, {
|
|
1486
1490
|
clearable: !1,
|
|
1487
1491
|
fullWidth: !0,
|
|
1488
|
-
onChange: (e) =>
|
|
1492
|
+
onChange: (e) => j(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
|
|
1489
1493
|
options: [...Cn],
|
|
1490
|
-
value:
|
|
1494
|
+
value: Ft
|
|
1491
1495
|
})
|
|
1492
1496
|
}) : null,
|
|
1493
|
-
|
|
1497
|
+
Y ? null : /* @__PURE__ */ E(n, {
|
|
1494
1498
|
label: "說明",
|
|
1495
1499
|
name: "adhocComment",
|
|
1496
|
-
children: /* @__PURE__ */
|
|
1497
|
-
onChange: (e) =>
|
|
1500
|
+
children: /* @__PURE__ */ E(_e, {
|
|
1501
|
+
onChange: (e) => ze(e.target.value),
|
|
1498
1502
|
placeholder: "可補充原因",
|
|
1499
1503
|
ref: bn,
|
|
1500
1504
|
resize: "vertical",
|
|
1501
1505
|
rows: 3,
|
|
1502
1506
|
style: gn,
|
|
1503
|
-
value:
|
|
1507
|
+
value: Re
|
|
1504
1508
|
})
|
|
1505
1509
|
})
|
|
1506
1510
|
]
|
|
@@ -1511,7 +1515,7 @@ var xn = {
|
|
|
1511
1515
|
function En(e, t) {
|
|
1512
1516
|
try {
|
|
1513
1517
|
let n = JSON.parse(e.targetValueJson);
|
|
1514
|
-
if (n.memberIds?.length) return n.memberIds.map((e) =>
|
|
1518
|
+
if (n.memberIds?.length) return n.memberIds.map((e) => q(e, t)).join("、");
|
|
1515
1519
|
if (n.webhookUrl) return n.webhookUrl;
|
|
1516
1520
|
if (n.positionId) return `職位 ${n.positionId}`;
|
|
1517
1521
|
if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
|
|
@@ -1521,7 +1525,7 @@ function En(e, t) {
|
|
|
1521
1525
|
function Dn(e, t) {
|
|
1522
1526
|
if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
|
|
1523
1527
|
let n = t?.nodes.find((t) => t.id === e.nodeId);
|
|
1524
|
-
return n?.type === "userTask" ?
|
|
1528
|
+
return n?.type === "userTask" ? M(n).size : 0;
|
|
1525
1529
|
}
|
|
1526
1530
|
//#endregion
|
|
1527
1531
|
//#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
|
|
@@ -1532,7 +1536,7 @@ var On = {
|
|
|
1532
1536
|
function kn({ signatureVerification: e, signatures: n }) {
|
|
1533
1537
|
let r = _(() => n.map((e) => ({
|
|
1534
1538
|
algorithm: e.algorithm,
|
|
1535
|
-
hashLabel:
|
|
1539
|
+
hashLabel: St(e.signedPayloadHash),
|
|
1536
1540
|
key: e.id,
|
|
1537
1541
|
keyVersion: e.keyVersion,
|
|
1538
1542
|
signedAtLabel: t(e.signedAt),
|
|
@@ -1569,20 +1573,20 @@ function kn({ signatureVerification: e, signatures: n }) {
|
|
|
1569
1573
|
width: 220
|
|
1570
1574
|
}
|
|
1571
1575
|
], []);
|
|
1572
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ D("div", {
|
|
1573
1577
|
style: On,
|
|
1574
1578
|
children: [
|
|
1575
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ E(w, {
|
|
1576
1580
|
component: "h2",
|
|
1577
1581
|
variant: "h3",
|
|
1578
1582
|
children: "簽章"
|
|
1579
1583
|
}),
|
|
1580
|
-
/* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ E(w, {
|
|
1581
1585
|
color: e?.valid ? "text-success" : "text-error",
|
|
1582
1586
|
variant: "body",
|
|
1583
1587
|
children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
|
|
1584
1588
|
}),
|
|
1585
|
-
r.length > 0 ? /* @__PURE__ */
|
|
1589
|
+
r.length > 0 ? /* @__PURE__ */ E(ge, {
|
|
1586
1590
|
columns: i,
|
|
1587
1591
|
dataSource: r,
|
|
1588
1592
|
fullWidth: !0
|
|
@@ -1614,34 +1618,34 @@ var An = {
|
|
|
1614
1618
|
color: "var(--mzn-color-text-error)"
|
|
1615
1619
|
};
|
|
1616
1620
|
function Fn(...e) {
|
|
1617
|
-
return e.filter((e) =>
|
|
1621
|
+
return e.filter((e) => H(e ?? null)).join(" ");
|
|
1618
1622
|
}
|
|
1619
|
-
var In =
|
|
1623
|
+
var In = re(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
|
|
1620
1624
|
let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
|
|
1621
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ D("div", {
|
|
1622
1626
|
...l,
|
|
1623
|
-
className: Fn(
|
|
1627
|
+
className: Fn(R.host, c === "dot" ? R.dot : null, n && d !== "processing" ? R.error : null, a === "horizontal" ? R.horizontal : null, c === "number" ? R.number : null, d === "pending" ? R.pending : null, d === "processing" ? R.processing : null, n && d === "processing" ? R.processingError : null, !n && d === "succeeded" ? R.succeeded : null, a === "vertical" ? R.vertical : null, e),
|
|
1624
1628
|
ref: u,
|
|
1625
|
-
children: [c === "dot" ? /* @__PURE__ */
|
|
1626
|
-
className:
|
|
1629
|
+
children: [c === "dot" ? /* @__PURE__ */ E("span", { className: Fn(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ E("span", {
|
|
1630
|
+
className: R.statusIndicator,
|
|
1627
1631
|
children: i + 1
|
|
1628
|
-
}), /* @__PURE__ */
|
|
1629
|
-
className:
|
|
1632
|
+
}), /* @__PURE__ */ D("div", {
|
|
1633
|
+
className: R.textContainer,
|
|
1630
1634
|
children: [
|
|
1631
|
-
/* @__PURE__ */
|
|
1632
|
-
className:
|
|
1635
|
+
/* @__PURE__ */ D(w, {
|
|
1636
|
+
className: R.title,
|
|
1633
1637
|
variant: "label-primary-highlight",
|
|
1634
|
-
children: [s, /* @__PURE__ */
|
|
1638
|
+
children: [s, /* @__PURE__ */ E("span", { className: R.titleConnectLine })]
|
|
1635
1639
|
}),
|
|
1636
|
-
f.length > 0 ? /* @__PURE__ */
|
|
1637
|
-
className:
|
|
1640
|
+
f.length > 0 ? /* @__PURE__ */ E(w, {
|
|
1641
|
+
className: R.description,
|
|
1638
1642
|
variant: "caption",
|
|
1639
|
-
children: f.map((e, t) => /* @__PURE__ */
|
|
1643
|
+
children: f.map((e, t) => /* @__PURE__ */ D(h, { children: [t > 0 ? " · " : null, Ln(e)] }, `${e.type}-${t}`))
|
|
1640
1644
|
}) : null,
|
|
1641
|
-
p.map((e, t) => /* @__PURE__ */
|
|
1645
|
+
p.map((e, t) => /* @__PURE__ */ D(w, {
|
|
1642
1646
|
style: e.tone === "danger" ? Pn : Mn,
|
|
1643
1647
|
variant: "body",
|
|
1644
|
-
children: [/* @__PURE__ */
|
|
1648
|
+
children: [/* @__PURE__ */ D("span", {
|
|
1645
1649
|
style: e.tone === "danger" ? void 0 : Nn,
|
|
1646
1650
|
children: [e.label, ":"]
|
|
1647
1651
|
}), e.text]
|
|
@@ -1651,12 +1655,12 @@ var In = h(function({ className: e, descriptionParts: t, error: n, forcePending:
|
|
|
1651
1655
|
});
|
|
1652
1656
|
});
|
|
1653
1657
|
function Ln(e) {
|
|
1654
|
-
return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */
|
|
1658
|
+
return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ D(T, { children: [
|
|
1655
1659
|
e.prefix,
|
|
1656
1660
|
":",
|
|
1657
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ E(ve, {
|
|
1658
1662
|
title: e.email,
|
|
1659
|
-
children: ({ ref: t, ...n }) => /* @__PURE__ */
|
|
1663
|
+
children: ({ ref: t, ...n }) => /* @__PURE__ */ E("span", {
|
|
1660
1664
|
...n,
|
|
1661
1665
|
"data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
|
|
1662
1666
|
ref: t,
|
|
@@ -1667,27 +1671,27 @@ function Ln(e) {
|
|
|
1667
1671
|
] }) : `${e.prefix}:${e.label}`;
|
|
1668
1672
|
}
|
|
1669
1673
|
function Rn({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisionsByTaskId: o, tasks: s, workflowSnapshot: c, workflowTokens: l }) {
|
|
1670
|
-
let u = rn(e, s, l, c, n, r, o, a, i, t), d =
|
|
1674
|
+
let u = rn(e, s, l, c, n, r, o, a, i, t), d = Lt(u), f = u.map((e) => ({
|
|
1671
1675
|
...e,
|
|
1672
|
-
descriptionParts: e.descriptionParts.filter(
|
|
1676
|
+
descriptionParts: e.descriptionParts.filter(It)
|
|
1673
1677
|
}));
|
|
1674
|
-
return /* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ D("div", {
|
|
1675
1679
|
style: An,
|
|
1676
|
-
children: [/* @__PURE__ */
|
|
1680
|
+
children: [/* @__PURE__ */ E(w, {
|
|
1677
1681
|
component: "h2",
|
|
1678
1682
|
variant: "h3",
|
|
1679
1683
|
children: "歷程"
|
|
1680
|
-
}), f.length > 0 ? /* @__PURE__ */
|
|
1684
|
+
}), f.length > 0 ? /* @__PURE__ */ E(he, {
|
|
1681
1685
|
currentStep: d,
|
|
1682
1686
|
orientation: "vertical",
|
|
1683
1687
|
type: "dot",
|
|
1684
|
-
children: f.map((e) => /* @__PURE__ */
|
|
1688
|
+
children: f.map((e) => /* @__PURE__ */ E(In, {
|
|
1685
1689
|
descriptionParts: e.descriptionParts,
|
|
1686
1690
|
error: e.error,
|
|
1687
1691
|
forcePending: e.forcePending,
|
|
1688
1692
|
title: e.title
|
|
1689
1693
|
}, e.id))
|
|
1690
|
-
}) : /* @__PURE__ */
|
|
1694
|
+
}) : /* @__PURE__ */ E(w, {
|
|
1691
1695
|
color: "text-neutral",
|
|
1692
1696
|
variant: "body",
|
|
1693
1697
|
children: "尚無歷程紀錄。"
|
|
@@ -1713,13 +1717,13 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1713
1717
|
})), [e]), u = _(() => [
|
|
1714
1718
|
{
|
|
1715
1719
|
key: "endpoint",
|
|
1716
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1720
|
+
render: ({ delivery: e }) => /* @__PURE__ */ D("div", {
|
|
1717
1721
|
style: Bn,
|
|
1718
|
-
children: [/* @__PURE__ */
|
|
1722
|
+
children: [/* @__PURE__ */ E(w, {
|
|
1719
1723
|
component: "span",
|
|
1720
1724
|
variant: "body",
|
|
1721
1725
|
children: e.endpointLabel ?? e.endpointKey
|
|
1722
|
-
}), /* @__PURE__ */
|
|
1726
|
+
}), /* @__PURE__ */ D(w, {
|
|
1723
1727
|
color: "text-neutral",
|
|
1724
1728
|
component: "span",
|
|
1725
1729
|
variant: "caption",
|
|
@@ -1738,13 +1742,13 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1738
1742
|
},
|
|
1739
1743
|
{
|
|
1740
1744
|
key: "status",
|
|
1741
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1745
|
+
render: ({ delivery: e }) => /* @__PURE__ */ E(Un, { status: e.status }),
|
|
1742
1746
|
title: "狀態",
|
|
1743
1747
|
width: 120
|
|
1744
1748
|
},
|
|
1745
1749
|
{
|
|
1746
1750
|
key: "attemptCount",
|
|
1747
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1751
|
+
render: ({ delivery: e }) => /* @__PURE__ */ E(w, {
|
|
1748
1752
|
component: "span",
|
|
1749
1753
|
variant: "body",
|
|
1750
1754
|
children: e.attemptCount
|
|
@@ -1754,21 +1758,21 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1754
1758
|
},
|
|
1755
1759
|
{
|
|
1756
1760
|
key: "lastError",
|
|
1757
|
-
render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */
|
|
1761
|
+
render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ D("div", {
|
|
1758
1762
|
style: Bn,
|
|
1759
|
-
children: [/* @__PURE__ */
|
|
1763
|
+
children: [/* @__PURE__ */ E(w, {
|
|
1760
1764
|
color: "text-error",
|
|
1761
1765
|
component: "span",
|
|
1762
1766
|
variant: "body",
|
|
1763
1767
|
children: e.lastErrorCode
|
|
1764
|
-
}), e.lastErrorDetail ? /* @__PURE__ */
|
|
1768
|
+
}), e.lastErrorDetail ? /* @__PURE__ */ E(w, {
|
|
1765
1769
|
color: "text-neutral",
|
|
1766
1770
|
component: "span",
|
|
1767
1771
|
style: Vn,
|
|
1768
1772
|
variant: "caption",
|
|
1769
1773
|
children: e.lastErrorDetail
|
|
1770
1774
|
}) : null]
|
|
1771
|
-
}) : /* @__PURE__ */
|
|
1775
|
+
}) : /* @__PURE__ */ E(w, {
|
|
1772
1776
|
color: "text-neutral",
|
|
1773
1777
|
component: "span",
|
|
1774
1778
|
variant: "body",
|
|
@@ -1779,7 +1783,7 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1779
1783
|
},
|
|
1780
1784
|
{
|
|
1781
1785
|
key: "time",
|
|
1782
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1786
|
+
render: ({ delivery: e }) => /* @__PURE__ */ E(w, {
|
|
1783
1787
|
component: "span",
|
|
1784
1788
|
variant: "body",
|
|
1785
1789
|
children: Wn(e)
|
|
@@ -1812,30 +1816,30 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1812
1816
|
}
|
|
1813
1817
|
}
|
|
1814
1818
|
}
|
|
1815
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ D("div", {
|
|
1816
1820
|
style: zn,
|
|
1817
1821
|
children: [
|
|
1818
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ E(w, {
|
|
1819
1823
|
component: "h2",
|
|
1820
1824
|
variant: "h3",
|
|
1821
1825
|
children: "外部系統通知"
|
|
1822
1826
|
}),
|
|
1823
|
-
s ? /* @__PURE__ */
|
|
1827
|
+
s ? /* @__PURE__ */ E(w, {
|
|
1824
1828
|
color: "text-error",
|
|
1825
1829
|
variant: "body",
|
|
1826
1830
|
children: s
|
|
1827
1831
|
}) : null,
|
|
1828
|
-
l.length > 0 ? /* @__PURE__ */
|
|
1832
|
+
l.length > 0 ? /* @__PURE__ */ E(ge, {
|
|
1829
1833
|
actions: d,
|
|
1830
1834
|
columns: u,
|
|
1831
1835
|
dataSource: l,
|
|
1832
1836
|
fullWidth: !0
|
|
1833
|
-
}) : /* @__PURE__ */
|
|
1837
|
+
}) : /* @__PURE__ */ E(w, {
|
|
1834
1838
|
color: "text-neutral",
|
|
1835
1839
|
variant: "body",
|
|
1836
1840
|
children: "此案件沒有外部系統通知。"
|
|
1837
1841
|
}),
|
|
1838
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ E(S, {
|
|
1839
1843
|
cancelText: "取消",
|
|
1840
1844
|
confirmText: "重新傳送",
|
|
1841
1845
|
loading: a,
|
|
@@ -1849,7 +1853,7 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1849
1853
|
showModalHeader: !0,
|
|
1850
1854
|
supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
|
|
1851
1855
|
title: "重新傳送通知",
|
|
1852
|
-
children: /* @__PURE__ */
|
|
1856
|
+
children: /* @__PURE__ */ D(w, {
|
|
1853
1857
|
variant: "body",
|
|
1854
1858
|
children: [
|
|
1855
1859
|
"確定要重新通知「",
|
|
@@ -1862,15 +1866,15 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1862
1866
|
});
|
|
1863
1867
|
}
|
|
1864
1868
|
function Un({ status: e }) {
|
|
1865
|
-
return e === "SENT" ? /* @__PURE__ */
|
|
1869
|
+
return e === "SENT" ? /* @__PURE__ */ E(ce, {
|
|
1866
1870
|
size: "sub",
|
|
1867
1871
|
text: "已送達",
|
|
1868
1872
|
variant: "dot-success"
|
|
1869
|
-
}) : e === "FAILED" ? /* @__PURE__ */
|
|
1873
|
+
}) : e === "FAILED" ? /* @__PURE__ */ E(ce, {
|
|
1870
1874
|
size: "sub",
|
|
1871
1875
|
text: "失敗",
|
|
1872
1876
|
variant: "dot-error"
|
|
1873
|
-
}) : /* @__PURE__ */
|
|
1877
|
+
}) : /* @__PURE__ */ E(ce, {
|
|
1874
1878
|
size: "sub",
|
|
1875
1879
|
text: e === "PENDING" ? "等待傳送" : "傳送中",
|
|
1876
1880
|
variant: "dot-info"
|
|
@@ -1887,18 +1891,18 @@ function Gn(e, t) {
|
|
|
1887
1891
|
}
|
|
1888
1892
|
function Kn({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
|
|
1889
1893
|
let i = n.workflowSnapshot;
|
|
1890
|
-
return
|
|
1894
|
+
return Qe({
|
|
1891
1895
|
definition: i,
|
|
1892
1896
|
fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
|
|
1893
1897
|
isAdhocTask: t?.isAdhoc ?? !1,
|
|
1894
1898
|
nodeId: t?.nodeId ?? null,
|
|
1895
|
-
revealedFieldKeys:
|
|
1899
|
+
revealedFieldKeys: Xe(i, Gn(e, r))
|
|
1896
1900
|
});
|
|
1897
1901
|
}
|
|
1898
1902
|
//#endregion
|
|
1899
1903
|
//#region src/views/instances/detail/InstanceDetailView.tsx
|
|
1900
1904
|
function qn(e) {
|
|
1901
|
-
return `還有 ${new Set(Object.keys(e).map(
|
|
1905
|
+
return `還有 ${new Set(Object.keys(e).map(Ze)).size} 個補填欄位需要完成`;
|
|
1902
1906
|
}
|
|
1903
1907
|
var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
|
|
1904
1908
|
display: "grid",
|
|
@@ -1954,25 +1958,25 @@ var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
|
|
|
1954
1958
|
display: "grid",
|
|
1955
1959
|
gap: 16
|
|
1956
1960
|
}, sr = { workflowRuntime: _r };
|
|
1957
|
-
function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory:
|
|
1958
|
-
let { member: ce } = e(), b = ce?.memberId ?? null, le = se && r(ce), [x, ue] = v([]), [C, he] = v(null), [ge, ve] = v([]), [
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
}, [b, i]),
|
|
1961
|
+
function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory: h = !0, showSignatures: re = !0, showTasks: ae = !0, showWebhookDeliveries: se = !0 }) {
|
|
1962
|
+
let { member: ce } = e(), b = ce?.memberId ?? null, le = se && r(ce), [x, ue] = v([]), [C, he] = v(null), [ge, ve] = v([]), [ye, xe] = v([]), [Se, Ce] = v([]), [O, je] = v([]), [Me, Ne] = v(null), [k, ze] = v([]), [Be, He] = v([]), [Ue, qe] = v([]), [Ye, j] = v(null), [Xe, Ze] = v(!0), [Qe, N] = v(!1), [F, I] = v(!1), [L, it] = v(!1), [at, R] = v(""), [z, ot] = v(!1), [st, ct] = v({}), [lt, ut] = v({}), [dt, ft] = v({}), [B, mt] = v(null), [gt, _t] = v(null), [V, vt] = v([]), yt = at.trim(), U = oe(null), bt = oe(0), xt = O.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
|
|
1963
|
+
ie(() => {
|
|
1964
|
+
$t();
|
|
1965
|
+
}, [b, i]), ie(() => {
|
|
1962
1966
|
if (!le || !xt || bt.current >= Yn) return;
|
|
1963
1967
|
let e = setTimeout(() => {
|
|
1964
|
-
bt.current += 1,
|
|
1968
|
+
bt.current += 1, nn();
|
|
1965
1969
|
}, Jn);
|
|
1966
1970
|
return () => clearTimeout(e);
|
|
1967
1971
|
}, [
|
|
1968
1972
|
le,
|
|
1969
1973
|
xt,
|
|
1970
|
-
|
|
1971
|
-
]),
|
|
1972
|
-
|
|
1974
|
+
O
|
|
1975
|
+
]), ie(() => {
|
|
1976
|
+
ut(C?.formData ?? {}), ft({});
|
|
1973
1977
|
}, [C]);
|
|
1974
|
-
let St =
|
|
1975
|
-
|
|
1978
|
+
let St = g((e, t) => {
|
|
1979
|
+
ft((n) => {
|
|
1976
1980
|
let r = n[e];
|
|
1977
1981
|
return r?.hasValue === t.hasValue && r.status === t.status ? n : {
|
|
1978
1982
|
...n,
|
|
@@ -1982,427 +1986,428 @@ function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHis
|
|
|
1982
1986
|
}
|
|
1983
1987
|
};
|
|
1984
1988
|
});
|
|
1985
|
-
}, []),
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
}, [
|
|
1989
|
-
let
|
|
1989
|
+
}, []), G = _(() => Ot(k, b), [b, k]), K = _(() => G && C ? C.workflowSnapshot.nodes.find((e) => e.id === G.nodeId) ?? null : null, [G, C]), wt = K?.type === "userTask" && K.data.returnBehavior.allowReturn, Et = K?.type === "userTask" && K.data.allowReject !== !1, Dt = K?.type === "userTask" && K.data.allowTransfer !== !1, kt = K?.type === "userTask" && K.data.allowAddSigner, At = !(!C || C.initiatorMemberId !== b || C.state !== "RUNNING" && C.state !== "RETURNED"), jt = !!(C && C.initiatorMemberId === b && C.state === "RETURNED"), J = _(() => G && !G.isAdhoc && K?.type === "userTask" && M(K).size > 0 ? K : null, [G, K]), Mt = J ? G?.id ?? null : null, [Nt, Y] = v({}), [Pt, Ft] = v({}), [It, Lt] = v(!1);
|
|
1990
|
+
ie(() => {
|
|
1991
|
+
Y({}), Ft({}), Lt(!1);
|
|
1992
|
+
}, [Mt]);
|
|
1993
|
+
let X = C?.formDefinitionSnapshot.schema ?? null, Z = _(() => J && X ? o(X, J) : null, [J, X]), Q = _(() => Z && C ? $e(Z.fields, {
|
|
1990
1994
|
...C.formData,
|
|
1991
|
-
...
|
|
1995
|
+
...Nt
|
|
1992
1996
|
}) : null, [
|
|
1993
|
-
|
|
1994
|
-
|
|
1997
|
+
Nt,
|
|
1998
|
+
Z,
|
|
1995
1999
|
C
|
|
1996
|
-
]),
|
|
1997
|
-
draft:
|
|
1998
|
-
node:
|
|
1999
|
-
schema:
|
|
2000
|
+
]), Rt = _(() => J && Z && Q && C ? c({
|
|
2001
|
+
draft: Nt,
|
|
2002
|
+
node: J,
|
|
2003
|
+
schema: Z,
|
|
2000
2004
|
stored: C.formData,
|
|
2001
|
-
values:
|
|
2005
|
+
values: Q
|
|
2002
2006
|
}) : {}, [
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
X,
|
|
2007
|
+
Nt,
|
|
2008
|
+
J,
|
|
2006
2009
|
Z,
|
|
2010
|
+
Q,
|
|
2007
2011
|
C
|
|
2008
|
-
]),
|
|
2012
|
+
]), zt = _(() => C ? Kn({
|
|
2009
2013
|
activityLogs: x,
|
|
2010
|
-
actingTask:
|
|
2014
|
+
actingTask: G,
|
|
2011
2015
|
instance: C,
|
|
2012
|
-
tasks:
|
|
2016
|
+
tasks: k
|
|
2013
2017
|
}) : void 0, [
|
|
2014
2018
|
x,
|
|
2015
|
-
|
|
2019
|
+
G,
|
|
2016
2020
|
C,
|
|
2017
|
-
|
|
2018
|
-
]),
|
|
2021
|
+
k
|
|
2022
|
+
]), Bt = _(() => C ? d(C.workflowSnapshot, J) : void 0, [J, C]), Vt = _(() => new Map(Ue.map((e) => [e.memberId, e])), [Ue]), Ht = _(() => J && Q && X && C?.formDataFingerprint ? {
|
|
2019
2023
|
expectedFormDataFingerprint: C.formDataFingerprint,
|
|
2020
|
-
formData: p(
|
|
2021
|
-
summary: l(
|
|
2024
|
+
formData: p(Rt, J),
|
|
2025
|
+
summary: l(X, J, Rt, new Map([...Vt.keys()].map((e) => [e, q(e, Vt)])))
|
|
2022
2026
|
} : null, [
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
Z,
|
|
2026
|
-
C,
|
|
2027
|
+
Rt,
|
|
2028
|
+
J,
|
|
2027
2029
|
Q,
|
|
2028
|
-
|
|
2030
|
+
C,
|
|
2031
|
+
Vt,
|
|
2032
|
+
X
|
|
2029
2033
|
]);
|
|
2030
|
-
function
|
|
2031
|
-
if (!
|
|
2032
|
-
let t =
|
|
2033
|
-
|
|
2034
|
+
function Ut(e) {
|
|
2035
|
+
if (!J) return;
|
|
2036
|
+
let t = M(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
|
|
2037
|
+
Y((e) => ({
|
|
2034
2038
|
...e,
|
|
2035
2039
|
...Object.fromEntries(n)
|
|
2036
|
-
})),
|
|
2040
|
+
})), Ft({});
|
|
2037
2041
|
}
|
|
2038
|
-
function
|
|
2039
|
-
if (
|
|
2042
|
+
function Wt() {
|
|
2043
|
+
if (J && !C?.formDataFingerprint) de.error("無法確認表單版本,請重新整理頁面後再同意。");
|
|
2040
2044
|
else {
|
|
2041
|
-
if (
|
|
2042
|
-
let e =
|
|
2043
|
-
schema:
|
|
2045
|
+
if (J && Q && X && C?.formDefinitionSnapshot.uiSchema) {
|
|
2046
|
+
let e = tt({
|
|
2047
|
+
schema: te(X, J),
|
|
2044
2048
|
uiSchema: C.formDefinitionSnapshot.uiSchema,
|
|
2045
|
-
values:
|
|
2049
|
+
values: Q
|
|
2046
2050
|
});
|
|
2047
2051
|
if (!e.valid) {
|
|
2048
|
-
|
|
2052
|
+
Ft(e.errors), e.firstInvalidFieldKey && et(e.firstInvalidFieldKey), de.warning(qn(e.errors));
|
|
2049
2053
|
return;
|
|
2050
2054
|
}
|
|
2051
2055
|
}
|
|
2052
|
-
|
|
2056
|
+
U.current?.handleApprove();
|
|
2053
2057
|
}
|
|
2054
2058
|
}
|
|
2055
|
-
function
|
|
2056
|
-
if (!
|
|
2057
|
-
if (ee(e)) return
|
|
2058
|
-
let t = s(e,
|
|
2059
|
-
return t ? (
|
|
2059
|
+
function Gt(e) {
|
|
2060
|
+
if (!J || !X) return !1;
|
|
2061
|
+
if (ee(e)) return Lt(!0), !0;
|
|
2062
|
+
let t = s(e, X, J);
|
|
2063
|
+
return t ? (Ft(t), et(Object.keys(t)[0] ?? ""), de.warning(qn(t)), !0) : !1;
|
|
2060
2064
|
}
|
|
2061
|
-
async function
|
|
2062
|
-
await
|
|
2065
|
+
async function Kt() {
|
|
2066
|
+
await $t(), Lt(!1);
|
|
2063
2067
|
}
|
|
2064
|
-
let
|
|
2068
|
+
let qt = _(() => un(ge), [ge]), Jt = _(() => new Map(Se.map((e) => [e.id, e])), [Se]), Yt = _(() => C ? pr(C.workflowSnapshot) : null, [C]), Xt = _(() => C && Yt ? fr(Yt, k, Be, C.state) : [], [
|
|
2065
2069
|
C,
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
]),
|
|
2070
|
-
async function
|
|
2071
|
-
|
|
2070
|
+
Yt,
|
|
2071
|
+
k,
|
|
2072
|
+
Be
|
|
2073
|
+
]), Zt = _(() => Yt ? mr(Yt) : [], [Yt]), Qt = _(() => C ? ur(C.workflowSnapshot) : [], [C]);
|
|
2074
|
+
async function $t() {
|
|
2075
|
+
Ze(!0), j(null);
|
|
2072
2076
|
try {
|
|
2073
|
-
let e = await
|
|
2074
|
-
ue(e.activityLogs), he(e.instance),
|
|
2075
|
-
let t = await
|
|
2077
|
+
let e = await De(i);
|
|
2078
|
+
ue(e.activityLogs), he(e.instance), ze(e.tasks), He(e.workflowTokens);
|
|
2079
|
+
let t = await we(e.instance.id), [n, r, a, o, s] = await Promise.all([
|
|
2076
2080
|
ln(e.tasks),
|
|
2077
2081
|
sn({
|
|
2078
2082
|
...e,
|
|
2079
2083
|
adhocDirectives: t
|
|
2080
2084
|
}),
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2085
|
+
Te(e.instance.id),
|
|
2086
|
+
Ae(e.instance.id),
|
|
2087
|
+
en(e.instance.id)
|
|
2084
2088
|
]);
|
|
2085
|
-
ve(n), qe(r),
|
|
2089
|
+
ve(n), qe(r), xe(a), Ce(o.signatures), Ne(o.verification), vt(t), je(s);
|
|
2086
2090
|
} catch (e) {
|
|
2087
|
-
|
|
2091
|
+
j(W(e));
|
|
2088
2092
|
} finally {
|
|
2089
|
-
|
|
2093
|
+
Ze(!1);
|
|
2090
2094
|
}
|
|
2091
2095
|
}
|
|
2092
|
-
async function
|
|
2093
|
-
return le ?
|
|
2096
|
+
async function en(e) {
|
|
2097
|
+
return le ? Ee(e).catch(() => []) : [];
|
|
2094
2098
|
}
|
|
2095
|
-
async function
|
|
2096
|
-
await
|
|
2099
|
+
async function tn(e) {
|
|
2100
|
+
await Fe(e.id), bt.current = 0, await $t();
|
|
2097
2101
|
}
|
|
2098
|
-
async function
|
|
2099
|
-
let e = await
|
|
2100
|
-
e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ?
|
|
2102
|
+
async function nn() {
|
|
2103
|
+
let e = await en(i);
|
|
2104
|
+
e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? je(e) : await $t();
|
|
2101
2105
|
}
|
|
2102
|
-
async function
|
|
2106
|
+
async function rn(e, t) {
|
|
2103
2107
|
if (!b) throw Error("尚未登入,無法上傳附件");
|
|
2104
|
-
return { id: (await
|
|
2108
|
+
return { id: (await Ie({
|
|
2105
2109
|
file: t,
|
|
2106
2110
|
formFieldPath: `form.${e.fieldKey}`
|
|
2107
2111
|
})).id };
|
|
2108
2112
|
}
|
|
2109
|
-
async function
|
|
2113
|
+
async function an(e) {
|
|
2110
2114
|
if (!b) return;
|
|
2111
|
-
let t = await
|
|
2115
|
+
let t = await Oe({ id: e.id });
|
|
2112
2116
|
window.open(t, "_blank", "noopener,noreferrer");
|
|
2113
2117
|
}
|
|
2114
|
-
async function
|
|
2118
|
+
async function on(e) {
|
|
2115
2119
|
if (!b) return;
|
|
2116
|
-
let t = await
|
|
2117
|
-
mt(e),
|
|
2120
|
+
let t = await ke({ id: e.id });
|
|
2121
|
+
mt(e), _t(t);
|
|
2118
2122
|
}
|
|
2119
|
-
async function
|
|
2120
|
-
if (b && C &&
|
|
2121
|
-
|
|
2123
|
+
async function cn() {
|
|
2124
|
+
if (b && C && At) {
|
|
2125
|
+
N(!0), j(null), ct({});
|
|
2122
2126
|
try {
|
|
2123
|
-
await
|
|
2127
|
+
await be({
|
|
2124
2128
|
cancelledByMemberId: b,
|
|
2125
|
-
comment:
|
|
2129
|
+
comment: yt || null,
|
|
2126
2130
|
instanceId: C.id
|
|
2127
|
-
}),
|
|
2131
|
+
}), R(""), ot(!1), await $t();
|
|
2128
2132
|
} catch (e) {
|
|
2129
|
-
|
|
2133
|
+
j(W(e));
|
|
2130
2134
|
} finally {
|
|
2131
|
-
|
|
2135
|
+
N(!1);
|
|
2132
2136
|
}
|
|
2133
2137
|
}
|
|
2134
2138
|
}
|
|
2135
|
-
async function
|
|
2136
|
-
if (!b || !C || !
|
|
2137
|
-
|
|
2138
|
-
let e =
|
|
2139
|
+
async function dn() {
|
|
2140
|
+
if (!b || !C || !jt) return;
|
|
2141
|
+
N(!0), j(null), ct({});
|
|
2142
|
+
let e = m(Object.values(dt));
|
|
2139
2143
|
if (e) {
|
|
2140
|
-
|
|
2144
|
+
j(e), N(!1);
|
|
2141
2145
|
return;
|
|
2142
2146
|
}
|
|
2143
|
-
let t = C.formDefinitionSnapshot.schema ? u(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = f(t ?
|
|
2147
|
+
let t = C.formDefinitionSnapshot.schema ? u(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = f(t ? $e(t.fields, lt) : lt, C.workflowSnapshot);
|
|
2144
2148
|
if (t && C.formDefinitionSnapshot.uiSchema) {
|
|
2145
|
-
let e =
|
|
2149
|
+
let e = tt({
|
|
2146
2150
|
schema: t,
|
|
2147
2151
|
uiSchema: C.formDefinitionSnapshot.uiSchema,
|
|
2148
2152
|
values: n
|
|
2149
2153
|
});
|
|
2150
2154
|
if (!e.valid) {
|
|
2151
|
-
|
|
2155
|
+
ct(e.errors), j("請先補齊必填欄位。"), e.firstInvalidFieldKey && et(e.firstInvalidFieldKey), N(!1);
|
|
2152
2156
|
return;
|
|
2153
2157
|
}
|
|
2154
2158
|
}
|
|
2155
2159
|
try {
|
|
2156
|
-
await
|
|
2160
|
+
await Pe({
|
|
2157
2161
|
formData: n,
|
|
2158
2162
|
initiatorMemberId: b,
|
|
2159
2163
|
instanceId: C.id,
|
|
2160
2164
|
title: C.title
|
|
2161
|
-
}), await
|
|
2165
|
+
}), await $t();
|
|
2162
2166
|
} catch (e) {
|
|
2163
|
-
|
|
2167
|
+
j(W(e));
|
|
2164
2168
|
} finally {
|
|
2165
|
-
|
|
2169
|
+
N(!1);
|
|
2166
2170
|
}
|
|
2167
2171
|
}
|
|
2168
|
-
let
|
|
2169
|
-
return /* @__PURE__ */
|
|
2170
|
-
/* @__PURE__ */
|
|
2172
|
+
let $ = Qe || F;
|
|
2173
|
+
return /* @__PURE__ */ D(T, { children: [
|
|
2174
|
+
/* @__PURE__ */ E(fe, { children: /* @__PURE__ */ D(Le, {
|
|
2171
2175
|
description: C ? [
|
|
2172
2176
|
Ct(C.state),
|
|
2173
2177
|
t(C.startedAt),
|
|
2174
|
-
|
|
2175
|
-
].filter(
|
|
2178
|
+
ht(C, Vt)
|
|
2179
|
+
].filter(H).join(" · ") : "載入案件內容。",
|
|
2176
2180
|
title: C?.title ?? "簽核案件",
|
|
2177
2181
|
children: [
|
|
2178
|
-
C ? /* @__PURE__ */
|
|
2182
|
+
C ? /* @__PURE__ */ E(y, {
|
|
2179
2183
|
"aria-label": "查看流程圖",
|
|
2180
|
-
icon:
|
|
2184
|
+
icon: A,
|
|
2181
2185
|
iconType: "icon-only",
|
|
2182
|
-
onClick: () =>
|
|
2186
|
+
onClick: () => it(!0),
|
|
2183
2187
|
title: "查看流程圖",
|
|
2184
2188
|
variant: "base-secondary",
|
|
2185
2189
|
children: "流程圖"
|
|
2186
2190
|
}) : null,
|
|
2187
|
-
|
|
2191
|
+
At ? /* @__PURE__ */ E(y, {
|
|
2188
2192
|
disabled: $,
|
|
2189
|
-
icon:
|
|
2193
|
+
icon: Ve,
|
|
2190
2194
|
iconType: "leading",
|
|
2191
|
-
onClick: () =>
|
|
2195
|
+
onClick: () => ot(!0),
|
|
2192
2196
|
variant: "destructive-secondary",
|
|
2193
2197
|
children: "取消案件"
|
|
2194
2198
|
}) : null,
|
|
2195
|
-
|
|
2196
|
-
|
|
2199
|
+
G ? /* @__PURE__ */ D(T, { children: [
|
|
2200
|
+
kt ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(y, {
|
|
2197
2201
|
disabled: $,
|
|
2198
|
-
icon:
|
|
2202
|
+
icon: Ge,
|
|
2199
2203
|
iconType: "leading",
|
|
2200
|
-
onClick: () =>
|
|
2204
|
+
onClick: () => U.current?.openAdhocModal("COUNTERSIGN"),
|
|
2201
2205
|
variant: "base-secondary",
|
|
2202
2206
|
children: "會簽"
|
|
2203
|
-
}, "adhoc-countersign"), /* @__PURE__ */
|
|
2207
|
+
}, "adhoc-countersign"), /* @__PURE__ */ E(y, {
|
|
2204
2208
|
disabled: $,
|
|
2205
|
-
icon:
|
|
2209
|
+
icon: Ge,
|
|
2206
2210
|
iconType: "leading",
|
|
2207
|
-
onClick: () =>
|
|
2211
|
+
onClick: () => U.current?.openAdhocModal("PRE_APPROVAL"),
|
|
2208
2212
|
variant: "base-secondary",
|
|
2209
2213
|
children: "加簽"
|
|
2210
2214
|
}, "adhoc-pre-approval")] }) : null,
|
|
2211
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ E(y, {
|
|
2212
2216
|
disabled: $,
|
|
2213
|
-
icon:
|
|
2217
|
+
icon: We,
|
|
2214
2218
|
iconType: "leading",
|
|
2215
|
-
onClick: () =>
|
|
2219
|
+
onClick: () => U.current?.openAdhocModal("STAGE_NOTIFY"),
|
|
2216
2220
|
variant: "base-secondary",
|
|
2217
2221
|
children: "通知設定"
|
|
2218
2222
|
}, "adhoc-notify"),
|
|
2219
|
-
wt ? /* @__PURE__ */
|
|
2223
|
+
wt ? /* @__PURE__ */ E(y, {
|
|
2220
2224
|
disabled: $,
|
|
2221
|
-
icon:
|
|
2225
|
+
icon: Ke,
|
|
2222
2226
|
iconType: "leading",
|
|
2223
|
-
onClick: () =>
|
|
2227
|
+
onClick: () => U.current?.openReturnModal(),
|
|
2224
2228
|
variant: "base-secondary",
|
|
2225
2229
|
children: "退回"
|
|
2226
2230
|
}, "task-return") : null,
|
|
2227
|
-
|
|
2231
|
+
Dt ? /* @__PURE__ */ E(y, {
|
|
2228
2232
|
disabled: $,
|
|
2229
|
-
icon:
|
|
2233
|
+
icon: Je,
|
|
2230
2234
|
iconType: "leading",
|
|
2231
|
-
onClick: () =>
|
|
2235
|
+
onClick: () => U.current?.openTransferModal(),
|
|
2232
2236
|
variant: "base-secondary",
|
|
2233
2237
|
children: "轉派"
|
|
2234
2238
|
}, "task-transfer") : null,
|
|
2235
|
-
|
|
2239
|
+
Et ? /* @__PURE__ */ E(y, {
|
|
2236
2240
|
disabled: $,
|
|
2237
|
-
icon:
|
|
2241
|
+
icon: Ve,
|
|
2238
2242
|
iconType: "leading",
|
|
2239
|
-
onClick: () =>
|
|
2243
|
+
onClick: () => U.current?.openRejectModal(),
|
|
2240
2244
|
variant: "destructive-secondary",
|
|
2241
2245
|
children: "拒絕"
|
|
2242
2246
|
}, "task-reject") : null,
|
|
2243
|
-
/* @__PURE__ */
|
|
2247
|
+
/* @__PURE__ */ E(y, {
|
|
2244
2248
|
disabled: $,
|
|
2245
|
-
icon:
|
|
2249
|
+
icon: Re,
|
|
2246
2250
|
iconType: "leading",
|
|
2247
|
-
onClick:
|
|
2251
|
+
onClick: Wt,
|
|
2248
2252
|
variant: "base-primary",
|
|
2249
2253
|
children: "同意"
|
|
2250
2254
|
}, "task-approve")
|
|
2251
2255
|
] }) : null
|
|
2252
2256
|
]
|
|
2253
2257
|
}) }),
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
ne ? /* @__PURE__ */
|
|
2256
|
-
canResubmitInstance:
|
|
2257
|
-
deciding:
|
|
2258
|
-
error:
|
|
2259
|
-
fieldAccess:
|
|
2260
|
-
fieldLabelMarkers:
|
|
2261
|
-
fill:
|
|
2258
|
+
/* @__PURE__ */ D(me, { children: [
|
|
2259
|
+
ne ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(fn, {
|
|
2260
|
+
canResubmitInstance: jt,
|
|
2261
|
+
deciding: Qe,
|
|
2262
|
+
error: Ye,
|
|
2263
|
+
fieldAccess: zt,
|
|
2264
|
+
fieldLabelMarkers: Bt,
|
|
2265
|
+
fill: Z && Q && J ? {
|
|
2262
2266
|
errors: Pt,
|
|
2263
|
-
fieldCount:
|
|
2264
|
-
onChange:
|
|
2265
|
-
schema:
|
|
2266
|
-
value:
|
|
2267
|
+
fieldCount: M(J).size,
|
|
2268
|
+
onChange: Ut,
|
|
2269
|
+
schema: Z,
|
|
2270
|
+
value: Q
|
|
2267
2271
|
} : null,
|
|
2268
2272
|
instance: C,
|
|
2269
|
-
loading:
|
|
2273
|
+
loading: Xe,
|
|
2270
2274
|
onDataSourceStateChange: St,
|
|
2271
|
-
onReloadAfterConflict:
|
|
2275
|
+
onReloadAfterConflict: It ? () => void Kt() : null,
|
|
2272
2276
|
onResubmitFormChange: (e) => {
|
|
2273
|
-
|
|
2277
|
+
ut(e), ct({});
|
|
2274
2278
|
},
|
|
2275
|
-
onResubmitInstance: () => void
|
|
2276
|
-
onUploadAttachment:
|
|
2277
|
-
resubmitFormData:
|
|
2278
|
-
resubmitFormErrors:
|
|
2279
|
+
onResubmitInstance: () => void dn(),
|
|
2280
|
+
onUploadAttachment: rn,
|
|
2281
|
+
resubmitFormData: lt,
|
|
2282
|
+
resubmitFormErrors: st
|
|
2279
2283
|
}) }) : null,
|
|
2280
|
-
a ? /* @__PURE__ */
|
|
2281
|
-
attachments:
|
|
2284
|
+
a ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(mn, {
|
|
2285
|
+
attachments: ye,
|
|
2282
2286
|
onDownload: (e) => {
|
|
2283
|
-
|
|
2287
|
+
an(e);
|
|
2284
2288
|
},
|
|
2285
2289
|
onPreview: (e) => {
|
|
2286
|
-
|
|
2290
|
+
on(e);
|
|
2287
2291
|
}
|
|
2288
2292
|
}) }) : null,
|
|
2289
|
-
ae ? /* @__PURE__ */
|
|
2290
|
-
adhocDirectives:
|
|
2293
|
+
ae ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(Tn, {
|
|
2294
|
+
adhocDirectives: V,
|
|
2291
2295
|
currentMemberId: b,
|
|
2292
|
-
fill:
|
|
2296
|
+
fill: Ht,
|
|
2293
2297
|
instance: C,
|
|
2294
|
-
memberProfilesById:
|
|
2295
|
-
onChanged:
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2298
|
+
memberProfilesById: Vt,
|
|
2299
|
+
onChanged: $t,
|
|
2300
|
+
onDecidingChange: I,
|
|
2301
|
+
onFillApproveError: Gt,
|
|
2302
|
+
ref: U,
|
|
2303
|
+
tasks: k
|
|
2299
2304
|
}) }) : null,
|
|
2300
|
-
|
|
2301
|
-
signatureVerification:
|
|
2302
|
-
signatures:
|
|
2305
|
+
re ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(kn, {
|
|
2306
|
+
signatureVerification: Me,
|
|
2307
|
+
signatures: Se
|
|
2303
2308
|
}) }) : null,
|
|
2304
|
-
le &&
|
|
2305
|
-
deliveries:
|
|
2306
|
-
onRetry:
|
|
2307
|
-
readNodeLabel: (e) =>
|
|
2309
|
+
le && O.length > 0 ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(Hn, {
|
|
2310
|
+
deliveries: O,
|
|
2311
|
+
onRetry: tn,
|
|
2312
|
+
readNodeLabel: (e) => Tt(e, C?.workflowSnapshot ?? null)
|
|
2308
2313
|
}) }) : null,
|
|
2309
|
-
|
|
2314
|
+
h ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(Rn, {
|
|
2310
2315
|
activityLogs: x,
|
|
2311
|
-
formSchema:
|
|
2316
|
+
formSchema: X,
|
|
2312
2317
|
instanceState: C?.state ?? "RUNNING",
|
|
2313
|
-
memberProfilesById:
|
|
2314
|
-
signatureVerification:
|
|
2315
|
-
signaturesById:
|
|
2316
|
-
taskDecisionsByTaskId:
|
|
2317
|
-
tasks:
|
|
2318
|
+
memberProfilesById: Vt,
|
|
2319
|
+
signatureVerification: Me,
|
|
2320
|
+
signaturesById: Jt,
|
|
2321
|
+
taskDecisionsByTaskId: qt,
|
|
2322
|
+
tasks: k,
|
|
2318
2323
|
workflowSnapshot: C?.workflowSnapshot ?? null,
|
|
2319
|
-
workflowTokens:
|
|
2324
|
+
workflowTokens: Be
|
|
2320
2325
|
}) }) : null
|
|
2321
2326
|
] }),
|
|
2322
|
-
C ? /* @__PURE__ */
|
|
2327
|
+
C ? /* @__PURE__ */ E(S, {
|
|
2323
2328
|
modalType: "standard",
|
|
2324
|
-
onClose: () =>
|
|
2325
|
-
open:
|
|
2329
|
+
onClose: () => it(!1),
|
|
2330
|
+
open: L,
|
|
2326
2331
|
showModalHeader: !0,
|
|
2327
2332
|
size: "wide",
|
|
2328
2333
|
supportingText: `${Ct(C.state)} · ${t(C.startedAt)}`,
|
|
2329
2334
|
title: "流程圖",
|
|
2330
|
-
children: /* @__PURE__ */
|
|
2335
|
+
children: /* @__PURE__ */ D("div", {
|
|
2331
2336
|
style: Qn,
|
|
2332
|
-
children: [/* @__PURE__ */
|
|
2337
|
+
children: [/* @__PURE__ */ E("div", {
|
|
2333
2338
|
style: $n,
|
|
2334
|
-
children: /* @__PURE__ */
|
|
2335
|
-
edges:
|
|
2339
|
+
children: /* @__PURE__ */ D(rt, {
|
|
2340
|
+
edges: Zt,
|
|
2336
2341
|
fitView: !0,
|
|
2337
2342
|
fitViewOptions: { padding: .18 },
|
|
2338
2343
|
maxZoom: 1.2,
|
|
2339
2344
|
minZoom: .2,
|
|
2340
|
-
nodes:
|
|
2345
|
+
nodes: Xt,
|
|
2341
2346
|
nodesDraggable: !1,
|
|
2342
2347
|
nodesFocusable: !1,
|
|
2343
2348
|
nodeTypes: sr,
|
|
2344
2349
|
panOnDrag: !0,
|
|
2345
2350
|
proOptions: { hideAttribution: !0 },
|
|
2346
|
-
children: [/* @__PURE__ */
|
|
2351
|
+
children: [/* @__PURE__ */ E(nt, {}), /* @__PURE__ */ E(P, { showInteractive: !1 })]
|
|
2347
2352
|
})
|
|
2348
|
-
}),
|
|
2353
|
+
}), Qt.length > 0 ? /* @__PURE__ */ E("div", {
|
|
2349
2354
|
style: ir,
|
|
2350
|
-
children:
|
|
2355
|
+
children: Qt.map((e) => /* @__PURE__ */ E("span", {
|
|
2351
2356
|
style: ar,
|
|
2352
2357
|
children: e
|
|
2353
2358
|
}, e))
|
|
2354
2359
|
}) : null]
|
|
2355
2360
|
})
|
|
2356
2361
|
}) : null,
|
|
2357
|
-
/* @__PURE__ */
|
|
2362
|
+
/* @__PURE__ */ E(S, {
|
|
2358
2363
|
modalType: "standard",
|
|
2359
2364
|
onClose: () => {
|
|
2360
|
-
mt(null),
|
|
2365
|
+
mt(null), _t(null);
|
|
2361
2366
|
},
|
|
2362
|
-
open: !!(
|
|
2367
|
+
open: !!(B && gt),
|
|
2363
2368
|
showModalHeader: !0,
|
|
2364
2369
|
size: "wide",
|
|
2365
|
-
supportingText:
|
|
2370
|
+
supportingText: B?.filename ?? void 0,
|
|
2366
2371
|
title: "PDF 預覽",
|
|
2367
|
-
children:
|
|
2368
|
-
filename:
|
|
2369
|
-
fileUrl:
|
|
2370
|
-
onDownload:
|
|
2372
|
+
children: gt ? /* @__PURE__ */ E(pt, {
|
|
2373
|
+
filename: B?.filename ?? "PDF 預覽",
|
|
2374
|
+
fileUrl: gt,
|
|
2375
|
+
onDownload: B ? () => void an(B) : void 0
|
|
2371
2376
|
}) : null
|
|
2372
2377
|
}),
|
|
2373
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ E(S, {
|
|
2374
2379
|
cancelText: "保留案件",
|
|
2375
2380
|
confirmButtonProps: { variant: "destructive-primary" },
|
|
2376
2381
|
confirmText: "確認取消",
|
|
2377
|
-
loading:
|
|
2382
|
+
loading: Qe,
|
|
2378
2383
|
modalStatusType: "error",
|
|
2379
2384
|
modalType: "standard",
|
|
2380
|
-
onCancel: () =>
|
|
2381
|
-
onClose: () =>
|
|
2382
|
-
onConfirm: () => void
|
|
2383
|
-
open:
|
|
2385
|
+
onCancel: () => ot(!1),
|
|
2386
|
+
onClose: () => ot(!1),
|
|
2387
|
+
onConfirm: () => void cn(),
|
|
2388
|
+
open: z,
|
|
2384
2389
|
showModalFooter: !0,
|
|
2385
2390
|
showModalHeader: !0,
|
|
2386
2391
|
supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
|
|
2387
2392
|
title: "取消案件",
|
|
2388
|
-
children: /* @__PURE__ */
|
|
2393
|
+
children: /* @__PURE__ */ D("div", {
|
|
2389
2394
|
style: or,
|
|
2390
|
-
children: [/* @__PURE__ */
|
|
2395
|
+
children: [/* @__PURE__ */ D(w, {
|
|
2391
2396
|
variant: "body",
|
|
2392
2397
|
children: [
|
|
2393
2398
|
"確定要取消「",
|
|
2394
2399
|
C?.title ?? "",
|
|
2395
2400
|
"」嗎?"
|
|
2396
2401
|
]
|
|
2397
|
-
}), /* @__PURE__ */
|
|
2402
|
+
}), /* @__PURE__ */ E(n, {
|
|
2398
2403
|
label: "取消原因",
|
|
2399
2404
|
name: "cancelComment",
|
|
2400
|
-
children: /* @__PURE__ */
|
|
2401
|
-
onChange: (e) =>
|
|
2405
|
+
children: /* @__PURE__ */ E(_e, {
|
|
2406
|
+
onChange: (e) => R(e.target.value),
|
|
2402
2407
|
placeholder: "可填寫取消原因",
|
|
2403
2408
|
resize: "vertical",
|
|
2404
2409
|
rows: 3,
|
|
2405
|
-
value:
|
|
2410
|
+
value: at
|
|
2406
2411
|
})
|
|
2407
2412
|
})]
|
|
2408
2413
|
})
|
|
@@ -2431,14 +2436,14 @@ function fr(e, t, n, r) {
|
|
|
2431
2436
|
},
|
|
2432
2437
|
id: e.id,
|
|
2433
2438
|
position: e.position,
|
|
2434
|
-
sourcePosition:
|
|
2435
|
-
targetPosition:
|
|
2439
|
+
sourcePosition: I.Right,
|
|
2440
|
+
targetPosition: I.Left,
|
|
2436
2441
|
type: "workflowRuntime"
|
|
2437
2442
|
};
|
|
2438
2443
|
});
|
|
2439
2444
|
}
|
|
2440
2445
|
function pr(e) {
|
|
2441
|
-
let t = new
|
|
2446
|
+
let t = new L.graphlib.Graph();
|
|
2442
2447
|
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
2443
2448
|
nodesep: 56,
|
|
2444
2449
|
rankdir: "LR",
|
|
@@ -2450,7 +2455,7 @@ function pr(e) {
|
|
|
2450
2455
|
});
|
|
2451
2456
|
}), e.edges.forEach((e) => {
|
|
2452
2457
|
t.setEdge(e.source, e.target);
|
|
2453
|
-
}),
|
|
2458
|
+
}), L.layout(t), {
|
|
2454
2459
|
...e,
|
|
2455
2460
|
nodes: e.nodes.map((e) => {
|
|
2456
2461
|
let n = t.node(e.id);
|
|
@@ -2536,34 +2541,34 @@ function gr(e) {
|
|
|
2536
2541
|
};
|
|
2537
2542
|
}
|
|
2538
2543
|
function _r({ data: e }) {
|
|
2539
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ D("div", {
|
|
2540
2545
|
style: hr(e.tone),
|
|
2541
2546
|
children: [
|
|
2542
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ E(F, {
|
|
2543
2548
|
isConnectable: !1,
|
|
2544
|
-
position:
|
|
2549
|
+
position: I.Left,
|
|
2545
2550
|
style: rr,
|
|
2546
2551
|
type: "target"
|
|
2547
2552
|
}),
|
|
2548
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ E(w, {
|
|
2549
2554
|
component: "span",
|
|
2550
2555
|
ellipsis: !0,
|
|
2551
2556
|
title: e.label,
|
|
2552
2557
|
variant: "label-primary",
|
|
2553
2558
|
children: e.label
|
|
2554
2559
|
}),
|
|
2555
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ E("span", {
|
|
2556
2561
|
style: gr(e.tone),
|
|
2557
2562
|
children: e.statusLabel
|
|
2558
2563
|
}),
|
|
2559
|
-
/* @__PURE__ */
|
|
2564
|
+
/* @__PURE__ */ E("span", {
|
|
2560
2565
|
title: e.secondaryLabel,
|
|
2561
2566
|
style: nr,
|
|
2562
2567
|
children: e.secondaryLabel || e.kindLabel
|
|
2563
2568
|
}),
|
|
2564
|
-
/* @__PURE__ */
|
|
2569
|
+
/* @__PURE__ */ E(F, {
|
|
2565
2570
|
isConnectable: !1,
|
|
2566
|
-
position:
|
|
2571
|
+
position: I.Right,
|
|
2567
2572
|
style: rr,
|
|
2568
2573
|
type: "source"
|
|
2569
2574
|
})
|
|
@@ -2573,4 +2578,4 @@ function _r({ data: e }) {
|
|
|
2573
2578
|
//#endregion
|
|
2574
2579
|
export { Tn as a, kn as i, Hn as n, mn as o, Rn as r, fn as s, cr as t };
|
|
2575
2580
|
|
|
2576
|
-
//# sourceMappingURL=detail-
|
|
2581
|
+
//# sourceMappingURL=detail-D6X61pkg.js.map
|