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