@rytass/bpm-core-react 0.3.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -0
- package/README.md +69 -4
- package/dist/chunks/approval-instance-list-page-BtEc8Cs3.js +278 -0
- package/dist/chunks/approval-instance-list-page-BtEc8Cs3.js.map +1 -0
- package/dist/chunks/approval-instance-list-page-UNIIgUZy.cjs +2 -0
- package/dist/chunks/approval-instance-list-page-UNIIgUZy.cjs.map +1 -0
- package/dist/chunks/auth-provider-D2P-qWmY.cjs +2 -0
- package/dist/chunks/auth-provider-D2P-qWmY.cjs.map +1 -0
- package/dist/chunks/auth-provider-TTO9eNZV.js +83 -0
- package/dist/chunks/auth-provider-TTO9eNZV.js.map +1 -0
- package/dist/chunks/{builder-D950gct_.js → builder-C3E-8OJu.js} +474 -478
- package/dist/chunks/builder-C3E-8OJu.js.map +1 -0
- package/dist/chunks/builder-f-Q_0NUs.cjs +3 -0
- package/dist/chunks/builder-f-Q_0NUs.cjs.map +1 -0
- package/dist/chunks/categories-B6QZKZRt.cjs +2 -0
- package/dist/chunks/categories-B6QZKZRt.cjs.map +1 -0
- package/dist/chunks/categories-DBPoSrsi.js +382 -0
- package/dist/chunks/categories-DBPoSrsi.js.map +1 -0
- package/dist/chunks/chunk-CMqjfN_6.cjs +1 -0
- package/dist/chunks/dashboard-page-CQRBJxze.js +119 -0
- package/dist/chunks/dashboard-page-CQRBJxze.js.map +1 -0
- package/dist/chunks/dashboard-page-DrDChhg1.cjs +2 -0
- package/dist/chunks/dashboard-page-DrDChhg1.cjs.map +1 -0
- package/dist/chunks/delegations-CFXaJrdX.cjs +2 -0
- package/dist/chunks/delegations-CFXaJrdX.cjs.map +1 -0
- package/dist/chunks/delegations-D5pPEWsP.js +641 -0
- package/dist/chunks/delegations-D5pPEWsP.js.map +1 -0
- package/dist/chunks/delegations-DwbYkNUg.cjs +2 -0
- package/dist/chunks/delegations-DwbYkNUg.cjs.map +1 -0
- package/dist/chunks/delegations-FTLaWo1Y.js +568 -0
- package/dist/chunks/delegations-FTLaWo1Y.js.map +1 -0
- package/dist/chunks/detail-B9JkYNHc.cjs +2 -0
- package/dist/chunks/detail-B9JkYNHc.cjs.map +1 -0
- package/dist/chunks/detail-CSxI04gB.js +1518 -0
- package/dist/chunks/detail-CSxI04gB.js.map +1 -0
- package/dist/chunks/format-date-time-XxBzF0F5.cjs +2 -0
- package/dist/chunks/{format-date-time-26_pFvv4.cjs.map → format-date-time-XxBzF0F5.cjs.map} +1 -1
- package/dist/chunks/login-BfmfCclF.cjs +2 -0
- package/dist/chunks/{login-CQ9MfwcC.cjs.map → login-BfmfCclF.cjs.map} +1 -1
- package/dist/chunks/{login-C20yVxbc.js → login-xgI4wLHe.js} +3 -2
- package/dist/chunks/{login-C20yVxbc.js.map → login-xgI4wLHe.js.map} +1 -1
- package/dist/chunks/notifications-BoNa1BXD.js +193 -0
- package/dist/chunks/notifications-BoNa1BXD.js.map +1 -0
- package/dist/chunks/notifications-a-FCxV02.cjs +2 -0
- package/dist/chunks/notifications-a-FCxV02.cjs.map +1 -0
- package/dist/chunks/orgs-BIiqzHvb.cjs +2 -0
- package/dist/chunks/orgs-BIiqzHvb.cjs.map +1 -0
- package/dist/chunks/orgs-Cc18umVt.js +1944 -0
- package/dist/chunks/orgs-Cc18umVt.js.map +1 -0
- package/dist/chunks/router-adapter-BdHZXLS3.js +23 -0
- package/dist/chunks/router-adapter-BdHZXLS3.js.map +1 -0
- package/dist/chunks/router-adapter-BybHrCNP.cjs +2 -0
- package/dist/chunks/router-adapter-BybHrCNP.cjs.map +1 -0
- package/dist/chunks/templates-CL8bPvgn.cjs +2 -0
- package/dist/chunks/templates-CL8bPvgn.cjs.map +1 -0
- package/dist/chunks/templates-DNfDOPGm.js +380 -0
- package/dist/chunks/templates-DNfDOPGm.js.map +1 -0
- package/dist/chunks/users-CUY139DF.js +214 -0
- package/dist/chunks/users-CUY139DF.js.map +1 -0
- package/dist/chunks/users-qghSMtLn.cjs +2 -0
- package/dist/chunks/users-qghSMtLn.cjs.map +1 -0
- package/dist/components/approval-instance-list-page.d.ts +1 -2
- package/dist/components/bpm-notification-bell-button.d.ts +22 -0
- package/dist/components/dashboard-page.d.ts +1 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +206 -97
- package/dist/index.js.map +1 -1
- package/dist/lib/notification-drawer-provider.d.ts +3 -2
- package/dist/lib/notification-unread-provider.d.ts +6 -5
- package/dist/lib/providers.d.ts +3 -2
- package/dist/lib/use-bpm-logout.d.ts +12 -0
- package/dist/lib/use-bpm-member.d.ts +11 -0
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/forms/builder/index.cjs +1 -1
- package/dist/pages/forms/builder/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/login/index.cjs +1 -1
- package/dist/pages/login/index.js +1 -1
- package/dist/pages/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/index.js +1 -1
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/index.cjs +1 -1
- package/dist/pages/templates/index.js +1 -1
- package/dist/views/admin/delegations/AdminDelegationsView.d.ts +1 -4
- 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/AdminOrgsView.d.ts +1 -4
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/AdminUsersView.d.ts +1 -4
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/cc/CcView.d.ts +1 -3
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.cjs.map +1 -1
- package/dist/views/cc/index.js +2 -3
- package/dist/views/cc/index.js.map +1 -1
- package/dist/views/dashboard/DashboardView.d.ts +1 -3
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.cjs.map +1 -1
- package/dist/views/dashboard/index.js +3 -3
- package/dist/views/dashboard/index.js.map +1 -1
- package/dist/views/delegations/DelegationsView.d.ts +1 -4
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/FormsView.d.ts +1 -3
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/index.cjs +1 -1
- package/dist/views/forms/index.cjs.map +1 -1
- package/dist/views/forms/index.js +95 -99
- package/dist/views/forms/index.js.map +1 -1
- package/dist/views/inbox/InboxView.d.ts +1 -3
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +91 -94
- package/dist/views/inbox/index.js.map +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +71 -77
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/login/index.cjs +1 -1
- package/dist/views/login/index.js +1 -1
- package/dist/views/root/RootView.d.ts +1 -3
- package/dist/views/search/SearchView.d.ts +1 -3
- package/dist/views/search/index.cjs +1 -1
- package/dist/views/search/index.cjs.map +1 -1
- package/dist/views/search/index.js +2 -3
- package/dist/views/search/index.js.map +1 -1
- package/dist/views/sent/SentView.d.ts +1 -3
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.cjs.map +1 -1
- package/dist/views/sent/index.js +2 -3
- package/dist/views/sent/index.js.map +1 -1
- package/dist/views/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/SettingsNotificationsView.d.ts +1 -4
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/index.js +1 -1
- package/dist/views/templates/TemplatesView.d.ts +1 -4
- package/dist/views/templates/categories/TemplateCategoriesView.d.ts +1 -4
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.js +1 -1
- package/dist/views/templates/designer/TemplateDesignerView.d.ts +1 -2
- package/dist/views/templates/designer/index.cjs +7 -7
- package/dist/views/templates/designer/index.cjs.map +1 -1
- package/dist/views/templates/designer/index.js +707 -711
- package/dist/views/templates/designer/index.js.map +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.js +2 -2
- package/dist/views/templates/versions/TemplateVersionsView.d.ts +1 -2
- package/dist/views/templates/versions/index.cjs +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js +45 -49
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/app-navigation.css +0 -1
- package/dist/chunks/app-navigation-BSkMsEhy.js +0 -268
- package/dist/chunks/app-navigation-BSkMsEhy.js.map +0 -1
- package/dist/chunks/app-navigation-KnlJCUp1.cjs +0 -2
- package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +0 -2
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-CqNdoZqx.js +0 -282
- package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +0 -1
- package/dist/chunks/auth-provider-BV8Iiwfb.cjs +0 -2
- package/dist/chunks/auth-provider-BV8Iiwfb.cjs.map +0 -1
- package/dist/chunks/auth-provider-Bnox5gsx.js +0 -98
- package/dist/chunks/auth-provider-Bnox5gsx.js.map +0 -1
- package/dist/chunks/builder-CMlJfQHE.cjs +0 -3
- package/dist/chunks/builder-CMlJfQHE.cjs.map +0 -1
- package/dist/chunks/builder-D950gct_.js.map +0 -1
- package/dist/chunks/categories-5yEM3p3N.cjs +0 -2
- package/dist/chunks/categories-5yEM3p3N.cjs.map +0 -1
- package/dist/chunks/categories-BIpOG451.js +0 -387
- package/dist/chunks/categories-BIpOG451.js.map +0 -1
- package/dist/chunks/dashboard-page-Bx1-Ys3e.js +0 -122
- package/dist/chunks/dashboard-page-Bx1-Ys3e.js.map +0 -1
- package/dist/chunks/dashboard-page-CQNRbMkJ.cjs +0 -2
- package/dist/chunks/dashboard-page-CQNRbMkJ.cjs.map +0 -1
- package/dist/chunks/delegations-B2j-wNEO.js +0 -646
- package/dist/chunks/delegations-B2j-wNEO.js.map +0 -1
- package/dist/chunks/delegations-CsB9ozLu.cjs +0 -2
- package/dist/chunks/delegations-CsB9ozLu.cjs.map +0 -1
- package/dist/chunks/delegations-CvtwTXNP.cjs +0 -2
- package/dist/chunks/delegations-CvtwTXNP.cjs.map +0 -1
- package/dist/chunks/delegations-dKodb0WW.js +0 -573
- package/dist/chunks/delegations-dKodb0WW.js.map +0 -1
- package/dist/chunks/detail-BcGAqJ_R.js +0 -1523
- package/dist/chunks/detail-BcGAqJ_R.js.map +0 -1
- package/dist/chunks/detail-CqjqLd65.cjs +0 -2
- package/dist/chunks/detail-CqjqLd65.cjs.map +0 -1
- package/dist/chunks/format-date-time-26_pFvv4.cjs +0 -2
- package/dist/chunks/login-CQ9MfwcC.cjs +0 -2
- package/dist/chunks/notifications-2swRqDPF.js +0 -198
- package/dist/chunks/notifications-2swRqDPF.js.map +0 -1
- package/dist/chunks/notifications-BaYDebFt.cjs +0 -2
- package/dist/chunks/notifications-BaYDebFt.cjs.map +0 -1
- package/dist/chunks/orgs-CuHxxd_n.js +0 -1949
- package/dist/chunks/orgs-CuHxxd_n.js.map +0 -1
- package/dist/chunks/orgs-YMiVLNvL.cjs +0 -2
- package/dist/chunks/orgs-YMiVLNvL.cjs.map +0 -1
- package/dist/chunks/templates-DTkbSgFY.cjs +0 -2
- package/dist/chunks/templates-DTkbSgFY.cjs.map +0 -1
- package/dist/chunks/templates-DoDWM68t.js +0 -384
- package/dist/chunks/templates-DoDWM68t.js.map +0 -1
- package/dist/chunks/users-3ySyUW4u.cjs +0 -2
- package/dist/chunks/users-3ySyUW4u.cjs.map +0 -1
- package/dist/chunks/users-sMfrSjRQ.js +0 -219
- package/dist/chunks/users-sMfrSjRQ.js.map +0 -1
- package/dist/components/app-navigation.d.ts +0 -41
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { t } from "../../../chunks/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
2
|
+
import { r as e } from "../../../chunks/router-adapter-BdHZXLS3.js";
|
|
3
|
+
import { r as t } from "../../../chunks/routes-config-dxahImVe.js";
|
|
4
|
+
import { a as n, n as r, o as i, r as a } from "../../../chunks/admin-pickers-DLlG_1du.js";
|
|
5
|
+
import { t as o } from "../../../chunks/bpm-form-field-Cao0rMol.js";
|
|
6
|
+
import { useCallback as s, useEffect as c, useMemo as l, useRef as ee, useState as u } from "react";
|
|
7
|
+
import { AutoComplete as te, Button as d, Icon as ne, Input as re, Modal as ie, PageHeader as ae, Section as oe, SectionGroup as se, Select as f, Textarea as ce, Toggle as le, Typography as p } from "@mezzanine-ui/react";
|
|
8
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import ue from "@mezzanine-ui/react/ContentHeader";
|
|
10
10
|
import { CheckedIcon as de, DotGridIcon as fe, EyeIcon as pe, FilterIcon as me, MailIcon as he, SaveIcon as ge, TrashIcon as _e, UserIcon as ve } from "@mezzanine-ui/icons";
|
|
11
|
-
import ye from "@
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { dryRunApprovalWorkflow as Ae, forkApprovalTemplate as je, publishApprovalTemplateVersion as Me, readTemplateDesigner as Ne, resolveMemberOptions as Pe, searchMemberOptions as Fe, searchPublishedFormVersionOptions as Ie, updateApprovalTemplateDraft as Le } from "@rytass/bpm-core-client/template";
|
|
11
|
+
import { readOrganizationDashboard as ye } from "@rytass/bpm-core-client/organization";
|
|
12
|
+
import { Background as be, ConnectionMode as xe, ControlButton as Se, Controls as Ce, Handle as _, MiniMap as we, Panel as v, Position as y, ReactFlow as Te, applyNodeChanges as Ee, getViewportForBounds as De } from "@xyflow/react";
|
|
13
|
+
import * as Oe from "dagre";
|
|
14
|
+
import { dryRunApprovalWorkflow as ke, forkApprovalTemplate as Ae, publishApprovalTemplateVersion as je, readTemplateDesigner as Me, resolveMemberOptions as Ne, searchMemberOptions as Pe, searchPublishedFormVersionOptions as Fe, updateApprovalTemplateDraft as Ie } from "@rytass/bpm-core-client/template";
|
|
16
15
|
//#region src/views/templates/designer/TemplateDesignerView.tsx
|
|
17
|
-
var
|
|
16
|
+
var Le = {
|
|
18
17
|
display: "grid",
|
|
19
18
|
gap: 16
|
|
20
|
-
},
|
|
19
|
+
}, Re = {
|
|
21
20
|
alignItems: "start",
|
|
22
21
|
display: "grid",
|
|
23
22
|
gap: 16,
|
|
24
23
|
gridTemplateColumns: "minmax(0, 1fr) 420px"
|
|
25
|
-
},
|
|
24
|
+
}, ze = {
|
|
26
25
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
27
26
|
borderRadius: 6,
|
|
28
27
|
height: 620,
|
|
29
28
|
minWidth: 0,
|
|
30
29
|
overflow: "hidden"
|
|
31
|
-
},
|
|
30
|
+
}, Be = {
|
|
32
31
|
alignItems: "center",
|
|
33
32
|
boxSizing: "border-box",
|
|
34
33
|
color: "var(--mzn-color-text-error)",
|
|
@@ -38,24 +37,24 @@ var Re = {
|
|
|
38
37
|
lineHeight: 0,
|
|
39
38
|
padding: 0,
|
|
40
39
|
width: 26
|
|
41
|
-
},
|
|
40
|
+
}, Ve = {
|
|
42
41
|
alignItems: "center",
|
|
43
42
|
display: "flex",
|
|
44
43
|
height: "100%",
|
|
45
44
|
justifyContent: "center",
|
|
46
45
|
width: "100%"
|
|
47
|
-
},
|
|
48
|
-
.${
|
|
49
|
-
.${
|
|
50
|
-
flex: 0 0 ${
|
|
51
|
-
width: ${
|
|
46
|
+
}, He = "workflow-designer-side-panel", b = 96, Ue = `
|
|
47
|
+
.${He} .mzn-form-field--stretch .mzn-form-field__label-area,
|
|
48
|
+
.${He} .mzn-form-field--horizontal .mzn-form-field__label-area {
|
|
49
|
+
flex: 0 0 ${b}px;
|
|
50
|
+
width: ${b}px;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
.${
|
|
55
|
-
.${
|
|
53
|
+
.${He} .mzn-form-field--stretch .mzn-form-field__data-entry,
|
|
54
|
+
.${He} .mzn-form-field--horizontal .mzn-form-field__data-entry {
|
|
56
55
|
min-width: 0;
|
|
57
56
|
}
|
|
58
|
-
`,
|
|
57
|
+
`, We = "#2563eb", x = "#64748b", Ge = "var(--mzn-color-text-error, #dc2626)", Ke = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", qe = `
|
|
59
58
|
.workflow-selection-delete-control.react-flow__controls-button {
|
|
60
59
|
align-items: center !important;
|
|
61
60
|
display: flex !important;
|
|
@@ -80,26 +79,26 @@ var Re = {
|
|
|
80
79
|
|
|
81
80
|
.workflow-edge--selected .react-flow__edge-path,
|
|
82
81
|
.react-flow__edge-path.workflow-edge--selected {
|
|
83
|
-
filter: ${
|
|
82
|
+
filter: ${Ke};
|
|
84
83
|
opacity: 1 !important;
|
|
85
|
-
stroke: ${
|
|
84
|
+
stroke: ${x} !important;
|
|
86
85
|
stroke-opacity: 1 !important;
|
|
87
86
|
stroke-width: 1.5px !important;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
.workflow-edge--selected {
|
|
91
|
-
--xy-edge-stroke: ${
|
|
92
|
-
--xy-edge-stroke-selected: ${
|
|
90
|
+
--xy-edge-stroke: ${x};
|
|
91
|
+
--xy-edge-stroke-selected: ${x};
|
|
93
92
|
--xy-edge-stroke-width: 1.5px;
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
`,
|
|
95
|
+
`, Je = {
|
|
97
96
|
display: "grid",
|
|
98
97
|
gap: 12
|
|
99
|
-
},
|
|
98
|
+
}, S = {
|
|
100
99
|
display: "grid",
|
|
101
100
|
gap: 12
|
|
102
|
-
},
|
|
101
|
+
}, Ye = {
|
|
103
102
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
104
103
|
borderRadius: 6,
|
|
105
104
|
display: "grid",
|
|
@@ -107,19 +106,19 @@ var Re = {
|
|
|
107
106
|
maxHeight: 360,
|
|
108
107
|
overflow: "auto",
|
|
109
108
|
padding: 12
|
|
110
|
-
},
|
|
109
|
+
}, Xe = {
|
|
111
110
|
borderBottom: "1px solid var(--mzn-color-border-neutral)",
|
|
112
111
|
display: "grid",
|
|
113
112
|
gap: 4,
|
|
114
113
|
padding: "0 0 8px"
|
|
115
|
-
},
|
|
114
|
+
}, Ze = {
|
|
116
115
|
display: "flex",
|
|
117
116
|
flexWrap: "wrap",
|
|
118
117
|
gap: 8
|
|
119
|
-
},
|
|
118
|
+
}, Qe = {
|
|
120
119
|
display: "grid",
|
|
121
120
|
gap: 8
|
|
122
|
-
},
|
|
121
|
+
}, C = {
|
|
123
122
|
alignContent: "center",
|
|
124
123
|
background: "var(--mzn-color-bg-surface)",
|
|
125
124
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
@@ -134,46 +133,46 @@ var Re = {
|
|
|
134
133
|
padding: "10px 12px",
|
|
135
134
|
textAlign: "center",
|
|
136
135
|
width: "100%"
|
|
137
|
-
},
|
|
138
|
-
...
|
|
136
|
+
}, $e = "0 8px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--mzn-color-primary, #0057ff), 0 0 10px rgba(0, 87, 255, 0.3)", et = 64, w = 160, T = 20, E = 64, D = 180, O = {
|
|
137
|
+
...C,
|
|
139
138
|
display: "grid",
|
|
140
139
|
gap: 8,
|
|
141
140
|
padding: "10px 12px"
|
|
142
|
-
},
|
|
143
|
-
...
|
|
141
|
+
}, tt = {
|
|
142
|
+
...O,
|
|
144
143
|
background: "#eff6ff",
|
|
145
144
|
border: "1px solid #2563eb"
|
|
146
|
-
},
|
|
147
|
-
...
|
|
145
|
+
}, k = {
|
|
146
|
+
...O,
|
|
148
147
|
background: "#f0fdfa",
|
|
149
148
|
border: "1px solid #0f766e"
|
|
150
|
-
},
|
|
151
|
-
...
|
|
149
|
+
}, nt = {
|
|
150
|
+
...C,
|
|
152
151
|
background: "#ffffff"
|
|
153
|
-
},
|
|
154
|
-
...
|
|
152
|
+
}, A = {
|
|
153
|
+
...C,
|
|
155
154
|
background: "#ecfdf3",
|
|
156
155
|
border: "1px solid #2f855a"
|
|
157
|
-
},
|
|
158
|
-
...
|
|
156
|
+
}, rt = {
|
|
157
|
+
...C,
|
|
159
158
|
background: "#fff4ed",
|
|
160
159
|
border: "1px solid #c2410c"
|
|
161
|
-
},
|
|
160
|
+
}, it = {
|
|
162
161
|
display: "block",
|
|
163
162
|
maxWidth: "100%",
|
|
164
163
|
minWidth: 0
|
|
165
|
-
},
|
|
164
|
+
}, at = {
|
|
166
165
|
display: "grid",
|
|
167
166
|
gap: 2,
|
|
168
167
|
minWidth: 0
|
|
169
|
-
},
|
|
168
|
+
}, j = "input", ot = "output", st = {
|
|
170
169
|
endEvent: "結束",
|
|
171
170
|
exclusiveGateway: "條件分流",
|
|
172
171
|
parallelGateway: "並行處理",
|
|
173
172
|
serviceTask: "系統",
|
|
174
173
|
startEvent: "開始",
|
|
175
174
|
userTask: "簽核"
|
|
176
|
-
},
|
|
175
|
+
}, ct = [{
|
|
177
176
|
icon: ve,
|
|
178
177
|
label: "簽核節點",
|
|
179
178
|
type: "userTask"
|
|
@@ -181,23 +180,23 @@ var Re = {
|
|
|
181
180
|
icon: he,
|
|
182
181
|
label: "知會節點",
|
|
183
182
|
type: "serviceTask"
|
|
184
|
-
}],
|
|
183
|
+
}], lt = [{
|
|
185
184
|
icon: me,
|
|
186
185
|
label: "條件分流",
|
|
187
186
|
type: "exclusiveGateway"
|
|
188
|
-
}],
|
|
187
|
+
}], ut = [{
|
|
189
188
|
id: "AND",
|
|
190
189
|
name: "全部前置完成"
|
|
191
190
|
}, {
|
|
192
191
|
id: "OR",
|
|
193
192
|
name: "任一前置完成"
|
|
194
|
-
}],
|
|
193
|
+
}], dt = [{
|
|
195
194
|
id: "RESTART",
|
|
196
195
|
name: "重新送出後從開始重跑"
|
|
197
196
|
}, {
|
|
198
197
|
id: "FROM_RETURN_POINT",
|
|
199
198
|
name: "重新送出後回到退回節點"
|
|
200
|
-
}],
|
|
199
|
+
}], ft = [
|
|
201
200
|
{
|
|
202
201
|
id: "DIRECT",
|
|
203
202
|
name: "指定會員"
|
|
@@ -238,13 +237,13 @@ var Re = {
|
|
|
238
237
|
name: "第三層主管",
|
|
239
238
|
value: 3
|
|
240
239
|
}
|
|
241
|
-
],
|
|
240
|
+
], pt = [{
|
|
242
241
|
id: "NONE",
|
|
243
242
|
name: "停止流程並提示"
|
|
244
243
|
}, {
|
|
245
244
|
id: "DIRECT",
|
|
246
245
|
name: "固定改派"
|
|
247
|
-
}],
|
|
246
|
+
}], mt = [
|
|
248
247
|
{
|
|
249
248
|
id: "EQUALS",
|
|
250
249
|
name: "等於"
|
|
@@ -305,178 +304,178 @@ var Re = {
|
|
|
305
304
|
id: "CUSTOM",
|
|
306
305
|
name: "既有自訂規則"
|
|
307
306
|
}, vt = "member-001", yt = {
|
|
308
|
-
endEvent:
|
|
309
|
-
exclusiveGateway:
|
|
310
|
-
parallelGateway:
|
|
311
|
-
serviceTask:
|
|
312
|
-
startEvent:
|
|
313
|
-
userTask:
|
|
307
|
+
endEvent: N,
|
|
308
|
+
exclusiveGateway: N,
|
|
309
|
+
parallelGateway: N,
|
|
310
|
+
serviceTask: N,
|
|
311
|
+
startEvent: N,
|
|
312
|
+
userTask: N
|
|
314
313
|
};
|
|
315
|
-
function bt({ templateId:
|
|
316
|
-
let
|
|
314
|
+
function bt({ templateId: n }) {
|
|
315
|
+
let i = e(), fe = t(), [me, he] = u(null), [ve, _] = u(null), [v, y] = u(zt()), [De, Oe] = u(""), [b, We] = u(null), [x, Ke] = u(null), [C, $e] = u(null), [et, w] = u(null), [T, E] = u("start"), [D, O] = u([]), [tt, k] = u(null), [nt, A] = u(null), [rt, it] = u(!0), [at, j] = u(!1), [ot, mt] = u(!1), [ht, bt] = u([]), N = l(() => JSON.stringify({
|
|
317
316
|
formDefinitionVersionId: b,
|
|
318
|
-
initiatorPolicyCel:
|
|
317
|
+
initiatorPolicyCel: x,
|
|
319
318
|
workflowDefinition: v
|
|
320
319
|
}), [
|
|
321
320
|
b,
|
|
322
|
-
|
|
321
|
+
x,
|
|
323
322
|
v
|
|
324
|
-
]),
|
|
323
|
+
]), St = !!De && N !== De, [Ct, wt] = u(!1), [P, F] = u([]), [I, Et] = u([]), [L, jt] = u([]), [Mt, It] = u([]), [Lt, Rt] = u(!1), [Zt, en] = u(!1), [nn, B] = u("{}"), [V, cn] = u(null), [fn, mn] = u(null), [H, U] = u(void 0), Tn = ee(null);
|
|
325
324
|
c(() => {
|
|
326
|
-
|
|
327
|
-
}, [
|
|
325
|
+
Qn();
|
|
326
|
+
}, [n]), c(() => {
|
|
328
327
|
function e(e) {
|
|
329
|
-
|
|
328
|
+
St && (e.preventDefault(), e.returnValue = "");
|
|
330
329
|
}
|
|
331
330
|
return window.addEventListener("beforeunload", e), () => {
|
|
332
331
|
window.removeEventListener("beforeunload", e);
|
|
333
332
|
};
|
|
334
|
-
}, [
|
|
335
|
-
|
|
336
|
-
}, [v,
|
|
337
|
-
y((e) =>
|
|
333
|
+
}, [St]), c(() => {
|
|
334
|
+
nr(v);
|
|
335
|
+
}, [v, P]), c(() => {
|
|
336
|
+
y((e) => At(e));
|
|
338
337
|
}, [v.edges, v.nodes]);
|
|
339
|
-
function
|
|
340
|
-
|
|
338
|
+
function En() {
|
|
339
|
+
St && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || i.push(fe.templates());
|
|
341
340
|
}
|
|
342
|
-
let
|
|
343
|
-
let e =
|
|
341
|
+
let W = l(() => v.nodes.find((e) => e.id === T) ?? null, [T, v.nodes]), Dn = W ? sn(W) : !1, kn = D.length > 0 || Dn, Mn = s(() => {
|
|
342
|
+
let e = W && sn(W) ? W.id : null;
|
|
344
343
|
y((t) => ({
|
|
345
344
|
...t,
|
|
346
|
-
edges: t.edges.filter((t) => !
|
|
345
|
+
edges: t.edges.filter((t) => !D.includes(t.id) && t.source !== e && t.target !== e),
|
|
347
346
|
nodes: e ? t.nodes.filter((t) => t.id !== e) : t.nodes
|
|
348
|
-
})),
|
|
349
|
-
}, [
|
|
347
|
+
})), O([]), k(null), e && E("start");
|
|
348
|
+
}, [D, W]);
|
|
350
349
|
c(() => {
|
|
351
|
-
if (!
|
|
350
|
+
if (!kn) return;
|
|
352
351
|
function e(e) {
|
|
353
|
-
e.key !== "Delete" && e.key !== "Backspace" || ln(e.target) || (e.preventDefault(),
|
|
352
|
+
e.key !== "Delete" && e.key !== "Backspace" || ln(e.target) || (e.preventDefault(), Mn());
|
|
354
353
|
}
|
|
355
354
|
return window.addEventListener("keydown", e), () => {
|
|
356
355
|
window.removeEventListener("keydown", e);
|
|
357
356
|
};
|
|
358
|
-
}, [
|
|
359
|
-
let
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
]),
|
|
364
|
-
|
|
357
|
+
}, [kn, Mn]);
|
|
358
|
+
let Nn = l(() => v.edges.find((e) => e.id === tt) ?? null, [tt, v.edges]), Pn = l(() => D.length === 1 ? v.edges.find((e) => e.id === D[0]) ?? null : null, [D, v.edges]), Fn = l(() => D.map((e) => v.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [D, v.edges]), G = l(() => et ?? Qt(x, C), [
|
|
359
|
+
x,
|
|
360
|
+
et,
|
|
361
|
+
C
|
|
362
|
+
]), Rn = l(() => v.nodes.map((e) => Tt(e, P, I, L, e.id === T, G)), [
|
|
363
|
+
G,
|
|
364
|
+
P,
|
|
365
365
|
I,
|
|
366
366
|
L,
|
|
367
|
-
|
|
368
|
-
w,
|
|
367
|
+
T,
|
|
369
368
|
v.nodes
|
|
370
|
-
]),
|
|
371
|
-
|
|
369
|
+
]), Wn = l(() => v.edges.map((e) => Dt(e, v.nodes, D.includes(e.id))), [
|
|
370
|
+
D,
|
|
372
371
|
v.edges,
|
|
373
372
|
v.nodes
|
|
374
|
-
]),
|
|
373
|
+
]), K = l(() => z(ht, b) ?? z(un(me?.formVersions ?? []), b), [
|
|
375
374
|
b,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
]),
|
|
379
|
-
async function
|
|
380
|
-
|
|
375
|
+
ht,
|
|
376
|
+
me?.formVersions
|
|
377
|
+
]), Xn = l(() => _n(ht, K), [ht, K]), q = l(() => Ln(v), [v]), J = l(() => zn(v), [v]), Y = l(() => $t(G), [G]);
|
|
378
|
+
async function Qn() {
|
|
379
|
+
it(!0), A(null);
|
|
381
380
|
try {
|
|
382
|
-
let [e, t] = await Promise.all([
|
|
383
|
-
|
|
381
|
+
let [e, t] = await Promise.all([Me(n), ye()]), r = e.versions.find((e) => e.status === "DRAFT") ?? null, i = r ?? e.versions[0] ?? null;
|
|
382
|
+
he(e), _(r), Et(t.orgUnits), jt(t.positions), It(t.memberships), bt(un(e.formVersions));
|
|
384
383
|
let a = i?.workflowDefinition ?? zt(), o = i?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, s = i?.initiatorPolicyCel ?? null;
|
|
385
|
-
y(a),
|
|
384
|
+
y(a), We(o), Ke(s), Oe(JSON.stringify({
|
|
386
385
|
formDefinitionVersionId: o,
|
|
387
386
|
initiatorPolicyCel: s,
|
|
388
387
|
workflowDefinition: a
|
|
389
|
-
})),
|
|
388
|
+
})), $e(i && !e.template.currentVersionId && !i.initiatorPolicyCel && Bt(i.workflowDefinition) ? "NONE" : null), w(null), E(i?.workflowDefinition.nodes[0]?.id ?? "start"), O([]), k(null);
|
|
390
389
|
} catch (e) {
|
|
391
|
-
|
|
390
|
+
A(Q(e));
|
|
392
391
|
} finally {
|
|
393
|
-
|
|
392
|
+
it(!1);
|
|
394
393
|
}
|
|
395
394
|
}
|
|
396
|
-
async function
|
|
397
|
-
|
|
395
|
+
async function er(e) {
|
|
396
|
+
mt(!0), A(null);
|
|
398
397
|
try {
|
|
399
|
-
|
|
398
|
+
bt(_n(un(await Fe(e)), K));
|
|
400
399
|
} catch (e) {
|
|
401
|
-
|
|
400
|
+
A(Q(e));
|
|
402
401
|
} finally {
|
|
403
|
-
|
|
402
|
+
mt(!1);
|
|
404
403
|
}
|
|
405
404
|
}
|
|
406
|
-
async function
|
|
407
|
-
|
|
405
|
+
async function Z(e) {
|
|
406
|
+
wt(!0), A(null);
|
|
408
407
|
try {
|
|
409
|
-
let t = await
|
|
410
|
-
|
|
408
|
+
let t = await Pe(e);
|
|
409
|
+
F((e) => An(e, vn(t)));
|
|
411
410
|
} catch (e) {
|
|
412
|
-
|
|
411
|
+
A(Q(e));
|
|
413
412
|
} finally {
|
|
414
|
-
|
|
413
|
+
wt(!1);
|
|
415
414
|
}
|
|
416
415
|
}
|
|
417
|
-
async function
|
|
418
|
-
let t =
|
|
416
|
+
async function nr(e) {
|
|
417
|
+
let t = jn(e).filter((e) => !P.some((t) => t.memberId === e));
|
|
419
418
|
if (t.length !== 0) try {
|
|
420
|
-
let e = await
|
|
421
|
-
|
|
419
|
+
let e = await Ne(t);
|
|
420
|
+
F((t) => An(t, vn(e)));
|
|
422
421
|
} catch {
|
|
423
|
-
|
|
422
|
+
F((e) => An(e, t.map(yn)));
|
|
424
423
|
}
|
|
425
424
|
}
|
|
426
|
-
async function
|
|
427
|
-
|
|
425
|
+
async function rr() {
|
|
426
|
+
j(!0), A(null);
|
|
428
427
|
try {
|
|
429
|
-
let e = Ln(v), t = $t(
|
|
428
|
+
let e = Ln(v), t = $t(G);
|
|
430
429
|
if (e || t) {
|
|
431
430
|
let n = e ?? t ?? "流程設定未完成";
|
|
432
|
-
throw
|
|
431
|
+
throw A(n), Error(n);
|
|
433
432
|
}
|
|
434
|
-
let
|
|
433
|
+
let r = await Ie({
|
|
435
434
|
formDefinitionVersionId: b,
|
|
436
|
-
initiatorPolicyCel:
|
|
437
|
-
versionId: (
|
|
435
|
+
initiatorPolicyCel: x,
|
|
436
|
+
versionId: (ve ?? await Ae(n)).id,
|
|
438
437
|
workflowDefinition: v
|
|
439
438
|
});
|
|
440
|
-
return _(
|
|
439
|
+
return _(r), await Qn(), r;
|
|
441
440
|
} catch (e) {
|
|
442
|
-
throw
|
|
441
|
+
throw A(Q(e)), e;
|
|
443
442
|
} finally {
|
|
444
|
-
|
|
443
|
+
j(!1);
|
|
445
444
|
}
|
|
446
445
|
}
|
|
447
|
-
async function
|
|
448
|
-
|
|
446
|
+
async function ir() {
|
|
447
|
+
j(!0), A(null);
|
|
449
448
|
try {
|
|
450
|
-
await
|
|
449
|
+
await je((await rr()).id), await Qn();
|
|
451
450
|
} catch (e) {
|
|
452
|
-
|
|
451
|
+
A(Q(e));
|
|
453
452
|
} finally {
|
|
454
|
-
|
|
453
|
+
j(!1);
|
|
455
454
|
}
|
|
456
455
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
456
|
+
function ar() {
|
|
457
|
+
B(JSON.stringify(dn(K), null, 2)), cn(null), mn(null), Rt(!0);
|
|
459
458
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
459
|
+
function or() {
|
|
460
|
+
Zt || Rt(!1);
|
|
462
461
|
}
|
|
463
|
-
async function
|
|
464
|
-
|
|
462
|
+
async function sr() {
|
|
463
|
+
en(!0), mn(null), cn(null);
|
|
465
464
|
try {
|
|
466
|
-
|
|
467
|
-
formData:
|
|
465
|
+
cn(await ke({
|
|
466
|
+
formData: pn(nn),
|
|
468
467
|
initiatorMemberId: vt,
|
|
469
|
-
initiatorMetadataSnapshot:
|
|
468
|
+
initiatorMetadataSnapshot: wn(vt, Mt),
|
|
470
469
|
workflowDefinition: v
|
|
471
470
|
}));
|
|
472
471
|
} catch (e) {
|
|
473
|
-
|
|
472
|
+
mn(Q(e));
|
|
474
473
|
} finally {
|
|
475
|
-
|
|
474
|
+
en(!1);
|
|
476
475
|
}
|
|
477
476
|
}
|
|
478
|
-
function
|
|
479
|
-
let t =
|
|
477
|
+
function cr(e) {
|
|
478
|
+
let t = Ee(e, Rn);
|
|
480
479
|
y((e) => ({
|
|
481
480
|
...e,
|
|
482
481
|
nodes: e.nodes.map((e) => {
|
|
@@ -488,34 +487,34 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
488
487
|
})
|
|
489
488
|
}));
|
|
490
489
|
}
|
|
491
|
-
function
|
|
490
|
+
function lr(e) {
|
|
492
491
|
if (!an(e, v.nodes)) return;
|
|
493
|
-
let t = v.nodes.some((t) => t.id === e.source && t.type === "exclusiveGateway"), n =
|
|
492
|
+
let t = v.nodes.some((t) => t.id === e.source && t.type === "exclusiveGateway"), n = R(e.source, e.target, {});
|
|
494
493
|
y((e) => ({
|
|
495
494
|
...e,
|
|
496
495
|
edges: [...e.edges, n]
|
|
497
|
-
})),
|
|
496
|
+
})), E(null), O([n.id]), k(t ? n.id : null);
|
|
498
497
|
}
|
|
499
|
-
function
|
|
500
|
-
e.stopPropagation(),
|
|
498
|
+
function ur(e, t) {
|
|
499
|
+
e.stopPropagation(), O((n) => e.shiftKey || e.metaKey || e.ctrlKey ? on(n, t.id) : [t.id]), E(null);
|
|
501
500
|
}
|
|
502
|
-
function
|
|
503
|
-
|
|
501
|
+
function dr() {
|
|
502
|
+
k(null);
|
|
504
503
|
}
|
|
505
|
-
function
|
|
504
|
+
function fr(e) {
|
|
506
505
|
let t = Ft({
|
|
507
506
|
definition: v,
|
|
508
507
|
node: Nt(e, Pt(v.nodes, e)),
|
|
509
|
-
selectedEdgeId:
|
|
510
|
-
selectedNodeId:
|
|
511
|
-
}), n = Vt(t.definition), r = In(n,
|
|
512
|
-
y(n),
|
|
508
|
+
selectedEdgeId: D.length === 1 ? D[0] : null,
|
|
509
|
+
selectedNodeId: T
|
|
510
|
+
}), n = Vt(t.definition), r = In(n, Tn.current);
|
|
511
|
+
y(n), E(t.selectedNodeId), O(t.selectedEdgeIds), k(t.editingEdgeId), r && U(r);
|
|
513
512
|
}
|
|
514
|
-
function
|
|
515
|
-
|
|
513
|
+
function pr(e) {
|
|
514
|
+
W && vr(W.id, (t) => Ot(t, e));
|
|
516
515
|
}
|
|
517
516
|
function $(e) {
|
|
518
|
-
!
|
|
517
|
+
!W || W.type !== "userTask" || vr(W.id, (t) => t.type === "userTask" ? {
|
|
519
518
|
...t,
|
|
520
519
|
data: {
|
|
521
520
|
...t.data,
|
|
@@ -524,8 +523,8 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
524
523
|
}
|
|
525
524
|
} : t);
|
|
526
525
|
}
|
|
527
|
-
function
|
|
528
|
-
!
|
|
526
|
+
function mr(e) {
|
|
527
|
+
!W || W.type !== "userTask" || vr(W.id, (t) => t.type === "userTask" ? {
|
|
529
528
|
...t,
|
|
530
529
|
data: {
|
|
531
530
|
...t.data,
|
|
@@ -536,8 +535,8 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
536
535
|
}
|
|
537
536
|
} : t);
|
|
538
537
|
}
|
|
539
|
-
function
|
|
540
|
-
!
|
|
538
|
+
function hr(e) {
|
|
539
|
+
!W || W.type !== "serviceTask" || vr(W.id, (t) => t.type === "serviceTask" ? {
|
|
541
540
|
...t,
|
|
542
541
|
data: {
|
|
543
542
|
...t.data,
|
|
@@ -545,30 +544,30 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
545
544
|
}
|
|
546
545
|
} : t);
|
|
547
546
|
}
|
|
548
|
-
function
|
|
549
|
-
|
|
547
|
+
function gr(e) {
|
|
548
|
+
w(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), $e(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), Ke(tn(e, I));
|
|
550
549
|
}
|
|
551
|
-
function
|
|
552
|
-
!
|
|
550
|
+
function _r(e) {
|
|
551
|
+
!W || W.type === "startEvent" || vr(W.id, (t) => kt(t, e));
|
|
553
552
|
}
|
|
554
|
-
function
|
|
553
|
+
function vr(e, t) {
|
|
555
554
|
y((n) => ({
|
|
556
555
|
...n,
|
|
557
556
|
nodes: n.nodes.map((n) => n.id === e ? t(n) : n)
|
|
558
557
|
}));
|
|
559
558
|
}
|
|
560
|
-
function
|
|
559
|
+
function yr(e, t) {
|
|
561
560
|
y((n) => ({
|
|
562
561
|
...n,
|
|
563
562
|
edges: n.edges.map((n) => n.id === e ? t(n) : n)
|
|
564
563
|
}));
|
|
565
564
|
}
|
|
566
|
-
function
|
|
565
|
+
function br(e, t) {
|
|
567
566
|
y((n) => {
|
|
568
567
|
let r = n.edges.find((t) => t.id === e);
|
|
569
568
|
return r ? {
|
|
570
569
|
...n,
|
|
571
|
-
edges: n.edges.map((e) => t && e.source === r.source && e.id !== r.id &&
|
|
570
|
+
edges: n.edges.map((e) => t && e.source === r.source && e.id !== r.id && X(e, n.nodes) ? {
|
|
572
571
|
...e,
|
|
573
572
|
data: {
|
|
574
573
|
...e.data,
|
|
@@ -584,296 +583,293 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
584
583
|
} : n;
|
|
585
584
|
});
|
|
586
585
|
}
|
|
587
|
-
function
|
|
588
|
-
let i =
|
|
589
|
-
|
|
590
|
-
let a =
|
|
586
|
+
function xr({ edgeId: e, fieldKey: t, operator: n, value: r }) {
|
|
587
|
+
let i = K?.schema ?? null;
|
|
588
|
+
yr(e, (e) => {
|
|
589
|
+
let a = Vn(i, t ?? e.data.conditionFieldKey ?? null), o = Kn(a, n ?? e.data.conditionOperator ?? null), s = qn(a, o, r ?? e.data.conditionValue ?? null), c = Yn(a, o, s);
|
|
591
590
|
return {
|
|
592
591
|
...e,
|
|
593
592
|
data: {
|
|
594
593
|
...e.data,
|
|
595
|
-
condition:
|
|
594
|
+
condition: Zn(a, o, s),
|
|
596
595
|
conditionFieldKey: a?.fieldKey,
|
|
597
596
|
conditionOperator: o,
|
|
598
597
|
conditionValue: s,
|
|
599
598
|
isDefault: !1,
|
|
600
|
-
label:
|
|
599
|
+
label: c
|
|
601
600
|
}
|
|
602
601
|
};
|
|
603
602
|
});
|
|
604
603
|
}
|
|
605
|
-
function
|
|
606
|
-
let e = Vt(v), t = In(e,
|
|
607
|
-
y(e), t &&
|
|
604
|
+
function Sr() {
|
|
605
|
+
let e = Vt(v), t = In(e, Tn.current);
|
|
606
|
+
y(e), t && U(t);
|
|
608
607
|
}
|
|
609
|
-
return /* @__PURE__ */ g(
|
|
610
|
-
|
|
611
|
-
children:
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
/* @__PURE__ */ h(
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
searchDebounceTime: 300,
|
|
692
|
-
value: Y
|
|
693
|
-
})
|
|
608
|
+
return /* @__PURE__ */ g(m, { children: [
|
|
609
|
+
/* @__PURE__ */ h("style", { children: Ue }),
|
|
610
|
+
/* @__PURE__ */ h(ae, { children: /* @__PURE__ */ g(ue, {
|
|
611
|
+
description: `${ve ? `草稿 v${ve.version}` : "尚未建立草稿"} ·${me?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
|
|
612
|
+
onBackClick: En,
|
|
613
|
+
title: me?.template.name ?? "流程設計器",
|
|
614
|
+
children: [
|
|
615
|
+
/* @__PURE__ */ h(d, {
|
|
616
|
+
"aria-label": "儲存草稿",
|
|
617
|
+
disabled: at || !!q || !!Y,
|
|
618
|
+
icon: ge,
|
|
619
|
+
iconType: "icon-only",
|
|
620
|
+
onClick: () => void rr(),
|
|
621
|
+
variant: "base-secondary",
|
|
622
|
+
children: "儲存草稿"
|
|
623
|
+
}),
|
|
624
|
+
/* @__PURE__ */ h(d, {
|
|
625
|
+
disabled: rt || !!q || !!Y,
|
|
626
|
+
icon: pe,
|
|
627
|
+
iconType: "leading",
|
|
628
|
+
onClick: ar,
|
|
629
|
+
variant: "base-secondary",
|
|
630
|
+
children: "試跑流程"
|
|
631
|
+
}),
|
|
632
|
+
/* @__PURE__ */ h(d, {
|
|
633
|
+
disabled: at || !ve || !!q || !!Y,
|
|
634
|
+
icon: de,
|
|
635
|
+
iconType: "leading",
|
|
636
|
+
onClick: () => void ir(),
|
|
637
|
+
variant: "base-primary",
|
|
638
|
+
children: "發布版本"
|
|
639
|
+
})
|
|
640
|
+
]
|
|
641
|
+
}) }),
|
|
642
|
+
/* @__PURE__ */ h(se, { children: /* @__PURE__ */ h(oe, { children: /* @__PURE__ */ g("div", {
|
|
643
|
+
style: Le,
|
|
644
|
+
children: [
|
|
645
|
+
nt ? /* @__PURE__ */ h(p, {
|
|
646
|
+
color: "text-error",
|
|
647
|
+
variant: "body",
|
|
648
|
+
children: nt
|
|
649
|
+
}) : null,
|
|
650
|
+
q ? /* @__PURE__ */ h(p, {
|
|
651
|
+
color: "text-error",
|
|
652
|
+
variant: "body",
|
|
653
|
+
children: q
|
|
654
|
+
}) : null,
|
|
655
|
+
Y ? /* @__PURE__ */ h(p, {
|
|
656
|
+
color: "text-error",
|
|
657
|
+
variant: "body",
|
|
658
|
+
children: Y
|
|
659
|
+
}) : null,
|
|
660
|
+
/* @__PURE__ */ h("div", {
|
|
661
|
+
style: S,
|
|
662
|
+
children: /* @__PURE__ */ h(o, {
|
|
663
|
+
hintText: J ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
|
|
664
|
+
label: "綁定表單版本",
|
|
665
|
+
name: "formDefinitionVersionId",
|
|
666
|
+
required: !0,
|
|
667
|
+
children: /* @__PURE__ */ h(te, {
|
|
668
|
+
asyncData: !0,
|
|
669
|
+
disabled: rt || J,
|
|
670
|
+
disabledOptionsFilter: !0,
|
|
671
|
+
emptyText: "沒有符合的已發布表單版本",
|
|
672
|
+
isForceClearable: !!b && !J,
|
|
673
|
+
loading: ot,
|
|
674
|
+
loadingText: "搜尋表單版本中...",
|
|
675
|
+
mode: "single",
|
|
676
|
+
onChange: (e) => {
|
|
677
|
+
J || We(e?.id ?? null);
|
|
678
|
+
},
|
|
679
|
+
onClear: () => {
|
|
680
|
+
J || We(null);
|
|
681
|
+
},
|
|
682
|
+
onSearch: er,
|
|
683
|
+
onVisibilityChange: (e) => {
|
|
684
|
+
e && !J && er("");
|
|
685
|
+
},
|
|
686
|
+
options: [...Xn],
|
|
687
|
+
placeholder: "選擇已發布表單版本",
|
|
688
|
+
searchDebounceTime: 300,
|
|
689
|
+
value: K
|
|
694
690
|
})
|
|
695
|
-
})
|
|
696
|
-
|
|
691
|
+
})
|
|
692
|
+
}),
|
|
693
|
+
/* @__PURE__ */ g("div", {
|
|
694
|
+
style: Re,
|
|
695
|
+
children: [/* @__PURE__ */ h("div", {
|
|
696
|
+
ref: Tn,
|
|
697
697
|
style: ze,
|
|
698
|
-
children:
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
children:
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
698
|
+
children: /* @__PURE__ */ g(Te, {
|
|
699
|
+
connectionMode: xe.Strict,
|
|
700
|
+
edges: Wn,
|
|
701
|
+
fitView: !0,
|
|
702
|
+
isValidConnection: (e) => an(e, v.nodes),
|
|
703
|
+
nodeTypes: yt,
|
|
704
|
+
nodes: Rn,
|
|
705
|
+
deleteKeyCode: null,
|
|
706
|
+
multiSelectionKeyCode: [
|
|
707
|
+
"Shift",
|
|
708
|
+
"Meta",
|
|
709
|
+
"Control"
|
|
710
|
+
],
|
|
711
|
+
onConnect: lr,
|
|
712
|
+
onEdgeClick: ur,
|
|
713
|
+
onNodeClick: (e, t) => {
|
|
714
|
+
E(t.id), O([]);
|
|
715
|
+
},
|
|
716
|
+
onNodesChange: cr,
|
|
717
|
+
onPaneClick: () => {
|
|
718
|
+
E(null), O([]);
|
|
719
|
+
},
|
|
720
|
+
onViewportChange: U,
|
|
721
|
+
viewport: H,
|
|
722
|
+
children: [
|
|
723
|
+
/* @__PURE__ */ h(be, {}),
|
|
724
|
+
/* @__PURE__ */ h("style", { children: qe }),
|
|
725
|
+
/* @__PURE__ */ h(Ce, { children: kn ? /* @__PURE__ */ h(Se, {
|
|
726
|
+
"aria-label": "刪除選取項目",
|
|
727
|
+
className: "workflow-selection-delete-control",
|
|
728
|
+
onClick: Mn,
|
|
729
|
+
style: Be,
|
|
730
|
+
title: "刪除選取項目",
|
|
731
|
+
children: /* @__PURE__ */ h("span", {
|
|
732
732
|
style: Ve,
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
color: "error",
|
|
738
|
-
icon: _e,
|
|
739
|
-
size: 16
|
|
740
|
-
})
|
|
733
|
+
children: /* @__PURE__ */ h(ne, {
|
|
734
|
+
color: "error",
|
|
735
|
+
icon: _e,
|
|
736
|
+
size: 16
|
|
741
737
|
})
|
|
742
|
-
})
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
})
|
|
747
|
-
}), /* @__PURE__ */ g("div", {
|
|
748
|
-
className: Ue,
|
|
749
|
-
style: Xe,
|
|
750
|
-
children: [
|
|
751
|
-
/* @__PURE__ */ h(m, {
|
|
752
|
-
component: "h2",
|
|
753
|
-
variant: "h3",
|
|
754
|
-
children: "流程工具"
|
|
755
|
-
}),
|
|
756
|
-
/* @__PURE__ */ g("div", {
|
|
757
|
-
style: et,
|
|
758
|
-
children: [/* @__PURE__ */ h(m, {
|
|
759
|
-
color: "text-neutral",
|
|
760
|
-
variant: "caption",
|
|
761
|
-
children: "動作節點"
|
|
762
|
-
}), /* @__PURE__ */ h("div", {
|
|
763
|
-
style: $e,
|
|
764
|
-
children: lt.map((e) => /* @__PURE__ */ h(f, {
|
|
765
|
-
icon: e.icon,
|
|
766
|
-
iconType: "leading",
|
|
767
|
-
onClick: () => hr(e.type),
|
|
768
|
-
size: "sub",
|
|
769
|
-
variant: "base-secondary",
|
|
770
|
-
children: e.label
|
|
771
|
-
}, e.type))
|
|
772
|
-
})]
|
|
773
|
-
}),
|
|
774
|
-
/* @__PURE__ */ g("div", {
|
|
775
|
-
style: et,
|
|
776
|
-
children: [/* @__PURE__ */ h(m, {
|
|
777
|
-
color: "text-neutral",
|
|
778
|
-
variant: "caption",
|
|
779
|
-
children: "流程控制"
|
|
780
|
-
}), /* @__PURE__ */ h("div", {
|
|
781
|
-
style: $e,
|
|
782
|
-
children: ut.map((e) => /* @__PURE__ */ h(f, {
|
|
783
|
-
icon: e.icon,
|
|
784
|
-
iconType: "leading",
|
|
785
|
-
onClick: () => hr(e.type),
|
|
786
|
-
size: "sub",
|
|
787
|
-
variant: "base-secondary",
|
|
788
|
-
children: e.label
|
|
789
|
-
}, e.type))
|
|
790
|
-
})]
|
|
791
|
-
}),
|
|
792
|
-
q.length > 1 ? Mr(q) : null,
|
|
793
|
-
q.length === 1 && Fn ? Nr(Fn) : null,
|
|
794
|
-
q.length === 0 && K ? Dr(K) : null
|
|
738
|
+
})
|
|
739
|
+
}) : null }),
|
|
740
|
+
/* @__PURE__ */ h(xt, { onApplyAutoLayout: Sr }),
|
|
741
|
+
/* @__PURE__ */ h(we, {})
|
|
795
742
|
]
|
|
796
|
-
})
|
|
797
|
-
})
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
743
|
+
})
|
|
744
|
+
}), /* @__PURE__ */ g("div", {
|
|
745
|
+
className: He,
|
|
746
|
+
style: Je,
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ h(p, {
|
|
749
|
+
component: "h2",
|
|
750
|
+
variant: "h3",
|
|
751
|
+
children: "流程工具"
|
|
752
|
+
}),
|
|
753
|
+
/* @__PURE__ */ g("div", {
|
|
754
|
+
style: Qe,
|
|
755
|
+
children: [/* @__PURE__ */ h(p, {
|
|
756
|
+
color: "text-neutral",
|
|
757
|
+
variant: "caption",
|
|
758
|
+
children: "動作節點"
|
|
759
|
+
}), /* @__PURE__ */ h("div", {
|
|
760
|
+
style: Ze,
|
|
761
|
+
children: ct.map((e) => /* @__PURE__ */ h(d, {
|
|
762
|
+
icon: e.icon,
|
|
763
|
+
iconType: "leading",
|
|
764
|
+
onClick: () => fr(e.type),
|
|
765
|
+
size: "sub",
|
|
766
|
+
variant: "base-secondary",
|
|
767
|
+
children: e.label
|
|
768
|
+
}, e.type))
|
|
769
|
+
})]
|
|
770
|
+
}),
|
|
771
|
+
/* @__PURE__ */ g("div", {
|
|
772
|
+
style: Qe,
|
|
773
|
+
children: [/* @__PURE__ */ h(p, {
|
|
774
|
+
color: "text-neutral",
|
|
775
|
+
variant: "caption",
|
|
776
|
+
children: "流程控制"
|
|
777
|
+
}), /* @__PURE__ */ h("div", {
|
|
778
|
+
style: Ze,
|
|
779
|
+
children: lt.map((e) => /* @__PURE__ */ h(d, {
|
|
780
|
+
icon: e.icon,
|
|
781
|
+
iconType: "leading",
|
|
782
|
+
onClick: () => fr(e.type),
|
|
783
|
+
size: "sub",
|
|
784
|
+
variant: "base-secondary",
|
|
785
|
+
children: e.label
|
|
786
|
+
}, e.type))
|
|
787
|
+
})]
|
|
788
|
+
}),
|
|
789
|
+
Fn.length > 1 ? kr(Fn) : null,
|
|
790
|
+
Fn.length === 1 && Pn ? Ar(Pn) : null,
|
|
791
|
+
Fn.length === 0 && W ? wr(W) : null
|
|
792
|
+
]
|
|
793
|
+
})]
|
|
794
|
+
})
|
|
795
|
+
]
|
|
796
|
+
}) }) }),
|
|
797
|
+
jr(Nn),
|
|
798
|
+
Cr()
|
|
799
|
+
] });
|
|
800
|
+
function Cr() {
|
|
805
801
|
return /* @__PURE__ */ h(ie, {
|
|
806
802
|
cancelText: "關閉",
|
|
807
803
|
confirmText: "執行試跑",
|
|
808
|
-
loading:
|
|
804
|
+
loading: Zt,
|
|
809
805
|
modalType: "standard",
|
|
810
|
-
onCancel:
|
|
811
|
-
onClose:
|
|
812
|
-
onConfirm: () => void
|
|
813
|
-
open:
|
|
806
|
+
onCancel: or,
|
|
807
|
+
onClose: or,
|
|
808
|
+
onConfirm: () => void sr(),
|
|
809
|
+
open: Lt,
|
|
814
810
|
showModalFooter: !0,
|
|
815
811
|
showModalHeader: !0,
|
|
816
812
|
size: "wide",
|
|
817
813
|
supportingText: `使用 ${vt} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
|
|
818
814
|
title: "試跑流程",
|
|
819
815
|
children: /* @__PURE__ */ g("div", {
|
|
820
|
-
style:
|
|
816
|
+
style: S,
|
|
821
817
|
children: [
|
|
822
|
-
/* @__PURE__ */ h(
|
|
818
|
+
/* @__PURE__ */ h(o, {
|
|
823
819
|
label: "表單資料 JSON",
|
|
824
820
|
name: "dryRunFormDataJson",
|
|
825
821
|
required: !0,
|
|
826
822
|
children: /* @__PURE__ */ h(ce, {
|
|
827
|
-
onChange: (e) =>
|
|
823
|
+
onChange: (e) => B(e.target.value),
|
|
828
824
|
resize: "vertical",
|
|
829
825
|
rows: 8,
|
|
830
|
-
value:
|
|
826
|
+
value: nn
|
|
831
827
|
})
|
|
832
828
|
}),
|
|
833
|
-
|
|
829
|
+
fn ? /* @__PURE__ */ h(p, {
|
|
834
830
|
color: "text-error",
|
|
835
831
|
variant: "body",
|
|
836
|
-
children:
|
|
832
|
+
children: fn
|
|
837
833
|
}) : null,
|
|
838
|
-
|
|
839
|
-
style:
|
|
834
|
+
V ? /* @__PURE__ */ g("div", {
|
|
835
|
+
style: Ye,
|
|
840
836
|
children: [
|
|
841
|
-
/* @__PURE__ */ h(
|
|
842
|
-
color:
|
|
837
|
+
/* @__PURE__ */ h(p, {
|
|
838
|
+
color: V.valid ? "text-success" : "text-error",
|
|
843
839
|
variant: "label-primary-highlight",
|
|
844
|
-
children:
|
|
840
|
+
children: V.valid ? "試跑通過" : "試跑失敗"
|
|
845
841
|
}),
|
|
846
|
-
|
|
842
|
+
V.errors.map((e) => /* @__PURE__ */ h(p, {
|
|
847
843
|
color: "text-error",
|
|
848
844
|
variant: "body",
|
|
849
845
|
children: e
|
|
850
846
|
}, e)),
|
|
851
|
-
|
|
852
|
-
style:
|
|
847
|
+
V.steps.map((e) => /* @__PURE__ */ g("div", {
|
|
848
|
+
style: Xe,
|
|
853
849
|
children: [
|
|
854
|
-
/* @__PURE__ */ g(
|
|
850
|
+
/* @__PURE__ */ g(p, {
|
|
855
851
|
variant: "label-primary-highlight",
|
|
856
852
|
children: [
|
|
857
853
|
e.nodeLabel,
|
|
858
854
|
" · ",
|
|
859
|
-
|
|
855
|
+
hn(e.status)
|
|
860
856
|
]
|
|
861
857
|
}),
|
|
862
|
-
/* @__PURE__ */ g(
|
|
858
|
+
/* @__PURE__ */ g(p, {
|
|
863
859
|
color: "text-neutral",
|
|
864
860
|
variant: "caption",
|
|
865
861
|
children: [
|
|
866
|
-
|
|
862
|
+
gn(e.nodeType),
|
|
867
863
|
e.assigneeMemberId ? ` · 處理者:${e.assigneeMemberId}` : "",
|
|
868
864
|
e.edgeLabel ? ` · 來源線段:${e.edgeLabel}` : ""
|
|
869
865
|
]
|
|
870
866
|
}),
|
|
871
|
-
e.edgeReason ? /* @__PURE__ */ h(
|
|
867
|
+
e.edgeReason ? /* @__PURE__ */ h(p, {
|
|
872
868
|
color: "text-neutral",
|
|
873
869
|
variant: "caption",
|
|
874
870
|
children: e.edgeReason
|
|
875
871
|
}) : null,
|
|
876
|
-
e.entryCondition ? /* @__PURE__ */ g(
|
|
872
|
+
e.entryCondition ? /* @__PURE__ */ g(p, {
|
|
877
873
|
color: "text-neutral",
|
|
878
874
|
variant: "caption",
|
|
879
875
|
children: [
|
|
@@ -884,7 +880,7 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
884
880
|
e.entryCondition
|
|
885
881
|
]
|
|
886
882
|
}) : null,
|
|
887
|
-
/* @__PURE__ */ h(
|
|
883
|
+
/* @__PURE__ */ h(p, {
|
|
888
884
|
color: "text-neutral",
|
|
889
885
|
variant: "body",
|
|
890
886
|
children: e.message
|
|
@@ -897,154 +893,154 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
897
893
|
})
|
|
898
894
|
});
|
|
899
895
|
}
|
|
900
|
-
function
|
|
896
|
+
function wr(e) {
|
|
901
897
|
return /* @__PURE__ */ g("div", {
|
|
902
|
-
style:
|
|
898
|
+
style: S,
|
|
903
899
|
children: [
|
|
904
|
-
/* @__PURE__ */ h(
|
|
900
|
+
/* @__PURE__ */ h(p, {
|
|
905
901
|
component: "h2",
|
|
906
902
|
variant: "h3",
|
|
907
903
|
children: "節點屬性"
|
|
908
904
|
}),
|
|
909
|
-
/* @__PURE__ */ g(
|
|
905
|
+
/* @__PURE__ */ g(p, {
|
|
910
906
|
color: "text-neutral",
|
|
911
907
|
variant: "body",
|
|
912
908
|
children: [
|
|
913
|
-
|
|
909
|
+
st[e.type],
|
|
914
910
|
" · ",
|
|
915
911
|
e.id
|
|
916
912
|
]
|
|
917
913
|
}),
|
|
918
|
-
/* @__PURE__ */ h(
|
|
914
|
+
/* @__PURE__ */ h(o, {
|
|
919
915
|
label: "顯示名稱",
|
|
920
916
|
name: "nodeLabel",
|
|
921
917
|
required: !0,
|
|
922
918
|
children: /* @__PURE__ */ h(re, {
|
|
923
|
-
onChange: (e) =>
|
|
919
|
+
onChange: (e) => pr(e.target.value),
|
|
924
920
|
value: e.data.label,
|
|
925
921
|
variant: "base"
|
|
926
922
|
})
|
|
927
923
|
}),
|
|
928
|
-
e.type === "startEvent" ?
|
|
929
|
-
e.type === "startEvent" ? null :
|
|
930
|
-
e.type === "userTask" ?
|
|
931
|
-
e.type === "serviceTask" ?
|
|
924
|
+
e.type === "startEvent" ? Tr() : null,
|
|
925
|
+
e.type === "startEvent" ? null : Er(e),
|
|
926
|
+
e.type === "userTask" ? Dr(e) : null,
|
|
927
|
+
e.type === "serviceTask" ? Or(e) : null
|
|
932
928
|
]
|
|
933
929
|
});
|
|
934
930
|
}
|
|
935
|
-
function
|
|
936
|
-
let e =
|
|
937
|
-
includeDescendants: !!
|
|
938
|
-
memberships:
|
|
939
|
-
orgUnitId:
|
|
940
|
-
orgUnits:
|
|
941
|
-
positions:
|
|
931
|
+
function Tr() {
|
|
932
|
+
let e = G.mode === "CUSTOM" ? [...gt, _t] : [...gt], t = G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? Sn(I, G.orgUnitId ?? "") : null, n = G.mode === "ORG_UNIT_POSITION" ? Cn(L, G.positionId ?? "") : null, i = G.mode === "ORG_UNIT_POSITION" ? On({
|
|
933
|
+
includeDescendants: !!G.includeDescendants,
|
|
934
|
+
memberships: Mt,
|
|
935
|
+
orgUnitId: G.orgUnitId ?? "",
|
|
936
|
+
orgUnits: I,
|
|
937
|
+
positions: L
|
|
942
938
|
}) : [];
|
|
943
|
-
return /* @__PURE__ */ g(
|
|
944
|
-
/* @__PURE__ */ h(
|
|
945
|
-
hintText:
|
|
939
|
+
return /* @__PURE__ */ g(m, { children: [
|
|
940
|
+
/* @__PURE__ */ h(o, {
|
|
941
|
+
hintText: G.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
|
|
946
942
|
label: "發起權限",
|
|
947
943
|
name: "initiatorPolicyMode",
|
|
948
944
|
required: !0,
|
|
949
|
-
children: /* @__PURE__ */ h(
|
|
945
|
+
children: /* @__PURE__ */ h(f, {
|
|
950
946
|
clearable: !1,
|
|
951
947
|
onChange: (e) => {
|
|
952
948
|
if (e?.id === "CUSTOM") {
|
|
953
|
-
|
|
949
|
+
$e(null), w(null);
|
|
954
950
|
return;
|
|
955
951
|
}
|
|
956
952
|
let t = Xt(e?.id ?? null), n = rn(t);
|
|
957
|
-
|
|
953
|
+
$e(t === "ALL" ? null : t), w(t === "ALL" ? null : n), Ke(tn(n, I));
|
|
958
954
|
},
|
|
959
955
|
options: e,
|
|
960
956
|
placeholder: "選擇誰可以發起",
|
|
961
|
-
value:
|
|
957
|
+
value: z(e, G.mode)
|
|
962
958
|
})
|
|
963
959
|
}),
|
|
964
|
-
|
|
960
|
+
G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
|
|
965
961
|
label: "組織",
|
|
966
962
|
name: "initiatorOrgUnitId",
|
|
967
963
|
required: !0,
|
|
968
|
-
children: /* @__PURE__ */ h(
|
|
964
|
+
children: /* @__PURE__ */ h(r, {
|
|
969
965
|
name: "initiatorOrgUnitId",
|
|
970
|
-
onChange: (e) =>
|
|
971
|
-
...
|
|
966
|
+
onChange: (e) => gr({
|
|
967
|
+
...G,
|
|
972
968
|
orgUnitId: e?.id ?? "",
|
|
973
969
|
positionId: "",
|
|
974
970
|
value: e?.id ?? ""
|
|
975
971
|
}),
|
|
976
|
-
orgUnits:
|
|
972
|
+
orgUnits: I,
|
|
977
973
|
placeholder: "選擇組織",
|
|
978
974
|
value: t
|
|
979
975
|
})
|
|
980
976
|
}) : null,
|
|
981
|
-
|
|
977
|
+
G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
|
|
982
978
|
label: "包含下層",
|
|
983
979
|
name: "initiatorIncludeDescendants",
|
|
984
980
|
children: /* @__PURE__ */ h(le, {
|
|
985
|
-
checked: !!
|
|
986
|
-
onChange: (e) =>
|
|
987
|
-
...
|
|
981
|
+
checked: !!G.includeDescendants,
|
|
982
|
+
onChange: (e) => gr({
|
|
983
|
+
...G,
|
|
988
984
|
includeDescendants: e.target.checked,
|
|
989
|
-
...
|
|
985
|
+
...G.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
|
|
990
986
|
})
|
|
991
987
|
})
|
|
992
988
|
}) : null,
|
|
993
|
-
|
|
989
|
+
G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
|
|
994
990
|
label: "職位",
|
|
995
991
|
name: "initiatorPositionId",
|
|
996
992
|
required: !0,
|
|
997
|
-
children: /* @__PURE__ */ h(
|
|
998
|
-
disabled: !
|
|
993
|
+
children: /* @__PURE__ */ h(a, {
|
|
994
|
+
disabled: !G.orgUnitId?.trim(),
|
|
999
995
|
name: "initiatorPositionId",
|
|
1000
|
-
onChange: (e) =>
|
|
1001
|
-
...
|
|
996
|
+
onChange: (e) => gr({
|
|
997
|
+
...G,
|
|
1002
998
|
positionId: e?.id ?? ""
|
|
1003
999
|
}),
|
|
1004
|
-
placeholder:
|
|
1005
|
-
positions:
|
|
1000
|
+
placeholder: G.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
|
|
1001
|
+
positions: i,
|
|
1006
1002
|
value: n
|
|
1007
1003
|
})
|
|
1008
1004
|
}) : null
|
|
1009
1005
|
] });
|
|
1010
1006
|
}
|
|
1011
|
-
function
|
|
1007
|
+
function Er(e) {
|
|
1012
1008
|
let t = v.edges.filter((t) => t.target === e.id).length, n = t < 2, r = n ? "AND" : e.data.triggerMode ?? "AND";
|
|
1013
|
-
return /* @__PURE__ */ h(
|
|
1009
|
+
return /* @__PURE__ */ h(o, {
|
|
1014
1010
|
hintText: n ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
|
|
1015
1011
|
label: "前置條件",
|
|
1016
1012
|
name: "triggerMode",
|
|
1017
1013
|
required: !0,
|
|
1018
|
-
children: /* @__PURE__ */ h(
|
|
1014
|
+
children: /* @__PURE__ */ h(f, {
|
|
1019
1015
|
clearable: !1,
|
|
1020
|
-
onChange: (e) => n ? void 0 :
|
|
1021
|
-
options: [...
|
|
1016
|
+
onChange: (e) => n ? void 0 : _r(Ht(e?.id ?? null)),
|
|
1017
|
+
options: [...ut],
|
|
1022
1018
|
readOnly: n,
|
|
1023
|
-
value:
|
|
1019
|
+
value: z(ut, r)
|
|
1024
1020
|
})
|
|
1025
1021
|
});
|
|
1026
1022
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let t = e.data.approverResolver, n = Wt(t.type),
|
|
1023
|
+
function Dr(e) {
|
|
1024
|
+
let t = e.data.approverResolver, n = Wt(t.type), i = t.type === "DIRECT" ? xn(t.memberIds, P) : null, s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Sn(I, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Cn(L, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? On({
|
|
1029
1025
|
includeDescendants: !!t.includeDescendants,
|
|
1030
|
-
memberships:
|
|
1026
|
+
memberships: Mt,
|
|
1031
1027
|
orgUnitId: t.orgUnitId,
|
|
1032
|
-
orgUnits:
|
|
1033
|
-
positions:
|
|
1034
|
-
}) : [],
|
|
1035
|
-
return /* @__PURE__ */ g(
|
|
1036
|
-
/* @__PURE__ */ h(
|
|
1028
|
+
orgUnits: I,
|
|
1029
|
+
positions: L
|
|
1030
|
+
}) : [], ee = t.type === "ORG_MANAGER" ? Jt(t.levelsUp) : M[0], u = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, d = u.type === "DIRECT" ? bn(P, u.memberId) : null, ne = e.data.returnBehavior.resubmitStrategy ?? "RESTART";
|
|
1031
|
+
return /* @__PURE__ */ g(m, { children: [
|
|
1032
|
+
/* @__PURE__ */ h(o, {
|
|
1037
1033
|
label: "簽核來源",
|
|
1038
1034
|
name: "approverResolverType",
|
|
1039
1035
|
required: !0,
|
|
1040
|
-
children: /* @__PURE__ */ h(
|
|
1036
|
+
children: /* @__PURE__ */ h(f, {
|
|
1041
1037
|
clearable: !1,
|
|
1042
1038
|
onChange: (e) => $(Gt(e?.id ?? null)),
|
|
1043
|
-
options: [...
|
|
1044
|
-
value:
|
|
1039
|
+
options: [...ft],
|
|
1040
|
+
value: z(ft, n)
|
|
1045
1041
|
})
|
|
1046
1042
|
}),
|
|
1047
|
-
t.type === "DIRECT" ? /* @__PURE__ */ h(
|
|
1043
|
+
t.type === "DIRECT" ? /* @__PURE__ */ h(o, {
|
|
1048
1044
|
label: "簽核者",
|
|
1049
1045
|
name: "memberId",
|
|
1050
1046
|
required: !0,
|
|
@@ -1058,29 +1054,29 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1058
1054
|
name: "workflow-approver-search",
|
|
1059
1055
|
spellCheck: !1
|
|
1060
1056
|
},
|
|
1061
|
-
loading:
|
|
1057
|
+
loading: Ct,
|
|
1062
1058
|
loadingText: "搜尋成員中...",
|
|
1063
1059
|
mode: "single",
|
|
1064
1060
|
onChange: (e) => $({
|
|
1065
1061
|
memberIds: e?.id ? [e.id] : [],
|
|
1066
1062
|
type: "DIRECT"
|
|
1067
1063
|
}),
|
|
1068
|
-
onSearch:
|
|
1064
|
+
onSearch: Z,
|
|
1069
1065
|
onVisibilityChange: (e) => {
|
|
1070
|
-
e &&
|
|
1066
|
+
e && Z("");
|
|
1071
1067
|
},
|
|
1072
|
-
options: [...
|
|
1068
|
+
options: [...P],
|
|
1073
1069
|
placeholder: "搜尋姓名或信箱",
|
|
1074
1070
|
searchDebounceTime: 300,
|
|
1075
|
-
value:
|
|
1071
|
+
value: i
|
|
1076
1072
|
})
|
|
1077
1073
|
}) : null,
|
|
1078
|
-
t.type === "ORG_MANAGER" ? /* @__PURE__ */ h(
|
|
1074
|
+
t.type === "ORG_MANAGER" ? /* @__PURE__ */ h(o, {
|
|
1079
1075
|
hintText: "依發起人的有效會員歸屬與主管解析規則決定簽核人。",
|
|
1080
1076
|
label: "主管層級",
|
|
1081
1077
|
name: "managerLevelsUp",
|
|
1082
1078
|
required: !0,
|
|
1083
|
-
children: /* @__PURE__ */ h(
|
|
1079
|
+
children: /* @__PURE__ */ h(f, {
|
|
1084
1080
|
clearable: !1,
|
|
1085
1081
|
onChange: (e) => $({
|
|
1086
1082
|
baseFromInitiator: !0,
|
|
@@ -1088,15 +1084,15 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1088
1084
|
type: "ORG_MANAGER"
|
|
1089
1085
|
}),
|
|
1090
1086
|
options: [...M],
|
|
1091
|
-
value:
|
|
1087
|
+
value: ee
|
|
1092
1088
|
})
|
|
1093
1089
|
}) : null,
|
|
1094
|
-
t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(
|
|
1090
|
+
t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
|
|
1095
1091
|
hintText: t.type === "ORG_UNIT_MANAGER" ? "依指定組織或其上層的主管解析規則決定簽核人。" : "依指定組織目前有效會員歸屬建立候選簽核人。",
|
|
1096
1092
|
label: "組織",
|
|
1097
1093
|
name: "orgUnitId",
|
|
1098
1094
|
required: !0,
|
|
1099
|
-
children: /* @__PURE__ */ h(
|
|
1095
|
+
children: /* @__PURE__ */ h(r, {
|
|
1100
1096
|
name: "orgUnitId",
|
|
1101
1097
|
onChange: (e) => $(t.type === "ORG_UNIT_MEMBER" ? {
|
|
1102
1098
|
includeDescendants: t.includeDescendants,
|
|
@@ -1112,26 +1108,26 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1112
1108
|
orgUnitId: e?.id ?? "",
|
|
1113
1109
|
type: "ORG_UNIT_MANAGER"
|
|
1114
1110
|
}),
|
|
1115
|
-
orgUnits:
|
|
1111
|
+
orgUnits: I,
|
|
1116
1112
|
placeholder: "選擇組織",
|
|
1117
|
-
value:
|
|
1113
|
+
value: s
|
|
1118
1114
|
})
|
|
1119
1115
|
}) : null,
|
|
1120
|
-
t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ g(
|
|
1116
|
+
t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(o, {
|
|
1121
1117
|
hintText: "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
|
|
1122
1118
|
label: "無主管時",
|
|
1123
1119
|
name: "approverFallbackMode",
|
|
1124
1120
|
required: !0,
|
|
1125
|
-
children: /* @__PURE__ */ h(
|
|
1121
|
+
children: /* @__PURE__ */ h(f, {
|
|
1126
1122
|
clearable: !1,
|
|
1127
1123
|
onChange: (e) => $(qt(t, Kt(e?.id ?? null) === "DIRECT" ? {
|
|
1128
1124
|
memberId: "",
|
|
1129
1125
|
type: "DIRECT"
|
|
1130
1126
|
} : { type: "NONE" })),
|
|
1131
|
-
options: [...
|
|
1132
|
-
value:
|
|
1127
|
+
options: [...pt],
|
|
1128
|
+
value: z(pt, u.type)
|
|
1133
1129
|
})
|
|
1134
|
-
}), u.type === "DIRECT" ? /* @__PURE__ */ g(
|
|
1130
|
+
}), u.type === "DIRECT" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(o, {
|
|
1135
1131
|
label: "改派人員",
|
|
1136
1132
|
name: "approverFallbackMemberId",
|
|
1137
1133
|
required: !0,
|
|
@@ -1145,7 +1141,7 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1145
1141
|
name: "workflow-approver-fallback-search",
|
|
1146
1142
|
spellCheck: !1
|
|
1147
1143
|
},
|
|
1148
|
-
loading:
|
|
1144
|
+
loading: Ct,
|
|
1149
1145
|
loadingText: "搜尋成員中...",
|
|
1150
1146
|
mode: "single",
|
|
1151
1147
|
onChange: (e) => $(qt(t, {
|
|
@@ -1153,16 +1149,16 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1153
1149
|
memberId: e?.id ?? "",
|
|
1154
1150
|
type: "DIRECT"
|
|
1155
1151
|
})),
|
|
1156
|
-
onSearch:
|
|
1152
|
+
onSearch: Z,
|
|
1157
1153
|
onVisibilityChange: (e) => {
|
|
1158
|
-
e &&
|
|
1154
|
+
e && Z("");
|
|
1159
1155
|
},
|
|
1160
|
-
options: [...
|
|
1156
|
+
options: [...P],
|
|
1161
1157
|
placeholder: "搜尋姓名或信箱",
|
|
1162
1158
|
searchDebounceTime: 300,
|
|
1163
1159
|
value: d
|
|
1164
1160
|
})
|
|
1165
|
-
}), /* @__PURE__ */ h(
|
|
1161
|
+
}), /* @__PURE__ */ h(o, {
|
|
1166
1162
|
hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
|
|
1167
1163
|
label: "允許自簽",
|
|
1168
1164
|
name: "allowInitiatorSelfApproval",
|
|
@@ -1175,7 +1171,7 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1175
1171
|
}))
|
|
1176
1172
|
})
|
|
1177
1173
|
})] }) : null] }) : null,
|
|
1178
|
-
t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(
|
|
1174
|
+
t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
|
|
1179
1175
|
label: "包含下層",
|
|
1180
1176
|
name: "includeDescendants",
|
|
1181
1177
|
children: /* @__PURE__ */ h(le, {
|
|
@@ -1187,28 +1183,28 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1187
1183
|
})
|
|
1188
1184
|
})
|
|
1189
1185
|
}) : null,
|
|
1190
|
-
t.type === "POSITION" ? /* @__PURE__ */ h(
|
|
1186
|
+
t.type === "POSITION" ? /* @__PURE__ */ h(o, {
|
|
1191
1187
|
hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。",
|
|
1192
1188
|
label: "職位",
|
|
1193
1189
|
name: "positionId",
|
|
1194
1190
|
required: !0,
|
|
1195
|
-
children: /* @__PURE__ */ h(
|
|
1191
|
+
children: /* @__PURE__ */ h(a, {
|
|
1196
1192
|
name: "positionId",
|
|
1197
1193
|
onChange: (e) => $({
|
|
1198
1194
|
positionId: e?.id ?? "",
|
|
1199
1195
|
type: "POSITION"
|
|
1200
1196
|
}),
|
|
1201
1197
|
placeholder: "選擇職位",
|
|
1202
|
-
positions:
|
|
1203
|
-
value:
|
|
1198
|
+
positions: L,
|
|
1199
|
+
value: c
|
|
1204
1200
|
})
|
|
1205
1201
|
}) : null,
|
|
1206
|
-
t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(
|
|
1202
|
+
t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(o, {
|
|
1207
1203
|
hintText: "只納入指定組織範圍內擁有此職位的有效會員。",
|
|
1208
1204
|
label: "職位",
|
|
1209
1205
|
name: "orgUnitPositionId",
|
|
1210
1206
|
required: !0,
|
|
1211
|
-
children: /* @__PURE__ */ h(
|
|
1207
|
+
children: /* @__PURE__ */ h(a, {
|
|
1212
1208
|
disabled: !t.orgUnitId.trim(),
|
|
1213
1209
|
name: "orgUnitPositionId",
|
|
1214
1210
|
onChange: (e) => $({
|
|
@@ -1218,27 +1214,27 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1218
1214
|
type: "ORG_UNIT_POSITION"
|
|
1219
1215
|
}),
|
|
1220
1216
|
placeholder: t.orgUnitId.trim() ? "選擇職位" : "請先選擇組織",
|
|
1221
|
-
positions:
|
|
1222
|
-
value:
|
|
1217
|
+
positions: l,
|
|
1218
|
+
value: c
|
|
1223
1219
|
})
|
|
1224
1220
|
}) : null,
|
|
1225
|
-
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ h(
|
|
1221
|
+
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ h(o, {
|
|
1226
1222
|
hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
|
|
1227
1223
|
label: "重送策略",
|
|
1228
1224
|
name: "returnResubmitStrategy",
|
|
1229
1225
|
required: !0,
|
|
1230
|
-
children: /* @__PURE__ */ h(
|
|
1226
|
+
children: /* @__PURE__ */ h(f, {
|
|
1231
1227
|
clearable: !1,
|
|
1232
|
-
onChange: (e) =>
|
|
1233
|
-
options: [...
|
|
1234
|
-
value:
|
|
1228
|
+
onChange: (e) => mr(Ut(e?.id ?? null)),
|
|
1229
|
+
options: [...dt],
|
|
1230
|
+
value: z(dt, ne)
|
|
1235
1231
|
})
|
|
1236
1232
|
}) : null
|
|
1237
1233
|
] });
|
|
1238
1234
|
}
|
|
1239
|
-
function
|
|
1240
|
-
let t = tr(e.data.action).map((e) =>
|
|
1241
|
-
return /* @__PURE__ */ h(
|
|
1235
|
+
function Or(e) {
|
|
1236
|
+
let t = tr(e.data.action).map((e) => bn(P, e));
|
|
1237
|
+
return /* @__PURE__ */ h(o, {
|
|
1242
1238
|
label: "知會對象",
|
|
1243
1239
|
name: "notifyMemberIds",
|
|
1244
1240
|
required: !0,
|
|
@@ -1246,10 +1242,10 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1246
1242
|
asyncData: !0,
|
|
1247
1243
|
disabledOptionsFilter: !0,
|
|
1248
1244
|
emptyText: "沒有符合的成員",
|
|
1249
|
-
loading:
|
|
1245
|
+
loading: Ct,
|
|
1250
1246
|
loadingText: "搜尋成員中...",
|
|
1251
1247
|
mode: "multiple",
|
|
1252
|
-
onChange: (e) =>
|
|
1248
|
+
onChange: (e) => hr({
|
|
1253
1249
|
channels: ["IN_APP"],
|
|
1254
1250
|
recipients: {
|
|
1255
1251
|
memberIds: e.map((e) => e.id),
|
|
@@ -1257,11 +1253,11 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1257
1253
|
},
|
|
1258
1254
|
type: "NOTIFY"
|
|
1259
1255
|
}),
|
|
1260
|
-
onSearch:
|
|
1256
|
+
onSearch: Z,
|
|
1261
1257
|
onVisibilityChange: (e) => {
|
|
1262
|
-
e &&
|
|
1258
|
+
e && Z("");
|
|
1263
1259
|
},
|
|
1264
|
-
options: [...
|
|
1260
|
+
options: [...P],
|
|
1265
1261
|
overflowStrategy: "wrap",
|
|
1266
1262
|
placeholder: "搜尋姓名或信箱",
|
|
1267
1263
|
searchDebounceTime: 300,
|
|
@@ -1269,14 +1265,14 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1269
1265
|
})
|
|
1270
1266
|
});
|
|
1271
1267
|
}
|
|
1272
|
-
function
|
|
1268
|
+
function kr(e) {
|
|
1273
1269
|
return /* @__PURE__ */ g("div", {
|
|
1274
|
-
style:
|
|
1275
|
-
children: [/* @__PURE__ */ h(
|
|
1270
|
+
style: S,
|
|
1271
|
+
children: [/* @__PURE__ */ h(p, {
|
|
1276
1272
|
component: "h2",
|
|
1277
1273
|
variant: "h3",
|
|
1278
1274
|
children: "已選取線段"
|
|
1279
|
-
}), /* @__PURE__ */ g(
|
|
1275
|
+
}), /* @__PURE__ */ g(p, {
|
|
1280
1276
|
color: "text-neutral",
|
|
1281
1277
|
variant: "body",
|
|
1282
1278
|
children: [
|
|
@@ -1287,17 +1283,17 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1287
1283
|
})]
|
|
1288
1284
|
});
|
|
1289
1285
|
}
|
|
1290
|
-
function
|
|
1291
|
-
let t =
|
|
1286
|
+
function Ar(e) {
|
|
1287
|
+
let t = X(e, v.nodes);
|
|
1292
1288
|
return /* @__PURE__ */ g("div", {
|
|
1293
|
-
style:
|
|
1289
|
+
style: S,
|
|
1294
1290
|
children: [
|
|
1295
|
-
/* @__PURE__ */ h(
|
|
1291
|
+
/* @__PURE__ */ h(p, {
|
|
1296
1292
|
component: "h2",
|
|
1297
1293
|
variant: "h3",
|
|
1298
1294
|
children: t ? "條件設定" : "線段屬性"
|
|
1299
1295
|
}),
|
|
1300
|
-
/* @__PURE__ */ g(
|
|
1296
|
+
/* @__PURE__ */ g(p, {
|
|
1301
1297
|
color: "text-neutral",
|
|
1302
1298
|
variant: "body",
|
|
1303
1299
|
children: [
|
|
@@ -1306,7 +1302,7 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1306
1302
|
e.target
|
|
1307
1303
|
]
|
|
1308
1304
|
}),
|
|
1309
|
-
t ?
|
|
1305
|
+
t ? Mr(e) : /* @__PURE__ */ h(p, {
|
|
1310
1306
|
color: "text-neutral",
|
|
1311
1307
|
variant: "body",
|
|
1312
1308
|
children: "這條線會直接把流程送到下一個節點。"
|
|
@@ -1314,36 +1310,36 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1314
1310
|
]
|
|
1315
1311
|
});
|
|
1316
1312
|
}
|
|
1317
|
-
function
|
|
1318
|
-
return !e || !
|
|
1313
|
+
function jr(e) {
|
|
1314
|
+
return !e || !X(e, v.nodes) ? null : /* @__PURE__ */ h(ie, {
|
|
1319
1315
|
cancelText: "取消",
|
|
1320
1316
|
confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
|
|
1321
1317
|
confirmText: "完成",
|
|
1322
1318
|
modalType: "standard",
|
|
1323
|
-
onCancel:
|
|
1324
|
-
onClose:
|
|
1325
|
-
onConfirm:
|
|
1326
|
-
open: !!
|
|
1319
|
+
onCancel: dr,
|
|
1320
|
+
onClose: dr,
|
|
1321
|
+
onConfirm: dr,
|
|
1322
|
+
open: !!tt,
|
|
1327
1323
|
showModalFooter: !0,
|
|
1328
1324
|
showModalHeader: !0,
|
|
1329
1325
|
size: "regular",
|
|
1330
1326
|
supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
|
|
1331
1327
|
title: "條件設定",
|
|
1332
|
-
children:
|
|
1328
|
+
children: Mr(e)
|
|
1333
1329
|
});
|
|
1334
1330
|
}
|
|
1335
|
-
function
|
|
1336
|
-
let t =
|
|
1331
|
+
function Mr(e) {
|
|
1332
|
+
let t = $n(e, v.nodes), n = Bn(K?.schema ?? null), r = Vn(K?.schema ?? null, e.data.conditionFieldKey ?? null), i = Hn(r), a = Gn(r), s = z(i, e.data.conditionOperator ?? null);
|
|
1337
1333
|
return /* @__PURE__ */ g("div", {
|
|
1338
|
-
style:
|
|
1334
|
+
style: S,
|
|
1339
1335
|
children: [
|
|
1340
|
-
/* @__PURE__ */ g(
|
|
1336
|
+
/* @__PURE__ */ g(p, {
|
|
1341
1337
|
color: "text-neutral",
|
|
1342
1338
|
variant: "body",
|
|
1343
1339
|
children: [
|
|
1344
1340
|
"畫布上的這條線目前會顯示「",
|
|
1345
1341
|
/* @__PURE__ */ h("span", {
|
|
1346
|
-
style: { color: !e.data.isDefault && !e.data.condition ?
|
|
1342
|
+
style: { color: !e.data.isDefault && !e.data.condition ? Ge : void 0 },
|
|
1347
1343
|
children: t ?? "請設定條件"
|
|
1348
1344
|
}),
|
|
1349
1345
|
"」。"
|
|
@@ -1352,25 +1348,25 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1352
1348
|
/* @__PURE__ */ h(le, {
|
|
1353
1349
|
checked: !!e.data.isDefault,
|
|
1354
1350
|
label: "其他情況走這條",
|
|
1355
|
-
onChange: (t) =>
|
|
1351
|
+
onChange: (t) => br(e.id, t.target.checked)
|
|
1356
1352
|
}),
|
|
1357
|
-
e.data.isDefault ? /* @__PURE__ */ h(
|
|
1353
|
+
e.data.isDefault ? /* @__PURE__ */ h(p, {
|
|
1358
1354
|
color: "text-neutral",
|
|
1359
1355
|
variant: "body",
|
|
1360
1356
|
children: "其他條件都不符合時,流程會走這條線。"
|
|
1361
|
-
}) : /* @__PURE__ */ g(
|
|
1362
|
-
|
|
1357
|
+
}) : /* @__PURE__ */ g(m, { children: [
|
|
1358
|
+
K ? null : /* @__PURE__ */ h(p, {
|
|
1363
1359
|
color: "text-neutral",
|
|
1364
1360
|
variant: "body",
|
|
1365
1361
|
children: "請先綁定表單版本,才能選擇條件欄位。"
|
|
1366
1362
|
}),
|
|
1367
|
-
/* @__PURE__ */ h(
|
|
1363
|
+
/* @__PURE__ */ h(o, {
|
|
1368
1364
|
label: "條件欄位",
|
|
1369
1365
|
name: "edgeConditionField",
|
|
1370
1366
|
required: !0,
|
|
1371
|
-
children: /* @__PURE__ */ h(
|
|
1367
|
+
children: /* @__PURE__ */ h(f, {
|
|
1372
1368
|
clearable: !1,
|
|
1373
|
-
onChange: (t) =>
|
|
1369
|
+
onChange: (t) => xr({
|
|
1374
1370
|
edgeId: e.id,
|
|
1375
1371
|
fieldKey: t?.id ?? null,
|
|
1376
1372
|
operator: null,
|
|
@@ -1378,40 +1374,40 @@ function bt({ templateId: r, activeHref: a }) {
|
|
|
1378
1374
|
}),
|
|
1379
1375
|
options: [...n],
|
|
1380
1376
|
placeholder: "選擇條件欄位",
|
|
1381
|
-
value:
|
|
1377
|
+
value: z(n, e.data.conditionFieldKey ?? null)
|
|
1382
1378
|
})
|
|
1383
1379
|
}),
|
|
1384
|
-
/* @__PURE__ */ h(
|
|
1380
|
+
/* @__PURE__ */ h(o, {
|
|
1385
1381
|
label: "條件判斷",
|
|
1386
1382
|
name: "edgeConditionOperator",
|
|
1387
1383
|
required: !0,
|
|
1388
|
-
children: /* @__PURE__ */ h(
|
|
1384
|
+
children: /* @__PURE__ */ h(f, {
|
|
1389
1385
|
clearable: !1,
|
|
1390
|
-
onChange: (t) =>
|
|
1386
|
+
onChange: (t) => xr({
|
|
1391
1387
|
edgeId: e.id,
|
|
1392
|
-
operator:
|
|
1388
|
+
operator: Un(t?.id ?? null),
|
|
1393
1389
|
value: null
|
|
1394
1390
|
}),
|
|
1395
1391
|
options: [...i],
|
|
1396
1392
|
placeholder: "選擇判斷方式",
|
|
1397
|
-
value:
|
|
1393
|
+
value: s
|
|
1398
1394
|
})
|
|
1399
1395
|
}),
|
|
1400
|
-
|
|
1396
|
+
s && Jn(s.id) ? /* @__PURE__ */ h(o, {
|
|
1401
1397
|
label: "條件值",
|
|
1402
1398
|
name: "edgeConditionValue",
|
|
1403
1399
|
required: !0,
|
|
1404
|
-
children: a.length > 0 ? /* @__PURE__ */ h(
|
|
1400
|
+
children: a.length > 0 ? /* @__PURE__ */ h(f, {
|
|
1405
1401
|
clearable: !1,
|
|
1406
|
-
onChange: (t) =>
|
|
1402
|
+
onChange: (t) => xr({
|
|
1407
1403
|
edgeId: e.id,
|
|
1408
1404
|
value: t?.id ?? null
|
|
1409
1405
|
}),
|
|
1410
1406
|
options: [...a],
|
|
1411
1407
|
placeholder: "選擇條件值",
|
|
1412
|
-
value:
|
|
1408
|
+
value: z(a, e.data.conditionValue ?? null)
|
|
1413
1409
|
}) : /* @__PURE__ */ h(re, {
|
|
1414
|
-
onChange: (t) =>
|
|
1410
|
+
onChange: (t) => xr({
|
|
1415
1411
|
edgeId: e.id,
|
|
1416
1412
|
value: t.target.value
|
|
1417
1413
|
}),
|
|
@@ -1429,9 +1425,9 @@ function xt({ onApplyAutoLayout: e }) {
|
|
|
1429
1425
|
function t() {
|
|
1430
1426
|
e();
|
|
1431
1427
|
}
|
|
1432
|
-
return /* @__PURE__ */ h(
|
|
1428
|
+
return /* @__PURE__ */ h(v, {
|
|
1433
1429
|
position: "top-right",
|
|
1434
|
-
children: /* @__PURE__ */ h(
|
|
1430
|
+
children: /* @__PURE__ */ h(d, {
|
|
1435
1431
|
icon: fe,
|
|
1436
1432
|
iconType: "leading",
|
|
1437
1433
|
onClick: t,
|
|
@@ -1441,28 +1437,28 @@ function xt({ onApplyAutoLayout: e }) {
|
|
|
1441
1437
|
})
|
|
1442
1438
|
});
|
|
1443
1439
|
}
|
|
1444
|
-
function
|
|
1440
|
+
function N({ data: e, selected: t, type: n }) {
|
|
1445
1441
|
let r = e.approverLines ?? [e.approverSummary ?? e.label], i = St(e);
|
|
1446
1442
|
return /* @__PURE__ */ g("div", {
|
|
1447
1443
|
style: Ct(n, t),
|
|
1448
1444
|
children: [
|
|
1449
|
-
|
|
1445
|
+
P(e),
|
|
1450
1446
|
/* @__PURE__ */ h("div", {
|
|
1451
|
-
style:
|
|
1452
|
-
children: r.map((e, t) => /* @__PURE__ */ h(
|
|
1447
|
+
style: at,
|
|
1448
|
+
children: r.map((e, t) => /* @__PURE__ */ h(p, {
|
|
1453
1449
|
component: "span",
|
|
1454
1450
|
ellipsis: !0,
|
|
1455
|
-
style:
|
|
1451
|
+
style: it,
|
|
1456
1452
|
title: e,
|
|
1457
1453
|
variant: "label-primary",
|
|
1458
1454
|
children: e
|
|
1459
1455
|
}, `${e}_${t}`))
|
|
1460
1456
|
}),
|
|
1461
|
-
/* @__PURE__ */ h(
|
|
1457
|
+
/* @__PURE__ */ h(p, {
|
|
1462
1458
|
color: "text-neutral",
|
|
1463
1459
|
component: "span",
|
|
1464
1460
|
ellipsis: !0,
|
|
1465
|
-
style:
|
|
1461
|
+
style: it,
|
|
1466
1462
|
title: i,
|
|
1467
1463
|
variant: "caption",
|
|
1468
1464
|
children: i
|
|
@@ -1471,46 +1467,46 @@ function P({ data: e, selected: t, type: n }) {
|
|
|
1471
1467
|
});
|
|
1472
1468
|
}
|
|
1473
1469
|
function St(e) {
|
|
1474
|
-
return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" :
|
|
1470
|
+
return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : st[e.nodeKind];
|
|
1475
1471
|
}
|
|
1476
1472
|
function Ct(e, t) {
|
|
1477
1473
|
let n = wt(e);
|
|
1478
1474
|
return t ? {
|
|
1479
1475
|
...n,
|
|
1480
1476
|
border: "1px solid var(--mzn-color-primary, #0057ff)",
|
|
1481
|
-
boxShadow:
|
|
1477
|
+
boxShadow: $e
|
|
1482
1478
|
} : n;
|
|
1483
1479
|
}
|
|
1484
1480
|
function wt(e) {
|
|
1485
|
-
return e === "exclusiveGateway" ?
|
|
1481
|
+
return e === "exclusiveGateway" ? tt : e === "parallelGateway" ? k : e === "startEvent" ? A : e === "endEvent" ? rt : e === "userTask" ? nt : C;
|
|
1486
1482
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return !e.hasInput && e.hasOutput ? /* @__PURE__ */ h(
|
|
1489
|
-
id:
|
|
1490
|
-
position:
|
|
1483
|
+
function P(e) {
|
|
1484
|
+
return !e.hasInput && e.hasOutput ? /* @__PURE__ */ h(_, {
|
|
1485
|
+
id: ot,
|
|
1486
|
+
position: y.Right,
|
|
1491
1487
|
type: "source"
|
|
1492
|
-
}) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ h(
|
|
1493
|
-
id:
|
|
1494
|
-
position:
|
|
1495
|
-
type: "target"
|
|
1496
|
-
}) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ h(Te, {
|
|
1497
|
-
id: A,
|
|
1498
|
-
position: _.Left,
|
|
1488
|
+
}) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ h(_, {
|
|
1489
|
+
id: j,
|
|
1490
|
+
position: y.Left,
|
|
1499
1491
|
type: "target"
|
|
1500
|
-
}
|
|
1492
|
+
}) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ h(_, {
|
|
1501
1493
|
id: j,
|
|
1502
|
-
position:
|
|
1494
|
+
position: y.Left,
|
|
1495
|
+
type: "target"
|
|
1496
|
+
}, "target"), /* @__PURE__ */ h(_, {
|
|
1497
|
+
id: ot,
|
|
1498
|
+
position: y.Right,
|
|
1503
1499
|
type: "source"
|
|
1504
1500
|
}, "source")];
|
|
1505
1501
|
}
|
|
1506
|
-
function
|
|
1502
|
+
function Tt(e, t, n, r, i, a) {
|
|
1507
1503
|
let o = F(e);
|
|
1508
1504
|
return {
|
|
1509
1505
|
data: {
|
|
1510
|
-
approverLines:
|
|
1511
|
-
approverSummary:
|
|
1512
|
-
hasInput:
|
|
1513
|
-
hasOutput:
|
|
1506
|
+
approverLines: Pn(e, t),
|
|
1507
|
+
approverSummary: Mn(e, t, n, r),
|
|
1508
|
+
hasInput: B(e),
|
|
1509
|
+
hasOutput: V(e),
|
|
1514
1510
|
initiatorPolicySummary: e.type === "startEvent" ? nn(a, n, r) : null,
|
|
1515
1511
|
label: e.data.label,
|
|
1516
1512
|
nodeKind: e.type
|
|
@@ -1522,34 +1518,34 @@ function Et(e, t, n, r, i, a) {
|
|
|
1522
1518
|
initialWidth: o.width,
|
|
1523
1519
|
position: e.position,
|
|
1524
1520
|
selected: i,
|
|
1525
|
-
sourcePosition:
|
|
1526
|
-
targetPosition:
|
|
1521
|
+
sourcePosition: y.Right,
|
|
1522
|
+
targetPosition: y.Left,
|
|
1527
1523
|
type: e.type,
|
|
1528
1524
|
width: o.width
|
|
1529
1525
|
};
|
|
1530
1526
|
}
|
|
1531
1527
|
function F(e) {
|
|
1532
1528
|
return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
|
|
1533
|
-
height:
|
|
1534
|
-
width:
|
|
1529
|
+
height: E,
|
|
1530
|
+
width: D
|
|
1535
1531
|
} : e.type === "serviceTask" ? {
|
|
1536
|
-
height:
|
|
1537
|
-
width:
|
|
1532
|
+
height: et + (Math.max(1, tr(e.data.action).length) - 1) * T,
|
|
1533
|
+
width: w
|
|
1538
1534
|
} : {
|
|
1539
|
-
height:
|
|
1540
|
-
width:
|
|
1535
|
+
height: et,
|
|
1536
|
+
width: w
|
|
1541
1537
|
};
|
|
1542
1538
|
}
|
|
1543
1539
|
function I(e) {
|
|
1544
1540
|
let t = F(e);
|
|
1545
|
-
return [...
|
|
1541
|
+
return [...B(e) ? [Et(t)] : [], ...V(e) ? [L(t)] : []];
|
|
1546
1542
|
}
|
|
1547
|
-
function
|
|
1543
|
+
function Et({ height: e }) {
|
|
1548
1544
|
let t = e / 2 - 9 / 2;
|
|
1549
1545
|
return {
|
|
1550
1546
|
height: 9,
|
|
1551
|
-
id:
|
|
1552
|
-
position:
|
|
1547
|
+
id: j,
|
|
1548
|
+
position: y.Left,
|
|
1553
1549
|
type: "target",
|
|
1554
1550
|
width: 9,
|
|
1555
1551
|
x: -9 / 2,
|
|
@@ -1560,16 +1556,16 @@ function L({ height: e, width: t }) {
|
|
|
1560
1556
|
let n = e / 2 - 9 / 2;
|
|
1561
1557
|
return {
|
|
1562
1558
|
height: 9,
|
|
1563
|
-
id:
|
|
1564
|
-
position:
|
|
1559
|
+
id: ot,
|
|
1560
|
+
position: y.Right,
|
|
1565
1561
|
type: "source",
|
|
1566
1562
|
width: 9,
|
|
1567
1563
|
x: t - 9 / 2,
|
|
1568
1564
|
y: n
|
|
1569
1565
|
};
|
|
1570
1566
|
}
|
|
1571
|
-
function
|
|
1572
|
-
let r =
|
|
1567
|
+
function Dt(e, t, n) {
|
|
1568
|
+
let r = $n(e, t), i = X(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Ge : i ? We : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Ge : i ? We : x;
|
|
1573
1569
|
return {
|
|
1574
1570
|
className: n ? "workflow-edge--selected" : void 0,
|
|
1575
1571
|
data: e.data,
|
|
@@ -1579,7 +1575,7 @@ function Ot(e, t, n) {
|
|
|
1579
1575
|
labelBgPadding: [8, 4],
|
|
1580
1576
|
labelBgStyle: {
|
|
1581
1577
|
fill: s,
|
|
1582
|
-
stroke:
|
|
1578
|
+
stroke: c,
|
|
1583
1579
|
strokeWidth: 1
|
|
1584
1580
|
},
|
|
1585
1581
|
labelShowBg: !!r,
|
|
@@ -1592,9 +1588,9 @@ function Ot(e, t, n) {
|
|
|
1592
1588
|
source: e.source,
|
|
1593
1589
|
sourceHandle: e.sourceHandle,
|
|
1594
1590
|
style: {
|
|
1595
|
-
filter: n ?
|
|
1591
|
+
filter: n ? Ke : void 0,
|
|
1596
1592
|
opacity: 1,
|
|
1597
|
-
stroke:
|
|
1593
|
+
stroke: x,
|
|
1598
1594
|
strokeOpacity: 1,
|
|
1599
1595
|
strokeWidth: 1.5
|
|
1600
1596
|
},
|
|
@@ -1603,7 +1599,7 @@ function Ot(e, t, n) {
|
|
|
1603
1599
|
type: e.type ?? "smoothstep"
|
|
1604
1600
|
};
|
|
1605
1601
|
}
|
|
1606
|
-
function
|
|
1602
|
+
function Ot(e, t) {
|
|
1607
1603
|
return e.type === "startEvent" || e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
|
|
1608
1604
|
...e,
|
|
1609
1605
|
data: {
|
|
@@ -1612,7 +1608,7 @@ function kt(e, t) {
|
|
|
1612
1608
|
}
|
|
1613
1609
|
};
|
|
1614
1610
|
}
|
|
1615
|
-
function
|
|
1611
|
+
function kt(e, t) {
|
|
1616
1612
|
return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
|
|
1617
1613
|
...e,
|
|
1618
1614
|
data: {
|
|
@@ -1621,21 +1617,21 @@ function At(e, t) {
|
|
|
1621
1617
|
}
|
|
1622
1618
|
});
|
|
1623
1619
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return
|
|
1620
|
+
function At(e) {
|
|
1621
|
+
return Mt(jt(e));
|
|
1626
1622
|
}
|
|
1627
|
-
function
|
|
1623
|
+
function jt(e) {
|
|
1628
1624
|
let t = new Set(e.nodes.filter((e) => cn(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
|
|
1629
1625
|
return n.length === e.edges.length ? e : {
|
|
1630
1626
|
...e,
|
|
1631
1627
|
edges: n
|
|
1632
1628
|
};
|
|
1633
1629
|
}
|
|
1634
|
-
function
|
|
1630
|
+
function Mt(e) {
|
|
1635
1631
|
let t = e.edges.reduce((e, t) => ({
|
|
1636
1632
|
...e,
|
|
1637
1633
|
[t.target]: (e[t.target] ?? 0) + 1
|
|
1638
|
-
}), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ?
|
|
1634
|
+
}), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? kt(e, "AND") : e);
|
|
1639
1635
|
return n.some((t, n) => t !== e.nodes[n]) ? {
|
|
1640
1636
|
...e,
|
|
1641
1637
|
nodes: n
|
|
@@ -1711,14 +1707,14 @@ function Ft({ definition: e, node: t, selectedEdgeId: n, selectedNodeId: r }) {
|
|
|
1711
1707
|
};
|
|
1712
1708
|
}
|
|
1713
1709
|
function It(e, t, n) {
|
|
1714
|
-
if (!
|
|
1710
|
+
if (!B(t)) return {
|
|
1715
1711
|
definition: e,
|
|
1716
1712
|
editingEdgeId: null,
|
|
1717
1713
|
selectedEdgeIds: [n.id],
|
|
1718
1714
|
selectedNodeId: null
|
|
1719
1715
|
};
|
|
1720
|
-
if (!
|
|
1721
|
-
let r =
|
|
1716
|
+
if (!V(t)) {
|
|
1717
|
+
let r = R(n.source, t.id, {});
|
|
1722
1718
|
return {
|
|
1723
1719
|
definition: {
|
|
1724
1720
|
...e,
|
|
@@ -1730,7 +1726,7 @@ function It(e, t, n) {
|
|
|
1730
1726
|
selectedNodeId: t.id
|
|
1731
1727
|
};
|
|
1732
1728
|
}
|
|
1733
|
-
let r =
|
|
1729
|
+
let r = R(n.source, t.id, n.data), i = R(t.id, n.target, Rt(t, n)), a = X(i, [...e.nodes, t]);
|
|
1734
1730
|
return {
|
|
1735
1731
|
definition: {
|
|
1736
1732
|
...e,
|
|
@@ -1743,7 +1739,7 @@ function It(e, t, n) {
|
|
|
1743
1739
|
};
|
|
1744
1740
|
}
|
|
1745
1741
|
function Lt(e, t, n) {
|
|
1746
|
-
if (!
|
|
1742
|
+
if (!V(n)) return {
|
|
1747
1743
|
definition: {
|
|
1748
1744
|
...e,
|
|
1749
1745
|
nodes: [...e.nodes, t]
|
|
@@ -1753,10 +1749,10 @@ function Lt(e, t, n) {
|
|
|
1753
1749
|
selectedNodeId: t.id
|
|
1754
1750
|
};
|
|
1755
1751
|
let r = e.edges.find((e) => e.source === n.id) ?? null;
|
|
1756
|
-
if (r &&
|
|
1752
|
+
if (r && V(t)) return It(e, t, r);
|
|
1757
1753
|
let i = e.nodes.find((e) => e.type === "endEvent");
|
|
1758
|
-
if (i && n.id !== i.id &&
|
|
1759
|
-
let r =
|
|
1754
|
+
if (i && n.id !== i.id && V(t)) {
|
|
1755
|
+
let r = R(n.id, t.id, {}), a = R(t.id, i.id, Rt(t, r)), o = X(a, [...e.nodes, t]);
|
|
1760
1756
|
return {
|
|
1761
1757
|
definition: {
|
|
1762
1758
|
...e,
|
|
@@ -1772,7 +1768,7 @@ function Lt(e, t, n) {
|
|
|
1772
1768
|
selectedNodeId: o ? null : t.id
|
|
1773
1769
|
};
|
|
1774
1770
|
}
|
|
1775
|
-
let a =
|
|
1771
|
+
let a = R(n.id, t.id, {});
|
|
1776
1772
|
return {
|
|
1777
1773
|
definition: {
|
|
1778
1774
|
...e,
|
|
@@ -1784,14 +1780,14 @@ function Lt(e, t, n) {
|
|
|
1784
1780
|
selectedNodeId: t.id
|
|
1785
1781
|
};
|
|
1786
1782
|
}
|
|
1787
|
-
function
|
|
1783
|
+
function R(e, t, n) {
|
|
1788
1784
|
return {
|
|
1789
1785
|
data: n,
|
|
1790
1786
|
id: `edge_${e}_${t}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
|
|
1791
1787
|
source: e,
|
|
1792
|
-
sourceHandle:
|
|
1788
|
+
sourceHandle: ot,
|
|
1793
1789
|
target: t,
|
|
1794
|
-
targetHandle:
|
|
1790
|
+
targetHandle: j,
|
|
1795
1791
|
type: "smoothstep"
|
|
1796
1792
|
};
|
|
1797
1793
|
}
|
|
@@ -1832,7 +1828,7 @@ function Bt(e) {
|
|
|
1832
1828
|
return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
|
|
1833
1829
|
}
|
|
1834
1830
|
function Vt(e) {
|
|
1835
|
-
let t = new
|
|
1831
|
+
let t = new Oe.graphlib.Graph();
|
|
1836
1832
|
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
1837
1833
|
rankdir: "LR",
|
|
1838
1834
|
ranksep: 120
|
|
@@ -1840,7 +1836,7 @@ function Vt(e) {
|
|
|
1840
1836
|
t.setNode(e.id, F(e));
|
|
1841
1837
|
}), e.edges.forEach((e) => {
|
|
1842
1838
|
t.setEdge(e.source, e.target);
|
|
1843
|
-
}),
|
|
1839
|
+
}), Oe.layout(t), {
|
|
1844
1840
|
...e,
|
|
1845
1841
|
nodes: e.nodes.map((e) => {
|
|
1846
1842
|
let n = t.node(e.id);
|
|
@@ -1854,7 +1850,7 @@ function Vt(e) {
|
|
|
1854
1850
|
})
|
|
1855
1851
|
};
|
|
1856
1852
|
}
|
|
1857
|
-
function
|
|
1853
|
+
function z(e, t) {
|
|
1858
1854
|
return t ? e.find((e) => e.id === t) ?? null : null;
|
|
1859
1855
|
}
|
|
1860
1856
|
function Ht(e) {
|
|
@@ -1950,13 +1946,13 @@ function tn(e, t) {
|
|
|
1950
1946
|
if (e.mode === "ALL" || e.mode === "NONE") return null;
|
|
1951
1947
|
let n = e.orgUnitId?.trim() ?? "";
|
|
1952
1948
|
if (!n) return null;
|
|
1953
|
-
let r =
|
|
1949
|
+
let r = kn(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
|
|
1954
1950
|
if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
|
|
1955
1951
|
let i = e.positionId?.trim() ?? "";
|
|
1956
1952
|
return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
|
|
1957
1953
|
}
|
|
1958
1954
|
function nn(e, t, n) {
|
|
1959
|
-
return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${
|
|
1955
|
+
return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${H(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${H(t, e.orgUnitId)} / ${U(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
|
|
1960
1956
|
}
|
|
1961
1957
|
function rn(e) {
|
|
1962
1958
|
return {
|
|
@@ -1969,7 +1965,7 @@ function rn(e) {
|
|
|
1969
1965
|
}
|
|
1970
1966
|
function an(e, t) {
|
|
1971
1967
|
let n = e.source ? t.find((t) => t.id === e.source) ?? null : null, r = e.target ? t.find((t) => t.id === e.target) ?? null : null;
|
|
1972
|
-
return !!n && !!r && e.source !== e.target && e.sourceHandle ===
|
|
1968
|
+
return !!n && !!r && e.source !== e.target && e.sourceHandle === ot && e.targetHandle === j && !!(n && V(n)) && !!(r && B(r));
|
|
1973
1969
|
}
|
|
1974
1970
|
function on(e, t) {
|
|
1975
1971
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
@@ -1977,10 +1973,10 @@ function on(e, t) {
|
|
|
1977
1973
|
function sn(e) {
|
|
1978
1974
|
return e.type !== "startEvent" && e.type !== "endEvent";
|
|
1979
1975
|
}
|
|
1980
|
-
function
|
|
1976
|
+
function B(e) {
|
|
1981
1977
|
return e.type !== "startEvent";
|
|
1982
1978
|
}
|
|
1983
|
-
function
|
|
1979
|
+
function V(e) {
|
|
1984
1980
|
return e.type !== "endEvent" && !cn(e);
|
|
1985
1981
|
}
|
|
1986
1982
|
function cn(e) {
|
|
@@ -1999,39 +1995,39 @@ function un(e) {
|
|
|
1999
1995
|
function dn(e) {
|
|
2000
1996
|
return (e?.schema.fields ?? []).reduce((e, t) => ({
|
|
2001
1997
|
...e,
|
|
2002
|
-
[t.fieldKey]:
|
|
1998
|
+
[t.fieldKey]: fn(t)
|
|
2003
1999
|
}), {});
|
|
2004
2000
|
}
|
|
2005
|
-
function
|
|
2001
|
+
function fn(e) {
|
|
2006
2002
|
return e.type === "number" ? 1e3 : e.type === "boolean" ? !0 : e.type === "select" ? e.options[0]?.value ?? "" : e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
|
|
2007
2003
|
}
|
|
2008
|
-
function
|
|
2004
|
+
function pn(e) {
|
|
2009
2005
|
let t = JSON.parse(e);
|
|
2010
|
-
if (!
|
|
2006
|
+
if (!mn(t)) throw Error("表單資料 JSON 必須是物件。");
|
|
2011
2007
|
return t;
|
|
2012
2008
|
}
|
|
2013
|
-
function
|
|
2009
|
+
function mn(e) {
|
|
2014
2010
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2015
2011
|
}
|
|
2016
|
-
function
|
|
2012
|
+
function hn(e) {
|
|
2017
2013
|
return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
|
|
2018
2014
|
}
|
|
2019
|
-
function
|
|
2020
|
-
return e in
|
|
2015
|
+
function gn(e) {
|
|
2016
|
+
return e in st ? st[e] : e;
|
|
2021
2017
|
}
|
|
2022
|
-
function
|
|
2018
|
+
function _n(e, t) {
|
|
2023
2019
|
return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
|
|
2024
2020
|
}
|
|
2025
|
-
function
|
|
2021
|
+
function vn(e) {
|
|
2026
2022
|
return e.map((e) => ({
|
|
2027
2023
|
displayName: e.name,
|
|
2028
2024
|
email: e.email,
|
|
2029
2025
|
id: e.memberId,
|
|
2030
2026
|
memberId: e.memberId,
|
|
2031
|
-
name:
|
|
2027
|
+
name: G(e.name, e.email)
|
|
2032
2028
|
}));
|
|
2033
2029
|
}
|
|
2034
|
-
function
|
|
2030
|
+
function yn(e) {
|
|
2035
2031
|
return {
|
|
2036
2032
|
displayName: "未知會員",
|
|
2037
2033
|
email: "",
|
|
@@ -2040,29 +2036,29 @@ function vn(e) {
|
|
|
2040
2036
|
name: "未知會員"
|
|
2041
2037
|
};
|
|
2042
2038
|
}
|
|
2043
|
-
function yn(e, t) {
|
|
2044
|
-
return e.find((e) => e.memberId === t) ?? vn(t);
|
|
2045
|
-
}
|
|
2046
2039
|
function bn(e, t) {
|
|
2047
|
-
|
|
2048
|
-
return n ? yn(t, n) : null;
|
|
2040
|
+
return e.find((e) => e.memberId === t) ?? yn(t);
|
|
2049
2041
|
}
|
|
2050
2042
|
function xn(e, t) {
|
|
2051
|
-
let n = e
|
|
2052
|
-
return n ?
|
|
2043
|
+
let n = e[0];
|
|
2044
|
+
return n ? bn(t, n) : null;
|
|
2053
2045
|
}
|
|
2054
2046
|
function Sn(e, t) {
|
|
2047
|
+
let r = e.find((e) => e.id === t);
|
|
2048
|
+
return r ? n(r) : null;
|
|
2049
|
+
}
|
|
2050
|
+
function Cn(e, t) {
|
|
2055
2051
|
let n = e.find((e) => e.id === t);
|
|
2056
|
-
return n ?
|
|
2052
|
+
return n ? i(n) : null;
|
|
2057
2053
|
}
|
|
2058
|
-
function
|
|
2059
|
-
return
|
|
2054
|
+
function H(e, t) {
|
|
2055
|
+
return Sn(e, t)?.name ?? "未指定組織";
|
|
2060
2056
|
}
|
|
2061
|
-
function
|
|
2062
|
-
return
|
|
2057
|
+
function U(e, t) {
|
|
2058
|
+
return Cn(e, t)?.name ?? "未指定職位";
|
|
2063
2059
|
}
|
|
2064
|
-
function
|
|
2065
|
-
let n =
|
|
2060
|
+
function wn(e, t) {
|
|
2061
|
+
let n = Tn(), r = t.filter((t) => t.memberId === e && En(t, n)), i = r.reduce((e, t) => e && W(e, t) <= 0 ? e : t, null);
|
|
2066
2062
|
return {
|
|
2067
2063
|
customFields: {},
|
|
2068
2064
|
managerMemberId: "member-002",
|
|
@@ -2075,49 +2071,49 @@ function Cn(e, t) {
|
|
|
2075
2071
|
roles: ["manager"]
|
|
2076
2072
|
};
|
|
2077
2073
|
}
|
|
2078
|
-
function
|
|
2074
|
+
function Tn() {
|
|
2079
2075
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
2080
2076
|
}
|
|
2081
|
-
function
|
|
2077
|
+
function En(e, t) {
|
|
2082
2078
|
return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
|
|
2083
2079
|
}
|
|
2084
|
-
function
|
|
2080
|
+
function W(e, t) {
|
|
2085
2081
|
return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
|
|
2086
2082
|
}
|
|
2087
2083
|
function Dn(e) {
|
|
2088
2084
|
return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
|
|
2089
2085
|
}
|
|
2090
2086
|
function On({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
|
|
2091
|
-
let a = new Set(
|
|
2087
|
+
let a = new Set(kn(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
|
|
2092
2088
|
return i.filter((e) => o.has(e.id));
|
|
2093
2089
|
}
|
|
2094
|
-
function
|
|
2090
|
+
function kn(e, t, n) {
|
|
2095
2091
|
let r = e.find((e) => e.id === t);
|
|
2096
2092
|
return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
|
|
2097
2093
|
}
|
|
2098
|
-
function
|
|
2094
|
+
function An(e, t) {
|
|
2099
2095
|
let n = new Set(e.map((e) => e.memberId)), r = t.filter((e) => !n.has(e.memberId));
|
|
2100
2096
|
return [...e, ...r];
|
|
2101
2097
|
}
|
|
2102
|
-
function
|
|
2098
|
+
function jn(e) {
|
|
2103
2099
|
return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? e.data.approverResolver.type === "DIRECT" ? e.data.approverResolver.memberIds : [] : e.type === "serviceTask" ? tr(e.data.action) : []))];
|
|
2104
2100
|
}
|
|
2105
|
-
function jn(e, t, n, r) {
|
|
2106
|
-
return e.type === "userTask" ? Mn(e.data.approverResolver, t, n, r) : null;
|
|
2107
|
-
}
|
|
2108
2101
|
function Mn(e, t, n, r) {
|
|
2109
|
-
return e.type === "
|
|
2102
|
+
return e.type === "userTask" ? Nn(e.data.approverResolver, t, n, r) : null;
|
|
2110
2103
|
}
|
|
2111
|
-
function Nn(e, t) {
|
|
2104
|
+
function Nn(e, t, n, r) {
|
|
2105
|
+
return e.type === "DIRECT" ? Fn(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? Jt(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${H(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${H(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${H(n, e.orgUnitId)} / ${U(r, e.positionId)}` : e.type === "POSITION" ? `職位:${U(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
|
|
2106
|
+
}
|
|
2107
|
+
function Pn(e, t) {
|
|
2112
2108
|
if (e.type !== "serviceTask") return null;
|
|
2113
2109
|
let n = tr(e.data.action);
|
|
2114
|
-
return n.length === 0 ? ["未指定知會對象"] : n.map((e) =>
|
|
2110
|
+
return n.length === 0 ? ["未指定知會對象"] : n.map((e) => bn(t, e).name);
|
|
2115
2111
|
}
|
|
2116
|
-
function
|
|
2117
|
-
let r = e.map((e) =>
|
|
2112
|
+
function Fn(e, t, n) {
|
|
2113
|
+
let r = e.map((e) => bn(t, e).name);
|
|
2118
2114
|
return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
|
|
2119
2115
|
}
|
|
2120
|
-
function
|
|
2116
|
+
function G(e, t) {
|
|
2121
2117
|
return `${e} (${t})`;
|
|
2122
2118
|
}
|
|
2123
2119
|
function In(e, t) {
|
|
@@ -2137,7 +2133,7 @@ function In(e, t) {
|
|
|
2137
2133
|
minX: Infinity,
|
|
2138
2134
|
minY: Infinity
|
|
2139
2135
|
});
|
|
2140
|
-
return
|
|
2136
|
+
return De({
|
|
2141
2137
|
height: r.maxY - r.minY,
|
|
2142
2138
|
width: r.maxX - r.minX,
|
|
2143
2139
|
x: r.minX,
|
|
@@ -2145,34 +2141,34 @@ function In(e, t) {
|
|
|
2145
2141
|
}, n.width, n.height, .1, 1, .2);
|
|
2146
2142
|
}
|
|
2147
2143
|
function Ln(e) {
|
|
2148
|
-
let t = e.nodes.find((e) => e.type === "userTask" && !!
|
|
2149
|
-
return t && t.type === "userTask" ?
|
|
2150
|
-
}
|
|
2151
|
-
function q(e) {
|
|
2152
|
-
return e.type === "DIRECT" && e.memberIds.length === 0 ? "簽核節點需要指定簽核會員。" : e.type === "ORG_MANAGER" && e.levelsUp < 1 ? "簽核節點需要指定有效的主管層級。" : e.type === "ORG_UNIT_MANAGER" && !e.orgUnitId.trim() || e.type === "ORG_UNIT_MEMBER" && !e.orgUnitId.trim() ? "簽核節點需要指定組織。" : e.type === "ORG_UNIT_POSITION" && (!e.orgUnitId.trim() || !e.positionId.trim()) ? "簽核節點需要指定組織與職位。" : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && !e.fallback.memberId.trim() ? "簽核節點需要指定改派固定人。" : e.type === "POSITION" && !e.positionId.trim() ? "簽核節點需要指定職位。" : null;
|
|
2144
|
+
let t = e.nodes.find((e) => e.type === "userTask" && !!Rn(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && tr(e.data.action).length === 0), r = e.edges.find((t) => X(t, e.nodes) && !t.data.isDefault && !t.data.condition);
|
|
2145
|
+
return t && t.type === "userTask" ? Rn(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
|
|
2153
2146
|
}
|
|
2154
2147
|
function Rn(e) {
|
|
2155
|
-
return e.
|
|
2148
|
+
return e.type === "DIRECT" && e.memberIds.length === 0 ? "簽核節點需要指定簽核會員。" : e.type === "ORG_MANAGER" && e.levelsUp < 1 ? "簽核節點需要指定有效的主管層級。" : e.type === "ORG_UNIT_MANAGER" && !e.orgUnitId.trim() || e.type === "ORG_UNIT_MEMBER" && !e.orgUnitId.trim() ? "簽核節點需要指定組織。" : e.type === "ORG_UNIT_POSITION" && (!e.orgUnitId.trim() || !e.positionId.trim()) ? "簽核節點需要指定組織與職位。" : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && !e.fallback.memberId.trim() ? "簽核節點需要指定改派固定人。" : e.type === "POSITION" && !e.positionId.trim() ? "簽核節點需要指定職位。" : null;
|
|
2156
2149
|
}
|
|
2157
2150
|
function zn(e) {
|
|
2151
|
+
return e.edges.some((t) => X(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
|
|
2152
|
+
}
|
|
2153
|
+
function Bn(e) {
|
|
2158
2154
|
return e?.fields.map((e) => ({
|
|
2159
2155
|
fieldType: e.type,
|
|
2160
2156
|
id: e.fieldKey,
|
|
2161
2157
|
name: `${e.label} (${e.fieldKey})`
|
|
2162
2158
|
})) ?? [];
|
|
2163
2159
|
}
|
|
2164
|
-
function
|
|
2160
|
+
function Vn(e, t) {
|
|
2165
2161
|
return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
|
|
2166
2162
|
}
|
|
2167
|
-
function
|
|
2163
|
+
function Hn(e) {
|
|
2168
2164
|
if (!e) return [];
|
|
2169
|
-
let t =
|
|
2170
|
-
return
|
|
2165
|
+
let t = Wn(e);
|
|
2166
|
+
return mt.filter((e) => t.includes(e.id));
|
|
2171
2167
|
}
|
|
2172
|
-
function
|
|
2173
|
-
return
|
|
2168
|
+
function Un(e) {
|
|
2169
|
+
return mt.some((t) => t.id === e) ? e : null;
|
|
2174
2170
|
}
|
|
2175
|
-
function
|
|
2171
|
+
function Wn(e) {
|
|
2176
2172
|
return e.type === "file_upload" ? ["IS_FILLED", "IS_EMPTY"] : e.type === "boolean" ? [
|
|
2177
2173
|
"EQUALS",
|
|
2178
2174
|
"NOT_EQUALS",
|
|
@@ -2194,7 +2190,7 @@ function J(e) {
|
|
|
2194
2190
|
"IS_EMPTY"
|
|
2195
2191
|
];
|
|
2196
2192
|
}
|
|
2197
|
-
function
|
|
2193
|
+
function Gn(e) {
|
|
2198
2194
|
return e ? e.type === "boolean" ? [{
|
|
2199
2195
|
id: "true",
|
|
2200
2196
|
name: "是"
|
|
@@ -2206,68 +2202,68 @@ function Un(e) {
|
|
|
2206
2202
|
name: e.label
|
|
2207
2203
|
})) : [] : [];
|
|
2208
2204
|
}
|
|
2209
|
-
function
|
|
2205
|
+
function Kn(e, t) {
|
|
2210
2206
|
if (!e) return;
|
|
2211
|
-
let n =
|
|
2207
|
+
let n = Wn(e);
|
|
2212
2208
|
return t && n.includes(t) ? t : n[0];
|
|
2213
2209
|
}
|
|
2214
|
-
function
|
|
2215
|
-
if (!e || !t || !
|
|
2216
|
-
let r =
|
|
2210
|
+
function qn(e, t, n) {
|
|
2211
|
+
if (!e || !t || !Jn(t)) return;
|
|
2212
|
+
let r = Gn(e);
|
|
2217
2213
|
return r.length === 0 || r.some((e) => e.id === n) ? n ?? void 0 : r[0]?.id;
|
|
2218
2214
|
}
|
|
2219
|
-
function
|
|
2215
|
+
function Jn(e) {
|
|
2220
2216
|
return ht.includes(e);
|
|
2221
2217
|
}
|
|
2222
|
-
function
|
|
2218
|
+
function Yn(e, t, n) {
|
|
2223
2219
|
if (!e || !t) return;
|
|
2224
|
-
let r =
|
|
2225
|
-
if (!
|
|
2226
|
-
if (n) return `${e.label} ${r} ${
|
|
2220
|
+
let r = K(t);
|
|
2221
|
+
if (!Jn(t)) return `${e.label} ${r}`;
|
|
2222
|
+
if (n) return `${e.label} ${r} ${Xn(e, n)}`;
|
|
2227
2223
|
}
|
|
2228
|
-
function
|
|
2229
|
-
return
|
|
2224
|
+
function K(e) {
|
|
2225
|
+
return mt.find((t) => t.id === e)?.name ?? e;
|
|
2230
2226
|
}
|
|
2231
|
-
function
|
|
2232
|
-
return e.type === "boolean" ? t === "true" ? "是" : "否" : e.type === "checkbox" || e.type === "radio" || e.type === "select" ?
|
|
2227
|
+
function Xn(e, t) {
|
|
2228
|
+
return e.type === "boolean" ? t === "true" ? "是" : "否" : e.type === "checkbox" || e.type === "radio" || e.type === "select" ? q(e.options, t)?.label ?? t : t;
|
|
2233
2229
|
}
|
|
2234
|
-
function
|
|
2230
|
+
function q(e, t) {
|
|
2235
2231
|
return e.find((e) => e.value === t) ?? null;
|
|
2236
2232
|
}
|
|
2237
|
-
function
|
|
2233
|
+
function Zn(e, t, n) {
|
|
2238
2234
|
if (!e || !t) return;
|
|
2239
|
-
let r =
|
|
2235
|
+
let r = J(e.fieldKey);
|
|
2240
2236
|
if (t === "IS_FILLED") return `${r} != null && ${r} != ""`;
|
|
2241
2237
|
if (t === "IS_EMPTY") return `${r} == null || ${r} == ""`;
|
|
2242
|
-
if (n) return `${r} ${
|
|
2238
|
+
if (n) return `${r} ${Y(t)} ${Qn(e, n)}`;
|
|
2243
2239
|
}
|
|
2244
|
-
function
|
|
2240
|
+
function J(e) {
|
|
2245
2241
|
return /^[A-Za-z_][A-Za-z0-9_]*$/u.test(e) ? `form.${e}` : `form[${JSON.stringify(e)}]`;
|
|
2246
2242
|
}
|
|
2247
|
-
function
|
|
2243
|
+
function Y(e) {
|
|
2248
2244
|
return e === "EQUALS" ? "==" : e === "NOT_EQUALS" ? "!=" : e === "GREATER_THAN" ? ">" : e === "GREATER_THAN_OR_EQUALS" ? ">=" : e === "LESS_THAN" ? "<" : "<=";
|
|
2249
2245
|
}
|
|
2250
|
-
function
|
|
2246
|
+
function Qn(e, t) {
|
|
2251
2247
|
return e.type === "boolean" ? t === "true" ? "true" : "false" : (e.type === "money" || e.type === "number") && Number.isFinite(Number(t)) ? t : JSON.stringify(t);
|
|
2252
2248
|
}
|
|
2253
|
-
function
|
|
2249
|
+
function $n(e, t) {
|
|
2254
2250
|
if (e.data.label) return e.data.label;
|
|
2255
|
-
if (
|
|
2256
|
-
if (
|
|
2251
|
+
if (X(e, t)) return er(e);
|
|
2252
|
+
if (Z(e, t)) return "同時進行";
|
|
2257
2253
|
}
|
|
2258
|
-
function
|
|
2254
|
+
function er(e) {
|
|
2259
2255
|
return e.data.isDefault ? "其他情況" : "請設定條件";
|
|
2260
2256
|
}
|
|
2261
|
-
function
|
|
2257
|
+
function X(e, t) {
|
|
2262
2258
|
return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
|
|
2263
2259
|
}
|
|
2264
|
-
function
|
|
2260
|
+
function Z(e, t) {
|
|
2265
2261
|
return t.some((t) => t.id === e.source && t.type === "parallelGateway");
|
|
2266
2262
|
}
|
|
2267
2263
|
function tr(e) {
|
|
2268
2264
|
return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
|
|
2269
2265
|
}
|
|
2270
|
-
function
|
|
2266
|
+
function Q(e) {
|
|
2271
2267
|
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
2272
2268
|
}
|
|
2273
2269
|
//#endregion
|