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