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