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