@rytass/bpm-core-react 0.13.5 → 0.14.0
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 +52 -0
- package/dist/chunks/compose-CHZoX-H0.cjs +2 -0
- package/dist/chunks/compose-CHZoX-H0.cjs.map +1 -0
- package/dist/chunks/{compose-6P64PO1i.js → compose-CSWbRgJJ.js} +3 -2
- package/dist/chunks/compose-CSWbRgJJ.js.map +1 -0
- package/dist/chunks/{designer-C3s2kSna.js → designer-BtsIL0BB.js} +1132 -1037
- package/dist/chunks/designer-BtsIL0BB.js.map +1 -0
- package/dist/chunks/designer-Dm6cX2kZ.cjs +65 -0
- package/dist/chunks/designer-Dm6cX2kZ.cjs.map +1 -0
- package/dist/chunks/{detail-pYEIk-jW.js → detail-C8NOqY0p.js} +790 -768
- package/dist/chunks/detail-C8NOqY0p.js.map +1 -0
- package/dist/chunks/detail-CX-3hZoL.cjs +2 -0
- package/dist/chunks/detail-CX-3hZoL.cjs.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/shared.d.ts +5 -0
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/decision-policy-options.d.ts +8 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/position-level-options.d.ts +17 -0
- package/package.json +3 -3
- package/dist/chunks/compose-6P64PO1i.js.map +0 -1
- package/dist/chunks/compose-BnSRL4ml.cjs +0 -2
- package/dist/chunks/compose-BnSRL4ml.cjs.map +0 -1
- package/dist/chunks/designer-C3s2kSna.js.map +0 -1
- package/dist/chunks/designer-_g58R6rQ.cjs +0 -65
- package/dist/chunks/designer-_g58R6rQ.cjs.map +0 -1
- package/dist/chunks/detail-Db-UOELp.cjs +0 -2
- package/dist/chunks/detail-Db-UOELp.cjs.map +0 -1
- package/dist/chunks/detail-pYEIk-jW.js.map +0 -1
|
@@ -6,17 +6,17 @@ import { t as r } from "./use-bpm-member-D57LKe_u.js";
|
|
|
6
6
|
import { i, t as a } from "./FormRendererView-UPowZZgw.js";
|
|
7
7
|
import '../style.css';import '../detail.css';/* empty css */
|
|
8
8
|
import { Fragment as o, forwardRef as s, useCallback as c, useEffect as l, useImperativeHandle as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
9
|
-
import { AutoComplete as m, Badge as h, Button as g, Input as ee, Modal as _, PageHeader as v, Section as y, SectionGroup as te, Select as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { cancelAdhocDirective as
|
|
12
|
-
import
|
|
13
|
-
import { CheckedIcon as
|
|
14
|
-
import { buildFormRendererValues as
|
|
15
|
-
import { Background as
|
|
16
|
-
import * as
|
|
17
|
-
import { Document as
|
|
18
|
-
import { stepClasses as
|
|
19
|
-
var
|
|
9
|
+
import { AutoComplete as m, Badge as h, Button as g, Input as ee, Modal as _, PageHeader as v, Section as y, SectionGroup as te, Select as ne, Stepper as b, Table as x, Textarea as re, Tooltip as ie, Typography as S } from "@mezzanine-ui/react";
|
|
10
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
11
|
+
import { cancelAdhocDirective as ae, cancelApprovalInstance as oe, configureAdhocCompletionNotification as E, configureAdhocStageNotification as se, decideTask as ce, listAdhocDirectives as le, listAttachments as ue, listTaskDecisions as de, listWorkflowWebhookDeliveries as fe, readApprovalInstance as pe, readAttachmentDownloadUrl as me, readAttachmentPreviewUrl as he, readInstanceSignatures as ge, requestAdhocCountersign as _e, requestAdhocPreApproval as ve, resolveMemberProfiles as ye, resubmitApprovalInstance as be, retryWorkflowWebhookDelivery as xe, searchMembers as Se, uploadAttachment as Ce } from "@rytass/bpm-core-client/workflow";
|
|
12
|
+
import we from "@mezzanine-ui/react/ContentHeader";
|
|
13
|
+
import { CheckedIcon as Te, ChevronLeftIcon as D, ChevronRightIcon as Ee, DangerousOutlineIcon as De, DownloadIcon as Oe, FileSearchIcon as ke, NotificationUnreadIcon as Ae, PlusIcon as je, RefreshCcwIcon as Me, ResetIcon as O, ShareIcon as Ne, UserIcon as Pe, ZoomInIcon as Fe, ZoomOutIcon as Ie } from "@mezzanine-ui/icons";
|
|
14
|
+
import { buildFormRendererValues as Le, focusFormRendererField as Re, readFormDataSourceErrorMessage as ze, validateFormRendererValues as Be } from "@rytass/bpm-core-client/form";
|
|
15
|
+
import { Background as k, Controls as Ve, Handle as He, Position as Ue, ReactFlow as We } from "@xyflow/react";
|
|
16
|
+
import * as Ge from "dagre";
|
|
17
|
+
import { Document as A, Page as Ke } from "react-pdf";
|
|
18
|
+
import { stepClasses as j } from "@mezzanine-ui/core/stepper";
|
|
19
|
+
var M = {
|
|
20
20
|
root: "bpm_root_ehm7w",
|
|
21
21
|
toolbar: "bpm_toolbar_R-tis",
|
|
22
22
|
pageControls: "bpm_pageControls_jM-rC",
|
|
@@ -25,9 +25,9 @@ var P = {
|
|
|
25
25
|
viewport: "bpm_viewport_DQXms",
|
|
26
26
|
page: "bpm_page_Cv5Rg",
|
|
27
27
|
state: "bpm_state_bpgp3"
|
|
28
|
-
},
|
|
29
|
-
function
|
|
30
|
-
let r = f(null), [i, a] = p(null), [o, s] = p(1), [u, m] = p(1), [h, ee] = p(
|
|
28
|
+
}, N = 760, qe = 920, Je = 320, P = 32, F = .75, Ye = 1.75, I = .25;
|
|
29
|
+
function Xe({ filename: e, fileUrl: t, onDownload: n }) {
|
|
30
|
+
let r = f(null), [i, a] = p(null), [o, s] = p(1), [u, m] = p(1), [h, ee] = p(N);
|
|
31
31
|
l(() => {
|
|
32
32
|
let e = r.current;
|
|
33
33
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -40,41 +40,41 @@ function Je({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
40
40
|
a(null), s(1), m(1);
|
|
41
41
|
}, [t]);
|
|
42
42
|
let _ = d(() => {
|
|
43
|
-
let e = Math.max(
|
|
44
|
-
return Math.round(Math.min(
|
|
43
|
+
let e = Math.max(Je, h - P);
|
|
44
|
+
return Math.round(Math.min(qe, e) * u);
|
|
45
45
|
}, [u, h]), v = c((e) => {
|
|
46
46
|
a(e.numPages), s(1);
|
|
47
|
-
}, []), y = o > 1, te = i !== null && o < i,
|
|
48
|
-
return /* @__PURE__ */
|
|
47
|
+
}, []), y = o > 1, te = i !== null && o < i, ne = u > F, b = u < Ye, x = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, re = `${Math.round(u * 100)}%`;
|
|
48
|
+
return /* @__PURE__ */ T("section", {
|
|
49
49
|
"aria-label": `${e} PDF 預覽`,
|
|
50
|
-
className:
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
-
className:
|
|
50
|
+
className: M.root,
|
|
51
|
+
children: [/* @__PURE__ */ T("div", {
|
|
52
|
+
className: M.toolbar,
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
className:
|
|
54
|
+
/* @__PURE__ */ T("div", {
|
|
55
|
+
className: M.pageControls,
|
|
56
56
|
"aria-label": "頁面切換",
|
|
57
57
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ w(g, {
|
|
59
59
|
"aria-label": "上一頁",
|
|
60
60
|
disabled: !y,
|
|
61
|
-
icon:
|
|
61
|
+
icon: D,
|
|
62
62
|
onClick: () => {
|
|
63
63
|
s((e) => Math.max(1, e - 1));
|
|
64
64
|
},
|
|
65
65
|
size: "minor",
|
|
66
66
|
variant: "base-secondary"
|
|
67
67
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
className:
|
|
68
|
+
/* @__PURE__ */ w(S, {
|
|
69
|
+
className: M.counter,
|
|
70
70
|
component: "span",
|
|
71
71
|
variant: "body",
|
|
72
|
-
children:
|
|
72
|
+
children: x
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ w(g, {
|
|
75
75
|
"aria-label": "下一頁",
|
|
76
76
|
disabled: !te,
|
|
77
|
-
icon:
|
|
77
|
+
icon: Ee,
|
|
78
78
|
onClick: () => {
|
|
79
79
|
s((e) => i === null ? e : Math.min(i, e + 1));
|
|
80
80
|
},
|
|
@@ -83,40 +83,40 @@ function Je({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
83
83
|
})
|
|
84
84
|
]
|
|
85
85
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
className:
|
|
86
|
+
/* @__PURE__ */ T("div", {
|
|
87
|
+
className: M.zoomControls,
|
|
88
88
|
"aria-label": "縮放",
|
|
89
89
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ w(g, {
|
|
91
91
|
"aria-label": "縮小",
|
|
92
|
-
disabled: !
|
|
93
|
-
icon:
|
|
92
|
+
disabled: !ne,
|
|
93
|
+
icon: Ie,
|
|
94
94
|
onClick: () => {
|
|
95
|
-
m((e) => Math.max(
|
|
95
|
+
m((e) => Math.max(F, e - I));
|
|
96
96
|
},
|
|
97
97
|
size: "minor",
|
|
98
98
|
variant: "base-secondary"
|
|
99
99
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
className:
|
|
100
|
+
/* @__PURE__ */ w(S, {
|
|
101
|
+
className: M.counter,
|
|
102
102
|
component: "span",
|
|
103
103
|
variant: "body",
|
|
104
|
-
children:
|
|
104
|
+
children: re
|
|
105
105
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ w(g, {
|
|
107
107
|
"aria-label": "放大",
|
|
108
|
-
disabled: !
|
|
109
|
-
icon:
|
|
108
|
+
disabled: !b,
|
|
109
|
+
icon: Fe,
|
|
110
110
|
onClick: () => {
|
|
111
|
-
m((e) => Math.min(
|
|
111
|
+
m((e) => Math.min(Ye, e + I));
|
|
112
112
|
},
|
|
113
113
|
size: "minor",
|
|
114
114
|
variant: "base-secondary"
|
|
115
115
|
})
|
|
116
116
|
]
|
|
117
117
|
}),
|
|
118
|
-
n ? /* @__PURE__ */
|
|
119
|
-
icon:
|
|
118
|
+
n ? /* @__PURE__ */ w(g, {
|
|
119
|
+
icon: Oe,
|
|
120
120
|
iconType: "leading",
|
|
121
121
|
onClick: n,
|
|
122
122
|
size: "minor",
|
|
@@ -124,18 +124,18 @@ function Je({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
124
124
|
children: "下載"
|
|
125
125
|
}) : null
|
|
126
126
|
]
|
|
127
|
-
}), /* @__PURE__ */
|
|
128
|
-
className:
|
|
127
|
+
}), /* @__PURE__ */ w("div", {
|
|
128
|
+
className: M.viewport,
|
|
129
129
|
ref: r,
|
|
130
|
-
children: /* @__PURE__ */
|
|
131
|
-
error: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ w(A, {
|
|
131
|
+
error: /* @__PURE__ */ w(L, { message: "PDF 無法載入。" }),
|
|
132
132
|
file: t,
|
|
133
|
-
loading: /* @__PURE__ */
|
|
134
|
-
noData: /* @__PURE__ */
|
|
133
|
+
loading: /* @__PURE__ */ w(L, { message: "正在載入 PDF..." }),
|
|
134
|
+
noData: /* @__PURE__ */ w(L, { message: "沒有可預覽的 PDF。" }),
|
|
135
135
|
onLoadSuccess: v,
|
|
136
|
-
children: /* @__PURE__ */
|
|
137
|
-
className:
|
|
138
|
-
loading: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ w(Ke, {
|
|
137
|
+
className: M.page,
|
|
138
|
+
loading: /* @__PURE__ */ w(L, { message: "正在載入頁面..." }),
|
|
139
139
|
pageNumber: o,
|
|
140
140
|
renderAnnotationLayer: !0,
|
|
141
141
|
renderTextLayer: !0,
|
|
@@ -145,10 +145,10 @@ function Je({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
145
145
|
})]
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
className:
|
|
151
|
-
children: /* @__PURE__ */
|
|
148
|
+
function L({ message: e }) {
|
|
149
|
+
return /* @__PURE__ */ w("div", {
|
|
150
|
+
className: M.state,
|
|
151
|
+
children: /* @__PURE__ */ w(S, {
|
|
152
152
|
color: "text-neutral",
|
|
153
153
|
variant: "body",
|
|
154
154
|
children: e
|
|
@@ -157,102 +157,102 @@ function z({ message: e }) {
|
|
|
157
157
|
}
|
|
158
158
|
//#endregion
|
|
159
159
|
//#region src/views/instances/detail/sections/shared.ts
|
|
160
|
-
function
|
|
161
|
-
let t =
|
|
160
|
+
function R(e) {
|
|
161
|
+
let t = z(e, "from"), n = z(e, "to"), r = z(e, "reason");
|
|
162
162
|
return !t || !n || !r ? null : {
|
|
163
163
|
from: t,
|
|
164
164
|
reason: r,
|
|
165
|
-
ruleId:
|
|
165
|
+
ruleId: z(e, "ruleId"),
|
|
166
166
|
to: n
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ze(e) {
|
|
170
170
|
try {
|
|
171
171
|
let t = JSON.parse(e);
|
|
172
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
172
|
+
return Array.isArray(t) ? t.map((e) => $e(e) ? R(e) : null).filter((e) => e !== null) : [];
|
|
173
173
|
} catch {
|
|
174
174
|
return [];
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function z(e, t) {
|
|
178
178
|
let n = e[t];
|
|
179
179
|
return typeof n == "string" ? n : null;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function B(e, t) {
|
|
182
182
|
let n = e[t];
|
|
183
183
|
return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Qe(e, t) {
|
|
186
186
|
let n = e[t];
|
|
187
187
|
return typeof n == "number" ? n : null;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function V(e) {
|
|
190
190
|
return typeof e == "string" && e.trim().length > 0;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function $e(e) {
|
|
193
193
|
return typeof e == "object" && !!e;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function et(e) {
|
|
196
196
|
return e.status === "PENDING" || e.status === "IN_PROGRESS";
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
198
|
+
function H(e) {
|
|
199
|
+
return ze(e) || (e instanceof Error ? e.message : "發生未知錯誤");
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function U(e) {
|
|
202
202
|
return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function tt(e) {
|
|
205
205
|
return e.length > 16 ? `${e.slice(0, 12)}...` : e;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function nt(e) {
|
|
208
208
|
return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function rt(e) {
|
|
211
211
|
return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function it(e) {
|
|
214
214
|
return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function W(e) {
|
|
217
217
|
return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function at(e, t) {
|
|
220
220
|
return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function G(e, t) {
|
|
223
223
|
if (!e) return "-";
|
|
224
224
|
let n = t.get(e);
|
|
225
225
|
return n ? `${n.name}(${n.email})` : e;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
let n =
|
|
229
|
-
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) =>
|
|
230
|
-
let r =
|
|
227
|
+
function ot(e, t = /* @__PURE__ */ new Map()) {
|
|
228
|
+
let n = Ze(e.delegationChainJson);
|
|
229
|
+
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => G(e, t)).join("、")}` : "未指定";
|
|
230
|
+
let r = G(e.assigneeMemberId, t), i = G(e.originalAssigneeMemberId, t);
|
|
231
231
|
return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
|
|
232
232
|
}
|
|
233
|
-
function ot(e, t) {
|
|
234
|
-
return t ? e.assigneeMemberId === t || e.candidateMemberIds.includes(t) : !1;
|
|
235
|
-
}
|
|
236
233
|
function st(e, t) {
|
|
234
|
+
return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
|
|
235
|
+
}
|
|
236
|
+
function ct(e, t) {
|
|
237
237
|
if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
|
|
238
238
|
if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
|
|
239
239
|
id: e.id,
|
|
240
|
-
name: `${e.data.label}(${
|
|
240
|
+
name: `${e.data.label}(${W(e.type)})`
|
|
241
241
|
}));
|
|
242
242
|
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);
|
|
243
243
|
return r ? [{
|
|
244
244
|
id: r.id,
|
|
245
|
-
name: `${r.data.label}(${
|
|
245
|
+
name: `${r.data.label}(${W(r.type)})`
|
|
246
246
|
}] : [];
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function lt(e) {
|
|
249
249
|
return {
|
|
250
250
|
email: e.email,
|
|
251
251
|
id: e.memberId,
|
|
252
252
|
name: `${e.name} · ${e.email}`
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function K({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
|
|
256
256
|
if (t) {
|
|
257
257
|
let e = n.trim();
|
|
258
258
|
return e ? {
|
|
@@ -277,11 +277,11 @@ function q({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
|
|
|
277
277
|
valid: !1
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function ut(e) {
|
|
281
281
|
return !!e;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
if (
|
|
283
|
+
function dt(e) {
|
|
284
|
+
if (!$e(e)) return null;
|
|
285
285
|
let t = e.email, n = e.id, r = e.name;
|
|
286
286
|
return typeof n == "string" && typeof r == "string" ? {
|
|
287
287
|
email: typeof t == "string" ? t : null,
|
|
@@ -289,7 +289,7 @@ function ut(e) {
|
|
|
289
289
|
name: r
|
|
290
290
|
} : null;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function ft(e, t) {
|
|
293
293
|
let n = e.trim().toLocaleLowerCase();
|
|
294
294
|
if (!n) return null;
|
|
295
295
|
let r = t.filter((e) => [
|
|
@@ -299,21 +299,21 @@ function dt(e, t) {
|
|
|
299
299
|
].some((e) => e.toLocaleLowerCase().includes(n)));
|
|
300
300
|
return r.length === 1 ? r[0] ?? null : null;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
return
|
|
302
|
+
function q(e) {
|
|
303
|
+
return V(e) ? {
|
|
304
304
|
text: e,
|
|
305
305
|
type: "text"
|
|
306
306
|
} : null;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
return
|
|
308
|
+
function pt(e, t, n = "neutral") {
|
|
309
|
+
return V(t) ? {
|
|
310
310
|
label: e,
|
|
311
311
|
text: t,
|
|
312
312
|
tone: n,
|
|
313
313
|
type: "comment"
|
|
314
314
|
} : null;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function mt(e, t, n, r) {
|
|
317
317
|
let i = t ? n.get(t) : null;
|
|
318
318
|
return {
|
|
319
319
|
email: i?.email ?? null,
|
|
@@ -323,179 +323,200 @@ function pt(e, t, n, r) {
|
|
|
323
323
|
type: "member"
|
|
324
324
|
};
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function J(e) {
|
|
327
327
|
return !!e;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function ht(e) {
|
|
330
330
|
let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
|
|
331
331
|
return t === -1 ? e.length : t;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" ||
|
|
333
|
+
function gt(e) {
|
|
334
|
+
return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || Y(e) || X(e.eventType, xt(e));
|
|
335
|
+
}
|
|
336
|
+
function Y(e) {
|
|
337
|
+
return e.eventType === "TASK_CREATED" && B(xt(e), "sequentialCandidateMemberIds").length > 0;
|
|
338
|
+
}
|
|
339
|
+
function _t(e) {
|
|
340
|
+
if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
|
|
341
|
+
let t = xt(e);
|
|
342
|
+
return [
|
|
343
|
+
...B(t, "sequentialCandidateMemberIds"),
|
|
344
|
+
z(t, "candidateMemberId"),
|
|
345
|
+
z(t, "previousMemberId")
|
|
346
|
+
].filter(V);
|
|
335
347
|
}
|
|
336
|
-
var
|
|
348
|
+
var vt = /* @__PURE__ */ new Set([
|
|
337
349
|
"SERVICE_TASK_EXECUTED",
|
|
338
350
|
"SERVICE_TASK_FAILED",
|
|
339
351
|
"WEBHOOK_DELIVERY_RETRIED"
|
|
340
352
|
]);
|
|
341
|
-
function
|
|
342
|
-
return
|
|
353
|
+
function X(e, t) {
|
|
354
|
+
return vt.has(e) && z(t, "action") === "NOTIFY_WEBHOOK";
|
|
343
355
|
}
|
|
344
|
-
function
|
|
345
|
-
return
|
|
356
|
+
function Z(e) {
|
|
357
|
+
return z(e, "endpointLabel") ?? z(e, "endpointKey") ?? "外部系統";
|
|
346
358
|
}
|
|
347
|
-
function
|
|
359
|
+
function yt(e) {
|
|
348
360
|
return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
|
|
349
361
|
}
|
|
350
|
-
function
|
|
362
|
+
function bt(e, t) {
|
|
351
363
|
if (e === "INSTANCE_STARTED") return "案件已發起";
|
|
352
364
|
if (e === "TOKEN_CREATED") return "流程路徑已建立";
|
|
353
365
|
if (e === "ENGINE_PROCESS_REQUESTED") return "流程引擎已處理";
|
|
354
366
|
if (e === "TOKEN_ADVANCED") return "流程已前進";
|
|
355
367
|
if (e === "TASK_CREATED") return "待簽任務已建立";
|
|
356
|
-
if (e === "
|
|
368
|
+
if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
|
|
369
|
+
if (e === "TASK_DECIDED") return yt(z(t, "action"));
|
|
357
370
|
if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
|
|
358
|
-
if (
|
|
359
|
-
let n =
|
|
371
|
+
if (X(e, t)) {
|
|
372
|
+
let n = Z(t);
|
|
360
373
|
return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
|
|
361
374
|
}
|
|
362
375
|
return e;
|
|
363
376
|
}
|
|
364
|
-
function
|
|
377
|
+
function xt(e) {
|
|
365
378
|
try {
|
|
366
379
|
let t = JSON.parse(e.payloadJson);
|
|
367
|
-
return
|
|
380
|
+
return $e(t) ? t : {};
|
|
368
381
|
} catch {
|
|
369
382
|
return {};
|
|
370
383
|
}
|
|
371
384
|
}
|
|
372
|
-
function
|
|
373
|
-
return e.eventType === "SLA_TRIGGERED" || e.eventType === "SERVICE_TASK_FAILED" &&
|
|
385
|
+
function St(e, t) {
|
|
386
|
+
return e.eventType === "SLA_TRIGGERED" || e.eventType === "SERVICE_TASK_FAILED" && X(e.eventType, t) || z(t, "action") === "REJECTED" || z(t, "instanceState") === "REJECTED";
|
|
374
387
|
}
|
|
375
|
-
function
|
|
388
|
+
function Q(e) {
|
|
376
389
|
return t(e);
|
|
377
390
|
}
|
|
378
|
-
function
|
|
391
|
+
function Ct(e, t, n, r) {
|
|
392
|
+
if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
|
|
393
|
+
let e = z(t, "candidateMemberId"), n = z(t, "previousMemberId");
|
|
394
|
+
if (!e) return null;
|
|
395
|
+
let i = G(e, r);
|
|
396
|
+
return n ? `輪到:${i}(前一位:${G(n, r)})` : `輪到:${i}`;
|
|
397
|
+
}
|
|
379
398
|
if (e.eventType === "TASK_CREATED") {
|
|
380
|
-
let e =
|
|
381
|
-
if (
|
|
382
|
-
|
|
383
|
-
|
|
399
|
+
let e = B(t, "sequentialCandidateMemberIds");
|
|
400
|
+
if (e.length) return `簽核順序:${e.map((e) => G(e, r)).join(" → ")}`;
|
|
401
|
+
let n = z(t, "assigneeMemberId"), i = z(t, "originalAssigneeMemberId");
|
|
402
|
+
if (!n) {
|
|
403
|
+
let e = B(t, "candidateMemberIds");
|
|
404
|
+
return e.length ? `候選簽核人:${e.map((e) => G(e, r)).join("、")}` : null;
|
|
384
405
|
}
|
|
385
|
-
let
|
|
386
|
-
return
|
|
406
|
+
let a = G(n, r), o = G(i, r);
|
|
407
|
+
return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
|
|
387
408
|
}
|
|
388
409
|
if (e.eventType === "TASK_DECIDED") {
|
|
389
|
-
let e =
|
|
390
|
-
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(
|
|
410
|
+
let e = z(t, "action"), n = z(t, "comment"), i = e ? `決議:${it(e)}` : null, a = z(t, "transferToMemberId");
|
|
411
|
+
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(V).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(V).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${G(a, r)}`].filter(V).join(" · ") : i;
|
|
391
412
|
}
|
|
392
413
|
if (e.eventType === "TOKEN_ADVANCED") {
|
|
393
|
-
let e =
|
|
394
|
-
if (e) return `流程結果:${
|
|
395
|
-
let r =
|
|
414
|
+
let e = z(t, "action");
|
|
415
|
+
if (e) return `流程結果:${it(e)}`;
|
|
416
|
+
let r = Qe(t, "arrivedCount"), i = Qe(t, "requiredCount");
|
|
396
417
|
if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
|
|
397
|
-
let a =
|
|
398
|
-
if (a && o) return `由 ${
|
|
418
|
+
let a = z(t, "fromNodeId"), o = z(t, "toNodeId");
|
|
419
|
+
if (a && o) return `由 ${at(a, n)} 前進至 ${at(o, n)}`;
|
|
399
420
|
}
|
|
400
421
|
if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
|
|
401
|
-
let e =
|
|
402
|
-
return e ? `案件狀態:${
|
|
422
|
+
let e = z(t, "state");
|
|
423
|
+
return e ? `案件狀態:${nt(e)}` : null;
|
|
403
424
|
}
|
|
404
425
|
return null;
|
|
405
426
|
}
|
|
406
|
-
function
|
|
407
|
-
if (e.eventType !== "TASK_DECIDED") return [
|
|
408
|
-
let s = e.taskId ? r.get(e.taskId) : null, c =
|
|
427
|
+
function wt(e, t, n, r, i, a, o) {
|
|
428
|
+
if (e.eventType !== "TASK_DECIDED") return [q(Ct(e, t, n, o))].filter(J);
|
|
429
|
+
let s = e.taskId ? r.get(e.taskId) : null, c = z(t, "action") ?? s?.action ?? null, l = z(t, "comment") ?? s?.comment ?? null, u = z(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = z(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
|
|
409
430
|
return [
|
|
410
|
-
|
|
411
|
-
c === "REJECTED" ?
|
|
412
|
-
c === "APPROVED" ?
|
|
413
|
-
c === "RETURNED" ?
|
|
414
|
-
c === "TRANSFERRED" ?
|
|
415
|
-
c === "TRANSFERRED" ?
|
|
416
|
-
f ?
|
|
417
|
-
].filter(
|
|
418
|
-
}
|
|
419
|
-
function
|
|
431
|
+
q(c ? `決議:${it(c)}` : null),
|
|
432
|
+
c === "REJECTED" ? pt("拒絕原因", l ?? "-", "danger") : null,
|
|
433
|
+
c === "APPROVED" ? pt("同意說明", l) : null,
|
|
434
|
+
c === "RETURNED" ? pt("退回說明", l ?? "-") : null,
|
|
435
|
+
c === "TRANSFERRED" ? q(`轉派給:${G(u, o)}`) : null,
|
|
436
|
+
c === "TRANSFERRED" ? pt("轉派說明", l ?? "-") : null,
|
|
437
|
+
f ? q(a?.valid ? `簽章:已驗證(${tt(f.signedPayloadHash)})` : `簽章:待檢查(${tt(f.signedPayloadHash)})`) : null
|
|
438
|
+
].filter(J);
|
|
439
|
+
}
|
|
440
|
+
function Tt(e, t, n, r, i) {
|
|
420
441
|
if (e.type === "startEvent" || i.has(e.id)) return !1;
|
|
421
442
|
if (r === "REJECTED") return !0;
|
|
422
|
-
let a =
|
|
443
|
+
let a = Nt(e, t, n, r);
|
|
423
444
|
return a.tone === "neutral" || a.tone === "waiting";
|
|
424
445
|
}
|
|
425
|
-
function
|
|
446
|
+
function Et(e, t, n, r, i) {
|
|
426
447
|
if (r !== "RUNNING" && r !== "REJECTED") return [];
|
|
427
|
-
let a = e.nodes.filter((e) =>
|
|
448
|
+
let a = e.nodes.filter((e) => Tt(e, t, n, r, i)), o = $(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
|
|
428
449
|
return a.filter((e) => o.has(e.id)).sort((e, t) => {
|
|
429
450
|
let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
|
|
430
451
|
return n === r ? e.position.x === t.position.x ? e.position.y === t.position.y ? (s.get(e.id) ?? 0) - (s.get(t.id) ?? 0) : e.position.y - t.position.y : e.position.x - t.position.x : n - r;
|
|
431
452
|
});
|
|
432
453
|
}
|
|
433
|
-
function
|
|
454
|
+
function $(e, t, n, r, i) {
|
|
434
455
|
let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
|
|
435
456
|
let n = [...e.get(t.source) ?? [], t.target];
|
|
436
457
|
return new Map(e).set(t.source, n);
|
|
437
458
|
}, /* @__PURE__ */ new Map());
|
|
438
|
-
return
|
|
459
|
+
return Dt(e, n, r, i).reduce((e, t) => At(e, Ot(t, o, a)), /* @__PURE__ */ new Map());
|
|
439
460
|
}
|
|
440
|
-
function
|
|
441
|
-
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(
|
|
461
|
+
function Dt(e, t, n, r) {
|
|
462
|
+
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(et).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
|
|
442
463
|
...i,
|
|
443
464
|
...a,
|
|
444
465
|
...o
|
|
445
466
|
])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
|
|
446
467
|
return s.length > 0 ? s : c;
|
|
447
468
|
}
|
|
448
|
-
function
|
|
449
|
-
return
|
|
469
|
+
function Ot(e, t, n) {
|
|
470
|
+
return kt([{
|
|
450
471
|
distance: 0,
|
|
451
472
|
nodeId: e
|
|
452
473
|
}], t, n);
|
|
453
474
|
}
|
|
454
|
-
function
|
|
475
|
+
function kt(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
|
|
455
476
|
let [a, ...o] = e;
|
|
456
477
|
if (!a) return i;
|
|
457
|
-
if (r.has(a.nodeId)) return
|
|
478
|
+
if (r.has(a.nodeId)) return kt(o, t, n, r, i);
|
|
458
479
|
let s = new Set(r).add(a.nodeId), c = n.has(a.nodeId) ? new Map(i).set(a.nodeId, Math.min(i.get(a.nodeId) ?? a.distance, a.distance)) : i;
|
|
459
|
-
return
|
|
480
|
+
return kt([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
|
|
460
481
|
distance: a.distance + 1,
|
|
461
482
|
nodeId: e
|
|
462
483
|
}))], t, n, s, c);
|
|
463
484
|
}
|
|
464
|
-
function
|
|
485
|
+
function At(e, t) {
|
|
465
486
|
return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
|
|
466
487
|
}
|
|
467
|
-
function
|
|
488
|
+
function jt(e) {
|
|
468
489
|
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}`;
|
|
469
490
|
}
|
|
470
|
-
function
|
|
471
|
-
let l = e.filter(
|
|
472
|
-
let t =
|
|
491
|
+
function Mt(e, t, n, r, i, a, o, s, c) {
|
|
492
|
+
let l = e.filter(gt).map((e) => {
|
|
493
|
+
let t = xt(e), n = e.nodeId ? at(e.nodeId, r) : null;
|
|
473
494
|
return {
|
|
474
495
|
descriptionParts: [
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
...
|
|
479
|
-
].filter(
|
|
480
|
-
error:
|
|
496
|
+
q(n ? `節點:${n}` : "節點:全流程"),
|
|
497
|
+
mt("操作者", e.actorMemberId, a, "系統"),
|
|
498
|
+
q(`時間:${Q(e.createdAt)}`),
|
|
499
|
+
...wt(e, t, r, o, s, c, a)
|
|
500
|
+
].filter(J),
|
|
501
|
+
error: St(e, t),
|
|
481
502
|
id: e.id,
|
|
482
|
-
title:
|
|
503
|
+
title: bt(e.eventType, t)
|
|
483
504
|
};
|
|
484
|
-
}), u = t.filter(
|
|
505
|
+
}), u = t.filter(et).map((e) => ({
|
|
485
506
|
descriptionParts: [
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
].filter(
|
|
507
|
+
q(`節點:${at(e.nodeId, r)}`),
|
|
508
|
+
mt("處理者", e.assigneeMemberId, a, "未指定"),
|
|
509
|
+
q(`建立時間:${Q(e.createdAt)}`)
|
|
510
|
+
].filter(J),
|
|
490
511
|
error: !1,
|
|
491
512
|
id: `pending-task-${e.id}`,
|
|
492
513
|
title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
|
|
493
|
-
})), d = new Set([...e.filter(
|
|
494
|
-
descriptionParts: [
|
|
514
|
+
})), d = new Set([...e.filter(gt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(V)), f = r ? Et(r, t, n, i, d).map((e) => ({
|
|
515
|
+
descriptionParts: [q(`${W(e.type)} · 尚未抵達`)].filter(J),
|
|
495
516
|
error: !1,
|
|
496
517
|
forcePending: !0,
|
|
497
518
|
id: `future-node-${e.id}`,
|
|
498
|
-
title:
|
|
519
|
+
title: jt(e)
|
|
499
520
|
})) : [];
|
|
500
521
|
return [
|
|
501
522
|
...l,
|
|
@@ -503,18 +524,18 @@ function At(e, t, n, r, i, a, o, s, c) {
|
|
|
503
524
|
...f
|
|
504
525
|
];
|
|
505
526
|
}
|
|
506
|
-
function
|
|
527
|
+
function Nt(e, t, n, r) {
|
|
507
528
|
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");
|
|
508
529
|
return a ? {
|
|
509
|
-
secondaryLabel: `處理者 ${
|
|
530
|
+
secondaryLabel: `處理者 ${ot(a)}`,
|
|
510
531
|
statusLabel: "待處理",
|
|
511
532
|
tone: "current"
|
|
512
533
|
} : o ? {
|
|
513
|
-
secondaryLabel: `已取消 ${
|
|
534
|
+
secondaryLabel: `已取消 ${ot(o)}`,
|
|
514
535
|
statusLabel: "已取消",
|
|
515
536
|
tone: "cancelled"
|
|
516
537
|
} : s ? {
|
|
517
|
-
secondaryLabel: `已完成 ${
|
|
538
|
+
secondaryLabel: `已完成 ${ot(s)}`,
|
|
518
539
|
statusLabel: "已完成",
|
|
519
540
|
tone: "completed"
|
|
520
541
|
} : l ? {
|
|
@@ -534,39 +555,40 @@ function jt(e, t, n, r) {
|
|
|
534
555
|
statusLabel: r === "REJECTED" ? "已拒絕" : "已完成",
|
|
535
556
|
tone: r === "REJECTED" ? "cancelled" : "completed"
|
|
536
557
|
} : {
|
|
537
|
-
secondaryLabel:
|
|
558
|
+
secondaryLabel: W(e.type),
|
|
538
559
|
statusLabel: "未抵達",
|
|
539
560
|
tone: "neutral"
|
|
540
561
|
};
|
|
541
562
|
}
|
|
542
563
|
//#endregion
|
|
543
564
|
//#region src/views/instances/detail/sections/container-helpers.ts
|
|
544
|
-
async function
|
|
565
|
+
async function Pt({ activityLogs: e, adhocDirectives: t = [], tasks: n }) {
|
|
545
566
|
let r = [...new Set([
|
|
546
567
|
...e.map((e) => e.actorMemberId),
|
|
568
|
+
...e.flatMap(_t),
|
|
547
569
|
...n.map((e) => e.assigneeMemberId),
|
|
548
570
|
...n.map((e) => e.originalAssigneeMemberId),
|
|
549
571
|
...n.flatMap((e) => e.candidateMemberIds),
|
|
550
|
-
...n.flatMap((e) =>
|
|
551
|
-
...t.flatMap((e) => [e.createdByMemberId, ...
|
|
552
|
-
].filter(
|
|
572
|
+
...n.flatMap((e) => Ze(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
|
|
573
|
+
...t.flatMap((e) => [e.createdByMemberId, ...Ft(e.targetValueJson)])
|
|
574
|
+
].filter(V))];
|
|
553
575
|
try {
|
|
554
|
-
return await
|
|
576
|
+
return await ye(r);
|
|
555
577
|
} catch {
|
|
556
578
|
return [];
|
|
557
579
|
}
|
|
558
580
|
}
|
|
559
|
-
function
|
|
581
|
+
function Ft(e) {
|
|
560
582
|
try {
|
|
561
583
|
return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
|
|
562
584
|
} catch {
|
|
563
585
|
return [];
|
|
564
586
|
}
|
|
565
587
|
}
|
|
566
|
-
async function
|
|
567
|
-
return (await Promise.all(e.map((e) =>
|
|
588
|
+
async function It(e) {
|
|
589
|
+
return (await Promise.all(e.map((e) => de(e.id)))).flat();
|
|
568
590
|
}
|
|
569
|
-
function
|
|
591
|
+
function Lt(e) {
|
|
570
592
|
return e.reduce((e, t) => {
|
|
571
593
|
let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
|
|
572
594
|
return new Map(e).set(t.taskId, r);
|
|
@@ -574,29 +596,29 @@ function Ft(e) {
|
|
|
574
596
|
}
|
|
575
597
|
//#endregion
|
|
576
598
|
//#region src/views/instances/detail/sections/InstanceFormSection.tsx
|
|
577
|
-
var
|
|
599
|
+
var Rt = {
|
|
578
600
|
display: "grid",
|
|
579
601
|
gap: 16
|
|
580
|
-
},
|
|
602
|
+
}, zt = {
|
|
581
603
|
display: "flex",
|
|
582
604
|
flexWrap: "wrap",
|
|
583
605
|
gap: 8
|
|
584
606
|
};
|
|
585
|
-
function
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
style:
|
|
607
|
+
function Bt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loading: i, onDataSourceStateChange: o, onResubmitFormChange: s, onResubmitInstance: c, onUploadAttachment: l, resubmitFormData: u, resubmitFormErrors: d }) {
|
|
608
|
+
return /* @__PURE__ */ T("div", {
|
|
609
|
+
style: Rt,
|
|
588
610
|
children: [
|
|
589
|
-
n ? /* @__PURE__ */
|
|
611
|
+
n ? /* @__PURE__ */ w(S, {
|
|
590
612
|
color: "text-error",
|
|
591
613
|
variant: "body",
|
|
592
614
|
children: n
|
|
593
615
|
}) : null,
|
|
594
|
-
i ? /* @__PURE__ */
|
|
616
|
+
i ? /* @__PURE__ */ w(S, {
|
|
595
617
|
color: "text-neutral",
|
|
596
618
|
variant: "body",
|
|
597
619
|
children: "載入中..."
|
|
598
620
|
}) : null,
|
|
599
|
-
r?.formDefinitionSnapshot.schema && r.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */
|
|
621
|
+
r?.formDefinitionSnapshot.schema && r.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(a, {
|
|
600
622
|
dataSourceContext: e ? {
|
|
601
623
|
instanceId: r.id,
|
|
602
624
|
kind: "runtime"
|
|
@@ -613,17 +635,17 @@ function Rt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
|
|
|
613
635
|
schema: r.formDefinitionSnapshot.schema,
|
|
614
636
|
uiSchema: r.formDefinitionSnapshot.uiSchema,
|
|
615
637
|
value: e ? u : r.formData
|
|
616
|
-
}), e ? /* @__PURE__ */
|
|
617
|
-
style:
|
|
618
|
-
children: /* @__PURE__ */
|
|
638
|
+
}), e ? /* @__PURE__ */ w("div", {
|
|
639
|
+
style: zt,
|
|
640
|
+
children: /* @__PURE__ */ w(g, {
|
|
619
641
|
disabled: t,
|
|
620
|
-
icon:
|
|
642
|
+
icon: Me,
|
|
621
643
|
iconType: "leading",
|
|
622
644
|
onClick: c,
|
|
623
645
|
variant: "base-primary",
|
|
624
646
|
children: "重新送出"
|
|
625
647
|
})
|
|
626
|
-
}) : null] }) : /* @__PURE__ */
|
|
648
|
+
}) : null] }) : /* @__PURE__ */ w(S, {
|
|
627
649
|
color: "text-neutral",
|
|
628
650
|
variant: "body",
|
|
629
651
|
children: "此案件沒有可顯示的表單快照。"
|
|
@@ -633,11 +655,11 @@ function Rt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
|
|
|
633
655
|
}
|
|
634
656
|
//#endregion
|
|
635
657
|
//#region src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
|
|
636
|
-
var
|
|
658
|
+
var Vt = {
|
|
637
659
|
display: "grid",
|
|
638
660
|
gap: 16
|
|
639
661
|
};
|
|
640
|
-
function
|
|
662
|
+
function Ht({ attachments: e, onDownload: n, onPreview: r }) {
|
|
641
663
|
let i = d(() => e.map((e) => ({
|
|
642
664
|
attachment: e,
|
|
643
665
|
createdAt: e.createdAt,
|
|
@@ -645,7 +667,7 @@ function Bt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
645
667
|
id: e.id,
|
|
646
668
|
key: e.id,
|
|
647
669
|
mimeType: e.mimeType,
|
|
648
|
-
sizeLabel:
|
|
670
|
+
sizeLabel: U(Number(e.sizeBytes))
|
|
649
671
|
})), [e]), a = d(() => [
|
|
650
672
|
{
|
|
651
673
|
dataIndex: "filename",
|
|
@@ -667,7 +689,7 @@ function Bt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
667
689
|
},
|
|
668
690
|
{
|
|
669
691
|
key: "createdAt",
|
|
670
|
-
render: (e) => /* @__PURE__ */
|
|
692
|
+
render: (e) => /* @__PURE__ */ w(S, {
|
|
671
693
|
component: "span",
|
|
672
694
|
variant: "body",
|
|
673
695
|
children: t(e.createdAt)
|
|
@@ -677,14 +699,14 @@ function Bt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
677
699
|
}
|
|
678
700
|
], []), o = d(() => ({
|
|
679
701
|
render: (e) => [...e.mimeType === "application/pdf" ? [{
|
|
680
|
-
icon:
|
|
702
|
+
icon: ke,
|
|
681
703
|
iconType: "leading",
|
|
682
704
|
name: "預覽",
|
|
683
705
|
onClick: () => {
|
|
684
706
|
r(e.attachment);
|
|
685
707
|
}
|
|
686
708
|
}] : [], {
|
|
687
|
-
icon:
|
|
709
|
+
icon: Oe,
|
|
688
710
|
iconType: "leading",
|
|
689
711
|
name: "下載",
|
|
690
712
|
onClick: () => {
|
|
@@ -694,18 +716,18 @@ function Bt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
694
716
|
variant: "base-secondary",
|
|
695
717
|
width: 160
|
|
696
718
|
}), [n, r]);
|
|
697
|
-
return /* @__PURE__ */
|
|
698
|
-
style:
|
|
699
|
-
children: [/* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ T("div", {
|
|
720
|
+
style: Vt,
|
|
721
|
+
children: [/* @__PURE__ */ w(S, {
|
|
700
722
|
component: "h2",
|
|
701
723
|
variant: "h3",
|
|
702
724
|
children: "附件"
|
|
703
|
-
}), i.length > 0 ? /* @__PURE__ */
|
|
725
|
+
}), i.length > 0 ? /* @__PURE__ */ w(x, {
|
|
704
726
|
actions: o,
|
|
705
727
|
columns: a,
|
|
706
728
|
dataSource: i,
|
|
707
729
|
fullWidth: !0
|
|
708
|
-
}) : /* @__PURE__ */
|
|
730
|
+
}) : /* @__PURE__ */ w(S, {
|
|
709
731
|
color: "text-neutral",
|
|
710
732
|
variant: "body",
|
|
711
733
|
children: "此案件沒有附件。"
|
|
@@ -714,55 +736,55 @@ function Bt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
714
736
|
}
|
|
715
737
|
//#endregion
|
|
716
738
|
//#region src/views/instances/detail/sections/InstanceTasksSection.tsx
|
|
717
|
-
var
|
|
739
|
+
var Ut = {
|
|
718
740
|
display: "grid",
|
|
719
741
|
gap: 12,
|
|
720
742
|
width: "100%"
|
|
721
|
-
},
|
|
743
|
+
}, Wt = {
|
|
722
744
|
minWidth: "100%",
|
|
723
745
|
width: "100%"
|
|
724
|
-
},
|
|
746
|
+
}, Gt = {
|
|
725
747
|
display: "grid",
|
|
726
748
|
gap: 12,
|
|
727
749
|
width: "100%"
|
|
728
|
-
},
|
|
729
|
-
function
|
|
750
|
+
}, Kt = { marginTop: 12 }, qt = { marginTop: 24 };
|
|
751
|
+
function Jt(e) {
|
|
730
752
|
e && (e.style.width = "100%");
|
|
731
753
|
}
|
|
732
|
-
var
|
|
754
|
+
var Yt = {
|
|
733
755
|
COMPLETION_NOTIFY: "結案通知",
|
|
734
756
|
COUNTERSIGN: "臨時會簽",
|
|
735
757
|
PRE_APPROVAL: "臨時加簽",
|
|
736
758
|
STAGE_NOTIFY: "階段完成通知"
|
|
737
|
-
},
|
|
759
|
+
}, Xt = {
|
|
738
760
|
COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
|
|
739
761
|
COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
|
|
740
762
|
PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
|
|
741
763
|
STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
|
|
742
|
-
},
|
|
764
|
+
}, Zt = [{
|
|
743
765
|
id: "REJECT_INSTANCE",
|
|
744
766
|
name: "加簽拒絕時整單駁回"
|
|
745
767
|
}, {
|
|
746
768
|
id: "RETURN_TO_ORIGIN",
|
|
747
769
|
name: "加簽拒絕時退回給我重新處理"
|
|
748
|
-
}],
|
|
770
|
+
}], Qt = [{
|
|
749
771
|
id: "MEMBER",
|
|
750
772
|
name: "指定成員"
|
|
751
773
|
}, {
|
|
752
774
|
id: "WEBHOOK",
|
|
753
775
|
name: "Webhook"
|
|
754
|
-
}],
|
|
755
|
-
let [l, f] = p(!1), [h, v] = p(null), [y, te] = p(""), [
|
|
776
|
+
}], $t = s(function({ adhocDirectives: e, currentMemberId: r, instance: i, memberProfilesById: a, onChanged: o, tasks: s }, c) {
|
|
777
|
+
let [l, f] = p(!1), [h, v] = p(null), [y, te] = p(""), [b, ie] = p(!1), [oe, le] = p(""), [ue, de] = p(null), [fe, pe] = p(!1), [me, he] = p(""), [ge, ye] = p(!1), [be, xe] = p(null), [Ce, we] = p(""), [Te, D] = p(null), [Ee, De] = p(!1), [Oe, ke] = p([]), [Ae, je] = p(!1), [Me, O] = p(""), [Ne, Pe] = p([]), [Fe, Ie] = p(!1), [Le, Re] = p([]), [ze, Be] = p(!1), [k, Ve] = p("COUNTERSIGN"), [He, Ue] = p("REJECT_INSTANCE"), [We, Ge] = p(!1), [A, Ke] = p("MEMBER"), [j, M] = p(""), N = oe.trim(), qe = me.trim(), Je = Ce.trim(), P = d(() => s.find((e) => st(e, r) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [r, s]), F = d(() => P && i ? i.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, i]), Ye = d(() => F && i ? ct(i.workflowSnapshot, F) : [], [F, i]), I = F?.type === "userTask" && F.data.returnBehavior.allowReturn, Xe = F?.type === "userTask" && F.data.allowReject !== !1, L = F?.type === "userTask" && F.data.allowTransfer !== !1, R = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, Ze = F?.type === "userTask" && F.data.allowAddSigner, z = d(() => e.filter((e) => e.status === "PENDING"), [e]), B = Ye.find((e) => e.id === be) ?? Ye[0] ?? null, Qe = d(() => s.map((e) => ({
|
|
756
778
|
...e,
|
|
757
|
-
assigneeLabel:
|
|
779
|
+
assigneeLabel: ot(e, a),
|
|
758
780
|
key: e.id,
|
|
759
|
-
nodeLabel: `${
|
|
760
|
-
statusLabel:
|
|
781
|
+
nodeLabel: `${at(e.nodeId, i?.workflowSnapshot ?? null)}${e.isAdhoc ? e.adhocType === "COUNTERSIGN" ? "(臨時會簽)" : "(臨時加簽)" : ""}`,
|
|
782
|
+
statusLabel: rt(e.status)
|
|
761
783
|
})), [
|
|
762
784
|
i,
|
|
763
785
|
a,
|
|
764
786
|
s
|
|
765
|
-
]),
|
|
787
|
+
]), V = d(() => [
|
|
766
788
|
{
|
|
767
789
|
dataIndex: "nodeLabel",
|
|
768
790
|
key: "nodeLabel",
|
|
@@ -772,7 +794,7 @@ var qt = {
|
|
|
772
794
|
{
|
|
773
795
|
key: "assigneeMemberId",
|
|
774
796
|
title: "處理者",
|
|
775
|
-
render: (e) => /* @__PURE__ */
|
|
797
|
+
render: (e) => /* @__PURE__ */ w(S, {
|
|
776
798
|
component: "span",
|
|
777
799
|
variant: "body",
|
|
778
800
|
children: e.assigneeLabel
|
|
@@ -787,7 +809,7 @@ var qt = {
|
|
|
787
809
|
},
|
|
788
810
|
{
|
|
789
811
|
key: "createdAt",
|
|
790
|
-
render: (e) => /* @__PURE__ */
|
|
812
|
+
render: (e) => /* @__PURE__ */ w(S, {
|
|
791
813
|
component: "span",
|
|
792
814
|
variant: "body",
|
|
793
815
|
children: t(e.createdAt)
|
|
@@ -795,13 +817,13 @@ var qt = {
|
|
|
795
817
|
title: "建立時間",
|
|
796
818
|
width: 220
|
|
797
819
|
}
|
|
798
|
-
], []),
|
|
820
|
+
], []), $e = d(() => z.map((e) => ({
|
|
799
821
|
...e,
|
|
800
|
-
createdByLabel:
|
|
822
|
+
createdByLabel: G(e.createdByMemberId, a),
|
|
801
823
|
key: e.id,
|
|
802
|
-
targetLabel:
|
|
803
|
-
typeLabel:
|
|
804
|
-
})), [a,
|
|
824
|
+
targetLabel: en(e, a),
|
|
825
|
+
typeLabel: Yt[e.type]
|
|
826
|
+
})), [a, z]), et = d(() => [
|
|
805
827
|
{
|
|
806
828
|
dataIndex: "typeLabel",
|
|
807
829
|
key: "typeLabel",
|
|
@@ -810,7 +832,7 @@ var qt = {
|
|
|
810
832
|
},
|
|
811
833
|
{
|
|
812
834
|
key: "targetLabel",
|
|
813
|
-
render: (e) => /* @__PURE__ */
|
|
835
|
+
render: (e) => /* @__PURE__ */ w(S, {
|
|
814
836
|
component: "span",
|
|
815
837
|
variant: "body",
|
|
816
838
|
children: e.targetLabel
|
|
@@ -820,7 +842,7 @@ var qt = {
|
|
|
820
842
|
},
|
|
821
843
|
{
|
|
822
844
|
key: "createdByLabel",
|
|
823
|
-
render: (e) => /* @__PURE__ */
|
|
845
|
+
render: (e) => /* @__PURE__ */ w(S, {
|
|
824
846
|
component: "span",
|
|
825
847
|
variant: "body",
|
|
826
848
|
children: e.createdByLabel
|
|
@@ -830,7 +852,7 @@ var qt = {
|
|
|
830
852
|
},
|
|
831
853
|
{
|
|
832
854
|
key: "createdAt",
|
|
833
|
-
render: (e) => /* @__PURE__ */
|
|
855
|
+
render: (e) => /* @__PURE__ */ w(S, {
|
|
834
856
|
component: "span",
|
|
835
857
|
variant: "body",
|
|
836
858
|
children: t(e.createdAt)
|
|
@@ -840,336 +862,336 @@ var qt = {
|
|
|
840
862
|
},
|
|
841
863
|
{
|
|
842
864
|
key: "actions",
|
|
843
|
-
render: (e) => e.createdByMemberId === r ? /* @__PURE__ */
|
|
844
|
-
disabled:
|
|
865
|
+
render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ w(g, {
|
|
866
|
+
disabled: We,
|
|
845
867
|
onClick: () => void St(e.id),
|
|
846
868
|
size: "minor",
|
|
847
869
|
variant: "destructive-secondary",
|
|
848
870
|
children: "撤回"
|
|
849
|
-
}) : /* @__PURE__ */
|
|
871
|
+
}) : /* @__PURE__ */ w(C, {}),
|
|
850
872
|
title: "操作",
|
|
851
873
|
width: 100
|
|
852
874
|
}
|
|
853
|
-
], [
|
|
854
|
-
async function
|
|
855
|
-
if (!r || !
|
|
875
|
+
], [We, r]);
|
|
876
|
+
async function U({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: i = null }) {
|
|
877
|
+
if (!r || !P || e === "REJECTED" && !Xe || e === "TRANSFERRED" && !L) return !1;
|
|
856
878
|
f(!0), v(null);
|
|
857
879
|
try {
|
|
858
|
-
await
|
|
880
|
+
await ce({
|
|
859
881
|
action: e,
|
|
860
882
|
comment: t,
|
|
861
883
|
decidedByMemberId: r,
|
|
862
884
|
returnToNodeId: n,
|
|
863
|
-
taskId:
|
|
885
|
+
taskId: P.id,
|
|
864
886
|
transferToMemberId: i
|
|
865
|
-
}),
|
|
887
|
+
}), pe(!1), ye(!1), je(!1), le(""), he(""), we(""), D(null), xe(null), de(null);
|
|
866
888
|
} catch (e) {
|
|
867
|
-
return v(
|
|
889
|
+
return v(H(e)), f(!1), !1;
|
|
868
890
|
}
|
|
869
891
|
try {
|
|
870
892
|
await o();
|
|
871
893
|
} catch (e) {
|
|
872
|
-
v(
|
|
894
|
+
v(H(e));
|
|
873
895
|
} finally {
|
|
874
896
|
f(!1);
|
|
875
897
|
}
|
|
876
898
|
return !0;
|
|
877
899
|
}
|
|
878
|
-
function et() {
|
|
879
|
-
r && I && (v(null), te(""), re(!0));
|
|
880
|
-
}
|
|
881
900
|
function tt() {
|
|
882
|
-
|
|
901
|
+
r && P && (v(null), te(""), ie(!0));
|
|
902
|
+
}
|
|
903
|
+
function nt() {
|
|
904
|
+
l || (ie(!1), te(""));
|
|
883
905
|
}
|
|
884
|
-
async function
|
|
885
|
-
l || await
|
|
906
|
+
async function it() {
|
|
907
|
+
l || await U({
|
|
886
908
|
action: "APPROVED",
|
|
887
909
|
comment: y.trim() || null
|
|
888
|
-
}) && (
|
|
910
|
+
}) && (ie(!1), te(""));
|
|
889
911
|
}
|
|
890
|
-
function
|
|
891
|
-
|
|
892
|
-
}
|
|
893
|
-
function J() {
|
|
894
|
-
l || (de(!1), ce(""), O(null));
|
|
912
|
+
function W() {
|
|
913
|
+
Xe && (le(""), de(null), pe(!0));
|
|
895
914
|
}
|
|
896
|
-
function
|
|
897
|
-
pe(
|
|
915
|
+
function q() {
|
|
916
|
+
l || (pe(!1), le(""), de(null));
|
|
898
917
|
}
|
|
899
918
|
function pt() {
|
|
900
|
-
|
|
901
|
-
}
|
|
902
|
-
function Y() {
|
|
903
|
-
z && (Se(""), k(null), ke(!0), ht(""));
|
|
919
|
+
he(""), xe(Ye[0]?.id ?? null), ye(!0);
|
|
904
920
|
}
|
|
905
921
|
function mt() {
|
|
906
|
-
l || (
|
|
922
|
+
l || (ye(!1), he(""), xe(null));
|
|
923
|
+
}
|
|
924
|
+
function J() {
|
|
925
|
+
L && (we(""), D(null), je(!0), gt(""));
|
|
907
926
|
}
|
|
908
|
-
|
|
909
|
-
|
|
927
|
+
function ht() {
|
|
928
|
+
l || (je(!1), we(""), D(null));
|
|
929
|
+
}
|
|
930
|
+
async function gt(e) {
|
|
931
|
+
De(!0);
|
|
910
932
|
try {
|
|
911
|
-
|
|
933
|
+
ke((await Se(e)).filter((e) => e.memberId !== r).map(lt));
|
|
912
934
|
} catch (e) {
|
|
913
|
-
v(
|
|
935
|
+
v(H(e));
|
|
914
936
|
} finally {
|
|
915
|
-
|
|
937
|
+
De(!1);
|
|
916
938
|
}
|
|
917
939
|
}
|
|
918
|
-
async function
|
|
919
|
-
if (
|
|
920
|
-
if (!
|
|
921
|
-
|
|
940
|
+
async function Y() {
|
|
941
|
+
if (Xe) {
|
|
942
|
+
if (!N) {
|
|
943
|
+
de("請輸入拒絕原因");
|
|
922
944
|
return;
|
|
923
945
|
}
|
|
924
|
-
await
|
|
946
|
+
await U({
|
|
925
947
|
action: "REJECTED",
|
|
926
|
-
comment:
|
|
948
|
+
comment: N
|
|
927
949
|
});
|
|
928
950
|
}
|
|
929
951
|
}
|
|
930
|
-
async function
|
|
931
|
-
if (
|
|
932
|
-
if (!
|
|
952
|
+
async function _t() {
|
|
953
|
+
if (L) {
|
|
954
|
+
if (!Te) {
|
|
933
955
|
v("請選擇轉派對象");
|
|
934
956
|
return;
|
|
935
957
|
}
|
|
936
|
-
await
|
|
958
|
+
await U({
|
|
937
959
|
action: "TRANSFERRED",
|
|
938
|
-
comment:
|
|
939
|
-
transferToMemberId:
|
|
960
|
+
comment: Je || null,
|
|
961
|
+
transferToMemberId: Te.id
|
|
940
962
|
});
|
|
941
963
|
}
|
|
942
964
|
}
|
|
943
|
-
async function
|
|
944
|
-
await
|
|
965
|
+
async function vt() {
|
|
966
|
+
await U({
|
|
945
967
|
action: "RETURNED",
|
|
946
|
-
comment:
|
|
947
|
-
returnToNodeId:
|
|
968
|
+
comment: qe || null,
|
|
969
|
+
returnToNodeId: B?.id ?? null
|
|
948
970
|
});
|
|
949
971
|
}
|
|
950
|
-
function
|
|
951
|
-
|
|
972
|
+
function X() {
|
|
973
|
+
O(""), Pe([]), Ue("REJECT_INSTANCE"), Ke("MEMBER"), M("");
|
|
952
974
|
}
|
|
953
975
|
function Z(e) {
|
|
954
|
-
|
|
976
|
+
Ve(e), X(), Be(!0), bt("");
|
|
955
977
|
}
|
|
956
978
|
function yt() {
|
|
957
|
-
|
|
979
|
+
We || (Be(!1), X());
|
|
958
980
|
}
|
|
959
981
|
async function bt(e) {
|
|
960
|
-
|
|
982
|
+
Ie(!0);
|
|
961
983
|
try {
|
|
962
|
-
|
|
984
|
+
Re((await Se(e)).map(lt));
|
|
963
985
|
} catch (e) {
|
|
964
|
-
v(
|
|
986
|
+
v(H(e));
|
|
965
987
|
} finally {
|
|
966
|
-
|
|
988
|
+
Ie(!1);
|
|
967
989
|
}
|
|
968
990
|
}
|
|
969
991
|
async function xt() {
|
|
970
|
-
if (!
|
|
971
|
-
let e = (
|
|
972
|
-
memberIds:
|
|
992
|
+
if (!P) return;
|
|
993
|
+
let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && A === "WEBHOOK", t = K({
|
|
994
|
+
memberIds: Ne.map((e) => e.id),
|
|
973
995
|
useWebhookTarget: e,
|
|
974
|
-
webhookUrl:
|
|
996
|
+
webhookUrl: j
|
|
975
997
|
});
|
|
976
998
|
if (!t.valid) {
|
|
977
999
|
v(t.error);
|
|
978
1000
|
return;
|
|
979
1001
|
}
|
|
980
|
-
let { target: n } = t, r =
|
|
981
|
-
|
|
1002
|
+
let { target: n } = t, r = Me.trim() || null;
|
|
1003
|
+
Ge(!0), v(null);
|
|
982
1004
|
try {
|
|
983
|
-
|
|
1005
|
+
k === "COUNTERSIGN" ? await _e({
|
|
984
1006
|
comment: r,
|
|
985
1007
|
target: n,
|
|
986
|
-
taskId:
|
|
987
|
-
}) :
|
|
1008
|
+
taskId: P.id
|
|
1009
|
+
}) : k === "PRE_APPROVAL" ? await ve({
|
|
988
1010
|
comment: r,
|
|
989
|
-
onReject:
|
|
1011
|
+
onReject: He,
|
|
990
1012
|
target: n,
|
|
991
|
-
taskId:
|
|
992
|
-
}) :
|
|
1013
|
+
taskId: P.id
|
|
1014
|
+
}) : k === "STAGE_NOTIFY" ? await se({
|
|
993
1015
|
target: n,
|
|
994
|
-
taskId:
|
|
995
|
-
}) : await
|
|
1016
|
+
taskId: P.id
|
|
1017
|
+
}) : await E({
|
|
996
1018
|
target: n,
|
|
997
|
-
taskId:
|
|
998
|
-
}),
|
|
1019
|
+
taskId: P.id
|
|
1020
|
+
}), Be(!1), X(), await o();
|
|
999
1021
|
} catch (e) {
|
|
1000
|
-
v(
|
|
1022
|
+
v(H(e));
|
|
1001
1023
|
} finally {
|
|
1002
|
-
|
|
1024
|
+
Ge(!1);
|
|
1003
1025
|
}
|
|
1004
1026
|
}
|
|
1005
1027
|
async function St(e) {
|
|
1006
|
-
|
|
1028
|
+
Ge(!0), v(null);
|
|
1007
1029
|
try {
|
|
1008
|
-
await
|
|
1030
|
+
await ae(e), await o();
|
|
1009
1031
|
} catch (e) {
|
|
1010
|
-
v(
|
|
1032
|
+
v(H(e));
|
|
1011
1033
|
} finally {
|
|
1012
|
-
|
|
1034
|
+
Ge(!1);
|
|
1013
1035
|
}
|
|
1014
1036
|
}
|
|
1015
1037
|
u(c, () => ({
|
|
1016
|
-
canAddSignerCurrentTask:
|
|
1017
|
-
canRejectCurrentTask:
|
|
1018
|
-
canReturnCurrentTask:
|
|
1019
|
-
canTransferCurrentTask:
|
|
1038
|
+
canAddSignerCurrentTask: Ze,
|
|
1039
|
+
canRejectCurrentTask: Xe,
|
|
1040
|
+
canReturnCurrentTask: I,
|
|
1041
|
+
canTransferCurrentTask: L,
|
|
1020
1042
|
deciding: l,
|
|
1021
|
-
handleApprove:
|
|
1022
|
-
hasCurrentTask:
|
|
1043
|
+
handleApprove: tt,
|
|
1044
|
+
hasCurrentTask: P !== null,
|
|
1023
1045
|
openAdhocModal: Z,
|
|
1024
|
-
openRejectModal:
|
|
1025
|
-
openReturnModal:
|
|
1026
|
-
openTransferModal:
|
|
1046
|
+
openRejectModal: W,
|
|
1047
|
+
openReturnModal: pt,
|
|
1048
|
+
openTransferModal: J
|
|
1027
1049
|
}), [
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
R,
|
|
1031
|
-
z,
|
|
1032
|
-
r,
|
|
1050
|
+
Ze,
|
|
1051
|
+
Xe,
|
|
1033
1052
|
I,
|
|
1053
|
+
L,
|
|
1054
|
+
r,
|
|
1055
|
+
P,
|
|
1034
1056
|
l
|
|
1035
1057
|
]);
|
|
1036
|
-
let Q =
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1058
|
+
let Q = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", Ct = Q && A === "WEBHOOK" ? !j.trim() : Ne.length === 0, wt = Zt.find((e) => e.id === He) ?? Zt[0], Tt = Qt.find((e) => e.id === A) ?? Qt[0];
|
|
1059
|
+
return /* @__PURE__ */ T(C, { children: [
|
|
1060
|
+
/* @__PURE__ */ w(S, {
|
|
1039
1061
|
component: "h2",
|
|
1040
1062
|
variant: "h3",
|
|
1041
1063
|
children: "任務"
|
|
1042
1064
|
}),
|
|
1043
|
-
h ? /* @__PURE__ */
|
|
1065
|
+
h ? /* @__PURE__ */ w(S, {
|
|
1044
1066
|
color: "text-error",
|
|
1045
1067
|
variant: "body",
|
|
1046
1068
|
children: h
|
|
1047
1069
|
}) : null,
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
style:
|
|
1050
|
-
children: /* @__PURE__ */
|
|
1051
|
-
columns:
|
|
1052
|
-
dataSource:
|
|
1070
|
+
/* @__PURE__ */ w("div", {
|
|
1071
|
+
style: Kt,
|
|
1072
|
+
children: /* @__PURE__ */ w(x, {
|
|
1073
|
+
columns: V,
|
|
1074
|
+
dataSource: Qe,
|
|
1053
1075
|
fullWidth: !0
|
|
1054
1076
|
})
|
|
1055
1077
|
}),
|
|
1056
|
-
|
|
1078
|
+
z.length > 0 ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, {
|
|
1057
1079
|
component: "h3",
|
|
1058
|
-
style:
|
|
1080
|
+
style: qt,
|
|
1059
1081
|
variant: "h3",
|
|
1060
1082
|
children: "待生效的臨時設定"
|
|
1061
|
-
}), /* @__PURE__ */
|
|
1062
|
-
style:
|
|
1063
|
-
children: /* @__PURE__ */
|
|
1064
|
-
columns:
|
|
1065
|
-
dataSource:
|
|
1083
|
+
}), /* @__PURE__ */ w("div", {
|
|
1084
|
+
style: Kt,
|
|
1085
|
+
children: /* @__PURE__ */ w(x, {
|
|
1086
|
+
columns: et,
|
|
1087
|
+
dataSource: $e,
|
|
1066
1088
|
fullWidth: !0
|
|
1067
1089
|
})
|
|
1068
1090
|
})] }) : null,
|
|
1069
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ T(_, {
|
|
1070
1092
|
cancelText: "取消",
|
|
1071
1093
|
confirmText: "送出同意",
|
|
1072
1094
|
loading: l,
|
|
1073
1095
|
modalType: "standard",
|
|
1074
|
-
onCancel:
|
|
1075
|
-
onClose:
|
|
1076
|
-
onConfirm: () => void
|
|
1077
|
-
open:
|
|
1096
|
+
onCancel: nt,
|
|
1097
|
+
onClose: nt,
|
|
1098
|
+
onConfirm: () => void it(),
|
|
1099
|
+
open: b,
|
|
1078
1100
|
showModalFooter: !0,
|
|
1079
1101
|
showModalHeader: !0,
|
|
1080
1102
|
size: "regular",
|
|
1081
1103
|
supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
|
|
1082
1104
|
title: "簽核意見",
|
|
1083
|
-
children: [h ? /* @__PURE__ */
|
|
1105
|
+
children: [h ? /* @__PURE__ */ w(S, {
|
|
1084
1106
|
color: "text-error",
|
|
1085
1107
|
role: "alert",
|
|
1086
1108
|
variant: "body",
|
|
1087
1109
|
children: h
|
|
1088
|
-
}) : null, /* @__PURE__ */
|
|
1089
|
-
style:
|
|
1090
|
-
children: /* @__PURE__ */
|
|
1110
|
+
}) : null, /* @__PURE__ */ w("div", {
|
|
1111
|
+
style: Ut,
|
|
1112
|
+
children: /* @__PURE__ */ w(n, {
|
|
1091
1113
|
label: "簽核意見",
|
|
1092
1114
|
name: "approveComment",
|
|
1093
|
-
children: /* @__PURE__ */
|
|
1115
|
+
children: /* @__PURE__ */ w(re, {
|
|
1094
1116
|
autoFocus: !0,
|
|
1095
1117
|
onChange: (e) => te(e.target.value),
|
|
1096
1118
|
placeholder: "選填,例如補充核准的條件或提醒事項",
|
|
1097
|
-
ref:
|
|
1119
|
+
ref: Jt,
|
|
1098
1120
|
resize: "vertical",
|
|
1099
1121
|
rows: 4,
|
|
1100
|
-
style:
|
|
1122
|
+
style: Wt,
|
|
1101
1123
|
value: y
|
|
1102
1124
|
})
|
|
1103
1125
|
})
|
|
1104
1126
|
})]
|
|
1105
1127
|
}),
|
|
1106
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ w(_, {
|
|
1107
1129
|
cancelText: "取消",
|
|
1108
1130
|
confirmButtonProps: {
|
|
1109
|
-
disabled: !
|
|
1131
|
+
disabled: !N,
|
|
1110
1132
|
variant: "destructive-primary"
|
|
1111
1133
|
},
|
|
1112
1134
|
confirmText: "送出拒絕",
|
|
1113
1135
|
loading: l,
|
|
1114
1136
|
modalStatusType: "error",
|
|
1115
1137
|
modalType: "standard",
|
|
1116
|
-
onCancel:
|
|
1117
|
-
onClose:
|
|
1118
|
-
onConfirm: () => void
|
|
1119
|
-
open:
|
|
1138
|
+
onCancel: q,
|
|
1139
|
+
onClose: q,
|
|
1140
|
+
onConfirm: () => void Y(),
|
|
1141
|
+
open: fe,
|
|
1120
1142
|
showModalFooter: !0,
|
|
1121
1143
|
showModalHeader: !0,
|
|
1122
1144
|
size: "regular",
|
|
1123
1145
|
supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
|
|
1124
1146
|
title: "拒絕原因",
|
|
1125
|
-
children: /* @__PURE__ */
|
|
1126
|
-
style:
|
|
1127
|
-
children: [/* @__PURE__ */
|
|
1147
|
+
children: /* @__PURE__ */ T("div", {
|
|
1148
|
+
style: Ut,
|
|
1149
|
+
children: [/* @__PURE__ */ w(n, {
|
|
1128
1150
|
label: "拒絕原因",
|
|
1129
1151
|
name: "rejectReason",
|
|
1130
1152
|
required: !0,
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1153
|
+
children: /* @__PURE__ */ w(re, {
|
|
1132
1154
|
autoFocus: !0,
|
|
1133
1155
|
onChange: (e) => {
|
|
1134
|
-
|
|
1156
|
+
le(e.target.value), de(null);
|
|
1135
1157
|
},
|
|
1136
1158
|
placeholder: "請說明拒絕原因",
|
|
1137
|
-
ref:
|
|
1159
|
+
ref: Jt,
|
|
1138
1160
|
resize: "vertical",
|
|
1139
1161
|
rows: 4,
|
|
1140
|
-
style:
|
|
1141
|
-
type:
|
|
1142
|
-
value:
|
|
1162
|
+
style: Wt,
|
|
1163
|
+
type: ue ? "error" : "default",
|
|
1164
|
+
value: oe
|
|
1143
1165
|
})
|
|
1144
|
-
}),
|
|
1166
|
+
}), ue ? /* @__PURE__ */ w(S, {
|
|
1145
1167
|
color: "text-error",
|
|
1146
1168
|
variant: "body",
|
|
1147
|
-
children:
|
|
1169
|
+
children: ue
|
|
1148
1170
|
}) : null]
|
|
1149
1171
|
})
|
|
1150
1172
|
}),
|
|
1151
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ w(_, {
|
|
1152
1174
|
cancelText: "取消",
|
|
1153
|
-
confirmButtonProps: { disabled: !
|
|
1175
|
+
confirmButtonProps: { disabled: !Te },
|
|
1154
1176
|
confirmText: "送出轉派",
|
|
1155
1177
|
loading: l,
|
|
1156
1178
|
modalType: "standard",
|
|
1157
|
-
onCancel:
|
|
1158
|
-
onClose:
|
|
1159
|
-
onConfirm: () => void
|
|
1160
|
-
open:
|
|
1179
|
+
onCancel: ht,
|
|
1180
|
+
onClose: ht,
|
|
1181
|
+
onConfirm: () => void _t(),
|
|
1182
|
+
open: Ae,
|
|
1161
1183
|
showModalFooter: !0,
|
|
1162
1184
|
showModalHeader: !0,
|
|
1163
1185
|
size: "regular",
|
|
1164
1186
|
supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
|
|
1165
1187
|
title: "轉派簽核",
|
|
1166
|
-
children: /* @__PURE__ */
|
|
1167
|
-
style:
|
|
1168
|
-
children: [/* @__PURE__ */
|
|
1188
|
+
children: /* @__PURE__ */ T("div", {
|
|
1189
|
+
style: Gt,
|
|
1190
|
+
children: [/* @__PURE__ */ w(n, {
|
|
1169
1191
|
label: "轉派對象",
|
|
1170
1192
|
name: "transferToMemberId",
|
|
1171
1193
|
required: !0,
|
|
1172
|
-
children: /* @__PURE__ */
|
|
1194
|
+
children: /* @__PURE__ */ w(m, {
|
|
1173
1195
|
asyncData: !0,
|
|
1174
1196
|
disabledOptionsFilter: !0,
|
|
1175
1197
|
emptyText: "沒有符合的成員",
|
|
@@ -1179,147 +1201,147 @@ var qt = {
|
|
|
1179
1201
|
name: "transfer-member-search",
|
|
1180
1202
|
spellCheck: !1
|
|
1181
1203
|
},
|
|
1182
|
-
loading:
|
|
1204
|
+
loading: Ee,
|
|
1183
1205
|
loadingText: "搜尋成員中...",
|
|
1184
1206
|
mode: "single",
|
|
1185
|
-
onChange: (e) =>
|
|
1186
|
-
onSearch:
|
|
1187
|
-
onSearchTextChange: (e) =>
|
|
1207
|
+
onChange: (e) => D(dt(e)),
|
|
1208
|
+
onSearch: gt,
|
|
1209
|
+
onSearchTextChange: (e) => D(ft(e, Oe)),
|
|
1188
1210
|
onVisibilityChange: (e) => {
|
|
1189
|
-
e &&
|
|
1211
|
+
e && gt("");
|
|
1190
1212
|
},
|
|
1191
|
-
options: [...
|
|
1213
|
+
options: [...Oe],
|
|
1192
1214
|
placeholder: "搜尋姓名或信箱",
|
|
1193
1215
|
searchDebounceTime: 300,
|
|
1194
|
-
value:
|
|
1216
|
+
value: Te
|
|
1195
1217
|
})
|
|
1196
|
-
}), /* @__PURE__ */
|
|
1218
|
+
}), /* @__PURE__ */ w(n, {
|
|
1197
1219
|
label: "轉派說明",
|
|
1198
1220
|
name: "transferComment",
|
|
1199
|
-
children: /* @__PURE__ */
|
|
1200
|
-
onChange: (e) =>
|
|
1221
|
+
children: /* @__PURE__ */ w(re, {
|
|
1222
|
+
onChange: (e) => we(e.target.value),
|
|
1201
1223
|
placeholder: "可補充轉派原因",
|
|
1202
|
-
ref:
|
|
1224
|
+
ref: Jt,
|
|
1203
1225
|
resize: "vertical",
|
|
1204
1226
|
rows: 4,
|
|
1205
|
-
style:
|
|
1206
|
-
value:
|
|
1227
|
+
style: Wt,
|
|
1228
|
+
value: Ce
|
|
1207
1229
|
})
|
|
1208
1230
|
})]
|
|
1209
1231
|
})
|
|
1210
1232
|
}),
|
|
1211
|
-
/* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ w(_, {
|
|
1212
1234
|
cancelText: "取消",
|
|
1213
|
-
confirmButtonProps: { disabled: !
|
|
1235
|
+
confirmButtonProps: { disabled: !B || R && !qe },
|
|
1214
1236
|
confirmText: "送出退回",
|
|
1215
1237
|
loading: l,
|
|
1216
1238
|
modalType: "standard",
|
|
1217
|
-
onCancel:
|
|
1218
|
-
onClose:
|
|
1219
|
-
onConfirm: () => void
|
|
1220
|
-
open:
|
|
1239
|
+
onCancel: mt,
|
|
1240
|
+
onClose: mt,
|
|
1241
|
+
onConfirm: () => void vt(),
|
|
1242
|
+
open: ge,
|
|
1221
1243
|
showModalFooter: !0,
|
|
1222
1244
|
showModalHeader: !0,
|
|
1223
1245
|
size: "regular",
|
|
1224
1246
|
supportingText: "退回後,流程會回到指定節點並等待重新處理。",
|
|
1225
1247
|
title: "退回簽核",
|
|
1226
|
-
children: /* @__PURE__ */
|
|
1227
|
-
style:
|
|
1228
|
-
children: [/* @__PURE__ */
|
|
1248
|
+
children: /* @__PURE__ */ T("div", {
|
|
1249
|
+
style: Gt,
|
|
1250
|
+
children: [/* @__PURE__ */ w(n, {
|
|
1229
1251
|
label: "退回節點",
|
|
1230
1252
|
name: "returnTargetNodeId",
|
|
1231
1253
|
required: !0,
|
|
1232
|
-
children: /* @__PURE__ */
|
|
1254
|
+
children: /* @__PURE__ */ w(ne, {
|
|
1233
1255
|
clearable: !1,
|
|
1234
1256
|
fullWidth: !0,
|
|
1235
|
-
onChange: (e) =>
|
|
1236
|
-
options: [...
|
|
1257
|
+
onChange: (e) => xe(e?.id ?? null),
|
|
1258
|
+
options: [...Ye],
|
|
1237
1259
|
placeholder: "選擇退回節點",
|
|
1238
|
-
value:
|
|
1260
|
+
value: B
|
|
1239
1261
|
})
|
|
1240
|
-
}), /* @__PURE__ */
|
|
1241
|
-
hintText:
|
|
1262
|
+
}), /* @__PURE__ */ w(n, {
|
|
1263
|
+
hintText: R ? "此關卡設定退回時必須填寫意見。" : void 0,
|
|
1242
1264
|
label: "退回說明",
|
|
1243
1265
|
name: "returnComment",
|
|
1244
|
-
required:
|
|
1245
|
-
children: /* @__PURE__ */
|
|
1246
|
-
onChange: (e) =>
|
|
1247
|
-
placeholder:
|
|
1248
|
-
ref:
|
|
1266
|
+
required: R,
|
|
1267
|
+
children: /* @__PURE__ */ w(re, {
|
|
1268
|
+
onChange: (e) => he(e.target.value),
|
|
1269
|
+
placeholder: R ? "請說明退回原因" : "可補充需要修改的內容",
|
|
1270
|
+
ref: Jt,
|
|
1249
1271
|
resize: "vertical",
|
|
1250
1272
|
rows: 4,
|
|
1251
|
-
style:
|
|
1252
|
-
value:
|
|
1273
|
+
style: Wt,
|
|
1274
|
+
value: me
|
|
1253
1275
|
})
|
|
1254
1276
|
})]
|
|
1255
1277
|
})
|
|
1256
1278
|
}),
|
|
1257
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ w(_, {
|
|
1258
1280
|
cancelText: "取消",
|
|
1259
1281
|
confirmButtonProps: { disabled: Ct },
|
|
1260
1282
|
confirmText: "送出",
|
|
1261
|
-
loading:
|
|
1283
|
+
loading: We,
|
|
1262
1284
|
modalType: "standard",
|
|
1263
1285
|
onCancel: yt,
|
|
1264
1286
|
onClose: yt,
|
|
1265
1287
|
onConfirm: () => void xt(),
|
|
1266
|
-
open:
|
|
1288
|
+
open: ze,
|
|
1267
1289
|
showModalFooter: !0,
|
|
1268
1290
|
showModalHeader: !0,
|
|
1269
1291
|
size: "regular",
|
|
1270
|
-
supportingText:
|
|
1271
|
-
title:
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1273
|
-
style:
|
|
1292
|
+
supportingText: Xt[k],
|
|
1293
|
+
title: Yt[k],
|
|
1294
|
+
children: /* @__PURE__ */ T("div", {
|
|
1295
|
+
style: Gt,
|
|
1274
1296
|
children: [
|
|
1275
|
-
Q ? /* @__PURE__ */
|
|
1297
|
+
Q ? /* @__PURE__ */ w(n, {
|
|
1276
1298
|
label: "通知時機",
|
|
1277
1299
|
name: "adhocNotifyMode",
|
|
1278
1300
|
required: !0,
|
|
1279
|
-
children: /* @__PURE__ */
|
|
1301
|
+
children: /* @__PURE__ */ w(ne, {
|
|
1280
1302
|
clearable: !1,
|
|
1281
1303
|
fullWidth: !0,
|
|
1282
|
-
onChange: (e) =>
|
|
1304
|
+
onChange: (e) => Ve(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
|
|
1283
1305
|
options: [{
|
|
1284
1306
|
id: "STAGE_NOTIFY",
|
|
1285
|
-
name:
|
|
1307
|
+
name: Yt.STAGE_NOTIFY
|
|
1286
1308
|
}, {
|
|
1287
1309
|
id: "COMPLETION_NOTIFY",
|
|
1288
|
-
name:
|
|
1310
|
+
name: Yt.COMPLETION_NOTIFY
|
|
1289
1311
|
}],
|
|
1290
1312
|
value: {
|
|
1291
|
-
id:
|
|
1292
|
-
name:
|
|
1313
|
+
id: k,
|
|
1314
|
+
name: Yt[k]
|
|
1293
1315
|
}
|
|
1294
1316
|
})
|
|
1295
1317
|
}) : null,
|
|
1296
|
-
Q ? /* @__PURE__ */
|
|
1318
|
+
Q ? /* @__PURE__ */ w(n, {
|
|
1297
1319
|
label: "通知對象類型",
|
|
1298
1320
|
name: "adhocTargetKind",
|
|
1299
1321
|
required: !0,
|
|
1300
|
-
children: /* @__PURE__ */
|
|
1322
|
+
children: /* @__PURE__ */ w(ne, {
|
|
1301
1323
|
clearable: !1,
|
|
1302
1324
|
fullWidth: !0,
|
|
1303
|
-
onChange: (e) =>
|
|
1304
|
-
options: [...
|
|
1325
|
+
onChange: (e) => Ke(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
|
|
1326
|
+
options: [...Qt],
|
|
1305
1327
|
value: Tt
|
|
1306
1328
|
})
|
|
1307
1329
|
}) : null,
|
|
1308
|
-
Q &&
|
|
1330
|
+
Q && A === "WEBHOOK" ? /* @__PURE__ */ w(n, {
|
|
1309
1331
|
label: "Webhook URL",
|
|
1310
1332
|
name: "adhocWebhookUrl",
|
|
1311
1333
|
required: !0,
|
|
1312
|
-
children: /* @__PURE__ */
|
|
1334
|
+
children: /* @__PURE__ */ w(ee, {
|
|
1313
1335
|
fullWidth: !0,
|
|
1314
|
-
onChange: (e) =>
|
|
1336
|
+
onChange: (e) => M(e.target.value),
|
|
1315
1337
|
placeholder: "https://example.com/webhook",
|
|
1316
|
-
value:
|
|
1338
|
+
value: j
|
|
1317
1339
|
})
|
|
1318
|
-
}) : /* @__PURE__ */
|
|
1340
|
+
}) : /* @__PURE__ */ w(n, {
|
|
1319
1341
|
label: Q ? "通知對象" : "簽核對象",
|
|
1320
1342
|
name: "adhocMemberId",
|
|
1321
1343
|
required: !0,
|
|
1322
|
-
children: /* @__PURE__ */
|
|
1344
|
+
children: /* @__PURE__ */ w(m, {
|
|
1323
1345
|
asyncData: !0,
|
|
1324
1346
|
disabledOptionsFilter: !0,
|
|
1325
1347
|
emptyText: "沒有符合的成員",
|
|
@@ -1329,45 +1351,45 @@ var qt = {
|
|
|
1329
1351
|
name: "adhoc-member-search",
|
|
1330
1352
|
spellCheck: !1
|
|
1331
1353
|
},
|
|
1332
|
-
loading:
|
|
1354
|
+
loading: Fe,
|
|
1333
1355
|
loadingText: "搜尋成員中...",
|
|
1334
1356
|
menuMaxHeight: 320,
|
|
1335
1357
|
mode: "multiple",
|
|
1336
|
-
onChange: (e) =>
|
|
1358
|
+
onChange: (e) => Pe(e.map(dt).filter(ut)),
|
|
1337
1359
|
onSearch: bt,
|
|
1338
1360
|
onVisibilityChange: (e) => {
|
|
1339
1361
|
e && bt("");
|
|
1340
1362
|
},
|
|
1341
|
-
options: [...
|
|
1363
|
+
options: [...Le],
|
|
1342
1364
|
overflowStrategy: "wrap",
|
|
1343
1365
|
placeholder: "搜尋姓名或信箱,可加入多位",
|
|
1344
1366
|
searchDebounceTime: 300,
|
|
1345
|
-
value: [...
|
|
1367
|
+
value: [...Ne]
|
|
1346
1368
|
})
|
|
1347
1369
|
}),
|
|
1348
|
-
|
|
1370
|
+
k === "PRE_APPROVAL" ? /* @__PURE__ */ w(n, {
|
|
1349
1371
|
label: "拒簽處理方式",
|
|
1350
1372
|
name: "adhocOnReject",
|
|
1351
1373
|
required: !0,
|
|
1352
|
-
children: /* @__PURE__ */
|
|
1374
|
+
children: /* @__PURE__ */ w(ne, {
|
|
1353
1375
|
clearable: !1,
|
|
1354
1376
|
fullWidth: !0,
|
|
1355
|
-
onChange: (e) =>
|
|
1356
|
-
options: [...
|
|
1377
|
+
onChange: (e) => Ue(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
|
|
1378
|
+
options: [...Zt],
|
|
1357
1379
|
value: wt
|
|
1358
1380
|
})
|
|
1359
1381
|
}) : null,
|
|
1360
|
-
Q ? null : /* @__PURE__ */
|
|
1382
|
+
Q ? null : /* @__PURE__ */ w(n, {
|
|
1361
1383
|
label: "說明",
|
|
1362
1384
|
name: "adhocComment",
|
|
1363
|
-
children: /* @__PURE__ */
|
|
1364
|
-
onChange: (e) =>
|
|
1385
|
+
children: /* @__PURE__ */ w(re, {
|
|
1386
|
+
onChange: (e) => O(e.target.value),
|
|
1365
1387
|
placeholder: "可補充原因",
|
|
1366
|
-
ref:
|
|
1388
|
+
ref: Jt,
|
|
1367
1389
|
resize: "vertical",
|
|
1368
1390
|
rows: 3,
|
|
1369
|
-
style:
|
|
1370
|
-
value:
|
|
1391
|
+
style: Wt,
|
|
1392
|
+
value: Me
|
|
1371
1393
|
})
|
|
1372
1394
|
})
|
|
1373
1395
|
]
|
|
@@ -1375,10 +1397,10 @@ var qt = {
|
|
|
1375
1397
|
})
|
|
1376
1398
|
] });
|
|
1377
1399
|
});
|
|
1378
|
-
function
|
|
1400
|
+
function en(e, t) {
|
|
1379
1401
|
try {
|
|
1380
1402
|
let n = JSON.parse(e.targetValueJson);
|
|
1381
|
-
if (n.memberIds?.length) return n.memberIds.map((e) =>
|
|
1403
|
+
if (n.memberIds?.length) return n.memberIds.map((e) => G(e, t)).join("、");
|
|
1382
1404
|
if (n.webhookUrl) return n.webhookUrl;
|
|
1383
1405
|
if (n.positionId) return `職位 ${n.positionId}`;
|
|
1384
1406
|
if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
|
|
@@ -1387,14 +1409,14 @@ function Qt(e, t) {
|
|
|
1387
1409
|
}
|
|
1388
1410
|
//#endregion
|
|
1389
1411
|
//#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
|
|
1390
|
-
var
|
|
1412
|
+
var tn = {
|
|
1391
1413
|
display: "grid",
|
|
1392
1414
|
gap: 16
|
|
1393
1415
|
};
|
|
1394
|
-
function
|
|
1416
|
+
function nn({ signatureVerification: e, signatures: n }) {
|
|
1395
1417
|
let r = d(() => n.map((e) => ({
|
|
1396
1418
|
algorithm: e.algorithm,
|
|
1397
|
-
hashLabel:
|
|
1419
|
+
hashLabel: tt(e.signedPayloadHash),
|
|
1398
1420
|
key: e.id,
|
|
1399
1421
|
keyVersion: e.keyVersion,
|
|
1400
1422
|
signedAtLabel: t(e.signedAt),
|
|
@@ -1431,20 +1453,20 @@ function en({ signatureVerification: e, signatures: n }) {
|
|
|
1431
1453
|
width: 220
|
|
1432
1454
|
}
|
|
1433
1455
|
], []);
|
|
1434
|
-
return /* @__PURE__ */
|
|
1435
|
-
style:
|
|
1456
|
+
return /* @__PURE__ */ T("div", {
|
|
1457
|
+
style: tn,
|
|
1436
1458
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ w(S, {
|
|
1438
1460
|
component: "h2",
|
|
1439
1461
|
variant: "h3",
|
|
1440
1462
|
children: "簽章"
|
|
1441
1463
|
}),
|
|
1442
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ w(S, {
|
|
1443
1465
|
color: e?.valid ? "text-success" : "text-error",
|
|
1444
1466
|
variant: "body",
|
|
1445
1467
|
children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
|
|
1446
1468
|
}),
|
|
1447
|
-
r.length > 0 ? /* @__PURE__ */
|
|
1469
|
+
r.length > 0 ? /* @__PURE__ */ w(x, {
|
|
1448
1470
|
columns: i,
|
|
1449
1471
|
dataSource: r,
|
|
1450
1472
|
fullWidth: !0
|
|
@@ -1454,55 +1476,55 @@ function en({ signatureVerification: e, signatures: n }) {
|
|
|
1454
1476
|
}
|
|
1455
1477
|
//#endregion
|
|
1456
1478
|
//#region src/views/instances/detail/sections/InstanceHistorySection.tsx
|
|
1457
|
-
var
|
|
1479
|
+
var rn = {
|
|
1458
1480
|
display: "grid",
|
|
1459
1481
|
gap: 16
|
|
1460
|
-
},
|
|
1482
|
+
}, an = {
|
|
1461
1483
|
cursor: "help",
|
|
1462
1484
|
textDecoration: "underline dotted",
|
|
1463
1485
|
textUnderlineOffset: 3
|
|
1464
|
-
},
|
|
1486
|
+
}, on = {
|
|
1465
1487
|
borderLeftColor: "var(--mzn-color-border)",
|
|
1466
1488
|
borderLeftStyle: "solid",
|
|
1467
1489
|
borderLeftWidth: 2,
|
|
1468
1490
|
marginTop: 4,
|
|
1469
1491
|
paddingLeft: 8,
|
|
1470
1492
|
whiteSpace: "pre-wrap"
|
|
1471
|
-
},
|
|
1472
|
-
...
|
|
1493
|
+
}, sn = { color: "var(--mzn-color-text-secondary)" }, cn = {
|
|
1494
|
+
...on,
|
|
1473
1495
|
borderLeftColor: "var(--mzn-color-text-error)",
|
|
1474
1496
|
color: "var(--mzn-color-text-error)"
|
|
1475
1497
|
};
|
|
1476
|
-
function
|
|
1477
|
-
return e.filter((e) =>
|
|
1498
|
+
function ln(...e) {
|
|
1499
|
+
return e.filter((e) => V(e ?? null)).join(" ");
|
|
1478
1500
|
}
|
|
1479
|
-
var
|
|
1501
|
+
var un = s(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: s = "pending", title: c, type: l = "number", ...u }, d) {
|
|
1480
1502
|
let f = r ? "pending" : s, p = t.filter((e) => e.type !== "comment"), m = t.filter((e) => e.type === "comment");
|
|
1481
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ T("div", {
|
|
1482
1504
|
...u,
|
|
1483
|
-
className:
|
|
1505
|
+
className: ln(j.host, l === "dot" ? j.dot : null, n && f !== "processing" ? j.error : null, a === "horizontal" ? j.horizontal : null, l === "number" ? j.number : null, f === "pending" ? j.pending : null, f === "processing" ? j.processing : null, n && f === "processing" ? j.processingError : null, !n && f === "succeeded" ? j.succeeded : null, a === "vertical" ? j.vertical : null, e),
|
|
1484
1506
|
ref: d,
|
|
1485
|
-
children: [l === "dot" ? /* @__PURE__ */
|
|
1486
|
-
className:
|
|
1507
|
+
children: [l === "dot" ? /* @__PURE__ */ w("span", { className: ln(j.statusIndicator, j.statusIndicatorDot) }) : /* @__PURE__ */ w("span", {
|
|
1508
|
+
className: j.statusIndicator,
|
|
1487
1509
|
children: i + 1
|
|
1488
|
-
}), /* @__PURE__ */
|
|
1489
|
-
className:
|
|
1510
|
+
}), /* @__PURE__ */ T("div", {
|
|
1511
|
+
className: j.textContainer,
|
|
1490
1512
|
children: [
|
|
1491
|
-
/* @__PURE__ */
|
|
1492
|
-
className:
|
|
1513
|
+
/* @__PURE__ */ T(S, {
|
|
1514
|
+
className: j.title,
|
|
1493
1515
|
variant: "label-primary-highlight",
|
|
1494
|
-
children: [c, /* @__PURE__ */
|
|
1516
|
+
children: [c, /* @__PURE__ */ w("span", { className: j.titleConnectLine })]
|
|
1495
1517
|
}),
|
|
1496
|
-
p.length > 0 ? /* @__PURE__ */
|
|
1497
|
-
className:
|
|
1518
|
+
p.length > 0 ? /* @__PURE__ */ w(S, {
|
|
1519
|
+
className: j.description,
|
|
1498
1520
|
variant: "caption",
|
|
1499
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
1521
|
+
children: p.map((e, t) => /* @__PURE__ */ T(o, { children: [t > 0 ? " · " : null, dn(e)] }, `${e.type}-${t}`))
|
|
1500
1522
|
}) : null,
|
|
1501
|
-
m.map((e, t) => /* @__PURE__ */
|
|
1502
|
-
style: e.tone === "danger" ?
|
|
1523
|
+
m.map((e, t) => /* @__PURE__ */ T(S, {
|
|
1524
|
+
style: e.tone === "danger" ? cn : on,
|
|
1503
1525
|
variant: "body",
|
|
1504
|
-
children: [/* @__PURE__ */
|
|
1505
|
-
style: e.tone === "danger" ? void 0 :
|
|
1526
|
+
children: [/* @__PURE__ */ T("span", {
|
|
1527
|
+
style: e.tone === "danger" ? void 0 : sn,
|
|
1506
1528
|
children: [e.label, ":"]
|
|
1507
1529
|
}), e.text]
|
|
1508
1530
|
}, `comment-${t}`))
|
|
@@ -1510,44 +1532,44 @@ var cn = s(function({ className: e, descriptionParts: t, error: n, forcePending:
|
|
|
1510
1532
|
})]
|
|
1511
1533
|
});
|
|
1512
1534
|
});
|
|
1513
|
-
function
|
|
1514
|
-
return e.type === "text" ? e.text : e.email ? /* @__PURE__ */
|
|
1535
|
+
function dn(e) {
|
|
1536
|
+
return e.type === "text" ? e.text : e.email ? /* @__PURE__ */ T(C, { children: [
|
|
1515
1537
|
e.prefix,
|
|
1516
1538
|
":",
|
|
1517
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ w(ie, {
|
|
1518
1540
|
title: e.email,
|
|
1519
|
-
children: ({ ref: t, ...n }) => /* @__PURE__ */
|
|
1541
|
+
children: ({ ref: t, ...n }) => /* @__PURE__ */ w("span", {
|
|
1520
1542
|
...n,
|
|
1521
1543
|
"data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
|
|
1522
1544
|
ref: t,
|
|
1523
|
-
style:
|
|
1545
|
+
style: an,
|
|
1524
1546
|
children: e.label
|
|
1525
1547
|
})
|
|
1526
1548
|
})
|
|
1527
1549
|
] }) : `${e.prefix}:${e.label}`;
|
|
1528
1550
|
}
|
|
1529
|
-
function
|
|
1530
|
-
let l =
|
|
1551
|
+
function fn({ activityLogs: e, instanceState: t, memberProfilesById: n, signatureVerification: r, signaturesById: i, taskDecisionsByTaskId: a, tasks: o, workflowSnapshot: s, workflowTokens: c }) {
|
|
1552
|
+
let l = Mt(e, o, c, s, t, n, a, i, r), u = ht(l), d = l.map((e) => ({
|
|
1531
1553
|
...e,
|
|
1532
|
-
descriptionParts: e.descriptionParts.filter(
|
|
1554
|
+
descriptionParts: e.descriptionParts.filter(J)
|
|
1533
1555
|
}));
|
|
1534
|
-
return /* @__PURE__ */
|
|
1535
|
-
style:
|
|
1536
|
-
children: [/* @__PURE__ */
|
|
1556
|
+
return /* @__PURE__ */ T("div", {
|
|
1557
|
+
style: rn,
|
|
1558
|
+
children: [/* @__PURE__ */ w(S, {
|
|
1537
1559
|
component: "h2",
|
|
1538
1560
|
variant: "h3",
|
|
1539
1561
|
children: "歷程"
|
|
1540
|
-
}), d.length > 0 ? /* @__PURE__ */
|
|
1562
|
+
}), d.length > 0 ? /* @__PURE__ */ w(b, {
|
|
1541
1563
|
currentStep: u,
|
|
1542
1564
|
orientation: "vertical",
|
|
1543
1565
|
type: "dot",
|
|
1544
|
-
children: d.map((e) => /* @__PURE__ */
|
|
1566
|
+
children: d.map((e) => /* @__PURE__ */ w(un, {
|
|
1545
1567
|
descriptionParts: e.descriptionParts,
|
|
1546
1568
|
error: e.error,
|
|
1547
1569
|
forcePending: e.forcePending,
|
|
1548
1570
|
title: e.title
|
|
1549
1571
|
}, e.id))
|
|
1550
|
-
}) : /* @__PURE__ */
|
|
1572
|
+
}) : /* @__PURE__ */ w(S, {
|
|
1551
1573
|
color: "text-neutral",
|
|
1552
1574
|
variant: "body",
|
|
1553
1575
|
children: "尚無歷程紀錄。"
|
|
@@ -1556,30 +1578,30 @@ function un({ activityLogs: e, instanceState: t, memberProfilesById: n, signatur
|
|
|
1556
1578
|
}
|
|
1557
1579
|
//#endregion
|
|
1558
1580
|
//#region src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
|
|
1559
|
-
var
|
|
1581
|
+
var pn = {
|
|
1560
1582
|
display: "grid",
|
|
1561
1583
|
gap: 16
|
|
1562
|
-
},
|
|
1584
|
+
}, mn = {
|
|
1563
1585
|
display: "grid",
|
|
1564
1586
|
gap: 2
|
|
1565
|
-
},
|
|
1587
|
+
}, hn = {
|
|
1566
1588
|
overflowWrap: "anywhere",
|
|
1567
1589
|
whiteSpace: "pre-wrap"
|
|
1568
1590
|
};
|
|
1569
|
-
function
|
|
1591
|
+
function gn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
1570
1592
|
let [r, i] = p(null), [a, o] = p(!1), [s, c] = p(null), l = d(() => e.map((e) => ({
|
|
1571
1593
|
delivery: e,
|
|
1572
1594
|
key: e.id
|
|
1573
1595
|
})), [e]), u = d(() => [
|
|
1574
1596
|
{
|
|
1575
1597
|
key: "endpoint",
|
|
1576
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1577
|
-
style:
|
|
1578
|
-
children: [/* @__PURE__ */
|
|
1598
|
+
render: ({ delivery: e }) => /* @__PURE__ */ T("div", {
|
|
1599
|
+
style: mn,
|
|
1600
|
+
children: [/* @__PURE__ */ w(S, {
|
|
1579
1601
|
component: "span",
|
|
1580
1602
|
variant: "body",
|
|
1581
1603
|
children: e.endpointLabel ?? e.endpointKey
|
|
1582
|
-
}), /* @__PURE__ */
|
|
1604
|
+
}), /* @__PURE__ */ T(S, {
|
|
1583
1605
|
color: "text-neutral",
|
|
1584
1606
|
component: "span",
|
|
1585
1607
|
variant: "caption",
|
|
@@ -1598,13 +1620,13 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1598
1620
|
},
|
|
1599
1621
|
{
|
|
1600
1622
|
key: "status",
|
|
1601
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1623
|
+
render: ({ delivery: e }) => /* @__PURE__ */ w(_n, { status: e.status }),
|
|
1602
1624
|
title: "狀態",
|
|
1603
1625
|
width: 120
|
|
1604
1626
|
},
|
|
1605
1627
|
{
|
|
1606
1628
|
key: "attemptCount",
|
|
1607
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1629
|
+
render: ({ delivery: e }) => /* @__PURE__ */ w(S, {
|
|
1608
1630
|
component: "span",
|
|
1609
1631
|
variant: "body",
|
|
1610
1632
|
children: e.attemptCount
|
|
@@ -1614,21 +1636,21 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1614
1636
|
},
|
|
1615
1637
|
{
|
|
1616
1638
|
key: "lastError",
|
|
1617
|
-
render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */
|
|
1618
|
-
style:
|
|
1619
|
-
children: [/* @__PURE__ */
|
|
1639
|
+
render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ T("div", {
|
|
1640
|
+
style: mn,
|
|
1641
|
+
children: [/* @__PURE__ */ w(S, {
|
|
1620
1642
|
color: "text-error",
|
|
1621
1643
|
component: "span",
|
|
1622
1644
|
variant: "body",
|
|
1623
1645
|
children: e.lastErrorCode
|
|
1624
|
-
}), e.lastErrorDetail ? /* @__PURE__ */
|
|
1646
|
+
}), e.lastErrorDetail ? /* @__PURE__ */ w(S, {
|
|
1625
1647
|
color: "text-neutral",
|
|
1626
1648
|
component: "span",
|
|
1627
|
-
style:
|
|
1649
|
+
style: hn,
|
|
1628
1650
|
variant: "caption",
|
|
1629
1651
|
children: e.lastErrorDetail
|
|
1630
1652
|
}) : null]
|
|
1631
|
-
}) : /* @__PURE__ */
|
|
1653
|
+
}) : /* @__PURE__ */ w(S, {
|
|
1632
1654
|
color: "text-neutral",
|
|
1633
1655
|
component: "span",
|
|
1634
1656
|
variant: "body",
|
|
@@ -1639,10 +1661,10 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1639
1661
|
},
|
|
1640
1662
|
{
|
|
1641
1663
|
key: "time",
|
|
1642
|
-
render: ({ delivery: e }) => /* @__PURE__ */
|
|
1664
|
+
render: ({ delivery: e }) => /* @__PURE__ */ w(S, {
|
|
1643
1665
|
component: "span",
|
|
1644
1666
|
variant: "body",
|
|
1645
|
-
children:
|
|
1667
|
+
children: vn(e)
|
|
1646
1668
|
}),
|
|
1647
1669
|
title: "時間",
|
|
1648
1670
|
width: 220
|
|
@@ -1650,7 +1672,7 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1650
1672
|
], [n]), f = d(() => ({
|
|
1651
1673
|
render: ({ delivery: e }) => e.status === "FAILED" && e.attemptCount > 0 ? [{
|
|
1652
1674
|
disabled: () => a,
|
|
1653
|
-
icon:
|
|
1675
|
+
icon: O,
|
|
1654
1676
|
iconType: "leading",
|
|
1655
1677
|
name: "重新傳送",
|
|
1656
1678
|
onClick: () => {
|
|
@@ -1672,30 +1694,30 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1672
1694
|
}
|
|
1673
1695
|
}
|
|
1674
1696
|
}
|
|
1675
|
-
return /* @__PURE__ */
|
|
1676
|
-
style:
|
|
1697
|
+
return /* @__PURE__ */ T("div", {
|
|
1698
|
+
style: pn,
|
|
1677
1699
|
children: [
|
|
1678
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ w(S, {
|
|
1679
1701
|
component: "h2",
|
|
1680
1702
|
variant: "h3",
|
|
1681
1703
|
children: "外部系統通知"
|
|
1682
1704
|
}),
|
|
1683
|
-
s ? /* @__PURE__ */
|
|
1705
|
+
s ? /* @__PURE__ */ w(S, {
|
|
1684
1706
|
color: "text-error",
|
|
1685
1707
|
variant: "body",
|
|
1686
1708
|
children: s
|
|
1687
1709
|
}) : null,
|
|
1688
|
-
l.length > 0 ? /* @__PURE__ */
|
|
1710
|
+
l.length > 0 ? /* @__PURE__ */ w(x, {
|
|
1689
1711
|
actions: f,
|
|
1690
1712
|
columns: u,
|
|
1691
1713
|
dataSource: l,
|
|
1692
1714
|
fullWidth: !0
|
|
1693
|
-
}) : /* @__PURE__ */
|
|
1715
|
+
}) : /* @__PURE__ */ w(S, {
|
|
1694
1716
|
color: "text-neutral",
|
|
1695
1717
|
variant: "body",
|
|
1696
1718
|
children: "此案件沒有外部系統通知。"
|
|
1697
1719
|
}),
|
|
1698
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ w(_, {
|
|
1699
1721
|
cancelText: "取消",
|
|
1700
1722
|
confirmText: "重新傳送",
|
|
1701
1723
|
loading: a,
|
|
@@ -1709,7 +1731,7 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1709
1731
|
showModalHeader: !0,
|
|
1710
1732
|
supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
|
|
1711
1733
|
title: "重新傳送通知",
|
|
1712
|
-
children: /* @__PURE__ */
|
|
1734
|
+
children: /* @__PURE__ */ T(S, {
|
|
1713
1735
|
variant: "body",
|
|
1714
1736
|
children: [
|
|
1715
1737
|
"確定要重新通知「",
|
|
@@ -1721,30 +1743,30 @@ function mn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
|
|
|
1721
1743
|
]
|
|
1722
1744
|
});
|
|
1723
1745
|
}
|
|
1724
|
-
function
|
|
1725
|
-
return e === "SENT" ? /* @__PURE__ */
|
|
1746
|
+
function _n({ status: e }) {
|
|
1747
|
+
return e === "SENT" ? /* @__PURE__ */ w(h, {
|
|
1726
1748
|
size: "sub",
|
|
1727
1749
|
text: "已送達",
|
|
1728
1750
|
variant: "dot-success"
|
|
1729
|
-
}) : e === "FAILED" ? /* @__PURE__ */
|
|
1751
|
+
}) : e === "FAILED" ? /* @__PURE__ */ w(h, {
|
|
1730
1752
|
size: "sub",
|
|
1731
1753
|
text: "失敗",
|
|
1732
1754
|
variant: "dot-error"
|
|
1733
|
-
}) : /* @__PURE__ */
|
|
1755
|
+
}) : /* @__PURE__ */ w(h, {
|
|
1734
1756
|
size: "sub",
|
|
1735
1757
|
text: e === "PENDING" ? "等待傳送" : "傳送中",
|
|
1736
1758
|
variant: "dot-info"
|
|
1737
1759
|
});
|
|
1738
1760
|
}
|
|
1739
|
-
function
|
|
1761
|
+
function vn(e) {
|
|
1740
1762
|
return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
|
|
1741
1763
|
}
|
|
1742
1764
|
//#endregion
|
|
1743
1765
|
//#region src/views/instances/detail/InstanceDetailView.tsx
|
|
1744
|
-
var
|
|
1766
|
+
var yn = 3e3, bn = 40, xn = 184, Sn = 96, Cn = {
|
|
1745
1767
|
display: "grid",
|
|
1746
1768
|
gap: 16
|
|
1747
|
-
},
|
|
1769
|
+
}, wn = {
|
|
1748
1770
|
background: "#f8fafc",
|
|
1749
1771
|
border: "1px solid #e2e8f0",
|
|
1750
1772
|
borderRadius: 8,
|
|
@@ -1752,7 +1774,7 @@ var _n = 3e3, vn = 40, yn = 184, bn = 96, xn = {
|
|
|
1752
1774
|
minHeight: 440,
|
|
1753
1775
|
overflow: "hidden",
|
|
1754
1776
|
width: "min(80vw, 1040px)"
|
|
1755
|
-
},
|
|
1777
|
+
}, Tn = {
|
|
1756
1778
|
background: "#ffffff",
|
|
1757
1779
|
border: "1px solid #cbd5e1",
|
|
1758
1780
|
borderRadius: 8,
|
|
@@ -1762,24 +1784,24 @@ var _n = 3e3, vn = 40, yn = 184, bn = 96, xn = {
|
|
|
1762
1784
|
minHeight: 82,
|
|
1763
1785
|
padding: 12,
|
|
1764
1786
|
width: 184
|
|
1765
|
-
},
|
|
1787
|
+
}, En = {
|
|
1766
1788
|
borderRadius: 999,
|
|
1767
1789
|
fontSize: 12,
|
|
1768
1790
|
fontWeight: 600,
|
|
1769
1791
|
justifySelf: "start",
|
|
1770
1792
|
lineHeight: "18px",
|
|
1771
1793
|
padding: "0 8px"
|
|
1772
|
-
},
|
|
1794
|
+
}, Dn = {
|
|
1773
1795
|
color: "#64748b",
|
|
1774
1796
|
fontSize: 12,
|
|
1775
1797
|
overflow: "hidden",
|
|
1776
1798
|
textOverflow: "ellipsis",
|
|
1777
1799
|
whiteSpace: "nowrap"
|
|
1778
|
-
},
|
|
1800
|
+
}, On = { opacity: 0 }, kn = {
|
|
1779
1801
|
display: "flex",
|
|
1780
1802
|
flexWrap: "wrap",
|
|
1781
1803
|
gap: 8
|
|
1782
|
-
},
|
|
1804
|
+
}, An = {
|
|
1783
1805
|
alignItems: "center",
|
|
1784
1806
|
background: "#ffffff",
|
|
1785
1807
|
border: "1px solid #cbd5e1",
|
|
@@ -1791,29 +1813,29 @@ var _n = 3e3, vn = 40, yn = 184, bn = 96, xn = {
|
|
|
1791
1813
|
gap: 6,
|
|
1792
1814
|
lineHeight: "20px",
|
|
1793
1815
|
padding: "4px 8px"
|
|
1794
|
-
},
|
|
1816
|
+
}, jn = {
|
|
1795
1817
|
display: "grid",
|
|
1796
1818
|
gap: 16
|
|
1797
|
-
},
|
|
1798
|
-
function
|
|
1799
|
-
let { member:
|
|
1819
|
+
}, Mn = { workflowRuntime: Hn };
|
|
1820
|
+
function Nn({ instanceId: a, showAttachments: o = !0, showForm: s = !0, showHistory: u = !0, showSignatures: m = !0, showTasks: h = !0, showWebhookDeliveries: ee = !0 }) {
|
|
1821
|
+
let { member: ne } = e(), b = ne?.memberId ?? null, x = ee && r(ne), [ie, ae] = p([]), [E, se] = p(null), [ce, de] = p([]), [_e, ve] = p([]), [ye, Se] = p([]), [D, Ee] = p([]), [Oe, ke] = p(null), [O, Fe] = p([]), [Ie, ze] = p([]), [He, Ue] = p([]), [Ge, A] = p(null), [Ke, j] = p(!0), [M, N] = p(!1), [qe, Je] = p(!1), [P, F] = p(""), [Ye, I] = p(!1), [L, R] = p({}), [Ze, z] = p({}), [B, Qe] = p({}), [V, $e] = p(null), [et, U] = p(null), [tt, rt] = p([]), it = P.trim(), W = f(null), G = f(0), ot = D.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
|
|
1800
1822
|
l(() => {
|
|
1801
1823
|
Z();
|
|
1802
|
-
}, [
|
|
1803
|
-
if (!
|
|
1824
|
+
}, [b, a]), l(() => {
|
|
1825
|
+
if (!x || !ot || G.current >= bn) return;
|
|
1804
1826
|
let e = setTimeout(() => {
|
|
1805
|
-
|
|
1806
|
-
},
|
|
1827
|
+
G.current += 1, xt();
|
|
1828
|
+
}, yn);
|
|
1807
1829
|
return () => clearTimeout(e);
|
|
1808
1830
|
}, [
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1831
|
+
x,
|
|
1832
|
+
ot,
|
|
1833
|
+
D
|
|
1812
1834
|
]), l(() => {
|
|
1813
|
-
|
|
1814
|
-
}, [
|
|
1815
|
-
let
|
|
1816
|
-
|
|
1835
|
+
z(E?.formData ?? {}), Qe({});
|
|
1836
|
+
}, [E]);
|
|
1837
|
+
let ct = c((e, t) => {
|
|
1838
|
+
Qe((n) => {
|
|
1817
1839
|
let r = n[e];
|
|
1818
1840
|
return r?.hasValue === t.hasValue && r.status === t.status ? n : {
|
|
1819
1841
|
...n,
|
|
@@ -1823,39 +1845,39 @@ function jn({ instanceId: a, showAttachments: o = !0, showForm: s = !0, showHist
|
|
|
1823
1845
|
}
|
|
1824
1846
|
};
|
|
1825
1847
|
});
|
|
1826
|
-
}, []),
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
]),
|
|
1848
|
+
}, []), lt = d(() => O.find((e) => st(e, b) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [b, O]), K = d(() => lt && E ? E.workflowSnapshot.nodes.find((e) => e.id === lt.nodeId) ?? null : null, [lt, E]), ut = K?.type === "userTask" && K.data.returnBehavior.allowReturn, dt = K?.type === "userTask" && K.data.allowReject !== !1, ft = K?.type === "userTask" && K.data.allowTransfer !== !1, q = K?.type === "userTask" && K.data.allowAddSigner, pt = !(!E || E.initiatorMemberId !== b || E.state !== "RUNNING" && E.state !== "RETURNED"), mt = !!(E && E.initiatorMemberId === b && E.state === "RETURNED"), J = d(() => new Map(He.map((e) => [e.memberId, e])), [He]), ht = d(() => Lt(ce), [ce]), gt = d(() => new Map(ye.map((e) => [e.id, e])), [ye]), Y = d(() => E ? Rn(E.workflowSnapshot) : null, [E]), _t = d(() => E && Y ? Ln(Y, O, Ie, E.state) : [], [
|
|
1849
|
+
E,
|
|
1850
|
+
Y,
|
|
1851
|
+
O,
|
|
1852
|
+
Ie
|
|
1853
|
+
]), vt = d(() => Y ? zn(Y) : [], [Y]), X = d(() => E ? Fn(E.workflowSnapshot) : [], [E]);
|
|
1832
1854
|
async function Z() {
|
|
1833
|
-
|
|
1855
|
+
j(!0), A(null);
|
|
1834
1856
|
try {
|
|
1835
|
-
let e = await
|
|
1836
|
-
|
|
1837
|
-
let t = await
|
|
1838
|
-
|
|
1839
|
-
|
|
1857
|
+
let e = await pe(a);
|
|
1858
|
+
ae(e.activityLogs), se(e.instance), Fe(e.tasks), ze(e.workflowTokens);
|
|
1859
|
+
let t = await le(e.instance.id), [n, r, i, o, s] = await Promise.all([
|
|
1860
|
+
It(e.tasks),
|
|
1861
|
+
Pt({
|
|
1840
1862
|
...e,
|
|
1841
1863
|
adhocDirectives: t
|
|
1842
1864
|
}),
|
|
1843
|
-
|
|
1844
|
-
|
|
1865
|
+
ue(e.instance.id),
|
|
1866
|
+
ge(e.instance.id),
|
|
1845
1867
|
yt(e.instance.id)
|
|
1846
1868
|
]);
|
|
1847
|
-
|
|
1869
|
+
de(n), Ue(r), ve(i), Se(o.signatures), ke(o.verification), rt(t), Ee(s);
|
|
1848
1870
|
} catch (e) {
|
|
1849
|
-
|
|
1871
|
+
A(H(e));
|
|
1850
1872
|
} finally {
|
|
1851
|
-
|
|
1873
|
+
j(!1);
|
|
1852
1874
|
}
|
|
1853
1875
|
}
|
|
1854
1876
|
async function yt(e) {
|
|
1855
|
-
return
|
|
1877
|
+
return x ? fe(e).catch(() => []) : [];
|
|
1856
1878
|
}
|
|
1857
1879
|
async function bt(e) {
|
|
1858
|
-
await
|
|
1880
|
+
await xe(e.id), G.current = 0, await Z();
|
|
1859
1881
|
}
|
|
1860
1882
|
async function xt() {
|
|
1861
1883
|
let e = await yt(a);
|
|
@@ -1863,174 +1885,174 @@ function jn({ instanceId: a, showAttachments: o = !0, showForm: s = !0, showHist
|
|
|
1863
1885
|
await Z();
|
|
1864
1886
|
return;
|
|
1865
1887
|
}
|
|
1866
|
-
|
|
1888
|
+
Ee(e);
|
|
1867
1889
|
}
|
|
1868
1890
|
async function St(e, t) {
|
|
1869
|
-
if (!
|
|
1870
|
-
return { id: (await
|
|
1891
|
+
if (!b) throw Error("尚未登入,無法上傳附件");
|
|
1892
|
+
return { id: (await Ce({
|
|
1871
1893
|
file: t,
|
|
1872
1894
|
formFieldPath: `form.${e.fieldKey}`
|
|
1873
1895
|
})).id };
|
|
1874
1896
|
}
|
|
1875
1897
|
async function Q(e) {
|
|
1876
|
-
if (!
|
|
1877
|
-
let t = await
|
|
1898
|
+
if (!b) return;
|
|
1899
|
+
let t = await me({ id: e.id });
|
|
1878
1900
|
window.open(t, "_blank", "noopener,noreferrer");
|
|
1879
1901
|
}
|
|
1880
1902
|
async function Ct(e) {
|
|
1881
|
-
if (!
|
|
1882
|
-
let t = await
|
|
1883
|
-
|
|
1903
|
+
if (!b) return;
|
|
1904
|
+
let t = await he({ id: e.id });
|
|
1905
|
+
$e(e), U(t);
|
|
1884
1906
|
}
|
|
1885
1907
|
async function wt() {
|
|
1886
|
-
if (
|
|
1887
|
-
|
|
1908
|
+
if (b && E && pt) {
|
|
1909
|
+
N(!0), A(null), R({});
|
|
1888
1910
|
try {
|
|
1889
|
-
await
|
|
1890
|
-
cancelledByMemberId:
|
|
1891
|
-
comment:
|
|
1892
|
-
instanceId:
|
|
1893
|
-
}),
|
|
1911
|
+
await oe({
|
|
1912
|
+
cancelledByMemberId: b,
|
|
1913
|
+
comment: it || null,
|
|
1914
|
+
instanceId: E.id
|
|
1915
|
+
}), F(""), I(!1), await Z();
|
|
1894
1916
|
} catch (e) {
|
|
1895
|
-
|
|
1917
|
+
A(H(e));
|
|
1896
1918
|
} finally {
|
|
1897
|
-
|
|
1919
|
+
N(!1);
|
|
1898
1920
|
}
|
|
1899
1921
|
}
|
|
1900
1922
|
}
|
|
1901
1923
|
async function Tt() {
|
|
1902
|
-
if (!
|
|
1903
|
-
|
|
1904
|
-
let e = i(Object.values(
|
|
1924
|
+
if (!b || !E || !mt) return;
|
|
1925
|
+
N(!0), A(null), R({});
|
|
1926
|
+
let e = i(Object.values(B));
|
|
1905
1927
|
if (e) {
|
|
1906
|
-
|
|
1928
|
+
A(e), N(!1);
|
|
1907
1929
|
return;
|
|
1908
1930
|
}
|
|
1909
|
-
let t =
|
|
1910
|
-
if (
|
|
1911
|
-
let e =
|
|
1912
|
-
schema:
|
|
1913
|
-
uiSchema:
|
|
1931
|
+
let t = E.formDefinitionSnapshot.schema ? Le(E.formDefinitionSnapshot.schema.fields, Ze) : Ze;
|
|
1932
|
+
if (E.formDefinitionSnapshot.schema && E.formDefinitionSnapshot.uiSchema) {
|
|
1933
|
+
let e = Be({
|
|
1934
|
+
schema: E.formDefinitionSnapshot.schema,
|
|
1935
|
+
uiSchema: E.formDefinitionSnapshot.uiSchema,
|
|
1914
1936
|
values: t
|
|
1915
1937
|
});
|
|
1916
1938
|
if (!e.valid) {
|
|
1917
|
-
|
|
1939
|
+
R(e.errors), A("請先補齊必填欄位。"), e.firstInvalidFieldKey && Re(e.firstInvalidFieldKey), N(!1);
|
|
1918
1940
|
return;
|
|
1919
1941
|
}
|
|
1920
1942
|
}
|
|
1921
1943
|
try {
|
|
1922
|
-
await
|
|
1944
|
+
await be({
|
|
1923
1945
|
formData: t,
|
|
1924
|
-
initiatorMemberId:
|
|
1925
|
-
instanceId:
|
|
1926
|
-
title:
|
|
1946
|
+
initiatorMemberId: b,
|
|
1947
|
+
instanceId: E.id,
|
|
1948
|
+
title: E.title
|
|
1927
1949
|
}), await Z();
|
|
1928
1950
|
} catch (e) {
|
|
1929
|
-
|
|
1951
|
+
A(H(e));
|
|
1930
1952
|
} finally {
|
|
1931
|
-
|
|
1953
|
+
N(!1);
|
|
1932
1954
|
}
|
|
1933
1955
|
}
|
|
1934
|
-
let Et =
|
|
1935
|
-
return /* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
description:
|
|
1938
|
-
title:
|
|
1956
|
+
let Et = W.current?.deciding ?? !1, $ = M || Et;
|
|
1957
|
+
return /* @__PURE__ */ T(C, { children: [
|
|
1958
|
+
/* @__PURE__ */ w(v, { children: /* @__PURE__ */ T(we, {
|
|
1959
|
+
description: E ? `${nt(E.state)} · ${t(E.startedAt)}` : "載入案件內容。",
|
|
1960
|
+
title: E?.title ?? "簽核案件",
|
|
1939
1961
|
children: [
|
|
1940
|
-
|
|
1962
|
+
E ? /* @__PURE__ */ w(g, {
|
|
1941
1963
|
"aria-label": "查看流程圖",
|
|
1942
|
-
icon:
|
|
1964
|
+
icon: Ne,
|
|
1943
1965
|
iconType: "icon-only",
|
|
1944
|
-
onClick: () =>
|
|
1966
|
+
onClick: () => Je(!0),
|
|
1945
1967
|
title: "查看流程圖",
|
|
1946
1968
|
variant: "base-secondary",
|
|
1947
1969
|
children: "流程圖"
|
|
1948
1970
|
}) : null,
|
|
1949
|
-
|
|
1971
|
+
pt ? /* @__PURE__ */ w(g, {
|
|
1950
1972
|
disabled: $,
|
|
1951
|
-
icon:
|
|
1973
|
+
icon: De,
|
|
1952
1974
|
iconType: "leading",
|
|
1953
|
-
onClick: () =>
|
|
1975
|
+
onClick: () => I(!0),
|
|
1954
1976
|
variant: "destructive-secondary",
|
|
1955
1977
|
children: "取消案件"
|
|
1956
1978
|
}) : null,
|
|
1957
|
-
|
|
1958
|
-
|
|
1979
|
+
lt ? /* @__PURE__ */ T(C, { children: [
|
|
1980
|
+
q ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(g, {
|
|
1959
1981
|
disabled: $,
|
|
1960
|
-
icon:
|
|
1982
|
+
icon: je,
|
|
1961
1983
|
iconType: "leading",
|
|
1962
|
-
onClick: () =>
|
|
1984
|
+
onClick: () => W.current?.openAdhocModal("COUNTERSIGN"),
|
|
1963
1985
|
variant: "base-secondary",
|
|
1964
1986
|
children: "會簽"
|
|
1965
|
-
}, "adhoc-countersign"), /* @__PURE__ */
|
|
1987
|
+
}, "adhoc-countersign"), /* @__PURE__ */ w(g, {
|
|
1966
1988
|
disabled: $,
|
|
1967
|
-
icon:
|
|
1989
|
+
icon: je,
|
|
1968
1990
|
iconType: "leading",
|
|
1969
|
-
onClick: () =>
|
|
1991
|
+
onClick: () => W.current?.openAdhocModal("PRE_APPROVAL"),
|
|
1970
1992
|
variant: "base-secondary",
|
|
1971
1993
|
children: "加簽"
|
|
1972
1994
|
}, "adhoc-pre-approval")] }) : null,
|
|
1973
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ w(g, {
|
|
1974
1996
|
disabled: $,
|
|
1975
|
-
icon:
|
|
1997
|
+
icon: Ae,
|
|
1976
1998
|
iconType: "leading",
|
|
1977
|
-
onClick: () =>
|
|
1999
|
+
onClick: () => W.current?.openAdhocModal("STAGE_NOTIFY"),
|
|
1978
2000
|
variant: "base-secondary",
|
|
1979
2001
|
children: "通知設定"
|
|
1980
2002
|
}, "adhoc-notify"),
|
|
1981
|
-
|
|
2003
|
+
ut ? /* @__PURE__ */ w(g, {
|
|
1982
2004
|
disabled: $,
|
|
1983
|
-
icon:
|
|
2005
|
+
icon: Me,
|
|
1984
2006
|
iconType: "leading",
|
|
1985
|
-
onClick: () =>
|
|
2007
|
+
onClick: () => W.current?.openReturnModal(),
|
|
1986
2008
|
variant: "base-secondary",
|
|
1987
2009
|
children: "退回"
|
|
1988
2010
|
}, "task-return") : null,
|
|
1989
|
-
|
|
2011
|
+
ft ? /* @__PURE__ */ w(g, {
|
|
1990
2012
|
disabled: $,
|
|
1991
|
-
icon:
|
|
2013
|
+
icon: Pe,
|
|
1992
2014
|
iconType: "leading",
|
|
1993
|
-
onClick: () =>
|
|
2015
|
+
onClick: () => W.current?.openTransferModal(),
|
|
1994
2016
|
variant: "base-secondary",
|
|
1995
2017
|
children: "轉派"
|
|
1996
2018
|
}, "task-transfer") : null,
|
|
1997
|
-
|
|
2019
|
+
dt ? /* @__PURE__ */ w(g, {
|
|
1998
2020
|
disabled: $,
|
|
1999
|
-
icon:
|
|
2021
|
+
icon: De,
|
|
2000
2022
|
iconType: "leading",
|
|
2001
|
-
onClick: () =>
|
|
2023
|
+
onClick: () => W.current?.openRejectModal(),
|
|
2002
2024
|
variant: "destructive-secondary",
|
|
2003
2025
|
children: "拒絕"
|
|
2004
2026
|
}, "task-reject") : null,
|
|
2005
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ w(g, {
|
|
2006
2028
|
disabled: $,
|
|
2007
|
-
icon:
|
|
2029
|
+
icon: Te,
|
|
2008
2030
|
iconType: "leading",
|
|
2009
|
-
onClick: () =>
|
|
2031
|
+
onClick: () => W.current?.handleApprove(),
|
|
2010
2032
|
variant: "base-primary",
|
|
2011
2033
|
children: "同意"
|
|
2012
2034
|
}, "task-approve")
|
|
2013
2035
|
] }) : null
|
|
2014
2036
|
]
|
|
2015
2037
|
}) }),
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
s ? /* @__PURE__ */
|
|
2018
|
-
canResubmitInstance:
|
|
2019
|
-
deciding:
|
|
2020
|
-
error:
|
|
2021
|
-
instance:
|
|
2022
|
-
loading:
|
|
2023
|
-
onDataSourceStateChange:
|
|
2038
|
+
/* @__PURE__ */ T(te, { children: [
|
|
2039
|
+
s ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(Bt, {
|
|
2040
|
+
canResubmitInstance: mt,
|
|
2041
|
+
deciding: M,
|
|
2042
|
+
error: Ge,
|
|
2043
|
+
instance: E,
|
|
2044
|
+
loading: Ke,
|
|
2045
|
+
onDataSourceStateChange: ct,
|
|
2024
2046
|
onResubmitFormChange: (e) => {
|
|
2025
|
-
|
|
2047
|
+
z(e), R({});
|
|
2026
2048
|
},
|
|
2027
2049
|
onResubmitInstance: () => void Tt(),
|
|
2028
2050
|
onUploadAttachment: St,
|
|
2029
|
-
resubmitFormData:
|
|
2030
|
-
resubmitFormErrors:
|
|
2051
|
+
resubmitFormData: Ze,
|
|
2052
|
+
resubmitFormErrors: L
|
|
2031
2053
|
}) }) : null,
|
|
2032
|
-
o ? /* @__PURE__ */
|
|
2033
|
-
attachments:
|
|
2054
|
+
o ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(Ht, {
|
|
2055
|
+
attachments: _e,
|
|
2034
2056
|
onDownload: (e) => {
|
|
2035
2057
|
Q(e);
|
|
2036
2058
|
},
|
|
@@ -2038,141 +2060,141 @@ function jn({ instanceId: a, showAttachments: o = !0, showForm: s = !0, showHist
|
|
|
2038
2060
|
Ct(e);
|
|
2039
2061
|
}
|
|
2040
2062
|
}) }) : null,
|
|
2041
|
-
h ? /* @__PURE__ */
|
|
2042
|
-
adhocDirectives:
|
|
2043
|
-
currentMemberId:
|
|
2044
|
-
instance:
|
|
2045
|
-
memberProfilesById:
|
|
2063
|
+
h ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w($t, {
|
|
2064
|
+
adhocDirectives: tt,
|
|
2065
|
+
currentMemberId: b,
|
|
2066
|
+
instance: E,
|
|
2067
|
+
memberProfilesById: J,
|
|
2046
2068
|
onChanged: Z,
|
|
2047
|
-
ref:
|
|
2048
|
-
tasks:
|
|
2069
|
+
ref: W,
|
|
2070
|
+
tasks: O
|
|
2049
2071
|
}) }) : null,
|
|
2050
|
-
m ? /* @__PURE__ */
|
|
2051
|
-
signatureVerification:
|
|
2052
|
-
signatures:
|
|
2072
|
+
m ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(nn, {
|
|
2073
|
+
signatureVerification: Oe,
|
|
2074
|
+
signatures: ye
|
|
2053
2075
|
}) }) : null,
|
|
2054
|
-
|
|
2055
|
-
deliveries:
|
|
2076
|
+
x && D.length > 0 ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(gn, {
|
|
2077
|
+
deliveries: D,
|
|
2056
2078
|
onRetry: bt,
|
|
2057
|
-
readNodeLabel: (e) =>
|
|
2079
|
+
readNodeLabel: (e) => at(e, E?.workflowSnapshot ?? null)
|
|
2058
2080
|
}) }) : null,
|
|
2059
|
-
u ? /* @__PURE__ */
|
|
2060
|
-
activityLogs:
|
|
2061
|
-
instanceState:
|
|
2062
|
-
memberProfilesById:
|
|
2063
|
-
signatureVerification:
|
|
2064
|
-
signaturesById:
|
|
2065
|
-
taskDecisionsByTaskId:
|
|
2066
|
-
tasks:
|
|
2067
|
-
workflowSnapshot:
|
|
2068
|
-
workflowTokens:
|
|
2081
|
+
u ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(fn, {
|
|
2082
|
+
activityLogs: ie,
|
|
2083
|
+
instanceState: E?.state ?? "RUNNING",
|
|
2084
|
+
memberProfilesById: J,
|
|
2085
|
+
signatureVerification: Oe,
|
|
2086
|
+
signaturesById: gt,
|
|
2087
|
+
taskDecisionsByTaskId: ht,
|
|
2088
|
+
tasks: O,
|
|
2089
|
+
workflowSnapshot: E?.workflowSnapshot ?? null,
|
|
2090
|
+
workflowTokens: Ie
|
|
2069
2091
|
}) }) : null
|
|
2070
2092
|
] }),
|
|
2071
|
-
|
|
2093
|
+
E ? /* @__PURE__ */ w(_, {
|
|
2072
2094
|
modalType: "standard",
|
|
2073
|
-
onClose: () =>
|
|
2074
|
-
open:
|
|
2095
|
+
onClose: () => Je(!1),
|
|
2096
|
+
open: qe,
|
|
2075
2097
|
showModalHeader: !0,
|
|
2076
2098
|
size: "wide",
|
|
2077
|
-
supportingText: `${
|
|
2099
|
+
supportingText: `${nt(E.state)} · ${t(E.startedAt)}`,
|
|
2078
2100
|
title: "流程圖",
|
|
2079
|
-
children: /* @__PURE__ */
|
|
2080
|
-
style:
|
|
2081
|
-
children: [/* @__PURE__ */
|
|
2082
|
-
style:
|
|
2083
|
-
children: /* @__PURE__ */
|
|
2084
|
-
edges:
|
|
2101
|
+
children: /* @__PURE__ */ T("div", {
|
|
2102
|
+
style: Cn,
|
|
2103
|
+
children: [/* @__PURE__ */ w("div", {
|
|
2104
|
+
style: wn,
|
|
2105
|
+
children: /* @__PURE__ */ T(We, {
|
|
2106
|
+
edges: vt,
|
|
2085
2107
|
fitView: !0,
|
|
2086
2108
|
fitViewOptions: { padding: .18 },
|
|
2087
2109
|
maxZoom: 1.2,
|
|
2088
2110
|
minZoom: .2,
|
|
2089
|
-
nodes:
|
|
2111
|
+
nodes: _t,
|
|
2090
2112
|
nodesDraggable: !1,
|
|
2091
2113
|
nodesFocusable: !1,
|
|
2092
|
-
nodeTypes:
|
|
2114
|
+
nodeTypes: Mn,
|
|
2093
2115
|
panOnDrag: !0,
|
|
2094
2116
|
proOptions: { hideAttribution: !0 },
|
|
2095
|
-
children: [/* @__PURE__ */
|
|
2117
|
+
children: [/* @__PURE__ */ w(k, {}), /* @__PURE__ */ w(Ve, { showInteractive: !1 })]
|
|
2096
2118
|
})
|
|
2097
|
-
}),
|
|
2098
|
-
style:
|
|
2099
|
-
children:
|
|
2100
|
-
style:
|
|
2119
|
+
}), X.length > 0 ? /* @__PURE__ */ w("div", {
|
|
2120
|
+
style: kn,
|
|
2121
|
+
children: X.map((e) => /* @__PURE__ */ w("span", {
|
|
2122
|
+
style: An,
|
|
2101
2123
|
children: e
|
|
2102
2124
|
}, e))
|
|
2103
2125
|
}) : null]
|
|
2104
2126
|
})
|
|
2105
2127
|
}) : null,
|
|
2106
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ w(_, {
|
|
2107
2129
|
modalType: "standard",
|
|
2108
2130
|
onClose: () => {
|
|
2109
|
-
|
|
2131
|
+
$e(null), U(null);
|
|
2110
2132
|
},
|
|
2111
|
-
open: !!(
|
|
2133
|
+
open: !!(V && et),
|
|
2112
2134
|
showModalHeader: !0,
|
|
2113
2135
|
size: "wide",
|
|
2114
|
-
supportingText:
|
|
2136
|
+
supportingText: V?.filename ?? void 0,
|
|
2115
2137
|
title: "PDF 預覽",
|
|
2116
|
-
children:
|
|
2117
|
-
filename:
|
|
2118
|
-
fileUrl:
|
|
2119
|
-
onDownload:
|
|
2138
|
+
children: et ? /* @__PURE__ */ w(Xe, {
|
|
2139
|
+
filename: V?.filename ?? "PDF 預覽",
|
|
2140
|
+
fileUrl: et,
|
|
2141
|
+
onDownload: V ? () => void Q(V) : void 0
|
|
2120
2142
|
}) : null
|
|
2121
2143
|
}),
|
|
2122
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ w(_, {
|
|
2123
2145
|
cancelText: "保留案件",
|
|
2124
2146
|
confirmButtonProps: { variant: "destructive-primary" },
|
|
2125
2147
|
confirmText: "確認取消",
|
|
2126
|
-
loading:
|
|
2148
|
+
loading: M,
|
|
2127
2149
|
modalStatusType: "error",
|
|
2128
2150
|
modalType: "standard",
|
|
2129
|
-
onCancel: () =>
|
|
2130
|
-
onClose: () =>
|
|
2151
|
+
onCancel: () => I(!1),
|
|
2152
|
+
onClose: () => I(!1),
|
|
2131
2153
|
onConfirm: () => void wt(),
|
|
2132
|
-
open:
|
|
2154
|
+
open: Ye,
|
|
2133
2155
|
showModalFooter: !0,
|
|
2134
2156
|
showModalHeader: !0,
|
|
2135
2157
|
supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
|
|
2136
2158
|
title: "取消案件",
|
|
2137
|
-
children: /* @__PURE__ */
|
|
2138
|
-
style:
|
|
2139
|
-
children: [/* @__PURE__ */
|
|
2159
|
+
children: /* @__PURE__ */ T("div", {
|
|
2160
|
+
style: jn,
|
|
2161
|
+
children: [/* @__PURE__ */ T(S, {
|
|
2140
2162
|
variant: "body",
|
|
2141
2163
|
children: [
|
|
2142
2164
|
"確定要取消「",
|
|
2143
|
-
|
|
2165
|
+
E?.title ?? "",
|
|
2144
2166
|
"」嗎?"
|
|
2145
2167
|
]
|
|
2146
|
-
}), /* @__PURE__ */
|
|
2168
|
+
}), /* @__PURE__ */ w(n, {
|
|
2147
2169
|
label: "取消原因",
|
|
2148
2170
|
name: "cancelComment",
|
|
2149
|
-
children: /* @__PURE__ */
|
|
2150
|
-
onChange: (e) =>
|
|
2171
|
+
children: /* @__PURE__ */ w(re, {
|
|
2172
|
+
onChange: (e) => F(e.target.value),
|
|
2151
2173
|
placeholder: "可填寫取消原因",
|
|
2152
2174
|
resize: "vertical",
|
|
2153
2175
|
rows: 3,
|
|
2154
|
-
value:
|
|
2176
|
+
value: P
|
|
2155
2177
|
})
|
|
2156
2178
|
})]
|
|
2157
2179
|
})
|
|
2158
2180
|
})
|
|
2159
2181
|
] });
|
|
2160
2182
|
}
|
|
2161
|
-
function
|
|
2183
|
+
function Pn(e) {
|
|
2162
2184
|
return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
|
|
2163
2185
|
}
|
|
2164
|
-
function
|
|
2165
|
-
return e.edges.map(
|
|
2186
|
+
function Fn(e) {
|
|
2187
|
+
return e.edges.map(Pn).filter((e) => e.trim().length > 0);
|
|
2166
2188
|
}
|
|
2167
|
-
function
|
|
2189
|
+
function In(e) {
|
|
2168
2190
|
return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
|
|
2169
2191
|
}
|
|
2170
|
-
function
|
|
2192
|
+
function Ln(e, t, n, r) {
|
|
2171
2193
|
return e.nodes.map((e) => {
|
|
2172
|
-
let i =
|
|
2194
|
+
let i = Nt(e, t, n, r);
|
|
2173
2195
|
return {
|
|
2174
2196
|
data: {
|
|
2175
|
-
kindLabel:
|
|
2197
|
+
kindLabel: In(e.type),
|
|
2176
2198
|
label: e.data.label,
|
|
2177
2199
|
secondaryLabel: i.secondaryLabel,
|
|
2178
2200
|
statusLabel: i.statusLabel,
|
|
@@ -2180,42 +2202,42 @@ function Fn(e, t, n, r) {
|
|
|
2180
2202
|
},
|
|
2181
2203
|
id: e.id,
|
|
2182
2204
|
position: e.position,
|
|
2183
|
-
sourcePosition:
|
|
2184
|
-
targetPosition:
|
|
2205
|
+
sourcePosition: Ue.Right,
|
|
2206
|
+
targetPosition: Ue.Left,
|
|
2185
2207
|
type: "workflowRuntime"
|
|
2186
2208
|
};
|
|
2187
2209
|
});
|
|
2188
2210
|
}
|
|
2189
|
-
function
|
|
2190
|
-
let t = new
|
|
2211
|
+
function Rn(e) {
|
|
2212
|
+
let t = new Ge.graphlib.Graph();
|
|
2191
2213
|
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
2192
2214
|
nodesep: 56,
|
|
2193
2215
|
rankdir: "LR",
|
|
2194
2216
|
ranksep: 120
|
|
2195
2217
|
}), e.nodes.forEach((e) => {
|
|
2196
2218
|
t.setNode(e.id, {
|
|
2197
|
-
height:
|
|
2198
|
-
width:
|
|
2219
|
+
height: Sn,
|
|
2220
|
+
width: xn
|
|
2199
2221
|
});
|
|
2200
2222
|
}), e.edges.forEach((e) => {
|
|
2201
2223
|
t.setEdge(e.source, e.target);
|
|
2202
|
-
}),
|
|
2224
|
+
}), Ge.layout(t), {
|
|
2203
2225
|
...e,
|
|
2204
2226
|
nodes: e.nodes.map((e) => {
|
|
2205
2227
|
let n = t.node(e.id);
|
|
2206
2228
|
return n ? {
|
|
2207
2229
|
...e,
|
|
2208
2230
|
position: {
|
|
2209
|
-
x: n.x -
|
|
2210
|
-
y: n.y -
|
|
2231
|
+
x: n.x - xn / 2,
|
|
2232
|
+
y: n.y - Sn / 2
|
|
2211
2233
|
}
|
|
2212
2234
|
} : e;
|
|
2213
2235
|
})
|
|
2214
2236
|
};
|
|
2215
2237
|
}
|
|
2216
|
-
function
|
|
2238
|
+
function zn(e) {
|
|
2217
2239
|
return e.edges.map((e) => {
|
|
2218
|
-
let t =
|
|
2240
|
+
let t = Pn(e);
|
|
2219
2241
|
return {
|
|
2220
2242
|
animated: !1,
|
|
2221
2243
|
id: e.id,
|
|
@@ -2243,25 +2265,25 @@ function Ln(e) {
|
|
|
2243
2265
|
};
|
|
2244
2266
|
});
|
|
2245
2267
|
}
|
|
2246
|
-
function
|
|
2268
|
+
function Bn(e) {
|
|
2247
2269
|
return e === "current" ? {
|
|
2248
|
-
...
|
|
2270
|
+
...Tn,
|
|
2249
2271
|
border: "1px solid var(--mzn-color-primary, #0057ff)",
|
|
2250
2272
|
boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
|
|
2251
2273
|
} : e === "completed" ? {
|
|
2252
|
-
...
|
|
2274
|
+
...Tn,
|
|
2253
2275
|
border: "1px solid #16a34a"
|
|
2254
2276
|
} : e === "cancelled" ? {
|
|
2255
|
-
...
|
|
2277
|
+
...Tn,
|
|
2256
2278
|
border: "1px solid #dc2626",
|
|
2257
2279
|
opacity: .72
|
|
2258
2280
|
} : e === "waiting" ? {
|
|
2259
|
-
...
|
|
2281
|
+
...Tn,
|
|
2260
2282
|
border: "1px dashed #64748b"
|
|
2261
|
-
} :
|
|
2283
|
+
} : Tn;
|
|
2262
2284
|
}
|
|
2263
|
-
function
|
|
2264
|
-
let t =
|
|
2285
|
+
function Vn(e) {
|
|
2286
|
+
let t = En;
|
|
2265
2287
|
return e === "current" ? {
|
|
2266
2288
|
...t,
|
|
2267
2289
|
background: "#eff6ff",
|
|
@@ -2284,42 +2306,42 @@ function zn(e) {
|
|
|
2284
2306
|
color: "#64748b"
|
|
2285
2307
|
};
|
|
2286
2308
|
}
|
|
2287
|
-
function
|
|
2288
|
-
return /* @__PURE__ */
|
|
2289
|
-
style:
|
|
2309
|
+
function Hn({ data: e }) {
|
|
2310
|
+
return /* @__PURE__ */ T("div", {
|
|
2311
|
+
style: Bn(e.tone),
|
|
2290
2312
|
children: [
|
|
2291
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ w(He, {
|
|
2292
2314
|
isConnectable: !1,
|
|
2293
|
-
position:
|
|
2294
|
-
style:
|
|
2315
|
+
position: Ue.Left,
|
|
2316
|
+
style: On,
|
|
2295
2317
|
type: "target"
|
|
2296
2318
|
}),
|
|
2297
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ w(S, {
|
|
2298
2320
|
component: "span",
|
|
2299
2321
|
ellipsis: !0,
|
|
2300
2322
|
title: e.label,
|
|
2301
2323
|
variant: "label-primary",
|
|
2302
2324
|
children: e.label
|
|
2303
2325
|
}),
|
|
2304
|
-
/* @__PURE__ */
|
|
2305
|
-
style:
|
|
2326
|
+
/* @__PURE__ */ w("span", {
|
|
2327
|
+
style: Vn(e.tone),
|
|
2306
2328
|
children: e.statusLabel
|
|
2307
2329
|
}),
|
|
2308
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ w("span", {
|
|
2309
2331
|
title: e.secondaryLabel,
|
|
2310
|
-
style:
|
|
2332
|
+
style: Dn,
|
|
2311
2333
|
children: e.secondaryLabel || e.kindLabel
|
|
2312
2334
|
}),
|
|
2313
|
-
/* @__PURE__ */
|
|
2335
|
+
/* @__PURE__ */ w(He, {
|
|
2314
2336
|
isConnectable: !1,
|
|
2315
|
-
position:
|
|
2316
|
-
style:
|
|
2337
|
+
position: Ue.Right,
|
|
2338
|
+
style: On,
|
|
2317
2339
|
type: "source"
|
|
2318
2340
|
})
|
|
2319
2341
|
]
|
|
2320
2342
|
});
|
|
2321
2343
|
}
|
|
2322
2344
|
//#endregion
|
|
2323
|
-
export {
|
|
2345
|
+
export { $t as a, nn as i, gn as n, Ht as o, fn as r, Bt as s, Nn as t };
|
|
2324
2346
|
|
|
2325
|
-
//# sourceMappingURL=detail-
|
|
2347
|
+
//# sourceMappingURL=detail-C8NOqY0p.js.map
|