@rytass/bpm-core-react 0.8.0 → 0.9.1
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 +93 -0
- package/README.md +18 -2
- package/dist/chunks/FormBuilderView-BPLwAJGv.cjs +3 -0
- package/dist/chunks/FormBuilderView-BPLwAJGv.cjs.map +1 -0
- package/dist/chunks/FormBuilderView-Do9-MIAe.js +1477 -0
- package/dist/chunks/FormBuilderView-Do9-MIAe.js.map +1 -0
- package/dist/chunks/FormRendererView-C5POZbWz.js +492 -0
- package/dist/chunks/FormRendererView-C5POZbWz.js.map +1 -0
- package/dist/chunks/FormRendererView-DNtNodNl.cjs +2 -0
- package/dist/chunks/FormRendererView-DNtNodNl.cjs.map +1 -0
- package/dist/chunks/{approval-instance-list-page-YZcGGDD8.js → approval-instance-list-page-BjX2kaoF.js} +56 -54
- package/dist/chunks/approval-instance-list-page-BjX2kaoF.js.map +1 -0
- package/dist/chunks/approval-instance-list-page-C408vxE2.cjs +2 -0
- package/dist/chunks/approval-instance-list-page-C408vxE2.cjs.map +1 -0
- package/dist/chunks/{categories-DBPoSrsi.js → categories-DGlxuC6X.js} +5 -5
- package/dist/chunks/{categories-DBPoSrsi.js.map → categories-DGlxuC6X.js.map} +1 -1
- package/dist/chunks/{categories-B6QZKZRt.cjs → categories-DUfldZ_9.cjs} +2 -2
- package/dist/chunks/{categories-B6QZKZRt.cjs.map → categories-DUfldZ_9.cjs.map} +1 -1
- package/dist/chunks/compose-CULMDsLS.cjs +2 -0
- package/dist/chunks/compose-CULMDsLS.cjs.map +1 -0
- package/dist/chunks/{compose-CQHDT7vh.js → compose-DJBlA5PD.js} +60 -58
- package/dist/chunks/compose-DJBlA5PD.js.map +1 -0
- package/dist/chunks/{delegations-DDEk-WI6.cjs → delegations-CGj-tZNO.cjs} +2 -2
- package/dist/chunks/{delegations-DDEk-WI6.cjs.map → delegations-CGj-tZNO.cjs.map} +1 -1
- package/dist/chunks/{delegations-iVnRi3QE.js → delegations-DLEEFBlH.js} +231 -231
- package/dist/chunks/{delegations-iVnRi3QE.js.map → delegations-DLEEFBlH.js.map} +1 -1
- package/dist/chunks/{delegations-ZNtodFaD.js → delegations-DqMpI_Nk.js} +168 -167
- package/dist/chunks/delegations-DqMpI_Nk.js.map +1 -0
- package/dist/chunks/delegations-kbMOSEif.cjs +2 -0
- package/dist/chunks/delegations-kbMOSEif.cjs.map +1 -0
- package/dist/chunks/{designer-CUbVXEtS.js → designer-BszXJ5RO.js} +1227 -990
- package/dist/chunks/designer-BszXJ5RO.js.map +1 -0
- package/dist/chunks/designer-CmqAU92b.cjs +65 -0
- package/dist/chunks/designer-CmqAU92b.cjs.map +1 -0
- package/dist/chunks/detail-CDexqBoU.cjs +2 -0
- package/dist/chunks/detail-CDexqBoU.cjs.map +1 -0
- package/dist/chunks/{detail-Cts5_gVp.js → detail-DAak2OXS.js} +704 -622
- package/dist/chunks/detail-DAak2OXS.js.map +1 -0
- package/dist/chunks/notifications--hwl-DR0.cjs +2 -0
- package/dist/chunks/{notifications-BKs4--96.cjs.map → notifications--hwl-DR0.cjs.map} +1 -1
- package/dist/chunks/{notifications-CSulztkU.js → notifications-DJ5wzCye.js} +7 -7
- package/dist/chunks/{notifications-CSulztkU.js.map → notifications-DJ5wzCye.js.map} +1 -1
- package/dist/chunks/{orgs-CrNxqlwp.js → orgs-DytLvZ_X.js} +243 -241
- package/dist/chunks/{orgs-CrNxqlwp.js.map → orgs-DytLvZ_X.js.map} +1 -1
- package/dist/chunks/orgs-Ni22buHs.cjs +2 -0
- package/dist/chunks/orgs-Ni22buHs.cjs.map +1 -0
- package/dist/chunks/providers-DEqcuXw9.js +506 -0
- package/dist/chunks/providers-DEqcuXw9.js.map +1 -0
- package/dist/chunks/providers-D_zTbkQH.cjs +2 -0
- package/dist/chunks/providers-D_zTbkQH.cjs.map +1 -0
- package/dist/chunks/{users-qghSMtLn.cjs → users-0HqlM_VQ.cjs} +2 -2
- package/dist/chunks/{users-qghSMtLn.cjs.map → users-0HqlM_VQ.cjs.map} +1 -1
- package/dist/chunks/{users-CUY139DF.js → users-FWrb3ehW.js} +5 -5
- package/dist/chunks/{users-CUY139DF.js.map → users-FWrb3ehW.js.map} +1 -1
- package/dist/components/notification-drawer.d.ts +4 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -428
- package/dist/index.js.map +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +16 -15
- 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/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/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/admin/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/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/renderer/FormRendererView.d.ts +7 -2
- package/dist/views/forms/renderer/form-data-source-field.d.ts +34 -0
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.d.ts +1 -0
- package/dist/views/forms/renderer/index.js +2 -2
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +4 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +5 -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 +105 -86
- 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/compose/TemplateComposeWizardView.d.ts +3 -2
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.cjs.map +1 -1
- package/dist/views/templates/index.js +153 -112
- package/dist/views/templates/index.js.map +1 -1
- package/package.json +56 -11
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +0 -3
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +0 -1
- package/dist/chunks/FormBuilderView-D8DrQOXD.js +0 -1090
- package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +0 -1
- package/dist/chunks/FormRendererView-BwVsH2eX.cjs +0 -2
- package/dist/chunks/FormRendererView-BwVsH2eX.cjs.map +0 -1
- package/dist/chunks/FormRendererView-DrHsuSVo.js +0 -220
- package/dist/chunks/FormRendererView-DrHsuSVo.js.map +0 -1
- package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs +0 -2
- package/dist/chunks/approval-instance-list-page-BMUKxzcz.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-YZcGGDD8.js.map +0 -1
- package/dist/chunks/compose-CQHDT7vh.js.map +0 -1
- package/dist/chunks/compose-Ds_cAefe.cjs +0 -2
- package/dist/chunks/compose-Ds_cAefe.cjs.map +0 -1
- package/dist/chunks/delegations-C2wLWsDQ.cjs +0 -2
- package/dist/chunks/delegations-C2wLWsDQ.cjs.map +0 -1
- package/dist/chunks/delegations-ZNtodFaD.js.map +0 -1
- package/dist/chunks/designer-CQ9hxSdD.cjs +0 -65
- package/dist/chunks/designer-CQ9hxSdD.cjs.map +0 -1
- package/dist/chunks/designer-CUbVXEtS.js.map +0 -1
- package/dist/chunks/detail-B-Q4W-iw.cjs +0 -2
- package/dist/chunks/detail-B-Q4W-iw.cjs.map +0 -1
- package/dist/chunks/detail-Cts5_gVp.js.map +0 -1
- package/dist/chunks/notifications-BKs4--96.cjs +0 -2
- package/dist/chunks/orgs-iNJ0QEcK.cjs +0 -2
- package/dist/chunks/orgs-iNJ0QEcK.cjs.map +0 -1
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { n as e } from "./auth-provider-B5oPmvk2.js";
|
|
3
3
|
import { t } from "./format-date-time-CB-LxzqT.js";
|
|
4
4
|
import { t as n } from "./bpm-form-field-Cao0rMol.js";
|
|
5
|
-
import {
|
|
5
|
+
import { n as r, t as i } from "./FormRendererView-C5POZbWz.js";
|
|
6
6
|
import '../style.css';import '../detail.css';/* empty css */
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { AutoComplete as
|
|
7
|
+
import { Fragment as a, forwardRef as o, useCallback as s, useEffect as c, useImperativeHandle as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
8
|
+
import { AutoComplete as p, Button as m, Input as ee, Modal as h, PageHeader as te, Section as g, SectionGroup as _, Select as ne, Stepper as v, Table as re, Textarea as y, Tooltip as b, Typography as x } from "@mezzanine-ui/react";
|
|
9
9
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
10
|
-
import { cancelAdhocDirective as
|
|
10
|
+
import { cancelAdhocDirective as T, cancelApprovalInstance as ie, configureAdhocCompletionNotification as ae, configureAdhocStageNotification as oe, decideTask as se, listAdhocDirectives as ce, listAttachments as le, listTaskDecisions as ue, readApprovalInstance as de, readAttachmentDownloadUrl as fe, readAttachmentPreviewUrl as pe, readInstanceSignatures as me, requestAdhocCountersign as he, requestAdhocPreApproval as ge, resolveMemberProfiles as _e, resubmitApprovalInstance as ve, searchMembers as ye, uploadAttachment as be } from "@rytass/bpm-core-client/workflow";
|
|
11
11
|
import xe from "@mezzanine-ui/react/ContentHeader";
|
|
12
|
-
import { CheckedIcon as Se, ChevronLeftIcon as
|
|
13
|
-
import { focusFormRendererField as
|
|
14
|
-
import { Background as
|
|
15
|
-
import * as
|
|
16
|
-
import { Document as
|
|
12
|
+
import { CheckedIcon as Se, ChevronLeftIcon as Ce, ChevronRightIcon as E, DangerousOutlineIcon as we, DownloadIcon as Te, FileSearchIcon as D, NotificationUnreadIcon as Ee, PlusIcon as De, RefreshCcwIcon as Oe, ShareIcon as ke, UserIcon as Ae, ZoomInIcon as je, ZoomOutIcon as Me } from "@mezzanine-ui/icons";
|
|
13
|
+
import { focusFormRendererField as Ne, readFormDataSourceErrorMessage as Pe, validateFormRendererValues as Fe } from "@rytass/bpm-core-client/form";
|
|
14
|
+
import { Background as Ie, Controls as Le, Handle as Re, Position as O, ReactFlow as ze } from "@xyflow/react";
|
|
15
|
+
import * as Be from "dagre";
|
|
16
|
+
import { Document as k, Page as Ve } from "react-pdf";
|
|
17
17
|
import { stepClasses as A } from "@mezzanine-ui/core/stepper";
|
|
18
18
|
var j = {
|
|
19
19
|
root: "bpm_root_ehm7w",
|
|
@@ -24,26 +24,26 @@ var j = {
|
|
|
24
24
|
viewport: "bpm_viewport_DQXms",
|
|
25
25
|
page: "bpm_page_Cv5Rg",
|
|
26
26
|
state: "bpm_state_bpgp3"
|
|
27
|
-
}, M = 760,
|
|
28
|
-
function
|
|
29
|
-
let r =
|
|
30
|
-
|
|
27
|
+
}, M = 760, N = 920, P = 320, He = 32, F = .75, Ue = 1.75, I = .25;
|
|
28
|
+
function We({ filename: e, fileUrl: t, onDownload: n }) {
|
|
29
|
+
let r = d(null), [i, a] = f(null), [o, l] = f(1), [p, ee] = f(1), [h, te] = f(M);
|
|
30
|
+
c(() => {
|
|
31
31
|
let e = r.current;
|
|
32
32
|
if (!e || typeof ResizeObserver > "u") return;
|
|
33
33
|
let t = new ResizeObserver((e) => {
|
|
34
34
|
let t = e[0]?.contentRect.width;
|
|
35
|
-
t &&
|
|
35
|
+
t && te(t);
|
|
36
36
|
});
|
|
37
37
|
return t.observe(e), () => t.disconnect();
|
|
38
|
-
}, []),
|
|
39
|
-
a(null),
|
|
38
|
+
}, []), c(() => {
|
|
39
|
+
a(null), l(1), ee(1);
|
|
40
40
|
}, [t]);
|
|
41
|
-
let
|
|
42
|
-
let e = Math.max(
|
|
43
|
-
return Math.round(Math.min(
|
|
44
|
-
}, [
|
|
45
|
-
a(e.numPages),
|
|
46
|
-
}, []),
|
|
41
|
+
let g = u(() => {
|
|
42
|
+
let e = Math.max(P, h - He);
|
|
43
|
+
return Math.round(Math.min(N, e) * p);
|
|
44
|
+
}, [p, h]), _ = s((e) => {
|
|
45
|
+
a(e.numPages), l(1);
|
|
46
|
+
}, []), ne = o > 1, v = i !== null && o < i, re = p > F, y = p < Ue, b = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, S = `${Math.round(p * 100)}%`;
|
|
47
47
|
return /* @__PURE__ */ w("section", {
|
|
48
48
|
"aria-label": `${e} PDF 預覽`,
|
|
49
49
|
className: j.root,
|
|
@@ -54,12 +54,12 @@ function P({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
54
54
|
className: j.pageControls,
|
|
55
55
|
"aria-label": "頁面切換",
|
|
56
56
|
children: [
|
|
57
|
-
/* @__PURE__ */ C(
|
|
57
|
+
/* @__PURE__ */ C(m, {
|
|
58
58
|
"aria-label": "上一頁",
|
|
59
|
-
disabled: !
|
|
60
|
-
icon:
|
|
59
|
+
disabled: !ne,
|
|
60
|
+
icon: Ce,
|
|
61
61
|
onClick: () => {
|
|
62
|
-
|
|
62
|
+
l((e) => Math.max(1, e - 1));
|
|
63
63
|
},
|
|
64
64
|
size: "minor",
|
|
65
65
|
variant: "base-secondary"
|
|
@@ -68,14 +68,14 @@ function P({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
68
68
|
className: j.counter,
|
|
69
69
|
component: "span",
|
|
70
70
|
variant: "body",
|
|
71
|
-
children:
|
|
71
|
+
children: b
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */ C(
|
|
73
|
+
/* @__PURE__ */ C(m, {
|
|
74
74
|
"aria-label": "下一頁",
|
|
75
|
-
disabled: !
|
|
75
|
+
disabled: !v,
|
|
76
76
|
icon: E,
|
|
77
77
|
onClick: () => {
|
|
78
|
-
|
|
78
|
+
l((e) => i === null ? e : Math.min(i, e + 1));
|
|
79
79
|
},
|
|
80
80
|
size: "minor",
|
|
81
81
|
variant: "base-secondary"
|
|
@@ -86,12 +86,12 @@ function P({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
86
86
|
className: j.zoomControls,
|
|
87
87
|
"aria-label": "縮放",
|
|
88
88
|
children: [
|
|
89
|
-
/* @__PURE__ */ C(
|
|
89
|
+
/* @__PURE__ */ C(m, {
|
|
90
90
|
"aria-label": "縮小",
|
|
91
|
-
disabled: !
|
|
92
|
-
icon:
|
|
91
|
+
disabled: !re,
|
|
92
|
+
icon: Me,
|
|
93
93
|
onClick: () => {
|
|
94
|
-
|
|
94
|
+
ee((e) => Math.max(F, e - I));
|
|
95
95
|
},
|
|
96
96
|
size: "minor",
|
|
97
97
|
variant: "base-secondary"
|
|
@@ -100,22 +100,22 @@ function P({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
100
100
|
className: j.counter,
|
|
101
101
|
component: "span",
|
|
102
102
|
variant: "body",
|
|
103
|
-
children:
|
|
103
|
+
children: S
|
|
104
104
|
}),
|
|
105
|
-
/* @__PURE__ */ C(
|
|
105
|
+
/* @__PURE__ */ C(m, {
|
|
106
106
|
"aria-label": "放大",
|
|
107
|
-
disabled: !
|
|
108
|
-
icon:
|
|
107
|
+
disabled: !y,
|
|
108
|
+
icon: je,
|
|
109
109
|
onClick: () => {
|
|
110
|
-
|
|
110
|
+
ee((e) => Math.min(Ue, e + I));
|
|
111
111
|
},
|
|
112
112
|
size: "minor",
|
|
113
113
|
variant: "base-secondary"
|
|
114
114
|
})
|
|
115
115
|
]
|
|
116
116
|
}),
|
|
117
|
-
n ? /* @__PURE__ */ C(
|
|
118
|
-
icon:
|
|
117
|
+
n ? /* @__PURE__ */ C(m, {
|
|
118
|
+
icon: Te,
|
|
119
119
|
iconType: "leading",
|
|
120
120
|
onClick: n,
|
|
121
121
|
size: "minor",
|
|
@@ -126,25 +126,25 @@ function P({ filename: e, fileUrl: t, onDownload: n }) {
|
|
|
126
126
|
}), /* @__PURE__ */ C("div", {
|
|
127
127
|
className: j.viewport,
|
|
128
128
|
ref: r,
|
|
129
|
-
children: /* @__PURE__ */ C(
|
|
130
|
-
error: /* @__PURE__ */ C(
|
|
129
|
+
children: /* @__PURE__ */ C(k, {
|
|
130
|
+
error: /* @__PURE__ */ C(L, { message: "PDF 無法載入。" }),
|
|
131
131
|
file: t,
|
|
132
|
-
loading: /* @__PURE__ */ C(
|
|
133
|
-
noData: /* @__PURE__ */ C(
|
|
134
|
-
onLoadSuccess:
|
|
135
|
-
children: /* @__PURE__ */ C(
|
|
132
|
+
loading: /* @__PURE__ */ C(L, { message: "正在載入 PDF..." }),
|
|
133
|
+
noData: /* @__PURE__ */ C(L, { message: "沒有可預覽的 PDF。" }),
|
|
134
|
+
onLoadSuccess: _,
|
|
135
|
+
children: /* @__PURE__ */ C(Ve, {
|
|
136
136
|
className: j.page,
|
|
137
|
-
loading: /* @__PURE__ */ C(
|
|
138
|
-
pageNumber:
|
|
137
|
+
loading: /* @__PURE__ */ C(L, { message: "正在載入頁面..." }),
|
|
138
|
+
pageNumber: o,
|
|
139
139
|
renderAnnotationLayer: !0,
|
|
140
140
|
renderTextLayer: !0,
|
|
141
|
-
width:
|
|
141
|
+
width: g
|
|
142
142
|
})
|
|
143
143
|
})
|
|
144
144
|
})]
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function L({ message: e }) {
|
|
148
148
|
return /* @__PURE__ */ C("div", {
|
|
149
149
|
className: j.state,
|
|
150
150
|
children: /* @__PURE__ */ C(x, {
|
|
@@ -156,77 +156,77 @@ function F({ message: e }) {
|
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/views/instances/detail/sections/shared.ts
|
|
159
|
-
function
|
|
160
|
-
let t =
|
|
159
|
+
function R(e) {
|
|
160
|
+
let t = B(e, "from"), n = B(e, "to"), r = B(e, "reason");
|
|
161
161
|
return !t || !n || !r ? null : {
|
|
162
162
|
from: t,
|
|
163
163
|
reason: r,
|
|
164
|
-
ruleId:
|
|
164
|
+
ruleId: B(e, "ruleId"),
|
|
165
165
|
to: n
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function z(e) {
|
|
169
169
|
try {
|
|
170
170
|
let t = JSON.parse(e);
|
|
171
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
171
|
+
return Array.isArray(t) ? t.map((e) => W(e) ? R(e) : null).filter((e) => e !== null) : [];
|
|
172
172
|
} catch {
|
|
173
173
|
return [];
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function B(e, t) {
|
|
177
177
|
let n = e[t];
|
|
178
178
|
return typeof n == "string" ? n : null;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function V(e, t) {
|
|
181
181
|
let n = e[t];
|
|
182
182
|
return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function H(e, t) {
|
|
185
185
|
let n = e[t];
|
|
186
186
|
return typeof n == "number" ? n : null;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function U(e) {
|
|
189
189
|
return typeof e == "string" && e.trim().length > 0;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function W(e) {
|
|
192
192
|
return typeof e == "object" && !!e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Ge(e) {
|
|
195
195
|
return e.status === "PENDING" || e.status === "IN_PROGRESS";
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
197
|
+
function G(e) {
|
|
198
|
+
return Pe(e) || (e instanceof Error ? e.message : "發生未知錯誤");
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Ke(e) {
|
|
201
201
|
return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function qe(e) {
|
|
204
204
|
return e.length > 16 ? `${e.slice(0, 12)}...` : e;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Je(e) {
|
|
207
207
|
return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function K(e) {
|
|
210
210
|
return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
|
|
211
211
|
}
|
|
212
212
|
function Ye(e) {
|
|
213
213
|
return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function q(e) {
|
|
216
216
|
return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function J(e, t) {
|
|
219
219
|
return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function Y(e, t) {
|
|
222
222
|
if (!e) return "-";
|
|
223
223
|
let n = t.get(e);
|
|
224
224
|
return n ? `${n.name}(${n.email})` : e;
|
|
225
225
|
}
|
|
226
226
|
function Xe(e, t = /* @__PURE__ */ new Map()) {
|
|
227
|
-
let n =
|
|
228
|
-
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) =>
|
|
229
|
-
let r =
|
|
227
|
+
let n = z(e.delegationChainJson);
|
|
228
|
+
if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => Y(e, t)).join("、")}` : "未指定";
|
|
229
|
+
let r = Y(e.assigneeMemberId, t), i = Y(e.originalAssigneeMemberId, t);
|
|
230
230
|
return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
|
|
231
231
|
}
|
|
232
232
|
function Ze(e, t) {
|
|
@@ -236,12 +236,12 @@ function Qe(e, t) {
|
|
|
236
236
|
if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
|
|
237
237
|
if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
|
|
238
238
|
id: e.id,
|
|
239
|
-
name: `${e.data.label}(${
|
|
239
|
+
name: `${e.data.label}(${q(e.type)})`
|
|
240
240
|
}));
|
|
241
241
|
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);
|
|
242
242
|
return r ? [{
|
|
243
243
|
id: r.id,
|
|
244
|
-
name: `${r.data.label}(${
|
|
244
|
+
name: `${r.data.label}(${q(r.type)})`
|
|
245
245
|
}] : [];
|
|
246
246
|
}
|
|
247
247
|
function $e(e) {
|
|
@@ -251,8 +251,8 @@ function $e(e) {
|
|
|
251
251
|
name: `${e.name} · ${e.email}`
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
if (!
|
|
254
|
+
function et(e) {
|
|
255
|
+
if (!W(e)) return null;
|
|
256
256
|
let t = e.email, n = e.id, r = e.name;
|
|
257
257
|
return typeof n == "string" && typeof r == "string" ? {
|
|
258
258
|
email: typeof t == "string" ? t : null,
|
|
@@ -260,7 +260,7 @@ function J(e) {
|
|
|
260
260
|
name: r
|
|
261
261
|
} : null;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function tt(e, t) {
|
|
264
264
|
let n = e.trim().toLocaleLowerCase();
|
|
265
265
|
if (!n) return null;
|
|
266
266
|
let r = t.filter((e) => [
|
|
@@ -270,19 +270,19 @@ function et(e, t) {
|
|
|
270
270
|
].some((e) => e.toLocaleLowerCase().includes(n)));
|
|
271
271
|
return r.length === 1 ? r[0] ?? null : null;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
273
|
+
function X(e) {
|
|
274
|
+
return U(e) ? {
|
|
275
275
|
text: e,
|
|
276
276
|
type: "text"
|
|
277
277
|
} : null;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
279
|
+
function nt(e) {
|
|
280
|
+
return U(e) ? {
|
|
281
281
|
text: e,
|
|
282
282
|
type: "dangerText"
|
|
283
283
|
} : null;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function rt(e, t, n, r) {
|
|
286
286
|
let i = t ? n.get(t) : null;
|
|
287
287
|
return {
|
|
288
288
|
email: i?.email ?? null,
|
|
@@ -295,153 +295,154 @@ function X(e, t, n, r) {
|
|
|
295
295
|
function Z(e) {
|
|
296
296
|
return !!e;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function it(e) {
|
|
299
299
|
let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
|
|
300
300
|
return t === -1 ? e.length : t;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function at(e) {
|
|
303
303
|
return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED";
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function ot(e) {
|
|
306
306
|
return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ?
|
|
308
|
+
function st(e, t) {
|
|
309
|
+
return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? ot(B(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function ct(e) {
|
|
312
312
|
try {
|
|
313
313
|
let t = JSON.parse(e.payloadJson);
|
|
314
|
-
return
|
|
314
|
+
return W(t) ? t : {};
|
|
315
315
|
} catch {
|
|
316
316
|
return {};
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return e.eventType === "SLA_TRIGGERED" ||
|
|
319
|
+
function lt(e, t) {
|
|
320
|
+
return e.eventType === "SLA_TRIGGERED" || B(t, "action") === "REJECTED" || B(t, "instanceState") === "REJECTED";
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function ut(e) {
|
|
323
323
|
return t(e);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function dt(e, t, n, r) {
|
|
326
326
|
if (e.eventType === "TASK_CREATED") {
|
|
327
|
-
let e =
|
|
327
|
+
let e = B(t, "assigneeMemberId"), n = B(t, "originalAssigneeMemberId");
|
|
328
328
|
if (!e) {
|
|
329
|
-
let e =
|
|
330
|
-
return e.length ? `候選簽核人:${e.map((e) =>
|
|
329
|
+
let e = V(t, "candidateMemberIds");
|
|
330
|
+
return e.length ? `候選簽核人:${e.map((e) => Y(e, r)).join("、")}` : null;
|
|
331
331
|
}
|
|
332
|
-
let i =
|
|
332
|
+
let i = Y(e, r), a = Y(n, r);
|
|
333
333
|
return n && n !== e ? `待簽人:${i}(原簽核人:${a})` : `待簽人:${i}`;
|
|
334
334
|
}
|
|
335
335
|
if (e.eventType === "TASK_DECIDED") {
|
|
336
|
-
let e =
|
|
337
|
-
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(
|
|
336
|
+
let e = B(t, "action"), n = B(t, "comment"), i = e ? `決議:${Ye(e)}` : null, a = B(t, "transferToMemberId");
|
|
337
|
+
return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(U).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(U).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${Y(a, r)}`].filter(U).join(" · ") : i;
|
|
338
338
|
}
|
|
339
339
|
if (e.eventType === "TOKEN_ADVANCED") {
|
|
340
|
-
let e =
|
|
340
|
+
let e = B(t, "action");
|
|
341
341
|
if (e) return `流程結果:${Ye(e)}`;
|
|
342
|
-
let r =
|
|
342
|
+
let r = H(t, "arrivedCount"), i = H(t, "requiredCount");
|
|
343
343
|
if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
|
|
344
|
-
let a =
|
|
345
|
-
if (a && o) return `由 ${
|
|
344
|
+
let a = B(t, "fromNodeId"), o = B(t, "toNodeId");
|
|
345
|
+
if (a && o) return `由 ${J(a, n)} 前進至 ${J(o, n)}`;
|
|
346
346
|
}
|
|
347
347
|
if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
|
|
348
|
-
let e =
|
|
349
|
-
return e ? `案件狀態:${
|
|
348
|
+
let e = B(t, "state");
|
|
349
|
+
return e ? `案件狀態:${Je(e)}` : null;
|
|
350
350
|
}
|
|
351
351
|
return null;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
if (e.eventType !== "TASK_DECIDED") return [
|
|
355
|
-
let s = e.taskId ? r.get(e.taskId) : null, c =
|
|
353
|
+
function ft(e, t, n, r, i, a, o) {
|
|
354
|
+
if (e.eventType !== "TASK_DECIDED") return [X(dt(e, t, n, o))].filter(Z);
|
|
355
|
+
let s = e.taskId ? r.get(e.taskId) : null, c = B(t, "action") ?? s?.action ?? null, l = B(t, "comment") ?? s?.comment ?? null, u = B(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = B(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
|
|
356
356
|
return [
|
|
357
|
-
|
|
358
|
-
c === "REJECTED" ?
|
|
359
|
-
c === "
|
|
360
|
-
c === "
|
|
361
|
-
c === "TRANSFERRED" ? Y(
|
|
362
|
-
|
|
357
|
+
X(c ? `決議:${Ye(c)}` : null),
|
|
358
|
+
c === "REJECTED" ? nt(`拒絕原因:${l ?? "-"}`) : null,
|
|
359
|
+
c === "APPROVED" && l ? X(`同意說明:${l}`) : null,
|
|
360
|
+
c === "RETURNED" ? X(`退回說明:${l ?? "-"}`) : null,
|
|
361
|
+
c === "TRANSFERRED" ? X(`轉派給:${Y(u, o)}`) : null,
|
|
362
|
+
c === "TRANSFERRED" ? X(`轉派說明:${l ?? "-"}`) : null,
|
|
363
|
+
f ? X(a?.valid ? `簽章:已驗證(${qe(f.signedPayloadHash)})` : `簽章:待檢查(${qe(f.signedPayloadHash)})`) : null
|
|
363
364
|
].filter(Z);
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
+
function pt(e, t, n, r, i) {
|
|
366
367
|
if (e.type === "startEvent" || i.has(e.id)) return !1;
|
|
367
368
|
if (r === "REJECTED") return !0;
|
|
368
|
-
let a =
|
|
369
|
+
let a = bt(e, t, n, r);
|
|
369
370
|
return a.tone === "neutral" || a.tone === "waiting";
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
+
function Q(e, t, n, r, i) {
|
|
372
373
|
if (r !== "RUNNING" && r !== "REJECTED") return [];
|
|
373
|
-
let a = e.nodes.filter((e) =>
|
|
374
|
+
let a = e.nodes.filter((e) => pt(e, t, n, r, i)), o = mt(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
|
|
374
375
|
return a.filter((e) => o.has(e.id)).sort((e, t) => {
|
|
375
376
|
let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
|
|
376
377
|
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;
|
|
377
378
|
});
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
+
function mt(e, t, n, r, i) {
|
|
380
381
|
let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
|
|
381
382
|
let n = [...e.get(t.source) ?? [], t.target];
|
|
382
383
|
return new Map(e).set(t.source, n);
|
|
383
384
|
}, /* @__PURE__ */ new Map());
|
|
384
|
-
return
|
|
385
|
+
return ht(e, n, r, i).reduce((e, t) => vt(e, gt(t, o, a)), /* @__PURE__ */ new Map());
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
-
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(
|
|
387
|
+
function ht(e, t, n, r) {
|
|
388
|
+
let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(Ge).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [...new Set([
|
|
388
389
|
...i,
|
|
389
390
|
...a,
|
|
390
391
|
...o
|
|
391
392
|
])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
|
|
392
393
|
return s.length > 0 ? s : c;
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
-
return
|
|
395
|
+
function gt(e, t, n) {
|
|
396
|
+
return _t([{
|
|
396
397
|
distance: 0,
|
|
397
398
|
nodeId: e
|
|
398
399
|
}], t, n);
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function _t(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
|
|
401
402
|
let [a, ...o] = e;
|
|
402
403
|
if (!a) return i;
|
|
403
|
-
if (r.has(a.nodeId)) return
|
|
404
|
+
if (r.has(a.nodeId)) return _t(o, t, n, r, i);
|
|
404
405
|
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;
|
|
405
|
-
return
|
|
406
|
+
return _t([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
|
|
406
407
|
distance: a.distance + 1,
|
|
407
408
|
nodeId: e
|
|
408
409
|
}))], t, n, s, c);
|
|
409
410
|
}
|
|
410
|
-
function
|
|
411
|
+
function vt(e, t) {
|
|
411
412
|
return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
|
|
412
413
|
}
|
|
413
|
-
function
|
|
414
|
+
function yt(e) {
|
|
414
415
|
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}`;
|
|
415
416
|
}
|
|
416
|
-
function
|
|
417
|
-
let l = e.filter(
|
|
418
|
-
let t =
|
|
417
|
+
function $(e, t, n, r, i, a, o, s, c) {
|
|
418
|
+
let l = e.filter(at).map((e) => {
|
|
419
|
+
let t = ct(e), n = e.nodeId ? J(e.nodeId, r) : null;
|
|
419
420
|
return {
|
|
420
421
|
descriptionParts: [
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
...
|
|
422
|
+
X(n ? `節點:${n}` : "節點:全流程"),
|
|
423
|
+
rt("操作者", e.actorMemberId, a, "系統"),
|
|
424
|
+
X(`時間:${ut(e.createdAt)}`),
|
|
425
|
+
...ft(e, t, r, o, s, c, a)
|
|
425
426
|
].filter(Z),
|
|
426
|
-
error:
|
|
427
|
+
error: lt(e, t),
|
|
427
428
|
id: e.id,
|
|
428
|
-
title:
|
|
429
|
+
title: st(e.eventType, t)
|
|
429
430
|
};
|
|
430
|
-
}), u = t.filter(
|
|
431
|
+
}), u = t.filter(Ge).map((e) => ({
|
|
431
432
|
descriptionParts: [
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
X(`節點:${J(e.nodeId, r)}`),
|
|
434
|
+
rt("處理者", e.assigneeMemberId, a, "未指定"),
|
|
435
|
+
X(`建立時間:${ut(e.createdAt)}`)
|
|
435
436
|
].filter(Z),
|
|
436
437
|
error: !1,
|
|
437
438
|
id: `pending-task-${e.id}`,
|
|
438
439
|
title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
|
|
439
|
-
})), d = new Set([...e.filter(
|
|
440
|
-
descriptionParts: [
|
|
440
|
+
})), d = new Set([...e.filter(at).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(U)), f = r ? Q(r, t, n, i, d).map((e) => ({
|
|
441
|
+
descriptionParts: [X(`${q(e.type)} · 尚未抵達`)].filter(Z),
|
|
441
442
|
error: !1,
|
|
442
443
|
forcePending: !0,
|
|
443
444
|
id: `future-node-${e.id}`,
|
|
444
|
-
title:
|
|
445
|
+
title: yt(e)
|
|
445
446
|
})) : [];
|
|
446
447
|
return [
|
|
447
448
|
...l,
|
|
@@ -449,7 +450,7 @@ function _t(e, t, n, r, i, a, o, s, c) {
|
|
|
449
450
|
...f
|
|
450
451
|
];
|
|
451
452
|
}
|
|
452
|
-
function
|
|
453
|
+
function bt(e, t, n, r) {
|
|
453
454
|
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");
|
|
454
455
|
return a ? {
|
|
455
456
|
secondaryLabel: `處理者 ${Xe(a)}`,
|
|
@@ -480,39 +481,39 @@ function vt(e, t, n, r) {
|
|
|
480
481
|
statusLabel: r === "REJECTED" ? "已拒絕" : "已完成",
|
|
481
482
|
tone: r === "REJECTED" ? "cancelled" : "completed"
|
|
482
483
|
} : {
|
|
483
|
-
secondaryLabel:
|
|
484
|
+
secondaryLabel: q(e.type),
|
|
484
485
|
statusLabel: "未抵達",
|
|
485
486
|
tone: "neutral"
|
|
486
487
|
};
|
|
487
488
|
}
|
|
488
489
|
//#endregion
|
|
489
490
|
//#region src/views/instances/detail/sections/container-helpers.ts
|
|
490
|
-
async function
|
|
491
|
+
async function xt({ activityLogs: e, adhocDirectives: t = [], tasks: n }) {
|
|
491
492
|
let r = [...new Set([
|
|
492
493
|
...e.map((e) => e.actorMemberId),
|
|
493
494
|
...n.map((e) => e.assigneeMemberId),
|
|
494
495
|
...n.map((e) => e.originalAssigneeMemberId),
|
|
495
496
|
...n.flatMap((e) => e.candidateMemberIds),
|
|
496
|
-
...n.flatMap((e) =>
|
|
497
|
-
...t.flatMap((e) => [e.createdByMemberId, ...
|
|
498
|
-
].filter(
|
|
497
|
+
...n.flatMap((e) => z(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
|
|
498
|
+
...t.flatMap((e) => [e.createdByMemberId, ...St(e.targetValueJson)])
|
|
499
|
+
].filter(U))];
|
|
499
500
|
try {
|
|
500
501
|
return await _e(r);
|
|
501
502
|
} catch {
|
|
502
503
|
return [];
|
|
503
504
|
}
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
+
function St(e) {
|
|
506
507
|
try {
|
|
507
508
|
return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
|
|
508
509
|
} catch {
|
|
509
510
|
return [];
|
|
510
511
|
}
|
|
511
512
|
}
|
|
512
|
-
async function
|
|
513
|
+
async function Ct(e) {
|
|
513
514
|
return (await Promise.all(e.map((e) => ue(e.id)))).flat();
|
|
514
515
|
}
|
|
515
|
-
function
|
|
516
|
+
function wt(e) {
|
|
516
517
|
return e.reduce((e, t) => {
|
|
517
518
|
let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
|
|
518
519
|
return new Map(e).set(t.taskId, r);
|
|
@@ -520,17 +521,17 @@ function St(e) {
|
|
|
520
521
|
}
|
|
521
522
|
//#endregion
|
|
522
523
|
//#region src/views/instances/detail/sections/InstanceFormSection.tsx
|
|
523
|
-
var
|
|
524
|
+
var Tt = {
|
|
524
525
|
display: "grid",
|
|
525
526
|
gap: 16
|
|
526
|
-
},
|
|
527
|
+
}, Et = {
|
|
527
528
|
display: "flex",
|
|
528
529
|
flexWrap: "wrap",
|
|
529
530
|
gap: 8
|
|
530
531
|
};
|
|
531
|
-
function
|
|
532
|
+
function Dt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loading: a, onDataSourceStateChange: o, onResubmitFormChange: s, onResubmitInstance: c, onUploadAttachment: l, resubmitFormData: u, resubmitFormErrors: d }) {
|
|
532
533
|
return /* @__PURE__ */ w("div", {
|
|
533
|
-
style:
|
|
534
|
+
style: Tt,
|
|
534
535
|
children: [
|
|
535
536
|
n ? /* @__PURE__ */ C(x, {
|
|
536
537
|
color: "text-error",
|
|
@@ -542,23 +543,31 @@ function Tt({ canResubmitInstance: e, deciding: t, error: n, instance: i, loadin
|
|
|
542
543
|
variant: "body",
|
|
543
544
|
children: "載入中..."
|
|
544
545
|
}) : null,
|
|
545
|
-
|
|
546
|
-
|
|
546
|
+
r?.formDefinitionSnapshot.schema && r.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(i, {
|
|
547
|
+
dataSourceContext: e ? {
|
|
548
|
+
instanceId: r.id,
|
|
549
|
+
kind: "runtime",
|
|
550
|
+
templateId: r.templateId
|
|
551
|
+
} : void 0,
|
|
552
|
+
dataSourceInitialValues: r.formData,
|
|
553
|
+
errors: d,
|
|
547
554
|
onChange: (e) => {
|
|
548
|
-
|
|
555
|
+
s(e);
|
|
549
556
|
},
|
|
550
|
-
|
|
557
|
+
onDataSourceStateChange: o,
|
|
558
|
+
onUploadAttachment: e ? l : void 0,
|
|
559
|
+
optionSnapshots: r.formDataOptionSnapshot,
|
|
551
560
|
readonly: !e,
|
|
552
|
-
schema:
|
|
553
|
-
uiSchema:
|
|
554
|
-
value: e ?
|
|
561
|
+
schema: r.formDefinitionSnapshot.schema,
|
|
562
|
+
uiSchema: r.formDefinitionSnapshot.uiSchema,
|
|
563
|
+
value: e ? u : r.formData
|
|
555
564
|
}), e ? /* @__PURE__ */ C("div", {
|
|
556
|
-
style:
|
|
557
|
-
children: /* @__PURE__ */ C(
|
|
565
|
+
style: Et,
|
|
566
|
+
children: /* @__PURE__ */ C(m, {
|
|
558
567
|
disabled: t,
|
|
559
|
-
icon:
|
|
568
|
+
icon: Oe,
|
|
560
569
|
iconType: "leading",
|
|
561
|
-
onClick:
|
|
570
|
+
onClick: c,
|
|
562
571
|
variant: "base-primary",
|
|
563
572
|
children: "重新送出"
|
|
564
573
|
})
|
|
@@ -572,20 +581,20 @@ function Tt({ canResubmitInstance: e, deciding: t, error: n, instance: i, loadin
|
|
|
572
581
|
}
|
|
573
582
|
//#endregion
|
|
574
583
|
//#region src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
|
|
575
|
-
var
|
|
584
|
+
var Ot = {
|
|
576
585
|
display: "grid",
|
|
577
586
|
gap: 16
|
|
578
587
|
};
|
|
579
|
-
function
|
|
580
|
-
let i =
|
|
588
|
+
function kt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
589
|
+
let i = u(() => e.map((e) => ({
|
|
581
590
|
attachment: e,
|
|
582
591
|
createdAt: e.createdAt,
|
|
583
592
|
filename: e.filename,
|
|
584
593
|
id: e.id,
|
|
585
594
|
key: e.id,
|
|
586
595
|
mimeType: e.mimeType,
|
|
587
|
-
sizeLabel:
|
|
588
|
-
})), [e]), a =
|
|
596
|
+
sizeLabel: Ke(Number(e.sizeBytes))
|
|
597
|
+
})), [e]), a = u(() => [
|
|
589
598
|
{
|
|
590
599
|
dataIndex: "filename",
|
|
591
600
|
key: "filename",
|
|
@@ -614,16 +623,16 @@ function Dt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
614
623
|
title: "上傳時間",
|
|
615
624
|
width: 220
|
|
616
625
|
}
|
|
617
|
-
], []), o =
|
|
626
|
+
], []), o = u(() => ({
|
|
618
627
|
render: (e) => [...e.mimeType === "application/pdf" ? [{
|
|
619
|
-
icon:
|
|
628
|
+
icon: D,
|
|
620
629
|
iconType: "leading",
|
|
621
630
|
name: "預覽",
|
|
622
631
|
onClick: () => {
|
|
623
632
|
r(e.attachment);
|
|
624
633
|
}
|
|
625
634
|
}] : [], {
|
|
626
|
-
icon:
|
|
635
|
+
icon: Te,
|
|
627
636
|
iconType: "leading",
|
|
628
637
|
name: "下載",
|
|
629
638
|
onClick: () => {
|
|
@@ -634,12 +643,12 @@ function Dt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
634
643
|
width: 160
|
|
635
644
|
}), [n, r]);
|
|
636
645
|
return /* @__PURE__ */ w("div", {
|
|
637
|
-
style:
|
|
646
|
+
style: Ot,
|
|
638
647
|
children: [/* @__PURE__ */ C(x, {
|
|
639
648
|
component: "h2",
|
|
640
649
|
variant: "h3",
|
|
641
650
|
children: "附件"
|
|
642
|
-
}), i.length > 0 ? /* @__PURE__ */ C(
|
|
651
|
+
}), i.length > 0 ? /* @__PURE__ */ C(re, {
|
|
643
652
|
actions: o,
|
|
644
653
|
columns: a,
|
|
645
654
|
dataSource: i,
|
|
@@ -653,55 +662,55 @@ function Dt({ attachments: e, onDownload: n, onPreview: r }) {
|
|
|
653
662
|
}
|
|
654
663
|
//#endregion
|
|
655
664
|
//#region src/views/instances/detail/sections/InstanceTasksSection.tsx
|
|
656
|
-
var
|
|
665
|
+
var At = {
|
|
657
666
|
display: "grid",
|
|
658
667
|
gap: 12,
|
|
659
668
|
width: "100%"
|
|
660
|
-
},
|
|
669
|
+
}, jt = {
|
|
661
670
|
minWidth: "100%",
|
|
662
671
|
width: "100%"
|
|
663
|
-
},
|
|
672
|
+
}, Mt = {
|
|
664
673
|
display: "grid",
|
|
665
674
|
gap: 12,
|
|
666
675
|
width: "100%"
|
|
667
|
-
},
|
|
668
|
-
function
|
|
676
|
+
}, Nt = { marginTop: 12 }, Pt = { marginTop: 24 };
|
|
677
|
+
function Ft(e) {
|
|
669
678
|
e && (e.style.width = "100%");
|
|
670
679
|
}
|
|
671
|
-
var
|
|
680
|
+
var It = {
|
|
672
681
|
COMPLETION_NOTIFY: "結案通知",
|
|
673
682
|
COUNTERSIGN: "臨時會簽",
|
|
674
683
|
PRE_APPROVAL: "臨時加簽",
|
|
675
684
|
STAGE_NOTIFY: "階段完成通知"
|
|
676
|
-
},
|
|
685
|
+
}, Lt = {
|
|
677
686
|
COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
|
|
678
687
|
COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
|
|
679
688
|
PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
|
|
680
689
|
STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
|
|
681
|
-
},
|
|
690
|
+
}, Rt = [{
|
|
682
691
|
id: "REJECT_INSTANCE",
|
|
683
692
|
name: "加簽拒絕時整單駁回"
|
|
684
693
|
}, {
|
|
685
694
|
id: "RETURN_TO_ORIGIN",
|
|
686
695
|
name: "加簽拒絕時退回給我重新處理"
|
|
687
|
-
}],
|
|
696
|
+
}], zt = [{
|
|
688
697
|
id: "MEMBER",
|
|
689
698
|
name: "指定成員"
|
|
690
699
|
}, {
|
|
691
700
|
id: "WEBHOOK",
|
|
692
701
|
name: "Webhook"
|
|
693
|
-
}],
|
|
694
|
-
let [
|
|
702
|
+
}], Bt = o(function({ adhocDirectives: e, currentMemberId: r, instance: i, memberProfilesById: a, onChanged: o, tasks: s }, c) {
|
|
703
|
+
let [d, te] = f(!1), [g, _] = f(null), [v, b] = f(""), [ie, ce] = f(!1), [le, ue] = f(""), [de, fe] = f(null), [pe, me] = f(!1), [_e, ve] = f(""), [be, xe] = f(!1), [Se, Ce] = f(null), [E, we] = f(""), [Te, D] = f(null), [Ee, De] = f(!1), [Oe, ke] = f([]), [Ae, je] = f(!1), [Me, Ne] = f(""), [Pe, Fe] = f(null), [Ie, Le] = f(!1), [Re, O] = f([]), [ze, Be] = f(!1), [k, Ve] = f("COUNTERSIGN"), [A, j] = f("REJECT_INSTANCE"), [M, N] = f(!1), [P, He] = f("MEMBER"), [F, Ue] = f(""), I = le.trim(), We = _e.trim(), L = E.trim(), R = u(() => s.find((e) => Ze(e, r) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [r, s]), z = u(() => R && i ? i.workflowSnapshot.nodes.find((e) => e.id === R.nodeId) ?? null : null, [R, i]), B = u(() => z && i ? Qe(i.workflowSnapshot, z) : [], [z, i]), V = z?.type === "userTask" && z.data.returnBehavior.allowReturn, H = z?.type === "userTask" && z.data.allowReject !== !1, U = z?.type === "userTask" && z.data.allowTransfer !== !1, W = z?.type === "userTask" && z.data.returnBehavior.requireComment === !0, Ge = z?.type === "userTask" && z.data.allowAddSigner, Ke = u(() => e.filter((e) => e.status === "PENDING"), [e]), qe = B.find((e) => e.id === Se) ?? B[0] ?? null, Je = u(() => s.map((e) => ({
|
|
695
704
|
...e,
|
|
696
705
|
assigneeLabel: Xe(e, a),
|
|
697
706
|
key: e.id,
|
|
698
|
-
nodeLabel: `${
|
|
699
|
-
statusLabel:
|
|
707
|
+
nodeLabel: `${J(e.nodeId, i?.workflowSnapshot ?? null)}${e.isAdhoc ? e.adhocType === "COUNTERSIGN" ? "(臨時會簽)" : "(臨時加簽)" : ""}`,
|
|
708
|
+
statusLabel: K(e.status)
|
|
700
709
|
})), [
|
|
701
710
|
i,
|
|
702
711
|
a,
|
|
703
712
|
s
|
|
704
|
-
]),
|
|
713
|
+
]), Ye = u(() => [
|
|
705
714
|
{
|
|
706
715
|
dataIndex: "nodeLabel",
|
|
707
716
|
key: "nodeLabel",
|
|
@@ -734,13 +743,13 @@ var Pt = {
|
|
|
734
743
|
title: "建立時間",
|
|
735
744
|
width: 220
|
|
736
745
|
}
|
|
737
|
-
], []),
|
|
746
|
+
], []), q = u(() => Ke.map((e) => ({
|
|
738
747
|
...e,
|
|
739
|
-
createdByLabel:
|
|
748
|
+
createdByLabel: Y(e.createdByMemberId, a),
|
|
740
749
|
key: e.id,
|
|
741
|
-
targetLabel:
|
|
742
|
-
typeLabel:
|
|
743
|
-
})), [a,
|
|
750
|
+
targetLabel: Vt(e, a),
|
|
751
|
+
typeLabel: It[e.type]
|
|
752
|
+
})), [a, Ke]), X = u(() => [
|
|
744
753
|
{
|
|
745
754
|
dataIndex: "typeLabel",
|
|
746
755
|
key: "typeLabel",
|
|
@@ -779,9 +788,9 @@ var Pt = {
|
|
|
779
788
|
},
|
|
780
789
|
{
|
|
781
790
|
key: "actions",
|
|
782
|
-
render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ C(
|
|
783
|
-
disabled:
|
|
784
|
-
onClick: () => void
|
|
791
|
+
render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ C(m, {
|
|
792
|
+
disabled: M,
|
|
793
|
+
onClick: () => void yt(e.id),
|
|
785
794
|
size: "minor",
|
|
786
795
|
variant: "destructive-secondary",
|
|
787
796
|
children: "撤回"
|
|
@@ -789,110 +798,131 @@ var Pt = {
|
|
|
789
798
|
title: "操作",
|
|
790
799
|
width: 100
|
|
791
800
|
}
|
|
792
|
-
], [
|
|
793
|
-
async function
|
|
794
|
-
if (!
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
} finally {
|
|
808
|
-
_(!1);
|
|
809
|
-
}
|
|
801
|
+
], [M, r]);
|
|
802
|
+
async function nt({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: i = null }) {
|
|
803
|
+
if (!r || !R || e === "REJECTED" && !H || e === "TRANSFERRED" && !U) return !1;
|
|
804
|
+
te(!0), _(null);
|
|
805
|
+
try {
|
|
806
|
+
await se({
|
|
807
|
+
action: e,
|
|
808
|
+
comment: t,
|
|
809
|
+
decidedByMemberId: r,
|
|
810
|
+
returnToNodeId: n,
|
|
811
|
+
taskId: R.id,
|
|
812
|
+
transferToMemberId: i
|
|
813
|
+
}), me(!1), xe(!1), je(!1), ue(""), ve(""), we(""), D(null), Ce(null), fe(null);
|
|
814
|
+
} catch (e) {
|
|
815
|
+
return _(G(e)), te(!1), !1;
|
|
810
816
|
}
|
|
817
|
+
try {
|
|
818
|
+
await o();
|
|
819
|
+
} catch (e) {
|
|
820
|
+
_(G(e));
|
|
821
|
+
} finally {
|
|
822
|
+
te(!1);
|
|
823
|
+
}
|
|
824
|
+
return !0;
|
|
825
|
+
}
|
|
826
|
+
function rt() {
|
|
827
|
+
!r || !R || (_(null), b(""), ce(!0));
|
|
828
|
+
}
|
|
829
|
+
function Z() {
|
|
830
|
+
d || (ce(!1), b(""));
|
|
811
831
|
}
|
|
812
|
-
function
|
|
813
|
-
|
|
832
|
+
async function it() {
|
|
833
|
+
d || await nt({
|
|
834
|
+
action: "APPROVED",
|
|
835
|
+
comment: v.trim() || null
|
|
836
|
+
}) && (ce(!1), b(""));
|
|
814
837
|
}
|
|
815
|
-
function
|
|
816
|
-
|
|
838
|
+
function at() {
|
|
839
|
+
H && (ue(""), fe(null), me(!0));
|
|
817
840
|
}
|
|
818
|
-
function
|
|
819
|
-
|
|
841
|
+
function ot() {
|
|
842
|
+
d || (me(!1), ue(""), fe(null));
|
|
820
843
|
}
|
|
821
|
-
function
|
|
822
|
-
|
|
844
|
+
function st() {
|
|
845
|
+
ve(""), Ce(B[0]?.id ?? null), xe(!0);
|
|
823
846
|
}
|
|
824
|
-
function
|
|
825
|
-
|
|
847
|
+
function ct() {
|
|
848
|
+
d || (xe(!1), ve(""), Ce(null));
|
|
826
849
|
}
|
|
827
|
-
function
|
|
828
|
-
|
|
850
|
+
function lt() {
|
|
851
|
+
U && (we(""), D(null), je(!0), dt(""));
|
|
829
852
|
}
|
|
830
|
-
|
|
831
|
-
|
|
853
|
+
function ut() {
|
|
854
|
+
d || (je(!1), we(""), D(null));
|
|
855
|
+
}
|
|
856
|
+
async function dt(e) {
|
|
857
|
+
De(!0);
|
|
832
858
|
try {
|
|
833
|
-
|
|
859
|
+
ke((await ye(e)).filter((e) => e.memberId !== r).map($e));
|
|
834
860
|
} catch (e) {
|
|
835
|
-
|
|
861
|
+
_(G(e));
|
|
836
862
|
} finally {
|
|
837
|
-
|
|
863
|
+
De(!1);
|
|
838
864
|
}
|
|
839
865
|
}
|
|
840
|
-
async function
|
|
841
|
-
if (
|
|
842
|
-
|
|
843
|
-
|
|
866
|
+
async function ft() {
|
|
867
|
+
if (H) {
|
|
868
|
+
if (!I) {
|
|
869
|
+
fe("請輸入拒絕原因");
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
await nt({
|
|
873
|
+
action: "REJECTED",
|
|
874
|
+
comment: I
|
|
875
|
+
});
|
|
844
876
|
}
|
|
845
|
-
await W({
|
|
846
|
-
action: "REJECTED",
|
|
847
|
-
comment: N
|
|
848
|
-
});
|
|
849
877
|
}
|
|
850
|
-
async function
|
|
851
|
-
if (
|
|
852
|
-
|
|
853
|
-
|
|
878
|
+
async function pt() {
|
|
879
|
+
if (U) {
|
|
880
|
+
if (!Te) {
|
|
881
|
+
_("請選擇轉派對象");
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
await nt({
|
|
885
|
+
action: "TRANSFERRED",
|
|
886
|
+
comment: L || null,
|
|
887
|
+
transferToMemberId: Te.id
|
|
888
|
+
});
|
|
854
889
|
}
|
|
855
|
-
await W({
|
|
856
|
-
action: "TRANSFERRED",
|
|
857
|
-
comment: We || null,
|
|
858
|
-
transferToMemberId: T.id
|
|
859
|
-
});
|
|
860
890
|
}
|
|
861
|
-
async function
|
|
862
|
-
await
|
|
891
|
+
async function Q() {
|
|
892
|
+
await nt({
|
|
863
893
|
action: "RETURNED",
|
|
864
|
-
comment:
|
|
865
|
-
returnToNodeId:
|
|
894
|
+
comment: We || null,
|
|
895
|
+
returnToNodeId: qe?.id ?? null
|
|
866
896
|
});
|
|
867
897
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
898
|
+
function mt() {
|
|
899
|
+
Ne(""), Fe(null), j("REJECT_INSTANCE"), He("MEMBER"), Ue("");
|
|
870
900
|
}
|
|
871
|
-
function
|
|
872
|
-
|
|
901
|
+
function ht(e) {
|
|
902
|
+
Ve(e), mt(), Be(!0), _t("");
|
|
873
903
|
}
|
|
874
|
-
function
|
|
875
|
-
|
|
904
|
+
function gt() {
|
|
905
|
+
M || (Be(!1), mt());
|
|
876
906
|
}
|
|
877
|
-
async function
|
|
878
|
-
|
|
907
|
+
async function _t(e) {
|
|
908
|
+
Le(!0);
|
|
879
909
|
try {
|
|
880
|
-
|
|
910
|
+
O((await ye(e)).map($e));
|
|
881
911
|
} catch (e) {
|
|
882
|
-
|
|
912
|
+
_(G(e));
|
|
883
913
|
} finally {
|
|
884
|
-
|
|
914
|
+
Le(!1);
|
|
885
915
|
}
|
|
886
916
|
}
|
|
887
|
-
async function
|
|
888
|
-
if (!
|
|
889
|
-
let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") &&
|
|
917
|
+
async function vt() {
|
|
918
|
+
if (!R) return;
|
|
919
|
+
let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && P === "WEBHOOK", t = F.trim(), n = Pe;
|
|
890
920
|
if (e && !t) {
|
|
891
|
-
|
|
921
|
+
_("請輸入 Webhook URL");
|
|
892
922
|
return;
|
|
893
923
|
}
|
|
894
924
|
if (!e && !n) {
|
|
895
|
-
|
|
925
|
+
_("請選擇對象成員");
|
|
896
926
|
return;
|
|
897
927
|
}
|
|
898
928
|
let r = e || !n ? {
|
|
@@ -901,162 +931,199 @@ var Pt = {
|
|
|
901
931
|
} : {
|
|
902
932
|
kind: "MEMBER",
|
|
903
933
|
memberIds: [n.id]
|
|
904
|
-
}, i =
|
|
905
|
-
|
|
934
|
+
}, i = Me.trim() || null;
|
|
935
|
+
N(!0), _(null);
|
|
906
936
|
try {
|
|
907
937
|
k === "COUNTERSIGN" ? await he({
|
|
908
938
|
comment: i,
|
|
909
939
|
target: r,
|
|
910
|
-
taskId:
|
|
940
|
+
taskId: R.id
|
|
911
941
|
}) : k === "PRE_APPROVAL" ? await ge({
|
|
912
942
|
comment: i,
|
|
913
|
-
onReject:
|
|
943
|
+
onReject: A,
|
|
914
944
|
target: r,
|
|
915
|
-
taskId:
|
|
945
|
+
taskId: R.id
|
|
916
946
|
}) : k === "STAGE_NOTIFY" ? await oe({
|
|
917
947
|
target: r,
|
|
918
|
-
taskId:
|
|
948
|
+
taskId: R.id
|
|
919
949
|
}) : await ae({
|
|
920
950
|
target: r,
|
|
921
|
-
taskId:
|
|
922
|
-
}),
|
|
951
|
+
taskId: R.id
|
|
952
|
+
}), Be(!1), mt(), await o();
|
|
923
953
|
} catch (e) {
|
|
924
|
-
|
|
954
|
+
_(G(e));
|
|
925
955
|
} finally {
|
|
926
|
-
|
|
956
|
+
N(!1);
|
|
927
957
|
}
|
|
928
958
|
}
|
|
929
|
-
async function
|
|
930
|
-
|
|
959
|
+
async function yt(e) {
|
|
960
|
+
N(!0), _(null);
|
|
931
961
|
try {
|
|
932
|
-
await
|
|
962
|
+
await T(e), await o();
|
|
933
963
|
} catch (e) {
|
|
934
|
-
|
|
964
|
+
_(G(e));
|
|
935
965
|
} finally {
|
|
936
|
-
|
|
966
|
+
N(!1);
|
|
937
967
|
}
|
|
938
968
|
}
|
|
939
|
-
c
|
|
969
|
+
l(c, () => ({
|
|
940
970
|
canAddSignerCurrentTask: Ge,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
openRejectModal: Ye,
|
|
952
|
-
openReturnModal: Y,
|
|
953
|
-
openTransferModal: X
|
|
971
|
+
canRejectCurrentTask: H,
|
|
972
|
+
canReturnCurrentTask: V,
|
|
973
|
+
canTransferCurrentTask: U,
|
|
974
|
+
deciding: d,
|
|
975
|
+
handleApprove: rt,
|
|
976
|
+
hasCurrentTask: R !== null,
|
|
977
|
+
openAdhocModal: ht,
|
|
978
|
+
openRejectModal: at,
|
|
979
|
+
openReturnModal: st,
|
|
980
|
+
openTransferModal: lt
|
|
954
981
|
}), [
|
|
955
982
|
Ge,
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
983
|
+
H,
|
|
984
|
+
V,
|
|
985
|
+
U,
|
|
986
|
+
r,
|
|
987
|
+
R,
|
|
988
|
+
d
|
|
959
989
|
]);
|
|
960
|
-
let $ = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY",
|
|
990
|
+
let $ = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", bt = $ && P === "WEBHOOK" ? !F.trim() : !Pe, xt = Rt.find((e) => e.id === A) ?? Rt[0], St = zt.find((e) => e.id === P) ?? zt[0];
|
|
961
991
|
return /* @__PURE__ */ w(S, { children: [
|
|
962
992
|
/* @__PURE__ */ C(x, {
|
|
963
993
|
component: "h2",
|
|
964
994
|
variant: "h3",
|
|
965
995
|
children: "任務"
|
|
966
996
|
}),
|
|
967
|
-
|
|
997
|
+
g ? /* @__PURE__ */ C(x, {
|
|
968
998
|
color: "text-error",
|
|
969
999
|
variant: "body",
|
|
970
|
-
children:
|
|
1000
|
+
children: g
|
|
971
1001
|
}) : null,
|
|
972
1002
|
/* @__PURE__ */ C("div", {
|
|
973
|
-
style:
|
|
974
|
-
children: /* @__PURE__ */ C(
|
|
975
|
-
columns:
|
|
976
|
-
dataSource:
|
|
1003
|
+
style: Nt,
|
|
1004
|
+
children: /* @__PURE__ */ C(re, {
|
|
1005
|
+
columns: Ye,
|
|
1006
|
+
dataSource: Je,
|
|
977
1007
|
fullWidth: !0
|
|
978
1008
|
})
|
|
979
1009
|
}),
|
|
980
|
-
|
|
1010
|
+
Ke.length > 0 ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(x, {
|
|
981
1011
|
component: "h3",
|
|
982
|
-
style:
|
|
1012
|
+
style: Pt,
|
|
983
1013
|
variant: "h3",
|
|
984
1014
|
children: "待生效的臨時設定"
|
|
985
1015
|
}), /* @__PURE__ */ C("div", {
|
|
986
|
-
style:
|
|
987
|
-
children: /* @__PURE__ */ C(
|
|
988
|
-
columns:
|
|
989
|
-
dataSource:
|
|
1016
|
+
style: Nt,
|
|
1017
|
+
children: /* @__PURE__ */ C(re, {
|
|
1018
|
+
columns: X,
|
|
1019
|
+
dataSource: q,
|
|
990
1020
|
fullWidth: !0
|
|
991
1021
|
})
|
|
992
1022
|
})] }) : null,
|
|
1023
|
+
/* @__PURE__ */ w(h, {
|
|
1024
|
+
cancelText: "取消",
|
|
1025
|
+
confirmText: "送出同意",
|
|
1026
|
+
loading: d,
|
|
1027
|
+
modalType: "standard",
|
|
1028
|
+
onCancel: Z,
|
|
1029
|
+
onClose: Z,
|
|
1030
|
+
onConfirm: () => void it(),
|
|
1031
|
+
open: ie,
|
|
1032
|
+
showModalFooter: !0,
|
|
1033
|
+
showModalHeader: !0,
|
|
1034
|
+
size: "regular",
|
|
1035
|
+
supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
|
|
1036
|
+
title: "簽核意見",
|
|
1037
|
+
children: [g ? /* @__PURE__ */ C(x, {
|
|
1038
|
+
color: "text-error",
|
|
1039
|
+
role: "alert",
|
|
1040
|
+
variant: "body",
|
|
1041
|
+
children: g
|
|
1042
|
+
}) : null, /* @__PURE__ */ C("div", {
|
|
1043
|
+
style: At,
|
|
1044
|
+
children: /* @__PURE__ */ C(n, {
|
|
1045
|
+
label: "簽核意見",
|
|
1046
|
+
name: "approveComment",
|
|
1047
|
+
children: /* @__PURE__ */ C(y, {
|
|
1048
|
+
autoFocus: !0,
|
|
1049
|
+
onChange: (e) => b(e.target.value),
|
|
1050
|
+
placeholder: "選填,例如補充核准的條件或提醒事項",
|
|
1051
|
+
ref: Ft,
|
|
1052
|
+
resize: "vertical",
|
|
1053
|
+
rows: 4,
|
|
1054
|
+
style: jt,
|
|
1055
|
+
value: v
|
|
1056
|
+
})
|
|
1057
|
+
})
|
|
1058
|
+
})]
|
|
1059
|
+
}),
|
|
993
1060
|
/* @__PURE__ */ C(h, {
|
|
994
1061
|
cancelText: "取消",
|
|
995
1062
|
confirmButtonProps: {
|
|
996
|
-
disabled: !
|
|
1063
|
+
disabled: !I,
|
|
997
1064
|
variant: "destructive-primary"
|
|
998
1065
|
},
|
|
999
1066
|
confirmText: "送出拒絕",
|
|
1000
|
-
loading:
|
|
1067
|
+
loading: d,
|
|
1001
1068
|
modalStatusType: "error",
|
|
1002
1069
|
modalType: "standard",
|
|
1003
|
-
onCancel:
|
|
1004
|
-
onClose:
|
|
1005
|
-
onConfirm: () => void
|
|
1006
|
-
open:
|
|
1070
|
+
onCancel: ot,
|
|
1071
|
+
onClose: ot,
|
|
1072
|
+
onConfirm: () => void ft(),
|
|
1073
|
+
open: pe,
|
|
1007
1074
|
showModalFooter: !0,
|
|
1008
1075
|
showModalHeader: !0,
|
|
1009
1076
|
size: "regular",
|
|
1010
1077
|
supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
|
|
1011
1078
|
title: "拒絕原因",
|
|
1012
1079
|
children: /* @__PURE__ */ w("div", {
|
|
1013
|
-
style:
|
|
1080
|
+
style: At,
|
|
1014
1081
|
children: [/* @__PURE__ */ C(n, {
|
|
1015
1082
|
label: "拒絕原因",
|
|
1016
1083
|
name: "rejectReason",
|
|
1017
1084
|
required: !0,
|
|
1018
|
-
children: /* @__PURE__ */ C(
|
|
1085
|
+
children: /* @__PURE__ */ C(y, {
|
|
1019
1086
|
autoFocus: !0,
|
|
1020
1087
|
onChange: (e) => {
|
|
1021
|
-
|
|
1088
|
+
ue(e.target.value), fe(null);
|
|
1022
1089
|
},
|
|
1023
1090
|
placeholder: "請說明拒絕原因",
|
|
1024
|
-
ref:
|
|
1091
|
+
ref: Ft,
|
|
1025
1092
|
resize: "vertical",
|
|
1026
1093
|
rows: 4,
|
|
1027
|
-
style:
|
|
1028
|
-
type:
|
|
1029
|
-
value:
|
|
1094
|
+
style: jt,
|
|
1095
|
+
type: de ? "error" : "default",
|
|
1096
|
+
value: le
|
|
1030
1097
|
})
|
|
1031
|
-
}),
|
|
1098
|
+
}), de ? /* @__PURE__ */ C(x, {
|
|
1032
1099
|
color: "text-error",
|
|
1033
1100
|
variant: "body",
|
|
1034
|
-
children:
|
|
1101
|
+
children: de
|
|
1035
1102
|
}) : null]
|
|
1036
1103
|
})
|
|
1037
1104
|
}),
|
|
1038
1105
|
/* @__PURE__ */ C(h, {
|
|
1039
1106
|
cancelText: "取消",
|
|
1040
|
-
confirmButtonProps: { disabled: !
|
|
1107
|
+
confirmButtonProps: { disabled: !Te },
|
|
1041
1108
|
confirmText: "送出轉派",
|
|
1042
|
-
loading:
|
|
1109
|
+
loading: d,
|
|
1043
1110
|
modalType: "standard",
|
|
1044
|
-
onCancel:
|
|
1045
|
-
onClose:
|
|
1046
|
-
onConfirm: () => void
|
|
1047
|
-
open:
|
|
1111
|
+
onCancel: ut,
|
|
1112
|
+
onClose: ut,
|
|
1113
|
+
onConfirm: () => void pt(),
|
|
1114
|
+
open: Ae,
|
|
1048
1115
|
showModalFooter: !0,
|
|
1049
1116
|
showModalHeader: !0,
|
|
1050
1117
|
size: "regular",
|
|
1051
1118
|
supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
|
|
1052
1119
|
title: "轉派簽核",
|
|
1053
1120
|
children: /* @__PURE__ */ w("div", {
|
|
1054
|
-
style:
|
|
1121
|
+
style: Mt,
|
|
1055
1122
|
children: [/* @__PURE__ */ C(n, {
|
|
1056
1123
|
label: "轉派對象",
|
|
1057
1124
|
name: "transferToMemberId",
|
|
1058
1125
|
required: !0,
|
|
1059
|
-
children: /* @__PURE__ */ C(
|
|
1126
|
+
children: /* @__PURE__ */ C(p, {
|
|
1060
1127
|
asyncData: !0,
|
|
1061
1128
|
disabledOptionsFilter: !0,
|
|
1062
1129
|
emptyText: "沒有符合的成員",
|
|
@@ -1066,117 +1133,117 @@ var Pt = {
|
|
|
1066
1133
|
name: "transfer-member-search",
|
|
1067
1134
|
spellCheck: !1
|
|
1068
1135
|
},
|
|
1069
|
-
loading:
|
|
1136
|
+
loading: Ee,
|
|
1070
1137
|
loadingText: "搜尋成員中...",
|
|
1071
1138
|
mode: "single",
|
|
1072
|
-
onChange: (e) =>
|
|
1073
|
-
onSearch:
|
|
1074
|
-
onSearchTextChange: (e) =>
|
|
1139
|
+
onChange: (e) => D(et(e)),
|
|
1140
|
+
onSearch: dt,
|
|
1141
|
+
onSearchTextChange: (e) => D(tt(e, Oe)),
|
|
1075
1142
|
onVisibilityChange: (e) => {
|
|
1076
|
-
e &&
|
|
1143
|
+
e && dt("");
|
|
1077
1144
|
},
|
|
1078
|
-
options: [...
|
|
1145
|
+
options: [...Oe],
|
|
1079
1146
|
placeholder: "搜尋姓名或信箱",
|
|
1080
1147
|
searchDebounceTime: 300,
|
|
1081
|
-
value:
|
|
1148
|
+
value: Te
|
|
1082
1149
|
})
|
|
1083
1150
|
}), /* @__PURE__ */ C(n, {
|
|
1084
1151
|
label: "轉派說明",
|
|
1085
1152
|
name: "transferComment",
|
|
1086
|
-
children: /* @__PURE__ */ C(
|
|
1087
|
-
onChange: (e) =>
|
|
1153
|
+
children: /* @__PURE__ */ C(y, {
|
|
1154
|
+
onChange: (e) => we(e.target.value),
|
|
1088
1155
|
placeholder: "可補充轉派原因",
|
|
1089
|
-
ref:
|
|
1156
|
+
ref: Ft,
|
|
1090
1157
|
resize: "vertical",
|
|
1091
1158
|
rows: 4,
|
|
1092
|
-
style:
|
|
1093
|
-
value:
|
|
1159
|
+
style: jt,
|
|
1160
|
+
value: E
|
|
1094
1161
|
})
|
|
1095
1162
|
})]
|
|
1096
1163
|
})
|
|
1097
1164
|
}),
|
|
1098
1165
|
/* @__PURE__ */ C(h, {
|
|
1099
1166
|
cancelText: "取消",
|
|
1100
|
-
confirmButtonProps: { disabled: !
|
|
1167
|
+
confirmButtonProps: { disabled: !qe || W && !We },
|
|
1101
1168
|
confirmText: "送出退回",
|
|
1102
|
-
loading:
|
|
1169
|
+
loading: d,
|
|
1103
1170
|
modalType: "standard",
|
|
1104
|
-
onCancel:
|
|
1105
|
-
onClose:
|
|
1106
|
-
onConfirm: () => void
|
|
1107
|
-
open:
|
|
1171
|
+
onCancel: ct,
|
|
1172
|
+
onClose: ct,
|
|
1173
|
+
onConfirm: () => void Q(),
|
|
1174
|
+
open: be,
|
|
1108
1175
|
showModalFooter: !0,
|
|
1109
1176
|
showModalHeader: !0,
|
|
1110
1177
|
size: "regular",
|
|
1111
1178
|
supportingText: "退回後,流程會回到指定節點並等待重新處理。",
|
|
1112
1179
|
title: "退回簽核",
|
|
1113
1180
|
children: /* @__PURE__ */ w("div", {
|
|
1114
|
-
style:
|
|
1181
|
+
style: Mt,
|
|
1115
1182
|
children: [/* @__PURE__ */ C(n, {
|
|
1116
1183
|
label: "退回節點",
|
|
1117
1184
|
name: "returnTargetNodeId",
|
|
1118
1185
|
required: !0,
|
|
1119
|
-
children: /* @__PURE__ */ C(
|
|
1186
|
+
children: /* @__PURE__ */ C(ne, {
|
|
1120
1187
|
clearable: !1,
|
|
1121
1188
|
fullWidth: !0,
|
|
1122
|
-
onChange: (e) =>
|
|
1123
|
-
options: [...
|
|
1189
|
+
onChange: (e) => Ce(e?.id ?? null),
|
|
1190
|
+
options: [...B],
|
|
1124
1191
|
placeholder: "選擇退回節點",
|
|
1125
|
-
value:
|
|
1192
|
+
value: qe
|
|
1126
1193
|
})
|
|
1127
1194
|
}), /* @__PURE__ */ C(n, {
|
|
1128
|
-
hintText:
|
|
1195
|
+
hintText: W ? "此關卡設定退回時必須填寫意見。" : void 0,
|
|
1129
1196
|
label: "退回說明",
|
|
1130
1197
|
name: "returnComment",
|
|
1131
|
-
required:
|
|
1132
|
-
children: /* @__PURE__ */ C(
|
|
1133
|
-
onChange: (e) =>
|
|
1134
|
-
placeholder:
|
|
1135
|
-
ref:
|
|
1198
|
+
required: W,
|
|
1199
|
+
children: /* @__PURE__ */ C(y, {
|
|
1200
|
+
onChange: (e) => ve(e.target.value),
|
|
1201
|
+
placeholder: W ? "請說明退回原因" : "可補充需要修改的內容",
|
|
1202
|
+
ref: Ft,
|
|
1136
1203
|
resize: "vertical",
|
|
1137
1204
|
rows: 4,
|
|
1138
|
-
style:
|
|
1139
|
-
value:
|
|
1205
|
+
style: jt,
|
|
1206
|
+
value: _e
|
|
1140
1207
|
})
|
|
1141
1208
|
})]
|
|
1142
1209
|
})
|
|
1143
1210
|
}),
|
|
1144
1211
|
/* @__PURE__ */ C(h, {
|
|
1145
1212
|
cancelText: "取消",
|
|
1146
|
-
confirmButtonProps: { disabled:
|
|
1213
|
+
confirmButtonProps: { disabled: bt },
|
|
1147
1214
|
confirmText: "送出",
|
|
1148
|
-
loading:
|
|
1215
|
+
loading: M,
|
|
1149
1216
|
modalType: "standard",
|
|
1150
|
-
onCancel:
|
|
1151
|
-
onClose:
|
|
1152
|
-
onConfirm: () => void
|
|
1153
|
-
open:
|
|
1217
|
+
onCancel: gt,
|
|
1218
|
+
onClose: gt,
|
|
1219
|
+
onConfirm: () => void vt(),
|
|
1220
|
+
open: ze,
|
|
1154
1221
|
showModalFooter: !0,
|
|
1155
1222
|
showModalHeader: !0,
|
|
1156
1223
|
size: "regular",
|
|
1157
|
-
supportingText:
|
|
1158
|
-
title:
|
|
1224
|
+
supportingText: Lt[k],
|
|
1225
|
+
title: It[k],
|
|
1159
1226
|
children: /* @__PURE__ */ w("div", {
|
|
1160
|
-
style:
|
|
1227
|
+
style: Mt,
|
|
1161
1228
|
children: [
|
|
1162
1229
|
$ ? /* @__PURE__ */ C(n, {
|
|
1163
1230
|
label: "通知時機",
|
|
1164
1231
|
name: "adhocNotifyMode",
|
|
1165
1232
|
required: !0,
|
|
1166
|
-
children: /* @__PURE__ */ C(
|
|
1233
|
+
children: /* @__PURE__ */ C(ne, {
|
|
1167
1234
|
clearable: !1,
|
|
1168
1235
|
fullWidth: !0,
|
|
1169
|
-
onChange: (e) =>
|
|
1236
|
+
onChange: (e) => Ve(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
|
|
1170
1237
|
options: [{
|
|
1171
1238
|
id: "STAGE_NOTIFY",
|
|
1172
|
-
name:
|
|
1239
|
+
name: It.STAGE_NOTIFY
|
|
1173
1240
|
}, {
|
|
1174
1241
|
id: "COMPLETION_NOTIFY",
|
|
1175
|
-
name:
|
|
1242
|
+
name: It.COMPLETION_NOTIFY
|
|
1176
1243
|
}],
|
|
1177
1244
|
value: {
|
|
1178
1245
|
id: k,
|
|
1179
|
-
name:
|
|
1246
|
+
name: It[k]
|
|
1180
1247
|
}
|
|
1181
1248
|
})
|
|
1182
1249
|
}) : null,
|
|
@@ -1184,29 +1251,29 @@ var Pt = {
|
|
|
1184
1251
|
label: "通知對象類型",
|
|
1185
1252
|
name: "adhocTargetKind",
|
|
1186
1253
|
required: !0,
|
|
1187
|
-
children: /* @__PURE__ */ C(
|
|
1254
|
+
children: /* @__PURE__ */ C(ne, {
|
|
1188
1255
|
clearable: !1,
|
|
1189
1256
|
fullWidth: !0,
|
|
1190
|
-
onChange: (e) =>
|
|
1191
|
-
options: [...
|
|
1192
|
-
value:
|
|
1257
|
+
onChange: (e) => He(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
|
|
1258
|
+
options: [...zt],
|
|
1259
|
+
value: St
|
|
1193
1260
|
})
|
|
1194
1261
|
}) : null,
|
|
1195
|
-
$ &&
|
|
1262
|
+
$ && P === "WEBHOOK" ? /* @__PURE__ */ C(n, {
|
|
1196
1263
|
label: "Webhook URL",
|
|
1197
1264
|
name: "adhocWebhookUrl",
|
|
1198
1265
|
required: !0,
|
|
1199
|
-
children: /* @__PURE__ */ C(
|
|
1266
|
+
children: /* @__PURE__ */ C(ee, {
|
|
1200
1267
|
fullWidth: !0,
|
|
1201
|
-
onChange: (e) =>
|
|
1268
|
+
onChange: (e) => Ue(e.target.value),
|
|
1202
1269
|
placeholder: "https://example.com/webhook",
|
|
1203
|
-
value:
|
|
1270
|
+
value: F
|
|
1204
1271
|
})
|
|
1205
1272
|
}) : /* @__PURE__ */ C(n, {
|
|
1206
1273
|
label: $ ? "通知對象" : "簽核對象",
|
|
1207
1274
|
name: "adhocMemberId",
|
|
1208
1275
|
required: !0,
|
|
1209
|
-
children: /* @__PURE__ */ C(
|
|
1276
|
+
children: /* @__PURE__ */ C(p, {
|
|
1210
1277
|
asyncData: !0,
|
|
1211
1278
|
disabledOptionsFilter: !0,
|
|
1212
1279
|
emptyText: "沒有符合的成員",
|
|
@@ -1216,44 +1283,44 @@ var Pt = {
|
|
|
1216
1283
|
name: "adhoc-member-search",
|
|
1217
1284
|
spellCheck: !1
|
|
1218
1285
|
},
|
|
1219
|
-
loading:
|
|
1286
|
+
loading: Ie,
|
|
1220
1287
|
loadingText: "搜尋成員中...",
|
|
1221
1288
|
mode: "single",
|
|
1222
|
-
onChange: (e) =>
|
|
1223
|
-
onSearch:
|
|
1224
|
-
onSearchTextChange: (e) =>
|
|
1289
|
+
onChange: (e) => Fe(et(e)),
|
|
1290
|
+
onSearch: _t,
|
|
1291
|
+
onSearchTextChange: (e) => Fe(tt(e, Re)),
|
|
1225
1292
|
onVisibilityChange: (e) => {
|
|
1226
|
-
e &&
|
|
1293
|
+
e && _t("");
|
|
1227
1294
|
},
|
|
1228
|
-
options: [...
|
|
1295
|
+
options: [...Re],
|
|
1229
1296
|
placeholder: "搜尋姓名或信箱",
|
|
1230
1297
|
searchDebounceTime: 300,
|
|
1231
|
-
value:
|
|
1298
|
+
value: Pe
|
|
1232
1299
|
})
|
|
1233
1300
|
}),
|
|
1234
1301
|
k === "PRE_APPROVAL" ? /* @__PURE__ */ C(n, {
|
|
1235
1302
|
label: "拒簽處理方式",
|
|
1236
1303
|
name: "adhocOnReject",
|
|
1237
1304
|
required: !0,
|
|
1238
|
-
children: /* @__PURE__ */ C(
|
|
1305
|
+
children: /* @__PURE__ */ C(ne, {
|
|
1239
1306
|
clearable: !1,
|
|
1240
1307
|
fullWidth: !0,
|
|
1241
|
-
onChange: (e) =>
|
|
1242
|
-
options: [...
|
|
1243
|
-
value:
|
|
1308
|
+
onChange: (e) => j(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
|
|
1309
|
+
options: [...Rt],
|
|
1310
|
+
value: xt
|
|
1244
1311
|
})
|
|
1245
1312
|
}) : null,
|
|
1246
1313
|
$ ? null : /* @__PURE__ */ C(n, {
|
|
1247
1314
|
label: "說明",
|
|
1248
1315
|
name: "adhocComment",
|
|
1249
|
-
children: /* @__PURE__ */ C(
|
|
1250
|
-
onChange: (e) =>
|
|
1316
|
+
children: /* @__PURE__ */ C(y, {
|
|
1317
|
+
onChange: (e) => Ne(e.target.value),
|
|
1251
1318
|
placeholder: "可補充原因",
|
|
1252
|
-
ref:
|
|
1319
|
+
ref: Ft,
|
|
1253
1320
|
resize: "vertical",
|
|
1254
1321
|
rows: 3,
|
|
1255
|
-
style:
|
|
1256
|
-
value:
|
|
1322
|
+
style: jt,
|
|
1323
|
+
value: Me
|
|
1257
1324
|
})
|
|
1258
1325
|
})
|
|
1259
1326
|
]
|
|
@@ -1261,10 +1328,10 @@ var Pt = {
|
|
|
1261
1328
|
})
|
|
1262
1329
|
] });
|
|
1263
1330
|
});
|
|
1264
|
-
function
|
|
1331
|
+
function Vt(e, t) {
|
|
1265
1332
|
try {
|
|
1266
1333
|
let n = JSON.parse(e.targetValueJson);
|
|
1267
|
-
if (n.memberIds?.length) return n.memberIds.map((e) =>
|
|
1334
|
+
if (n.memberIds?.length) return n.memberIds.map((e) => Y(e, t)).join("、");
|
|
1268
1335
|
if (n.webhookUrl) return n.webhookUrl;
|
|
1269
1336
|
if (n.positionId) return `職位 ${n.positionId}`;
|
|
1270
1337
|
if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
|
|
@@ -1273,19 +1340,19 @@ function zt(e, t) {
|
|
|
1273
1340
|
}
|
|
1274
1341
|
//#endregion
|
|
1275
1342
|
//#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
|
|
1276
|
-
var
|
|
1343
|
+
var Ht = {
|
|
1277
1344
|
display: "grid",
|
|
1278
1345
|
gap: 16
|
|
1279
1346
|
};
|
|
1280
|
-
function
|
|
1281
|
-
let r =
|
|
1347
|
+
function Ut({ signatureVerification: e, signatures: n }) {
|
|
1348
|
+
let r = u(() => n.map((e) => ({
|
|
1282
1349
|
algorithm: e.algorithm,
|
|
1283
|
-
hashLabel:
|
|
1350
|
+
hashLabel: qe(e.signedPayloadHash),
|
|
1284
1351
|
key: e.id,
|
|
1285
1352
|
keyVersion: e.keyVersion,
|
|
1286
1353
|
signedAtLabel: t(e.signedAt),
|
|
1287
1354
|
signerMemberId: e.signerMemberId
|
|
1288
|
-
})), [n]), i =
|
|
1355
|
+
})), [n]), i = u(() => [
|
|
1289
1356
|
{
|
|
1290
1357
|
dataIndex: "signerMemberId",
|
|
1291
1358
|
key: "signerMemberId",
|
|
@@ -1318,7 +1385,7 @@ function Vt({ signatureVerification: e, signatures: n }) {
|
|
|
1318
1385
|
}
|
|
1319
1386
|
], []);
|
|
1320
1387
|
return /* @__PURE__ */ w("div", {
|
|
1321
|
-
style:
|
|
1388
|
+
style: Ht,
|
|
1322
1389
|
children: [
|
|
1323
1390
|
/* @__PURE__ */ C(x, {
|
|
1324
1391
|
component: "h2",
|
|
@@ -1330,7 +1397,7 @@ function Vt({ signatureVerification: e, signatures: n }) {
|
|
|
1330
1397
|
variant: "body",
|
|
1331
1398
|
children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
|
|
1332
1399
|
}),
|
|
1333
|
-
r.length > 0 ? /* @__PURE__ */ C(
|
|
1400
|
+
r.length > 0 ? /* @__PURE__ */ C(re, {
|
|
1334
1401
|
columns: i,
|
|
1335
1402
|
dataSource: r,
|
|
1336
1403
|
fullWidth: !0
|
|
@@ -1340,26 +1407,26 @@ function Vt({ signatureVerification: e, signatures: n }) {
|
|
|
1340
1407
|
}
|
|
1341
1408
|
//#endregion
|
|
1342
1409
|
//#region src/views/instances/detail/sections/InstanceHistorySection.tsx
|
|
1343
|
-
var
|
|
1410
|
+
var Wt = {
|
|
1344
1411
|
display: "grid",
|
|
1345
1412
|
gap: 16
|
|
1346
|
-
},
|
|
1413
|
+
}, Gt = {
|
|
1347
1414
|
cursor: "help",
|
|
1348
1415
|
textDecoration: "underline dotted",
|
|
1349
1416
|
textUnderlineOffset: 3
|
|
1350
|
-
},
|
|
1351
|
-
function
|
|
1352
|
-
return e.filter((e) =>
|
|
1417
|
+
}, Kt = { color: "var(--mzn-color-text-error)" };
|
|
1418
|
+
function qt(...e) {
|
|
1419
|
+
return e.filter((e) => U(e ?? null)).join(" ");
|
|
1353
1420
|
}
|
|
1354
|
-
var
|
|
1421
|
+
var Jt = 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) {
|
|
1355
1422
|
let f = r ? "pending" : s;
|
|
1356
1423
|
return /* @__PURE__ */ w("div", {
|
|
1357
1424
|
...u,
|
|
1358
|
-
className:
|
|
1425
|
+
className: qt(A.host, l === "dot" ? A.dot : null, n && f !== "processing" ? A.error : null, o === "horizontal" ? A.horizontal : null, l === "number" ? A.number : null, f === "pending" ? A.pending : null, f === "processing" ? A.processing : null, n && f === "processing" ? A.processingError : null, !n && f === "succeeded" ? A.succeeded : null, o === "vertical" ? A.vertical : null, e),
|
|
1359
1426
|
ref: d,
|
|
1360
|
-
children: [l === "dot" ? /* @__PURE__ */ C("span", { className:
|
|
1427
|
+
children: [l === "dot" ? /* @__PURE__ */ C("span", { className: qt(A.statusIndicator, A.statusIndicatorDot) }) : /* @__PURE__ */ C("span", {
|
|
1361
1428
|
className: A.statusIndicator,
|
|
1362
|
-
children:
|
|
1429
|
+
children: i + 1
|
|
1363
1430
|
}), /* @__PURE__ */ w("div", {
|
|
1364
1431
|
className: A.textContainer,
|
|
1365
1432
|
children: [/* @__PURE__ */ w(x, {
|
|
@@ -1369,14 +1436,14 @@ var Kt = a(function({ className: e, descriptionParts: t, error: n, forcePending:
|
|
|
1369
1436
|
}), t.length > 0 ? /* @__PURE__ */ C(x, {
|
|
1370
1437
|
className: A.description,
|
|
1371
1438
|
variant: "caption",
|
|
1372
|
-
children: t.map((e, t) => /* @__PURE__ */ w(
|
|
1439
|
+
children: t.map((e, t) => /* @__PURE__ */ w(a, { children: [t > 0 ? " · " : null, Yt(e)] }, `${e.type}-${t}`))
|
|
1373
1440
|
}) : null]
|
|
1374
1441
|
})]
|
|
1375
1442
|
});
|
|
1376
1443
|
});
|
|
1377
|
-
function
|
|
1444
|
+
function Yt(e) {
|
|
1378
1445
|
return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ C("span", {
|
|
1379
|
-
style:
|
|
1446
|
+
style: Kt,
|
|
1380
1447
|
children: e.text
|
|
1381
1448
|
}) : e.email ? /* @__PURE__ */ w(S, { children: [
|
|
1382
1449
|
e.prefix,
|
|
@@ -1388,28 +1455,28 @@ function qt(e) {
|
|
|
1388
1455
|
onMouseEnter: t,
|
|
1389
1456
|
onMouseLeave: n,
|
|
1390
1457
|
ref: r,
|
|
1391
|
-
style:
|
|
1458
|
+
style: Gt,
|
|
1392
1459
|
children: e.label
|
|
1393
1460
|
})
|
|
1394
1461
|
})
|
|
1395
1462
|
] }) : `${e.prefix}:${e.label}`;
|
|
1396
1463
|
}
|
|
1397
|
-
function
|
|
1398
|
-
let l =
|
|
1464
|
+
function Xt({ activityLogs: e, instanceState: t, memberProfilesById: n, signatureVerification: r, signaturesById: i, taskDecisionsByTaskId: a, tasks: o, workflowSnapshot: s, workflowTokens: c }) {
|
|
1465
|
+
let l = $(e, o, c, s, t, n, a, i, r), u = it(l), d = l.map((e) => ({
|
|
1399
1466
|
...e,
|
|
1400
1467
|
descriptionParts: e.descriptionParts.filter(Z)
|
|
1401
1468
|
}));
|
|
1402
1469
|
return /* @__PURE__ */ w("div", {
|
|
1403
|
-
style:
|
|
1470
|
+
style: Wt,
|
|
1404
1471
|
children: [/* @__PURE__ */ C(x, {
|
|
1405
1472
|
component: "h2",
|
|
1406
1473
|
variant: "h3",
|
|
1407
1474
|
children: "歷程"
|
|
1408
|
-
}), d.length > 0 ? /* @__PURE__ */ C(
|
|
1475
|
+
}), d.length > 0 ? /* @__PURE__ */ C(v, {
|
|
1409
1476
|
currentStep: u,
|
|
1410
1477
|
orientation: "vertical",
|
|
1411
1478
|
type: "dot",
|
|
1412
|
-
children: d.map((e) => /* @__PURE__ */ C(
|
|
1479
|
+
children: d.map((e) => /* @__PURE__ */ C(Jt, {
|
|
1413
1480
|
descriptionParts: e.descriptionParts,
|
|
1414
1481
|
error: e.error,
|
|
1415
1482
|
forcePending: e.forcePending,
|
|
@@ -1424,10 +1491,10 @@ function Jt({ activityLogs: e, instanceState: t, memberProfilesById: n, signatur
|
|
|
1424
1491
|
}
|
|
1425
1492
|
//#endregion
|
|
1426
1493
|
//#region src/views/instances/detail/InstanceDetailView.tsx
|
|
1427
|
-
var
|
|
1494
|
+
var Zt = 184, Qt = 96, $t = {
|
|
1428
1495
|
display: "grid",
|
|
1429
1496
|
gap: 16
|
|
1430
|
-
},
|
|
1497
|
+
}, en = {
|
|
1431
1498
|
background: "#f8fafc",
|
|
1432
1499
|
border: "1px solid #e2e8f0",
|
|
1433
1500
|
borderRadius: 8,
|
|
@@ -1435,7 +1502,7 @@ var Yt = 184, Xt = 96, Zt = {
|
|
|
1435
1502
|
minHeight: 440,
|
|
1436
1503
|
overflow: "hidden",
|
|
1437
1504
|
width: "min(80vw, 1040px)"
|
|
1438
|
-
},
|
|
1505
|
+
}, tn = {
|
|
1439
1506
|
background: "#ffffff",
|
|
1440
1507
|
border: "1px solid #cbd5e1",
|
|
1441
1508
|
borderRadius: 8,
|
|
@@ -1445,24 +1512,24 @@ var Yt = 184, Xt = 96, Zt = {
|
|
|
1445
1512
|
minHeight: 82,
|
|
1446
1513
|
padding: 12,
|
|
1447
1514
|
width: 184
|
|
1448
|
-
},
|
|
1515
|
+
}, nn = {
|
|
1449
1516
|
borderRadius: 999,
|
|
1450
1517
|
fontSize: 12,
|
|
1451
1518
|
fontWeight: 600,
|
|
1452
1519
|
justifySelf: "start",
|
|
1453
1520
|
lineHeight: "18px",
|
|
1454
1521
|
padding: "0 8px"
|
|
1455
|
-
},
|
|
1522
|
+
}, rn = {
|
|
1456
1523
|
color: "#64748b",
|
|
1457
1524
|
fontSize: 12,
|
|
1458
1525
|
overflow: "hidden",
|
|
1459
1526
|
textOverflow: "ellipsis",
|
|
1460
1527
|
whiteSpace: "nowrap"
|
|
1461
|
-
},
|
|
1528
|
+
}, an = { opacity: 0 }, on = {
|
|
1462
1529
|
display: "flex",
|
|
1463
1530
|
flexWrap: "wrap",
|
|
1464
1531
|
gap: 8
|
|
1465
|
-
},
|
|
1532
|
+
}, sn = {
|
|
1466
1533
|
alignItems: "center",
|
|
1467
1534
|
background: "#ffffff",
|
|
1468
1535
|
border: "1px solid #cbd5e1",
|
|
@@ -1474,71 +1541,82 @@ var Yt = 184, Xt = 96, Zt = {
|
|
|
1474
1541
|
gap: 6,
|
|
1475
1542
|
lineHeight: "20px",
|
|
1476
1543
|
padding: "4px 8px"
|
|
1477
|
-
},
|
|
1544
|
+
}, cn = {
|
|
1478
1545
|
display: "grid",
|
|
1479
1546
|
gap: 16
|
|
1480
|
-
},
|
|
1481
|
-
function
|
|
1482
|
-
let { member:
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
}, [v,
|
|
1486
|
-
|
|
1487
|
-
}, [
|
|
1488
|
-
let
|
|
1489
|
-
|
|
1490
|
-
|
|
1547
|
+
}, ln = { workflowRuntime: yn };
|
|
1548
|
+
function un({ instanceId: i, showAttachments: a = !0, showForm: o = !0, showHistory: l = !0, showSignatures: p = !0, showTasks: ee = !0 }) {
|
|
1549
|
+
let { member: ne } = e(), v = ne?.memberId ?? null, [re, b] = f([]), [T, ae] = f(null), [oe, se] = f([]), [ue, he] = f([]), [ge, _e] = f([]), [ye, Ce] = f(null), [E, Te] = f([]), [D, je] = f([]), [Me, Pe] = f([]), [Re, O] = f(null), [Be, k] = f(!0), [Ve, A] = f(!1), [j, M] = f(!1), [N, P] = f(""), [He, F] = f(!1), [Ue, I] = f({}), [L, R] = f({}), [z, B] = f({}), [V, H] = f(null), [U, W] = f(null), [Ge, Ke] = f([]), qe = N.trim(), K = d(null);
|
|
1550
|
+
c(() => {
|
|
1551
|
+
st();
|
|
1552
|
+
}, [v, i]), c(() => {
|
|
1553
|
+
R(T?.formData ?? {}), B({});
|
|
1554
|
+
}, [T]);
|
|
1555
|
+
let Ye = s((e, t) => {
|
|
1556
|
+
B((n) => {
|
|
1557
|
+
let r = n[e];
|
|
1558
|
+
return r?.hasValue === t.hasValue && r.status === t.status ? n : {
|
|
1559
|
+
...n,
|
|
1560
|
+
[e]: {
|
|
1561
|
+
hasValue: t.hasValue,
|
|
1562
|
+
status: t.status
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
});
|
|
1566
|
+
}, []), q = u(() => E.find((e) => Ze(e, v) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [v, E]), J = u(() => q && T ? T.workflowSnapshot.nodes.find((e) => e.id === q.nodeId) ?? null : null, [q, T]), Y = J?.type === "userTask" && J.data.returnBehavior.allowReturn, Xe = J?.type === "userTask" && J.data.allowReject !== !1, Qe = J?.type === "userTask" && J.data.allowTransfer !== !1, $e = J?.type === "userTask" && J.data.allowAddSigner, et = !!(T && T.initiatorMemberId === v && (T.state === "RUNNING" || T.state === "RETURNED")), tt = !!(T && T.initiatorMemberId === v && T.state === "RETURNED"), X = u(() => new Map(Me.map((e) => [e.memberId, e])), [Me]), nt = u(() => wt(oe), [oe]), rt = u(() => new Map(ge.map((e) => [e.id, e])), [ge]), Z = u(() => T ? hn(T.workflowSnapshot) : null, [T]), it = u(() => T && Z ? mn(Z, E, D, T.state) : [], [
|
|
1491
1567
|
T,
|
|
1568
|
+
Z,
|
|
1569
|
+
E,
|
|
1492
1570
|
D
|
|
1493
|
-
]),
|
|
1494
|
-
async function
|
|
1495
|
-
|
|
1571
|
+
]), at = u(() => Z ? gn(Z) : [], [Z]), ot = u(() => T ? fn(T.workflowSnapshot) : [], [T]);
|
|
1572
|
+
async function st() {
|
|
1573
|
+
k(!0), O(null);
|
|
1496
1574
|
try {
|
|
1497
|
-
let e = await de(
|
|
1498
|
-
|
|
1499
|
-
let t = await ce(e.instance.id), [n,
|
|
1500
|
-
|
|
1501
|
-
|
|
1575
|
+
let e = await de(i);
|
|
1576
|
+
b(e.activityLogs), ae(e.instance), Te(e.tasks), je(e.workflowTokens);
|
|
1577
|
+
let t = await ce(e.instance.id), [n, r, a, o] = await Promise.all([
|
|
1578
|
+
Ct(e.tasks),
|
|
1579
|
+
xt({
|
|
1502
1580
|
...e,
|
|
1503
1581
|
adhocDirectives: t
|
|
1504
1582
|
}),
|
|
1505
1583
|
le(e.instance.id),
|
|
1506
1584
|
me(e.instance.id)
|
|
1507
1585
|
]);
|
|
1508
|
-
|
|
1586
|
+
se(n), Pe(r), he(a), _e(o.signatures), Ce(o.verification), Ke(t);
|
|
1509
1587
|
} catch (e) {
|
|
1510
|
-
O(
|
|
1588
|
+
O(G(e));
|
|
1511
1589
|
} finally {
|
|
1512
|
-
|
|
1590
|
+
k(!1);
|
|
1513
1591
|
}
|
|
1514
1592
|
}
|
|
1515
|
-
async function
|
|
1593
|
+
async function ct(e, t) {
|
|
1516
1594
|
if (!v) throw Error("尚未登入,無法上傳附件");
|
|
1517
1595
|
return { id: (await be({
|
|
1518
1596
|
file: t,
|
|
1519
1597
|
formFieldPath: `form.${e.fieldKey}`
|
|
1520
1598
|
})).id };
|
|
1521
1599
|
}
|
|
1522
|
-
async function
|
|
1600
|
+
async function lt(e) {
|
|
1523
1601
|
if (!v) return;
|
|
1524
1602
|
let t = await fe({ id: e.id });
|
|
1525
1603
|
window.open(t, "_blank", "noopener,noreferrer");
|
|
1526
1604
|
}
|
|
1527
|
-
async function
|
|
1605
|
+
async function ut(e) {
|
|
1528
1606
|
if (!v) return;
|
|
1529
1607
|
let t = await pe({ id: e.id });
|
|
1530
|
-
|
|
1608
|
+
H(e), W(t);
|
|
1531
1609
|
}
|
|
1532
|
-
async function
|
|
1533
|
-
if (!(!v || !
|
|
1534
|
-
if (A(!0), O(null),
|
|
1535
|
-
let e =
|
|
1536
|
-
schema:
|
|
1537
|
-
uiSchema:
|
|
1538
|
-
values:
|
|
1610
|
+
async function dt() {
|
|
1611
|
+
if (!(!v || !T || !et)) {
|
|
1612
|
+
if (A(!0), O(null), I({}), T.formDefinitionSnapshot.schema && T.formDefinitionSnapshot.uiSchema) {
|
|
1613
|
+
let e = Fe({
|
|
1614
|
+
schema: T.formDefinitionSnapshot.schema,
|
|
1615
|
+
uiSchema: T.formDefinitionSnapshot.uiSchema,
|
|
1616
|
+
values: L
|
|
1539
1617
|
});
|
|
1540
1618
|
if (!e.valid) {
|
|
1541
|
-
|
|
1619
|
+
I(e.errors), O("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ne(e.firstInvalidFieldKey), A(!1);
|
|
1542
1620
|
return;
|
|
1543
1621
|
}
|
|
1544
1622
|
}
|
|
@@ -1546,193 +1624,197 @@ function cn({ instanceId: r, showAttachments: i = !0, showForm: a = !0, showHist
|
|
|
1546
1624
|
await ie({
|
|
1547
1625
|
cancelledByMemberId: v,
|
|
1548
1626
|
comment: qe || null,
|
|
1549
|
-
instanceId:
|
|
1550
|
-
}),
|
|
1627
|
+
instanceId: T.id
|
|
1628
|
+
}), P(""), F(!1), await st();
|
|
1551
1629
|
} catch (e) {
|
|
1552
|
-
O(
|
|
1630
|
+
O(G(e));
|
|
1553
1631
|
} finally {
|
|
1554
1632
|
A(!1);
|
|
1555
1633
|
}
|
|
1556
1634
|
}
|
|
1557
1635
|
}
|
|
1558
|
-
async function
|
|
1559
|
-
if (!(!v || !
|
|
1560
|
-
A(!0), O(null)
|
|
1636
|
+
async function ft() {
|
|
1637
|
+
if (!(!v || !T || !tt)) {
|
|
1638
|
+
if (A(!0), O(null), Object.values(z).some(r)) {
|
|
1639
|
+
O("請先完成動態選項驗證。"), A(!1);
|
|
1640
|
+
return;
|
|
1641
|
+
}
|
|
1561
1642
|
try {
|
|
1562
1643
|
await ve({
|
|
1563
|
-
formData:
|
|
1644
|
+
formData: L,
|
|
1564
1645
|
initiatorMemberId: v,
|
|
1565
|
-
instanceId:
|
|
1566
|
-
title:
|
|
1567
|
-
}), await
|
|
1646
|
+
instanceId: T.id,
|
|
1647
|
+
title: T.title
|
|
1648
|
+
}), await st();
|
|
1568
1649
|
} catch (e) {
|
|
1569
|
-
O(
|
|
1650
|
+
O(G(e));
|
|
1570
1651
|
} finally {
|
|
1571
1652
|
A(!1);
|
|
1572
1653
|
}
|
|
1573
1654
|
}
|
|
1574
1655
|
}
|
|
1575
|
-
let
|
|
1656
|
+
let pt = K.current?.deciding ?? !1, Q = Ve || pt;
|
|
1576
1657
|
return /* @__PURE__ */ w(S, { children: [
|
|
1577
|
-
/* @__PURE__ */ C(
|
|
1578
|
-
description:
|
|
1579
|
-
title:
|
|
1658
|
+
/* @__PURE__ */ C(te, { children: /* @__PURE__ */ w(xe, {
|
|
1659
|
+
description: T ? `${Je(T.state)} · ${t(T.startedAt)}` : "載入案件內容。",
|
|
1660
|
+
title: T?.title ?? "簽核案件",
|
|
1580
1661
|
children: [
|
|
1581
|
-
|
|
1662
|
+
T ? /* @__PURE__ */ C(m, {
|
|
1582
1663
|
"aria-label": "查看流程圖",
|
|
1583
|
-
icon:
|
|
1664
|
+
icon: ke,
|
|
1584
1665
|
iconType: "icon-only",
|
|
1585
1666
|
onClick: () => M(!0),
|
|
1586
1667
|
title: "查看流程圖",
|
|
1587
1668
|
variant: "base-secondary",
|
|
1588
1669
|
children: "流程圖"
|
|
1589
1670
|
}) : null,
|
|
1590
|
-
|
|
1671
|
+
et ? /* @__PURE__ */ C(m, {
|
|
1591
1672
|
disabled: Q,
|
|
1592
|
-
icon:
|
|
1673
|
+
icon: we,
|
|
1593
1674
|
iconType: "leading",
|
|
1594
|
-
onClick: () =>
|
|
1675
|
+
onClick: () => F(!0),
|
|
1595
1676
|
variant: "destructive-secondary",
|
|
1596
1677
|
children: "取消案件"
|
|
1597
1678
|
}) : null,
|
|
1598
|
-
|
|
1599
|
-
|
|
1679
|
+
q ? /* @__PURE__ */ w(S, { children: [
|
|
1680
|
+
$e ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(m, {
|
|
1600
1681
|
disabled: Q,
|
|
1601
|
-
icon:
|
|
1682
|
+
icon: De,
|
|
1602
1683
|
iconType: "leading",
|
|
1603
|
-
onClick: () =>
|
|
1684
|
+
onClick: () => K.current?.openAdhocModal("COUNTERSIGN"),
|
|
1604
1685
|
variant: "base-secondary",
|
|
1605
1686
|
children: "會簽"
|
|
1606
|
-
}, "adhoc-countersign"), /* @__PURE__ */ C(
|
|
1687
|
+
}, "adhoc-countersign"), /* @__PURE__ */ C(m, {
|
|
1607
1688
|
disabled: Q,
|
|
1608
|
-
icon:
|
|
1689
|
+
icon: De,
|
|
1609
1690
|
iconType: "leading",
|
|
1610
|
-
onClick: () =>
|
|
1691
|
+
onClick: () => K.current?.openAdhocModal("PRE_APPROVAL"),
|
|
1611
1692
|
variant: "base-secondary",
|
|
1612
1693
|
children: "加簽"
|
|
1613
1694
|
}, "adhoc-pre-approval")] }) : null,
|
|
1614
|
-
/* @__PURE__ */ C(
|
|
1695
|
+
/* @__PURE__ */ C(m, {
|
|
1615
1696
|
disabled: Q,
|
|
1616
|
-
icon:
|
|
1697
|
+
icon: Ee,
|
|
1617
1698
|
iconType: "leading",
|
|
1618
|
-
onClick: () =>
|
|
1699
|
+
onClick: () => K.current?.openAdhocModal("STAGE_NOTIFY"),
|
|
1619
1700
|
variant: "base-secondary",
|
|
1620
1701
|
children: "通知設定"
|
|
1621
1702
|
}, "adhoc-notify"),
|
|
1622
|
-
|
|
1703
|
+
Y ? /* @__PURE__ */ C(m, {
|
|
1623
1704
|
disabled: Q,
|
|
1624
|
-
icon:
|
|
1705
|
+
icon: Oe,
|
|
1625
1706
|
iconType: "leading",
|
|
1626
|
-
onClick: () =>
|
|
1707
|
+
onClick: () => K.current?.openReturnModal(),
|
|
1627
1708
|
variant: "base-secondary",
|
|
1628
1709
|
children: "退回"
|
|
1629
1710
|
}, "task-return") : null,
|
|
1630
|
-
/* @__PURE__ */ C(
|
|
1711
|
+
Qe ? /* @__PURE__ */ C(m, {
|
|
1631
1712
|
disabled: Q,
|
|
1632
|
-
icon:
|
|
1713
|
+
icon: Ae,
|
|
1633
1714
|
iconType: "leading",
|
|
1634
|
-
onClick: () =>
|
|
1715
|
+
onClick: () => K.current?.openTransferModal(),
|
|
1635
1716
|
variant: "base-secondary",
|
|
1636
1717
|
children: "轉派"
|
|
1637
|
-
}, "task-transfer"),
|
|
1638
|
-
/* @__PURE__ */ C(
|
|
1718
|
+
}, "task-transfer") : null,
|
|
1719
|
+
Xe ? /* @__PURE__ */ C(m, {
|
|
1639
1720
|
disabled: Q,
|
|
1640
|
-
icon:
|
|
1721
|
+
icon: we,
|
|
1641
1722
|
iconType: "leading",
|
|
1642
|
-
onClick: () =>
|
|
1723
|
+
onClick: () => K.current?.openRejectModal(),
|
|
1643
1724
|
variant: "destructive-secondary",
|
|
1644
1725
|
children: "拒絕"
|
|
1645
|
-
}, "task-reject"),
|
|
1646
|
-
/* @__PURE__ */ C(
|
|
1726
|
+
}, "task-reject") : null,
|
|
1727
|
+
/* @__PURE__ */ C(m, {
|
|
1647
1728
|
disabled: Q,
|
|
1648
1729
|
icon: Se,
|
|
1649
1730
|
iconType: "leading",
|
|
1650
|
-
onClick: () =>
|
|
1731
|
+
onClick: () => K.current?.handleApprove(),
|
|
1651
1732
|
variant: "base-primary",
|
|
1652
1733
|
children: "同意"
|
|
1653
1734
|
}, "task-approve")
|
|
1654
1735
|
] }) : null
|
|
1655
1736
|
]
|
|
1656
1737
|
}) }),
|
|
1657
|
-
/* @__PURE__ */ w(
|
|
1658
|
-
|
|
1659
|
-
canResubmitInstance:
|
|
1660
|
-
deciding:
|
|
1661
|
-
error:
|
|
1662
|
-
instance:
|
|
1663
|
-
loading:
|
|
1738
|
+
/* @__PURE__ */ w(_, { children: [
|
|
1739
|
+
o ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Dt, {
|
|
1740
|
+
canResubmitInstance: tt,
|
|
1741
|
+
deciding: Ve,
|
|
1742
|
+
error: Re,
|
|
1743
|
+
instance: T,
|
|
1744
|
+
loading: Be,
|
|
1745
|
+
onDataSourceStateChange: Ye,
|
|
1664
1746
|
onResubmitFormChange: (e) => {
|
|
1665
|
-
|
|
1747
|
+
R(e), I({});
|
|
1666
1748
|
},
|
|
1667
|
-
onResubmitInstance: () => void
|
|
1668
|
-
onUploadAttachment:
|
|
1669
|
-
resubmitFormData:
|
|
1749
|
+
onResubmitInstance: () => void ft(),
|
|
1750
|
+
onUploadAttachment: ct,
|
|
1751
|
+
resubmitFormData: L,
|
|
1670
1752
|
resubmitFormErrors: Ue
|
|
1671
1753
|
}) }) : null,
|
|
1672
|
-
|
|
1673
|
-
attachments:
|
|
1754
|
+
a ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(kt, {
|
|
1755
|
+
attachments: ue,
|
|
1674
1756
|
onDownload: (e) => {
|
|
1675
|
-
|
|
1757
|
+
lt(e);
|
|
1676
1758
|
},
|
|
1677
1759
|
onPreview: (e) => {
|
|
1678
|
-
|
|
1760
|
+
ut(e);
|
|
1679
1761
|
}
|
|
1680
1762
|
}) }) : null,
|
|
1681
|
-
|
|
1682
|
-
adhocDirectives:
|
|
1763
|
+
ee ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Bt, {
|
|
1764
|
+
adhocDirectives: Ge,
|
|
1683
1765
|
currentMemberId: v,
|
|
1684
|
-
instance:
|
|
1685
|
-
memberProfilesById:
|
|
1686
|
-
onChanged:
|
|
1687
|
-
ref:
|
|
1688
|
-
tasks:
|
|
1766
|
+
instance: T,
|
|
1767
|
+
memberProfilesById: X,
|
|
1768
|
+
onChanged: st,
|
|
1769
|
+
ref: K,
|
|
1770
|
+
tasks: E
|
|
1689
1771
|
}) }) : null,
|
|
1690
|
-
|
|
1691
|
-
signatureVerification:
|
|
1692
|
-
signatures:
|
|
1772
|
+
p ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Ut, {
|
|
1773
|
+
signatureVerification: ye,
|
|
1774
|
+
signatures: ge
|
|
1693
1775
|
}) }) : null,
|
|
1694
|
-
|
|
1695
|
-
activityLogs:
|
|
1696
|
-
instanceState:
|
|
1697
|
-
memberProfilesById:
|
|
1698
|
-
signatureVerification:
|
|
1699
|
-
signaturesById:
|
|
1700
|
-
taskDecisionsByTaskId:
|
|
1701
|
-
tasks:
|
|
1702
|
-
workflowSnapshot:
|
|
1776
|
+
l ? /* @__PURE__ */ C(g, { children: /* @__PURE__ */ C(Xt, {
|
|
1777
|
+
activityLogs: re,
|
|
1778
|
+
instanceState: T?.state ?? "RUNNING",
|
|
1779
|
+
memberProfilesById: X,
|
|
1780
|
+
signatureVerification: ye,
|
|
1781
|
+
signaturesById: rt,
|
|
1782
|
+
taskDecisionsByTaskId: nt,
|
|
1783
|
+
tasks: E,
|
|
1784
|
+
workflowSnapshot: T?.workflowSnapshot ?? null,
|
|
1703
1785
|
workflowTokens: D
|
|
1704
1786
|
}) }) : null
|
|
1705
1787
|
] }),
|
|
1706
|
-
|
|
1788
|
+
T ? /* @__PURE__ */ C(h, {
|
|
1707
1789
|
modalType: "standard",
|
|
1708
1790
|
onClose: () => M(!1),
|
|
1709
1791
|
open: j,
|
|
1710
1792
|
showModalHeader: !0,
|
|
1711
1793
|
size: "wide",
|
|
1712
|
-
supportingText: `${
|
|
1794
|
+
supportingText: `${Je(T.state)} · ${t(T.startedAt)}`,
|
|
1713
1795
|
title: "流程圖",
|
|
1714
1796
|
children: /* @__PURE__ */ w("div", {
|
|
1715
|
-
style:
|
|
1797
|
+
style: $t,
|
|
1716
1798
|
children: [/* @__PURE__ */ C("div", {
|
|
1717
|
-
style:
|
|
1718
|
-
children: /* @__PURE__ */ w(
|
|
1719
|
-
edges:
|
|
1799
|
+
style: en,
|
|
1800
|
+
children: /* @__PURE__ */ w(ze, {
|
|
1801
|
+
edges: at,
|
|
1720
1802
|
fitView: !0,
|
|
1721
1803
|
fitViewOptions: { padding: .18 },
|
|
1722
1804
|
maxZoom: 1.2,
|
|
1723
1805
|
minZoom: .2,
|
|
1724
|
-
nodes:
|
|
1806
|
+
nodes: it,
|
|
1725
1807
|
nodesDraggable: !1,
|
|
1726
1808
|
nodesFocusable: !1,
|
|
1727
|
-
nodeTypes:
|
|
1809
|
+
nodeTypes: ln,
|
|
1728
1810
|
panOnDrag: !0,
|
|
1729
1811
|
proOptions: { hideAttribution: !0 },
|
|
1730
|
-
children: [/* @__PURE__ */ C(
|
|
1812
|
+
children: [/* @__PURE__ */ C(Ie, {}), /* @__PURE__ */ C(Le, { showInteractive: !1 })]
|
|
1731
1813
|
})
|
|
1732
|
-
}),
|
|
1733
|
-
style:
|
|
1734
|
-
children:
|
|
1735
|
-
style:
|
|
1814
|
+
}), ot.length > 0 ? /* @__PURE__ */ C("div", {
|
|
1815
|
+
style: on,
|
|
1816
|
+
children: ot.map((e) => /* @__PURE__ */ C("span", {
|
|
1817
|
+
style: sn,
|
|
1736
1818
|
children: e
|
|
1737
1819
|
}, e))
|
|
1738
1820
|
}) : null]
|
|
@@ -1741,73 +1823,73 @@ function cn({ instanceId: r, showAttachments: i = !0, showForm: a = !0, showHist
|
|
|
1741
1823
|
/* @__PURE__ */ C(h, {
|
|
1742
1824
|
modalType: "standard",
|
|
1743
1825
|
onClose: () => {
|
|
1744
|
-
|
|
1826
|
+
H(null), W(null);
|
|
1745
1827
|
},
|
|
1746
|
-
open: !!(
|
|
1828
|
+
open: !!(V && U),
|
|
1747
1829
|
showModalHeader: !0,
|
|
1748
1830
|
size: "wide",
|
|
1749
|
-
supportingText:
|
|
1831
|
+
supportingText: V?.filename ?? void 0,
|
|
1750
1832
|
title: "PDF 預覽",
|
|
1751
|
-
children:
|
|
1752
|
-
filename:
|
|
1753
|
-
fileUrl:
|
|
1754
|
-
onDownload:
|
|
1833
|
+
children: U ? /* @__PURE__ */ C(We, {
|
|
1834
|
+
filename: V?.filename ?? "PDF 預覽",
|
|
1835
|
+
fileUrl: U,
|
|
1836
|
+
onDownload: V ? () => void lt(V) : void 0
|
|
1755
1837
|
}) : null
|
|
1756
1838
|
}),
|
|
1757
1839
|
/* @__PURE__ */ C(h, {
|
|
1758
1840
|
cancelText: "保留案件",
|
|
1759
1841
|
confirmButtonProps: { variant: "destructive-primary" },
|
|
1760
1842
|
confirmText: "確認取消",
|
|
1761
|
-
loading:
|
|
1843
|
+
loading: Ve,
|
|
1762
1844
|
modalStatusType: "error",
|
|
1763
1845
|
modalType: "standard",
|
|
1764
|
-
onCancel: () =>
|
|
1765
|
-
onClose: () =>
|
|
1766
|
-
onConfirm: () => void
|
|
1846
|
+
onCancel: () => F(!1),
|
|
1847
|
+
onClose: () => F(!1),
|
|
1848
|
+
onConfirm: () => void dt(),
|
|
1767
1849
|
open: He,
|
|
1768
1850
|
showModalFooter: !0,
|
|
1769
1851
|
showModalHeader: !0,
|
|
1770
1852
|
supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
|
|
1771
1853
|
title: "取消案件",
|
|
1772
1854
|
children: /* @__PURE__ */ w("div", {
|
|
1773
|
-
style:
|
|
1855
|
+
style: cn,
|
|
1774
1856
|
children: [/* @__PURE__ */ w(x, {
|
|
1775
1857
|
variant: "body",
|
|
1776
1858
|
children: [
|
|
1777
1859
|
"確定要取消「",
|
|
1778
|
-
|
|
1860
|
+
T?.title ?? "",
|
|
1779
1861
|
"」嗎?"
|
|
1780
1862
|
]
|
|
1781
1863
|
}), /* @__PURE__ */ C(n, {
|
|
1782
1864
|
label: "取消原因",
|
|
1783
1865
|
name: "cancelComment",
|
|
1784
|
-
children: /* @__PURE__ */ C(
|
|
1785
|
-
onChange: (e) =>
|
|
1866
|
+
children: /* @__PURE__ */ C(y, {
|
|
1867
|
+
onChange: (e) => P(e.target.value),
|
|
1786
1868
|
placeholder: "可填寫取消原因",
|
|
1787
1869
|
resize: "vertical",
|
|
1788
1870
|
rows: 3,
|
|
1789
|
-
value:
|
|
1871
|
+
value: N
|
|
1790
1872
|
})
|
|
1791
1873
|
})]
|
|
1792
1874
|
})
|
|
1793
1875
|
})
|
|
1794
1876
|
] });
|
|
1795
1877
|
}
|
|
1796
|
-
function
|
|
1878
|
+
function dn(e) {
|
|
1797
1879
|
return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
|
|
1798
1880
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return e.edges.map(
|
|
1881
|
+
function fn(e) {
|
|
1882
|
+
return e.edges.map(dn).filter((e) => e.trim().length > 0);
|
|
1801
1883
|
}
|
|
1802
|
-
function
|
|
1884
|
+
function pn(e) {
|
|
1803
1885
|
return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
|
|
1804
1886
|
}
|
|
1805
|
-
function
|
|
1887
|
+
function mn(e, t, n, r) {
|
|
1806
1888
|
return e.nodes.map((e) => {
|
|
1807
|
-
let i =
|
|
1889
|
+
let i = bt(e, t, n, r);
|
|
1808
1890
|
return {
|
|
1809
1891
|
data: {
|
|
1810
|
-
kindLabel:
|
|
1892
|
+
kindLabel: pn(e.type),
|
|
1811
1893
|
label: e.data.label,
|
|
1812
1894
|
secondaryLabel: i.secondaryLabel,
|
|
1813
1895
|
statusLabel: i.statusLabel,
|
|
@@ -1821,36 +1903,36 @@ function fn(e, t, n, r) {
|
|
|
1821
1903
|
};
|
|
1822
1904
|
});
|
|
1823
1905
|
}
|
|
1824
|
-
function
|
|
1825
|
-
let t = new
|
|
1906
|
+
function hn(e) {
|
|
1907
|
+
let t = new Be.graphlib.Graph();
|
|
1826
1908
|
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
1827
1909
|
nodesep: 56,
|
|
1828
1910
|
rankdir: "LR",
|
|
1829
1911
|
ranksep: 120
|
|
1830
1912
|
}), e.nodes.forEach((e) => {
|
|
1831
1913
|
t.setNode(e.id, {
|
|
1832
|
-
height:
|
|
1833
|
-
width:
|
|
1914
|
+
height: Qt,
|
|
1915
|
+
width: Zt
|
|
1834
1916
|
});
|
|
1835
1917
|
}), e.edges.forEach((e) => {
|
|
1836
1918
|
t.setEdge(e.source, e.target);
|
|
1837
|
-
}),
|
|
1919
|
+
}), Be.layout(t), {
|
|
1838
1920
|
...e,
|
|
1839
1921
|
nodes: e.nodes.map((e) => {
|
|
1840
1922
|
let n = t.node(e.id);
|
|
1841
1923
|
return n ? {
|
|
1842
1924
|
...e,
|
|
1843
1925
|
position: {
|
|
1844
|
-
x: n.x -
|
|
1845
|
-
y: n.y -
|
|
1926
|
+
x: n.x - Zt / 2,
|
|
1927
|
+
y: n.y - Qt / 2
|
|
1846
1928
|
}
|
|
1847
1929
|
} : e;
|
|
1848
1930
|
})
|
|
1849
1931
|
};
|
|
1850
1932
|
}
|
|
1851
|
-
function
|
|
1933
|
+
function gn(e) {
|
|
1852
1934
|
return e.edges.map((e) => {
|
|
1853
|
-
let t =
|
|
1935
|
+
let t = dn(e);
|
|
1854
1936
|
return {
|
|
1855
1937
|
animated: !1,
|
|
1856
1938
|
id: e.id,
|
|
@@ -1878,25 +1960,25 @@ function mn(e) {
|
|
|
1878
1960
|
};
|
|
1879
1961
|
});
|
|
1880
1962
|
}
|
|
1881
|
-
function
|
|
1963
|
+
function _n(e) {
|
|
1882
1964
|
return e === "current" ? {
|
|
1883
|
-
|
|
1965
|
+
...tn,
|
|
1884
1966
|
border: "1px solid var(--mzn-color-primary, #0057ff)",
|
|
1885
1967
|
boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
|
|
1886
1968
|
} : e === "completed" ? {
|
|
1887
|
-
|
|
1969
|
+
...tn,
|
|
1888
1970
|
border: "1px solid #16a34a"
|
|
1889
1971
|
} : e === "cancelled" ? {
|
|
1890
|
-
|
|
1972
|
+
...tn,
|
|
1891
1973
|
border: "1px solid #dc2626",
|
|
1892
1974
|
opacity: .72
|
|
1893
1975
|
} : e === "waiting" ? {
|
|
1894
|
-
|
|
1976
|
+
...tn,
|
|
1895
1977
|
border: "1px dashed #64748b"
|
|
1896
|
-
} :
|
|
1978
|
+
} : tn;
|
|
1897
1979
|
}
|
|
1898
|
-
function
|
|
1899
|
-
let t =
|
|
1980
|
+
function vn(e) {
|
|
1981
|
+
let t = nn;
|
|
1900
1982
|
return e === "current" ? {
|
|
1901
1983
|
...t,
|
|
1902
1984
|
background: "#eff6ff",
|
|
@@ -1919,14 +2001,14 @@ function gn(e) {
|
|
|
1919
2001
|
color: "#64748b"
|
|
1920
2002
|
};
|
|
1921
2003
|
}
|
|
1922
|
-
function
|
|
2004
|
+
function yn({ data: e }) {
|
|
1923
2005
|
return /* @__PURE__ */ w("div", {
|
|
1924
|
-
style:
|
|
2006
|
+
style: _n(e.tone),
|
|
1925
2007
|
children: [
|
|
1926
|
-
/* @__PURE__ */ C(
|
|
2008
|
+
/* @__PURE__ */ C(Re, {
|
|
1927
2009
|
isConnectable: !1,
|
|
1928
2010
|
position: O.Left,
|
|
1929
|
-
style:
|
|
2011
|
+
style: an,
|
|
1930
2012
|
type: "target"
|
|
1931
2013
|
}),
|
|
1932
2014
|
/* @__PURE__ */ C(x, {
|
|
@@ -1937,24 +2019,24 @@ function _n({ data: e }) {
|
|
|
1937
2019
|
children: e.label
|
|
1938
2020
|
}),
|
|
1939
2021
|
/* @__PURE__ */ C("span", {
|
|
1940
|
-
style:
|
|
2022
|
+
style: vn(e.tone),
|
|
1941
2023
|
children: e.statusLabel
|
|
1942
2024
|
}),
|
|
1943
2025
|
/* @__PURE__ */ C("span", {
|
|
1944
2026
|
title: e.secondaryLabel,
|
|
1945
|
-
style:
|
|
2027
|
+
style: rn,
|
|
1946
2028
|
children: e.secondaryLabel || e.kindLabel
|
|
1947
2029
|
}),
|
|
1948
|
-
/* @__PURE__ */ C(
|
|
2030
|
+
/* @__PURE__ */ C(Re, {
|
|
1949
2031
|
isConnectable: !1,
|
|
1950
2032
|
position: O.Right,
|
|
1951
|
-
style:
|
|
2033
|
+
style: an,
|
|
1952
2034
|
type: "source"
|
|
1953
2035
|
})
|
|
1954
2036
|
]
|
|
1955
2037
|
});
|
|
1956
2038
|
}
|
|
1957
2039
|
//#endregion
|
|
1958
|
-
export {
|
|
2040
|
+
export { kt as a, Bt as i, Xt as n, Dt as o, Ut as r, un as t };
|
|
1959
2041
|
|
|
1960
|
-
//# sourceMappingURL=detail-
|
|
2042
|
+
//# sourceMappingURL=detail-DAak2OXS.js.map
|