@rytass/bpm-core-react 0.4.0 → 0.5.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 +110 -0
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +3 -0
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +1 -0
- package/dist/chunks/FormBuilderView-D8DrQOXD.js +1090 -0
- package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +1 -0
- package/dist/chunks/{approval-instance-list-page-UNIIgUZy.cjs → approval-instance-list-page-BMUKxzcz.cjs} +2 -2
- package/dist/chunks/{approval-instance-list-page-UNIIgUZy.cjs.map → approval-instance-list-page-BMUKxzcz.cjs.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-BtEc8Cs3.js → approval-instance-list-page-YZcGGDD8.js} +3 -3
- package/dist/chunks/{approval-instance-list-page-BtEc8Cs3.js.map → approval-instance-list-page-YZcGGDD8.js.map} +1 -1
- package/dist/chunks/{auth-provider-D2P-qWmY.cjs → auth-provider-4BeCw7cI.cjs} +2 -2
- package/dist/chunks/{auth-provider-D2P-qWmY.cjs.map → auth-provider-4BeCw7cI.cjs.map} +1 -1
- package/dist/chunks/{auth-provider-TTO9eNZV.js → auth-provider-B5oPmvk2.js} +2 -2
- package/dist/chunks/{auth-provider-TTO9eNZV.js.map → auth-provider-B5oPmvk2.js.map} +1 -1
- package/dist/chunks/compose-PMrmi-LE.js +451 -0
- package/dist/chunks/compose-PMrmi-LE.js.map +1 -0
- package/dist/chunks/compose-ziVbRYdo.cjs +2 -0
- package/dist/chunks/compose-ziVbRYdo.cjs.map +1 -0
- package/dist/chunks/{dashboard-page-CQRBJxze.js → dashboard-page-DJ9vOPga.js} +4 -4
- package/dist/chunks/{dashboard-page-CQRBJxze.js.map → dashboard-page-DJ9vOPga.js.map} +1 -1
- package/dist/chunks/{dashboard-page-DrDChhg1.cjs → dashboard-page-DwHQY6Ki.cjs} +2 -2
- package/dist/chunks/{dashboard-page-DrDChhg1.cjs.map → dashboard-page-DwHQY6Ki.cjs.map} +1 -1
- package/dist/chunks/{delegations-CFXaJrdX.cjs → delegations-C2wLWsDQ.cjs} +2 -2
- package/dist/chunks/{delegations-CFXaJrdX.cjs.map → delegations-C2wLWsDQ.cjs.map} +1 -1
- package/dist/chunks/{delegations-DwbYkNUg.cjs → delegations-DDEk-WI6.cjs} +2 -2
- package/dist/chunks/{delegations-DwbYkNUg.cjs.map → delegations-DDEk-WI6.cjs.map} +1 -1
- package/dist/chunks/{delegations-FTLaWo1Y.js → delegations-ZNtodFaD.js} +2 -2
- package/dist/chunks/{delegations-FTLaWo1Y.js.map → delegations-ZNtodFaD.js.map} +1 -1
- package/dist/chunks/{delegations-D5pPEWsP.js → delegations-iVnRi3QE.js} +2 -2
- package/dist/chunks/{delegations-D5pPEWsP.js.map → delegations-iVnRi3QE.js.map} +1 -1
- package/dist/chunks/designer-DCn6_v4b.cjs +65 -0
- package/dist/chunks/designer-DCn6_v4b.cjs.map +1 -0
- package/dist/chunks/designer-mOMxJ0Py.js +2576 -0
- package/dist/chunks/designer-mOMxJ0Py.js.map +1 -0
- package/dist/chunks/detail-Bml-vXHX.js +1622 -0
- package/dist/chunks/detail-Bml-vXHX.js.map +1 -0
- package/dist/chunks/detail-CWeCrmtC.cjs +2 -0
- package/dist/chunks/detail-CWeCrmtC.cjs.map +1 -0
- package/dist/chunks/{login-BfmfCclF.cjs → login-9bCXyjbX.cjs} +2 -2
- package/dist/chunks/{login-BfmfCclF.cjs.map → login-9bCXyjbX.cjs.map} +1 -1
- package/dist/chunks/{login-xgI4wLHe.js → login-BKxpLibd.js} +3 -3
- package/dist/chunks/{login-xgI4wLHe.js.map → login-BKxpLibd.js.map} +1 -1
- package/dist/chunks/{notifications-a-FCxV02.cjs → notifications-BKs4--96.cjs} +2 -2
- package/dist/chunks/{notifications-a-FCxV02.cjs.map → notifications-BKs4--96.cjs.map} +1 -1
- package/dist/chunks/{notifications-BoNa1BXD.js → notifications-CSulztkU.js} +2 -2
- package/dist/chunks/{notifications-BoNa1BXD.js.map → notifications-CSulztkU.js.map} +1 -1
- package/dist/chunks/router-adapter--gYs13E8.cjs +2 -0
- package/dist/chunks/{router-adapter-BybHrCNP.cjs.map → router-adapter--gYs13E8.cjs.map} +1 -1
- package/dist/chunks/{router-adapter-BdHZXLS3.js → router-adapter-DftlFTOd.js} +2 -2
- package/dist/chunks/{router-adapter-BdHZXLS3.js.map → router-adapter-DftlFTOd.js.map} +1 -1
- package/dist/chunks/{routes-config-dxahImVe.js → routes-config-RBYQtUd0.js} +2 -3
- package/dist/chunks/routes-config-RBYQtUd0.js.map +1 -0
- package/dist/chunks/routes-config-fDVHmvXi.cjs +2 -0
- package/dist/chunks/routes-config-fDVHmvXi.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +270 -130
- package/dist/index.js.map +1 -1
- package/dist/lib/routes-config.d.ts +6 -4
- package/dist/next/BPMNextProviders.d.ts +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +14 -24
- package/dist/next/index.js.map +1 -1
- package/dist/next/workflow-chat-route.cjs +19 -0
- package/dist/next/workflow-chat-route.cjs.map +1 -0
- package/dist/next/workflow-chat-route.d.ts +17 -0
- package/dist/next/workflow-chat-route.js +31 -0
- package/dist/next/workflow-chat-route.js.map +1 -0
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/login/index.cjs +1 -1
- package/dist/pages/login/index.js +1 -1
- package/dist/pages/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +2 -0
- package/dist/pages/templates/compose/index.cjs.map +1 -0
- package/dist/pages/templates/compose/index.d.ts +13 -0
- package/dist/pages/templates/compose/index.js +14 -0
- package/dist/pages/templates/compose/index.js.map +1 -0
- 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 +7 -2
- package/dist/pages/templates/designer/index.js.map +1 -1
- package/dist/pages/templates/index.cjs +1 -1
- package/dist/pages/templates/index.cjs.map +1 -1
- package/dist/pages/templates/index.js +3 -3
- package/dist/pages/templates/index.js.map +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/FormBuilderView.d.ts +13 -4
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/builder/json-code-editor.d.ts +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.js +3 -3
- package/dist/views/instances/detail/InstanceDetailView.d.ts +11 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.d.ts +5 -0
- package/dist/views/instances/detail/index.js +2 -2
- package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.ts +15 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +33 -0
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +29 -0
- package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.ts +14 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +44 -0
- package/dist/views/instances/detail/sections/container-helpers.d.ts +8 -0
- package/dist/views/instances/detail/sections/shared.d.ts +103 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.js +3 -3
- package/dist/views/login/index.cjs +1 -1
- package/dist/views/login/index.js +1 -1
- package/dist/views/search/index.cjs +1 -1
- package/dist/views/search/index.js +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.js +1 -1
- package/dist/views/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/index.js +1 -1
- package/dist/views/templates/TemplatesView.d.ts +5 -0
- package/dist/views/templates/compose/TemplateComposeWizardView.d.ts +8 -0
- package/dist/views/templates/compose/index.cjs +1 -0
- package/dist/views/templates/compose/index.d.ts +2 -0
- package/dist/views/templates/compose/index.js +2 -0
- package/dist/views/templates/compose/steps/ComposeFormStep.d.ts +15 -0
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +12 -0
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +11 -0
- package/dist/views/templates/compose/use-template-compose-wizard.d.ts +46 -0
- package/dist/views/templates/designer/TemplateDesignerView.d.ts +60 -2
- package/dist/views/templates/designer/chrome-workflow-chat.d.ts +12 -0
- package/dist/views/templates/designer/index.cjs +1 -51
- package/dist/views/templates/designer/index.js +2 -2272
- package/dist/views/templates/designer/use-workflow-chat.d.ts +21 -0
- package/dist/views/templates/designer/use-workflow-designer-controller.d.ts +41 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.ts +16 -0
- package/dist/views/templates/index.cjs +2 -1
- package/dist/views/templates/index.cjs.map +1 -0
- package/dist/views/templates/index.js +265 -4
- package/dist/views/templates/index.js.map +1 -0
- package/dist/views/templates/versions/index.cjs +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js +39 -43
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +22 -19
- package/dist/chunks/builder-C3E-8OJu.js +0 -1300
- package/dist/chunks/builder-C3E-8OJu.js.map +0 -1
- package/dist/chunks/builder-f-Q_0NUs.cjs +0 -3
- package/dist/chunks/builder-f-Q_0NUs.cjs.map +0 -1
- package/dist/chunks/detail-B9JkYNHc.cjs +0 -2
- package/dist/chunks/detail-B9JkYNHc.cjs.map +0 -1
- package/dist/chunks/detail-CSxI04gB.js +0 -1518
- package/dist/chunks/detail-CSxI04gB.js.map +0 -1
- package/dist/chunks/form-name-modal-C3OEvkCV.js +0 -64
- package/dist/chunks/form-name-modal-C3OEvkCV.js.map +0 -1
- package/dist/chunks/form-name-modal-uZCHbtRH.cjs +0 -2
- package/dist/chunks/form-name-modal-uZCHbtRH.cjs.map +0 -1
- package/dist/chunks/router-adapter-BybHrCNP.cjs +0 -2
- package/dist/chunks/routes-config-2aKbWq2H.cjs +0 -2
- package/dist/chunks/routes-config-2aKbWq2H.cjs.map +0 -1
- package/dist/chunks/routes-config-dxahImVe.js.map +0 -1
- package/dist/chunks/templates-CL8bPvgn.cjs +0 -2
- package/dist/chunks/templates-CL8bPvgn.cjs.map +0 -1
- package/dist/chunks/templates-DNfDOPGm.js +0 -380
- package/dist/chunks/templates-DNfDOPGm.js.map +0 -1
- package/dist/pages/forms/builder/index.cjs +0 -2
- package/dist/pages/forms/builder/index.cjs.map +0 -1
- package/dist/pages/forms/builder/index.d.ts +0 -21
- package/dist/pages/forms/builder/index.js +0 -15
- package/dist/pages/forms/builder/index.js.map +0 -1
- package/dist/pages/forms/index.cjs +0 -2
- package/dist/pages/forms/index.cjs.map +0 -1
- package/dist/pages/forms/index.d.ts +0 -17
- package/dist/pages/forms/index.js +0 -14
- package/dist/pages/forms/index.js.map +0 -1
- package/dist/views/forms/FormsView.d.ts +0 -2
- package/dist/views/forms/form-name-modal.d.ts +0 -12
- package/dist/views/forms/index.cjs +0 -2
- package/dist/views/forms/index.cjs.map +0 -1
- package/dist/views/forms/index.d.ts +0 -2
- package/dist/views/forms/index.js +0 -186
- package/dist/views/forms/index.js.map +0 -1
- package/dist/views/templates/designer/index.cjs.map +0 -1
- package/dist/views/templates/designer/index.js.map +0 -1
- package/dist/views/templates/template-name-modal.d.ts +0 -22
|
@@ -1,1518 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { n as e } from "./auth-provider-TTO9eNZV.js";
|
|
3
|
-
import { t } from "./format-date-time-CB-LxzqT.js";
|
|
4
|
-
import { t as n } from "./bpm-form-field-Cao0rMol.js";
|
|
5
|
-
import { t as r } from "./FormRendererView-DrHsuSVo.js";
|
|
6
|
-
import { Fragment as i, forwardRef as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
7
|
-
import { AutoComplete as d, Button as f, Modal as p, PageHeader as m, Section as h, SectionGroup as ee, Select as te, Stepper as ne, Table as re, Textarea as ie, Tooltip as ae, Typography as g } from "@mezzanine-ui/react";
|
|
8
|
-
import { Fragment as oe, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
9
|
-
import { cancelApprovalInstance as se, decideTask as ce, listAttachments as le, listTaskDecisions as y, readApprovalInstance as ue, readAttachmentDownloadUrl as de, readAttachmentPreviewUrl as fe, readInstanceSignatures as pe, resolveMemberProfiles as me, resubmitApprovalInstance as he, searchMembers as ge, uploadAttachment as _e } from "@rytass/bpm-core-client/workflow";
|
|
10
|
-
import ve from "@mezzanine-ui/react/ContentHeader";
|
|
11
|
-
import { CheckedIcon as ye, ChevronLeftIcon as be, ChevronRightIcon as xe, DangerousOutlineIcon as Se, DownloadIcon as Ce, FileSearchIcon as we, RefreshCcwIcon as Te, ShareIcon as Ee, UserIcon as De, ZoomInIcon as Oe, ZoomOutIcon as ke } from "@mezzanine-ui/icons";
|
|
12
|
-
import { focusFormRendererField as Ae, validateFormRendererValues as je } from "@rytass/bpm-core-client/form";
|
|
13
|
-
import { Background as Me, Controls as Ne, Handle as b, Position as Pe, ReactFlow as Fe } from "@xyflow/react";
|
|
14
|
-
import * as x from "dagre";
|
|
15
|
-
import { stepClasses as S } from "@mezzanine-ui/core/stepper";
|
|
16
|
-
import { Document as C, Page as Ie } from "react-pdf";
|
|
17
|
-
import '../detail.css';var w = {
|
|
18
|
-
root: "bpm_root_ehm7w",
|
|
19
|
-
toolbar: "bpm_toolbar_R-tis",
|
|
20
|
-
pageControls: "bpm_pageControls_jM-rC",
|
|
21
|
-
zoomControls: "bpm_zoomControls_7RAbJ",
|
|
22
|
-
counter: "bpm_counter_ILUsD",
|
|
23
|
-
viewport: "bpm_viewport_DQXms",
|
|
24
|
-
page: "bpm_page_Cv5Rg",
|
|
25
|
-
state: "bpm_state_bpgp3"
|
|
26
|
-
}, Le = 760, Re = 920, ze = 320, Be = 32, T = .75, Ve = 1.75, He = .25;
|
|
27
|
-
function Ue({ filename: e, fileUrl: t, onDownload: n }) {
|
|
28
|
-
let r = l(null), [i, a] = u(null), [d, p] = u(1), [m, h] = u(1), [ee, te] = u(Le);
|
|
29
|
-
s(() => {
|
|
30
|
-
let e = r.current;
|
|
31
|
-
if (!e || typeof ResizeObserver > "u") return;
|
|
32
|
-
let t = new ResizeObserver((e) => {
|
|
33
|
-
let t = e[0]?.contentRect.width;
|
|
34
|
-
t && te(t);
|
|
35
|
-
});
|
|
36
|
-
return t.observe(e), () => t.disconnect();
|
|
37
|
-
}, []), s(() => {
|
|
38
|
-
a(null), p(1), h(1);
|
|
39
|
-
}, [t]);
|
|
40
|
-
let ne = c(() => {
|
|
41
|
-
let e = Math.max(ze, ee - Be);
|
|
42
|
-
return Math.round(Math.min(Re, e) * m);
|
|
43
|
-
}, [m, ee]), re = o((e) => {
|
|
44
|
-
a(e.numPages), p(1);
|
|
45
|
-
}, []), ie = d > 1, ae = i !== null && d < i, oe = m > T, se = m < Ve, ce = i === null ? `第 ${d} 頁` : `第 ${d} / ${i} 頁`, le = `${Math.round(m * 100)}%`;
|
|
46
|
-
return /* @__PURE__ */ v("section", {
|
|
47
|
-
"aria-label": `${e} PDF 預覽`,
|
|
48
|
-
className: w.root,
|
|
49
|
-
children: [/* @__PURE__ */ v("div", {
|
|
50
|
-
className: w.toolbar,
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ v("div", {
|
|
53
|
-
className: w.pageControls,
|
|
54
|
-
"aria-label": "頁面切換",
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ _(f, {
|
|
57
|
-
"aria-label": "上一頁",
|
|
58
|
-
disabled: !ie,
|
|
59
|
-
icon: be,
|
|
60
|
-
onClick: () => {
|
|
61
|
-
p((e) => Math.max(1, e - 1));
|
|
62
|
-
},
|
|
63
|
-
size: "minor",
|
|
64
|
-
variant: "base-secondary"
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ _(g, {
|
|
67
|
-
className: w.counter,
|
|
68
|
-
component: "span",
|
|
69
|
-
variant: "body",
|
|
70
|
-
children: ce
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ _(f, {
|
|
73
|
-
"aria-label": "下一頁",
|
|
74
|
-
disabled: !ae,
|
|
75
|
-
icon: xe,
|
|
76
|
-
onClick: () => {
|
|
77
|
-
p((e) => i === null ? e : Math.min(i, e + 1));
|
|
78
|
-
},
|
|
79
|
-
size: "minor",
|
|
80
|
-
variant: "base-secondary"
|
|
81
|
-
})
|
|
82
|
-
]
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ v("div", {
|
|
85
|
-
className: w.zoomControls,
|
|
86
|
-
"aria-label": "縮放",
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ _(f, {
|
|
89
|
-
"aria-label": "縮小",
|
|
90
|
-
disabled: !oe,
|
|
91
|
-
icon: ke,
|
|
92
|
-
onClick: () => {
|
|
93
|
-
h((e) => Math.max(T, e - He));
|
|
94
|
-
},
|
|
95
|
-
size: "minor",
|
|
96
|
-
variant: "base-secondary"
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ _(g, {
|
|
99
|
-
className: w.counter,
|
|
100
|
-
component: "span",
|
|
101
|
-
variant: "body",
|
|
102
|
-
children: le
|
|
103
|
-
}),
|
|
104
|
-
/* @__PURE__ */ _(f, {
|
|
105
|
-
"aria-label": "放大",
|
|
106
|
-
disabled: !se,
|
|
107
|
-
icon: Oe,
|
|
108
|
-
onClick: () => {
|
|
109
|
-
h((e) => Math.min(Ve, e + He));
|
|
110
|
-
},
|
|
111
|
-
size: "minor",
|
|
112
|
-
variant: "base-secondary"
|
|
113
|
-
})
|
|
114
|
-
]
|
|
115
|
-
}),
|
|
116
|
-
n ? /* @__PURE__ */ _(f, {
|
|
117
|
-
icon: Ce,
|
|
118
|
-
iconType: "leading",
|
|
119
|
-
onClick: n,
|
|
120
|
-
size: "minor",
|
|
121
|
-
variant: "base-primary",
|
|
122
|
-
children: "下載"
|
|
123
|
-
}) : null
|
|
124
|
-
]
|
|
125
|
-
}), /* @__PURE__ */ _("div", {
|
|
126
|
-
className: w.viewport,
|
|
127
|
-
ref: r,
|
|
128
|
-
children: /* @__PURE__ */ _(C, {
|
|
129
|
-
error: /* @__PURE__ */ _(E, { message: "PDF 無法載入。" }),
|
|
130
|
-
file: t,
|
|
131
|
-
loading: /* @__PURE__ */ _(E, { message: "正在載入 PDF..." }),
|
|
132
|
-
noData: /* @__PURE__ */ _(E, { message: "沒有可預覽的 PDF。" }),
|
|
133
|
-
onLoadSuccess: re,
|
|
134
|
-
children: /* @__PURE__ */ _(Ie, {
|
|
135
|
-
className: w.page,
|
|
136
|
-
loading: /* @__PURE__ */ _(E, { message: "正在載入頁面..." }),
|
|
137
|
-
pageNumber: d,
|
|
138
|
-
renderAnnotationLayer: !0,
|
|
139
|
-
renderTextLayer: !0,
|
|
140
|
-
width: ne
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
})]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
function E({ message: e }) {
|
|
147
|
-
return /* @__PURE__ */ _("div", {
|
|
148
|
-
className: w.state,
|
|
149
|
-
children: /* @__PURE__ */ _(g, {
|
|
150
|
-
color: "text-neutral",
|
|
151
|
-
variant: "body",
|
|
152
|
-
children: e
|
|
153
|
-
})
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/views/instances/detail/InstanceDetailView.tsx
|
|
158
|
-
var D = {
|
|
159
|
-
display: "grid",
|
|
160
|
-
gap: 16
|
|
161
|
-
}, We = {
|
|
162
|
-
display: "flex",
|
|
163
|
-
flexWrap: "wrap",
|
|
164
|
-
gap: 8
|
|
165
|
-
}, O = 184, Ge = 96, Ke = {
|
|
166
|
-
display: "grid",
|
|
167
|
-
gap: 16
|
|
168
|
-
}, qe = {
|
|
169
|
-
display: "grid",
|
|
170
|
-
gap: 12,
|
|
171
|
-
width: "100%"
|
|
172
|
-
}, Je = {
|
|
173
|
-
minWidth: "100%",
|
|
174
|
-
width: "100%"
|
|
175
|
-
}, Ye = {
|
|
176
|
-
display: "grid",
|
|
177
|
-
gap: 12,
|
|
178
|
-
width: "100%"
|
|
179
|
-
}, Xe = {
|
|
180
|
-
background: "#f8fafc",
|
|
181
|
-
border: "1px solid #e2e8f0",
|
|
182
|
-
borderRadius: 8,
|
|
183
|
-
height: "min(64vh, 620px)",
|
|
184
|
-
minHeight: 440,
|
|
185
|
-
overflow: "hidden",
|
|
186
|
-
width: "min(80vw, 1040px)"
|
|
187
|
-
}, k = {
|
|
188
|
-
background: "#ffffff",
|
|
189
|
-
border: "1px solid #cbd5e1",
|
|
190
|
-
borderRadius: 8,
|
|
191
|
-
boxShadow: "0 8px 18px rgba(15, 23, 42, 0.08)",
|
|
192
|
-
display: "grid",
|
|
193
|
-
gap: 6,
|
|
194
|
-
minHeight: 82,
|
|
195
|
-
padding: 12,
|
|
196
|
-
width: 184
|
|
197
|
-
}, Ze = {
|
|
198
|
-
borderRadius: 999,
|
|
199
|
-
fontSize: 12,
|
|
200
|
-
fontWeight: 600,
|
|
201
|
-
justifySelf: "start",
|
|
202
|
-
lineHeight: "18px",
|
|
203
|
-
padding: "0 8px"
|
|
204
|
-
}, Qe = {
|
|
205
|
-
color: "#64748b",
|
|
206
|
-
fontSize: 12,
|
|
207
|
-
overflow: "hidden",
|
|
208
|
-
textOverflow: "ellipsis",
|
|
209
|
-
whiteSpace: "nowrap"
|
|
210
|
-
}, $e = { opacity: 0 }, et = {
|
|
211
|
-
display: "flex",
|
|
212
|
-
flexWrap: "wrap",
|
|
213
|
-
gap: 8
|
|
214
|
-
}, tt = {
|
|
215
|
-
alignItems: "center",
|
|
216
|
-
background: "#ffffff",
|
|
217
|
-
border: "1px solid #cbd5e1",
|
|
218
|
-
borderRadius: 8,
|
|
219
|
-
color: "#334155",
|
|
220
|
-
display: "inline-flex",
|
|
221
|
-
fontSize: 12,
|
|
222
|
-
fontWeight: 600,
|
|
223
|
-
gap: 6,
|
|
224
|
-
lineHeight: "20px",
|
|
225
|
-
padding: "4px 8px"
|
|
226
|
-
}, A = {
|
|
227
|
-
cursor: "help",
|
|
228
|
-
textDecoration: "underline dotted",
|
|
229
|
-
textUnderlineOffset: 3
|
|
230
|
-
}, nt = { color: "var(--mzn-color-text-error)" };
|
|
231
|
-
function rt(e) {
|
|
232
|
-
e && (e.style.width = "100%");
|
|
233
|
-
}
|
|
234
|
-
var it = { workflowRuntime: Y };
|
|
235
|
-
function j({ instanceId: i }) {
|
|
236
|
-
let { member: a } = e(), o = a?.memberId ?? null, [l, ae] = u([]), [y, me] = u(null), [be, xe] = u([]), [Oe, ke] = u([]), [b, Pe] = u([]), [x, S] = u(null), [C, Ie] = u([]), [w, Le] = u([]), [Re, ze] = u([]), [Be, T] = u(null), [Ve, He] = u(!0), [E, O] = u(!1), [Ge, k] = u(!1), [Ze, Qe] = u(""), [$e, A] = u(!1), [nt, j] = u(""), [N, P] = u(null), [F, ft] = u(!1), [pt, I] = u(""), [L, R] = u(!1), [ht, z] = u(null), [gt, B] = u(""), [V, H] = u(null), [_t, vt] = u(!1), [yt, bt] = u([]), [xt, St] = u(!1), [Ct, wt] = u({}), [W, At] = u({}), [G, K] = u(null), [jt, Ft] = u(null), It = nt.trim(), Lt = Ze.trim(), q = pt.trim(), Rt = gt.trim();
|
|
237
|
-
s(() => {
|
|
238
|
-
sn();
|
|
239
|
-
}, [o, i]), s(() => {
|
|
240
|
-
At(y?.formData ?? {});
|
|
241
|
-
}, [y]);
|
|
242
|
-
let J = c(() => C.find((e) => Ot(e, o) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [o, C]), Y = c(() => J && y ? y.workflowSnapshot.nodes.find((e) => e.id === J.nodeId) ?? null : null, [J, y]), X = c(() => Y && y ? Tt(y.workflowSnapshot, Y) : [], [Y, y]), Z = Y?.type === "userTask" && Y.data.returnBehavior.allowReturn, Ht = X.find((e) => e.id === ht) ?? X[0] ?? null, Ut = !!(y && y.initiatorMemberId === o && (y.state === "RUNNING" || y.state === "RETURNED")), Q = !!(y && y.initiatorMemberId === o && y.state === "RETURNED"), Gt = c(() => new Map(Re.map((e) => [e.memberId, e])), [Re]), Kt = c(() => C.map((e) => ({
|
|
243
|
-
...e,
|
|
244
|
-
assigneeLabel: Dt(e, Gt),
|
|
245
|
-
key: e.id,
|
|
246
|
-
nodeLabel: U(e.nodeId, y?.workflowSnapshot ?? null),
|
|
247
|
-
statusLabel: Et(e.status)
|
|
248
|
-
})), [
|
|
249
|
-
y,
|
|
250
|
-
Gt,
|
|
251
|
-
C
|
|
252
|
-
]), qt = c(() => ut(be), [be]), Jt = c(() => new Map(b.map((e) => [e.id, e])), [b]), Yt = c(() => dt(l, C, w, y?.workflowSnapshot ?? null, y?.state ?? "RUNNING", Gt, qt, Jt, x), [
|
|
253
|
-
l,
|
|
254
|
-
y,
|
|
255
|
-
Gt,
|
|
256
|
-
x,
|
|
257
|
-
Jt,
|
|
258
|
-
qt,
|
|
259
|
-
C,
|
|
260
|
-
w
|
|
261
|
-
]), Xt = c(() => mt(Yt), [Yt]), $ = c(() => y ? Bt(y.workflowSnapshot) : null, [y]), Zt = c(() => y && $ ? zt($, C, w, y.state) : [], [
|
|
262
|
-
y,
|
|
263
|
-
$,
|
|
264
|
-
C,
|
|
265
|
-
w
|
|
266
|
-
]), Qt = c(() => $ ? Vt($) : [], [$]), $t = c(() => y ? Wt(y.workflowSnapshot) : [], [y]), en = c(() => [
|
|
267
|
-
{
|
|
268
|
-
dataIndex: "nodeLabel",
|
|
269
|
-
key: "nodeLabel",
|
|
270
|
-
title: "節點",
|
|
271
|
-
width: 180
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
key: "assigneeMemberId",
|
|
275
|
-
title: "處理者",
|
|
276
|
-
render: (e) => /* @__PURE__ */ _(g, {
|
|
277
|
-
component: "span",
|
|
278
|
-
variant: "body",
|
|
279
|
-
children: e.assigneeLabel
|
|
280
|
-
}),
|
|
281
|
-
width: 180
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
dataIndex: "statusLabel",
|
|
285
|
-
key: "statusLabel",
|
|
286
|
-
title: "狀態",
|
|
287
|
-
width: 120
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
key: "createdAt",
|
|
291
|
-
render: (e) => /* @__PURE__ */ _(g, {
|
|
292
|
-
component: "span",
|
|
293
|
-
variant: "body",
|
|
294
|
-
children: t(e.createdAt)
|
|
295
|
-
}),
|
|
296
|
-
title: "建立時間",
|
|
297
|
-
width: 220
|
|
298
|
-
}
|
|
299
|
-
], []), tn = c(() => Oe.map((e) => ({
|
|
300
|
-
attachment: e,
|
|
301
|
-
createdAt: e.createdAt,
|
|
302
|
-
filename: e.filename,
|
|
303
|
-
id: e.id,
|
|
304
|
-
key: e.id,
|
|
305
|
-
mimeType: e.mimeType,
|
|
306
|
-
sizeLabel: at(Number(e.sizeBytes))
|
|
307
|
-
})), [Oe]), nn = c(() => [
|
|
308
|
-
{
|
|
309
|
-
dataIndex: "filename",
|
|
310
|
-
key: "filename",
|
|
311
|
-
title: "檔名",
|
|
312
|
-
width: 260
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
dataIndex: "mimeType",
|
|
316
|
-
key: "mimeType",
|
|
317
|
-
title: "類型",
|
|
318
|
-
width: 180
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
dataIndex: "sizeLabel",
|
|
322
|
-
key: "sizeLabel",
|
|
323
|
-
title: "大小",
|
|
324
|
-
width: 120
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
key: "createdAt",
|
|
328
|
-
render: (e) => /* @__PURE__ */ _(g, {
|
|
329
|
-
component: "span",
|
|
330
|
-
variant: "body",
|
|
331
|
-
children: t(e.createdAt)
|
|
332
|
-
}),
|
|
333
|
-
title: "上傳時間",
|
|
334
|
-
width: 220
|
|
335
|
-
}
|
|
336
|
-
], []), rn = c(() => ({
|
|
337
|
-
render: (e) => [...e.mimeType === "application/pdf" ? [{
|
|
338
|
-
icon: we,
|
|
339
|
-
iconType: "leading",
|
|
340
|
-
name: "預覽",
|
|
341
|
-
onClick: () => {
|
|
342
|
-
un(e.attachment);
|
|
343
|
-
}
|
|
344
|
-
}] : [], {
|
|
345
|
-
icon: Ce,
|
|
346
|
-
iconType: "leading",
|
|
347
|
-
name: "下載",
|
|
348
|
-
onClick: () => {
|
|
349
|
-
ln(e.attachment);
|
|
350
|
-
}
|
|
351
|
-
}],
|
|
352
|
-
variant: "base-secondary",
|
|
353
|
-
width: 160
|
|
354
|
-
}), []), an = c(() => b.map((e) => ({
|
|
355
|
-
algorithm: e.algorithm,
|
|
356
|
-
hashLabel: ot(e.signedPayloadHash),
|
|
357
|
-
key: e.id,
|
|
358
|
-
keyVersion: e.keyVersion,
|
|
359
|
-
signedAtLabel: t(e.signedAt),
|
|
360
|
-
signerMemberId: e.signerMemberId
|
|
361
|
-
})), [b]), on = c(() => [
|
|
362
|
-
{
|
|
363
|
-
dataIndex: "signerMemberId",
|
|
364
|
-
key: "signerMemberId",
|
|
365
|
-
title: "簽章者",
|
|
366
|
-
width: 160
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
dataIndex: "algorithm",
|
|
370
|
-
key: "algorithm",
|
|
371
|
-
title: "演算法",
|
|
372
|
-
width: 150
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
dataIndex: "keyVersion",
|
|
376
|
-
key: "keyVersion",
|
|
377
|
-
title: "Key 版本",
|
|
378
|
-
width: 100
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
dataIndex: "hashLabel",
|
|
382
|
-
key: "hashLabel",
|
|
383
|
-
title: "Payload Hash",
|
|
384
|
-
width: 180
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
dataIndex: "signedAtLabel",
|
|
388
|
-
key: "signedAtLabel",
|
|
389
|
-
title: "簽章時間",
|
|
390
|
-
width: 220
|
|
391
|
-
}
|
|
392
|
-
], []);
|
|
393
|
-
async function sn() {
|
|
394
|
-
He(!0), T(null);
|
|
395
|
-
try {
|
|
396
|
-
let e = await ue(i);
|
|
397
|
-
ae(e.activityLogs), me(e.instance), Ie(e.tasks), Le(e.workflowTokens);
|
|
398
|
-
let [t, n, r, a] = await Promise.all([
|
|
399
|
-
lt(e.tasks),
|
|
400
|
-
ct(e),
|
|
401
|
-
le(e.instance.id),
|
|
402
|
-
pe(e.instance.id)
|
|
403
|
-
]);
|
|
404
|
-
xe(t), ze(n), ke(r), Pe(a.signatures), S(a.verification);
|
|
405
|
-
} catch (e) {
|
|
406
|
-
T(M(e));
|
|
407
|
-
} finally {
|
|
408
|
-
He(!1);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
async function cn(e, t) {
|
|
412
|
-
if (!o) throw Error("尚未登入,無法上傳附件");
|
|
413
|
-
return { id: (await _e({
|
|
414
|
-
file: t,
|
|
415
|
-
formFieldPath: `form.${e.fieldKey}`
|
|
416
|
-
})).id };
|
|
417
|
-
}
|
|
418
|
-
async function ln(e) {
|
|
419
|
-
if (!o) return;
|
|
420
|
-
let t = await de({ id: e.id });
|
|
421
|
-
window.open(t, "_blank", "noopener,noreferrer");
|
|
422
|
-
}
|
|
423
|
-
async function un(e) {
|
|
424
|
-
if (!o) return;
|
|
425
|
-
let t = await fe({ id: e.id });
|
|
426
|
-
K(e), Ft(t);
|
|
427
|
-
}
|
|
428
|
-
async function dn({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: r = null }) {
|
|
429
|
-
if (!(!o || !J)) {
|
|
430
|
-
O(!0), T(null);
|
|
431
|
-
try {
|
|
432
|
-
await ce({
|
|
433
|
-
action: e,
|
|
434
|
-
comment: t,
|
|
435
|
-
decidedByMemberId: o,
|
|
436
|
-
returnToNodeId: n,
|
|
437
|
-
taskId: J.id,
|
|
438
|
-
transferToMemberId: r
|
|
439
|
-
}), ft(!1), R(!1), St(!1), j(""), I(""), B(""), H(null), z(null), P(null), await sn();
|
|
440
|
-
} catch (e) {
|
|
441
|
-
T(M(e));
|
|
442
|
-
} finally {
|
|
443
|
-
O(!1);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
function fn() {
|
|
448
|
-
j(""), P(null), ft(!0);
|
|
449
|
-
}
|
|
450
|
-
function pn() {
|
|
451
|
-
E || (ft(!1), j(""), P(null));
|
|
452
|
-
}
|
|
453
|
-
function mn() {
|
|
454
|
-
I(""), z(X[0]?.id ?? null), R(!0);
|
|
455
|
-
}
|
|
456
|
-
function hn() {
|
|
457
|
-
E || (R(!1), I(""), z(null));
|
|
458
|
-
}
|
|
459
|
-
function gn() {
|
|
460
|
-
B(""), H(null), St(!0), vn("");
|
|
461
|
-
}
|
|
462
|
-
function _n() {
|
|
463
|
-
E || (St(!1), B(""), H(null));
|
|
464
|
-
}
|
|
465
|
-
async function vn(e) {
|
|
466
|
-
vt(!0);
|
|
467
|
-
try {
|
|
468
|
-
bt((await ge(e)).filter((e) => e.memberId !== o).map(Mt));
|
|
469
|
-
} catch (e) {
|
|
470
|
-
T(M(e));
|
|
471
|
-
} finally {
|
|
472
|
-
vt(!1);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
async function yn() {
|
|
476
|
-
if (!It) {
|
|
477
|
-
P("請輸入拒絕原因");
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
await dn({
|
|
481
|
-
action: "REJECTED",
|
|
482
|
-
comment: It
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
async function bn() {
|
|
486
|
-
if (!V) {
|
|
487
|
-
T("請選擇轉派對象");
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
await dn({
|
|
491
|
-
action: "TRANSFERRED",
|
|
492
|
-
comment: Rt || null,
|
|
493
|
-
transferToMemberId: V.id
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
async function xn() {
|
|
497
|
-
await dn({
|
|
498
|
-
action: "RETURNED",
|
|
499
|
-
comment: q || null,
|
|
500
|
-
returnToNodeId: Ht?.id ?? null
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
async function Sn() {
|
|
504
|
-
if (!(!o || !y || !Ut)) {
|
|
505
|
-
if (O(!0), T(null), wt({}), y.formDefinitionSnapshot.schema && y.formDefinitionSnapshot.uiSchema) {
|
|
506
|
-
let e = je({
|
|
507
|
-
schema: y.formDefinitionSnapshot.schema,
|
|
508
|
-
uiSchema: y.formDefinitionSnapshot.uiSchema,
|
|
509
|
-
values: W
|
|
510
|
-
});
|
|
511
|
-
if (!e.valid) {
|
|
512
|
-
wt(e.errors), T("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ae(e.firstInvalidFieldKey), O(!1);
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
try {
|
|
517
|
-
await se({
|
|
518
|
-
cancelledByMemberId: o,
|
|
519
|
-
comment: Lt || null,
|
|
520
|
-
instanceId: y.id
|
|
521
|
-
}), Qe(""), A(!1), await sn();
|
|
522
|
-
} catch (e) {
|
|
523
|
-
T(M(e));
|
|
524
|
-
} finally {
|
|
525
|
-
O(!1);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
async function Cn() {
|
|
530
|
-
if (!(!o || !y || !Q)) {
|
|
531
|
-
O(!0), T(null);
|
|
532
|
-
try {
|
|
533
|
-
await he({
|
|
534
|
-
formData: W,
|
|
535
|
-
initiatorMemberId: o,
|
|
536
|
-
instanceId: y.id,
|
|
537
|
-
title: y.title
|
|
538
|
-
}), await sn();
|
|
539
|
-
} catch (e) {
|
|
540
|
-
T(M(e));
|
|
541
|
-
} finally {
|
|
542
|
-
O(!1);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return /* @__PURE__ */ v(oe, { children: [
|
|
547
|
-
/* @__PURE__ */ _(m, { children: /* @__PURE__ */ v(ve, {
|
|
548
|
-
description: y ? `${kt(y.state)} · ${t(y.startedAt)}` : "載入案件內容。",
|
|
549
|
-
title: y?.title ?? "簽核案件",
|
|
550
|
-
children: [
|
|
551
|
-
y ? /* @__PURE__ */ _(f, {
|
|
552
|
-
"aria-label": "查看流程圖",
|
|
553
|
-
icon: Ee,
|
|
554
|
-
iconType: "icon-only",
|
|
555
|
-
onClick: () => k(!0),
|
|
556
|
-
title: "查看流程圖",
|
|
557
|
-
variant: "base-secondary",
|
|
558
|
-
children: "流程圖"
|
|
559
|
-
}) : null,
|
|
560
|
-
Ut ? /* @__PURE__ */ _(f, {
|
|
561
|
-
disabled: E,
|
|
562
|
-
icon: Se,
|
|
563
|
-
iconType: "leading",
|
|
564
|
-
onClick: () => A(!0),
|
|
565
|
-
variant: "destructive-secondary",
|
|
566
|
-
children: "取消案件"
|
|
567
|
-
}) : null,
|
|
568
|
-
J ? /* @__PURE__ */ v(oe, { children: [
|
|
569
|
-
Z ? /* @__PURE__ */ _(f, {
|
|
570
|
-
disabled: E,
|
|
571
|
-
icon: Te,
|
|
572
|
-
iconType: "leading",
|
|
573
|
-
onClick: mn,
|
|
574
|
-
variant: "base-secondary",
|
|
575
|
-
children: "退回"
|
|
576
|
-
}) : null,
|
|
577
|
-
/* @__PURE__ */ _(f, {
|
|
578
|
-
disabled: E,
|
|
579
|
-
icon: De,
|
|
580
|
-
iconType: "leading",
|
|
581
|
-
onClick: gn,
|
|
582
|
-
variant: "base-secondary",
|
|
583
|
-
children: "轉派"
|
|
584
|
-
}),
|
|
585
|
-
/* @__PURE__ */ _(f, {
|
|
586
|
-
disabled: E,
|
|
587
|
-
icon: Se,
|
|
588
|
-
iconType: "leading",
|
|
589
|
-
onClick: fn,
|
|
590
|
-
variant: "destructive-secondary",
|
|
591
|
-
children: "拒絕"
|
|
592
|
-
}),
|
|
593
|
-
/* @__PURE__ */ _(f, {
|
|
594
|
-
disabled: E,
|
|
595
|
-
icon: ye,
|
|
596
|
-
iconType: "leading",
|
|
597
|
-
onClick: () => void dn({
|
|
598
|
-
action: "APPROVED",
|
|
599
|
-
comment: null
|
|
600
|
-
}),
|
|
601
|
-
variant: "base-primary",
|
|
602
|
-
children: "同意"
|
|
603
|
-
})
|
|
604
|
-
] }) : null
|
|
605
|
-
]
|
|
606
|
-
}) }),
|
|
607
|
-
/* @__PURE__ */ v(ee, { children: [
|
|
608
|
-
/* @__PURE__ */ _(h, { children: /* @__PURE__ */ v("div", {
|
|
609
|
-
style: D,
|
|
610
|
-
children: [
|
|
611
|
-
Be ? /* @__PURE__ */ _(g, {
|
|
612
|
-
color: "text-error",
|
|
613
|
-
variant: "body",
|
|
614
|
-
children: Be
|
|
615
|
-
}) : null,
|
|
616
|
-
Ve ? /* @__PURE__ */ _(g, {
|
|
617
|
-
color: "text-neutral",
|
|
618
|
-
variant: "body",
|
|
619
|
-
children: "載入中..."
|
|
620
|
-
}) : null,
|
|
621
|
-
y?.formDefinitionSnapshot.schema && y.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ v(oe, { children: [/* @__PURE__ */ _(r, {
|
|
622
|
-
errors: Ct,
|
|
623
|
-
onChange: (e) => {
|
|
624
|
-
At(e), wt({});
|
|
625
|
-
},
|
|
626
|
-
onUploadAttachment: Q ? cn : void 0,
|
|
627
|
-
readonly: !Q,
|
|
628
|
-
schema: y.formDefinitionSnapshot.schema,
|
|
629
|
-
uiSchema: y.formDefinitionSnapshot.uiSchema,
|
|
630
|
-
value: Q ? W : y.formData
|
|
631
|
-
}), Q ? /* @__PURE__ */ _("div", {
|
|
632
|
-
style: We,
|
|
633
|
-
children: /* @__PURE__ */ _(f, {
|
|
634
|
-
disabled: E,
|
|
635
|
-
icon: Te,
|
|
636
|
-
iconType: "leading",
|
|
637
|
-
onClick: () => void Cn(),
|
|
638
|
-
variant: "base-primary",
|
|
639
|
-
children: "重新送出"
|
|
640
|
-
})
|
|
641
|
-
}) : null] }) : /* @__PURE__ */ _(g, {
|
|
642
|
-
color: "text-neutral",
|
|
643
|
-
variant: "body",
|
|
644
|
-
children: "此案件沒有可顯示的表單快照。"
|
|
645
|
-
})
|
|
646
|
-
]
|
|
647
|
-
}) }),
|
|
648
|
-
/* @__PURE__ */ _(h, { children: /* @__PURE__ */ v("div", {
|
|
649
|
-
style: D,
|
|
650
|
-
children: [/* @__PURE__ */ _(g, {
|
|
651
|
-
component: "h2",
|
|
652
|
-
variant: "h3",
|
|
653
|
-
children: "附件"
|
|
654
|
-
}), tn.length > 0 ? /* @__PURE__ */ _(re, {
|
|
655
|
-
actions: rn,
|
|
656
|
-
columns: nn,
|
|
657
|
-
dataSource: tn,
|
|
658
|
-
fullWidth: !0
|
|
659
|
-
}) : /* @__PURE__ */ _(g, {
|
|
660
|
-
color: "text-neutral",
|
|
661
|
-
variant: "body",
|
|
662
|
-
children: "此案件沒有附件。"
|
|
663
|
-
})]
|
|
664
|
-
}) }),
|
|
665
|
-
/* @__PURE__ */ v(h, { children: [/* @__PURE__ */ _(g, {
|
|
666
|
-
component: "h2",
|
|
667
|
-
variant: "h3",
|
|
668
|
-
children: "任務"
|
|
669
|
-
}), /* @__PURE__ */ _(re, {
|
|
670
|
-
columns: en,
|
|
671
|
-
dataSource: Kt,
|
|
672
|
-
fullWidth: !0
|
|
673
|
-
})] }),
|
|
674
|
-
/* @__PURE__ */ _(h, { children: /* @__PURE__ */ v("div", {
|
|
675
|
-
style: D,
|
|
676
|
-
children: [
|
|
677
|
-
/* @__PURE__ */ _(g, {
|
|
678
|
-
component: "h2",
|
|
679
|
-
variant: "h3",
|
|
680
|
-
children: "簽章"
|
|
681
|
-
}),
|
|
682
|
-
/* @__PURE__ */ _(g, {
|
|
683
|
-
color: x?.valid ? "text-success" : "text-error",
|
|
684
|
-
variant: "body",
|
|
685
|
-
children: x ? x.valid ? `簽章鏈已驗證,共 ${x.checkedCount} 筆。` : `簽章鏈驗證失敗:${x.errors.join("、")}` : "尚無簽章紀錄。"
|
|
686
|
-
}),
|
|
687
|
-
an.length > 0 ? /* @__PURE__ */ _(re, {
|
|
688
|
-
columns: on,
|
|
689
|
-
dataSource: an,
|
|
690
|
-
fullWidth: !0
|
|
691
|
-
}) : null
|
|
692
|
-
]
|
|
693
|
-
}) }),
|
|
694
|
-
/* @__PURE__ */ _(h, { children: /* @__PURE__ */ v("div", {
|
|
695
|
-
style: D,
|
|
696
|
-
children: [/* @__PURE__ */ _(g, {
|
|
697
|
-
component: "h2",
|
|
698
|
-
variant: "h3",
|
|
699
|
-
children: "歷程"
|
|
700
|
-
}), Yt.length > 0 ? /* @__PURE__ */ _(ne, {
|
|
701
|
-
currentStep: Xt,
|
|
702
|
-
orientation: "vertical",
|
|
703
|
-
type: "dot",
|
|
704
|
-
children: Yt.map((e) => /* @__PURE__ */ _(st, {
|
|
705
|
-
descriptionParts: e.descriptionParts,
|
|
706
|
-
error: e.error,
|
|
707
|
-
forcePending: e.forcePending,
|
|
708
|
-
title: e.title
|
|
709
|
-
}, e.id))
|
|
710
|
-
}) : /* @__PURE__ */ _(g, {
|
|
711
|
-
color: "text-neutral",
|
|
712
|
-
variant: "body",
|
|
713
|
-
children: "尚無歷程紀錄。"
|
|
714
|
-
})]
|
|
715
|
-
}) })
|
|
716
|
-
] }),
|
|
717
|
-
y ? /* @__PURE__ */ _(p, {
|
|
718
|
-
modalType: "standard",
|
|
719
|
-
onClose: () => k(!1),
|
|
720
|
-
open: Ge,
|
|
721
|
-
showModalHeader: !0,
|
|
722
|
-
size: "wide",
|
|
723
|
-
supportingText: `${kt(y.state)} · ${t(y.startedAt)}`,
|
|
724
|
-
title: "流程圖",
|
|
725
|
-
children: /* @__PURE__ */ v("div", {
|
|
726
|
-
style: Ke,
|
|
727
|
-
children: [/* @__PURE__ */ _("div", {
|
|
728
|
-
style: Xe,
|
|
729
|
-
children: /* @__PURE__ */ v(Fe, {
|
|
730
|
-
edges: Qt,
|
|
731
|
-
fitView: !0,
|
|
732
|
-
fitViewOptions: { padding: .18 },
|
|
733
|
-
maxZoom: 1.2,
|
|
734
|
-
minZoom: .2,
|
|
735
|
-
nodes: Zt,
|
|
736
|
-
nodesDraggable: !1,
|
|
737
|
-
nodesFocusable: !1,
|
|
738
|
-
nodeTypes: it,
|
|
739
|
-
panOnDrag: !0,
|
|
740
|
-
proOptions: { hideAttribution: !0 },
|
|
741
|
-
children: [/* @__PURE__ */ _(Me, {}), /* @__PURE__ */ _(Ne, { showInteractive: !1 })]
|
|
742
|
-
})
|
|
743
|
-
}), $t.length > 0 ? /* @__PURE__ */ _("div", {
|
|
744
|
-
style: et,
|
|
745
|
-
children: $t.map((e) => /* @__PURE__ */ _("span", {
|
|
746
|
-
style: tt,
|
|
747
|
-
children: e
|
|
748
|
-
}, e))
|
|
749
|
-
}) : null]
|
|
750
|
-
})
|
|
751
|
-
}) : null,
|
|
752
|
-
/* @__PURE__ */ _(p, {
|
|
753
|
-
modalType: "standard",
|
|
754
|
-
onClose: () => {
|
|
755
|
-
K(null), Ft(null);
|
|
756
|
-
},
|
|
757
|
-
open: !!(G && jt),
|
|
758
|
-
showModalHeader: !0,
|
|
759
|
-
size: "wide",
|
|
760
|
-
supportingText: G?.filename ?? void 0,
|
|
761
|
-
title: "PDF 預覽",
|
|
762
|
-
children: jt ? /* @__PURE__ */ _(Ue, {
|
|
763
|
-
filename: G?.filename ?? "PDF 預覽",
|
|
764
|
-
fileUrl: jt,
|
|
765
|
-
onDownload: G ? () => void ln(G) : void 0
|
|
766
|
-
}) : null
|
|
767
|
-
}),
|
|
768
|
-
/* @__PURE__ */ _(p, {
|
|
769
|
-
cancelText: "保留案件",
|
|
770
|
-
confirmButtonProps: { variant: "destructive-primary" },
|
|
771
|
-
confirmText: "確認取消",
|
|
772
|
-
loading: E,
|
|
773
|
-
modalStatusType: "error",
|
|
774
|
-
modalType: "standard",
|
|
775
|
-
onCancel: () => A(!1),
|
|
776
|
-
onClose: () => A(!1),
|
|
777
|
-
onConfirm: () => void Sn(),
|
|
778
|
-
open: $e,
|
|
779
|
-
showModalFooter: !0,
|
|
780
|
-
showModalHeader: !0,
|
|
781
|
-
supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
|
|
782
|
-
title: "取消案件",
|
|
783
|
-
children: /* @__PURE__ */ v("div", {
|
|
784
|
-
style: D,
|
|
785
|
-
children: [/* @__PURE__ */ v(g, {
|
|
786
|
-
variant: "body",
|
|
787
|
-
children: [
|
|
788
|
-
"確定要取消「",
|
|
789
|
-
y?.title ?? "",
|
|
790
|
-
"」嗎?"
|
|
791
|
-
]
|
|
792
|
-
}), /* @__PURE__ */ _(n, {
|
|
793
|
-
label: "取消原因",
|
|
794
|
-
name: "cancelComment",
|
|
795
|
-
children: /* @__PURE__ */ _(ie, {
|
|
796
|
-
onChange: (e) => Qe(e.target.value),
|
|
797
|
-
placeholder: "可填寫取消原因",
|
|
798
|
-
resize: "vertical",
|
|
799
|
-
rows: 3,
|
|
800
|
-
value: Ze
|
|
801
|
-
})
|
|
802
|
-
})]
|
|
803
|
-
})
|
|
804
|
-
}),
|
|
805
|
-
/* @__PURE__ */ _(p, {
|
|
806
|
-
cancelText: "取消",
|
|
807
|
-
confirmButtonProps: {
|
|
808
|
-
disabled: !It,
|
|
809
|
-
variant: "destructive-primary"
|
|
810
|
-
},
|
|
811
|
-
confirmText: "送出拒絕",
|
|
812
|
-
loading: E,
|
|
813
|
-
modalStatusType: "error",
|
|
814
|
-
modalType: "standard",
|
|
815
|
-
onCancel: pn,
|
|
816
|
-
onClose: pn,
|
|
817
|
-
onConfirm: () => void yn(),
|
|
818
|
-
open: F,
|
|
819
|
-
showModalFooter: !0,
|
|
820
|
-
showModalHeader: !0,
|
|
821
|
-
size: "regular",
|
|
822
|
-
supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
|
|
823
|
-
title: "拒絕原因",
|
|
824
|
-
children: /* @__PURE__ */ v("div", {
|
|
825
|
-
style: qe,
|
|
826
|
-
children: [/* @__PURE__ */ _(n, {
|
|
827
|
-
label: "拒絕原因",
|
|
828
|
-
name: "rejectReason",
|
|
829
|
-
required: !0,
|
|
830
|
-
children: /* @__PURE__ */ _(ie, {
|
|
831
|
-
autoFocus: !0,
|
|
832
|
-
onChange: (e) => {
|
|
833
|
-
j(e.target.value), P(null);
|
|
834
|
-
},
|
|
835
|
-
placeholder: "請說明拒絕原因",
|
|
836
|
-
ref: rt,
|
|
837
|
-
resize: "vertical",
|
|
838
|
-
rows: 4,
|
|
839
|
-
style: Je,
|
|
840
|
-
type: N ? "error" : "default",
|
|
841
|
-
value: nt
|
|
842
|
-
})
|
|
843
|
-
}), N ? /* @__PURE__ */ _(g, {
|
|
844
|
-
color: "text-error",
|
|
845
|
-
variant: "body",
|
|
846
|
-
children: N
|
|
847
|
-
}) : null]
|
|
848
|
-
})
|
|
849
|
-
}),
|
|
850
|
-
/* @__PURE__ */ _(p, {
|
|
851
|
-
cancelText: "取消",
|
|
852
|
-
confirmButtonProps: { disabled: !V },
|
|
853
|
-
confirmText: "送出轉派",
|
|
854
|
-
loading: E,
|
|
855
|
-
modalType: "standard",
|
|
856
|
-
onCancel: _n,
|
|
857
|
-
onClose: _n,
|
|
858
|
-
onConfirm: () => void bn(),
|
|
859
|
-
open: xt,
|
|
860
|
-
showModalFooter: !0,
|
|
861
|
-
showModalHeader: !0,
|
|
862
|
-
size: "regular",
|
|
863
|
-
supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
|
|
864
|
-
title: "轉派簽核",
|
|
865
|
-
children: /* @__PURE__ */ v("div", {
|
|
866
|
-
style: Ye,
|
|
867
|
-
children: [/* @__PURE__ */ _(n, {
|
|
868
|
-
label: "轉派對象",
|
|
869
|
-
name: "transferToMemberId",
|
|
870
|
-
required: !0,
|
|
871
|
-
children: /* @__PURE__ */ _(d, {
|
|
872
|
-
asyncData: !0,
|
|
873
|
-
disabledOptionsFilter: !0,
|
|
874
|
-
emptyText: "沒有符合的成員",
|
|
875
|
-
inputProps: {
|
|
876
|
-
autoCapitalize: "none",
|
|
877
|
-
autoCorrect: "off",
|
|
878
|
-
name: "transfer-member-search",
|
|
879
|
-
spellCheck: !1
|
|
880
|
-
},
|
|
881
|
-
loading: _t,
|
|
882
|
-
loadingText: "搜尋成員中...",
|
|
883
|
-
mode: "single",
|
|
884
|
-
onChange: (e) => H(Nt(e)),
|
|
885
|
-
onSearch: vn,
|
|
886
|
-
onSearchTextChange: (e) => H(Pt(e, yt)),
|
|
887
|
-
onVisibilityChange: (e) => {
|
|
888
|
-
e && vn("");
|
|
889
|
-
},
|
|
890
|
-
options: [...yt],
|
|
891
|
-
placeholder: "搜尋姓名或信箱",
|
|
892
|
-
searchDebounceTime: 300,
|
|
893
|
-
value: V
|
|
894
|
-
})
|
|
895
|
-
}), /* @__PURE__ */ _(n, {
|
|
896
|
-
label: "轉派說明",
|
|
897
|
-
name: "transferComment",
|
|
898
|
-
children: /* @__PURE__ */ _(ie, {
|
|
899
|
-
onChange: (e) => B(e.target.value),
|
|
900
|
-
placeholder: "可補充轉派原因",
|
|
901
|
-
ref: rt,
|
|
902
|
-
resize: "vertical",
|
|
903
|
-
rows: 4,
|
|
904
|
-
style: Je,
|
|
905
|
-
value: gt
|
|
906
|
-
})
|
|
907
|
-
})]
|
|
908
|
-
})
|
|
909
|
-
}),
|
|
910
|
-
/* @__PURE__ */ _(p, {
|
|
911
|
-
cancelText: "取消",
|
|
912
|
-
confirmButtonProps: { disabled: !Ht },
|
|
913
|
-
confirmText: "送出退回",
|
|
914
|
-
loading: E,
|
|
915
|
-
modalType: "standard",
|
|
916
|
-
onCancel: hn,
|
|
917
|
-
onClose: hn,
|
|
918
|
-
onConfirm: () => void xn(),
|
|
919
|
-
open: L,
|
|
920
|
-
showModalFooter: !0,
|
|
921
|
-
showModalHeader: !0,
|
|
922
|
-
size: "regular",
|
|
923
|
-
supportingText: "退回後,流程會回到指定節點並等待重新處理。",
|
|
924
|
-
title: "退回簽核",
|
|
925
|
-
children: /* @__PURE__ */ v("div", {
|
|
926
|
-
style: Ye,
|
|
927
|
-
children: [/* @__PURE__ */ _(n, {
|
|
928
|
-
label: "退回節點",
|
|
929
|
-
name: "returnTargetNodeId",
|
|
930
|
-
required: !0,
|
|
931
|
-
children: /* @__PURE__ */ _(te, {
|
|
932
|
-
clearable: !1,
|
|
933
|
-
fullWidth: !0,
|
|
934
|
-
onChange: (e) => z(e?.id ?? null),
|
|
935
|
-
options: [...X],
|
|
936
|
-
placeholder: "選擇退回節點",
|
|
937
|
-
value: Ht
|
|
938
|
-
})
|
|
939
|
-
}), /* @__PURE__ */ _(n, {
|
|
940
|
-
label: "退回說明",
|
|
941
|
-
name: "returnComment",
|
|
942
|
-
children: /* @__PURE__ */ _(ie, {
|
|
943
|
-
onChange: (e) => I(e.target.value),
|
|
944
|
-
placeholder: "可補充需要修改的內容",
|
|
945
|
-
ref: rt,
|
|
946
|
-
resize: "vertical",
|
|
947
|
-
rows: 4,
|
|
948
|
-
style: Je,
|
|
949
|
-
value: pt
|
|
950
|
-
})
|
|
951
|
-
})]
|
|
952
|
-
})
|
|
953
|
-
})
|
|
954
|
-
] });
|
|
955
|
-
}
|
|
956
|
-
function M(e) {
|
|
957
|
-
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
958
|
-
}
|
|
959
|
-
function at(e) {
|
|
960
|
-
return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
|
|
961
|
-
}
|
|
962
|
-
function ot(e) {
|
|
963
|
-
return e.length > 16 ? `${e.slice(0, 12)}...` : e;
|
|
964
|
-
}
|
|
965
|
-
function N(...e) {
|
|
966
|
-
return e.filter((e) => q(e ?? null)).join(" ");
|
|
967
|
-
}
|
|
968
|
-
var st = a(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: a = 0, orientation: o, status: s = "pending", title: c, type: l = "number", ...u }, d) {
|
|
969
|
-
let f = r ? "pending" : s;
|
|
970
|
-
return /* @__PURE__ */ v("div", {
|
|
971
|
-
...u,
|
|
972
|
-
className: N(S.host, l === "dot" ? S.dot : null, n && f !== "processing" ? S.error : null, o === "horizontal" ? S.horizontal : null, l === "number" ? S.number : null, f === "pending" ? S.pending : null, f === "processing" ? S.processing : null, n && f === "processing" ? S.processingError : null, !n && f === "succeeded" ? S.succeeded : null, o === "vertical" ? S.vertical : null, e),
|
|
973
|
-
ref: d,
|
|
974
|
-
children: [l === "dot" ? /* @__PURE__ */ _("span", { className: N(S.statusIndicator, S.statusIndicatorDot) }) : /* @__PURE__ */ _("span", {
|
|
975
|
-
className: S.statusIndicator,
|
|
976
|
-
children: a + 1
|
|
977
|
-
}), /* @__PURE__ */ v("div", {
|
|
978
|
-
className: S.textContainer,
|
|
979
|
-
children: [/* @__PURE__ */ v(g, {
|
|
980
|
-
className: S.title,
|
|
981
|
-
variant: "label-primary-highlight",
|
|
982
|
-
children: [c, /* @__PURE__ */ _("span", { className: S.titleConnectLine })]
|
|
983
|
-
}), t.length > 0 ? /* @__PURE__ */ _(g, {
|
|
984
|
-
className: S.description,
|
|
985
|
-
variant: "caption",
|
|
986
|
-
children: t.map((e, t) => /* @__PURE__ */ v(i, { children: [t > 0 ? " · " : null, P(e)] }, `${e.type}-${t}`))
|
|
987
|
-
}) : null]
|
|
988
|
-
})]
|
|
989
|
-
});
|
|
990
|
-
});
|
|
991
|
-
function P(e) {
|
|
992
|
-
return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ _("span", {
|
|
993
|
-
style: nt,
|
|
994
|
-
children: e.text
|
|
995
|
-
}) : e.email ? /* @__PURE__ */ v(oe, { children: [
|
|
996
|
-
e.prefix,
|
|
997
|
-
":",
|
|
998
|
-
/* @__PURE__ */ _(ae, {
|
|
999
|
-
title: e.email,
|
|
1000
|
-
children: ({ onMouseEnter: t, onMouseLeave: n, ref: r }) => /* @__PURE__ */ _("span", {
|
|
1001
|
-
"data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
|
|
1002
|
-
onMouseEnter: t,
|
|
1003
|
-
onMouseLeave: n,
|
|
1004
|
-
ref: r,
|
|
1005
|
-
style: A,
|
|
1006
|
-
children: e.label
|
|
1007
|
-
})
|
|
1008
|
-
})
|
|
1009
|
-
] }) : `${e.prefix}:${e.label}`;
|
|
1010
|
-
}
|
|
1011
|
-
async function ct({ activityLogs: e, tasks: t }) {
|
|
1012
|
-
let n = [...new Set([
|
|
1013
|
-
...e.map((e) => e.actorMemberId),
|
|
1014
|
-
...t.map((e) => e.assigneeMemberId),
|
|
1015
|
-
...t.map((e) => e.originalAssigneeMemberId),
|
|
1016
|
-
...t.flatMap((e) => e.candidateMemberIds),
|
|
1017
|
-
...t.flatMap((e) => Ft(e.delegationChainJson).flatMap((e) => [e.from, e.to]))
|
|
1018
|
-
].filter(q))];
|
|
1019
|
-
try {
|
|
1020
|
-
return await me(n);
|
|
1021
|
-
} catch {
|
|
1022
|
-
return [];
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
async function lt(e) {
|
|
1026
|
-
return (await Promise.all(e.map((e) => y(e.id)))).flat();
|
|
1027
|
-
}
|
|
1028
|
-
function ut(e) {
|
|
1029
|
-
return e.reduce((e, t) => {
|
|
1030
|
-
let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
|
|
1031
|
-
return new Map(e).set(t.taskId, r);
|
|
1032
|
-
}, /* @__PURE__ */ new Map());
|
|
1033
|
-
}
|
|
1034
|
-
function dt(e, t, n, r, i, a, o, s, c) {
|
|
1035
|
-
let l = e.filter(R).map((e) => {
|
|
1036
|
-
let t = yt(e), n = wt(e.nodeId, r);
|
|
1037
|
-
return {
|
|
1038
|
-
descriptionParts: [
|
|
1039
|
-
F(n ? `節點:${n}` : "節點:全流程"),
|
|
1040
|
-
pt("操作者", e.actorMemberId, a, "系統"),
|
|
1041
|
-
F(`時間:${G(e.createdAt)}`),
|
|
1042
|
-
...Ct(e, t, r, o, s, c, a)
|
|
1043
|
-
].filter(L),
|
|
1044
|
-
error: At(e, t),
|
|
1045
|
-
id: e.id,
|
|
1046
|
-
title: bt(e.eventType, t)
|
|
1047
|
-
};
|
|
1048
|
-
}), u = t.filter(J).map((e) => ({
|
|
1049
|
-
descriptionParts: [
|
|
1050
|
-
F(`節點:${U(e.nodeId, r)}`),
|
|
1051
|
-
pt("處理者", e.assigneeMemberId, a, "未指定"),
|
|
1052
|
-
F(`建立時間:${G(e.createdAt)}`)
|
|
1053
|
-
].filter(L),
|
|
1054
|
-
error: !1,
|
|
1055
|
-
id: `pending-task-${e.id}`,
|
|
1056
|
-
title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
|
|
1057
|
-
})), d = new Set([...e.filter(R).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(q)), f = r ? z(r, t, n, i, d).map((e) => ({
|
|
1058
|
-
descriptionParts: [F(`${Z(e.type)} · 尚未抵達`)].filter(L),
|
|
1059
|
-
error: !1,
|
|
1060
|
-
forcePending: !0,
|
|
1061
|
-
id: `future-node-${e.id}`,
|
|
1062
|
-
title: vt(e)
|
|
1063
|
-
})) : [];
|
|
1064
|
-
return [
|
|
1065
|
-
...l,
|
|
1066
|
-
...u,
|
|
1067
|
-
...f
|
|
1068
|
-
];
|
|
1069
|
-
}
|
|
1070
|
-
function F(e) {
|
|
1071
|
-
return q(e) ? {
|
|
1072
|
-
text: e,
|
|
1073
|
-
type: "text"
|
|
1074
|
-
} : null;
|
|
1075
|
-
}
|
|
1076
|
-
function ft(e) {
|
|
1077
|
-
return q(e) ? {
|
|
1078
|
-
text: e,
|
|
1079
|
-
type: "dangerText"
|
|
1080
|
-
} : null;
|
|
1081
|
-
}
|
|
1082
|
-
function pt(e, t, n, r) {
|
|
1083
|
-
let i = t ? n.get(t) : null;
|
|
1084
|
-
return {
|
|
1085
|
-
email: i?.email ?? null,
|
|
1086
|
-
label: i?.name ?? r,
|
|
1087
|
-
memberId: t,
|
|
1088
|
-
prefix: e,
|
|
1089
|
-
type: "member"
|
|
1090
|
-
};
|
|
1091
|
-
}
|
|
1092
|
-
function I(e, t) {
|
|
1093
|
-
if (!e) return "-";
|
|
1094
|
-
let n = t.get(e);
|
|
1095
|
-
return n ? `${n.name}(${n.email})` : e;
|
|
1096
|
-
}
|
|
1097
|
-
function L(e) {
|
|
1098
|
-
return !!e;
|
|
1099
|
-
}
|
|
1100
|
-
function mt(e) {
|
|
1101
|
-
let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
|
|
1102
|
-
return t === -1 ? e.length : t;
|
|
1103
|
-
}
|
|
1104
|
-
function R(e) {
|
|
1105
|
-
return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED";
|
|
1106
|
-
}
|
|
1107
|
-
function ht(e, t, n, r, i) {
|
|
1108
|
-
if (e.type === "startEvent" || i.has(e.id)) return !1;
|
|
1109
|
-
if (r === "REJECTED") return !0;
|
|
1110
|
-
let a = X(e, t, n, r);
|
|
1111
|
-
return a.tone === "neutral" || a.tone === "waiting";
|
|
1112
|
-
}
|
|
1113
|
-
function z(e, t, n, r, i) {
|
|
1114
|
-
if (r !== "RUNNING" && r !== "REJECTED") return [];
|
|
1115
|
-
let a = e.nodes.filter((e) => ht(e, t, n, r, i)), o = gt(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
|
|
1116
|
-
return a.filter((e) => o.has(e.id)).sort((e, t) => {
|
|
1117
|
-
let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
|
|
1118
|
-
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;
|
|
1119
|
-
});
|
|
1120
|
-
}
|
|
1121
|
-
function gt(e, t, n, r, i) {
|
|
1122
|
-
let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
|
|
1123
|
-
let n = [...e.get(t.source) ?? [], t.target];
|
|
1124
|
-
return new Map(e).set(t.source, n);
|
|
1125
|
-
}, /* @__PURE__ */ new Map());
|
|
1126
|
-
return B(e, n, r, i).reduce((e, t) => _t(e, V(t, o, a)), /* @__PURE__ */ new Map());
|
|
1127
|
-
}
|
|
1128
|
-
function B(e, t, n, r) {
|
|
1129
|
-
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(J).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [...new Set([
|
|
1130
|
-
...i,
|
|
1131
|
-
...a,
|
|
1132
|
-
...o
|
|
1133
|
-
])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
|
|
1134
|
-
return s.length > 0 ? s : c;
|
|
1135
|
-
}
|
|
1136
|
-
function V(e, t, n) {
|
|
1137
|
-
return H([{
|
|
1138
|
-
distance: 0,
|
|
1139
|
-
nodeId: e
|
|
1140
|
-
}], t, n);
|
|
1141
|
-
}
|
|
1142
|
-
function H(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
|
|
1143
|
-
let [a, ...o] = e;
|
|
1144
|
-
if (!a) return i;
|
|
1145
|
-
if (r.has(a.nodeId)) return H(o, t, n, r, i);
|
|
1146
|
-
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;
|
|
1147
|
-
return H([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
|
|
1148
|
-
distance: a.distance + 1,
|
|
1149
|
-
nodeId: e
|
|
1150
|
-
}))], t, n, s, c);
|
|
1151
|
-
}
|
|
1152
|
-
function _t(e, t) {
|
|
1153
|
-
return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
|
|
1154
|
-
}
|
|
1155
|
-
function vt(e) {
|
|
1156
|
-
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}`;
|
|
1157
|
-
}
|
|
1158
|
-
function yt(e) {
|
|
1159
|
-
try {
|
|
1160
|
-
let t = JSON.parse(e.payloadJson);
|
|
1161
|
-
return Rt(t) ? t : {};
|
|
1162
|
-
} catch {
|
|
1163
|
-
return {};
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
function bt(e, t) {
|
|
1167
|
-
return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? xt(K(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
|
|
1168
|
-
}
|
|
1169
|
-
function xt(e) {
|
|
1170
|
-
return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
|
|
1171
|
-
}
|
|
1172
|
-
function St(e, t, n, r) {
|
|
1173
|
-
if (e.eventType === "TASK_CREATED") {
|
|
1174
|
-
let e = K(t, "assigneeMemberId"), n = K(t, "originalAssigneeMemberId");
|
|
1175
|
-
if (!e) {
|
|
1176
|
-
let e = jt(t, "candidateMemberIds");
|
|
1177
|
-
return e.length ? `候選簽核人:${e.map((e) => I(e, r)).join("、")}` : null;
|
|
1178
|
-
}
|
|
1179
|
-
let i = I(e, r), a = I(n, r);
|
|
1180
|
-
return n && n !== e ? `待簽人:${i}(原簽核人:${a})` : `待簽人:${i}`;
|
|
1181
|
-
}
|
|
1182
|
-
if (e.eventType === "TASK_DECIDED") {
|
|
1183
|
-
let e = K(t, "action"), n = K(t, "comment"), i = e ? `決議:${W(e)}` : null, a = K(t, "transferToMemberId");
|
|
1184
|
-
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(q).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${I(a, r)}`].filter(q).join(" · ") : i;
|
|
1185
|
-
}
|
|
1186
|
-
if (e.eventType === "TOKEN_ADVANCED") {
|
|
1187
|
-
let e = K(t, "action");
|
|
1188
|
-
if (e) return `流程結果:${W(e)}`;
|
|
1189
|
-
let r = Lt(t, "arrivedCount"), i = Lt(t, "requiredCount");
|
|
1190
|
-
if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
|
|
1191
|
-
let a = K(t, "fromNodeId"), o = K(t, "toNodeId");
|
|
1192
|
-
if (a && o) return `由 ${U(a, n)} 前進至 ${U(o, n)}`;
|
|
1193
|
-
}
|
|
1194
|
-
if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
|
|
1195
|
-
let e = K(t, "state");
|
|
1196
|
-
return e ? `案件狀態:${kt(e)}` : null;
|
|
1197
|
-
}
|
|
1198
|
-
return null;
|
|
1199
|
-
}
|
|
1200
|
-
function Ct(e, t, n, r, i, a, o) {
|
|
1201
|
-
if (e.eventType !== "TASK_DECIDED") return [F(St(e, t, n, o))].filter(L);
|
|
1202
|
-
let s = e.taskId ? r.get(e.taskId) : null, c = K(t, "action") ?? s?.action ?? null, l = K(t, "comment") ?? s?.comment ?? null, u = K(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = K(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
|
|
1203
|
-
return [
|
|
1204
|
-
F(c ? `決議:${W(c)}` : null),
|
|
1205
|
-
c === "REJECTED" ? ft(`拒絕原因:${l ?? "-"}`) : null,
|
|
1206
|
-
c === "RETURNED" ? F(`退回說明:${l ?? "-"}`) : null,
|
|
1207
|
-
c === "TRANSFERRED" ? F(`轉派給:${I(u, o)}`) : null,
|
|
1208
|
-
c === "TRANSFERRED" ? F(`轉派說明:${l ?? "-"}`) : null,
|
|
1209
|
-
f ? F(a?.valid ? `簽章:已驗證(${ot(f.signedPayloadHash)})` : `簽章:待檢查(${ot(f.signedPayloadHash)})`) : null
|
|
1210
|
-
].filter(L);
|
|
1211
|
-
}
|
|
1212
|
-
function wt(e, t) {
|
|
1213
|
-
return e ? U(e, t) : null;
|
|
1214
|
-
}
|
|
1215
|
-
function U(e, t) {
|
|
1216
|
-
return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
|
|
1217
|
-
}
|
|
1218
|
-
function Tt(e, t) {
|
|
1219
|
-
if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
|
|
1220
|
-
if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
|
|
1221
|
-
id: e.id,
|
|
1222
|
-
name: `${e.data.label}(${Z(e.type)})`
|
|
1223
|
-
}));
|
|
1224
|
-
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);
|
|
1225
|
-
return r ? [{
|
|
1226
|
-
id: r.id,
|
|
1227
|
-
name: `${r.data.label}(${Z(r.type)})`
|
|
1228
|
-
}] : [];
|
|
1229
|
-
}
|
|
1230
|
-
function W(e) {
|
|
1231
|
-
return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
|
|
1232
|
-
}
|
|
1233
|
-
function Et(e) {
|
|
1234
|
-
return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
|
|
1235
|
-
}
|
|
1236
|
-
function Dt(e, t = /* @__PURE__ */ new Map()) {
|
|
1237
|
-
let n = Ft(e.delegationChainJson);
|
|
1238
|
-
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => I(e, t)).join("、")}` : "未指定";
|
|
1239
|
-
let r = I(e.assigneeMemberId, t), i = I(e.originalAssigneeMemberId, t);
|
|
1240
|
-
return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
|
|
1241
|
-
}
|
|
1242
|
-
function Ot(e, t) {
|
|
1243
|
-
return t ? e.assigneeMemberId === t || e.candidateMemberIds.includes(t) : !1;
|
|
1244
|
-
}
|
|
1245
|
-
function kt(e) {
|
|
1246
|
-
return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
|
|
1247
|
-
}
|
|
1248
|
-
function At(e, t) {
|
|
1249
|
-
return e.eventType === "SLA_TRIGGERED" || K(t, "action") === "REJECTED" || K(t, "instanceState") === "REJECTED";
|
|
1250
|
-
}
|
|
1251
|
-
function G(e) {
|
|
1252
|
-
return t(e);
|
|
1253
|
-
}
|
|
1254
|
-
function K(e, t) {
|
|
1255
|
-
let n = e[t];
|
|
1256
|
-
return typeof n == "string" ? n : null;
|
|
1257
|
-
}
|
|
1258
|
-
function jt(e, t) {
|
|
1259
|
-
let n = e[t];
|
|
1260
|
-
return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
|
|
1261
|
-
}
|
|
1262
|
-
function Mt(e) {
|
|
1263
|
-
return {
|
|
1264
|
-
email: e.email,
|
|
1265
|
-
id: e.memberId,
|
|
1266
|
-
name: `${e.name} · ${e.email}`
|
|
1267
|
-
};
|
|
1268
|
-
}
|
|
1269
|
-
function Nt(e) {
|
|
1270
|
-
if (!Rt(e)) return null;
|
|
1271
|
-
let t = e.email, n = e.id, r = e.name;
|
|
1272
|
-
return typeof n == "string" && typeof r == "string" ? {
|
|
1273
|
-
email: typeof t == "string" ? t : null,
|
|
1274
|
-
id: n,
|
|
1275
|
-
name: r
|
|
1276
|
-
} : null;
|
|
1277
|
-
}
|
|
1278
|
-
function Pt(e, t) {
|
|
1279
|
-
let n = e.trim().toLocaleLowerCase();
|
|
1280
|
-
if (!n) return null;
|
|
1281
|
-
let r = t.filter((e) => [
|
|
1282
|
-
e.id,
|
|
1283
|
-
e.name,
|
|
1284
|
-
e.email ?? ""
|
|
1285
|
-
].some((e) => e.toLocaleLowerCase().includes(n)));
|
|
1286
|
-
return r.length === 1 ? r[0] ?? null : null;
|
|
1287
|
-
}
|
|
1288
|
-
function Ft(e) {
|
|
1289
|
-
try {
|
|
1290
|
-
let t = JSON.parse(e);
|
|
1291
|
-
return Array.isArray(t) ? t.map((e) => Rt(e) ? It(e) : null).filter((e) => e !== null) : [];
|
|
1292
|
-
} catch {
|
|
1293
|
-
return [];
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
function It(e) {
|
|
1297
|
-
let t = K(e, "from"), n = K(e, "to"), r = K(e, "reason");
|
|
1298
|
-
return !t || !n || !r ? null : {
|
|
1299
|
-
from: t,
|
|
1300
|
-
reason: r,
|
|
1301
|
-
ruleId: K(e, "ruleId"),
|
|
1302
|
-
to: n
|
|
1303
|
-
};
|
|
1304
|
-
}
|
|
1305
|
-
function Lt(e, t) {
|
|
1306
|
-
let n = e[t];
|
|
1307
|
-
return typeof n == "number" ? n : null;
|
|
1308
|
-
}
|
|
1309
|
-
function q(e) {
|
|
1310
|
-
return typeof e == "string" && e.trim().length > 0;
|
|
1311
|
-
}
|
|
1312
|
-
function Rt(e) {
|
|
1313
|
-
return typeof e == "object" && !!e;
|
|
1314
|
-
}
|
|
1315
|
-
function J(e) {
|
|
1316
|
-
return e.status === "PENDING" || e.status === "IN_PROGRESS";
|
|
1317
|
-
}
|
|
1318
|
-
function Y({ data: e }) {
|
|
1319
|
-
return /* @__PURE__ */ v("div", {
|
|
1320
|
-
style: Ht(e.tone),
|
|
1321
|
-
children: [
|
|
1322
|
-
/* @__PURE__ */ _(b, {
|
|
1323
|
-
isConnectable: !1,
|
|
1324
|
-
position: Pe.Left,
|
|
1325
|
-
style: $e,
|
|
1326
|
-
type: "target"
|
|
1327
|
-
}),
|
|
1328
|
-
/* @__PURE__ */ _(g, {
|
|
1329
|
-
component: "span",
|
|
1330
|
-
ellipsis: !0,
|
|
1331
|
-
title: e.label,
|
|
1332
|
-
variant: "label-primary",
|
|
1333
|
-
children: e.label
|
|
1334
|
-
}),
|
|
1335
|
-
/* @__PURE__ */ _("span", {
|
|
1336
|
-
style: Ut(e.tone),
|
|
1337
|
-
children: e.statusLabel
|
|
1338
|
-
}),
|
|
1339
|
-
/* @__PURE__ */ _("span", {
|
|
1340
|
-
title: e.secondaryLabel,
|
|
1341
|
-
style: Qe,
|
|
1342
|
-
children: e.secondaryLabel || e.kindLabel
|
|
1343
|
-
}),
|
|
1344
|
-
/* @__PURE__ */ _(b, {
|
|
1345
|
-
isConnectable: !1,
|
|
1346
|
-
position: Pe.Right,
|
|
1347
|
-
style: $e,
|
|
1348
|
-
type: "source"
|
|
1349
|
-
})
|
|
1350
|
-
]
|
|
1351
|
-
});
|
|
1352
|
-
}
|
|
1353
|
-
function zt(e, t, n, r) {
|
|
1354
|
-
return e.nodes.map((e) => {
|
|
1355
|
-
let i = X(e, t, n, r);
|
|
1356
|
-
return {
|
|
1357
|
-
data: {
|
|
1358
|
-
kindLabel: Z(e.type),
|
|
1359
|
-
label: e.data.label,
|
|
1360
|
-
secondaryLabel: i.secondaryLabel,
|
|
1361
|
-
statusLabel: i.statusLabel,
|
|
1362
|
-
tone: i.tone
|
|
1363
|
-
},
|
|
1364
|
-
id: e.id,
|
|
1365
|
-
position: e.position,
|
|
1366
|
-
sourcePosition: Pe.Right,
|
|
1367
|
-
targetPosition: Pe.Left,
|
|
1368
|
-
type: "workflowRuntime"
|
|
1369
|
-
};
|
|
1370
|
-
});
|
|
1371
|
-
}
|
|
1372
|
-
function Bt(e) {
|
|
1373
|
-
let t = new x.graphlib.Graph();
|
|
1374
|
-
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
1375
|
-
nodesep: 56,
|
|
1376
|
-
rankdir: "LR",
|
|
1377
|
-
ranksep: 120
|
|
1378
|
-
}), e.nodes.forEach((e) => {
|
|
1379
|
-
t.setNode(e.id, {
|
|
1380
|
-
height: Ge,
|
|
1381
|
-
width: O
|
|
1382
|
-
});
|
|
1383
|
-
}), e.edges.forEach((e) => {
|
|
1384
|
-
t.setEdge(e.source, e.target);
|
|
1385
|
-
}), x.layout(t), {
|
|
1386
|
-
...e,
|
|
1387
|
-
nodes: e.nodes.map((e) => {
|
|
1388
|
-
let n = t.node(e.id);
|
|
1389
|
-
return n ? {
|
|
1390
|
-
...e,
|
|
1391
|
-
position: {
|
|
1392
|
-
x: n.x - O / 2,
|
|
1393
|
-
y: n.y - Ge / 2
|
|
1394
|
-
}
|
|
1395
|
-
} : e;
|
|
1396
|
-
})
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
function Vt(e) {
|
|
1400
|
-
return e.edges.map((e) => {
|
|
1401
|
-
let t = Q(e);
|
|
1402
|
-
return {
|
|
1403
|
-
animated: !1,
|
|
1404
|
-
id: e.id,
|
|
1405
|
-
label: t,
|
|
1406
|
-
labelBgBorderRadius: 6,
|
|
1407
|
-
labelBgPadding: [8, 4],
|
|
1408
|
-
labelBgStyle: {
|
|
1409
|
-
fill: e.data.isDefault ? "#f8fafc" : "#eff6ff",
|
|
1410
|
-
stroke: e.data.isDefault ? "#64748b" : "#2563eb",
|
|
1411
|
-
strokeWidth: 1
|
|
1412
|
-
},
|
|
1413
|
-
labelShowBg: !!t,
|
|
1414
|
-
labelStyle: {
|
|
1415
|
-
fill: e.data.isDefault ? "#475569" : "#2563eb",
|
|
1416
|
-
fontSize: 12,
|
|
1417
|
-
fontWeight: 600
|
|
1418
|
-
},
|
|
1419
|
-
source: e.source,
|
|
1420
|
-
style: {
|
|
1421
|
-
stroke: "#475569",
|
|
1422
|
-
strokeWidth: 1.5
|
|
1423
|
-
},
|
|
1424
|
-
target: e.target,
|
|
1425
|
-
type: e.type ?? "smoothstep"
|
|
1426
|
-
};
|
|
1427
|
-
});
|
|
1428
|
-
}
|
|
1429
|
-
function X(e, t, n, r) {
|
|
1430
|
-
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");
|
|
1431
|
-
return a ? {
|
|
1432
|
-
secondaryLabel: `處理者 ${Dt(a)}`,
|
|
1433
|
-
statusLabel: "待處理",
|
|
1434
|
-
tone: "current"
|
|
1435
|
-
} : o ? {
|
|
1436
|
-
secondaryLabel: `已取消 ${Dt(o)}`,
|
|
1437
|
-
statusLabel: "已取消",
|
|
1438
|
-
tone: "cancelled"
|
|
1439
|
-
} : s ? {
|
|
1440
|
-
secondaryLabel: `已完成 ${Dt(s)}`,
|
|
1441
|
-
statusLabel: "已完成",
|
|
1442
|
-
tone: "completed"
|
|
1443
|
-
} : l ? {
|
|
1444
|
-
secondaryLabel: `token ${l.id}`,
|
|
1445
|
-
statusLabel: "執行中",
|
|
1446
|
-
tone: "current"
|
|
1447
|
-
} : u ? {
|
|
1448
|
-
secondaryLabel: `token ${u.id}`,
|
|
1449
|
-
statusLabel: "等待前置",
|
|
1450
|
-
tone: "waiting"
|
|
1451
|
-
} : e.type === "startEvent" ? {
|
|
1452
|
-
secondaryLabel: "流程已發起",
|
|
1453
|
-
statusLabel: "已發起",
|
|
1454
|
-
tone: "completed"
|
|
1455
|
-
} : e.type === "endEvent" && r !== "RUNNING" ? {
|
|
1456
|
-
secondaryLabel: r,
|
|
1457
|
-
statusLabel: r === "REJECTED" ? "已拒絕" : "已完成",
|
|
1458
|
-
tone: r === "REJECTED" ? "cancelled" : "completed"
|
|
1459
|
-
} : {
|
|
1460
|
-
secondaryLabel: Z(e.type),
|
|
1461
|
-
statusLabel: "未抵達",
|
|
1462
|
-
tone: "neutral"
|
|
1463
|
-
};
|
|
1464
|
-
}
|
|
1465
|
-
function Z(e) {
|
|
1466
|
-
return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
|
|
1467
|
-
}
|
|
1468
|
-
function Ht(e) {
|
|
1469
|
-
return e === "current" ? {
|
|
1470
|
-
...k,
|
|
1471
|
-
border: "1px solid var(--mzn-color-primary, #0057ff)",
|
|
1472
|
-
boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
|
|
1473
|
-
} : e === "completed" ? {
|
|
1474
|
-
...k,
|
|
1475
|
-
border: "1px solid #16a34a"
|
|
1476
|
-
} : e === "cancelled" ? {
|
|
1477
|
-
...k,
|
|
1478
|
-
border: "1px solid #dc2626",
|
|
1479
|
-
opacity: .72
|
|
1480
|
-
} : e === "waiting" ? {
|
|
1481
|
-
...k,
|
|
1482
|
-
border: "1px dashed #64748b"
|
|
1483
|
-
} : k;
|
|
1484
|
-
}
|
|
1485
|
-
function Ut(e) {
|
|
1486
|
-
let t = Ze;
|
|
1487
|
-
return e === "current" ? {
|
|
1488
|
-
...t,
|
|
1489
|
-
background: "#eff6ff",
|
|
1490
|
-
color: "#2563eb"
|
|
1491
|
-
} : e === "completed" ? {
|
|
1492
|
-
...t,
|
|
1493
|
-
background: "#f0fdf4",
|
|
1494
|
-
color: "#15803d"
|
|
1495
|
-
} : e === "cancelled" ? {
|
|
1496
|
-
...t,
|
|
1497
|
-
background: "#fef2f2",
|
|
1498
|
-
color: "#dc2626"
|
|
1499
|
-
} : e === "waiting" ? {
|
|
1500
|
-
...t,
|
|
1501
|
-
background: "#f8fafc",
|
|
1502
|
-
color: "#475569"
|
|
1503
|
-
} : {
|
|
1504
|
-
...t,
|
|
1505
|
-
background: "#f1f5f9",
|
|
1506
|
-
color: "#64748b"
|
|
1507
|
-
};
|
|
1508
|
-
}
|
|
1509
|
-
function Q(e) {
|
|
1510
|
-
return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
|
|
1511
|
-
}
|
|
1512
|
-
function Wt(e) {
|
|
1513
|
-
return e.edges.map(Q).filter((e) => e.trim().length > 0);
|
|
1514
|
-
}
|
|
1515
|
-
//#endregion
|
|
1516
|
-
export { j as t };
|
|
1517
|
-
|
|
1518
|
-
//# sourceMappingURL=detail-CSxI04gB.js.map
|