@rytass/bpm-core-react 0.13.5 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/dist/chunks/FormBuilderView-6bCbIkz6.cjs +3 -0
- package/dist/chunks/FormBuilderView-6bCbIkz6.cjs.map +1 -0
- package/dist/chunks/{FormBuilderView-BYLN6W-P.js → FormBuilderView-CLg-JYmu.js} +495 -452
- package/dist/chunks/FormBuilderView-CLg-JYmu.js.map +1 -0
- package/dist/chunks/FormRendererView-DU9LLrOF.js +999 -0
- package/dist/chunks/FormRendererView-DU9LLrOF.js.map +1 -0
- package/dist/chunks/FormRendererView-gctFIqwC.cjs +4 -0
- package/dist/chunks/FormRendererView-gctFIqwC.cjs.map +1 -0
- package/dist/chunks/{compose-6P64PO1i.js → compose-BtQPBd1Q.js} +6 -5
- package/dist/chunks/compose-BtQPBd1Q.js.map +1 -0
- package/dist/chunks/compose-DZhTQOt4.cjs +2 -0
- package/dist/chunks/compose-DZhTQOt4.cjs.map +1 -0
- package/dist/chunks/{designer-C3s2kSna.js → designer-CrbBRPUU.js} +1382 -1199
- package/dist/chunks/designer-CrbBRPUU.js.map +1 -0
- package/dist/chunks/designer-D3_lWmfa.cjs +65 -0
- package/dist/chunks/designer-D3_lWmfa.cjs.map +1 -0
- package/dist/chunks/detail-CVXb5Vy8.cjs +2 -0
- package/dist/chunks/detail-CVXb5Vy8.cjs.map +1 -0
- package/dist/chunks/{detail-pYEIk-jW.js → detail-_c21WQla.js} +862 -815
- package/dist/chunks/detail-_c21WQla.js.map +1 -0
- package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
- package/dist/chunks/routes-config-yZbESPlw.js.map +1 -1
- package/dist/chunks/task-node-label-BF6UllxP.cjs +2 -0
- package/dist/chunks/task-node-label-BF6UllxP.cjs.map +1 -0
- package/dist/chunks/task-node-label-CWZgOBj0.js +9 -0
- package/dist/chunks/task-node-label-CWZgOBj0.js.map +1 -0
- package/dist/lib/member-profile-resolution.d.ts +48 -0
- package/dist/lib/routes-config.d.ts +1 -1
- package/dist/lib/task-node-label.d.ts +10 -0
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/renderer/form-field-link.d.ts +16 -0
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.js +2 -2
- package/dist/views/forms/renderer/member-field-options.d.ts +39 -0
- package/dist/views/forms/renderer/member-field.d.ts +21 -0
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +100 -97
- 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/detail/sections/container-helpers.d.ts +3 -2
- package/dist/views/instances/detail/sections/shared.d.ts +5 -0
- package/dist/views/instances/detail/submitted-by.d.ts +23 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.js +1 -1
- package/dist/views/sent/SentView.d.ts +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.cjs.map +1 -1
- package/dist/views/sent/index.js +2 -2
- package/dist/views/sent/index.js.map +1 -1
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/decision-policy-options.d.ts +8 -0
- package/dist/views/templates/designer/designer-version-labels.d.ts +12 -0
- package/dist/views/templates/designer/dry-run-assignee-label.d.ts +28 -0
- package/dist/views/templates/designer/dry-run-sample-data.d.ts +9 -0
- package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +35 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/position-level-options.d.ts +17 -0
- package/package.json +3 -3
- package/dist/chunks/FormBuilderView-BYLN6W-P.js.map +0 -1
- package/dist/chunks/FormBuilderView-VmdPVbg7.cjs +0 -3
- package/dist/chunks/FormBuilderView-VmdPVbg7.cjs.map +0 -1
- package/dist/chunks/FormRendererView-Bs8lTb4k.cjs +0 -2
- package/dist/chunks/FormRendererView-Bs8lTb4k.cjs.map +0 -1
- package/dist/chunks/FormRendererView-UPowZZgw.js +0 -798
- package/dist/chunks/FormRendererView-UPowZZgw.js.map +0 -1
- package/dist/chunks/compose-6P64PO1i.js.map +0 -1
- package/dist/chunks/compose-BnSRL4ml.cjs +0 -2
- package/dist/chunks/compose-BnSRL4ml.cjs.map +0 -1
- package/dist/chunks/designer-C3s2kSna.js.map +0 -1
- package/dist/chunks/designer-_g58R6rQ.cjs +0 -65
- package/dist/chunks/designer-_g58R6rQ.cjs.map +0 -1
- package/dist/chunks/detail-Db-UOELp.cjs +0 -2
- package/dist/chunks/detail-Db-UOELp.cjs.map +0 -1
- package/dist/chunks/detail-pYEIk-jW.js.map +0 -1
|
@@ -3,29 +3,67 @@ import { r as e } from "./router-adapter-DftlFTOd.js";
|
|
|
3
3
|
import { r as t } from "./routes-config-yZbESPlw.js";
|
|
4
4
|
import { t as n } from "./bpm-form-field-Cao0rMol.js";
|
|
5
5
|
import { a as r, n as i, o as a, r as o } from "./admin-pickers-DLlG_1du.js";
|
|
6
|
+
import { n as s, r as c } from "./FormRendererView-DU9LLrOF.js";
|
|
6
7
|
import '../style.css';/* empty css */
|
|
7
|
-
import { t as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { AutoComplete as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { CheckedIcon as
|
|
14
|
-
import { DefaultChatTransport as
|
|
15
|
-
import { WORKFLOW_TOOLSET as
|
|
16
|
-
import { readFormBuilder as
|
|
17
|
-
import { isFormStaticOptionFieldDefinition as
|
|
18
|
-
import { readOrganizationDashboard as
|
|
19
|
-
import { Background as
|
|
20
|
-
import * as
|
|
21
|
-
import { composeApprovalTemplateWithForm as
|
|
22
|
-
import { useChat as
|
|
23
|
-
import { DEFAULT_QUORUM_THRESHOLD as
|
|
8
|
+
import { t as l } from "./FormBuilderView-CLg-JYmu.js";
|
|
9
|
+
import { Fragment as u, useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
10
|
+
import { AutoComplete as g, Button as _, Icon as v, Input as y, Modal as b, PageHeader as ee, Section as te, SectionGroup as ne, Select as x, Textarea as re, Toggle as S, Typography as C } from "@mezzanine-ui/react";
|
|
11
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
import ie from "@mezzanine-ui/react/Drawer";
|
|
13
|
+
import ae from "@mezzanine-ui/react/ContentHeader";
|
|
14
|
+
import { CheckedIcon as oe, DotGridIcon as se, EyeIcon as ce, FilterIcon as le, MailIcon as ue, PlusIcon as de, SaveIcon as fe, TrashIcon as pe, UserIcon as me } from "@mezzanine-ui/icons";
|
|
15
|
+
import { DefaultChatTransport as he, getToolName as ge, isToolUIPart as _e, lastAssistantMessageIsCompleteWithToolCalls as ve } from "ai";
|
|
16
|
+
import { WORKFLOW_TOOLSET as D, applyWorkflowCommand as ye, applyWorkflowMacroCommand as be, executeWorkflowTool as xe, readWorkflowSnapshot as Se } from "@rytass/bpm-core-shared";
|
|
17
|
+
import { readFormBuilder as Ce, readFormSchemaLintMessage as we } from "@rytass/bpm-core-client/form";
|
|
18
|
+
import { isFormStaticOptionFieldDefinition as Te, isMemberFieldDefinition as Ee } from "@rytass/bpm-core-shared/form";
|
|
19
|
+
import { readOrganizationDashboard as De } from "@rytass/bpm-core-client/organization";
|
|
20
|
+
import { Background as Oe, ConnectionMode as ke, ControlButton as Ae, Controls as je, Handle as Me, MiniMap as Ne, Panel as Pe, Position as O, ReactFlow as Fe, applyNodeChanges as Ie, getViewportForBounds as Le } from "@xyflow/react";
|
|
21
|
+
import * as Re from "dagre";
|
|
22
|
+
import { composeApprovalTemplateWithForm as ze, dryRunApprovalWorkflow as Be, forkApprovalTemplate as Ve, listWorkflowWebhookEndpoints as He, publishApprovalTemplateVersion as Ue, readTemplateDesigner as We, resolveMemberOptions as Ge, searchMemberOptions as Ke, searchPublishedFormVersionOptions as qe, updateApprovalTemplateDraft as Je } from "@rytass/bpm-core-client/template";
|
|
23
|
+
import { useChat as Ye } from "@ai-sdk/react";
|
|
24
|
+
import { DEFAULT_QUORUM_THRESHOLD as Xe, DEFAULT_SLA_CONFIG as Ze, NOTIFY_WEBHOOK_CONTEXT_PATHS as k, NOTIFY_WEBHOOK_TARGET_LIMIT as A, SLA_CALENDAR_MODE_OPTIONS as Qe, SLA_DURATION_UNIT_OPTIONS as $e, SLA_TIMEOUT_ACTION_OPTIONS as et, composeQuorumThreshold as tt, composeSlaDuration as j, createNotifyWebhookTarget as M, hasConfiguredConditionEdges as nt, isDecisionPolicyUnsatisfiable as rt, isFormFieldCompatibleWithWebhookParameter as it, isNotifyWebhookContextPath as N, isOrgManagerChainDecisionPolicyInvalid as at, readApproverResolverIssue as ot, readConditionOperatorIds as st, readDesignTimeApproverCount as ct, readExcludeInitiatorIssue as lt, readNotifyServiceTaskIssue as ut, readNotifyWebhookCatalogIssueMessage as dt, readNotifyWebhookStructureIssues as ft, readNotifyWebhookTargetCatalogIssues as pt, readNotifyWebhookTargets as mt, readSlaDurationParts as ht } from "@rytass/bpm-core-shared/workflow-graph";
|
|
25
|
+
//#region src/views/templates/designer/decision-policy-options.ts
|
|
26
|
+
var gt = [
|
|
27
|
+
{
|
|
28
|
+
id: "SINGLE",
|
|
29
|
+
name: "單人簽核"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "PARALLEL_ANY",
|
|
33
|
+
name: "任一人同意"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "PARALLEL_ALL",
|
|
37
|
+
name: "全部同意"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "SEQUENTIAL",
|
|
41
|
+
name: "依序簽核"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "QUORUM",
|
|
45
|
+
name: "達到指定門檻"
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
function _t(e) {
|
|
49
|
+
if (!e || e.type === "SINGLE" || e.type === "PARALLEL_ANY") return "可指定多位;多位時所有人都會收到待辦,任一人同意即可通過。";
|
|
50
|
+
if (e.type === "PARALLEL_ALL") return "可指定多位;多位時所有人都會收到待辦,全部同意後才會通過。";
|
|
51
|
+
if (e.type === "SEQUENTIAL") return "依簽核人順序一次開放一位,前一位核准後才輪到下一位;任一位拒絕或退回即結束此關。";
|
|
52
|
+
let t = e.thresholdType === "PERCENTAGE" ? "%" : " 位簽核者";
|
|
53
|
+
return `可指定多位;需達到 ${e.threshold}${t} 才會通過。`;
|
|
54
|
+
}
|
|
55
|
+
function vt(e) {
|
|
56
|
+
return gt.find((t) => t.id === e) || {
|
|
57
|
+
id: e,
|
|
58
|
+
name: `未知決策方式(${e})`
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
24
62
|
//#region src/views/templates/designer/use-workflow-designer-controller.ts
|
|
25
|
-
function
|
|
26
|
-
let [i, a] =
|
|
63
|
+
function yt({ directory: e, initialState: t, layout: n, onLayout: r }) {
|
|
64
|
+
let [i, a] = h(t), o = m(t), s = m(e);
|
|
27
65
|
s.current = e;
|
|
28
|
-
let c =
|
|
66
|
+
let c = d((e) => {
|
|
29
67
|
if (!e.changed && !e.error) return e;
|
|
30
68
|
let t = e.effects.layout ? n(e.state.definition) : e.state.definition, i = {
|
|
31
69
|
...e.state,
|
|
@@ -35,34 +73,34 @@ function ut({ directory: e, initialState: t, layout: n, onLayout: r }) {
|
|
|
35
73
|
...e,
|
|
36
74
|
state: i
|
|
37
75
|
};
|
|
38
|
-
}, [n, r]),
|
|
39
|
-
let n = await
|
|
76
|
+
}, [n, r]), l = d((e) => c(ye(o.current, e)), [c]), u = d((e) => c(be(o.current, e)), [c]), f = d(async (e, t) => {
|
|
77
|
+
let n = await xe(o.current, e, t, { directory: s.current });
|
|
40
78
|
if (n.ok && (n.kind === "mutation" || n.kind === "macro")) {
|
|
41
79
|
let e = c(n.result);
|
|
42
80
|
return {
|
|
43
81
|
...n,
|
|
44
82
|
result: e,
|
|
45
|
-
snapshot:
|
|
83
|
+
snapshot: Se(e.state)
|
|
46
84
|
};
|
|
47
85
|
}
|
|
48
86
|
return n;
|
|
49
|
-
}, [c]), g =
|
|
87
|
+
}, [c]), g = d((e) => {
|
|
50
88
|
let t = typeof e == "function" ? e(o.current) : e;
|
|
51
89
|
o.current = t, a(t);
|
|
52
|
-
}, []), _ =
|
|
53
|
-
return
|
|
54
|
-
dispatch:
|
|
55
|
-
dispatchMacro:
|
|
56
|
-
executeTool:
|
|
90
|
+
}, []), _ = d(() => o.current, []), v = p(() => Se(i), [i]);
|
|
91
|
+
return p(() => ({
|
|
92
|
+
dispatch: l,
|
|
93
|
+
dispatchMacro: u,
|
|
94
|
+
executeTool: f,
|
|
57
95
|
getState: _,
|
|
58
96
|
replaceState: g,
|
|
59
97
|
snapshot: v,
|
|
60
98
|
state: i,
|
|
61
|
-
tools:
|
|
99
|
+
tools: D
|
|
62
100
|
}), [
|
|
101
|
+
l,
|
|
63
102
|
u,
|
|
64
|
-
|
|
65
|
-
h,
|
|
103
|
+
f,
|
|
66
104
|
_,
|
|
67
105
|
g,
|
|
68
106
|
v,
|
|
@@ -71,10 +109,10 @@ function ut({ directory: e, initialState: t, layout: n, onLayout: r }) {
|
|
|
71
109
|
}
|
|
72
110
|
//#endregion
|
|
73
111
|
//#region src/views/templates/designer/use-workflow-chat.ts
|
|
74
|
-
function
|
|
75
|
-
let n =
|
|
112
|
+
function bt({ controller: e, api: t = "/api/chat" }) {
|
|
113
|
+
let n = p(() => new he({ api: t }), [t]), r = Ye({
|
|
76
114
|
transport: n,
|
|
77
|
-
sendAutomaticallyWhen:
|
|
115
|
+
sendAutomaticallyWhen: ve,
|
|
78
116
|
async onToolCall({ toolCall: t }) {
|
|
79
117
|
let n = await e.executeTool(t.toolName, t.input);
|
|
80
118
|
if (n.ok) {
|
|
@@ -97,12 +135,12 @@ function dt({ controller: e, api: t = "/api/chat" }) {
|
|
|
97
135
|
}
|
|
98
136
|
//#endregion
|
|
99
137
|
//#region src/views/templates/designer/chrome-workflow-chat.ts
|
|
100
|
-
var
|
|
101
|
-
function
|
|
138
|
+
var P = 12;
|
|
139
|
+
function xt() {
|
|
102
140
|
let e = globalThis.LanguageModel;
|
|
103
141
|
return e && typeof e == "object" ? e : null;
|
|
104
142
|
}
|
|
105
|
-
var
|
|
143
|
+
var F = {
|
|
106
144
|
additionalProperties: !1,
|
|
107
145
|
properties: {
|
|
108
146
|
action: {
|
|
@@ -116,7 +154,7 @@ var mt = {
|
|
|
116
154
|
required: ["action"],
|
|
117
155
|
type: "object"
|
|
118
156
|
};
|
|
119
|
-
function
|
|
157
|
+
function St() {
|
|
120
158
|
return `你是「簽核流程設計器」頁面的離線 AI 助理。只能透過下列工具操作這個流程畫布,其他請求一律婉拒並引導回流程設計。
|
|
121
159
|
|
|
122
160
|
每一步只輸出一個 JSON 決策物件:
|
|
@@ -126,17 +164,17 @@ function P() {
|
|
|
126
164
|
規則:先用 get_workflow_snapshot 了解現況再規劃;完成後用 validate_workflow 檢查並以 message 說明做了什麼。
|
|
127
165
|
|
|
128
166
|
可用工具:
|
|
129
|
-
${
|
|
167
|
+
${D.map((e) => `- ${e.name}(${JSON.stringify(e.inputSchema.properties ?? {})}): ${e.description}`).join("\n")}`;
|
|
130
168
|
}
|
|
131
|
-
function
|
|
132
|
-
let [t, n] =
|
|
133
|
-
|
|
134
|
-
let e =
|
|
169
|
+
function Ct({ controller: e }) {
|
|
170
|
+
let [t, n] = h(!1), [r, i] = h([]), [a, o] = h("ready"), s = m(0);
|
|
171
|
+
f(() => {
|
|
172
|
+
let e = xt();
|
|
135
173
|
e && e.availability().then((e) => {
|
|
136
174
|
n(e !== "unavailable");
|
|
137
175
|
}).catch(() => n(!1));
|
|
138
176
|
}, []);
|
|
139
|
-
let c =
|
|
177
|
+
let c = d((e, t) => {
|
|
140
178
|
s.current += 1, i((n) => [...n, {
|
|
141
179
|
id: `chrome-${s.current}`,
|
|
142
180
|
parts: [{
|
|
@@ -149,15 +187,15 @@ function ht({ controller: e }) {
|
|
|
149
187
|
return {
|
|
150
188
|
available: t,
|
|
151
189
|
messages: r,
|
|
152
|
-
send:
|
|
153
|
-
let n =
|
|
154
|
-
n && a === "ready" && (c("user", t), o("submitted"),
|
|
190
|
+
send: d((t) => {
|
|
191
|
+
let n = xt();
|
|
192
|
+
n && a === "ready" && (c("user", t), o("submitted"), wt({
|
|
155
193
|
appendMessage: c,
|
|
156
194
|
controller: e,
|
|
157
195
|
model: n,
|
|
158
196
|
userText: t
|
|
159
197
|
}).then(() => o("ready")).catch((e) => {
|
|
160
|
-
c("assistant",
|
|
198
|
+
c("assistant", Et(e)), o("error");
|
|
161
199
|
}));
|
|
162
200
|
}, [
|
|
163
201
|
c,
|
|
@@ -167,15 +205,15 @@ function ht({ controller: e }) {
|
|
|
167
205
|
status: a
|
|
168
206
|
};
|
|
169
207
|
}
|
|
170
|
-
async function
|
|
208
|
+
async function wt({ appendMessage: e, controller: t, model: n, userText: r }) {
|
|
171
209
|
let i = await n.create({ initialPrompts: [{
|
|
172
|
-
content:
|
|
210
|
+
content: St(),
|
|
173
211
|
role: "system"
|
|
174
212
|
}] });
|
|
175
213
|
try {
|
|
176
214
|
let n = `使用者需求:${r}\n目前流程:${JSON.stringify(t.snapshot)}`;
|
|
177
|
-
for (let r = 0; r <
|
|
178
|
-
let r =
|
|
215
|
+
for (let r = 0; r < P; r += 1) {
|
|
216
|
+
let r = Tt(await i.prompt(n, { responseConstraint: F }));
|
|
179
217
|
if (!r || r.action === "message") {
|
|
180
218
|
e("assistant", r?.text ?? "我已完成可處理的部分。");
|
|
181
219
|
return;
|
|
@@ -195,7 +233,7 @@ async function gt({ appendMessage: e, controller: t, model: n, userText: r }) {
|
|
|
195
233
|
i.destroy();
|
|
196
234
|
}
|
|
197
235
|
}
|
|
198
|
-
function
|
|
236
|
+
function Tt(e) {
|
|
199
237
|
try {
|
|
200
238
|
let t = JSON.parse(e);
|
|
201
239
|
return typeof t == "object" && t && t.action !== void 0 ? t : null;
|
|
@@ -203,51 +241,51 @@ function _t(e) {
|
|
|
203
241
|
return null;
|
|
204
242
|
}
|
|
205
243
|
}
|
|
206
|
-
function
|
|
244
|
+
function Et(e) {
|
|
207
245
|
return e instanceof Error ? `離線模式發生錯誤:${e.message}` : "離線模式發生未知錯誤。";
|
|
208
246
|
}
|
|
209
247
|
//#endregion
|
|
210
248
|
//#region src/views/templates/designer/workflow-chat-drawer.tsx
|
|
211
|
-
var
|
|
249
|
+
var Dt = {
|
|
212
250
|
display: "flex",
|
|
213
251
|
flexDirection: "column",
|
|
214
252
|
gap: 12,
|
|
215
253
|
height: "100%"
|
|
216
|
-
},
|
|
254
|
+
}, Ot = {
|
|
217
255
|
display: "flex",
|
|
218
256
|
flex: 1,
|
|
219
257
|
flexDirection: "column",
|
|
220
258
|
gap: 12,
|
|
221
259
|
minHeight: 0,
|
|
222
260
|
overflowY: "auto"
|
|
223
|
-
},
|
|
261
|
+
}, kt = {
|
|
224
262
|
display: "flex",
|
|
225
263
|
gap: 8,
|
|
226
264
|
paddingBottom: 4
|
|
227
|
-
},
|
|
265
|
+
}, At = {
|
|
228
266
|
borderTop: "1px solid var(--mzn-color-border-neutral, #e5e7eb)",
|
|
229
267
|
display: "flex",
|
|
230
268
|
flexDirection: "column",
|
|
231
269
|
gap: 8,
|
|
232
270
|
paddingTop: 12
|
|
233
|
-
},
|
|
271
|
+
}, jt = {
|
|
234
272
|
display: "flex",
|
|
235
273
|
justifyContent: "flex-end"
|
|
236
|
-
},
|
|
237
|
-
.${
|
|
274
|
+
}, Mt = { width: "100%" }, Nt = "workflow-chat-input-field", I = `
|
|
275
|
+
.${Nt}.mzn-text-field {
|
|
238
276
|
width: 100%;
|
|
239
277
|
}
|
|
240
|
-
`,
|
|
278
|
+
`, Pt = {
|
|
241
279
|
color: "var(--mzn-color-text-secondary, #6b7280)",
|
|
242
280
|
fontSize: 12,
|
|
243
281
|
padding: "2px 0"
|
|
244
|
-
},
|
|
282
|
+
}, Ft = {
|
|
245
283
|
"input-available": "執行中…",
|
|
246
284
|
"input-streaming": "準備中…",
|
|
247
285
|
"output-available": "完成",
|
|
248
286
|
"output-error": "失敗"
|
|
249
287
|
};
|
|
250
|
-
function
|
|
288
|
+
function It(e) {
|
|
251
289
|
let t = e === "user";
|
|
252
290
|
return {
|
|
253
291
|
alignSelf: t ? "flex-end" : "flex-start",
|
|
@@ -260,11 +298,11 @@ function F(e) {
|
|
|
260
298
|
wordBreak: "break-word"
|
|
261
299
|
};
|
|
262
300
|
}
|
|
263
|
-
function
|
|
264
|
-
let i =
|
|
301
|
+
function Lt({ api: e, controller: t, onClose: n, open: r }) {
|
|
302
|
+
let i = bt({
|
|
265
303
|
api: e,
|
|
266
304
|
controller: t
|
|
267
|
-
}), a =
|
|
305
|
+
}), a = Ct({ controller: t }), [o, s] = h("online"), [c, l] = h(""), f = o === "offline" ? {
|
|
268
306
|
messages: a.messages,
|
|
269
307
|
send: a.send,
|
|
270
308
|
status: a.status
|
|
@@ -274,71 +312,71 @@ function kt({ api: e, controller: t, onClose: n, open: r }) {
|
|
|
274
312
|
i.sendMessage({ text: e });
|
|
275
313
|
},
|
|
276
314
|
status: i.status
|
|
277
|
-
}, { messages:
|
|
278
|
-
let e =
|
|
279
|
-
e && !
|
|
315
|
+
}, { messages: p, send: m } = f, g = f.status === "submitted" || f.status === "streaming", v = d(() => {
|
|
316
|
+
let e = c.trim();
|
|
317
|
+
e && !g && (l(""), m(e));
|
|
280
318
|
}, [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
]),
|
|
319
|
+
g,
|
|
320
|
+
c,
|
|
321
|
+
m
|
|
322
|
+
]), y = d((e) => {
|
|
285
323
|
e.nativeEvent.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), v());
|
|
286
324
|
}, [v]);
|
|
287
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ E(ie, {
|
|
288
326
|
headerTitle: "AI 流程助理",
|
|
289
327
|
isHeaderDisplay: !0,
|
|
290
328
|
onClose: n,
|
|
291
329
|
open: r,
|
|
292
330
|
size: "medium",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
294
|
-
style:
|
|
331
|
+
children: [/* @__PURE__ */ T("style", { children: I }), /* @__PURE__ */ E("div", {
|
|
332
|
+
style: Dt,
|
|
295
333
|
children: [
|
|
296
|
-
a.available ? /* @__PURE__ */
|
|
297
|
-
style:
|
|
298
|
-
children: [/* @__PURE__ */
|
|
334
|
+
a.available ? /* @__PURE__ */ E("div", {
|
|
335
|
+
style: kt,
|
|
336
|
+
children: [/* @__PURE__ */ T(_, {
|
|
299
337
|
onClick: () => s("online"),
|
|
300
338
|
variant: o === "online" ? "base-primary" : "base-tertiary",
|
|
301
339
|
children: "線上"
|
|
302
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ T(_, {
|
|
303
341
|
onClick: () => s("offline"),
|
|
304
342
|
variant: o === "offline" ? "base-primary" : "base-tertiary",
|
|
305
343
|
children: "離線(裝置內,實驗)"
|
|
306
344
|
})]
|
|
307
345
|
}) : null,
|
|
308
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ E("div", {
|
|
309
347
|
role: "log",
|
|
310
|
-
style:
|
|
348
|
+
style: Ot,
|
|
311
349
|
children: [
|
|
312
|
-
|
|
350
|
+
p.length === 0 ? /* @__PURE__ */ T(C, {
|
|
313
351
|
color: "text-neutral",
|
|
314
352
|
variant: "body",
|
|
315
353
|
children: "用一句話描述你想要的流程,例如:「建立三關簽核:部門主管 → 經理 → 財務,金額大於十萬走財務複核」。我會直接在畫布上幫你繪製。"
|
|
316
354
|
}) : null,
|
|
317
|
-
|
|
318
|
-
|
|
355
|
+
p.map((e) => /* @__PURE__ */ T(u, { children: Rt(e) }, e.id)),
|
|
356
|
+
g ? /* @__PURE__ */ T(C, {
|
|
319
357
|
color: "text-neutral",
|
|
320
358
|
variant: "body",
|
|
321
359
|
children: "思考中…"
|
|
322
360
|
}) : null
|
|
323
361
|
]
|
|
324
362
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
style:
|
|
327
|
-
children: [/* @__PURE__ */
|
|
328
|
-
className:
|
|
329
|
-
disabled:
|
|
363
|
+
/* @__PURE__ */ E("div", {
|
|
364
|
+
style: At,
|
|
365
|
+
children: [/* @__PURE__ */ T(re, {
|
|
366
|
+
className: Nt,
|
|
367
|
+
disabled: g,
|
|
330
368
|
maxLength: 2e3,
|
|
331
|
-
onChange: (e) =>
|
|
332
|
-
onKeyDown:
|
|
369
|
+
onChange: (e) => l(e.target.value),
|
|
370
|
+
onKeyDown: y,
|
|
333
371
|
placeholder: "描述你想要的流程…(Enter 送出,Shift + Enter 換行)",
|
|
334
372
|
rows: 3,
|
|
335
|
-
style:
|
|
336
|
-
value:
|
|
337
|
-
}), /* @__PURE__ */
|
|
338
|
-
style:
|
|
339
|
-
children: /* @__PURE__ */
|
|
340
|
-
disabled:
|
|
341
|
-
loading:
|
|
373
|
+
style: Mt,
|
|
374
|
+
value: c
|
|
375
|
+
}), /* @__PURE__ */ T("div", {
|
|
376
|
+
style: jt,
|
|
377
|
+
children: /* @__PURE__ */ T(_, {
|
|
378
|
+
disabled: g || c.trim().length === 0,
|
|
379
|
+
loading: g,
|
|
342
380
|
onClick: v,
|
|
343
381
|
type: "button",
|
|
344
382
|
variant: "base-primary",
|
|
@@ -350,16 +388,16 @@ function kt({ api: e, controller: t, onClose: n, open: r }) {
|
|
|
350
388
|
})]
|
|
351
389
|
});
|
|
352
390
|
}
|
|
353
|
-
function
|
|
391
|
+
function Rt(e) {
|
|
354
392
|
return e.parts.map((t, n) => {
|
|
355
|
-
if (t.type === "text") return /* @__PURE__ */
|
|
356
|
-
style:
|
|
393
|
+
if (t.type === "text") return /* @__PURE__ */ T("div", {
|
|
394
|
+
style: It(e.role),
|
|
357
395
|
children: t.text
|
|
358
396
|
}, `${e.id}-${n}`);
|
|
359
|
-
if (t.type === "dynamic-tool" ||
|
|
360
|
-
let r =
|
|
361
|
-
return /* @__PURE__ */
|
|
362
|
-
style:
|
|
397
|
+
if (t.type === "dynamic-tool" || _e(t)) {
|
|
398
|
+
let r = ge(t), i = Ft[t.state] ?? t.state;
|
|
399
|
+
return /* @__PURE__ */ T("div", {
|
|
400
|
+
style: Pt,
|
|
363
401
|
children: `⚙ ${r} · ${i}`
|
|
364
402
|
}, `${e.id}-${n}`);
|
|
365
403
|
}
|
|
@@ -367,8 +405,24 @@ function At(e) {
|
|
|
367
405
|
});
|
|
368
406
|
}
|
|
369
407
|
//#endregion
|
|
408
|
+
//#region src/views/templates/designer/position-level-options.ts
|
|
409
|
+
function zt(e, t) {
|
|
410
|
+
let n = [...new Set(e.map((e) => e.level))];
|
|
411
|
+
return [...n.includes(t) ? n : [...n, t]].sort((e, t) => t - e).map((t) => {
|
|
412
|
+
let n = e.filter((e) => e.level === t).map((e) => e.name);
|
|
413
|
+
return {
|
|
414
|
+
id: String(t),
|
|
415
|
+
name: n.length > 0 ? `職等 ${t}(${n.join("、")})` : `職等 ${t}`,
|
|
416
|
+
value: t
|
|
417
|
+
};
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function Bt(e) {
|
|
421
|
+
return e.reduce((e, t) => Math.max(e, t.level), 1);
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
370
424
|
//#region src/views/templates/designer/notify-webhook-designer.ts
|
|
371
|
-
var
|
|
425
|
+
var L = {
|
|
372
426
|
"initiator.memberId": "發起人會員編號",
|
|
373
427
|
"instance.id": "案件編號",
|
|
374
428
|
"instance.templateId": "模板編號",
|
|
@@ -376,32 +430,32 @@ var jt = {
|
|
|
376
430
|
"instance.title": "案件主旨",
|
|
377
431
|
"node.id": "節點編號",
|
|
378
432
|
"node.label": "節點名稱"
|
|
379
|
-
},
|
|
433
|
+
}, Vt = {
|
|
380
434
|
boolean: "是/否",
|
|
381
435
|
json: "JSON",
|
|
382
436
|
number: "數字",
|
|
383
437
|
string: "文字",
|
|
384
438
|
stringArray: "文字清單"
|
|
385
439
|
};
|
|
386
|
-
function
|
|
440
|
+
function R(e) {
|
|
387
441
|
return `${e.key}@${e.version}`;
|
|
388
442
|
}
|
|
389
|
-
function
|
|
443
|
+
function Ht(e, t) {
|
|
390
444
|
return e.find((e) => e.key === t.key && e.version === t.version) ?? null;
|
|
391
445
|
}
|
|
392
|
-
function
|
|
446
|
+
function Ut(e) {
|
|
393
447
|
return [
|
|
394
448
|
"FIELD",
|
|
395
449
|
...e === "stringArray" ? [] : ["CONSTANT"],
|
|
396
450
|
...e === "string" || e === "json" ? ["CONTEXT"] : []
|
|
397
451
|
];
|
|
398
452
|
}
|
|
399
|
-
function
|
|
400
|
-
return e.filter((e) =>
|
|
453
|
+
function Wt(e, t) {
|
|
454
|
+
return e.filter((e) => it(e, t));
|
|
401
455
|
}
|
|
402
|
-
function
|
|
456
|
+
function Gt(e, t, n) {
|
|
403
457
|
return e === "FIELD" ? {
|
|
404
|
-
fieldKey:
|
|
458
|
+
fieldKey: Wt(n, t.type)[0]?.fieldKey ?? "",
|
|
405
459
|
kind: "FIELD"
|
|
406
460
|
} : e === "CONTEXT" ? {
|
|
407
461
|
kind: "CONTEXT",
|
|
@@ -411,16 +465,16 @@ function Pt(e, t, n) {
|
|
|
411
465
|
value: t.type === "boolean" ? !0 : t.type === "number" ? null : ""
|
|
412
466
|
};
|
|
413
467
|
}
|
|
414
|
-
var
|
|
415
|
-
function
|
|
468
|
+
var Kt = /^-?\d+(\.\d+)?$/;
|
|
469
|
+
function qt(e, t) {
|
|
416
470
|
if (e !== "number") return t;
|
|
417
471
|
let n = t.trim();
|
|
418
|
-
return n ?
|
|
472
|
+
return n ? Kt.test(n) ? Number(n) : t : null;
|
|
419
473
|
}
|
|
420
|
-
function
|
|
421
|
-
return !
|
|
474
|
+
function Jt(e) {
|
|
475
|
+
return !ft(e).some((e) => Yt.has(e.code));
|
|
422
476
|
}
|
|
423
|
-
var
|
|
477
|
+
var Yt = /* @__PURE__ */ new Set([
|
|
424
478
|
"BINDING_INVALID",
|
|
425
479
|
"BINDING_SOURCE_INVALID",
|
|
426
480
|
"BINDINGS_NOT_ARRAY",
|
|
@@ -430,7 +484,7 @@ var Rt = /* @__PURE__ */ new Set([
|
|
|
430
484
|
"TARGET_INVALID",
|
|
431
485
|
"WEBHOOKS_NOT_ARRAY"
|
|
432
486
|
]);
|
|
433
|
-
function
|
|
487
|
+
function Xt(e, t, n) {
|
|
434
488
|
let r = e.bindings.filter((e) => e.parameter !== t), i = e.bindings.findIndex((e) => e.parameter === t);
|
|
435
489
|
if (!n) return {
|
|
436
490
|
...e,
|
|
@@ -445,11 +499,11 @@ function zt(e, t, n) {
|
|
|
445
499
|
bindings: i === -1 ? [...e.bindings, a] : e.bindings.map((e, t) => t === i ? a : e)
|
|
446
500
|
};
|
|
447
501
|
}
|
|
448
|
-
function
|
|
502
|
+
function Zt(e, t, n) {
|
|
449
503
|
return {
|
|
450
504
|
bindings: e.bindings.filter((r) => {
|
|
451
505
|
let i = t.parameters.find((e) => e.key === r.parameter);
|
|
452
|
-
return i !== void 0 && !
|
|
506
|
+
return i !== void 0 && !pt({
|
|
453
507
|
endpoint: { parameters: [{
|
|
454
508
|
...i,
|
|
455
509
|
required: !1
|
|
@@ -468,15 +522,15 @@ function Bt(e, t, n) {
|
|
|
468
522
|
id: e.id
|
|
469
523
|
};
|
|
470
524
|
}
|
|
471
|
-
function
|
|
472
|
-
return e.nodes.flatMap((e) => e.type !== "serviceTask" || e.data.action.type !== "NOTIFY" ||
|
|
473
|
-
let a =
|
|
474
|
-
return
|
|
525
|
+
function Qt({ definition: e, endpoints: t, formFields: n }) {
|
|
526
|
+
return e.nodes.flatMap((e) => e.type !== "serviceTask" || e.data.action.type !== "NOTIFY" || ft(e.data.action.webhooks).length ? [] : mt(e.data.action).flatMap((r, i) => {
|
|
527
|
+
let a = Ht(t, r.endpoint);
|
|
528
|
+
return pt({
|
|
475
529
|
endpoint: a,
|
|
476
530
|
formFields: n,
|
|
477
531
|
target: r
|
|
478
|
-
}).map((t) =>
|
|
479
|
-
endpointLabel: a?.label ??
|
|
532
|
+
}).map((t) => dt({
|
|
533
|
+
endpointLabel: a?.label ?? R(r.endpoint),
|
|
480
534
|
issue: t,
|
|
481
535
|
nodeLabel: e.data.label,
|
|
482
536
|
targetIndex: i
|
|
@@ -485,10 +539,10 @@ function Vt({ definition: e, endpoints: t, formFields: n }) {
|
|
|
485
539
|
}
|
|
486
540
|
//#endregion
|
|
487
541
|
//#region src/views/templates/designer/NotifyWebhookTargetsEditor.tsx
|
|
488
|
-
var
|
|
542
|
+
var $t = {
|
|
489
543
|
display: "grid",
|
|
490
544
|
gap: "var(--mzn-spacing-gap-base)"
|
|
491
|
-
},
|
|
545
|
+
}, en = {
|
|
492
546
|
borderColor: "var(--mzn-color-border-neutral)",
|
|
493
547
|
borderRadius: "var(--mzn-radius-base)",
|
|
494
548
|
borderStyle: "solid",
|
|
@@ -496,19 +550,19 @@ var Ht = {
|
|
|
496
550
|
display: "grid",
|
|
497
551
|
gap: "var(--mzn-spacing-gap-base)",
|
|
498
552
|
padding: "var(--mzn-spacing-padding-horizontal-base)"
|
|
499
|
-
},
|
|
553
|
+
}, tn = {
|
|
500
554
|
alignItems: "center",
|
|
501
555
|
display: "flex",
|
|
502
556
|
gap: "var(--mzn-spacing-gap-base)",
|
|
503
557
|
justifyContent: "space-between"
|
|
504
|
-
},
|
|
558
|
+
}, nn = {
|
|
505
559
|
display: "grid",
|
|
506
560
|
gap: "var(--mzn-spacing-gap-base)",
|
|
507
561
|
gridTemplateColumns: "minmax(0, 2fr) minmax(0, 3fr)"
|
|
508
|
-
},
|
|
562
|
+
}, rn = {
|
|
509
563
|
id: "NONE",
|
|
510
564
|
name: "不傳送"
|
|
511
|
-
},
|
|
565
|
+
}, an = {
|
|
512
566
|
CONSTANT: {
|
|
513
567
|
id: "CONSTANT",
|
|
514
568
|
name: "固定值"
|
|
@@ -521,17 +575,17 @@ var Ht = {
|
|
|
521
575
|
id: "FIELD",
|
|
522
576
|
name: "表單欄位"
|
|
523
577
|
}
|
|
524
|
-
},
|
|
578
|
+
}, on = [{
|
|
525
579
|
id: "true",
|
|
526
580
|
name: "是"
|
|
527
581
|
}, {
|
|
528
582
|
id: "false",
|
|
529
583
|
name: "否"
|
|
530
|
-
}],
|
|
584
|
+
}], sn = k.map((e) => ({
|
|
531
585
|
id: e,
|
|
532
|
-
name:
|
|
586
|
+
name: L[e]
|
|
533
587
|
}));
|
|
534
|
-
function
|
|
588
|
+
function cn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets: i }) {
|
|
535
589
|
let a = e.filter((e) => !e.deprecated);
|
|
536
590
|
if (!i.length && (t === "unavailable" || t === "ready" && !a.length)) return null;
|
|
537
591
|
function o(e, t) {
|
|
@@ -539,34 +593,34 @@ function Xt({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
|
|
|
539
593
|
}
|
|
540
594
|
function s() {
|
|
541
595
|
let [e] = a;
|
|
542
|
-
e && r([...i,
|
|
596
|
+
e && r([...i, M({
|
|
543
597
|
key: e.key,
|
|
544
598
|
version: e.version
|
|
545
599
|
})]);
|
|
546
600
|
}
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
style:
|
|
601
|
+
return /* @__PURE__ */ E("div", {
|
|
602
|
+
style: $t,
|
|
549
603
|
children: [
|
|
550
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ T(C, {
|
|
551
605
|
variant: "label-primary-highlight",
|
|
552
606
|
children: "Webhook"
|
|
553
607
|
}),
|
|
554
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ T(C, {
|
|
555
609
|
color: "text-neutral",
|
|
556
610
|
variant: "caption",
|
|
557
611
|
children: "知會節點抵達時,將指定的表單欄位或案件資訊送到外部系統。"
|
|
558
612
|
}),
|
|
559
|
-
t === "loading" ? /* @__PURE__ */
|
|
613
|
+
t === "loading" ? /* @__PURE__ */ T(C, {
|
|
560
614
|
color: "text-neutral",
|
|
561
615
|
variant: "body",
|
|
562
616
|
children: "正在載入可用的 Webhook 端點…"
|
|
563
617
|
}) : null,
|
|
564
|
-
t === "unavailable" ? /* @__PURE__ */
|
|
618
|
+
t === "unavailable" ? /* @__PURE__ */ T(C, {
|
|
565
619
|
color: "text-error",
|
|
566
620
|
variant: "body",
|
|
567
621
|
children: "目前無法載入 Webhook 端點,已設定的內容會保留,請稍後重試。"
|
|
568
622
|
}) : null,
|
|
569
|
-
i.map((s, c) => /* @__PURE__ */
|
|
623
|
+
i.map((s, c) => /* @__PURE__ */ T(ln, {
|
|
570
624
|
activeEndpoints: a,
|
|
571
625
|
catalog: e,
|
|
572
626
|
catalogState: t,
|
|
@@ -576,104 +630,104 @@ function Xt({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
|
|
|
576
630
|
onRemove: () => r(i.filter((e, t) => t !== c)),
|
|
577
631
|
target: s
|
|
578
632
|
}, s.id)),
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
disabled: t !== "ready" || !a.length || i.length >=
|
|
581
|
-
icon:
|
|
633
|
+
/* @__PURE__ */ T("div", { children: /* @__PURE__ */ T(_, {
|
|
634
|
+
disabled: t !== "ready" || !a.length || i.length >= A,
|
|
635
|
+
icon: de,
|
|
582
636
|
iconType: "leading",
|
|
583
637
|
onClick: s,
|
|
584
638
|
variant: "base-dashed",
|
|
585
639
|
children: "新增 Webhook"
|
|
586
640
|
}) }),
|
|
587
|
-
i.length >=
|
|
641
|
+
i.length >= A ? /* @__PURE__ */ E(C, {
|
|
588
642
|
color: "text-neutral",
|
|
589
643
|
variant: "caption",
|
|
590
644
|
children: [
|
|
591
645
|
"每個知會節點最多 ",
|
|
592
|
-
|
|
646
|
+
A,
|
|
593
647
|
" 個 Webhook。"
|
|
594
648
|
]
|
|
595
649
|
}) : null
|
|
596
650
|
]
|
|
597
651
|
});
|
|
598
652
|
}
|
|
599
|
-
function
|
|
600
|
-
let l =
|
|
601
|
-
id:
|
|
602
|
-
name:
|
|
653
|
+
function ln({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, index: a, onChange: o, onRemove: s, target: c }) {
|
|
654
|
+
let l = Ht(t, c.endpoint), u = R(c.endpoint), d = [...e.map((e) => ({
|
|
655
|
+
id: R(e),
|
|
656
|
+
name: z(e)
|
|
603
657
|
})), ...l && !l.deprecated ? [] : [{
|
|
604
658
|
id: u,
|
|
605
|
-
name: l ?
|
|
659
|
+
name: l ? z(l) : `${u}(找不到端點)`
|
|
606
660
|
}]], f = new Set((l?.parameters ?? []).map((e) => e.key)), p = l ? c.bindings.filter((e) => !f.has(e.parameter)) : [];
|
|
607
|
-
return /* @__PURE__ */
|
|
608
|
-
style:
|
|
661
|
+
return /* @__PURE__ */ E("div", {
|
|
662
|
+
style: en,
|
|
609
663
|
children: [
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
style:
|
|
612
|
-
children: [/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ E("div", {
|
|
665
|
+
style: tn,
|
|
666
|
+
children: [/* @__PURE__ */ E(C, {
|
|
613
667
|
variant: "label-primary",
|
|
614
668
|
children: [
|
|
615
669
|
"第 ",
|
|
616
670
|
a + 1,
|
|
617
671
|
" 個 Webhook"
|
|
618
672
|
]
|
|
619
|
-
}), /* @__PURE__ */
|
|
620
|
-
icon:
|
|
673
|
+
}), /* @__PURE__ */ T(_, {
|
|
674
|
+
icon: pe,
|
|
621
675
|
iconType: "leading",
|
|
622
676
|
onClick: s,
|
|
623
677
|
variant: "destructive-text-link",
|
|
624
678
|
children: "移除"
|
|
625
679
|
})]
|
|
626
680
|
}),
|
|
627
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ T(n, {
|
|
628
682
|
label: "端點",
|
|
629
683
|
name: `webhookEndpoint-${c.id}`,
|
|
630
684
|
required: !0,
|
|
631
|
-
children: /* @__PURE__ */
|
|
685
|
+
children: /* @__PURE__ */ T(x, {
|
|
632
686
|
clearable: !1,
|
|
633
687
|
disabled: r !== "ready",
|
|
634
688
|
onChange: (t) => {
|
|
635
|
-
let n = e.find((e) =>
|
|
636
|
-
n && o(
|
|
689
|
+
let n = e.find((e) => R(e) === t?.id);
|
|
690
|
+
n && o(Zt(c, n, i ?? []));
|
|
637
691
|
},
|
|
638
692
|
options: [...d],
|
|
639
693
|
placeholder: "選擇端點",
|
|
640
694
|
value: d.find((e) => e.id === u) ?? null
|
|
641
695
|
})
|
|
642
696
|
}),
|
|
643
|
-
r === "ready" && !l ? /* @__PURE__ */
|
|
697
|
+
r === "ready" && !l ? /* @__PURE__ */ T(C, {
|
|
644
698
|
color: "text-warning",
|
|
645
699
|
variant: "body",
|
|
646
700
|
children: "找不到這個端點,設定會保留;請改選其他端點或移除,否則無法發布。"
|
|
647
701
|
}) : null,
|
|
648
|
-
l?.disabled ? /* @__PURE__ */
|
|
702
|
+
l?.disabled ? /* @__PURE__ */ T(C, {
|
|
649
703
|
color: "text-warning",
|
|
650
704
|
variant: "body",
|
|
651
705
|
children: "這個端點已被管理者停用,不會再送出;設定會保留,請改選其他端點,否則無法發布。"
|
|
652
|
-
}) : l?.deprecated ? /* @__PURE__ */
|
|
706
|
+
}) : l?.deprecated ? /* @__PURE__ */ T(C, {
|
|
653
707
|
color: "text-warning",
|
|
654
708
|
variant: "body",
|
|
655
709
|
children: "這個端點不建議再使用,設定會保留;請改選其他端點,否則無法發布。"
|
|
656
710
|
}) : null,
|
|
657
|
-
l?.description ? /* @__PURE__ */
|
|
711
|
+
l?.description ? /* @__PURE__ */ T(C, {
|
|
658
712
|
color: "text-neutral",
|
|
659
713
|
variant: "caption",
|
|
660
714
|
children: l.description
|
|
661
715
|
}) : null,
|
|
662
|
-
l && !l.parameters.length ? /* @__PURE__ */
|
|
716
|
+
l && !l.parameters.length ? /* @__PURE__ */ T(C, {
|
|
663
717
|
color: "text-neutral",
|
|
664
718
|
variant: "caption",
|
|
665
719
|
children: "這個端點不需要參數。"
|
|
666
720
|
}) : null,
|
|
667
|
-
(l?.parameters ?? []).map((e) => /* @__PURE__ */
|
|
721
|
+
(l?.parameters ?? []).map((e) => /* @__PURE__ */ T(un, {
|
|
668
722
|
formFields: i,
|
|
669
|
-
onChange: (t) => o(
|
|
723
|
+
onChange: (t) => o(Xt(c, e.key, t)),
|
|
670
724
|
parameter: e,
|
|
671
725
|
source: c.bindings.find((t) => t.parameter === e.key)?.from ?? null,
|
|
672
726
|
targetId: c.id
|
|
673
727
|
}, e.key)),
|
|
674
|
-
p.map((e) => /* @__PURE__ */
|
|
675
|
-
style:
|
|
676
|
-
children: [/* @__PURE__ */
|
|
728
|
+
p.map((e) => /* @__PURE__ */ E("div", {
|
|
729
|
+
style: tn,
|
|
730
|
+
children: [/* @__PURE__ */ E(C, {
|
|
677
731
|
color: "text-warning",
|
|
678
732
|
variant: "body",
|
|
679
733
|
children: [
|
|
@@ -681,8 +735,8 @@ function Zt({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, in
|
|
|
681
735
|
e.parameter,
|
|
682
736
|
"」已不在端點定義中。"
|
|
683
737
|
]
|
|
684
|
-
}), /* @__PURE__ */
|
|
685
|
-
onClick: () => o(
|
|
738
|
+
}), /* @__PURE__ */ T(_, {
|
|
739
|
+
onClick: () => o(Xt(c, e.parameter, null)),
|
|
686
740
|
variant: "base-text-link",
|
|
687
741
|
children: "移除設定"
|
|
688
742
|
})]
|
|
@@ -690,9 +744,9 @@ function Zt({ activeEndpoints: e, catalog: t, catalogState: r, formFields: i, in
|
|
|
690
744
|
]
|
|
691
745
|
});
|
|
692
746
|
}
|
|
693
|
-
function
|
|
694
|
-
let o = i?.kind === "FIELD" ||
|
|
695
|
-
return /* @__PURE__ */
|
|
747
|
+
function un({ formFields: e, onChange: t, parameter: r, source: i, targetId: a }) {
|
|
748
|
+
let o = i?.kind === "FIELD" || Wt(e ?? [], r.type).length > 0, s = [...r.required ? [] : [rn], ...Ut(r.type).filter((e) => e !== "FIELD" || o).map((e) => an[e])], c = Vt[r.type];
|
|
749
|
+
return /* @__PURE__ */ T(n, {
|
|
696
750
|
hintText: [
|
|
697
751
|
r.key,
|
|
698
752
|
c,
|
|
@@ -701,18 +755,18 @@ function Qt({ formFields: e, onChange: t, parameter: r, source: i, targetId: a }
|
|
|
701
755
|
label: r.label,
|
|
702
756
|
name: `webhookBinding-${a}-${r.key}`,
|
|
703
757
|
required: r.required,
|
|
704
|
-
children: /* @__PURE__ */
|
|
705
|
-
style:
|
|
706
|
-
children: [/* @__PURE__ */
|
|
758
|
+
children: /* @__PURE__ */ E("div", {
|
|
759
|
+
style: nn,
|
|
760
|
+
children: [/* @__PURE__ */ T(x, {
|
|
707
761
|
clearable: !1,
|
|
708
762
|
onChange: (n) => {
|
|
709
|
-
let i =
|
|
710
|
-
t(i ?
|
|
763
|
+
let i = pn(n?.id ?? null);
|
|
764
|
+
t(i ? Gt(i, r, e ?? []) : null);
|
|
711
765
|
},
|
|
712
766
|
options: [...s],
|
|
713
767
|
placeholder: "選擇來源",
|
|
714
|
-
value: i ?
|
|
715
|
-
}), i ? /* @__PURE__ */
|
|
768
|
+
value: i ? an[i.kind] : r.required ? null : rn
|
|
769
|
+
}), i ? /* @__PURE__ */ T(dn, {
|
|
716
770
|
formFields: e,
|
|
717
771
|
onChange: t,
|
|
718
772
|
parameter: r,
|
|
@@ -721,21 +775,21 @@ function Qt({ formFields: e, onChange: t, parameter: r, source: i, targetId: a }
|
|
|
721
775
|
})
|
|
722
776
|
});
|
|
723
777
|
}
|
|
724
|
-
function
|
|
778
|
+
function dn({ formFields: e, onChange: t, parameter: n, source: r }) {
|
|
725
779
|
if (r.kind === "FIELD") {
|
|
726
|
-
if (!e) return /* @__PURE__ */
|
|
780
|
+
if (!e) return /* @__PURE__ */ T(C, {
|
|
727
781
|
color: "text-neutral",
|
|
728
782
|
variant: "caption",
|
|
729
783
|
children: "請先綁定表單版本,才能選擇表單欄位。"
|
|
730
784
|
});
|
|
731
|
-
let i =
|
|
785
|
+
let i = Wt(e, n.type).map((e) => ({
|
|
732
786
|
id: e.fieldKey,
|
|
733
787
|
name: `${e.label}(${e.fieldKey})`
|
|
734
788
|
})), a = r.fieldKey && !i.some((e) => e.id === r.fieldKey) ? [...i, {
|
|
735
789
|
id: r.fieldKey,
|
|
736
790
|
name: `${r.fieldKey}(找不到相容欄位)`
|
|
737
791
|
}] : i;
|
|
738
|
-
return /* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ T(x, {
|
|
739
793
|
clearable: !1,
|
|
740
794
|
onChange: (e) => t({
|
|
741
795
|
fieldKey: e?.id ?? "",
|
|
@@ -746,25 +800,25 @@ function $t({ formFields: e, onChange: t, parameter: n, source: r }) {
|
|
|
746
800
|
value: a.find((e) => e.id === r.fieldKey) ?? null
|
|
747
801
|
});
|
|
748
802
|
}
|
|
749
|
-
return r.kind === "CONTEXT" ? /* @__PURE__ */
|
|
803
|
+
return r.kind === "CONTEXT" ? /* @__PURE__ */ T(x, {
|
|
750
804
|
clearable: !1,
|
|
751
805
|
onChange: (e) => {
|
|
752
|
-
|
|
806
|
+
N(e?.id) && t({
|
|
753
807
|
kind: "CONTEXT",
|
|
754
808
|
path: e.id
|
|
755
809
|
});
|
|
756
810
|
},
|
|
757
|
-
options: [...
|
|
758
|
-
value:
|
|
759
|
-
}) : n.type === "boolean" ? /* @__PURE__ */
|
|
811
|
+
options: [...sn],
|
|
812
|
+
value: sn.find((e) => e.id === r.path) ?? null
|
|
813
|
+
}) : n.type === "boolean" ? /* @__PURE__ */ T(x, {
|
|
760
814
|
clearable: !1,
|
|
761
815
|
onChange: (e) => t({
|
|
762
816
|
kind: "CONSTANT",
|
|
763
817
|
value: e?.id === "true"
|
|
764
818
|
}),
|
|
765
|
-
options: [...
|
|
766
|
-
value: typeof r.value == "boolean" ?
|
|
767
|
-
}) : /* @__PURE__ */
|
|
819
|
+
options: [...on],
|
|
820
|
+
value: typeof r.value == "boolean" ? on.find((e) => e.id === String(r.value)) ?? null : null
|
|
821
|
+
}) : /* @__PURE__ */ T(fn, {
|
|
768
822
|
onChange: (e) => t({
|
|
769
823
|
kind: "CONSTANT",
|
|
770
824
|
value: e
|
|
@@ -773,21 +827,21 @@ function $t({ formFields: e, onChange: t, parameter: n, source: r }) {
|
|
|
773
827
|
value: r.value
|
|
774
828
|
});
|
|
775
829
|
}
|
|
776
|
-
function
|
|
777
|
-
let [r, i] =
|
|
778
|
-
return
|
|
779
|
-
i((e) =>
|
|
780
|
-
}, [t, n]), /* @__PURE__ */
|
|
830
|
+
function fn({ onChange: e, type: t, value: n }) {
|
|
831
|
+
let [r, i] = h(n === null ? "" : String(n));
|
|
832
|
+
return f(() => {
|
|
833
|
+
i((e) => qt(t, e) === n ? e : n === null ? "" : String(n));
|
|
834
|
+
}, [t, n]), /* @__PURE__ */ T(y, {
|
|
781
835
|
inputProps: { inputMode: t === "number" ? "decimal" : void 0 },
|
|
782
836
|
onChange: (n) => {
|
|
783
|
-
i(n.target.value), e(
|
|
837
|
+
i(n.target.value), e(qt(t, n.target.value));
|
|
784
838
|
},
|
|
785
839
|
placeholder: t === "number" ? "輸入數字" : "輸入固定值",
|
|
786
840
|
value: r,
|
|
787
841
|
variant: "base"
|
|
788
842
|
});
|
|
789
843
|
}
|
|
790
|
-
function
|
|
844
|
+
function z(e) {
|
|
791
845
|
let t = [
|
|
792
846
|
`v${e.version}`,
|
|
793
847
|
...e.source === "DATABASE" ? ["後台維護"] : [],
|
|
@@ -795,26 +849,113 @@ function tn(e) {
|
|
|
795
849
|
];
|
|
796
850
|
return `${e.label}(${t.join(",")})`;
|
|
797
851
|
}
|
|
798
|
-
function
|
|
852
|
+
function pn(e) {
|
|
799
853
|
return e === "FIELD" || e === "CONSTANT" || e === "CONTEXT" ? e : null;
|
|
800
854
|
}
|
|
801
855
|
//#endregion
|
|
856
|
+
//#region src/views/templates/designer/dry-run-sample-data.ts
|
|
857
|
+
function mn(e) {
|
|
858
|
+
return (e?.fields ?? []).reduce((e, t) => ({
|
|
859
|
+
...e,
|
|
860
|
+
[t.fieldKey]: gn(t)
|
|
861
|
+
}), {});
|
|
862
|
+
}
|
|
863
|
+
function hn(e) {
|
|
864
|
+
return `formMember:${e}`;
|
|
865
|
+
}
|
|
866
|
+
function gn(e) {
|
|
867
|
+
if (e.type === "number") return 1e3;
|
|
868
|
+
if (e.type === "boolean") return !0;
|
|
869
|
+
if (e.type === "member") {
|
|
870
|
+
let t = hn(e.fieldKey);
|
|
871
|
+
return e.multiple ? [t] : t;
|
|
872
|
+
}
|
|
873
|
+
return Te(e) ? e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.options[0]?.value ?? "" : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
|
|
874
|
+
}
|
|
875
|
+
//#endregion
|
|
876
|
+
//#region src/views/templates/designer/dry-run-assignee-label.ts
|
|
877
|
+
function _n(e, t) {
|
|
878
|
+
let [n, ...r] = e.split(":"), i = (e) => t.orgUnits.find((t) => t.id === e)?.name ?? e, a = (e) => t.positions.find((t) => t.id === e)?.name ?? e;
|
|
879
|
+
return n === "position" && r.length === 1 && r[0] ? `職位:${a(r[0])}(送出時依當下人員決定)` : n === "orgUnitMember" && r.length === 1 && r[0] ? `組織任一人:${i(r[0])}` : n === "orgUnitPosition" && r.length === 2 && r[0] && r[1] ? `組織職位:${i(r[0])}/${a(r[1])}` : n === "orgUnitManager" && r.length === 1 && r[0] ? `組織主管:${i(r[0])}` : n === "formMember" && r.length === 1 && r[0] ? `表單欄位「${((e) => t.formFields.find((t) => t.fieldKey === e)?.label || e)(r[0])}」選的人(送出時依填寫內容決定)` : n === "orgManagerChain" && r.length === 1 && r[0] ? `主管鏈:簽到職等 ${r[0]}(送出時依組織決定實際主管)` : t.memberName(e) ?? e;
|
|
880
|
+
}
|
|
881
|
+
//#endregion
|
|
882
|
+
//#region src/views/templates/designer/dynamic-form-resolver-options.ts
|
|
883
|
+
var vn = "表單中沒有「人員選擇」欄位,請先到表單設計加入", yn = "原本指定的欄位已不在表單中,或已不是「人員選擇」欄位,請重新選擇。", bn = "此欄位非必填", xn = "此欄位可能被條件隱藏", B = "此欄位為隱藏欄位,申請人無法填寫", Sn = ",空白時此關會找不到人員,發佈時會被拒絕;請在表單設計將它設為必填且不隱藏";
|
|
884
|
+
function Cn(e) {
|
|
885
|
+
let t = [
|
|
886
|
+
...e.required ? [] : [bn],
|
|
887
|
+
...e.visibleWhen?.trim() ? [xn] : [],
|
|
888
|
+
...e.hidden ? [B] : []
|
|
889
|
+
];
|
|
890
|
+
return t.length > 0 ? `${t.join("、")}${Sn}` : void 0;
|
|
891
|
+
}
|
|
892
|
+
function wn(e) {
|
|
893
|
+
return `${e.required ? "" : "(非必填)"}${e.visibleWhen?.trim() ? "(可能被條件隱藏)" : ""}${e.hidden ? "(隱藏欄位)" : ""}`;
|
|
894
|
+
}
|
|
895
|
+
function Tn(e) {
|
|
896
|
+
return (e?.fields ?? []).filter(Ee).map((e) => {
|
|
897
|
+
let t = Cn(e);
|
|
898
|
+
return {
|
|
899
|
+
id: e.fieldKey,
|
|
900
|
+
name: `${e.label} (${e.fieldKey})${wn(e)}`,
|
|
901
|
+
...t ? { warning: t } : {}
|
|
902
|
+
};
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
function En(e, t) {
|
|
906
|
+
let n = Tn(e), r = n.find((e) => e.id === t) ?? null;
|
|
907
|
+
if (r) return {
|
|
908
|
+
options: n,
|
|
909
|
+
problem: r.warning ?? null,
|
|
910
|
+
selected: r
|
|
911
|
+
};
|
|
912
|
+
if (t.trim()) {
|
|
913
|
+
let e = {
|
|
914
|
+
id: t,
|
|
915
|
+
name: `${t}(無效欄位)`
|
|
916
|
+
};
|
|
917
|
+
return {
|
|
918
|
+
options: [...n, e],
|
|
919
|
+
problem: yn,
|
|
920
|
+
selected: e
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
return {
|
|
924
|
+
options: n,
|
|
925
|
+
problem: n.length === 0 ? vn : null,
|
|
926
|
+
selected: null
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
function Dn(e, t) {
|
|
930
|
+
if (!t.trim()) return "依表單欄位:未設定";
|
|
931
|
+
let n = e?.fields.find((e) => e.fieldKey === t);
|
|
932
|
+
return n && !Ee(n) ? `依表單欄位:${n.label || t}(非人員選擇欄位)` : `依表單欄位:${n?.label || t}`;
|
|
933
|
+
}
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/views/templates/designer/designer-version-labels.ts
|
|
936
|
+
function On(e) {
|
|
937
|
+
return `${e.draftVersion === null ? "尚未建立草稿" : `草稿 v${e.draftVersion}`} · ${e.publishedVersion === null ? e.hasPublishedVersion ? "已發布版本" : "尚未發布" : `已發布 v${e.publishedVersion}`}`;
|
|
938
|
+
}
|
|
939
|
+
function kn(e, t) {
|
|
940
|
+
return `表單:${e} v${t}`;
|
|
941
|
+
}
|
|
942
|
+
//#endregion
|
|
802
943
|
//#region src/views/templates/designer/TemplateDesignerView.tsx
|
|
803
|
-
var
|
|
944
|
+
var An = {
|
|
804
945
|
display: "grid",
|
|
805
946
|
gap: 16
|
|
806
|
-
},
|
|
947
|
+
}, jn = {
|
|
807
948
|
alignItems: "start",
|
|
808
949
|
display: "grid",
|
|
809
950
|
gap: 16,
|
|
810
951
|
gridTemplateColumns: "minmax(0, 1fr) 420px"
|
|
811
|
-
},
|
|
952
|
+
}, Mn = {
|
|
812
953
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
813
954
|
borderRadius: 6,
|
|
814
955
|
height: 620,
|
|
815
956
|
minWidth: 0,
|
|
816
957
|
overflow: "hidden"
|
|
817
|
-
},
|
|
958
|
+
}, Nn = {
|
|
818
959
|
alignItems: "center",
|
|
819
960
|
boxSizing: "border-box",
|
|
820
961
|
color: "var(--mzn-color-text-error)",
|
|
@@ -824,24 +965,24 @@ var rn = {
|
|
|
824
965
|
lineHeight: 0,
|
|
825
966
|
padding: 0,
|
|
826
967
|
width: 26
|
|
827
|
-
},
|
|
968
|
+
}, Pn = {
|
|
828
969
|
alignItems: "center",
|
|
829
970
|
display: "flex",
|
|
830
971
|
height: "100%",
|
|
831
972
|
justifyContent: "center",
|
|
832
973
|
width: "100%"
|
|
833
|
-
},
|
|
834
|
-
.${
|
|
835
|
-
.${
|
|
836
|
-
flex: 0 0 ${
|
|
837
|
-
width: ${
|
|
974
|
+
}, Fn = "workflow-designer-side-panel", V = 96, In = `
|
|
975
|
+
.${Fn} .mzn-form-field--stretch .mzn-form-field__label-area,
|
|
976
|
+
.${Fn} .mzn-form-field--horizontal .mzn-form-field__label-area {
|
|
977
|
+
flex: 0 0 ${V}px;
|
|
978
|
+
width: ${V}px;
|
|
838
979
|
}
|
|
839
980
|
|
|
840
|
-
.${
|
|
841
|
-
.${
|
|
981
|
+
.${Fn} .mzn-form-field--stretch .mzn-form-field__data-entry,
|
|
982
|
+
.${Fn} .mzn-form-field--horizontal .mzn-form-field__data-entry {
|
|
842
983
|
min-width: 0;
|
|
843
984
|
}
|
|
844
|
-
`,
|
|
985
|
+
`, Ln = "#2563eb", H = "#64748b", Rn = "var(--mzn-color-text-error, #dc2626)", zn = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", Bn = `
|
|
845
986
|
.workflow-selection-delete-control.react-flow__controls-button {
|
|
846
987
|
align-items: center !important;
|
|
847
988
|
display: flex !important;
|
|
@@ -866,26 +1007,26 @@ var rn = {
|
|
|
866
1007
|
|
|
867
1008
|
.workflow-edge--selected .react-flow__edge-path,
|
|
868
1009
|
.react-flow__edge-path.workflow-edge--selected {
|
|
869
|
-
filter: ${
|
|
1010
|
+
filter: ${zn};
|
|
870
1011
|
opacity: 1 !important;
|
|
871
|
-
stroke: ${
|
|
1012
|
+
stroke: ${H} !important;
|
|
872
1013
|
stroke-opacity: 1 !important;
|
|
873
1014
|
stroke-width: 1.5px !important;
|
|
874
1015
|
}
|
|
875
1016
|
|
|
876
1017
|
.workflow-edge--selected {
|
|
877
|
-
--xy-edge-stroke: ${
|
|
878
|
-
--xy-edge-stroke-selected: ${
|
|
1018
|
+
--xy-edge-stroke: ${H};
|
|
1019
|
+
--xy-edge-stroke-selected: ${H};
|
|
879
1020
|
--xy-edge-stroke-width: 1.5px;
|
|
880
1021
|
}
|
|
881
1022
|
|
|
882
|
-
`,
|
|
1023
|
+
`, Vn = {
|
|
883
1024
|
display: "grid",
|
|
884
1025
|
gap: 12
|
|
885
|
-
},
|
|
1026
|
+
}, U = {
|
|
886
1027
|
display: "grid",
|
|
887
1028
|
gap: 12
|
|
888
|
-
},
|
|
1029
|
+
}, Hn = {
|
|
889
1030
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
890
1031
|
borderRadius: 6,
|
|
891
1032
|
display: "grid",
|
|
@@ -893,26 +1034,26 @@ var rn = {
|
|
|
893
1034
|
maxHeight: 360,
|
|
894
1035
|
overflow: "auto",
|
|
895
1036
|
padding: 12
|
|
896
|
-
},
|
|
1037
|
+
}, Un = {
|
|
897
1038
|
borderBottom: "1px solid var(--mzn-color-border-neutral)",
|
|
898
1039
|
display: "grid",
|
|
899
1040
|
gap: 4,
|
|
900
1041
|
padding: "0 0 8px"
|
|
901
|
-
},
|
|
1042
|
+
}, Wn = {
|
|
902
1043
|
display: "flex",
|
|
903
1044
|
flexWrap: "wrap",
|
|
904
1045
|
gap: 8
|
|
905
|
-
},
|
|
1046
|
+
}, Gn = {
|
|
906
1047
|
alignItems: "center",
|
|
907
1048
|
display: "flex",
|
|
908
1049
|
gap: 8
|
|
909
|
-
},
|
|
1050
|
+
}, Kn = {
|
|
910
1051
|
flex: "1 1 auto",
|
|
911
1052
|
minWidth: 0
|
|
912
|
-
},
|
|
1053
|
+
}, qn = { flex: "0 0 auto" }, Jn = {
|
|
913
1054
|
display: "grid",
|
|
914
1055
|
gap: 8
|
|
915
|
-
},
|
|
1056
|
+
}, Yn = {
|
|
916
1057
|
alignContent: "center",
|
|
917
1058
|
background: "var(--mzn-color-bg-surface)",
|
|
918
1059
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
@@ -927,70 +1068,70 @@ var rn = {
|
|
|
927
1068
|
padding: "10px 12px",
|
|
928
1069
|
textAlign: "center",
|
|
929
1070
|
width: "100%"
|
|
930
|
-
},
|
|
931
|
-
...
|
|
1071
|
+
}, Xn = "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)", W = 64, G = 160, Zn = 20, Qn = 64, K = 180, q = {
|
|
1072
|
+
...Yn,
|
|
932
1073
|
display: "grid",
|
|
933
1074
|
gap: 8,
|
|
934
1075
|
padding: "10px 12px"
|
|
935
|
-
},
|
|
936
|
-
...
|
|
1076
|
+
}, $n = {
|
|
1077
|
+
...q,
|
|
937
1078
|
background: "#eff6ff",
|
|
938
1079
|
border: "1px solid #2563eb"
|
|
939
|
-
},
|
|
940
|
-
...
|
|
1080
|
+
}, er = {
|
|
1081
|
+
...q,
|
|
941
1082
|
background: "#f0fdfa",
|
|
942
1083
|
border: "1px solid #0f766e"
|
|
943
|
-
},
|
|
944
|
-
...
|
|
1084
|
+
}, tr = {
|
|
1085
|
+
...Yn,
|
|
945
1086
|
background: "#ffffff"
|
|
946
|
-
},
|
|
947
|
-
...
|
|
1087
|
+
}, J = {
|
|
1088
|
+
...Yn,
|
|
948
1089
|
background: "#ecfdf3",
|
|
949
1090
|
border: "1px solid #2f855a"
|
|
950
|
-
},
|
|
951
|
-
...
|
|
1091
|
+
}, nr = {
|
|
1092
|
+
...Yn,
|
|
952
1093
|
background: "#fff4ed",
|
|
953
1094
|
border: "1px solid #c2410c"
|
|
954
|
-
},
|
|
1095
|
+
}, rr = {
|
|
955
1096
|
display: "block",
|
|
956
1097
|
maxWidth: "100%",
|
|
957
1098
|
minWidth: 0
|
|
958
|
-
},
|
|
1099
|
+
}, ir = {
|
|
959
1100
|
display: "grid",
|
|
960
1101
|
gap: 2,
|
|
961
1102
|
minWidth: 0
|
|
962
|
-
},
|
|
1103
|
+
}, ar = "input", or = "output", sr = {
|
|
963
1104
|
endEvent: "結束",
|
|
964
1105
|
exclusiveGateway: "條件分流",
|
|
965
1106
|
parallelGateway: "並行處理",
|
|
966
1107
|
serviceTask: "系統",
|
|
967
1108
|
startEvent: "開始",
|
|
968
1109
|
userTask: "簽核"
|
|
969
|
-
},
|
|
970
|
-
icon:
|
|
1110
|
+
}, cr = [{
|
|
1111
|
+
icon: me,
|
|
971
1112
|
label: "簽核節點",
|
|
972
1113
|
type: "userTask"
|
|
973
1114
|
}, {
|
|
974
|
-
icon:
|
|
1115
|
+
icon: ue,
|
|
975
1116
|
label: "知會節點",
|
|
976
1117
|
type: "serviceTask"
|
|
977
|
-
}],
|
|
978
|
-
icon:
|
|
1118
|
+
}], lr = [{
|
|
1119
|
+
icon: le,
|
|
979
1120
|
label: "條件分流",
|
|
980
1121
|
type: "exclusiveGateway"
|
|
981
|
-
}],
|
|
1122
|
+
}], ur = [{
|
|
982
1123
|
id: "AND",
|
|
983
1124
|
name: "全部前置完成"
|
|
984
1125
|
}, {
|
|
985
1126
|
id: "OR",
|
|
986
1127
|
name: "任一前置完成"
|
|
987
|
-
}],
|
|
1128
|
+
}], dr = [{
|
|
988
1129
|
id: "RESTART",
|
|
989
1130
|
name: "重新送出後從開始重跑"
|
|
990
1131
|
}, {
|
|
991
1132
|
id: "FROM_RETURN_POINT",
|
|
992
1133
|
name: "重新送出後回到退回節點"
|
|
993
|
-
}],
|
|
1134
|
+
}], fr = [
|
|
994
1135
|
{
|
|
995
1136
|
id: "NONE",
|
|
996
1137
|
name: "不提醒",
|
|
@@ -1011,15 +1152,23 @@ var rn = {
|
|
|
1011
1152
|
name: "剩十分之一時提醒",
|
|
1012
1153
|
value: .9
|
|
1013
1154
|
}
|
|
1014
|
-
],
|
|
1155
|
+
], pr = [
|
|
1015
1156
|
{
|
|
1016
1157
|
id: "DIRECT",
|
|
1017
1158
|
name: "指定會員"
|
|
1018
1159
|
},
|
|
1160
|
+
{
|
|
1161
|
+
id: "DYNAMIC_FORM",
|
|
1162
|
+
name: "依表單欄位指定"
|
|
1163
|
+
},
|
|
1019
1164
|
{
|
|
1020
1165
|
id: "ORG_MANAGER",
|
|
1021
1166
|
name: "發起人主管"
|
|
1022
1167
|
},
|
|
1168
|
+
{
|
|
1169
|
+
id: "ORG_MANAGER_CHAIN",
|
|
1170
|
+
name: "主管鏈(簽到指定職等)"
|
|
1171
|
+
},
|
|
1023
1172
|
{
|
|
1024
1173
|
id: "ORG_UNIT_MANAGER",
|
|
1025
1174
|
name: "指定組織主管"
|
|
@@ -1036,30 +1185,13 @@ var rn = {
|
|
|
1036
1185
|
id: "POSITION",
|
|
1037
1186
|
name: "指定職位"
|
|
1038
1187
|
}
|
|
1039
|
-
],
|
|
1040
|
-
{
|
|
1041
|
-
id: "SINGLE",
|
|
1042
|
-
name: "單人簽核"
|
|
1043
|
-
},
|
|
1044
|
-
{
|
|
1045
|
-
id: "PARALLEL_ANY",
|
|
1046
|
-
name: "任一人同意"
|
|
1047
|
-
},
|
|
1048
|
-
{
|
|
1049
|
-
id: "PARALLEL_ALL",
|
|
1050
|
-
name: "全部同意"
|
|
1051
|
-
},
|
|
1052
|
-
{
|
|
1053
|
-
id: "QUORUM",
|
|
1054
|
-
name: "達到指定門檻"
|
|
1055
|
-
}
|
|
1056
|
-
], Wn = [{
|
|
1188
|
+
], mr = [{
|
|
1057
1189
|
id: "COUNT",
|
|
1058
1190
|
name: "人數"
|
|
1059
1191
|
}, {
|
|
1060
1192
|
id: "PERCENTAGE",
|
|
1061
1193
|
name: "百分比"
|
|
1062
|
-
}],
|
|
1194
|
+
}], Y = [
|
|
1063
1195
|
{
|
|
1064
1196
|
id: "1",
|
|
1065
1197
|
name: "直屬主管",
|
|
@@ -1075,13 +1207,26 @@ var rn = {
|
|
|
1075
1207
|
name: "第三層主管",
|
|
1076
1208
|
value: 3
|
|
1077
1209
|
}
|
|
1078
|
-
],
|
|
1210
|
+
], hr = [{
|
|
1079
1211
|
id: "NONE",
|
|
1080
1212
|
name: "停止流程並提示"
|
|
1081
1213
|
}, {
|
|
1082
1214
|
id: "DIRECT",
|
|
1083
1215
|
name: "固定改派"
|
|
1084
|
-
}],
|
|
1216
|
+
}], gr = [
|
|
1217
|
+
{
|
|
1218
|
+
id: "INITIATOR_MANAGER",
|
|
1219
|
+
name: "改由申請人的直屬主管簽核"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
id: "SKIP_NODE",
|
|
1223
|
+
name: "跳過此關"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
id: "FAIL",
|
|
1227
|
+
name: "停止流程並提示"
|
|
1228
|
+
}
|
|
1229
|
+
], _r = { whenEmpty: "INITIATOR_MANAGER" }, vr = [
|
|
1085
1230
|
{
|
|
1086
1231
|
id: "EQUALS",
|
|
1087
1232
|
name: "等於"
|
|
@@ -1114,14 +1259,14 @@ var rn = {
|
|
|
1114
1259
|
id: "IS_EMPTY",
|
|
1115
1260
|
name: "未填寫"
|
|
1116
1261
|
}
|
|
1117
|
-
],
|
|
1262
|
+
], yr = [
|
|
1118
1263
|
"EQUALS",
|
|
1119
1264
|
"GREATER_THAN",
|
|
1120
1265
|
"GREATER_THAN_OR_EQUALS",
|
|
1121
1266
|
"LESS_THAN",
|
|
1122
1267
|
"LESS_THAN_OR_EQUALS",
|
|
1123
1268
|
"NOT_EQUALS"
|
|
1124
|
-
],
|
|
1269
|
+
], br = [
|
|
1125
1270
|
{
|
|
1126
1271
|
id: "NONE",
|
|
1127
1272
|
name: "未設定"
|
|
@@ -1138,93 +1283,93 @@ var rn = {
|
|
|
1138
1283
|
id: "ORG_UNIT_POSITION",
|
|
1139
1284
|
name: "指定組織職位"
|
|
1140
1285
|
}
|
|
1141
|
-
],
|
|
1286
|
+
], xr = {
|
|
1142
1287
|
id: "CUSTOM",
|
|
1143
1288
|
name: "既有自訂規則"
|
|
1144
|
-
},
|
|
1289
|
+
}, Sr = "member-001", Cr = {
|
|
1145
1290
|
display: "flex",
|
|
1146
1291
|
flexDirection: "column",
|
|
1147
1292
|
height: "100%"
|
|
1148
|
-
},
|
|
1293
|
+
}, wr = {
|
|
1149
1294
|
flex: 1,
|
|
1150
1295
|
minHeight: 0,
|
|
1151
1296
|
overflowY: "auto"
|
|
1152
|
-
},
|
|
1297
|
+
}, Tr = {
|
|
1153
1298
|
borderTop: "1px solid var(--mzn-color-border-neutral)",
|
|
1154
1299
|
display: "flex",
|
|
1155
1300
|
gap: 8,
|
|
1156
1301
|
paddingTop: 12
|
|
1157
|
-
},
|
|
1302
|
+
}, Er = {
|
|
1158
1303
|
fields: [],
|
|
1159
1304
|
schemaVersion: 1
|
|
1160
|
-
},
|
|
1305
|
+
}, Dr = {
|
|
1161
1306
|
layout: [],
|
|
1162
1307
|
schemaVersion: 1
|
|
1163
|
-
},
|
|
1164
|
-
endEvent:
|
|
1165
|
-
exclusiveGateway:
|
|
1166
|
-
parallelGateway:
|
|
1167
|
-
serviceTask:
|
|
1168
|
-
startEvent:
|
|
1169
|
-
userTask:
|
|
1308
|
+
}, Or = {
|
|
1309
|
+
endEvent: X,
|
|
1310
|
+
exclusiveGateway: X,
|
|
1311
|
+
parallelGateway: X,
|
|
1312
|
+
serviceTask: X,
|
|
1313
|
+
startEvent: X,
|
|
1314
|
+
userTask: X
|
|
1170
1315
|
};
|
|
1171
|
-
function
|
|
1316
|
+
function kr(e, t) {
|
|
1172
1317
|
return typeof e == "function" ? e(t) : e;
|
|
1173
1318
|
}
|
|
1174
|
-
function
|
|
1175
|
-
let
|
|
1176
|
-
directory:
|
|
1177
|
-
listOrgUnits: async () =>
|
|
1319
|
+
function Ar({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride: u, initialInitiatorPolicyCel: se, initialWorkflowDefinition: le, onInitiatorPolicyChange: ue, onWorkflowChange: de, showAiAssistant: me = !1, showDryRun: he = !0, templateId: ge }) {
|
|
1320
|
+
let _e = e(), ve = t(), [D, ye] = h(null), [be, xe] = h(null), [Se, we] = h(""), [Te, Ee] = h(null), [Me, Pe] = h(null), O = m(null), [Le, Re] = h(void 0), Ye = m([]), Xe = m([]), k = yt({
|
|
1321
|
+
directory: p(() => ({
|
|
1322
|
+
listOrgUnits: async () => Ye.current.map((e) => ({
|
|
1178
1323
|
id: e.id,
|
|
1179
1324
|
name: e.name
|
|
1180
1325
|
})),
|
|
1181
|
-
listPositions: async () =>
|
|
1326
|
+
listPositions: async () => Xe.current.map((e) => ({
|
|
1182
1327
|
id: e.id,
|
|
1183
1328
|
name: e.name
|
|
1184
1329
|
})),
|
|
1185
|
-
searchMembers: async (e) =>
|
|
1330
|
+
searchMembers: async (e) => Li(await Ke(e)).map((e) => ({
|
|
1186
1331
|
email: e.email,
|
|
1187
1332
|
id: e.memberId,
|
|
1188
1333
|
name: e.name
|
|
1189
1334
|
}))
|
|
1190
1335
|
}), []),
|
|
1191
1336
|
initialState: {
|
|
1192
|
-
definition: a &&
|
|
1337
|
+
definition: a && le != null ? Vr(le) : Kr(),
|
|
1193
1338
|
editingEdgeId: null,
|
|
1194
1339
|
formDefinitionVersionId: null,
|
|
1195
1340
|
formSchema: null,
|
|
1196
|
-
initiatorPolicyCel: a &&
|
|
1341
|
+
initiatorPolicyCel: a && se !== void 0 ? se : null,
|
|
1197
1342
|
selectedEdgeIds: [],
|
|
1198
|
-
selectedNodeId: a &&
|
|
1343
|
+
selectedNodeId: a && le != null ? le.nodes[0]?.id ?? "start" : "start"
|
|
1199
1344
|
},
|
|
1200
|
-
layout:
|
|
1345
|
+
layout: Jr,
|
|
1201
1346
|
onLayout: (e) => {
|
|
1202
|
-
let t =
|
|
1203
|
-
t &&
|
|
1347
|
+
let t = sa(e, O.current);
|
|
1348
|
+
t && Re(t);
|
|
1204
1349
|
}
|
|
1205
|
-
}), A = k.state.definition, j = k.state.formDefinitionVersionId, M = k.state.initiatorPolicyCel,
|
|
1350
|
+
}), A = k.state.definition, j = k.state.formDefinitionVersionId, M = k.state.initiatorPolicyCel, it = k.state.selectedNodeId, N = k.state.selectedEdgeIds, ot = k.state.editingEdgeId, st = (e) => k.replaceState((t) => ({
|
|
1206
1351
|
...t,
|
|
1207
|
-
definition:
|
|
1208
|
-
})),
|
|
1352
|
+
definition: kr(e, t.definition)
|
|
1353
|
+
})), lt = (e) => k.replaceState((t) => ({
|
|
1209
1354
|
...t,
|
|
1210
|
-
formDefinitionVersionId:
|
|
1211
|
-
})),
|
|
1355
|
+
formDefinitionVersionId: kr(e, t.formDefinitionVersionId)
|
|
1356
|
+
})), ut = (e) => k.replaceState((t) => ({
|
|
1212
1357
|
...t,
|
|
1213
|
-
initiatorPolicyCel:
|
|
1358
|
+
initiatorPolicyCel: kr(e, t.initiatorPolicyCel)
|
|
1214
1359
|
})), dt = (e) => k.replaceState((t) => ({
|
|
1215
1360
|
...t,
|
|
1216
|
-
selectedNodeId:
|
|
1361
|
+
selectedNodeId: kr(e, t.selectedNodeId)
|
|
1217
1362
|
})), ft = (e) => k.replaceState((t) => ({
|
|
1218
1363
|
...t,
|
|
1219
|
-
selectedEdgeIds:
|
|
1364
|
+
selectedEdgeIds: kr(e, t.selectedEdgeIds)
|
|
1220
1365
|
})), pt = (e) => k.replaceState((t) => ({
|
|
1221
1366
|
...t,
|
|
1222
|
-
editingEdgeId:
|
|
1223
|
-
})), [
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
}, [
|
|
1227
|
-
let [
|
|
1367
|
+
editingEdgeId: kr(e, t.editingEdgeId)
|
|
1368
|
+
})), [bt, P] = h(null), [xt, F] = h(null);
|
|
1369
|
+
f(() => {
|
|
1370
|
+
F(null);
|
|
1371
|
+
}, [it]);
|
|
1372
|
+
let [St, Ct] = h(!0), [wt, Tt] = h(!1), [Et, Dt] = h(!1), [Ot, kt] = h([]), At = p(() => JSON.stringify({
|
|
1228
1373
|
formDefinitionVersionId: j,
|
|
1229
1374
|
initiatorPolicyCel: M,
|
|
1230
1375
|
workflowDefinition: A
|
|
@@ -1232,250 +1377,248 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
1232
1377
|
j,
|
|
1233
1378
|
M,
|
|
1234
1379
|
A
|
|
1235
|
-
]),
|
|
1236
|
-
|
|
1237
|
-
let [
|
|
1238
|
-
|
|
1239
|
-
a ?
|
|
1240
|
-
}, [a,
|
|
1380
|
+
]), jt = !!Se && At !== Se, [Mt, Nt] = h(!1), [I, Pt] = h([]), [Ft, It] = h([]), Rt = m(0), Bt = m(/* @__PURE__ */ new Set()), [L, Vt] = h([]), [R, Ht] = h([]), [Ut, Wt] = h([]);
|
|
1381
|
+
Ye.current = L, Xe.current = R;
|
|
1382
|
+
let [Gt, Kt] = h(!1), [qt, Yt] = h(!1), [Xt, Zt] = h("{}"), [$t, en] = h(null), [tn, nn] = h(null), [rn, an] = h([]), [on, sn] = h("loading"), [ln, un] = h(!1), [dn, fn] = h(!1), [z, pn] = h(null), [hn, gn] = h(!1), [vn, yn] = h(!1), bn = jt || hn ? "保存並發布" : be ? "發布草稿" : "已發布";
|
|
1383
|
+
f(() => {
|
|
1384
|
+
a ? $n() : er();
|
|
1385
|
+
}, [a, ge]), f(() => {
|
|
1241
1386
|
function e(e) {
|
|
1242
|
-
|
|
1387
|
+
jt && (e.preventDefault(), e.returnValue = "");
|
|
1243
1388
|
}
|
|
1244
1389
|
return window.addEventListener("beforeunload", e), () => {
|
|
1245
1390
|
window.removeEventListener("beforeunload", e);
|
|
1246
1391
|
};
|
|
1247
|
-
}, [
|
|
1248
|
-
|
|
1249
|
-
}, [A,
|
|
1250
|
-
|
|
1392
|
+
}, [jt]), f(() => {
|
|
1393
|
+
nr(A);
|
|
1394
|
+
}, [A, I]), f(() => {
|
|
1395
|
+
st((e) => Vr(e));
|
|
1251
1396
|
}, [A.edges, A.nodes]);
|
|
1252
|
-
function
|
|
1253
|
-
(!
|
|
1397
|
+
function xn() {
|
|
1398
|
+
(!jt || window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?")) && _e.push(ve.templates());
|
|
1254
1399
|
}
|
|
1255
|
-
let
|
|
1400
|
+
let B = p(() => A.nodes.find((e) => e.id === it) ?? null, [it, A.nodes]), Sn = B ? Ei(B) : !1, Cn = N.length > 0 || Sn, wn = d(() => {
|
|
1256
1401
|
k.getState().selectedEdgeIds.forEach((e) => k.dispatch({
|
|
1257
1402
|
edgeId: e,
|
|
1258
1403
|
type: "deleteEdge"
|
|
1259
|
-
})),
|
|
1260
|
-
nodeId:
|
|
1404
|
+
})), B && Ei(B) && k.dispatch({
|
|
1405
|
+
nodeId: B.id,
|
|
1261
1406
|
type: "deleteNode"
|
|
1262
1407
|
});
|
|
1263
|
-
}, [k,
|
|
1264
|
-
|
|
1265
|
-
if (!
|
|
1408
|
+
}, [k, B]);
|
|
1409
|
+
f(() => {
|
|
1410
|
+
if (!Cn) return;
|
|
1266
1411
|
function e(e) {
|
|
1267
|
-
(e.key === "Delete" || e.key === "Backspace") && (
|
|
1412
|
+
(e.key === "Delete" || e.key === "Backspace") && (Ai(e.target) || (e.preventDefault(), wn()));
|
|
1268
1413
|
}
|
|
1269
1414
|
return window.addEventListener("keydown", e), () => {
|
|
1270
1415
|
window.removeEventListener("keydown", e);
|
|
1271
1416
|
};
|
|
1272
|
-
}, [
|
|
1273
|
-
let
|
|
1417
|
+
}, [Cn, wn]);
|
|
1418
|
+
let Tn = p(() => A.edges.find((e) => e.id === ot) ?? null, [ot, A.edges]), Dn = p(() => N.length === 1 ? A.edges.find((e) => e.id === N[0]) ?? null : null, [N, A.edges]), kn = p(() => N.map((e) => A.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [N, A.edges]), V = p(() => Me ?? vi(M, Te), [
|
|
1274
1419
|
M,
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
]),
|
|
1278
|
-
W,
|
|
1279
|
-
F,
|
|
1280
|
-
L,
|
|
1281
|
-
R,
|
|
1282
|
-
nt,
|
|
1283
|
-
A.nodes
|
|
1284
|
-
]), Pn = d(() => A.edges.map((e) => pr(e, A.nodes, N.includes(e.id))), [
|
|
1420
|
+
Me,
|
|
1421
|
+
Te
|
|
1422
|
+
]), Ln = p(() => A.edges.map((e) => Br(e, A.nodes, N.includes(e.id))), [
|
|
1285
1423
|
N,
|
|
1286
1424
|
A.edges,
|
|
1287
1425
|
A.nodes
|
|
1288
|
-
]),
|
|
1426
|
+
]), H = p(() => $(Ot, j) ?? $(ji(D?.formVersions ?? []), j), [
|
|
1289
1427
|
j,
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
]),
|
|
1293
|
-
|
|
1294
|
-
k.getState().formSchema !==
|
|
1428
|
+
Ot,
|
|
1429
|
+
D?.formVersions
|
|
1430
|
+
]), zn = p(() => Ii(Ot, H), [Ot, H]), Yn = H?.schema ?? null, Xn = a ? u ?? null : Yn;
|
|
1431
|
+
f(() => {
|
|
1432
|
+
k.getState().formSchema !== Xn && k.replaceState((e) => ({
|
|
1295
1433
|
...e,
|
|
1296
|
-
formSchema:
|
|
1434
|
+
formSchema: Xn
|
|
1297
1435
|
}));
|
|
1298
|
-
}, [k,
|
|
1299
|
-
let
|
|
1300
|
-
|
|
1436
|
+
}, [k, Xn]);
|
|
1437
|
+
let W = p(() => ca(A), [A]);
|
|
1438
|
+
f(() => {
|
|
1301
1439
|
let e = !0;
|
|
1302
|
-
return
|
|
1303
|
-
e && (
|
|
1440
|
+
return He({ includeDeprecated: !0 }).then((t) => {
|
|
1441
|
+
e && (an(t), sn("ready"));
|
|
1304
1442
|
}).catch(() => {
|
|
1305
|
-
e &&
|
|
1443
|
+
e && sn("unavailable");
|
|
1306
1444
|
}), () => {
|
|
1307
1445
|
e = !1;
|
|
1308
1446
|
};
|
|
1309
1447
|
}, []);
|
|
1310
|
-
let
|
|
1448
|
+
let G = hn && z ? z.schema : Xn, Zn = p(() => on === "ready" ? Qt({
|
|
1311
1449
|
definition: A,
|
|
1312
|
-
endpoints:
|
|
1313
|
-
formFields:
|
|
1450
|
+
endpoints: rn,
|
|
1451
|
+
formFields: G?.fields ?? []
|
|
1314
1452
|
})[0] ?? null : null, [
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1453
|
+
rn,
|
|
1454
|
+
on,
|
|
1455
|
+
G,
|
|
1318
1456
|
A
|
|
1319
|
-
]),
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1457
|
+
]), Qn = p(() => A.nodes.map((e) => Ir(e, I, L, R, e.id === it, V, G)), [
|
|
1458
|
+
V,
|
|
1459
|
+
I,
|
|
1460
|
+
L,
|
|
1461
|
+
R,
|
|
1462
|
+
it,
|
|
1463
|
+
G,
|
|
1464
|
+
A.nodes
|
|
1465
|
+
]), K = p(() => nt(A), [A]), q = p(() => yi(V), [V]);
|
|
1466
|
+
f(() => {
|
|
1467
|
+
a && de?.(A);
|
|
1468
|
+
}, [a, A]), f(() => {
|
|
1469
|
+
a && ue?.(M);
|
|
1324
1470
|
}, [a, M]);
|
|
1325
|
-
async function
|
|
1326
|
-
|
|
1471
|
+
async function $n() {
|
|
1472
|
+
Ct(!0), P(null);
|
|
1327
1473
|
try {
|
|
1328
|
-
let e = await
|
|
1329
|
-
|
|
1474
|
+
let e = await De();
|
|
1475
|
+
Vt(e.orgUnits), Ht(e.positions), Wt(e.memberships);
|
|
1330
1476
|
} catch (e) {
|
|
1331
|
-
P(
|
|
1477
|
+
P(ba(e));
|
|
1332
1478
|
} finally {
|
|
1333
|
-
|
|
1479
|
+
Ct(!1);
|
|
1334
1480
|
}
|
|
1335
1481
|
}
|
|
1336
|
-
async function
|
|
1337
|
-
|
|
1482
|
+
async function er() {
|
|
1483
|
+
Ct(!0), P(null), F(null);
|
|
1338
1484
|
try {
|
|
1339
|
-
let [e, t] = await Promise.all([
|
|
1340
|
-
|
|
1341
|
-
let i =
|
|
1342
|
-
|
|
1485
|
+
let [e, t] = await Promise.all([We(ge), De()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, r = n ?? e.versions[0] ?? null;
|
|
1486
|
+
ye(e), xe(n), Vt(t.orgUnits), Ht(t.positions), Wt(t.memberships), kt(ji(e.formVersions));
|
|
1487
|
+
let i = Vr(r?.workflowDefinition ?? Kr()), a = r?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, o = r?.initiatorPolicyCel ?? null;
|
|
1488
|
+
st(i), lt(a), ut(o), we(JSON.stringify({
|
|
1343
1489
|
formDefinitionVersionId: a,
|
|
1344
1490
|
initiatorPolicyCel: o,
|
|
1345
1491
|
workflowDefinition: i
|
|
1346
|
-
})),
|
|
1492
|
+
})), Ee(r && !e.template.currentVersionId && !r.initiatorPolicyCel && qr(r.workflowDefinition) ? "NONE" : null), Pe(null), dt(r?.workflowDefinition.nodes[0]?.id ?? "start"), ft([]), pt(null), pn(null), gn(!1);
|
|
1347
1493
|
} catch (e) {
|
|
1348
|
-
P(
|
|
1494
|
+
P(ba(e));
|
|
1349
1495
|
} finally {
|
|
1350
|
-
|
|
1496
|
+
Ct(!1);
|
|
1351
1497
|
}
|
|
1352
1498
|
}
|
|
1353
|
-
async function
|
|
1354
|
-
|
|
1499
|
+
async function tr(e) {
|
|
1500
|
+
Dt(!0), P(null);
|
|
1355
1501
|
try {
|
|
1356
|
-
let t = await
|
|
1357
|
-
|
|
1502
|
+
let t = await qe(e);
|
|
1503
|
+
kt(Ii(ji(t), H));
|
|
1358
1504
|
} catch (e) {
|
|
1359
|
-
P(
|
|
1505
|
+
P(ba(e));
|
|
1360
1506
|
} finally {
|
|
1361
|
-
|
|
1507
|
+
Dt(!1);
|
|
1362
1508
|
}
|
|
1363
1509
|
}
|
|
1364
|
-
async function
|
|
1365
|
-
|
|
1366
|
-
let t = ++
|
|
1510
|
+
async function J(e) {
|
|
1511
|
+
Nt(!0), P(null);
|
|
1512
|
+
let t = ++Rt.current;
|
|
1367
1513
|
try {
|
|
1368
|
-
let n =
|
|
1369
|
-
|
|
1514
|
+
let n = Li(await Ke(e));
|
|
1515
|
+
Pt((e) => Zi(e, n)), t === Rt.current && It(n);
|
|
1370
1516
|
} catch (e) {
|
|
1371
|
-
t ===
|
|
1517
|
+
t === Rt.current && P(ba(e));
|
|
1372
1518
|
} finally {
|
|
1373
|
-
t ===
|
|
1519
|
+
t === Rt.current && Nt(!1);
|
|
1374
1520
|
}
|
|
1375
1521
|
}
|
|
1376
|
-
async function
|
|
1377
|
-
let t =
|
|
1378
|
-
if (
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
} catch {
|
|
1382
|
-
At((e) => Di(e, t.map(hi)));
|
|
1383
|
-
}
|
|
1522
|
+
async function nr(e) {
|
|
1523
|
+
let t = $i(e), n = s(t.filter((e) => !I.some((t) => t.memberId === e && !t.unresolved)), Bt.current);
|
|
1524
|
+
if (n.length === 0) return;
|
|
1525
|
+
let { profiles: r, skippedIds: i } = await c(n, Ge), a = new Set(r.map((e) => e.memberId)), o = n.filter((e) => !a.has(e) && !i.includes(e));
|
|
1526
|
+
o.forEach((e) => Bt.current.add(e)), Pt((e) => Zi(e, [...Li(r), ...[...o, ...i].map(Ri)]));
|
|
1384
1527
|
}
|
|
1385
|
-
async function
|
|
1386
|
-
|
|
1528
|
+
async function rr(e) {
|
|
1529
|
+
Tt(!0), P(null);
|
|
1387
1530
|
try {
|
|
1388
|
-
let t =
|
|
1531
|
+
let t = ca(A), n = yi(V), r = e ? Zn : null;
|
|
1389
1532
|
if (t || n || r) {
|
|
1390
1533
|
let e = t ?? n ?? r ?? "流程設定未完成";
|
|
1391
1534
|
throw P(e), Error(e);
|
|
1392
1535
|
}
|
|
1393
|
-
if (
|
|
1394
|
-
category:
|
|
1395
|
-
categoryId:
|
|
1396
|
-
formDefinitionId:
|
|
1536
|
+
if (hn && z !== null) await ze({
|
|
1537
|
+
category: D?.template.category ?? null,
|
|
1538
|
+
categoryId: D?.template.categoryId ?? null,
|
|
1539
|
+
formDefinitionId: H?.formDefinitionId ?? null,
|
|
1397
1540
|
formDescription: null,
|
|
1398
|
-
formName:
|
|
1541
|
+
formName: H?.formName ?? D?.template.name ?? "表單",
|
|
1399
1542
|
initiatorPolicyCel: M,
|
|
1400
1543
|
notificationConfig: null,
|
|
1401
1544
|
publish: e,
|
|
1402
1545
|
schema: z.schema,
|
|
1403
1546
|
slaDefaults: null,
|
|
1404
1547
|
templateDescription: null,
|
|
1405
|
-
templateId:
|
|
1406
|
-
templateName:
|
|
1548
|
+
templateId: ge ?? null,
|
|
1549
|
+
templateName: D?.template.name ?? "模板",
|
|
1407
1550
|
uiSchema: z.uiSchema,
|
|
1408
1551
|
workflowDefinition: A
|
|
1409
|
-
}),
|
|
1552
|
+
}), gn(!1), pn(null), await er();
|
|
1410
1553
|
else {
|
|
1411
|
-
let t =
|
|
1554
|
+
let t = be ?? await Ve(ge), n = await Je({
|
|
1412
1555
|
formDefinitionVersionId: j,
|
|
1413
1556
|
initiatorPolicyCel: M,
|
|
1414
1557
|
versionId: t.id,
|
|
1415
1558
|
workflowDefinition: A
|
|
1416
1559
|
});
|
|
1417
|
-
|
|
1560
|
+
xe(n), e && await Ue(n.id), await er();
|
|
1418
1561
|
}
|
|
1419
1562
|
} catch (e) {
|
|
1420
|
-
throw P(
|
|
1563
|
+
throw P(ba(e)), e;
|
|
1421
1564
|
} finally {
|
|
1422
|
-
|
|
1565
|
+
Tt(!1);
|
|
1423
1566
|
}
|
|
1424
1567
|
}
|
|
1425
|
-
async function
|
|
1426
|
-
await
|
|
1568
|
+
async function ir() {
|
|
1569
|
+
await rr(!1);
|
|
1427
1570
|
}
|
|
1428
|
-
async function
|
|
1429
|
-
await
|
|
1571
|
+
async function ar() {
|
|
1572
|
+
await rr(!0);
|
|
1430
1573
|
}
|
|
1431
|
-
function
|
|
1432
|
-
|
|
1574
|
+
function or() {
|
|
1575
|
+
Zt(JSON.stringify(mn(G), null, 2)), en(null), nn(null), Kt(!0);
|
|
1433
1576
|
}
|
|
1434
|
-
function
|
|
1435
|
-
|
|
1577
|
+
function vr() {
|
|
1578
|
+
qt || Kt(!1);
|
|
1436
1579
|
}
|
|
1437
|
-
async function
|
|
1438
|
-
|
|
1580
|
+
async function yr() {
|
|
1581
|
+
Yt(!0), nn(null), en(null);
|
|
1439
1582
|
try {
|
|
1440
|
-
let e =
|
|
1583
|
+
let e = Mi(Xt), t = await Be({
|
|
1441
1584
|
formData: e,
|
|
1442
|
-
initiatorMemberId:
|
|
1443
|
-
initiatorMetadataSnapshot:
|
|
1585
|
+
initiatorMemberId: Sr,
|
|
1586
|
+
initiatorMetadataSnapshot: Wi(Sr, Ut),
|
|
1444
1587
|
workflowDefinition: A
|
|
1445
1588
|
});
|
|
1446
|
-
|
|
1589
|
+
en(t);
|
|
1447
1590
|
} catch (e) {
|
|
1448
|
-
|
|
1591
|
+
nn(ba(e));
|
|
1449
1592
|
} finally {
|
|
1450
|
-
|
|
1593
|
+
Yt(!1);
|
|
1451
1594
|
}
|
|
1452
1595
|
}
|
|
1453
|
-
async function
|
|
1454
|
-
if (
|
|
1455
|
-
let e =
|
|
1596
|
+
async function Ar() {
|
|
1597
|
+
if (fn(!0), z !== null) return;
|
|
1598
|
+
let e = H?.formDefinitionId ?? null;
|
|
1456
1599
|
if (!e) {
|
|
1457
|
-
|
|
1458
|
-
schema:
|
|
1459
|
-
uiSchema:
|
|
1600
|
+
pn({
|
|
1601
|
+
schema: Er,
|
|
1602
|
+
uiSchema: Dr
|
|
1460
1603
|
});
|
|
1461
1604
|
return;
|
|
1462
1605
|
}
|
|
1463
|
-
|
|
1606
|
+
yn(!0);
|
|
1464
1607
|
try {
|
|
1465
|
-
let t = await
|
|
1466
|
-
|
|
1467
|
-
schema: n?.schema ??
|
|
1468
|
-
uiSchema: n?.uiSchema ??
|
|
1608
|
+
let t = await Ce(e), n = t.versions.find((e) => e.status === "DRAFT") ?? t.versions.find((e) => e.id === t.definition.currentVersionId) ?? t.versions[0] ?? null;
|
|
1609
|
+
pn({
|
|
1610
|
+
schema: n?.schema ?? Er,
|
|
1611
|
+
uiSchema: n?.uiSchema ?? Dr
|
|
1469
1612
|
});
|
|
1470
1613
|
} catch (e) {
|
|
1471
|
-
P(
|
|
1614
|
+
P(ba(e));
|
|
1472
1615
|
} finally {
|
|
1473
|
-
|
|
1616
|
+
yn(!1);
|
|
1474
1617
|
}
|
|
1475
1618
|
}
|
|
1476
|
-
function
|
|
1477
|
-
let t =
|
|
1478
|
-
|
|
1619
|
+
function X(e) {
|
|
1620
|
+
let t = Ie(e, Qn);
|
|
1621
|
+
st((e) => ({
|
|
1479
1622
|
...e,
|
|
1480
1623
|
nodes: e.nodes.map((e) => {
|
|
1481
1624
|
let n = t.find((t) => t.id === e.id);
|
|
@@ -1486,110 +1629,126 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
1486
1629
|
})
|
|
1487
1630
|
}));
|
|
1488
1631
|
}
|
|
1489
|
-
function
|
|
1490
|
-
|
|
1632
|
+
function Mr(e) {
|
|
1633
|
+
wi(e, A.nodes) && e.source && e.target && k.dispatch({
|
|
1491
1634
|
source: e.source,
|
|
1492
1635
|
target: e.target,
|
|
1493
1636
|
type: "connectEdge"
|
|
1494
1637
|
});
|
|
1495
1638
|
}
|
|
1496
|
-
function
|
|
1497
|
-
e.stopPropagation(), ft((n) => e.shiftKey || e.metaKey || e.ctrlKey ?
|
|
1639
|
+
function Nr(e, t) {
|
|
1640
|
+
e.stopPropagation(), ft((n) => e.shiftKey || e.metaKey || e.ctrlKey ? Ti(n, t.id) : [t.id]), dt(null);
|
|
1498
1641
|
}
|
|
1499
|
-
function
|
|
1642
|
+
function Pr() {
|
|
1500
1643
|
pt(null);
|
|
1501
1644
|
}
|
|
1502
|
-
function
|
|
1645
|
+
function Fr(e) {
|
|
1503
1646
|
k.dispatch({
|
|
1504
1647
|
nodeType: e,
|
|
1505
1648
|
type: "addNode"
|
|
1506
1649
|
});
|
|
1507
1650
|
}
|
|
1508
|
-
function
|
|
1509
|
-
|
|
1651
|
+
function Lr(e) {
|
|
1652
|
+
B && k.dispatch({
|
|
1510
1653
|
label: e,
|
|
1511
|
-
nodeId:
|
|
1654
|
+
nodeId: B.id,
|
|
1512
1655
|
type: "renameNode"
|
|
1513
1656
|
});
|
|
1514
1657
|
}
|
|
1515
1658
|
function Z(e) {
|
|
1516
|
-
if (!
|
|
1517
|
-
let t =
|
|
1518
|
-
k.dispatch({
|
|
1659
|
+
if (!B || B.type !== "userTask") return;
|
|
1660
|
+
let t = B.id, n = B.data.decisionPolicy;
|
|
1661
|
+
if (k.dispatch({
|
|
1519
1662
|
approverResolver: e,
|
|
1520
1663
|
nodeId: t,
|
|
1521
1664
|
type: "setUserTaskApprover"
|
|
1522
|
-
}),
|
|
1523
|
-
|
|
1524
|
-
|
|
1665
|
+
}), F(null), at(e, n)) {
|
|
1666
|
+
F({
|
|
1667
|
+
message: "主管鏈會依序加入多位主管,簽核方式已改為「依序簽核」。",
|
|
1668
|
+
nodeId: t,
|
|
1669
|
+
policyType: "SEQUENTIAL"
|
|
1670
|
+
});
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
rt(n, e) && F({
|
|
1674
|
+
message: `簽核者已變更為 ${ct(e)} 位,不足原本設定的 ${n?.type === "QUORUM" ? n.threshold : 0} 位門檻,簽核政策已重設為單人簽核,請重新設定。`,
|
|
1675
|
+
nodeId: t,
|
|
1676
|
+
policyType: "SINGLE"
|
|
1525
1677
|
});
|
|
1526
1678
|
}
|
|
1527
|
-
function
|
|
1528
|
-
|
|
1529
|
-
nodeId:
|
|
1679
|
+
function Rr(e) {
|
|
1680
|
+
B && B.type === "userTask" && k.dispatch({
|
|
1681
|
+
nodeId: B.id,
|
|
1530
1682
|
resubmitStrategy: e,
|
|
1531
1683
|
type: "setUserTaskReturnResubmitStrategy"
|
|
1532
1684
|
});
|
|
1533
1685
|
}
|
|
1534
|
-
function
|
|
1535
|
-
|
|
1536
|
-
nodeId:
|
|
1686
|
+
function zr(e) {
|
|
1687
|
+
B && B.type === "userTask" && k.dispatch({
|
|
1688
|
+
nodeId: B.id,
|
|
1537
1689
|
requireComment: e,
|
|
1538
1690
|
type: "setUserTaskReturnRequireComment"
|
|
1539
1691
|
});
|
|
1540
1692
|
}
|
|
1541
1693
|
function Q(e) {
|
|
1542
|
-
|
|
1543
|
-
nodeId:
|
|
1694
|
+
B && B.type === "userTask" && k.dispatch({
|
|
1695
|
+
nodeId: B.id,
|
|
1544
1696
|
sla: e,
|
|
1545
1697
|
type: "setUserTaskSla"
|
|
1546
1698
|
});
|
|
1547
1699
|
}
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
|
|
1700
|
+
function Hr(e) {
|
|
1701
|
+
B && B.type === "userTask" && k.dispatch({
|
|
1702
|
+
excludeInitiator: e,
|
|
1703
|
+
nodeId: B.id,
|
|
1704
|
+
type: "setUserTaskExcludeInitiator"
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
function Ur(e) {
|
|
1708
|
+
if (!B || B.type !== "userTask") return;
|
|
1709
|
+
F(null);
|
|
1551
1710
|
let t = e.type === "QUORUM" ? {
|
|
1552
1711
|
...e,
|
|
1553
|
-
threshold:
|
|
1712
|
+
threshold: tt(e.threshold, e.thresholdType)
|
|
1554
1713
|
} : e;
|
|
1555
1714
|
k.dispatch({
|
|
1556
1715
|
decisionPolicy: t,
|
|
1557
|
-
nodeId:
|
|
1716
|
+
nodeId: B.id,
|
|
1558
1717
|
type: "setUserTaskDecisionPolicy"
|
|
1559
1718
|
});
|
|
1560
1719
|
}
|
|
1561
|
-
function
|
|
1562
|
-
|
|
1720
|
+
function Wr(e) {
|
|
1721
|
+
B && B.type === "userTask" && k.dispatch({
|
|
1563
1722
|
...e,
|
|
1564
|
-
nodeId:
|
|
1723
|
+
nodeId: B.id,
|
|
1565
1724
|
type: "setUserTaskOptions"
|
|
1566
1725
|
});
|
|
1567
1726
|
}
|
|
1568
|
-
function
|
|
1569
|
-
|
|
1727
|
+
function Gr(e) {
|
|
1728
|
+
B && B.type === "serviceTask" && k.dispatch({
|
|
1570
1729
|
action: e,
|
|
1571
|
-
nodeId:
|
|
1730
|
+
nodeId: B.id,
|
|
1572
1731
|
type: "setServiceAction"
|
|
1573
1732
|
});
|
|
1574
1733
|
}
|
|
1575
|
-
function
|
|
1576
|
-
|
|
1734
|
+
function li(e) {
|
|
1735
|
+
Pe(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), Ee(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), ut(xi(e, L));
|
|
1577
1736
|
}
|
|
1578
|
-
function
|
|
1579
|
-
|
|
1580
|
-
nodeId:
|
|
1737
|
+
function _i(e) {
|
|
1738
|
+
B && B.type !== "startEvent" && k.dispatch({
|
|
1739
|
+
nodeId: B.id,
|
|
1581
1740
|
triggerMode: e,
|
|
1582
1741
|
type: "setNodeTriggerMode"
|
|
1583
1742
|
});
|
|
1584
1743
|
}
|
|
1585
|
-
function
|
|
1744
|
+
function bi(e, t) {
|
|
1586
1745
|
k.dispatch({
|
|
1587
1746
|
edgeId: e,
|
|
1588
1747
|
isDefault: t,
|
|
1589
1748
|
type: "setEdgeDefault"
|
|
1590
1749
|
});
|
|
1591
1750
|
}
|
|
1592
|
-
function
|
|
1751
|
+
function Si({ edgeId: e, fieldKey: t, operator: n, value: r }) {
|
|
1593
1752
|
k.dispatch({
|
|
1594
1753
|
edgeId: e,
|
|
1595
1754
|
fieldKey: t,
|
|
@@ -1598,289 +1757,293 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
1598
1757
|
value: r
|
|
1599
1758
|
});
|
|
1600
1759
|
}
|
|
1601
|
-
function
|
|
1760
|
+
function Di() {
|
|
1602
1761
|
k.dispatch({ type: "autoLayout" });
|
|
1603
1762
|
}
|
|
1604
|
-
return /* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
a ? null : /* @__PURE__ */
|
|
1607
|
-
description:
|
|
1608
|
-
|
|
1609
|
-
|
|
1763
|
+
return /* @__PURE__ */ E(w, { children: [
|
|
1764
|
+
/* @__PURE__ */ T("style", { children: In }),
|
|
1765
|
+
a ? null : /* @__PURE__ */ T(ee, { children: /* @__PURE__ */ E(ae, {
|
|
1766
|
+
description: On({
|
|
1767
|
+
draftVersion: be?.version ?? null,
|
|
1768
|
+
hasPublishedVersion: !!D?.template.currentVersionId,
|
|
1769
|
+
publishedVersion: D?.versions.find((e) => e.id === D.template.currentVersionId)?.version ?? null
|
|
1770
|
+
}),
|
|
1771
|
+
onBackClick: xn,
|
|
1772
|
+
title: D?.template.name ?? "流程設計器",
|
|
1610
1773
|
children: [
|
|
1611
|
-
|
|
1774
|
+
me ? /* @__PURE__ */ T(_, {
|
|
1612
1775
|
disabled: !r,
|
|
1613
|
-
onClick: () =>
|
|
1614
|
-
variant:
|
|
1776
|
+
onClick: () => un((e) => !e),
|
|
1777
|
+
variant: ln ? "base-primary" : "base-secondary",
|
|
1615
1778
|
children: r ? "AI 助理" : "AI 助理(未設定)"
|
|
1616
1779
|
}) : null,
|
|
1617
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ T(_, {
|
|
1618
1781
|
"aria-label": "儲存草稿",
|
|
1619
|
-
disabled:
|
|
1620
|
-
icon:
|
|
1782
|
+
disabled: wt || !!W || !!q,
|
|
1783
|
+
icon: fe,
|
|
1621
1784
|
iconType: "icon-only",
|
|
1622
|
-
onClick: () => void
|
|
1785
|
+
onClick: () => void ir(),
|
|
1623
1786
|
variant: "base-secondary",
|
|
1624
1787
|
children: "儲存草稿"
|
|
1625
1788
|
}),
|
|
1626
|
-
|
|
1627
|
-
disabled:
|
|
1628
|
-
icon:
|
|
1789
|
+
he ? /* @__PURE__ */ T(_, {
|
|
1790
|
+
disabled: St || !!W || !!q,
|
|
1791
|
+
icon: ce,
|
|
1629
1792
|
iconType: "leading",
|
|
1630
|
-
onClick:
|
|
1793
|
+
onClick: or,
|
|
1631
1794
|
variant: "base-secondary",
|
|
1632
1795
|
children: "試跑流程"
|
|
1633
1796
|
}) : null,
|
|
1634
|
-
/* @__PURE__ */
|
|
1635
|
-
disabled:
|
|
1636
|
-
icon:
|
|
1797
|
+
/* @__PURE__ */ T(_, {
|
|
1798
|
+
disabled: wt || !be && !jt && !hn || !!W || !!q || !!Zn,
|
|
1799
|
+
icon: oe,
|
|
1637
1800
|
iconType: "leading",
|
|
1638
|
-
onClick: () => void
|
|
1801
|
+
onClick: () => void ar(),
|
|
1639
1802
|
variant: "base-primary",
|
|
1640
|
-
children:
|
|
1803
|
+
children: bn
|
|
1641
1804
|
})
|
|
1642
1805
|
]
|
|
1643
1806
|
}) }),
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
-
style:
|
|
1807
|
+
/* @__PURE__ */ T(ne, { children: /* @__PURE__ */ T(te, { children: /* @__PURE__ */ E("div", {
|
|
1808
|
+
style: An,
|
|
1646
1809
|
children: [
|
|
1647
|
-
|
|
1810
|
+
bt ? /* @__PURE__ */ T(C, {
|
|
1648
1811
|
color: "text-error",
|
|
1649
1812
|
variant: "body",
|
|
1650
|
-
children:
|
|
1813
|
+
children: bt
|
|
1651
1814
|
}) : null,
|
|
1652
|
-
|
|
1815
|
+
xt && xt.nodeId === B?.id && B.type === "userTask" && (B.data.decisionPolicy?.type ?? "SINGLE") === xt.policyType ? /* @__PURE__ */ T(C, {
|
|
1653
1816
|
color: "text-warning",
|
|
1654
1817
|
variant: "body",
|
|
1655
|
-
children:
|
|
1818
|
+
children: xt.message
|
|
1656
1819
|
}) : null,
|
|
1657
|
-
|
|
1820
|
+
W ? /* @__PURE__ */ T(C, {
|
|
1658
1821
|
color: "text-error",
|
|
1659
1822
|
variant: "body",
|
|
1660
|
-
children:
|
|
1823
|
+
children: W
|
|
1661
1824
|
}) : null,
|
|
1662
|
-
|
|
1825
|
+
q ? /* @__PURE__ */ T(C, {
|
|
1663
1826
|
color: "text-error",
|
|
1664
1827
|
variant: "body",
|
|
1665
|
-
children:
|
|
1828
|
+
children: q
|
|
1666
1829
|
}) : null,
|
|
1667
|
-
!
|
|
1830
|
+
!W && Zn ? /* @__PURE__ */ E(C, {
|
|
1668
1831
|
color: "text-error",
|
|
1669
1832
|
variant: "body",
|
|
1670
|
-
children: ["發布前需修正:",
|
|
1833
|
+
children: ["發布前需修正:", Zn]
|
|
1671
1834
|
}) : null,
|
|
1672
|
-
a ? null : /* @__PURE__ */
|
|
1673
|
-
style:
|
|
1674
|
-
children: /* @__PURE__ */
|
|
1675
|
-
hintText:
|
|
1835
|
+
a ? null : /* @__PURE__ */ T("div", {
|
|
1836
|
+
style: U,
|
|
1837
|
+
children: /* @__PURE__ */ T(n, {
|
|
1838
|
+
hintText: K ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
|
|
1676
1839
|
label: "綁定表單版本",
|
|
1677
1840
|
name: "formDefinitionVersionId",
|
|
1678
1841
|
required: !0,
|
|
1679
|
-
children: /* @__PURE__ */
|
|
1680
|
-
style:
|
|
1681
|
-
children: [/* @__PURE__ */
|
|
1682
|
-
style:
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ E("div", {
|
|
1843
|
+
style: Gn,
|
|
1844
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1845
|
+
style: Kn,
|
|
1846
|
+
children: /* @__PURE__ */ T(g, {
|
|
1684
1847
|
asyncData: !0,
|
|
1685
|
-
disabled:
|
|
1848
|
+
disabled: St || K,
|
|
1686
1849
|
disabledOptionsFilter: !0,
|
|
1687
1850
|
emptyText: "沒有符合的已發布表單版本",
|
|
1688
|
-
isForceClearable: !!j && !
|
|
1689
|
-
loading:
|
|
1851
|
+
isForceClearable: !!j && !K,
|
|
1852
|
+
loading: Et,
|
|
1690
1853
|
loadingText: "搜尋表單版本中...",
|
|
1691
1854
|
mode: "single",
|
|
1692
1855
|
onChange: (e) => {
|
|
1693
|
-
|
|
1856
|
+
K || lt(e?.id ?? null);
|
|
1694
1857
|
},
|
|
1695
1858
|
onClear: () => {
|
|
1696
|
-
|
|
1859
|
+
K || lt(null);
|
|
1697
1860
|
},
|
|
1698
|
-
onSearch:
|
|
1861
|
+
onSearch: tr,
|
|
1699
1862
|
onVisibilityChange: (e) => {
|
|
1700
|
-
e && !
|
|
1863
|
+
e && !K && tr("");
|
|
1701
1864
|
},
|
|
1702
|
-
options: [...
|
|
1865
|
+
options: [...zn],
|
|
1703
1866
|
placeholder: "選擇已發布表單版本",
|
|
1704
1867
|
searchDebounceTime: 300,
|
|
1705
|
-
value:
|
|
1868
|
+
value: H
|
|
1706
1869
|
})
|
|
1707
|
-
}), /* @__PURE__ */
|
|
1708
|
-
disabled:
|
|
1870
|
+
}), /* @__PURE__ */ T(_, {
|
|
1871
|
+
disabled: St,
|
|
1709
1872
|
onClick: () => {
|
|
1710
|
-
|
|
1873
|
+
Ar();
|
|
1711
1874
|
},
|
|
1712
|
-
style:
|
|
1875
|
+
style: qn,
|
|
1713
1876
|
variant: "base-secondary",
|
|
1714
1877
|
children: "編輯表單"
|
|
1715
1878
|
})]
|
|
1716
1879
|
})
|
|
1717
1880
|
})
|
|
1718
1881
|
}),
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
style:
|
|
1721
|
-
children: [/* @__PURE__ */
|
|
1722
|
-
ref:
|
|
1723
|
-
style:
|
|
1724
|
-
children: /* @__PURE__ */
|
|
1725
|
-
connectionMode:
|
|
1726
|
-
edges:
|
|
1882
|
+
/* @__PURE__ */ E("div", {
|
|
1883
|
+
style: jn,
|
|
1884
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1885
|
+
ref: O,
|
|
1886
|
+
style: Mn,
|
|
1887
|
+
children: /* @__PURE__ */ E(Fe, {
|
|
1888
|
+
connectionMode: ke.Strict,
|
|
1889
|
+
edges: Ln,
|
|
1727
1890
|
fitView: !0,
|
|
1728
|
-
isValidConnection: (e) =>
|
|
1729
|
-
nodeTypes:
|
|
1730
|
-
nodes:
|
|
1891
|
+
isValidConnection: (e) => wi(e, A.nodes),
|
|
1892
|
+
nodeTypes: Or,
|
|
1893
|
+
nodes: Qn,
|
|
1731
1894
|
deleteKeyCode: null,
|
|
1732
1895
|
multiSelectionKeyCode: [
|
|
1733
1896
|
"Shift",
|
|
1734
1897
|
"Meta",
|
|
1735
1898
|
"Control"
|
|
1736
1899
|
],
|
|
1737
|
-
onConnect:
|
|
1738
|
-
onEdgeClick:
|
|
1900
|
+
onConnect: Mr,
|
|
1901
|
+
onEdgeClick: Nr,
|
|
1739
1902
|
onNodeClick: (e, t) => {
|
|
1740
1903
|
dt(t.id), ft([]);
|
|
1741
1904
|
},
|
|
1742
|
-
onNodesChange:
|
|
1905
|
+
onNodesChange: X,
|
|
1743
1906
|
onPaneClick: () => {
|
|
1744
1907
|
dt(null), ft([]);
|
|
1745
1908
|
},
|
|
1746
|
-
onViewportChange:
|
|
1747
|
-
viewport:
|
|
1909
|
+
onViewportChange: Re,
|
|
1910
|
+
viewport: Le,
|
|
1748
1911
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ T(Oe, {}),
|
|
1913
|
+
/* @__PURE__ */ T("style", { children: Bn }),
|
|
1914
|
+
/* @__PURE__ */ T(je, { children: Cn ? /* @__PURE__ */ T(Ae, {
|
|
1752
1915
|
"aria-label": "刪除選取項目",
|
|
1753
1916
|
className: "workflow-selection-delete-control",
|
|
1754
|
-
onClick:
|
|
1755
|
-
style:
|
|
1917
|
+
onClick: wn,
|
|
1918
|
+
style: Nn,
|
|
1756
1919
|
title: "刪除選取項目",
|
|
1757
|
-
children: /* @__PURE__ */
|
|
1758
|
-
style:
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1920
|
+
children: /* @__PURE__ */ T("span", {
|
|
1921
|
+
style: Pn,
|
|
1922
|
+
children: /* @__PURE__ */ T(v, {
|
|
1760
1923
|
color: "error",
|
|
1761
|
-
icon:
|
|
1924
|
+
icon: pe,
|
|
1762
1925
|
size: 16
|
|
1763
1926
|
})
|
|
1764
1927
|
})
|
|
1765
1928
|
}) : null }),
|
|
1766
|
-
/* @__PURE__ */
|
|
1767
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ T(jr, { onApplyAutoLayout: Di }),
|
|
1930
|
+
/* @__PURE__ */ T(Ne, {})
|
|
1768
1931
|
]
|
|
1769
1932
|
})
|
|
1770
|
-
}), /* @__PURE__ */
|
|
1771
|
-
className:
|
|
1772
|
-
style:
|
|
1933
|
+
}), /* @__PURE__ */ E("div", {
|
|
1934
|
+
className: Fn,
|
|
1935
|
+
style: Vn,
|
|
1773
1936
|
children: [
|
|
1774
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ T(C, {
|
|
1775
1938
|
component: "h2",
|
|
1776
1939
|
variant: "h3",
|
|
1777
1940
|
children: "流程工具"
|
|
1778
1941
|
}),
|
|
1779
|
-
a &&
|
|
1780
|
-
style:
|
|
1781
|
-
children: [/* @__PURE__ */
|
|
1942
|
+
a && me ? /* @__PURE__ */ E("div", {
|
|
1943
|
+
style: Jn,
|
|
1944
|
+
children: [/* @__PURE__ */ T(C, {
|
|
1782
1945
|
color: "text-neutral",
|
|
1783
1946
|
variant: "caption",
|
|
1784
1947
|
children: "AI 協助"
|
|
1785
|
-
}), /* @__PURE__ */
|
|
1786
|
-
style:
|
|
1787
|
-
children: /* @__PURE__ */
|
|
1948
|
+
}), /* @__PURE__ */ T("div", {
|
|
1949
|
+
style: Wn,
|
|
1950
|
+
children: /* @__PURE__ */ T(_, {
|
|
1788
1951
|
disabled: !r,
|
|
1789
|
-
onClick: () =>
|
|
1952
|
+
onClick: () => un((e) => !e),
|
|
1790
1953
|
size: "sub",
|
|
1791
|
-
variant:
|
|
1954
|
+
variant: ln ? "base-primary" : "base-secondary",
|
|
1792
1955
|
children: r ? "AI 助理" : "AI 助理(未設定)"
|
|
1793
1956
|
})
|
|
1794
1957
|
})]
|
|
1795
1958
|
}) : null,
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
style:
|
|
1798
|
-
children: [/* @__PURE__ */
|
|
1959
|
+
/* @__PURE__ */ E("div", {
|
|
1960
|
+
style: Jn,
|
|
1961
|
+
children: [/* @__PURE__ */ T(C, {
|
|
1799
1962
|
color: "text-neutral",
|
|
1800
1963
|
variant: "caption",
|
|
1801
1964
|
children: "動作節點"
|
|
1802
|
-
}), /* @__PURE__ */
|
|
1803
|
-
style:
|
|
1804
|
-
children:
|
|
1965
|
+
}), /* @__PURE__ */ T("div", {
|
|
1966
|
+
style: Wn,
|
|
1967
|
+
children: cr.map((e) => /* @__PURE__ */ T(_, {
|
|
1805
1968
|
icon: e.icon,
|
|
1806
1969
|
iconType: "leading",
|
|
1807
|
-
onClick: () =>
|
|
1970
|
+
onClick: () => Fr(e.type),
|
|
1808
1971
|
size: "sub",
|
|
1809
1972
|
variant: "base-secondary",
|
|
1810
1973
|
children: e.label
|
|
1811
1974
|
}, e.type))
|
|
1812
1975
|
})]
|
|
1813
1976
|
}),
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
style:
|
|
1816
|
-
children: [/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ E("div", {
|
|
1978
|
+
style: Jn,
|
|
1979
|
+
children: [/* @__PURE__ */ T(C, {
|
|
1817
1980
|
color: "text-neutral",
|
|
1818
1981
|
variant: "caption",
|
|
1819
1982
|
children: "流程控制"
|
|
1820
|
-
}), /* @__PURE__ */
|
|
1821
|
-
style:
|
|
1822
|
-
children:
|
|
1983
|
+
}), /* @__PURE__ */ T("div", {
|
|
1984
|
+
style: Wn,
|
|
1985
|
+
children: lr.map((e) => /* @__PURE__ */ T(_, {
|
|
1823
1986
|
icon: e.icon,
|
|
1824
1987
|
iconType: "leading",
|
|
1825
|
-
onClick: () =>
|
|
1988
|
+
onClick: () => Fr(e.type),
|
|
1826
1989
|
size: "sub",
|
|
1827
1990
|
variant: "base-secondary",
|
|
1828
1991
|
children: e.label
|
|
1829
1992
|
}, e.type))
|
|
1830
1993
|
})]
|
|
1831
1994
|
}),
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1995
|
+
kn.length > 1 ? Ki(kn) : null,
|
|
1996
|
+
kn.length === 1 && Dn ? qi(Dn) : null,
|
|
1997
|
+
kn.length === 0 && B ? ki(B) : null
|
|
1835
1998
|
]
|
|
1836
1999
|
})]
|
|
1837
2000
|
})
|
|
1838
2001
|
]
|
|
1839
2002
|
}) }) }),
|
|
1840
|
-
|
|
1841
|
-
!a &&
|
|
1842
|
-
|
|
2003
|
+
Ji(Tn),
|
|
2004
|
+
!a && he ? Oi() : null,
|
|
2005
|
+
me && r ? /* @__PURE__ */ T(Lt, {
|
|
1843
2006
|
controller: k,
|
|
1844
|
-
onClose: () =>
|
|
1845
|
-
open:
|
|
2007
|
+
onClose: () => un(!1),
|
|
2008
|
+
open: ln
|
|
1846
2009
|
}) : null,
|
|
1847
|
-
a ? null : /* @__PURE__ */
|
|
2010
|
+
a ? null : /* @__PURE__ */ T(ie, {
|
|
1848
2011
|
headerTitle: "編輯表單",
|
|
1849
2012
|
isHeaderDisplay: !0,
|
|
1850
|
-
onClose: () =>
|
|
1851
|
-
open:
|
|
2013
|
+
onClose: () => fn(!1),
|
|
2014
|
+
open: dn,
|
|
1852
2015
|
size: "wide",
|
|
1853
|
-
children: /* @__PURE__ */
|
|
1854
|
-
style:
|
|
1855
|
-
children: [/* @__PURE__ */
|
|
1856
|
-
style:
|
|
1857
|
-
children:
|
|
2016
|
+
children: /* @__PURE__ */ E("div", {
|
|
2017
|
+
style: Cr,
|
|
2018
|
+
children: [/* @__PURE__ */ T("div", {
|
|
2019
|
+
style: wr,
|
|
2020
|
+
children: vn ? /* @__PURE__ */ T(C, {
|
|
1858
2021
|
color: "text-neutral",
|
|
1859
2022
|
variant: "body",
|
|
1860
2023
|
children: "載入中…"
|
|
1861
|
-
}) : /* @__PURE__ */
|
|
2024
|
+
}) : /* @__PURE__ */ T(l, {
|
|
1862
2025
|
onChange: (e) => {
|
|
1863
|
-
|
|
2026
|
+
pn(e);
|
|
1864
2027
|
},
|
|
1865
2028
|
value: z ?? {
|
|
1866
|
-
schema:
|
|
1867
|
-
uiSchema:
|
|
2029
|
+
schema: Er,
|
|
2030
|
+
uiSchema: Dr
|
|
1868
2031
|
}
|
|
1869
2032
|
})
|
|
1870
|
-
}), /* @__PURE__ */
|
|
1871
|
-
style:
|
|
1872
|
-
children: [/* @__PURE__ */
|
|
1873
|
-
disabled:
|
|
2033
|
+
}), /* @__PURE__ */ E("div", {
|
|
2034
|
+
style: Tr,
|
|
2035
|
+
children: [/* @__PURE__ */ T(_, {
|
|
2036
|
+
disabled: vn,
|
|
1874
2037
|
onClick: () => {
|
|
1875
|
-
z !== null && (
|
|
2038
|
+
z !== null && (gn(!0), k.replaceState((e) => ({
|
|
1876
2039
|
...e,
|
|
1877
2040
|
formSchema: z.schema
|
|
1878
|
-
}))),
|
|
2041
|
+
}))), fn(!1);
|
|
1879
2042
|
},
|
|
1880
2043
|
variant: "base-primary",
|
|
1881
2044
|
children: "套用"
|
|
1882
|
-
}), /* @__PURE__ */
|
|
1883
|
-
onClick: () =>
|
|
2045
|
+
}), /* @__PURE__ */ T(_, {
|
|
2046
|
+
onClick: () => fn(!1),
|
|
1884
2047
|
variant: "base-secondary",
|
|
1885
2048
|
children: "取消"
|
|
1886
2049
|
})]
|
|
@@ -1888,179 +2051,185 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
1888
2051
|
})
|
|
1889
2052
|
})
|
|
1890
2053
|
] });
|
|
1891
|
-
function
|
|
1892
|
-
|
|
2054
|
+
function Oi() {
|
|
2055
|
+
let e = {
|
|
2056
|
+
formFields: G?.fields ?? [],
|
|
2057
|
+
memberName: (e) => I.find((t) => t.memberId === e && !t.unresolved)?.displayName ?? null,
|
|
2058
|
+
orgUnits: L,
|
|
2059
|
+
positions: R
|
|
2060
|
+
};
|
|
2061
|
+
return /* @__PURE__ */ T(b, {
|
|
1893
2062
|
cancelText: "關閉",
|
|
1894
2063
|
confirmText: "執行試跑",
|
|
1895
|
-
loading:
|
|
2064
|
+
loading: qt,
|
|
1896
2065
|
modalType: "standard",
|
|
1897
|
-
onCancel:
|
|
1898
|
-
onClose:
|
|
1899
|
-
onConfirm: () => void
|
|
1900
|
-
open:
|
|
2066
|
+
onCancel: vr,
|
|
2067
|
+
onClose: vr,
|
|
2068
|
+
onConfirm: () => void yr(),
|
|
2069
|
+
open: Gt,
|
|
1901
2070
|
showModalFooter: !0,
|
|
1902
2071
|
showModalHeader: !0,
|
|
1903
2072
|
size: "wide",
|
|
1904
|
-
supportingText: `使用 ${
|
|
2073
|
+
supportingText: `使用 ${Sr} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
|
|
1905
2074
|
title: "試跑流程",
|
|
1906
|
-
children: /* @__PURE__ */
|
|
1907
|
-
style:
|
|
2075
|
+
children: /* @__PURE__ */ E("div", {
|
|
2076
|
+
style: U,
|
|
1908
2077
|
children: [
|
|
1909
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ T(n, {
|
|
1910
2079
|
label: "表單資料 JSON",
|
|
1911
2080
|
name: "dryRunFormDataJson",
|
|
1912
2081
|
required: !0,
|
|
1913
|
-
children: /* @__PURE__ */
|
|
1914
|
-
onChange: (e) =>
|
|
2082
|
+
children: /* @__PURE__ */ T(re, {
|
|
2083
|
+
onChange: (e) => Zt(e.target.value),
|
|
1915
2084
|
resize: "vertical",
|
|
1916
2085
|
rows: 8,
|
|
1917
|
-
value:
|
|
2086
|
+
value: Xt
|
|
1918
2087
|
})
|
|
1919
2088
|
}),
|
|
1920
|
-
|
|
2089
|
+
tn ? /* @__PURE__ */ T(C, {
|
|
1921
2090
|
color: "text-error",
|
|
1922
2091
|
variant: "body",
|
|
1923
|
-
children:
|
|
2092
|
+
children: tn
|
|
1924
2093
|
}) : null,
|
|
1925
|
-
|
|
1926
|
-
style:
|
|
2094
|
+
$t ? /* @__PURE__ */ E("div", {
|
|
2095
|
+
style: Hn,
|
|
1927
2096
|
children: [
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
color:
|
|
2097
|
+
/* @__PURE__ */ T(C, {
|
|
2098
|
+
color: $t.valid ? "text-success" : "text-error",
|
|
1930
2099
|
variant: "label-primary-highlight",
|
|
1931
|
-
children:
|
|
2100
|
+
children: $t.valid ? "試跑通過" : "試跑失敗"
|
|
1932
2101
|
}),
|
|
1933
|
-
|
|
2102
|
+
$t.errors.map((e) => /* @__PURE__ */ T(C, {
|
|
1934
2103
|
color: "text-error",
|
|
1935
2104
|
variant: "body",
|
|
1936
2105
|
children: e
|
|
1937
2106
|
}, e)),
|
|
1938
|
-
|
|
1939
|
-
style:
|
|
2107
|
+
$t.steps.map((t) => /* @__PURE__ */ E("div", {
|
|
2108
|
+
style: Un,
|
|
1940
2109
|
children: [
|
|
1941
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ E(C, {
|
|
1942
2111
|
variant: "label-primary-highlight",
|
|
1943
2112
|
children: [
|
|
1944
|
-
|
|
2113
|
+
t.nodeLabel,
|
|
1945
2114
|
" · ",
|
|
1946
|
-
|
|
2115
|
+
Pi(t.status)
|
|
1947
2116
|
]
|
|
1948
2117
|
}),
|
|
1949
|
-
/* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ E(C, {
|
|
1950
2119
|
color: "text-neutral",
|
|
1951
2120
|
variant: "caption",
|
|
1952
2121
|
children: [
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
2122
|
+
Fi(t.nodeType),
|
|
2123
|
+
t.assigneeMemberId ? ` · 處理者:${_n(t.assigneeMemberId, e)}` : "",
|
|
2124
|
+
t.edgeLabel ? ` · 來源線段:${t.edgeLabel}` : ""
|
|
1956
2125
|
]
|
|
1957
2126
|
}),
|
|
1958
|
-
|
|
2127
|
+
t.edgeReason ? /* @__PURE__ */ T(C, {
|
|
1959
2128
|
color: "text-neutral",
|
|
1960
2129
|
variant: "caption",
|
|
1961
|
-
children:
|
|
2130
|
+
children: t.edgeReason
|
|
1962
2131
|
}) : null,
|
|
1963
|
-
|
|
2132
|
+
t.entryCondition ? /* @__PURE__ */ E(C, {
|
|
1964
2133
|
color: "text-neutral",
|
|
1965
2134
|
variant: "caption",
|
|
1966
2135
|
children: [
|
|
1967
2136
|
"進入條件:",
|
|
1968
|
-
|
|
2137
|
+
t.entryConditionMatched ? "符合" : "不符合",
|
|
1969
2138
|
" ·",
|
|
1970
2139
|
" ",
|
|
1971
|
-
|
|
2140
|
+
t.entryCondition
|
|
1972
2141
|
]
|
|
1973
2142
|
}) : null,
|
|
1974
|
-
/* @__PURE__ */
|
|
2143
|
+
/* @__PURE__ */ T(C, {
|
|
1975
2144
|
color: "text-neutral",
|
|
1976
2145
|
variant: "body",
|
|
1977
|
-
children:
|
|
2146
|
+
children: t.message
|
|
1978
2147
|
}),
|
|
1979
|
-
(
|
|
2148
|
+
(t.status === "SKIPPED" ? [] : ia(A, t.nodeId, rn)).map((e) => /* @__PURE__ */ E(C, {
|
|
1980
2149
|
color: "text-neutral",
|
|
1981
2150
|
variant: "caption",
|
|
1982
2151
|
children: ["將送出 Webhook:", e.label]
|
|
1983
2152
|
}, e.key))
|
|
1984
2153
|
]
|
|
1985
|
-
},
|
|
2154
|
+
}, t.id))
|
|
1986
2155
|
]
|
|
1987
2156
|
}) : null
|
|
1988
2157
|
]
|
|
1989
2158
|
})
|
|
1990
2159
|
});
|
|
1991
2160
|
}
|
|
1992
|
-
function
|
|
1993
|
-
return /* @__PURE__ */
|
|
1994
|
-
style:
|
|
2161
|
+
function ki(e) {
|
|
2162
|
+
return /* @__PURE__ */ E("div", {
|
|
2163
|
+
style: U,
|
|
1995
2164
|
children: [
|
|
1996
|
-
/* @__PURE__ */
|
|
2165
|
+
/* @__PURE__ */ T(C, {
|
|
1997
2166
|
component: "h2",
|
|
1998
2167
|
variant: "h3",
|
|
1999
2168
|
children: "節點屬性"
|
|
2000
2169
|
}),
|
|
2001
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ E(C, {
|
|
2002
2171
|
color: "text-neutral",
|
|
2003
2172
|
variant: "body",
|
|
2004
2173
|
children: [
|
|
2005
|
-
|
|
2174
|
+
sr[e.type],
|
|
2006
2175
|
" · ",
|
|
2007
2176
|
e.id
|
|
2008
2177
|
]
|
|
2009
2178
|
}),
|
|
2010
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ T(n, {
|
|
2011
2180
|
label: "顯示名稱",
|
|
2012
2181
|
name: "nodeLabel",
|
|
2013
2182
|
required: !0,
|
|
2014
|
-
children: /* @__PURE__ */
|
|
2015
|
-
onChange: (e) =>
|
|
2183
|
+
children: /* @__PURE__ */ T(y, {
|
|
2184
|
+
onChange: (e) => Lr(e.target.value),
|
|
2016
2185
|
value: e.data.label,
|
|
2017
2186
|
variant: "base"
|
|
2018
2187
|
})
|
|
2019
2188
|
}),
|
|
2020
|
-
e.type === "startEvent" ?
|
|
2021
|
-
e.type === "startEvent" ? null :
|
|
2022
|
-
e.type === "userTask" ?
|
|
2023
|
-
e.type === "serviceTask" ?
|
|
2189
|
+
e.type === "startEvent" ? Ni() : null,
|
|
2190
|
+
e.type === "startEvent" ? null : Hi(e),
|
|
2191
|
+
e.type === "userTask" ? Ui(e) : null,
|
|
2192
|
+
e.type === "serviceTask" ? Gi(e) : null
|
|
2024
2193
|
]
|
|
2025
2194
|
});
|
|
2026
2195
|
}
|
|
2027
|
-
function
|
|
2028
|
-
let e =
|
|
2029
|
-
includeDescendants: !!
|
|
2030
|
-
memberships:
|
|
2031
|
-
orgUnitId:
|
|
2196
|
+
function Ni() {
|
|
2197
|
+
let e = V.mode === "CUSTOM" ? [...br, xr] : [...br], t = V.mode === "ORG_UNIT" || V.mode === "ORG_UNIT_POSITION" ? Bi(L, V.orgUnitId ?? "") : null, r = V.mode === "ORG_UNIT_POSITION" ? Vi(R, V.positionId ?? "") : null, a = V.mode === "ORG_UNIT_POSITION" ? Yi({
|
|
2198
|
+
includeDescendants: !!V.includeDescendants,
|
|
2199
|
+
memberships: Ut,
|
|
2200
|
+
orgUnitId: V.orgUnitId ?? "",
|
|
2032
2201
|
orgUnits: L,
|
|
2033
2202
|
positions: R
|
|
2034
2203
|
}) : [];
|
|
2035
|
-
return /* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2037
|
-
hintText:
|
|
2204
|
+
return /* @__PURE__ */ E(w, { children: [
|
|
2205
|
+
/* @__PURE__ */ T(n, {
|
|
2206
|
+
hintText: V.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
|
|
2038
2207
|
label: "發起權限",
|
|
2039
2208
|
name: "initiatorPolicyMode",
|
|
2040
2209
|
required: !0,
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2210
|
+
children: /* @__PURE__ */ T(x, {
|
|
2042
2211
|
clearable: !1,
|
|
2043
2212
|
onChange: (e) => {
|
|
2044
2213
|
if (e?.id === "CUSTOM") {
|
|
2045
|
-
|
|
2214
|
+
Ee(null), Pe(null);
|
|
2046
2215
|
return;
|
|
2047
2216
|
}
|
|
2048
|
-
let t =
|
|
2049
|
-
|
|
2217
|
+
let t = gi(e?.id ?? null), n = Ci(t);
|
|
2218
|
+
Ee(t === "ALL" ? null : t), Pe(t === "ALL" ? null : n), ut(xi(n, L));
|
|
2050
2219
|
},
|
|
2051
2220
|
options: e,
|
|
2052
2221
|
placeholder: "選擇誰可以發起",
|
|
2053
|
-
value:
|
|
2222
|
+
value: $(e, V.mode)
|
|
2054
2223
|
})
|
|
2055
2224
|
}),
|
|
2056
|
-
|
|
2225
|
+
V.mode === "ORG_UNIT" || V.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
|
|
2057
2226
|
label: "組織",
|
|
2058
2227
|
name: "initiatorOrgUnitId",
|
|
2059
2228
|
required: !0,
|
|
2060
|
-
children: /* @__PURE__ */
|
|
2229
|
+
children: /* @__PURE__ */ T(i, {
|
|
2061
2230
|
name: "initiatorOrgUnitId",
|
|
2062
|
-
onChange: (e) =>
|
|
2063
|
-
...
|
|
2231
|
+
onChange: (e) => li({
|
|
2232
|
+
...V,
|
|
2064
2233
|
orgUnitId: e?.id ?? "",
|
|
2065
2234
|
positionId: "",
|
|
2066
2235
|
value: e?.id ?? ""
|
|
@@ -2070,78 +2239,78 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2070
2239
|
value: t
|
|
2071
2240
|
})
|
|
2072
2241
|
}) : null,
|
|
2073
|
-
|
|
2242
|
+
V.mode === "ORG_UNIT" || V.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
|
|
2074
2243
|
label: "包含下層",
|
|
2075
2244
|
name: "initiatorIncludeDescendants",
|
|
2076
|
-
children: /* @__PURE__ */
|
|
2077
|
-
checked: !!
|
|
2078
|
-
onChange: (e) =>
|
|
2079
|
-
...
|
|
2245
|
+
children: /* @__PURE__ */ T(S, {
|
|
2246
|
+
checked: !!V.includeDescendants,
|
|
2247
|
+
onChange: (e) => li({
|
|
2248
|
+
...V,
|
|
2080
2249
|
includeDescendants: e.target.checked,
|
|
2081
|
-
...
|
|
2250
|
+
...V.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
|
|
2082
2251
|
})
|
|
2083
2252
|
})
|
|
2084
2253
|
}) : null,
|
|
2085
|
-
|
|
2254
|
+
V.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
|
|
2086
2255
|
label: "職位",
|
|
2087
2256
|
name: "initiatorPositionId",
|
|
2088
2257
|
required: !0,
|
|
2089
|
-
children: /* @__PURE__ */
|
|
2090
|
-
disabled: !
|
|
2258
|
+
children: /* @__PURE__ */ T(o, {
|
|
2259
|
+
disabled: !V.orgUnitId?.trim(),
|
|
2091
2260
|
name: "initiatorPositionId",
|
|
2092
|
-
onChange: (e) =>
|
|
2093
|
-
...
|
|
2261
|
+
onChange: (e) => li({
|
|
2262
|
+
...V,
|
|
2094
2263
|
positionId: e?.id ?? ""
|
|
2095
2264
|
}),
|
|
2096
|
-
placeholder:
|
|
2265
|
+
placeholder: V.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
|
|
2097
2266
|
positions: a,
|
|
2098
2267
|
value: r
|
|
2099
2268
|
})
|
|
2100
2269
|
}) : null
|
|
2101
2270
|
] });
|
|
2102
2271
|
}
|
|
2103
|
-
function
|
|
2272
|
+
function Hi(e) {
|
|
2104
2273
|
let t = A.edges.filter((t) => t.target === e.id).length, r = t < 2, i = r ? "AND" : e.data.triggerMode ?? "AND";
|
|
2105
|
-
return /* @__PURE__ */
|
|
2274
|
+
return /* @__PURE__ */ T(n, {
|
|
2106
2275
|
hintText: r ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
|
|
2107
2276
|
label: "前置條件",
|
|
2108
2277
|
name: "triggerMode",
|
|
2109
2278
|
required: !0,
|
|
2110
|
-
children: /* @__PURE__ */
|
|
2279
|
+
children: /* @__PURE__ */ T(x, {
|
|
2111
2280
|
clearable: !1,
|
|
2112
|
-
onChange: (e) => r ? void 0 :
|
|
2113
|
-
options: [...
|
|
2281
|
+
onChange: (e) => r ? void 0 : _i(Yr(e?.id ?? null)),
|
|
2282
|
+
options: [...ur],
|
|
2114
2283
|
readOnly: r,
|
|
2115
|
-
value:
|
|
2284
|
+
value: $(ur, i)
|
|
2116
2285
|
})
|
|
2117
2286
|
});
|
|
2118
2287
|
}
|
|
2119
|
-
function
|
|
2120
|
-
let t = e.data.approverResolver, r =
|
|
2288
|
+
function Ui(e) {
|
|
2289
|
+
let t = e.data.approverResolver, r = ui(t.type), a = t.type === "DIRECT" ? t.memberIds.map((e) => zi(I, e)) : [], s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Bi(L, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Vi(R, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? Yi({
|
|
2121
2290
|
includeDescendants: !!t.includeDescendants,
|
|
2122
|
-
memberships:
|
|
2291
|
+
memberships: Ut,
|
|
2123
2292
|
orgUnitId: t.orgUnitId,
|
|
2124
2293
|
orgUnits: L,
|
|
2125
2294
|
positions: R
|
|
2126
|
-
}) : [], u = t.type === "ORG_MANAGER" ?
|
|
2127
|
-
return /* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2295
|
+
}) : [], u = t.type === "DYNAMIC_FORM" ? En(G, t.formPath) : null, d = t.type === "ORG_MANAGER" ? mi(t.levelsUp) : Y[0], f = t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, p = t.type === "ORG_MANAGER_CHAIN" ? zt(R, t.minPositionLevel) : [], m = f.type === "DIRECT" && f.memberId ? zi(I, f.memberId) : null, h = e.data.returnBehavior.resubmitStrategy ?? "RESTART", _ = e.data.sla ?? null, v = e.data.excludeInitiator ?? null, b = _ ? ht(_.duration) : null, ee = b?.unit ?? "DAY", te = ii(_?.warningAt ?? null), ne = mi(_?.escalateLevelsUp ?? 1), re = Zr(e.data.decisionPolicy), C = $r(e.data.decisionPolicy);
|
|
2296
|
+
return /* @__PURE__ */ E(w, { children: [
|
|
2297
|
+
/* @__PURE__ */ T(n, {
|
|
2129
2298
|
label: "簽核來源",
|
|
2130
2299
|
name: "approverResolverType",
|
|
2131
2300
|
required: !0,
|
|
2132
|
-
children: /* @__PURE__ */
|
|
2301
|
+
children: /* @__PURE__ */ T(x, {
|
|
2133
2302
|
clearable: !1,
|
|
2134
|
-
onChange: (e) => Z(
|
|
2135
|
-
options: [...
|
|
2136
|
-
value:
|
|
2303
|
+
onChange: (e) => Z(di(e?.id ?? null, R)),
|
|
2304
|
+
options: [...pr],
|
|
2305
|
+
value: $(pr, r)
|
|
2137
2306
|
})
|
|
2138
2307
|
}),
|
|
2139
|
-
t.type === "DIRECT" ? /* @__PURE__ */
|
|
2140
|
-
hintText:
|
|
2308
|
+
t.type === "DIRECT" ? /* @__PURE__ */ T(n, {
|
|
2309
|
+
hintText: _t(e.data.decisionPolicy),
|
|
2141
2310
|
label: "簽核者",
|
|
2142
2311
|
name: "memberId",
|
|
2143
2312
|
required: !0,
|
|
2144
|
-
children: /* @__PURE__ */
|
|
2313
|
+
children: /* @__PURE__ */ T(g, {
|
|
2145
2314
|
asyncData: !0,
|
|
2146
2315
|
disabledOptionsFilter: !0,
|
|
2147
2316
|
emptyText: "沒有符合的成員",
|
|
@@ -2151,45 +2320,76 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2151
2320
|
name: "workflow-approver-search",
|
|
2152
2321
|
spellCheck: !1
|
|
2153
2322
|
},
|
|
2154
|
-
loading:
|
|
2323
|
+
loading: Mt,
|
|
2155
2324
|
loadingText: "搜尋成員中...",
|
|
2156
2325
|
mode: "multiple",
|
|
2157
2326
|
onChange: (e) => Z({
|
|
2158
2327
|
memberIds: e.map((e) => e.id),
|
|
2159
2328
|
type: "DIRECT"
|
|
2160
2329
|
}),
|
|
2161
|
-
onSearch:
|
|
2330
|
+
onSearch: J,
|
|
2162
2331
|
onVisibilityChange: (e) => {
|
|
2163
|
-
e && (
|
|
2332
|
+
e && (It([]), J(""));
|
|
2164
2333
|
},
|
|
2165
|
-
options: [...
|
|
2334
|
+
options: [...Zi(a, Ft)],
|
|
2166
2335
|
placeholder: "搜尋姓名或信箱",
|
|
2167
2336
|
searchDebounceTime: 300,
|
|
2168
2337
|
value: a
|
|
2169
2338
|
})
|
|
2170
2339
|
}) : null,
|
|
2171
|
-
t.type === "
|
|
2340
|
+
t.type === "DYNAMIC_FORM" ? /* @__PURE__ */ T(n, {
|
|
2341
|
+
hintText: u?.problem ?? "簽核人取自申請人送出表單時在該欄位選的人員。",
|
|
2342
|
+
label: "表單欄位",
|
|
2343
|
+
name: "approverFormPath",
|
|
2344
|
+
required: !0,
|
|
2345
|
+
children: /* @__PURE__ */ T(x, {
|
|
2346
|
+
clearable: !1,
|
|
2347
|
+
onChange: (e) => Z({
|
|
2348
|
+
formPath: e?.id ?? "",
|
|
2349
|
+
type: "DYNAMIC_FORM"
|
|
2350
|
+
}),
|
|
2351
|
+
options: [...u?.options ?? []],
|
|
2352
|
+
placeholder: "選擇人員選擇欄位",
|
|
2353
|
+
value: u?.selected ?? void 0
|
|
2354
|
+
})
|
|
2355
|
+
}) : null,
|
|
2356
|
+
t.type === "ORG_MANAGER" ? /* @__PURE__ */ T(n, {
|
|
2172
2357
|
hintText: "依發起人的有效會員歸屬與主管解析規則決定簽核人。",
|
|
2173
2358
|
label: "主管層級",
|
|
2174
2359
|
name: "managerLevelsUp",
|
|
2175
2360
|
required: !0,
|
|
2176
|
-
children: /* @__PURE__ */
|
|
2361
|
+
children: /* @__PURE__ */ T(x, {
|
|
2177
2362
|
clearable: !1,
|
|
2178
2363
|
onChange: (e) => Z({
|
|
2179
2364
|
baseFromInitiator: !0,
|
|
2180
|
-
levelsUp:
|
|
2365
|
+
levelsUp: hi(e?.id ?? null).value,
|
|
2181
2366
|
type: "ORG_MANAGER"
|
|
2182
2367
|
}),
|
|
2183
|
-
options: [...
|
|
2184
|
-
value:
|
|
2368
|
+
options: [...Y],
|
|
2369
|
+
value: d
|
|
2370
|
+
})
|
|
2371
|
+
}) : null,
|
|
2372
|
+
t.type === "ORG_MANAGER_CHAIN" ? /* @__PURE__ */ T(n, {
|
|
2373
|
+
hintText: "從發起人的直屬主管開始往上,職等比前一位高的主管依序加入,簽到職等達此值的主管為止。沒有職位的主管會略過。",
|
|
2374
|
+
label: "簽到職等",
|
|
2375
|
+
name: "minPositionLevel",
|
|
2376
|
+
required: !0,
|
|
2377
|
+
children: /* @__PURE__ */ T(x, {
|
|
2378
|
+
clearable: !1,
|
|
2379
|
+
onChange: (e) => Z({
|
|
2380
|
+
...t,
|
|
2381
|
+
minPositionLevel: Number(e?.id ?? t.minPositionLevel)
|
|
2382
|
+
}),
|
|
2383
|
+
options: [...p],
|
|
2384
|
+
value: $(p, String(t.minPositionLevel))
|
|
2185
2385
|
})
|
|
2186
2386
|
}) : null,
|
|
2187
|
-
t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */
|
|
2387
|
+
t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
|
|
2188
2388
|
hintText: t.type === "ORG_UNIT_MANAGER" ? "依指定組織或其上層的主管解析規則決定簽核人。" : "依指定組織目前有效會員歸屬建立候選簽核人。",
|
|
2189
2389
|
label: "組織",
|
|
2190
2390
|
name: "orgUnitId",
|
|
2191
2391
|
required: !0,
|
|
2192
|
-
children: /* @__PURE__ */
|
|
2392
|
+
children: /* @__PURE__ */ T(i, {
|
|
2193
2393
|
name: "orgUnitId",
|
|
2194
2394
|
onChange: (e) => Z(t.type === "ORG_UNIT_MEMBER" ? {
|
|
2195
2395
|
includeDescendants: t.includeDescendants,
|
|
@@ -2210,12 +2410,12 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2210
2410
|
value: s
|
|
2211
2411
|
})
|
|
2212
2412
|
}) : null,
|
|
2213
|
-
t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2413
|
+
t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ E(w, { children: [
|
|
2414
|
+
t.type === "ORG_MANAGER_CHAIN" ? null : /* @__PURE__ */ T(n, {
|
|
2215
2415
|
hintText: "開啟後只取離該員最近一層的主管規則;掛在上層單位、涵蓋範圍較大的規則不會再一併加入簽核人。",
|
|
2216
2416
|
label: "只取最近一層主管",
|
|
2217
2417
|
name: "preferClosestOrgUnit",
|
|
2218
|
-
children: /* @__PURE__ */
|
|
2418
|
+
children: /* @__PURE__ */ T(S, {
|
|
2219
2419
|
checked: !!t.preferClosestOrgUnit,
|
|
2220
2420
|
inputProps: {
|
|
2221
2421
|
id: "preferClosestOrgUnit",
|
|
@@ -2227,26 +2427,26 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2227
2427
|
})
|
|
2228
2428
|
})
|
|
2229
2429
|
}),
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
hintText: "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
|
|
2430
|
+
/* @__PURE__ */ T(n, {
|
|
2431
|
+
hintText: t.type === "ORG_MANAGER_CHAIN" ? "預設會停止流程並提示;若設定固定人,主管鏈在達到簽核職等前就結束時,會再加上該會員作為最後一關。" : "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
|
|
2232
2432
|
label: "無主管時",
|
|
2233
2433
|
name: "approverFallbackMode",
|
|
2234
2434
|
required: !0,
|
|
2235
|
-
children: /* @__PURE__ */
|
|
2435
|
+
children: /* @__PURE__ */ T(x, {
|
|
2236
2436
|
clearable: !1,
|
|
2237
|
-
onChange: (e) => Z(
|
|
2437
|
+
onChange: (e) => Z(pi(t, fi(e?.id ?? null) === "DIRECT" ? {
|
|
2238
2438
|
memberId: "",
|
|
2239
2439
|
type: "DIRECT"
|
|
2240
2440
|
} : { type: "NONE" })),
|
|
2241
|
-
options: [...
|
|
2242
|
-
value:
|
|
2441
|
+
options: [...hr],
|
|
2442
|
+
value: $(hr, f.type)
|
|
2243
2443
|
})
|
|
2244
2444
|
}),
|
|
2245
|
-
|
|
2445
|
+
f.type === "DIRECT" ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(n, {
|
|
2246
2446
|
label: "改派人員",
|
|
2247
2447
|
name: "approverFallbackMemberId",
|
|
2248
2448
|
required: !0,
|
|
2249
|
-
children: /* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ T(g, {
|
|
2250
2450
|
asyncData: !0,
|
|
2251
2451
|
disabledOptionsFilter: !0,
|
|
2252
2452
|
emptyText: "沒有符合的成員",
|
|
@@ -2256,45 +2456,45 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2256
2456
|
name: "workflow-approver-fallback-search",
|
|
2257
2457
|
spellCheck: !1
|
|
2258
2458
|
},
|
|
2259
|
-
loading:
|
|
2459
|
+
loading: Mt,
|
|
2260
2460
|
loadingText: "搜尋成員中...",
|
|
2261
2461
|
mode: "single",
|
|
2262
|
-
onChange: (e) => Z(
|
|
2263
|
-
allowInitiatorSelfApproval:
|
|
2462
|
+
onChange: (e) => Z(pi(t, {
|
|
2463
|
+
allowInitiatorSelfApproval: f.allowInitiatorSelfApproval,
|
|
2264
2464
|
memberId: e?.id ?? "",
|
|
2265
2465
|
type: "DIRECT"
|
|
2266
2466
|
})),
|
|
2267
|
-
onSearch:
|
|
2467
|
+
onSearch: J,
|
|
2268
2468
|
onVisibilityChange: (e) => {
|
|
2269
|
-
e && (
|
|
2469
|
+
e && (It([]), J(""));
|
|
2270
2470
|
},
|
|
2271
|
-
options: [...
|
|
2471
|
+
options: [...Zi(Ft, m ? [m] : [])],
|
|
2272
2472
|
placeholder: "搜尋姓名或信箱",
|
|
2273
2473
|
searchDebounceTime: 300,
|
|
2274
|
-
value:
|
|
2474
|
+
value: m
|
|
2275
2475
|
})
|
|
2276
|
-
}), /* @__PURE__ */
|
|
2476
|
+
}), /* @__PURE__ */ T(n, {
|
|
2277
2477
|
hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
|
|
2278
2478
|
label: "允許自簽",
|
|
2279
2479
|
name: "allowInitiatorSelfApproval",
|
|
2280
|
-
children: /* @__PURE__ */
|
|
2281
|
-
checked: !!
|
|
2480
|
+
children: /* @__PURE__ */ T(S, {
|
|
2481
|
+
checked: !!f.allowInitiatorSelfApproval,
|
|
2282
2482
|
inputProps: {
|
|
2283
2483
|
id: "allowInitiatorSelfApproval",
|
|
2284
2484
|
name: "allowInitiatorSelfApproval"
|
|
2285
2485
|
},
|
|
2286
|
-
onChange: (e) => Z(
|
|
2486
|
+
onChange: (e) => Z(pi(t, {
|
|
2287
2487
|
allowInitiatorSelfApproval: e.target.checked,
|
|
2288
|
-
memberId:
|
|
2488
|
+
memberId: f.memberId,
|
|
2289
2489
|
type: "DIRECT"
|
|
2290
2490
|
}))
|
|
2291
2491
|
})
|
|
2292
2492
|
})] }) : null
|
|
2293
2493
|
] }) : null,
|
|
2294
|
-
t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */
|
|
2494
|
+
t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
|
|
2295
2495
|
label: "包含下層",
|
|
2296
2496
|
name: "includeDescendants",
|
|
2297
|
-
children: /* @__PURE__ */
|
|
2497
|
+
children: /* @__PURE__ */ T(S, {
|
|
2298
2498
|
checked: !!t.includeDescendants,
|
|
2299
2499
|
inputProps: {
|
|
2300
2500
|
id: "includeDescendants",
|
|
@@ -2307,12 +2507,12 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2307
2507
|
})
|
|
2308
2508
|
})
|
|
2309
2509
|
}) : null,
|
|
2310
|
-
t.type === "POSITION" ? /* @__PURE__ */
|
|
2510
|
+
t.type === "POSITION" ? /* @__PURE__ */ T(n, {
|
|
2311
2511
|
hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。",
|
|
2312
2512
|
label: "職位",
|
|
2313
2513
|
name: "positionId",
|
|
2314
2514
|
required: !0,
|
|
2315
|
-
children: /* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ T(o, {
|
|
2316
2516
|
name: "positionId",
|
|
2317
2517
|
onChange: (e) => Z({
|
|
2318
2518
|
positionId: e?.id ?? "",
|
|
@@ -2323,12 +2523,12 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2323
2523
|
value: c
|
|
2324
2524
|
})
|
|
2325
2525
|
}) : null,
|
|
2326
|
-
t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */
|
|
2526
|
+
t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ T(n, {
|
|
2327
2527
|
hintText: "只納入指定組織範圍內擁有此職位的有效會員。",
|
|
2328
2528
|
label: "職位",
|
|
2329
2529
|
name: "orgUnitPositionId",
|
|
2330
2530
|
required: !0,
|
|
2331
|
-
children: /* @__PURE__ */
|
|
2531
|
+
children: /* @__PURE__ */ T(o, {
|
|
2332
2532
|
disabled: !t.orgUnitId.trim(),
|
|
2333
2533
|
name: "orgUnitPositionId",
|
|
2334
2534
|
onChange: (e) => Z({
|
|
@@ -2342,233 +2542,257 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2342
2542
|
value: c
|
|
2343
2543
|
})
|
|
2344
2544
|
}) : null,
|
|
2345
|
-
/* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ T(n, {
|
|
2346
2546
|
hintText: "決定這一關要幾位簽核者同意才會通過;單人簽核與任一人同意的效果完全相同,皆為其中一人同意即通過。",
|
|
2347
2547
|
label: "決策方式",
|
|
2348
2548
|
name: "decisionPolicy",
|
|
2349
2549
|
required: !0,
|
|
2350
|
-
children: /* @__PURE__ */
|
|
2550
|
+
children: /* @__PURE__ */ T(x, {
|
|
2351
2551
|
clearable: !1,
|
|
2352
|
-
onChange: (t) =>
|
|
2353
|
-
options: [...
|
|
2354
|
-
value:
|
|
2552
|
+
onChange: (t) => Ur(Qr(t?.id ?? null, e.data.decisionPolicy)),
|
|
2553
|
+
options: [...gt.filter((e) => t.type !== "ORG_MANAGER_CHAIN" || e.id === "SEQUENTIAL" || e.id === "PARALLEL_ALL")],
|
|
2554
|
+
value: vt(re)
|
|
2355
2555
|
})
|
|
2356
2556
|
}),
|
|
2357
|
-
|
|
2557
|
+
re === "QUORUM" ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(n, {
|
|
2358
2558
|
label: "門檻計算方式",
|
|
2359
2559
|
name: "quorumThresholdType",
|
|
2360
2560
|
required: !0,
|
|
2361
|
-
children: /* @__PURE__ */
|
|
2561
|
+
children: /* @__PURE__ */ T(x, {
|
|
2362
2562
|
clearable: !1,
|
|
2363
|
-
onChange: (e) =>
|
|
2364
|
-
threshold:
|
|
2365
|
-
thresholdType:
|
|
2563
|
+
onChange: (e) => Ur({
|
|
2564
|
+
threshold: C.threshold,
|
|
2565
|
+
thresholdType: ei(e?.id ?? null),
|
|
2366
2566
|
type: "QUORUM"
|
|
2367
2567
|
}),
|
|
2368
|
-
options: [...
|
|
2369
|
-
value:
|
|
2568
|
+
options: [...mr],
|
|
2569
|
+
value: $(mr, C.thresholdType)
|
|
2370
2570
|
})
|
|
2371
|
-
}), /* @__PURE__ */
|
|
2372
|
-
hintText:
|
|
2373
|
-
label:
|
|
2571
|
+
}), /* @__PURE__ */ T(n, {
|
|
2572
|
+
hintText: C.thresholdType === "PERCENTAGE" ? "達到簽核者總數的這個百分比即通過,換算人數時無條件進位;超過 100 的輸入會自動夾至 100。" : "達到這個同意人數即通過;門檻超過實際簽核者人數時,這一關將永遠無法通過,請勿設定超過實際簽核者人數。",
|
|
2573
|
+
label: C.thresholdType === "PERCENTAGE" ? "門檻百分比" : "門檻人數",
|
|
2374
2574
|
name: "quorumThreshold",
|
|
2375
2575
|
required: !0,
|
|
2376
|
-
children: /* @__PURE__ */
|
|
2576
|
+
children: /* @__PURE__ */ T(y, {
|
|
2377
2577
|
id: "quorumThreshold",
|
|
2378
|
-
inputProps:
|
|
2578
|
+
inputProps: C.thresholdType === "PERCENTAGE" ? {
|
|
2379
2579
|
max: 100,
|
|
2380
2580
|
min: 1
|
|
2381
2581
|
} : { min: 1 },
|
|
2382
2582
|
inputType: "number",
|
|
2383
2583
|
name: "quorumThreshold",
|
|
2384
|
-
onChange: (e) =>
|
|
2385
|
-
threshold:
|
|
2386
|
-
thresholdType:
|
|
2584
|
+
onChange: (e) => Ur({
|
|
2585
|
+
threshold: tt(Number(e.target.value), C.thresholdType),
|
|
2586
|
+
thresholdType: C.thresholdType,
|
|
2387
2587
|
type: "QUORUM"
|
|
2388
2588
|
}),
|
|
2389
|
-
value: String(
|
|
2589
|
+
value: String(C.threshold),
|
|
2390
2590
|
variant: "base"
|
|
2391
2591
|
})
|
|
2392
2592
|
})] }) : null,
|
|
2393
|
-
e.data.returnBehavior.allowReturn ? /* @__PURE__ */
|
|
2593
|
+
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ T(n, {
|
|
2394
2594
|
hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
|
|
2395
2595
|
label: "重送策略",
|
|
2396
2596
|
name: "returnResubmitStrategy",
|
|
2397
2597
|
required: !0,
|
|
2398
|
-
children: /* @__PURE__ */
|
|
2598
|
+
children: /* @__PURE__ */ T(x, {
|
|
2399
2599
|
clearable: !1,
|
|
2400
|
-
onChange: (e) =>
|
|
2401
|
-
options: [...
|
|
2402
|
-
value:
|
|
2600
|
+
onChange: (e) => Rr(Xr(e?.id ?? null)),
|
|
2601
|
+
options: [...dr],
|
|
2602
|
+
value: $(dr, h)
|
|
2403
2603
|
})
|
|
2404
2604
|
}) : null,
|
|
2405
|
-
e.data.returnBehavior.allowReturn ? /* @__PURE__ */
|
|
2605
|
+
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ T(n, {
|
|
2406
2606
|
hintText: "開啟後,簽核者按下退回時必須填寫意見,未填寫會被擋下。",
|
|
2407
2607
|
label: "退回時意見必填",
|
|
2408
2608
|
name: "returnRequireComment",
|
|
2409
|
-
children: /* @__PURE__ */
|
|
2609
|
+
children: /* @__PURE__ */ T(S, {
|
|
2410
2610
|
checked: e.data.returnBehavior.requireComment === !0,
|
|
2411
2611
|
inputProps: {
|
|
2412
2612
|
id: "returnRequireComment",
|
|
2413
2613
|
name: "returnRequireComment"
|
|
2414
2614
|
},
|
|
2415
|
-
onChange: (e) =>
|
|
2615
|
+
onChange: (e) => zr(e.target.checked)
|
|
2416
2616
|
})
|
|
2417
2617
|
}) : null,
|
|
2418
|
-
/* @__PURE__ */
|
|
2618
|
+
/* @__PURE__ */ T(n, {
|
|
2419
2619
|
hintText: "開啟後可設定簽核期限,逾時將依下方設定處理。",
|
|
2420
2620
|
label: "啟用時效",
|
|
2421
2621
|
name: "slaEnabled",
|
|
2422
|
-
children: /* @__PURE__ */
|
|
2423
|
-
checked: !!
|
|
2622
|
+
children: /* @__PURE__ */ T(S, {
|
|
2623
|
+
checked: !!_,
|
|
2424
2624
|
inputProps: {
|
|
2425
2625
|
id: "slaEnabled",
|
|
2426
2626
|
name: "slaEnabled"
|
|
2427
2627
|
},
|
|
2428
|
-
onChange: (e) => Q(e.target.checked ?
|
|
2628
|
+
onChange: (e) => Q(e.target.checked ? Ze : null)
|
|
2429
2629
|
})
|
|
2430
2630
|
}),
|
|
2431
|
-
|
|
2631
|
+
_ && !b ? /* @__PURE__ */ T(n, {
|
|
2432
2632
|
hintText: "此期限混用了日與時,無法在表單中編輯。請改以單一單位設定,或透過 API 維護。",
|
|
2433
2633
|
label: "時效期限",
|
|
2434
2634
|
name: "slaDurationRaw",
|
|
2435
|
-
children: /* @__PURE__ */
|
|
2635
|
+
children: /* @__PURE__ */ T(y, {
|
|
2436
2636
|
disabled: !0,
|
|
2437
|
-
value:
|
|
2637
|
+
value: _.duration,
|
|
2438
2638
|
variant: "base"
|
|
2439
2639
|
})
|
|
2440
2640
|
}) : null,
|
|
2441
|
-
|
|
2641
|
+
_ && b ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(n, {
|
|
2442
2642
|
label: "時效期限",
|
|
2443
2643
|
name: "slaDurationValue",
|
|
2444
2644
|
required: !0,
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2645
|
+
children: /* @__PURE__ */ T(y, {
|
|
2446
2646
|
id: "slaDurationValue",
|
|
2447
2647
|
inputProps: { min: 1 },
|
|
2448
2648
|
inputType: "number",
|
|
2449
2649
|
name: "slaDurationValue",
|
|
2450
|
-
onChange: (e) => Q(
|
|
2451
|
-
unit:
|
|
2650
|
+
onChange: (e) => Q(oi(_, {
|
|
2651
|
+
unit: ee,
|
|
2452
2652
|
value: Number(e.target.value)
|
|
2453
2653
|
})),
|
|
2454
|
-
value: String(
|
|
2654
|
+
value: String(b.value),
|
|
2455
2655
|
variant: "base"
|
|
2456
2656
|
})
|
|
2457
|
-
}), /* @__PURE__ */
|
|
2657
|
+
}), /* @__PURE__ */ T(n, {
|
|
2458
2658
|
label: "期限單位",
|
|
2459
2659
|
name: "slaDurationUnit",
|
|
2460
2660
|
required: !0,
|
|
2461
|
-
children: /* @__PURE__ */
|
|
2661
|
+
children: /* @__PURE__ */ T(x, {
|
|
2462
2662
|
clearable: !1,
|
|
2463
|
-
onChange: (e) => Q(
|
|
2464
|
-
unit:
|
|
2465
|
-
value:
|
|
2663
|
+
onChange: (e) => Q(oi(_, {
|
|
2664
|
+
unit: ti(e?.id ?? null),
|
|
2665
|
+
value: b.value
|
|
2466
2666
|
})),
|
|
2467
|
-
options: [
|
|
2468
|
-
value:
|
|
2667
|
+
options: [...$e],
|
|
2668
|
+
value: $($e, ee)
|
|
2469
2669
|
})
|
|
2470
2670
|
})] }) : null,
|
|
2471
|
-
|
|
2671
|
+
_ && ee === "DAY" ? /* @__PURE__ */ T(n, {
|
|
2472
2672
|
hintText: "工作日會跳過週末與行事曆上的假日,補班日仍計為工作日;行事曆由系統管理者設定。",
|
|
2473
2673
|
label: "計算方式",
|
|
2474
2674
|
name: "slaCalendar",
|
|
2475
2675
|
required: !0,
|
|
2476
|
-
children: /* @__PURE__ */
|
|
2676
|
+
children: /* @__PURE__ */ T(x, {
|
|
2477
2677
|
clearable: !1,
|
|
2478
2678
|
onChange: (e) => Q({
|
|
2479
|
-
...
|
|
2480
|
-
calendar:
|
|
2679
|
+
..._,
|
|
2680
|
+
calendar: ni(e?.id ?? null)
|
|
2481
2681
|
}),
|
|
2482
|
-
options: [...
|
|
2483
|
-
value:
|
|
2682
|
+
options: [...Qe],
|
|
2683
|
+
value: $(Qe, _.calendar ?? "CALENDAR")
|
|
2484
2684
|
})
|
|
2485
2685
|
}) : null,
|
|
2486
|
-
|
|
2686
|
+
_ ? /* @__PURE__ */ T(n, {
|
|
2487
2687
|
label: "逾時處理",
|
|
2488
2688
|
name: "slaOnTimeout",
|
|
2489
2689
|
required: !0,
|
|
2490
|
-
children: /* @__PURE__ */
|
|
2690
|
+
children: /* @__PURE__ */ T(x, {
|
|
2491
2691
|
clearable: !1,
|
|
2492
|
-
onChange: (e) => Q(
|
|
2493
|
-
options: [...
|
|
2494
|
-
value:
|
|
2692
|
+
onChange: (e) => Q(si(_, ri(e?.id ?? null))),
|
|
2693
|
+
options: [...et],
|
|
2694
|
+
value: $(et, _.onTimeout)
|
|
2495
2695
|
})
|
|
2496
2696
|
}) : null,
|
|
2497
|
-
|
|
2697
|
+
_?.onTimeout === "ESCALATE" ? /* @__PURE__ */ T(n, {
|
|
2498
2698
|
hintText: "逾時後改派給簽核者的上層主管,只會升級一次。",
|
|
2499
2699
|
label: "升級層級",
|
|
2500
2700
|
name: "slaEscalateLevelsUp",
|
|
2501
2701
|
required: !0,
|
|
2502
|
-
children: /* @__PURE__ */
|
|
2702
|
+
children: /* @__PURE__ */ T(x, {
|
|
2503
2703
|
clearable: !1,
|
|
2504
2704
|
onChange: (e) => Q({
|
|
2505
|
-
...
|
|
2506
|
-
escalateLevelsUp:
|
|
2705
|
+
..._,
|
|
2706
|
+
escalateLevelsUp: hi(e?.id ?? null).value
|
|
2507
2707
|
}),
|
|
2508
|
-
options: [...
|
|
2509
|
-
value:
|
|
2708
|
+
options: [...Y],
|
|
2709
|
+
value: ne
|
|
2510
2710
|
})
|
|
2511
2711
|
}) : null,
|
|
2512
|
-
|
|
2712
|
+
_ ? /* @__PURE__ */ T(n, {
|
|
2513
2713
|
hintText: "在期限到達前先送出一次提醒。",
|
|
2514
2714
|
label: "預警提醒",
|
|
2515
2715
|
name: "slaWarningAt",
|
|
2516
|
-
children: /* @__PURE__ */
|
|
2716
|
+
children: /* @__PURE__ */ T(x, {
|
|
2517
2717
|
clearable: !1,
|
|
2518
|
-
onChange: (e) => Q(
|
|
2519
|
-
options: [...
|
|
2520
|
-
value:
|
|
2718
|
+
onChange: (e) => Q(ci(_, ai(e?.id ?? null).value)),
|
|
2719
|
+
options: [...fr],
|
|
2720
|
+
value: te
|
|
2521
2721
|
})
|
|
2522
2722
|
}) : null,
|
|
2523
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ T(n, {
|
|
2524
2724
|
hintText: "關閉後,簽核者在此關卡看不到「拒絕」按鈕。",
|
|
2525
2725
|
label: "允許拒絕",
|
|
2526
2726
|
name: "allowReject",
|
|
2527
|
-
children: /* @__PURE__ */
|
|
2727
|
+
children: /* @__PURE__ */ T(S, {
|
|
2528
2728
|
checked: e.data.allowReject,
|
|
2529
2729
|
inputProps: {
|
|
2530
2730
|
id: "allowReject",
|
|
2531
2731
|
name: "allowReject"
|
|
2532
2732
|
},
|
|
2533
|
-
onChange: (e) =>
|
|
2733
|
+
onChange: (e) => Wr({ allowReject: e.target.checked })
|
|
2534
2734
|
})
|
|
2535
2735
|
}),
|
|
2536
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ T(n, {
|
|
2537
2737
|
hintText: "關閉後,簽核者無法把此關卡的任務轉派給其他人。",
|
|
2538
2738
|
label: "允許轉派",
|
|
2539
2739
|
name: "allowTransfer",
|
|
2540
|
-
children: /* @__PURE__ */
|
|
2740
|
+
children: /* @__PURE__ */ T(S, {
|
|
2541
2741
|
checked: e.data.allowTransfer,
|
|
2542
2742
|
inputProps: {
|
|
2543
2743
|
id: "allowTransfer",
|
|
2544
2744
|
name: "allowTransfer"
|
|
2545
2745
|
},
|
|
2546
|
-
onChange: (e) =>
|
|
2746
|
+
onChange: (e) => Wr({ allowTransfer: e.target.checked })
|
|
2547
2747
|
})
|
|
2548
2748
|
}),
|
|
2549
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ T(n, {
|
|
2550
2750
|
hintText: "開啟後,簽核者可在此關卡臨時加入其他簽核人;會簽為平行處理,加簽則需等加入者簽完才往下。",
|
|
2551
2751
|
label: "允許加簽",
|
|
2552
2752
|
name: "allowAddSigner",
|
|
2553
|
-
children: /* @__PURE__ */
|
|
2753
|
+
children: /* @__PURE__ */ T(S, {
|
|
2554
2754
|
checked: e.data.allowAddSigner,
|
|
2555
2755
|
inputProps: {
|
|
2556
2756
|
id: "allowAddSigner",
|
|
2557
2757
|
name: "allowAddSigner"
|
|
2558
2758
|
},
|
|
2559
|
-
onChange: (e) =>
|
|
2759
|
+
onChange: (e) => Wr({ allowAddSigner: e.target.checked })
|
|
2560
2760
|
})
|
|
2561
|
-
})
|
|
2761
|
+
}),
|
|
2762
|
+
/* @__PURE__ */ T(n, {
|
|
2763
|
+
hintText: "開啟後,申請人本人(含其代理人)不會成為此關的簽核人,也不能被轉簽或加簽到此關。",
|
|
2764
|
+
label: "申請人不可簽核自己的單",
|
|
2765
|
+
name: "excludeInitiator",
|
|
2766
|
+
children: /* @__PURE__ */ T(S, {
|
|
2767
|
+
checked: !!v,
|
|
2768
|
+
inputProps: {
|
|
2769
|
+
id: "excludeInitiator",
|
|
2770
|
+
name: "excludeInitiator"
|
|
2771
|
+
},
|
|
2772
|
+
onChange: (e) => Hr(e.target.checked ? _r : null)
|
|
2773
|
+
})
|
|
2774
|
+
}),
|
|
2775
|
+
v ? /* @__PURE__ */ T(n, {
|
|
2776
|
+
label: "排除後沒有簽核人時",
|
|
2777
|
+
name: "excludeInitiatorWhenEmpty",
|
|
2778
|
+
required: !0,
|
|
2779
|
+
children: /* @__PURE__ */ T(x, {
|
|
2780
|
+
clearable: !1,
|
|
2781
|
+
onChange: (e) => Hr({ whenEmpty: $(gr, e?.id ?? null)?.id ?? _r.whenEmpty }),
|
|
2782
|
+
options: [...gr],
|
|
2783
|
+
value: $(gr, v.whenEmpty)
|
|
2784
|
+
})
|
|
2785
|
+
}) : null
|
|
2562
2786
|
] });
|
|
2563
2787
|
}
|
|
2564
|
-
function
|
|
2565
|
-
let t = e.data.action, r =
|
|
2788
|
+
function Gi(e) {
|
|
2789
|
+
let t = e.data.action, r = ya(t).map((e) => zi(I, e)), i = t.type === "NOTIFY" && t.recipients.type !== "DIRECT" ? ta(t.recipients, I, L, R, G) : null;
|
|
2566
2790
|
function a(e) {
|
|
2567
2791
|
let n = {
|
|
2568
2792
|
memberIds: [...e],
|
|
2569
2793
|
type: "DIRECT"
|
|
2570
2794
|
};
|
|
2571
|
-
|
|
2795
|
+
Gr(t.type === "NOTIFY" ? {
|
|
2572
2796
|
...t,
|
|
2573
2797
|
recipients: n
|
|
2574
2798
|
} : {
|
|
@@ -2578,64 +2802,64 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2578
2802
|
});
|
|
2579
2803
|
}
|
|
2580
2804
|
function o(e) {
|
|
2581
|
-
t.type === "NOTIFY" &&
|
|
2805
|
+
t.type === "NOTIFY" && Gr({
|
|
2582
2806
|
...t,
|
|
2583
2807
|
webhooks: e
|
|
2584
2808
|
});
|
|
2585
2809
|
}
|
|
2586
|
-
return /* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */
|
|
2810
|
+
return /* @__PURE__ */ E(w, { children: [
|
|
2811
|
+
/* @__PURE__ */ T(n, {
|
|
2588
2812
|
hintText: i ? `目前知會對象為「${i}」;在此選擇成員會改為指定成員。` : t.type === "NOTIFY" ? "可只設定 Webhook,不指定知會對象。" : void 0,
|
|
2589
2813
|
label: "知會對象",
|
|
2590
2814
|
name: "notifyMemberIds",
|
|
2591
|
-
children: /* @__PURE__ */
|
|
2815
|
+
children: /* @__PURE__ */ T(g, {
|
|
2592
2816
|
asyncData: !0,
|
|
2593
2817
|
disabledOptionsFilter: !0,
|
|
2594
2818
|
emptyText: "沒有符合的成員",
|
|
2595
|
-
loading:
|
|
2819
|
+
loading: Mt,
|
|
2596
2820
|
loadingText: "搜尋成員中...",
|
|
2597
2821
|
mode: "multiple",
|
|
2598
2822
|
onChange: (e) => a(e.map((e) => e.id)),
|
|
2599
|
-
onSearch:
|
|
2823
|
+
onSearch: J,
|
|
2600
2824
|
onVisibilityChange: (e) => {
|
|
2601
|
-
e && (
|
|
2825
|
+
e && (It([]), J(""));
|
|
2602
2826
|
},
|
|
2603
|
-
options: [...
|
|
2827
|
+
options: [...Zi(r, Ft)],
|
|
2604
2828
|
overflowStrategy: "wrap",
|
|
2605
2829
|
placeholder: "搜尋姓名或信箱",
|
|
2606
2830
|
searchDebounceTime: 300,
|
|
2607
2831
|
value: [...r]
|
|
2608
2832
|
})
|
|
2609
2833
|
}),
|
|
2610
|
-
t.type === "NOTIFY" && !
|
|
2611
|
-
style:
|
|
2612
|
-
children: [/* @__PURE__ */
|
|
2834
|
+
t.type === "NOTIFY" && !Jt(t.webhooks) ? /* @__PURE__ */ E("div", {
|
|
2835
|
+
style: U,
|
|
2836
|
+
children: [/* @__PURE__ */ T(C, {
|
|
2613
2837
|
color: "text-warning",
|
|
2614
2838
|
variant: "body",
|
|
2615
2839
|
children: "這個節點的 Webhook 設定格式錯誤,無法在此編輯。清除後可重新新增。"
|
|
2616
|
-
}), /* @__PURE__ */
|
|
2840
|
+
}), /* @__PURE__ */ T("div", { children: /* @__PURE__ */ T(_, {
|
|
2617
2841
|
onClick: () => o([]),
|
|
2618
2842
|
variant: "destructive-secondary",
|
|
2619
2843
|
children: "清除 Webhook 設定"
|
|
2620
2844
|
}) })]
|
|
2621
2845
|
}) : null,
|
|
2622
|
-
t.type === "NOTIFY" &&
|
|
2623
|
-
catalog:
|
|
2624
|
-
catalogState:
|
|
2625
|
-
formFields:
|
|
2846
|
+
t.type === "NOTIFY" && Jt(t.webhooks) ? /* @__PURE__ */ T(cn, {
|
|
2847
|
+
catalog: rn,
|
|
2848
|
+
catalogState: on,
|
|
2849
|
+
formFields: G?.fields ?? null,
|
|
2626
2850
|
onChange: o,
|
|
2627
|
-
targets:
|
|
2851
|
+
targets: mt(t)
|
|
2628
2852
|
}) : null
|
|
2629
2853
|
] });
|
|
2630
2854
|
}
|
|
2631
|
-
function
|
|
2632
|
-
return /* @__PURE__ */
|
|
2633
|
-
style:
|
|
2634
|
-
children: [/* @__PURE__ */
|
|
2855
|
+
function Ki(e) {
|
|
2856
|
+
return /* @__PURE__ */ E("div", {
|
|
2857
|
+
style: U,
|
|
2858
|
+
children: [/* @__PURE__ */ T(C, {
|
|
2635
2859
|
component: "h2",
|
|
2636
2860
|
variant: "h3",
|
|
2637
2861
|
children: "已選取線段"
|
|
2638
|
-
}), /* @__PURE__ */
|
|
2862
|
+
}), /* @__PURE__ */ E(C, {
|
|
2639
2863
|
color: "text-neutral",
|
|
2640
2864
|
variant: "body",
|
|
2641
2865
|
children: [
|
|
@@ -2646,17 +2870,17 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2646
2870
|
})]
|
|
2647
2871
|
});
|
|
2648
2872
|
}
|
|
2649
|
-
function
|
|
2650
|
-
let t =
|
|
2651
|
-
return /* @__PURE__ */
|
|
2652
|
-
style:
|
|
2873
|
+
function qi(e) {
|
|
2874
|
+
let t = _a(e, A.nodes);
|
|
2875
|
+
return /* @__PURE__ */ E("div", {
|
|
2876
|
+
style: U,
|
|
2653
2877
|
children: [
|
|
2654
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ T(C, {
|
|
2655
2879
|
component: "h2",
|
|
2656
2880
|
variant: "h3",
|
|
2657
2881
|
children: t ? "條件設定" : "線段屬性"
|
|
2658
2882
|
}),
|
|
2659
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ E(C, {
|
|
2660
2884
|
color: "text-neutral",
|
|
2661
2885
|
variant: "body",
|
|
2662
2886
|
children: [
|
|
@@ -2665,7 +2889,7 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2665
2889
|
e.target
|
|
2666
2890
|
]
|
|
2667
2891
|
}),
|
|
2668
|
-
t ?
|
|
2892
|
+
t ? Xi(e) : /* @__PURE__ */ T(C, {
|
|
2669
2893
|
color: "text-neutral",
|
|
2670
2894
|
variant: "body",
|
|
2671
2895
|
children: "這條線會直接把流程送到下一個節點。"
|
|
@@ -2673,63 +2897,63 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2673
2897
|
]
|
|
2674
2898
|
});
|
|
2675
2899
|
}
|
|
2676
|
-
function
|
|
2677
|
-
return !e || !
|
|
2900
|
+
function Ji(e) {
|
|
2901
|
+
return !e || !_a(e, A.nodes) ? null : /* @__PURE__ */ T(b, {
|
|
2678
2902
|
cancelText: "取消",
|
|
2679
2903
|
confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
|
|
2680
2904
|
confirmText: "完成",
|
|
2681
2905
|
modalType: "standard",
|
|
2682
|
-
onCancel:
|
|
2683
|
-
onClose:
|
|
2684
|
-
onConfirm:
|
|
2685
|
-
open: !!
|
|
2906
|
+
onCancel: Pr,
|
|
2907
|
+
onClose: Pr,
|
|
2908
|
+
onConfirm: Pr,
|
|
2909
|
+
open: !!ot,
|
|
2686
2910
|
showModalFooter: !0,
|
|
2687
2911
|
showModalHeader: !0,
|
|
2688
2912
|
size: "regular",
|
|
2689
2913
|
supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
|
|
2690
2914
|
title: "條件設定",
|
|
2691
|
-
children:
|
|
2915
|
+
children: Xi(e)
|
|
2692
2916
|
});
|
|
2693
2917
|
}
|
|
2694
|
-
function
|
|
2695
|
-
let t =
|
|
2696
|
-
return /* @__PURE__ */
|
|
2697
|
-
style:
|
|
2918
|
+
function Xi(e) {
|
|
2919
|
+
let t = ha(e, A.nodes), r = la(H?.schema ?? null), i = ua(H?.schema ?? null, e.data.conditionFieldKey ?? null), a = da(i), o = pa(i), s = $(a, e.data.conditionOperator ?? null), c = !e.data.isDefault && !e.data.condition;
|
|
2920
|
+
return /* @__PURE__ */ E("div", {
|
|
2921
|
+
style: U,
|
|
2698
2922
|
children: [
|
|
2699
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ E(C, {
|
|
2700
2924
|
color: "text-neutral",
|
|
2701
2925
|
variant: "body",
|
|
2702
2926
|
children: [
|
|
2703
2927
|
"畫布上的這條線目前會顯示「",
|
|
2704
|
-
/* @__PURE__ */
|
|
2705
|
-
style: { color: c ?
|
|
2928
|
+
/* @__PURE__ */ T("span", {
|
|
2929
|
+
style: { color: c ? Rn : void 0 },
|
|
2706
2930
|
children: t ?? "請設定條件"
|
|
2707
2931
|
}),
|
|
2708
2932
|
"」。"
|
|
2709
2933
|
]
|
|
2710
2934
|
}),
|
|
2711
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ T(S, {
|
|
2712
2936
|
checked: !!e.data.isDefault,
|
|
2713
2937
|
label: "其他情況走這條",
|
|
2714
|
-
onChange: (t) =>
|
|
2938
|
+
onChange: (t) => bi(e.id, t.target.checked)
|
|
2715
2939
|
}),
|
|
2716
|
-
e.data.isDefault ? /* @__PURE__ */
|
|
2940
|
+
e.data.isDefault ? /* @__PURE__ */ T(C, {
|
|
2717
2941
|
color: "text-neutral",
|
|
2718
2942
|
variant: "body",
|
|
2719
2943
|
children: "其他條件都不符合時,流程會走這條線。"
|
|
2720
|
-
}) : /* @__PURE__ */
|
|
2721
|
-
|
|
2944
|
+
}) : /* @__PURE__ */ E(w, { children: [
|
|
2945
|
+
H ? null : /* @__PURE__ */ T(C, {
|
|
2722
2946
|
color: "text-neutral",
|
|
2723
2947
|
variant: "body",
|
|
2724
2948
|
children: "請先綁定表單版本,才能選擇條件欄位。"
|
|
2725
2949
|
}),
|
|
2726
|
-
/* @__PURE__ */
|
|
2950
|
+
/* @__PURE__ */ T(n, {
|
|
2727
2951
|
label: "條件欄位",
|
|
2728
2952
|
name: "edgeConditionField",
|
|
2729
2953
|
required: !0,
|
|
2730
|
-
children: /* @__PURE__ */
|
|
2954
|
+
children: /* @__PURE__ */ T(x, {
|
|
2731
2955
|
clearable: !1,
|
|
2732
|
-
onChange: (t) =>
|
|
2956
|
+
onChange: (t) => Si({
|
|
2733
2957
|
edgeId: e.id,
|
|
2734
2958
|
fieldKey: t?.id ?? null,
|
|
2735
2959
|
operator: null,
|
|
@@ -2737,18 +2961,18 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2737
2961
|
}),
|
|
2738
2962
|
options: [...r],
|
|
2739
2963
|
placeholder: "選擇條件欄位",
|
|
2740
|
-
value:
|
|
2964
|
+
value: $(r, e.data.conditionFieldKey ?? null)
|
|
2741
2965
|
})
|
|
2742
2966
|
}),
|
|
2743
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ T(n, {
|
|
2744
2968
|
label: "條件判斷",
|
|
2745
2969
|
name: "edgeConditionOperator",
|
|
2746
2970
|
required: !0,
|
|
2747
|
-
children: /* @__PURE__ */
|
|
2971
|
+
children: /* @__PURE__ */ T(x, {
|
|
2748
2972
|
clearable: !1,
|
|
2749
|
-
onChange: (t) =>
|
|
2973
|
+
onChange: (t) => Si({
|
|
2750
2974
|
edgeId: e.id,
|
|
2751
|
-
operator:
|
|
2975
|
+
operator: fa(t?.id ?? null),
|
|
2752
2976
|
value: null
|
|
2753
2977
|
}),
|
|
2754
2978
|
options: [...a],
|
|
@@ -2756,21 +2980,21 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2756
2980
|
value: s
|
|
2757
2981
|
})
|
|
2758
2982
|
}),
|
|
2759
|
-
s &&
|
|
2983
|
+
s && ma(s.id) ? /* @__PURE__ */ T(n, {
|
|
2760
2984
|
label: "條件值",
|
|
2761
2985
|
name: "edgeConditionValue",
|
|
2762
2986
|
required: !0,
|
|
2763
|
-
children: o.length > 0 ? /* @__PURE__ */
|
|
2987
|
+
children: o.length > 0 ? /* @__PURE__ */ T(x, {
|
|
2764
2988
|
clearable: !1,
|
|
2765
|
-
onChange: (t) =>
|
|
2989
|
+
onChange: (t) => Si({
|
|
2766
2990
|
edgeId: e.id,
|
|
2767
2991
|
value: t?.id ?? null
|
|
2768
2992
|
}),
|
|
2769
2993
|
options: [...o],
|
|
2770
2994
|
placeholder: "選擇條件值",
|
|
2771
|
-
value:
|
|
2772
|
-
}) : /* @__PURE__ */
|
|
2773
|
-
onChange: (t) =>
|
|
2995
|
+
value: $(o, e.data.conditionValue ?? null)
|
|
2996
|
+
}) : /* @__PURE__ */ T(y, {
|
|
2997
|
+
onChange: (t) => Si({
|
|
2774
2998
|
edgeId: e.id,
|
|
2775
2999
|
value: t.target.value
|
|
2776
3000
|
}),
|
|
@@ -2784,14 +3008,14 @@ function ir({ aiAssistantAvailable: r = !0, embedded: a = !1, formSchemaOverride
|
|
|
2784
3008
|
});
|
|
2785
3009
|
}
|
|
2786
3010
|
}
|
|
2787
|
-
function
|
|
3011
|
+
function jr({ onApplyAutoLayout: e }) {
|
|
2788
3012
|
function t() {
|
|
2789
3013
|
e();
|
|
2790
3014
|
}
|
|
2791
|
-
return /* @__PURE__ */
|
|
3015
|
+
return /* @__PURE__ */ T(Pe, {
|
|
2792
3016
|
position: "top-right",
|
|
2793
|
-
children: /* @__PURE__ */
|
|
2794
|
-
icon:
|
|
3017
|
+
children: /* @__PURE__ */ T(_, {
|
|
3018
|
+
icon: se,
|
|
2795
3019
|
iconType: "leading",
|
|
2796
3020
|
onClick: t,
|
|
2797
3021
|
size: "sub",
|
|
@@ -2800,28 +3024,28 @@ function ar({ onApplyAutoLayout: e }) {
|
|
|
2800
3024
|
})
|
|
2801
3025
|
});
|
|
2802
3026
|
}
|
|
2803
|
-
function
|
|
2804
|
-
let r = e.approverLines ?? [e.approverSummary ?? e.label], i =
|
|
2805
|
-
return /* @__PURE__ */
|
|
3027
|
+
function X({ data: e, selected: t, type: n }) {
|
|
3028
|
+
let r = e.approverLines ?? [e.approverSummary ?? e.label], i = Mr(e), a = Nr(n, t);
|
|
3029
|
+
return /* @__PURE__ */ E("div", {
|
|
2806
3030
|
style: a,
|
|
2807
3031
|
children: [
|
|
2808
|
-
|
|
2809
|
-
/* @__PURE__ */
|
|
2810
|
-
style:
|
|
2811
|
-
children: r.map((e, t) => /* @__PURE__ */
|
|
3032
|
+
Fr(e),
|
|
3033
|
+
/* @__PURE__ */ T("div", {
|
|
3034
|
+
style: ir,
|
|
3035
|
+
children: r.map((e, t) => /* @__PURE__ */ T(C, {
|
|
2812
3036
|
component: "span",
|
|
2813
3037
|
ellipsis: !0,
|
|
2814
|
-
style:
|
|
3038
|
+
style: rr,
|
|
2815
3039
|
title: e,
|
|
2816
3040
|
variant: "label-primary",
|
|
2817
3041
|
children: e
|
|
2818
3042
|
}, `${e}_${t}`))
|
|
2819
3043
|
}),
|
|
2820
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ T(C, {
|
|
2821
3045
|
color: "text-neutral",
|
|
2822
3046
|
component: "span",
|
|
2823
3047
|
ellipsis: !0,
|
|
2824
|
-
style:
|
|
3048
|
+
style: rr,
|
|
2825
3049
|
title: i,
|
|
2826
3050
|
variant: "caption",
|
|
2827
3051
|
children: i
|
|
@@ -2829,85 +3053,85 @@ function q({ data: e, selected: t, type: n }) {
|
|
|
2829
3053
|
]
|
|
2830
3054
|
});
|
|
2831
3055
|
}
|
|
2832
|
-
function
|
|
2833
|
-
return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" :
|
|
3056
|
+
function Mr(e) {
|
|
3057
|
+
return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : sr[e.nodeKind];
|
|
2834
3058
|
}
|
|
2835
|
-
function
|
|
2836
|
-
let n =
|
|
3059
|
+
function Nr(e, t) {
|
|
3060
|
+
let n = Pr(e);
|
|
2837
3061
|
return t ? {
|
|
2838
3062
|
...n,
|
|
2839
3063
|
border: "1px solid var(--mzn-color-primary, #0057ff)",
|
|
2840
|
-
boxShadow:
|
|
3064
|
+
boxShadow: Xn
|
|
2841
3065
|
} : n;
|
|
2842
3066
|
}
|
|
2843
|
-
function
|
|
2844
|
-
return e === "exclusiveGateway" ?
|
|
3067
|
+
function Pr(e) {
|
|
3068
|
+
return e === "exclusiveGateway" ? $n : e === "parallelGateway" ? er : e === "startEvent" ? J : e === "endEvent" ? nr : e === "userTask" ? tr : Yn;
|
|
2845
3069
|
}
|
|
2846
|
-
function
|
|
2847
|
-
return !e.hasInput && e.hasOutput ? /* @__PURE__ */
|
|
2848
|
-
id:
|
|
3070
|
+
function Fr(e) {
|
|
3071
|
+
return !e.hasInput && e.hasOutput ? /* @__PURE__ */ T(Me, {
|
|
3072
|
+
id: or,
|
|
2849
3073
|
position: O.Right,
|
|
2850
3074
|
type: "source"
|
|
2851
|
-
}) : e.hasInput && !e.hasOutput ? /* @__PURE__ */
|
|
2852
|
-
id:
|
|
3075
|
+
}) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ T(Me, {
|
|
3076
|
+
id: ar,
|
|
2853
3077
|
position: O.Left,
|
|
2854
3078
|
type: "target"
|
|
2855
|
-
}) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */
|
|
2856
|
-
id:
|
|
3079
|
+
}) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ T(Me, {
|
|
3080
|
+
id: ar,
|
|
2857
3081
|
position: O.Left,
|
|
2858
3082
|
type: "target"
|
|
2859
|
-
}, "target"), /* @__PURE__ */
|
|
2860
|
-
id:
|
|
3083
|
+
}, "target"), /* @__PURE__ */ T(Me, {
|
|
3084
|
+
id: or,
|
|
2861
3085
|
position: O.Right,
|
|
2862
3086
|
type: "source"
|
|
2863
3087
|
}, "source")];
|
|
2864
3088
|
}
|
|
2865
|
-
function
|
|
2866
|
-
let
|
|
3089
|
+
function Ir(e, t, n, r, i, a, o) {
|
|
3090
|
+
let s = Lr(e);
|
|
2867
3091
|
return {
|
|
2868
3092
|
data: {
|
|
2869
|
-
approverLines:
|
|
2870
|
-
approverSummary:
|
|
2871
|
-
hasInput:
|
|
2872
|
-
hasOutput:
|
|
2873
|
-
initiatorPolicySummary: e.type === "startEvent" ?
|
|
3093
|
+
approverLines: na(e, t, n, r, o),
|
|
3094
|
+
approverSummary: ea(e, t, n, r, o),
|
|
3095
|
+
hasInput: Di(e),
|
|
3096
|
+
hasOutput: Oi(e),
|
|
3097
|
+
initiatorPolicySummary: e.type === "startEvent" ? Si(a, n, r) : null,
|
|
2874
3098
|
label: e.data.label,
|
|
2875
3099
|
nodeKind: e.type
|
|
2876
3100
|
},
|
|
2877
|
-
height:
|
|
2878
|
-
handles:
|
|
3101
|
+
height: s.height,
|
|
3102
|
+
handles: Z(e),
|
|
2879
3103
|
id: e.id,
|
|
2880
|
-
initialHeight:
|
|
2881
|
-
initialWidth:
|
|
3104
|
+
initialHeight: s.height,
|
|
3105
|
+
initialWidth: s.width,
|
|
2882
3106
|
position: e.position,
|
|
2883
3107
|
selected: i,
|
|
2884
3108
|
sourcePosition: O.Right,
|
|
2885
3109
|
targetPosition: O.Left,
|
|
2886
3110
|
type: e.type,
|
|
2887
|
-
width:
|
|
3111
|
+
width: s.width
|
|
2888
3112
|
};
|
|
2889
3113
|
}
|
|
2890
|
-
function
|
|
3114
|
+
function Lr(e) {
|
|
2891
3115
|
return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
|
|
2892
|
-
height:
|
|
2893
|
-
width:
|
|
3116
|
+
height: Qn,
|
|
3117
|
+
width: K
|
|
2894
3118
|
} : e.type === "serviceTask" ? {
|
|
2895
|
-
height:
|
|
2896
|
-
width:
|
|
3119
|
+
height: W + (ra(e.data.action) - 1) * Zn,
|
|
3120
|
+
width: G
|
|
2897
3121
|
} : {
|
|
2898
|
-
height:
|
|
2899
|
-
width:
|
|
3122
|
+
height: W,
|
|
3123
|
+
width: G
|
|
2900
3124
|
};
|
|
2901
3125
|
}
|
|
2902
|
-
function
|
|
2903
|
-
let t =
|
|
2904
|
-
return [...
|
|
3126
|
+
function Z(e) {
|
|
3127
|
+
let t = Lr(e);
|
|
3128
|
+
return [...Di(e) ? [Rr(t)] : [], ...Oi(e) ? [zr(t)] : []];
|
|
2905
3129
|
}
|
|
2906
|
-
function
|
|
3130
|
+
function Rr({ height: e }) {
|
|
2907
3131
|
let t = e / 2 - 9 / 2;
|
|
2908
3132
|
return {
|
|
2909
3133
|
height: 9,
|
|
2910
|
-
id:
|
|
3134
|
+
id: ar,
|
|
2911
3135
|
position: O.Left,
|
|
2912
3136
|
type: "target",
|
|
2913
3137
|
width: 9,
|
|
@@ -2915,11 +3139,11 @@ function Y({ height: e }) {
|
|
|
2915
3139
|
y: t
|
|
2916
3140
|
};
|
|
2917
3141
|
}
|
|
2918
|
-
function
|
|
3142
|
+
function zr({ height: e, width: t }) {
|
|
2919
3143
|
let n = e / 2 - 9 / 2;
|
|
2920
3144
|
return {
|
|
2921
3145
|
height: 9,
|
|
2922
|
-
id:
|
|
3146
|
+
id: or,
|
|
2923
3147
|
position: O.Right,
|
|
2924
3148
|
type: "source",
|
|
2925
3149
|
width: 9,
|
|
@@ -2927,8 +3151,8 @@ function fr({ height: e, width: t }) {
|
|
|
2927
3151
|
y: n
|
|
2928
3152
|
};
|
|
2929
3153
|
}
|
|
2930
|
-
function
|
|
2931
|
-
let r =
|
|
3154
|
+
function Br(e, t, n) {
|
|
3155
|
+
let r = ha(e, t), i = _a(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Rn : i ? Ln : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Rn : i ? Ln : H;
|
|
2932
3156
|
return {
|
|
2933
3157
|
className: n ? "workflow-edge--selected" : void 0,
|
|
2934
3158
|
data: e.data,
|
|
@@ -2951,9 +3175,9 @@ function pr(e, t, n) {
|
|
|
2951
3175
|
source: e.source,
|
|
2952
3176
|
sourceHandle: e.sourceHandle,
|
|
2953
3177
|
style: {
|
|
2954
|
-
filter: n ?
|
|
3178
|
+
filter: n ? zn : void 0,
|
|
2955
3179
|
opacity: 1,
|
|
2956
|
-
stroke:
|
|
3180
|
+
stroke: H,
|
|
2957
3181
|
strokeOpacity: 1,
|
|
2958
3182
|
strokeWidth: 1.5
|
|
2959
3183
|
},
|
|
@@ -2962,7 +3186,7 @@ function pr(e, t, n) {
|
|
|
2962
3186
|
type: e.type ?? "smoothstep"
|
|
2963
3187
|
};
|
|
2964
3188
|
}
|
|
2965
|
-
function
|
|
3189
|
+
function Q(e, t) {
|
|
2966
3190
|
return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
|
|
2967
3191
|
...e,
|
|
2968
3192
|
data: {
|
|
@@ -2971,10 +3195,10 @@ function mr(e, t) {
|
|
|
2971
3195
|
}
|
|
2972
3196
|
});
|
|
2973
3197
|
}
|
|
2974
|
-
function
|
|
2975
|
-
return
|
|
3198
|
+
function Vr(e) {
|
|
3199
|
+
return Gr(Ur(Wr(Hr(e))));
|
|
2976
3200
|
}
|
|
2977
|
-
function
|
|
3201
|
+
function Hr(e) {
|
|
2978
3202
|
let t = e.edges.map((e) => {
|
|
2979
3203
|
let t = e.data ?? {};
|
|
2980
3204
|
return e.data === t ? e : {
|
|
@@ -2987,7 +3211,7 @@ function gr(e) {
|
|
|
2987
3211
|
edges: t
|
|
2988
3212
|
} : e;
|
|
2989
3213
|
}
|
|
2990
|
-
function
|
|
3214
|
+
function Ur(e) {
|
|
2991
3215
|
let t = e.nodes.map((e) => {
|
|
2992
3216
|
if (e.type !== "userTask") return e;
|
|
2993
3217
|
let t = e.data.allowAddSigner ?? !1, n = e.data.allowReject ?? !0, r = e.data.allowTransfer ?? !0, i = !e.data.decisionPolicy;
|
|
@@ -3007,24 +3231,24 @@ function _r(e) {
|
|
|
3007
3231
|
nodes: t
|
|
3008
3232
|
} : e;
|
|
3009
3233
|
}
|
|
3010
|
-
function
|
|
3011
|
-
let t = new Set(e.nodes.filter((e) =>
|
|
3234
|
+
function Wr(e) {
|
|
3235
|
+
let t = new Set(e.nodes.filter((e) => ki(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
|
|
3012
3236
|
return n.length === e.edges.length ? e : {
|
|
3013
3237
|
...e,
|
|
3014
3238
|
edges: n
|
|
3015
3239
|
};
|
|
3016
3240
|
}
|
|
3017
|
-
function
|
|
3241
|
+
function Gr(e) {
|
|
3018
3242
|
let t = e.edges.reduce((e, t) => ({
|
|
3019
3243
|
...e,
|
|
3020
3244
|
[t.target]: (e[t.target] ?? 0) + 1
|
|
3021
|
-
}), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ?
|
|
3245
|
+
}), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? Q(e, "AND") : e);
|
|
3022
3246
|
return n.some((t, n) => t !== e.nodes[n]) ? {
|
|
3023
3247
|
...e,
|
|
3024
3248
|
nodes: n
|
|
3025
3249
|
} : e;
|
|
3026
3250
|
}
|
|
3027
|
-
function
|
|
3251
|
+
function Kr() {
|
|
3028
3252
|
return {
|
|
3029
3253
|
edges: [],
|
|
3030
3254
|
meta: { schemaVersion: 1 },
|
|
@@ -3051,96 +3275,80 @@ function br() {
|
|
|
3051
3275
|
}]
|
|
3052
3276
|
};
|
|
3053
3277
|
}
|
|
3054
|
-
function
|
|
3278
|
+
function qr(e) {
|
|
3055
3279
|
return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
|
|
3056
3280
|
}
|
|
3057
|
-
function
|
|
3058
|
-
let t = new
|
|
3281
|
+
function Jr(e) {
|
|
3282
|
+
let t = new Re.graphlib.Graph();
|
|
3059
3283
|
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
3060
3284
|
rankdir: "LR",
|
|
3061
3285
|
ranksep: 120
|
|
3062
3286
|
}), e.nodes.forEach((e) => {
|
|
3063
|
-
t.setNode(e.id,
|
|
3287
|
+
t.setNode(e.id, Lr(e));
|
|
3064
3288
|
}), e.edges.forEach((e) => {
|
|
3065
3289
|
t.setEdge(e.source, e.target);
|
|
3066
|
-
}),
|
|
3290
|
+
}), Re.layout(t), {
|
|
3067
3291
|
...e,
|
|
3068
3292
|
nodes: e.nodes.map((e) => {
|
|
3069
3293
|
let n = t.node(e.id);
|
|
3070
3294
|
return n ? {
|
|
3071
3295
|
...e,
|
|
3072
3296
|
position: {
|
|
3073
|
-
x: n.x -
|
|
3074
|
-
y: n.y -
|
|
3297
|
+
x: n.x - Lr(e).width / 2,
|
|
3298
|
+
y: n.y - Lr(e).height / 2
|
|
3075
3299
|
}
|
|
3076
3300
|
} : e;
|
|
3077
3301
|
})
|
|
3078
3302
|
};
|
|
3079
3303
|
}
|
|
3080
|
-
function
|
|
3304
|
+
function $(e, t) {
|
|
3081
3305
|
return t ? e.find((e) => e.id === t) ?? null : null;
|
|
3082
3306
|
}
|
|
3083
|
-
function
|
|
3307
|
+
function Yr(e) {
|
|
3084
3308
|
return e === "OR" ? "OR" : "AND";
|
|
3085
3309
|
}
|
|
3086
|
-
function
|
|
3310
|
+
function Xr(e) {
|
|
3087
3311
|
return e === "FROM_RETURN_POINT" ? "FROM_RETURN_POINT" : "RESTART";
|
|
3088
3312
|
}
|
|
3089
|
-
function
|
|
3090
|
-
if (!e || e.type === "SINGLE" || e.type === "PARALLEL_ANY") return "可指定多位;多位時所有人都會收到待辦,任一人同意即可通過。";
|
|
3091
|
-
if (e.type === "PARALLEL_ALL") return "可指定多位;多位時所有人都會收到待辦,全部同意後才會通過。";
|
|
3092
|
-
if (e.type === "SEQUENTIAL") return "可指定多位;所有人會同時收到待辦,需全部同意後才會通過。";
|
|
3093
|
-
let t = e.thresholdType === "PERCENTAGE" ? "%" : " 位簽核者";
|
|
3094
|
-
return `可指定多位;需達到 ${e.threshold}${t} 才會通過。`;
|
|
3095
|
-
}
|
|
3096
|
-
function Er(e) {
|
|
3313
|
+
function Zr(e) {
|
|
3097
3314
|
return e?.type ?? "SINGLE";
|
|
3098
3315
|
}
|
|
3099
|
-
function
|
|
3100
|
-
return Un.find((t) => t.id === e) || (e === "SEQUENTIAL" ? {
|
|
3101
|
-
id: e,
|
|
3102
|
-
name: "全部同意(既有設定)"
|
|
3103
|
-
} : {
|
|
3104
|
-
id: e,
|
|
3105
|
-
name: `未知決策方式(${e})`
|
|
3106
|
-
});
|
|
3107
|
-
}
|
|
3108
|
-
function Or(e, t) {
|
|
3316
|
+
function Qr(e, t) {
|
|
3109
3317
|
return e === "QUORUM" ? t?.type === "QUORUM" ? t : {
|
|
3110
|
-
threshold:
|
|
3318
|
+
threshold: Xe,
|
|
3111
3319
|
thresholdType: "COUNT",
|
|
3112
3320
|
type: "QUORUM"
|
|
3113
3321
|
} : e === "PARALLEL_ALL" || e === "PARALLEL_ANY" || e === "SEQUENTIAL" ? { type: e } : { type: "SINGLE" };
|
|
3114
3322
|
}
|
|
3115
|
-
function
|
|
3323
|
+
function $r(e) {
|
|
3116
3324
|
return e?.type === "QUORUM" ? {
|
|
3117
|
-
threshold: Number.isFinite(e.threshold) ? e.threshold :
|
|
3118
|
-
thresholdType:
|
|
3325
|
+
threshold: Number.isFinite(e.threshold) ? e.threshold : Xe,
|
|
3326
|
+
thresholdType: ei(e.thresholdType ?? null)
|
|
3119
3327
|
} : {
|
|
3120
|
-
threshold:
|
|
3328
|
+
threshold: Xe,
|
|
3121
3329
|
thresholdType: "COUNT"
|
|
3122
3330
|
};
|
|
3123
3331
|
}
|
|
3124
|
-
function
|
|
3332
|
+
function ei(e) {
|
|
3125
3333
|
return e === "PERCENTAGE" ? "PERCENTAGE" : "COUNT";
|
|
3126
3334
|
}
|
|
3127
|
-
function
|
|
3335
|
+
function ti(e) {
|
|
3128
3336
|
return e === "HOUR" ? "HOUR" : "DAY";
|
|
3129
3337
|
}
|
|
3130
|
-
function
|
|
3338
|
+
function ni(e) {
|
|
3131
3339
|
return e === "BUSINESS_DAY" ? "BUSINESS_DAY" : "CALENDAR";
|
|
3132
3340
|
}
|
|
3133
|
-
function
|
|
3134
|
-
return
|
|
3341
|
+
function ri(e) {
|
|
3342
|
+
return et.find((t) => t.id === e)?.id ?? "REMIND";
|
|
3135
3343
|
}
|
|
3136
|
-
function
|
|
3137
|
-
return
|
|
3344
|
+
function ii(e) {
|
|
3345
|
+
return fr.find((t) => t.value === e) ?? fr[0];
|
|
3138
3346
|
}
|
|
3139
|
-
function
|
|
3140
|
-
return
|
|
3347
|
+
function ai(e) {
|
|
3348
|
+
return fr.find((t) => t.id === e) ?? fr[0];
|
|
3141
3349
|
}
|
|
3142
|
-
function
|
|
3143
|
-
let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r =
|
|
3350
|
+
function oi(e, t) {
|
|
3351
|
+
let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r = j({
|
|
3144
3352
|
unit: t.unit,
|
|
3145
3353
|
value: n
|
|
3146
3354
|
});
|
|
@@ -3150,47 +3358,53 @@ function Ir(e, t) {
|
|
|
3150
3358
|
duration: r
|
|
3151
3359
|
};
|
|
3152
3360
|
}
|
|
3153
|
-
function
|
|
3361
|
+
function si(e, t) {
|
|
3154
3362
|
return t === "ESCALATE" ? {
|
|
3155
3363
|
...e,
|
|
3156
3364
|
escalateLevelsUp: e.escalateLevelsUp ?? 1,
|
|
3157
3365
|
onTimeout: t
|
|
3158
3366
|
} : {
|
|
3159
|
-
...
|
|
3367
|
+
...li(e, "escalateLevelsUp"),
|
|
3160
3368
|
onTimeout: t
|
|
3161
3369
|
};
|
|
3162
3370
|
}
|
|
3163
|
-
function
|
|
3164
|
-
return t === null ?
|
|
3371
|
+
function ci(e, t) {
|
|
3372
|
+
return t === null ? li(e, "warningAt") : {
|
|
3165
3373
|
...e,
|
|
3166
3374
|
warningAt: t
|
|
3167
3375
|
};
|
|
3168
3376
|
}
|
|
3169
|
-
function
|
|
3377
|
+
function li(e, t) {
|
|
3170
3378
|
return Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
|
|
3171
3379
|
}
|
|
3172
|
-
function
|
|
3173
|
-
return e === "ORG_MANAGER" || e === "ORG_UNIT_MANAGER" || e === "ORG_UNIT_MEMBER" || e === "ORG_UNIT_POSITION" || e === "POSITION" ? e : "DIRECT";
|
|
3174
|
-
}
|
|
3175
|
-
function
|
|
3176
|
-
let
|
|
3177
|
-
return
|
|
3380
|
+
function ui(e) {
|
|
3381
|
+
return e === "DYNAMIC_FORM" || e === "ORG_MANAGER" || e === "ORG_MANAGER_CHAIN" || e === "ORG_UNIT_MANAGER" || e === "ORG_UNIT_MEMBER" || e === "ORG_UNIT_POSITION" || e === "POSITION" ? e : "DIRECT";
|
|
3382
|
+
}
|
|
3383
|
+
function di(e, t) {
|
|
3384
|
+
let n = ui(e ?? "DIRECT");
|
|
3385
|
+
return n === "DYNAMIC_FORM" ? {
|
|
3386
|
+
formPath: "",
|
|
3387
|
+
type: "DYNAMIC_FORM"
|
|
3388
|
+
} : n === "ORG_MANAGER" ? {
|
|
3178
3389
|
baseFromInitiator: !0,
|
|
3179
3390
|
levelsUp: 1,
|
|
3180
3391
|
type: "ORG_MANAGER"
|
|
3181
|
-
} :
|
|
3392
|
+
} : n === "ORG_MANAGER_CHAIN" ? {
|
|
3393
|
+
minPositionLevel: Bt(t),
|
|
3394
|
+
type: "ORG_MANAGER_CHAIN"
|
|
3395
|
+
} : n === "ORG_UNIT_MANAGER" ? {
|
|
3182
3396
|
orgUnitId: "",
|
|
3183
3397
|
type: "ORG_UNIT_MANAGER"
|
|
3184
|
-
} :
|
|
3398
|
+
} : n === "ORG_UNIT_MEMBER" ? {
|
|
3185
3399
|
includeDescendants: !1,
|
|
3186
3400
|
orgUnitId: "",
|
|
3187
3401
|
type: "ORG_UNIT_MEMBER"
|
|
3188
|
-
} :
|
|
3402
|
+
} : n === "ORG_UNIT_POSITION" ? {
|
|
3189
3403
|
includeDescendants: !1,
|
|
3190
3404
|
orgUnitId: "",
|
|
3191
3405
|
positionId: "",
|
|
3192
3406
|
type: "ORG_UNIT_POSITION"
|
|
3193
|
-
} :
|
|
3407
|
+
} : n === "POSITION" ? {
|
|
3194
3408
|
positionId: "",
|
|
3195
3409
|
type: "POSITION"
|
|
3196
3410
|
} : {
|
|
@@ -3198,31 +3412,31 @@ function Vr(e) {
|
|
|
3198
3412
|
type: "DIRECT"
|
|
3199
3413
|
};
|
|
3200
3414
|
}
|
|
3201
|
-
function
|
|
3415
|
+
function fi(e) {
|
|
3202
3416
|
return e === "DIRECT" ? "DIRECT" : "NONE";
|
|
3203
3417
|
}
|
|
3204
|
-
function
|
|
3205
|
-
return e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER" ? {
|
|
3418
|
+
function pi(e, t) {
|
|
3419
|
+
return e.type === "ORG_MANAGER" || e.type === "ORG_MANAGER_CHAIN" || e.type === "ORG_UNIT_MANAGER" ? {
|
|
3206
3420
|
...e,
|
|
3207
3421
|
fallback: t
|
|
3208
3422
|
} : e;
|
|
3209
3423
|
}
|
|
3210
|
-
function
|
|
3211
|
-
return
|
|
3424
|
+
function mi(e) {
|
|
3425
|
+
return Y.find((t) => t.value === e) ?? Y[0];
|
|
3212
3426
|
}
|
|
3213
|
-
function
|
|
3214
|
-
return
|
|
3427
|
+
function hi(e) {
|
|
3428
|
+
return Y.find((t) => t.id === e) ?? Y[0];
|
|
3215
3429
|
}
|
|
3216
|
-
function
|
|
3430
|
+
function gi(e) {
|
|
3217
3431
|
return e === "ORG_UNIT" || e === "ORG_UNIT_POSITION" || e === "NONE" ? e : "ALL";
|
|
3218
3432
|
}
|
|
3219
|
-
function
|
|
3433
|
+
function _i(e) {
|
|
3220
3434
|
let t = e?.trim();
|
|
3221
3435
|
if (!t) return {
|
|
3222
3436
|
mode: "ALL",
|
|
3223
3437
|
value: ""
|
|
3224
3438
|
};
|
|
3225
|
-
let n =
|
|
3439
|
+
let n = bi(t, /"([^"]+)" in subject\.orgUnitIds/gu), r = bi(t, /"([^"]+)" in subject\.positionIds/gu);
|
|
3226
3440
|
return n.length > 0 && r.length > 0 ? {
|
|
3227
3441
|
includeDescendants: n.length > 1,
|
|
3228
3442
|
mode: "ORG_UNIT_POSITION",
|
|
@@ -3239,32 +3453,32 @@ function qr(e) {
|
|
|
3239
3453
|
value: t
|
|
3240
3454
|
};
|
|
3241
3455
|
}
|
|
3242
|
-
function
|
|
3243
|
-
let n =
|
|
3456
|
+
function vi(e, t) {
|
|
3457
|
+
let n = _i(e);
|
|
3244
3458
|
return !t || t === "ALL" || t === "NONE" ? t === "ALL" || t === "NONE" ? {
|
|
3245
3459
|
mode: t,
|
|
3246
3460
|
value: ""
|
|
3247
|
-
} : n : n.mode === t ? n :
|
|
3461
|
+
} : n : n.mode === t ? n : Ci(t);
|
|
3248
3462
|
}
|
|
3249
|
-
function
|
|
3463
|
+
function yi(e) {
|
|
3250
3464
|
return e.mode === "NONE" ? "發起權限需要選擇誰可以發起。" : (e.mode === "ORG_UNIT" || e.mode === "ORG_UNIT_POSITION") && !e.orgUnitId?.trim() ? "指定組織發起時,需要選擇組織。" : e.mode === "ORG_UNIT_POSITION" && !e.positionId?.trim() ? "指定組織職位發起時,需要選擇職位。" : null;
|
|
3251
3465
|
}
|
|
3252
|
-
function
|
|
3466
|
+
function bi(e, t) {
|
|
3253
3467
|
return [...e.matchAll(t)].map((e) => e[1]).filter((e) => !!e);
|
|
3254
3468
|
}
|
|
3255
|
-
function
|
|
3469
|
+
function xi(e, t) {
|
|
3256
3470
|
if (e.mode === "ALL" || e.mode === "NONE") return null;
|
|
3257
3471
|
let n = e.orgUnitId?.trim() ?? "";
|
|
3258
3472
|
if (!n) return null;
|
|
3259
|
-
let r =
|
|
3473
|
+
let r = Xi(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
|
|
3260
3474
|
if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
|
|
3261
3475
|
let i = e.positionId?.trim() ?? "";
|
|
3262
3476
|
return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
|
|
3263
3477
|
}
|
|
3264
|
-
function
|
|
3265
|
-
return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${
|
|
3478
|
+
function Si(e, t, n) {
|
|
3479
|
+
return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${Hi(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${Hi(t, e.orgUnitId)} / ${Ui(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
|
|
3266
3480
|
}
|
|
3267
|
-
function
|
|
3481
|
+
function Ci(e) {
|
|
3268
3482
|
return {
|
|
3269
3483
|
includeDescendants: !0,
|
|
3270
3484
|
mode: e,
|
|
@@ -3273,73 +3487,64 @@ function $r(e) {
|
|
|
3273
3487
|
value: ""
|
|
3274
3488
|
};
|
|
3275
3489
|
}
|
|
3276
|
-
function
|
|
3490
|
+
function wi(e, t) {
|
|
3277
3491
|
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;
|
|
3278
|
-
return !!n && !!r && e.source !== e.target && e.sourceHandle ===
|
|
3492
|
+
return !!n && !!r && e.source !== e.target && e.sourceHandle === or && e.targetHandle === ar && !!(n && Oi(n)) && !!(r && Di(r));
|
|
3279
3493
|
}
|
|
3280
|
-
function
|
|
3494
|
+
function Ti(e, t) {
|
|
3281
3495
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
3282
3496
|
}
|
|
3283
|
-
function
|
|
3497
|
+
function Ei(e) {
|
|
3284
3498
|
return e.type !== "startEvent" && e.type !== "endEvent";
|
|
3285
3499
|
}
|
|
3286
|
-
function
|
|
3500
|
+
function Di(e) {
|
|
3287
3501
|
return e.type !== "startEvent";
|
|
3288
3502
|
}
|
|
3289
|
-
function
|
|
3290
|
-
return e.type !== "endEvent" && !
|
|
3503
|
+
function Oi(e) {
|
|
3504
|
+
return e.type !== "endEvent" && !ki(e);
|
|
3291
3505
|
}
|
|
3292
|
-
function
|
|
3506
|
+
function ki(e) {
|
|
3293
3507
|
return e.type === "serviceTask" && e.data.action.type === "NOTIFY";
|
|
3294
3508
|
}
|
|
3295
|
-
function
|
|
3509
|
+
function Ai(e) {
|
|
3296
3510
|
return e instanceof HTMLElement ? e.isContentEditable || e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || !!e.closest("[contenteditable=\"true\"]") : !1;
|
|
3297
3511
|
}
|
|
3298
|
-
function
|
|
3512
|
+
function ji(e) {
|
|
3299
3513
|
return e.map((e) => ({
|
|
3300
3514
|
formDefinitionId: e.formDefinitionId,
|
|
3301
3515
|
formName: e.formName,
|
|
3302
3516
|
id: e.id,
|
|
3303
|
-
name:
|
|
3517
|
+
name: kn(e.formName, e.version),
|
|
3304
3518
|
schema: e.schema
|
|
3305
3519
|
}));
|
|
3306
3520
|
}
|
|
3307
|
-
function
|
|
3308
|
-
return (e?.schema.fields ?? []).reduce((e, t) => ({
|
|
3309
|
-
...e,
|
|
3310
|
-
[t.fieldKey]: li(t)
|
|
3311
|
-
}), {});
|
|
3312
|
-
}
|
|
3313
|
-
function li(e) {
|
|
3314
|
-
return e.type === "number" ? 1e3 : e.type === "boolean" ? !0 : we(e) ? e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.options[0]?.value ?? "" : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
|
|
3315
|
-
}
|
|
3316
|
-
function ui(e) {
|
|
3521
|
+
function Mi(e) {
|
|
3317
3522
|
let t = JSON.parse(e);
|
|
3318
|
-
if (!
|
|
3523
|
+
if (!Ni(t)) throw Error("表單資料 JSON 必須是物件。");
|
|
3319
3524
|
return t;
|
|
3320
3525
|
}
|
|
3321
|
-
function
|
|
3526
|
+
function Ni(e) {
|
|
3322
3527
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3323
3528
|
}
|
|
3324
|
-
function
|
|
3529
|
+
function Pi(e) {
|
|
3325
3530
|
return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
|
|
3326
3531
|
}
|
|
3327
|
-
function
|
|
3328
|
-
return e in
|
|
3532
|
+
function Fi(e) {
|
|
3533
|
+
return e in sr ? sr[e] : e;
|
|
3329
3534
|
}
|
|
3330
|
-
function
|
|
3535
|
+
function Ii(e, t) {
|
|
3331
3536
|
return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
|
|
3332
3537
|
}
|
|
3333
|
-
function
|
|
3538
|
+
function Li(e) {
|
|
3334
3539
|
return e.map((e) => ({
|
|
3335
3540
|
displayName: e.name,
|
|
3336
3541
|
email: e.email,
|
|
3337
3542
|
id: e.memberId,
|
|
3338
3543
|
memberId: e.memberId,
|
|
3339
|
-
name:
|
|
3544
|
+
name: oa(e.name, e.email)
|
|
3340
3545
|
}));
|
|
3341
3546
|
}
|
|
3342
|
-
function
|
|
3547
|
+
function Ri(e) {
|
|
3343
3548
|
return {
|
|
3344
3549
|
displayName: "未知會員",
|
|
3345
3550
|
email: "",
|
|
@@ -3349,101 +3554,101 @@ function hi(e) {
|
|
|
3349
3554
|
unresolved: !0
|
|
3350
3555
|
};
|
|
3351
3556
|
}
|
|
3352
|
-
function
|
|
3353
|
-
return e.find((e) => e.memberId === t) ??
|
|
3557
|
+
function zi(e, t) {
|
|
3558
|
+
return e.find((e) => e.memberId === t) ?? Ri(t);
|
|
3354
3559
|
}
|
|
3355
|
-
function
|
|
3560
|
+
function Bi(e, t) {
|
|
3356
3561
|
let n = e.find((e) => e.id === t);
|
|
3357
3562
|
return n ? r(n) : null;
|
|
3358
3563
|
}
|
|
3359
|
-
function
|
|
3564
|
+
function Vi(e, t) {
|
|
3360
3565
|
let n = e.find((e) => e.id === t);
|
|
3361
3566
|
return n ? a(n) : null;
|
|
3362
3567
|
}
|
|
3363
|
-
function
|
|
3364
|
-
return
|
|
3568
|
+
function Hi(e, t) {
|
|
3569
|
+
return Bi(e, t)?.name ?? "未指定組織";
|
|
3365
3570
|
}
|
|
3366
|
-
function
|
|
3367
|
-
return
|
|
3571
|
+
function Ui(e, t) {
|
|
3572
|
+
return Vi(e, t)?.name ?? "未指定職位";
|
|
3368
3573
|
}
|
|
3369
|
-
function
|
|
3370
|
-
let n =
|
|
3574
|
+
function Wi(e, t) {
|
|
3575
|
+
let n = Gi(), r = t.filter((t) => t.memberId === e && Ki(t, n)), i = r.reduce((e, t) => e && qi(e, t) <= 0 ? e : t, null);
|
|
3371
3576
|
return {
|
|
3372
3577
|
customFields: {},
|
|
3373
3578
|
managerMemberId: "member-002",
|
|
3374
3579
|
memberId: e,
|
|
3375
3580
|
orgCode: "HQ",
|
|
3376
|
-
orgUnitIds:
|
|
3581
|
+
orgUnitIds: Ji(r.map((e) => e.orgUnitId)),
|
|
3377
3582
|
positionId: i?.positionId ?? null,
|
|
3378
|
-
positionIds:
|
|
3583
|
+
positionIds: Ji(r.map((e) => e.positionId)),
|
|
3379
3584
|
primaryOrgUnitId: i?.orgUnitId ?? null,
|
|
3380
3585
|
roles: ["manager"]
|
|
3381
3586
|
};
|
|
3382
3587
|
}
|
|
3383
|
-
function
|
|
3588
|
+
function Gi() {
|
|
3384
3589
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
3385
3590
|
}
|
|
3386
|
-
function
|
|
3591
|
+
function Ki(e, t) {
|
|
3387
3592
|
return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
|
|
3388
3593
|
}
|
|
3389
|
-
function
|
|
3594
|
+
function qi(e, t) {
|
|
3390
3595
|
return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
|
|
3391
3596
|
}
|
|
3392
|
-
function
|
|
3597
|
+
function Ji(e) {
|
|
3393
3598
|
return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
|
|
3394
3599
|
}
|
|
3395
|
-
function
|
|
3396
|
-
let a = new Set(
|
|
3600
|
+
function Yi({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
|
|
3601
|
+
let a = new Set(Xi(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
|
|
3397
3602
|
return i.filter((e) => o.has(e.id));
|
|
3398
3603
|
}
|
|
3399
|
-
function
|
|
3604
|
+
function Xi(e, t, n) {
|
|
3400
3605
|
let r = e.find((e) => e.id === t);
|
|
3401
3606
|
return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
|
|
3402
3607
|
}
|
|
3403
|
-
function
|
|
3608
|
+
function Zi(e, t) {
|
|
3404
3609
|
let n = new Map(t.filter((e) => !e.unresolved).map((e) => [e.memberId, e])), r = new Set(e.map((e) => e.memberId)), i = t.filter((e) => !r.has(e.memberId)), a = e.map((e) => (e.unresolved ? n.get(e.memberId) : null) ?? e);
|
|
3405
3610
|
return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
|
|
3406
3611
|
}
|
|
3407
|
-
function
|
|
3408
|
-
return e.type === "DIRECT" ? e.memberIds : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && e.fallback.memberId ? [e.fallback.memberId] : [];
|
|
3612
|
+
function Qi(e) {
|
|
3613
|
+
return e.type === "DIRECT" ? e.memberIds : (e.type === "ORG_MANAGER" || e.type === "ORG_MANAGER_CHAIN" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && e.fallback.memberId ? [e.fallback.memberId] : [];
|
|
3409
3614
|
}
|
|
3410
|
-
function
|
|
3411
|
-
return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ?
|
|
3615
|
+
function $i(e) {
|
|
3616
|
+
return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? Qi(e.data.approverResolver) : e.type === "serviceTask" ? ya(e.data.action) : []))];
|
|
3412
3617
|
}
|
|
3413
|
-
function
|
|
3414
|
-
return e.type === "userTask" ?
|
|
3618
|
+
function ea(e, t, n, r, i) {
|
|
3619
|
+
return e.type === "userTask" ? ta(e.data.approverResolver, t, n, r, i) : null;
|
|
3415
3620
|
}
|
|
3416
|
-
function
|
|
3417
|
-
return e.type === "DIRECT" ?
|
|
3621
|
+
function ta(e, t, n, r, i) {
|
|
3622
|
+
return e.type === "DIRECT" ? aa(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? mi(e.levelsUp).name : e.type === "ORG_MANAGER_CHAIN" ? `主管鏈:簽到職等 ${e.minPositionLevel}` : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${Hi(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${Hi(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${Hi(n, e.orgUnitId)} / ${Ui(r, e.positionId)}` : e.type === "POSITION" ? `職位:${Ui(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? Dn(i, e.formPath) : "自訂表達式";
|
|
3418
3623
|
}
|
|
3419
|
-
function
|
|
3624
|
+
function na(e, t, n, r, i) {
|
|
3420
3625
|
if (e.type !== "serviceTask") return null;
|
|
3421
|
-
let
|
|
3422
|
-
return
|
|
3626
|
+
let a = e.data.action, o = a.type === "NOTIFY" && a.recipients.type !== "DIRECT" ? [ta(a.recipients, t, n, r, i)] : ya(a).map((e) => zi(t, e).name), s = mt(a).length, c = [...o, ...s ? [`Webhook ${s} 個`] : []];
|
|
3627
|
+
return c.length ? c : ["未指定知會對象"];
|
|
3423
3628
|
}
|
|
3424
|
-
function
|
|
3425
|
-
let t = e.type === "NOTIFY" && e.recipients.type !== "DIRECT" ? 1 :
|
|
3629
|
+
function ra(e) {
|
|
3630
|
+
let t = e.type === "NOTIFY" && e.recipients.type !== "DIRECT" ? 1 : ya(e).length, n = +!!mt(e).length;
|
|
3426
3631
|
return Math.max(1, t + n);
|
|
3427
3632
|
}
|
|
3428
|
-
function
|
|
3633
|
+
function ia(e, t, n) {
|
|
3429
3634
|
let r = e.nodes.find((e) => e.id === t);
|
|
3430
|
-
return r?.type === "serviceTask" && r.data.action.type === "NOTIFY" &&
|
|
3635
|
+
return r?.type === "serviceTask" && r.data.action.type === "NOTIFY" && Jt(r.data.action.webhooks) ? mt(r.data.action).map((e) => ({
|
|
3431
3636
|
key: e.id,
|
|
3432
|
-
label:
|
|
3637
|
+
label: Ht(n, e.endpoint)?.label ?? R(e.endpoint)
|
|
3433
3638
|
})) : [];
|
|
3434
3639
|
}
|
|
3435
|
-
function
|
|
3436
|
-
let r = e.map((e) =>
|
|
3640
|
+
function aa(e, t, n) {
|
|
3641
|
+
let r = e.map((e) => zi(t, e).name);
|
|
3437
3642
|
return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
|
|
3438
3643
|
}
|
|
3439
|
-
function
|
|
3644
|
+
function oa(e, t) {
|
|
3440
3645
|
return `${e} (${t})`;
|
|
3441
3646
|
}
|
|
3442
|
-
function
|
|
3647
|
+
function sa(e, t) {
|
|
3443
3648
|
let n = t?.getBoundingClientRect();
|
|
3444
3649
|
if (!n || e.nodes.length === 0) return null;
|
|
3445
3650
|
let r = e.nodes.reduce((e, t) => {
|
|
3446
|
-
let n =
|
|
3651
|
+
let n = Lr(t);
|
|
3447
3652
|
return {
|
|
3448
3653
|
maxX: Math.max(e.maxX, t.position.x + n.width),
|
|
3449
3654
|
maxY: Math.max(e.maxY, t.position.y + n.height),
|
|
@@ -3456,93 +3661,71 @@ function Li(e, t) {
|
|
|
3456
3661
|
minX: Infinity,
|
|
3457
3662
|
minY: Infinity
|
|
3458
3663
|
});
|
|
3459
|
-
return
|
|
3664
|
+
return Le({
|
|
3460
3665
|
height: r.maxY - r.minY,
|
|
3461
3666
|
width: r.maxX - r.minX,
|
|
3462
3667
|
x: r.minX,
|
|
3463
3668
|
y: r.minY
|
|
3464
3669
|
}, n.width, n.height, .1, 1, .2);
|
|
3465
3670
|
}
|
|
3466
|
-
function
|
|
3467
|
-
let t = e.nodes.find((e) => e.type === "userTask" && !!
|
|
3468
|
-
return t && t.type === "userTask" ?
|
|
3671
|
+
function ca(e) {
|
|
3672
|
+
let t = e.nodes.find((e) => e.type === "userTask" && !!ot(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "userTask" && !!lt(e.data.excludeInitiator)), r = e.nodes.map((e) => ut(e)).find((e) => e !== null) ?? null, i = e.edges.find((t) => _a(t, e.nodes) && !t.data.isDefault && !t.data.condition), a = e.nodes.find((e) => e.type === "userTask" && at(e.data.approverResolver, e.data.decisionPolicy));
|
|
3673
|
+
return t && t.type === "userTask" ? ot(t.data.approverResolver) : a && a.type === "userTask" ? `簽核節點「${a.data.label}」使用「沿主管鏈簽核」時,決策方式必須是「依序簽核或全部同意」,否則任一位主管簽完就會結案。` : n && n.type === "userTask" ? lt(n.data.excludeInitiator) : r || (i ? "條件分流的每條輸出連線都需要先設定條件。" : null);
|
|
3469
3674
|
}
|
|
3470
|
-
function
|
|
3675
|
+
function la(e) {
|
|
3471
3676
|
return e?.fields.map((e) => ({
|
|
3472
3677
|
fieldType: e.type,
|
|
3473
3678
|
id: e.fieldKey,
|
|
3474
3679
|
name: `${e.label} (${e.fieldKey})`
|
|
3475
3680
|
})) ?? [];
|
|
3476
3681
|
}
|
|
3477
|
-
function
|
|
3682
|
+
function ua(e, t) {
|
|
3478
3683
|
return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
|
|
3479
3684
|
}
|
|
3480
|
-
function
|
|
3685
|
+
function da(e) {
|
|
3481
3686
|
if (!e) return [];
|
|
3482
|
-
let t =
|
|
3483
|
-
return
|
|
3484
|
-
}
|
|
3485
|
-
function Hi(e) {
|
|
3486
|
-
return Kn.some((t) => t.id === e) ? e : null;
|
|
3487
|
-
}
|
|
3488
|
-
function Ui(e) {
|
|
3489
|
-
return e.type === "file_upload" ? ["IS_FILLED", "IS_EMPTY"] : e.type === "boolean" ? [
|
|
3490
|
-
"EQUALS",
|
|
3491
|
-
"NOT_EQUALS",
|
|
3492
|
-
"IS_FILLED",
|
|
3493
|
-
"IS_EMPTY"
|
|
3494
|
-
] : e.type === "date" || e.type === "datetime" || e.type === "money" || e.type === "number" ? [
|
|
3495
|
-
"EQUALS",
|
|
3496
|
-
"NOT_EQUALS",
|
|
3497
|
-
"GREATER_THAN",
|
|
3498
|
-
"GREATER_THAN_OR_EQUALS",
|
|
3499
|
-
"LESS_THAN",
|
|
3500
|
-
"LESS_THAN_OR_EQUALS",
|
|
3501
|
-
"IS_FILLED",
|
|
3502
|
-
"IS_EMPTY"
|
|
3503
|
-
] : [
|
|
3504
|
-
"EQUALS",
|
|
3505
|
-
"NOT_EQUALS",
|
|
3506
|
-
"IS_FILLED",
|
|
3507
|
-
"IS_EMPTY"
|
|
3508
|
-
];
|
|
3687
|
+
let t = st(e);
|
|
3688
|
+
return vr.filter((e) => t.includes(e.id));
|
|
3509
3689
|
}
|
|
3510
|
-
function
|
|
3690
|
+
function fa(e) {
|
|
3691
|
+
return vr.some((t) => t.id === e) ? e : null;
|
|
3692
|
+
}
|
|
3693
|
+
function pa(e) {
|
|
3511
3694
|
return e ? e.type === "boolean" ? [{
|
|
3512
3695
|
id: "true",
|
|
3513
3696
|
name: "是"
|
|
3514
3697
|
}, {
|
|
3515
3698
|
id: "false",
|
|
3516
3699
|
name: "否"
|
|
3517
|
-
}] :
|
|
3700
|
+
}] : Te(e) ? e.options.map((e) => ({
|
|
3518
3701
|
id: e.value,
|
|
3519
3702
|
name: e.label
|
|
3520
3703
|
})) : [] : [];
|
|
3521
3704
|
}
|
|
3522
|
-
function
|
|
3523
|
-
return
|
|
3705
|
+
function ma(e) {
|
|
3706
|
+
return yr.includes(e);
|
|
3524
3707
|
}
|
|
3525
|
-
function
|
|
3708
|
+
function ha(e, t) {
|
|
3526
3709
|
if (e.data.label) return e.data.label;
|
|
3527
|
-
if (
|
|
3528
|
-
if (
|
|
3710
|
+
if (_a(e, t)) return ga(e);
|
|
3711
|
+
if (va(e, t)) return "同時進行";
|
|
3529
3712
|
}
|
|
3530
|
-
function
|
|
3713
|
+
function ga(e) {
|
|
3531
3714
|
return e.data.isDefault ? "其他情況" : "請設定條件";
|
|
3532
3715
|
}
|
|
3533
|
-
function
|
|
3716
|
+
function _a(e, t) {
|
|
3534
3717
|
return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
|
|
3535
3718
|
}
|
|
3536
|
-
function
|
|
3719
|
+
function va(e, t) {
|
|
3537
3720
|
return t.some((t) => t.id === e.source && t.type === "parallelGateway");
|
|
3538
3721
|
}
|
|
3539
|
-
function
|
|
3722
|
+
function ya(e) {
|
|
3540
3723
|
return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
|
|
3541
3724
|
}
|
|
3542
|
-
function
|
|
3543
|
-
return e instanceof Error ? e.message.includes("WORKFLOW_WEBHOOK_") ? `Webhook 設定未通過發布檢查:${e.message}` :
|
|
3725
|
+
function ba(e) {
|
|
3726
|
+
return e instanceof Error ? e.message.includes("WORKFLOW_WEBHOOK_") ? `Webhook 設定未通過發布檢查:${e.message}` : we(e.message) : "發生未知錯誤";
|
|
3544
3727
|
}
|
|
3545
3728
|
//#endregion
|
|
3546
|
-
export {
|
|
3729
|
+
export { Ar as t };
|
|
3547
3730
|
|
|
3548
|
-
//# sourceMappingURL=designer-
|
|
3731
|
+
//# sourceMappingURL=designer-CrbBRPUU.js.map
|