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