@rytass/bpm-core-react 0.17.8 → 0.18.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 +58 -0
- package/README.md +8 -0
- package/dist/chunks/{FormBuilderView-ClLnQ1e_.js → FormBuilderView-BVKY1j_0.js} +504 -452
- package/dist/chunks/FormBuilderView-BVKY1j_0.js.map +1 -0
- package/dist/chunks/FormBuilderView-SrGltzFT.cjs +3 -0
- package/dist/chunks/FormBuilderView-SrGltzFT.cjs.map +1 -0
- package/dist/chunks/approver-filled-form-Dm3Iw7iw.cjs +2 -0
- package/dist/chunks/approver-filled-form-Dm3Iw7iw.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-DuQGPtNB.js → approver-filled-form-ZEwpmsHJ.js} +21 -8
- package/dist/chunks/approver-filled-form-ZEwpmsHJ.js.map +1 -0
- package/dist/chunks/{compose-jnvnnVfN.js → compose-B1GlrZW9.js} +3 -3
- package/dist/chunks/{compose-jnvnnVfN.js.map → compose-B1GlrZW9.js.map} +1 -1
- package/dist/chunks/{compose-Cock_B2Q.cjs → compose-DZk-SfHT.cjs} +2 -2
- package/dist/chunks/{compose-Cock_B2Q.cjs.map → compose-DZk-SfHT.cjs.map} +1 -1
- package/dist/chunks/{designer-B8Gvew_k.js → designer-BCLrjb4H.js} +886 -851
- package/dist/chunks/designer-BCLrjb4H.js.map +1 -0
- package/dist/chunks/designer-BYYxEN9L.cjs +65 -0
- package/dist/chunks/designer-BYYxEN9L.cjs.map +1 -0
- package/dist/chunks/{detail-D6X61pkg.js → detail-4F39ggBn.js} +883 -827
- package/dist/chunks/detail-4F39ggBn.js.map +1 -0
- package/dist/chunks/detail-BkMtA_0K.cjs +2 -0
- package/dist/chunks/detail-BkMtA_0K.cjs.map +1 -0
- package/dist/chunks/{orgs-Lg7tXv2u.js → orgs-8hje_l2n.js} +9 -4
- package/dist/chunks/orgs-8hje_l2n.js.map +1 -0
- package/dist/chunks/{orgs-C8usknWb.cjs → orgs-BeeDDWL1.cjs} +2 -2
- package/dist/chunks/orgs-BeeDDWL1.cjs.map +1 -0
- package/dist/chunks/users-O2L_M3BK.cjs +2 -0
- package/dist/chunks/users-O2L_M3BK.cjs.map +1 -0
- package/dist/chunks/{users-DRbuDYF1.js → users-Pl6hY5Y5.js} +160 -93
- package/dist/chunks/users-Pl6hY5Y5.js.map +1 -0
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/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/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +2 -2
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +159 -78
- 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/InstanceFormSection.d.cts +9 -1
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +9 -1
- package/dist/views/instances/detail/use-resubmit-comment-draft.d.cts +18 -0
- package/dist/views/instances/detail/use-resubmit-comment-draft.d.ts +18 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +15 -11
- package/dist/views/instances/new/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/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/FormBuilderView-CUOyS07f.cjs +0 -3
- package/dist/chunks/FormBuilderView-CUOyS07f.cjs.map +0 -1
- package/dist/chunks/FormBuilderView-ClLnQ1e_.js.map +0 -1
- package/dist/chunks/approver-filled-form-D1DmqDVP.cjs +0 -2
- package/dist/chunks/approver-filled-form-D1DmqDVP.cjs.map +0 -1
- package/dist/chunks/approver-filled-form-DuQGPtNB.js.map +0 -1
- package/dist/chunks/designer-B8Gvew_k.js.map +0 -1
- package/dist/chunks/designer-CAEFV1ve.cjs +0 -65
- package/dist/chunks/designer-CAEFV1ve.cjs.map +0 -1
- package/dist/chunks/detail-COh5sjAt.cjs +0 -2
- package/dist/chunks/detail-COh5sjAt.cjs.map +0 -1
- package/dist/chunks/detail-D6X61pkg.js.map +0 -1
- package/dist/chunks/orgs-C8usknWb.cjs.map +0 -1
- package/dist/chunks/orgs-Lg7tXv2u.js.map +0 -1
- package/dist/chunks/users-DRbuDYF1.js.map +0 -1
- package/dist/chunks/users-DVQicZIo.cjs +0 -2
- package/dist/chunks/users-DVQicZIo.cjs.map +0 -1
|
@@ -7,7 +7,7 @@ import { t as i } from "./format-member-label-DudVI55w.js";
|
|
|
7
7
|
import { a, n as o, o as s, r as c } from "./admin-pickers-Djq3h-UR.js";
|
|
8
8
|
import { n as l, r as u } from "./FormRendererView-BsTwZkqU.js";
|
|
9
9
|
import '../style.css';/* empty css */
|
|
10
|
-
import { t as d } from "./FormBuilderView-
|
|
10
|
+
import { t as d } from "./FormBuilderView-BVKY1j_0.js";
|
|
11
11
|
import { Fragment as f, useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
12
12
|
import { AutoComplete as v, Badge as y, Button as b, Icon as ee, InlineMessage as x, Input as te, Modal as ne, PageHeader as re, Section as ie, SectionGroup as ae, Select as S, Table as C, Tag as oe, Textarea as se, Toggle as w, Typography as T } from "@mezzanine-ui/react";
|
|
13
13
|
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
@@ -22,11 +22,11 @@ import { readOrganizationDirectory as Pe } from "@rytass/bpm-core-client/organiz
|
|
|
22
22
|
import { Background as Fe, ConnectionMode as Ie, ControlButton as Le, Controls as Re, Handle as F, MiniMap as ze, Panel as I, Position as L, ReactFlow as Be, applyNodeChanges as Ve, getViewportForBounds as He } from "@xyflow/react";
|
|
23
23
|
import * as Ue from "dagre";
|
|
24
24
|
import { composeApprovalTemplateWithForm as We, dryRunApprovalWorkflow as Ge, forkApprovalTemplate as Ke, listWorkflowWebhookEndpoints as qe, publishApprovalTemplateVersion as Je, readTemplateDesigner as Ye, readWorkflowLintMessage as Xe, resolveMemberOptions as Ze, searchMemberOptions as Qe, searchPublishedFormVersionOptions as $e, updateApprovalTemplateDraft as et } from "@rytass/bpm-core-client/template";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
25
|
+
import { DEFAULT_QUORUM_THRESHOLD as tt, DEFAULT_SLA_CONFIG as nt, NOTIFY_WEBHOOK_CONTEXT_PATHS as rt, NOTIFY_WEBHOOK_TARGET_LIMIT as it, SLA_CALENDAR_MODE_OPTIONS as at, SLA_DURATION_UNIT_OPTIONS as ot, SLA_TIMEOUT_ACTION_OPTIONS as st, composeQuorumThreshold as ct, composeSlaDuration as lt, createNotifyWebhookTarget as ut, hasConfiguredConditionEdges as dt, isDecisionPolicyUnsatisfiable as ft, isFormFieldCompatibleWithWebhookParameter as R, isNotifyWebhookContextPath as pt, isOrgManagerChainDecisionPolicyInvalid as mt, readApproverResolverIssue as z, readConditionOperator as ht, readConditionOperatorOptionsForField as gt, readDesignTimeApproverCount as _t, readExcludeInitiatorIssue as vt, readNotifyServiceTaskIssue as yt, readNotifyWebhookCatalogIssueMessage as bt, readNotifyWebhookStructureIssues as xt, readNotifyWebhookTargetCatalogIssues as St, readNotifyWebhookTargets as Ct, readSlaDurationParts as wt } from "@rytass/bpm-core-shared/workflow-graph";
|
|
26
|
+
import { useChat as Tt } from "@ai-sdk/react";
|
|
27
|
+
import { readUnsupportedApproverFallbackType as Et } from "@rytass/bpm-core-shared/workflow";
|
|
28
28
|
//#region src/views/templates/designer/decision-policy-options.ts
|
|
29
|
-
var
|
|
29
|
+
var Dt = [
|
|
30
30
|
{
|
|
31
31
|
id: "SINGLE",
|
|
32
32
|
name: "單人簽核"
|
|
@@ -48,22 +48,22 @@ var Ot = [
|
|
|
48
48
|
name: "達到指定門檻"
|
|
49
49
|
}
|
|
50
50
|
];
|
|
51
|
-
function
|
|
51
|
+
function Ot(e) {
|
|
52
52
|
if (!e || e.type === "SINGLE" || e.type === "PARALLEL_ANY") return "可指定多位;多位時所有人都會收到待辦,任一人同意即可通過。";
|
|
53
53
|
if (e.type === "PARALLEL_ALL") return "可指定多位;多位時所有人都會收到待辦,全部同意後才會通過。";
|
|
54
54
|
if (e.type === "SEQUENTIAL") return "依簽核人順序一次開放一位,前一位核准後才輪到下一位;任一位拒絕或退回即結束此關。";
|
|
55
55
|
let t = e.thresholdType === "PERCENTAGE" ? "%" : " 位簽核者";
|
|
56
56
|
return `可指定多位;需達到 ${e.threshold}${t} 才會通過。`;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function kt(e) {
|
|
59
|
+
return Dt.find((t) => t.id === e) || {
|
|
60
60
|
id: e,
|
|
61
61
|
name: `未知決策方式(${e})`
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/views/templates/designer/use-workflow-designer-controller.ts
|
|
66
|
-
function
|
|
66
|
+
function At({ directory: e, initialState: t, layout: n, onLayout: r }) {
|
|
67
67
|
let [i, a] = _(t), o = g(t), s = g(e);
|
|
68
68
|
s.current = e;
|
|
69
69
|
let c = p((e) => {
|
|
@@ -112,8 +112,8 @@ function jt({ directory: e, initialState: t, layout: n, onLayout: r }) {
|
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/views/templates/designer/use-workflow-chat.ts
|
|
115
|
-
function
|
|
116
|
-
let n = h(() => new A({ api: t }), [t]), r =
|
|
115
|
+
function jt({ controller: e, api: t = "/api/chat" }) {
|
|
116
|
+
let n = h(() => new A({ api: t }), [t]), r = Tt({
|
|
117
117
|
transport: n,
|
|
118
118
|
sendAutomaticallyWhen: be,
|
|
119
119
|
async onToolCall({ toolCall: t }) {
|
|
@@ -134,12 +134,12 @@ function Mt({ controller: e, api: t = "/api/chat" }) {
|
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/views/templates/designer/chrome-workflow-chat.ts
|
|
137
|
-
var
|
|
138
|
-
function
|
|
137
|
+
var Mt = 12;
|
|
138
|
+
function Nt() {
|
|
139
139
|
let e = globalThis.LanguageModel;
|
|
140
140
|
return e && typeof e == "object" ? e : null;
|
|
141
141
|
}
|
|
142
|
-
var
|
|
142
|
+
var Pt = {
|
|
143
143
|
additionalProperties: !1,
|
|
144
144
|
properties: {
|
|
145
145
|
action: {
|
|
@@ -153,7 +153,7 @@ var Ft = {
|
|
|
153
153
|
required: ["action"],
|
|
154
154
|
type: "object"
|
|
155
155
|
};
|
|
156
|
-
function
|
|
156
|
+
function Ft() {
|
|
157
157
|
return `你是「簽核流程設計器」頁面的離線 AI 助理。只能透過下列工具操作這個流程畫布,其他請求一律婉拒並引導回流程設計。
|
|
158
158
|
|
|
159
159
|
每一步只輸出一個 JSON 決策物件:
|
|
@@ -165,10 +165,10 @@ function It() {
|
|
|
165
165
|
可用工具:
|
|
166
166
|
${Se.map((e) => `- ${e.name}(${JSON.stringify(e.inputSchema.properties ?? {})}): ${e.description}`).join("\n")}`;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function It({ controller: e }) {
|
|
169
169
|
let [t, n] = _(!1), [r, i] = _([]), [a, o] = _("ready"), s = g(0);
|
|
170
170
|
m(() => {
|
|
171
|
-
let e =
|
|
171
|
+
let e = Nt();
|
|
172
172
|
e && e.availability().then((e) => {
|
|
173
173
|
n(e !== "unavailable");
|
|
174
174
|
}).catch(() => n(!1));
|
|
@@ -187,14 +187,14 @@ function Lt({ controller: e }) {
|
|
|
187
187
|
available: t,
|
|
188
188
|
messages: r,
|
|
189
189
|
send: p((t) => {
|
|
190
|
-
let n =
|
|
191
|
-
n && a === "ready" && (c("user", t), o("submitted"),
|
|
190
|
+
let n = Nt();
|
|
191
|
+
n && a === "ready" && (c("user", t), o("submitted"), B({
|
|
192
192
|
appendMessage: c,
|
|
193
193
|
controller: e,
|
|
194
194
|
model: n,
|
|
195
195
|
userText: t
|
|
196
196
|
}).then(() => o("ready")).catch((e) => {
|
|
197
|
-
c("assistant",
|
|
197
|
+
c("assistant", Rt(e)), o("error");
|
|
198
198
|
}));
|
|
199
199
|
}, [
|
|
200
200
|
c,
|
|
@@ -204,15 +204,15 @@ function Lt({ controller: e }) {
|
|
|
204
204
|
status: a
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
207
|
+
async function B({ appendMessage: e, controller: t, model: n, userText: r }) {
|
|
208
208
|
let i = await n.create({ initialPrompts: [{
|
|
209
|
-
content:
|
|
209
|
+
content: Ft(),
|
|
210
210
|
role: "system"
|
|
211
211
|
}] });
|
|
212
212
|
try {
|
|
213
213
|
let n = `使用者需求:${r}\n目前流程:${JSON.stringify(t.snapshot)}`;
|
|
214
|
-
for (let r = 0; r <
|
|
215
|
-
let r =
|
|
214
|
+
for (let r = 0; r < Mt; r += 1) {
|
|
215
|
+
let r = Lt(await i.prompt(n, { responseConstraint: Pt }));
|
|
216
216
|
if (!r || r.action === "message") {
|
|
217
217
|
e("assistant", r?.text ?? "我已完成可處理的部分。");
|
|
218
218
|
return;
|
|
@@ -232,7 +232,7 @@ async function z({ appendMessage: e, controller: t, model: n, userText: r }) {
|
|
|
232
232
|
i.destroy();
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Lt(e) {
|
|
236
236
|
try {
|
|
237
237
|
let t = JSON.parse(e);
|
|
238
238
|
return typeof t == "object" && t && t.action !== void 0 ? t : null;
|
|
@@ -240,51 +240,51 @@ function Rt(e) {
|
|
|
240
240
|
return null;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Rt(e) {
|
|
244
244
|
return e instanceof Error ? `離線模式發生錯誤:${e.message}` : "離線模式發生未知錯誤。";
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
247
|
//#region src/views/templates/designer/workflow-chat-drawer.tsx
|
|
248
|
-
var
|
|
248
|
+
var zt = {
|
|
249
249
|
display: "flex",
|
|
250
250
|
flexDirection: "column",
|
|
251
251
|
gap: 12,
|
|
252
252
|
height: "100%"
|
|
253
|
-
},
|
|
253
|
+
}, Bt = {
|
|
254
254
|
display: "flex",
|
|
255
255
|
flex: 1,
|
|
256
256
|
flexDirection: "column",
|
|
257
257
|
gap: 12,
|
|
258
258
|
minHeight: 0,
|
|
259
259
|
overflowY: "auto"
|
|
260
|
-
},
|
|
260
|
+
}, Vt = {
|
|
261
261
|
display: "flex",
|
|
262
262
|
gap: 8,
|
|
263
263
|
paddingBottom: 4
|
|
264
|
-
},
|
|
264
|
+
}, V = {
|
|
265
265
|
borderTop: "1px solid var(--mzn-color-border-neutral, #e5e7eb)",
|
|
266
266
|
display: "flex",
|
|
267
267
|
flexDirection: "column",
|
|
268
268
|
gap: 8,
|
|
269
269
|
paddingTop: 12
|
|
270
|
-
},
|
|
270
|
+
}, Ht = {
|
|
271
271
|
display: "flex",
|
|
272
272
|
justifyContent: "flex-end"
|
|
273
|
-
},
|
|
274
|
-
.${
|
|
273
|
+
}, H = { width: "100%" }, Ut = "workflow-chat-input-field", Wt = `
|
|
274
|
+
.${Ut}.mzn-text-field {
|
|
275
275
|
width: 100%;
|
|
276
276
|
}
|
|
277
|
-
`,
|
|
277
|
+
`, Gt = {
|
|
278
278
|
color: "var(--mzn-color-text-secondary, #6b7280)",
|
|
279
279
|
fontSize: 12,
|
|
280
280
|
padding: "2px 0"
|
|
281
|
-
},
|
|
281
|
+
}, Kt = {
|
|
282
282
|
"input-available": "執行中…",
|
|
283
283
|
"input-streaming": "準備中…",
|
|
284
284
|
"output-available": "完成",
|
|
285
285
|
"output-error": "失敗"
|
|
286
286
|
};
|
|
287
|
-
function
|
|
287
|
+
function qt(e) {
|
|
288
288
|
let t = e === "user";
|
|
289
289
|
return {
|
|
290
290
|
alignSelf: t ? "flex-end" : "flex-start",
|
|
@@ -297,11 +297,11 @@ function Jt(e) {
|
|
|
297
297
|
wordBreak: "break-word"
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
let i =
|
|
300
|
+
function Jt({ api: e, controller: t, onClose: n, open: r }) {
|
|
301
|
+
let i = jt({
|
|
302
302
|
api: e,
|
|
303
303
|
controller: t
|
|
304
|
-
}), a =
|
|
304
|
+
}), a = It({ controller: t }), [o, s] = _("online"), [c, l] = _(""), u = o === "offline" ? {
|
|
305
305
|
messages: a.messages,
|
|
306
306
|
send: a.send,
|
|
307
307
|
status: a.status
|
|
@@ -327,11 +327,11 @@ function Yt({ api: e, controller: t, onClose: n, open: r }) {
|
|
|
327
327
|
onClose: n,
|
|
328
328
|
open: r,
|
|
329
329
|
size: "medium",
|
|
330
|
-
children: [/* @__PURE__ */ D("style", { children:
|
|
331
|
-
style:
|
|
330
|
+
children: [/* @__PURE__ */ D("style", { children: Wt }), /* @__PURE__ */ O("div", {
|
|
331
|
+
style: zt,
|
|
332
332
|
children: [
|
|
333
333
|
a.available ? /* @__PURE__ */ O("div", {
|
|
334
|
-
style:
|
|
334
|
+
style: Vt,
|
|
335
335
|
children: [/* @__PURE__ */ D(b, {
|
|
336
336
|
onClick: () => s("online"),
|
|
337
337
|
variant: o === "online" ? "base-primary" : "base-tertiary",
|
|
@@ -344,14 +344,14 @@ function Yt({ api: e, controller: t, onClose: n, open: r }) {
|
|
|
344
344
|
}) : null,
|
|
345
345
|
/* @__PURE__ */ O("div", {
|
|
346
346
|
role: "log",
|
|
347
|
-
style:
|
|
347
|
+
style: Bt,
|
|
348
348
|
children: [
|
|
349
349
|
d.length === 0 ? /* @__PURE__ */ D(T, {
|
|
350
350
|
color: "text-neutral",
|
|
351
351
|
variant: "body",
|
|
352
352
|
children: "用一句話描述你想要的流程,例如:「建立三關簽核:部門主管 → 經理 → 財務,金額大於十萬走財務複核」。我會直接在畫布上幫你繪製。"
|
|
353
353
|
}) : null,
|
|
354
|
-
d.map((e) => /* @__PURE__ */ D(f, { children:
|
|
354
|
+
d.map((e) => /* @__PURE__ */ D(f, { children: Yt(e) }, e.id)),
|
|
355
355
|
h ? /* @__PURE__ */ D(T, {
|
|
356
356
|
color: "text-neutral",
|
|
357
357
|
variant: "body",
|
|
@@ -360,19 +360,19 @@ function Yt({ api: e, controller: t, onClose: n, open: r }) {
|
|
|
360
360
|
]
|
|
361
361
|
}),
|
|
362
362
|
/* @__PURE__ */ O("div", {
|
|
363
|
-
style:
|
|
363
|
+
style: V,
|
|
364
364
|
children: [/* @__PURE__ */ D(se, {
|
|
365
|
-
className:
|
|
365
|
+
className: Ut,
|
|
366
366
|
disabled: h,
|
|
367
367
|
maxLength: 2e3,
|
|
368
368
|
onChange: (e) => l(e.target.value),
|
|
369
369
|
onKeyDown: v,
|
|
370
370
|
placeholder: "描述你想要的流程…(Enter 送出,Shift + Enter 換行)",
|
|
371
371
|
rows: 3,
|
|
372
|
-
style:
|
|
372
|
+
style: H,
|
|
373
373
|
value: c
|
|
374
374
|
}), /* @__PURE__ */ D("div", {
|
|
375
|
-
style:
|
|
375
|
+
style: Ht,
|
|
376
376
|
children: /* @__PURE__ */ D(b, {
|
|
377
377
|
disabled: h || c.trim().length === 0,
|
|
378
378
|
loading: h,
|
|
@@ -387,16 +387,16 @@ function Yt({ api: e, controller: t, onClose: n, open: r }) {
|
|
|
387
387
|
})]
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function Yt(e) {
|
|
391
391
|
return e.parts.map((t, n) => {
|
|
392
392
|
if (t.type === "text") return /* @__PURE__ */ D("div", {
|
|
393
|
-
style:
|
|
393
|
+
style: qt(e.role),
|
|
394
394
|
children: t.text
|
|
395
395
|
}, `${e.id}-${n}`);
|
|
396
396
|
if (t.type === "dynamic-tool" || ye(t)) {
|
|
397
|
-
let r = ve(t), i =
|
|
397
|
+
let r = ve(t), i = Kt[t.state] ?? t.state;
|
|
398
398
|
return /* @__PURE__ */ D("div", {
|
|
399
|
-
style:
|
|
399
|
+
style: Gt,
|
|
400
400
|
children: `⚙ ${r} · ${i}`
|
|
401
401
|
}, `${e.id}-${n}`);
|
|
402
402
|
}
|
|
@@ -405,29 +405,29 @@ function Xt(e) {
|
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/views/templates/designer/field-access-matrix/field-access-copy.ts
|
|
408
|
-
var
|
|
408
|
+
var Xt = {
|
|
409
409
|
DEFAULT: "預設",
|
|
410
410
|
FILL_OPTIONAL: "補填(選填)",
|
|
411
411
|
FILL_REQUIRED: "補填(必填)",
|
|
412
412
|
HIDE: "隱藏",
|
|
413
413
|
SHOW: "顯示"
|
|
414
|
-
},
|
|
414
|
+
}, Zt = {
|
|
415
415
|
FILL: "填寫",
|
|
416
416
|
FILL_OPTIONAL: "補填(選填)",
|
|
417
417
|
FILL_REQUIRED: "補填(必填)",
|
|
418
418
|
HIDDEN: "隱藏",
|
|
419
419
|
NOT_SHOWN: "不顯示",
|
|
420
420
|
READ_ONLY: "唯讀"
|
|
421
|
-
},
|
|
421
|
+
}, Qt = {
|
|
422
422
|
approverFilledFieldDataSource: "選項來自資料來源,不能補填",
|
|
423
423
|
approverFilledFieldFileUpload: "檔案上傳欄位不能補填",
|
|
424
424
|
approverFilledFieldFormRule: "表單已設定必填、顯示或預設值等規則,不能補填",
|
|
425
425
|
approverFilledTableDataSourceColumn: "表格含資料來源欄,不能補填"
|
|
426
|
-
},
|
|
427
|
-
function
|
|
426
|
+
}, $t = "開關欄位只能選填補填:開關關著也是答案,不能要求必填。", en = "「隱藏」只影響這一關的畫面,不是權限:資料查詢仍拿得到值,不能用來保密。";
|
|
427
|
+
function U(e) {
|
|
428
428
|
return `關卡 ${e.stage}`;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function tn(e) {
|
|
431
431
|
let t = ke(e);
|
|
432
432
|
return {
|
|
433
433
|
fill: t.filter((e) => e.fill !== "NONE").length,
|
|
@@ -435,57 +435,57 @@ function nn(e) {
|
|
|
435
435
|
required: t.filter((e) => e.fill === "REQUIRED").length
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
let { fill: t, hidden: n } =
|
|
438
|
+
function nn(e) {
|
|
439
|
+
let { fill: t, hidden: n } = tn(e), r = [...t > 0 ? [`補填 ${t}`] : [], ...n > 0 ? [`隱藏 ${n}`] : []];
|
|
440
440
|
return r.length ? r.join(" · ") : null;
|
|
441
441
|
}
|
|
442
|
-
var
|
|
442
|
+
var rn = /* @__PURE__ */ new Set([
|
|
443
443
|
"fieldAccessAutoApprove",
|
|
444
444
|
"fieldAccessGroupPolicy",
|
|
445
445
|
"fieldAccessSkipNode"
|
|
446
446
|
]);
|
|
447
|
-
function
|
|
448
|
-
return
|
|
447
|
+
function an(e) {
|
|
448
|
+
return rn.has(e.code);
|
|
449
449
|
}
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region src/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.tsx
|
|
452
|
-
var
|
|
452
|
+
var on = {
|
|
453
453
|
display: "grid",
|
|
454
454
|
gap: 12,
|
|
455
455
|
gridTemplateColumns: "minmax(0, 1fr)",
|
|
456
456
|
padding: "var(--mzn-spacing-padding-vertical-spacious) var(--mzn-spacing-padding-horizontal-spacious)"
|
|
457
|
-
},
|
|
457
|
+
}, sn = {
|
|
458
458
|
display: "grid",
|
|
459
459
|
gap: 4
|
|
460
|
-
},
|
|
461
|
-
function
|
|
460
|
+
}, cn = { display: "grid" };
|
|
461
|
+
function ln(e) {
|
|
462
462
|
return e.nodes.filter((e) => e.type === "userTask").flatMap((e) => ke(e).filter(Ee).map((t) => ({
|
|
463
463
|
...t,
|
|
464
464
|
nodeId: e.id
|
|
465
465
|
})));
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function un(e, t, n, r) {
|
|
468
468
|
let i = e.findIndex((e) => e.nodeId === t && e.fieldKey === n);
|
|
469
469
|
return i === -1 ? r === null ? e : [...e, r] : e.flatMap((e, t) => t === i ? r === null ? [] : [r] : [e]);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function dn(e, t, n, r) {
|
|
472
472
|
let i = De(n, r);
|
|
473
|
-
return
|
|
473
|
+
return un(e, t, n, i === null ? null : {
|
|
474
474
|
...i,
|
|
475
475
|
nodeId: t
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function W(e) {
|
|
479
479
|
return `${e.nodeId}\u0000${e.fieldKey}`;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
let i = new Map(t.map((e) => [
|
|
483
|
-
return [...t, ...n].filter((e, t, n) => n.findIndex((t) =>
|
|
481
|
+
function G(e, t, n, r) {
|
|
482
|
+
let i = new Map(t.map((e) => [W(e), e])), a = new Map(n.map((e) => [W(e), e]));
|
|
483
|
+
return [...t, ...n].filter((e, t, n) => n.findIndex((t) => W(t) === W(e)) === t && JSON.stringify(i.get(W(e))) !== JSON.stringify(a.get(W(e)))).reduce((e, t) => un(e, t.nodeId, t.fieldKey, a.get(W(t)) ?? null), e).filter((e) => r.has(e.nodeId));
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function fn(e) {
|
|
486
486
|
return new Set(e.nodes.filter((e) => e.type === "userTask").map((e) => e.id));
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function pn(e, t, n) {
|
|
489
489
|
return Ce({
|
|
490
490
|
definition: e,
|
|
491
491
|
editingEdgeId: null,
|
|
@@ -499,16 +499,16 @@ function mn(e, t, n) {
|
|
|
499
499
|
type: "setFieldAccessMatrix"
|
|
500
500
|
}).state.definition;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
return e.nodes.every((t) => t.type !== "userTask" || t.data.fieldAccess === void 0 ||
|
|
502
|
+
function mn(e) {
|
|
503
|
+
return e.nodes.every((t) => t.type !== "userTask" || t.data.fieldAccess === void 0 || hn(t.data.fieldAccess) === hn(ln({
|
|
504
504
|
...e,
|
|
505
505
|
nodes: [t]
|
|
506
506
|
})));
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
return JSON.stringify(Array.isArray(e) ? e.map(
|
|
508
|
+
function hn(e) {
|
|
509
|
+
return JSON.stringify(Array.isArray(e) ? e.map(gn) : e);
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function gn(e) {
|
|
512
512
|
if (typeof e != "object" || !e || Array.isArray(e)) return e;
|
|
513
513
|
let { display: t, fieldKey: n, fill: r } = e;
|
|
514
514
|
return [
|
|
@@ -517,61 +517,61 @@ function _n(e) {
|
|
|
517
517
|
r
|
|
518
518
|
];
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function _n(e, t) {
|
|
521
521
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
522
522
|
}
|
|
523
|
-
var
|
|
523
|
+
var vn = {
|
|
524
524
|
columns: [],
|
|
525
525
|
issues: [],
|
|
526
526
|
rows: []
|
|
527
527
|
};
|
|
528
|
-
function
|
|
529
|
-
let n =
|
|
528
|
+
function K(e, t) {
|
|
529
|
+
let n = ln(e);
|
|
530
530
|
return {
|
|
531
531
|
draft: n,
|
|
532
532
|
initial: n,
|
|
533
|
-
pinnedFieldKeys: new Set(Oe(e, t).rows.filter(
|
|
533
|
+
pinnedFieldKeys: new Set(Oe(e, t).rows.filter(yn).map((e) => e.fieldKey))
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function yn(e) {
|
|
537
537
|
return e.cells.some((e) => e.explicit !== null) || e.issues.length > 0 || e.notices.length > 0;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function bn(e) {
|
|
540
540
|
return xe.filter((t) => t === e.choice || !e.disabledChoices.includes(t)).map((t) => ({
|
|
541
541
|
id: t,
|
|
542
|
-
name: t === "DEFAULT" && e.choice === "DEFAULT" ? `預設:${
|
|
542
|
+
name: t === "DEFAULT" && e.choice === "DEFAULT" ? `預設:${Zt[e.effective]}` : Xt[t]
|
|
543
543
|
}));
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
if (e.applicant.effective === "FILL") return
|
|
547
|
-
let n = e.fillNodeIds.map((e) => t.find((t) => t.nodeId === e)).filter((e) => !!e).map(
|
|
548
|
-
return `${
|
|
545
|
+
function xn(e, t) {
|
|
546
|
+
if (e.applicant.effective === "FILL") return Zt.FILL;
|
|
547
|
+
let n = e.fillNodeIds.map((e) => t.find((t) => t.nodeId === e)).filter((e) => !!e).map(U).join("、");
|
|
548
|
+
return `${Zt.NOT_SHOWN}(${n} 補填)`;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Sn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i, open: a }) {
|
|
551
551
|
let [o, s] = _(null), [c, l] = _(!0), [u, d] = _(null);
|
|
552
552
|
if (a && o === null) {
|
|
553
|
-
let n =
|
|
553
|
+
let n = K(e, t);
|
|
554
554
|
s(n), l(n.pinnedFieldKeys.size > 0), d(null);
|
|
555
555
|
}
|
|
556
556
|
!a && o !== null && s(null);
|
|
557
|
-
let f = h(() => o === null ? null :
|
|
557
|
+
let f = h(() => o === null ? null : G(ln(e), o.initial, o.draft, fn(e)), [e, o]), p = h(() => f === null ? e : pn(e, t, f), [
|
|
558
558
|
e,
|
|
559
559
|
f,
|
|
560
560
|
t
|
|
561
|
-
]), m = h(() => f === null ?
|
|
561
|
+
]), m = h(() => f === null ? vn : Oe(p, t), [
|
|
562
562
|
p,
|
|
563
563
|
f,
|
|
564
564
|
t
|
|
565
|
-
]), g = o?.pinnedFieldKeys ?? /* @__PURE__ */ new Set(), v = (e) => Xe(e, p, n), b = m.rows.filter((e) => !c || g.has(e.fieldKey) ||
|
|
565
|
+
]), g = o?.pinnedFieldKeys ?? /* @__PURE__ */ new Set(), v = (e) => Xe(e, p, n), b = m.rows.filter((e) => !c || g.has(e.fieldKey) || yn(e)), ee = m.rows.length - b.length, te = new Set(m.rows.map((e) => e.fieldKey)), ne = m.issues.filter((e) => !e.fieldKeys.some((e) => te.has(e)));
|
|
566
566
|
function re(e, t, n) {
|
|
567
567
|
d(null), s((r) => r === null ? null : {
|
|
568
568
|
...r,
|
|
569
|
-
draft:
|
|
569
|
+
draft: dn(r.draft, e, t, n),
|
|
570
570
|
pinnedFieldKeys: /* @__PURE__ */ new Set([...r.pinnedFieldKeys, t])
|
|
571
571
|
});
|
|
572
572
|
}
|
|
573
573
|
function ie() {
|
|
574
|
-
let t = f === null ||
|
|
574
|
+
let t = f === null || _n(f, ln(e)) && mn(e) ? null : r(f);
|
|
575
575
|
t === null ? i() : d(t);
|
|
576
576
|
}
|
|
577
577
|
let ae = [
|
|
@@ -580,7 +580,7 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
580
580
|
fixed: "start",
|
|
581
581
|
key: "field",
|
|
582
582
|
render: ({ row: e }) => /* @__PURE__ */ O("div", {
|
|
583
|
-
style:
|
|
583
|
+
style: cn,
|
|
584
584
|
children: [/* @__PURE__ */ D(T, {
|
|
585
585
|
variant: "label-primary",
|
|
586
586
|
children: e.field.label
|
|
@@ -596,7 +596,7 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
596
596
|
{
|
|
597
597
|
ellipsis: !1,
|
|
598
598
|
key: "applicant",
|
|
599
|
-
render: ({ row: e }) =>
|
|
599
|
+
render: ({ row: e }) => xn(e, m.columns),
|
|
600
600
|
title: "申請人",
|
|
601
601
|
width: 160
|
|
602
602
|
},
|
|
@@ -604,10 +604,10 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
604
604
|
ellipsis: !1,
|
|
605
605
|
key: `node:${e.nodeId}`,
|
|
606
606
|
render: ({ row: n }) => {
|
|
607
|
-
let r = n.cells[t], i =
|
|
607
|
+
let r = n.cells[t], i = bn(r);
|
|
608
608
|
return /* @__PURE__ */ D(S, {
|
|
609
609
|
clearable: !1,
|
|
610
|
-
inputProps: { "aria-label": `${n.field.label} 在${
|
|
610
|
+
inputProps: { "aria-label": `${n.field.label} 在${U(e)}的設定` },
|
|
611
611
|
onChange: (t) => re(e.nodeId, n.fieldKey, i.find((e) => e.id === t?.id)?.id ?? "DEFAULT"),
|
|
612
612
|
options: [...i],
|
|
613
613
|
size: "sub",
|
|
@@ -615,11 +615,11 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
615
615
|
});
|
|
616
616
|
},
|
|
617
617
|
title: /* @__PURE__ */ O("div", {
|
|
618
|
-
style:
|
|
618
|
+
style: sn,
|
|
619
619
|
children: [/* @__PURE__ */ O(T, {
|
|
620
620
|
color: "text-neutral",
|
|
621
621
|
variant: "caption",
|
|
622
|
-
children: [
|
|
622
|
+
children: [U(e), e.branchLabel ? ` · 分支:${e.branchLabel}` : ""]
|
|
623
623
|
}), /* @__PURE__ */ D(T, {
|
|
624
624
|
variant: "label-primary",
|
|
625
625
|
children: e.label
|
|
@@ -638,16 +638,16 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
638
638
|
function oe(e) {
|
|
639
639
|
let t = e.issues.map((e) => v(e.message)), n = e.notices.map((e) => {
|
|
640
640
|
let t = m.columns.find((t) => t.nodeId === e.nodeId);
|
|
641
|
-
return `${t ?
|
|
641
|
+
return `${t ? U(t) : e.nodeId} 會看到空白欄位:這一關之前還沒有人補填。`;
|
|
642
642
|
}), r = e.fillNodeIds.length === 0 ? [...e.fillBlockers.flatMap((e) => {
|
|
643
|
-
let t =
|
|
643
|
+
let t = Qt[e.code];
|
|
644
644
|
return t ? [t] : [];
|
|
645
|
-
}), ...e.field.type === "boolean" ? [
|
|
645
|
+
}), ...e.field.type === "boolean" ? [$t] : []] : [];
|
|
646
646
|
return t.length + n.length + r.length === 0 ? /* @__PURE__ */ D(y, {
|
|
647
647
|
text: "沒有問題",
|
|
648
648
|
variant: "dot-success"
|
|
649
649
|
}) : /* @__PURE__ */ O("div", {
|
|
650
|
-
style:
|
|
650
|
+
style: sn,
|
|
651
651
|
children: [
|
|
652
652
|
t.map((e) => /* @__PURE__ */ D(y, {
|
|
653
653
|
text: e,
|
|
@@ -676,10 +676,10 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
676
676
|
open: a,
|
|
677
677
|
size: "wide",
|
|
678
678
|
children: /* @__PURE__ */ O("div", {
|
|
679
|
-
style:
|
|
679
|
+
style: on,
|
|
680
680
|
children: [
|
|
681
681
|
u === null ? null : /* @__PURE__ */ O("div", {
|
|
682
|
-
style:
|
|
682
|
+
style: sn,
|
|
683
683
|
children: [/* @__PURE__ */ D(x, {
|
|
684
684
|
content: "無法套用,編輯內容仍保留。",
|
|
685
685
|
severity: "error"
|
|
@@ -689,7 +689,7 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
689
689
|
})]
|
|
690
690
|
}),
|
|
691
691
|
/* @__PURE__ */ O("div", {
|
|
692
|
-
style:
|
|
692
|
+
style: sn,
|
|
693
693
|
children: [
|
|
694
694
|
m.issues.length > 0 ? /* @__PURE__ */ D(x, {
|
|
695
695
|
content: `有 ${m.issues.length} 個欄位設定問題,處理完才能發布。`,
|
|
@@ -701,7 +701,7 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
701
701
|
/* @__PURE__ */ D(T, {
|
|
702
702
|
color: "text-neutral",
|
|
703
703
|
variant: "caption",
|
|
704
|
-
children: m.issues.length > 0 ? "問題標示在各欄位的「檢查」欄。" : `申請人送出時看不到補填欄位。${
|
|
704
|
+
children: m.issues.length > 0 ? "問題標示在各欄位的「檢查」欄。" : `申請人送出時看不到補填欄位。${en}發布時還會檢查條件是否在補填前就讀取這些欄位。`
|
|
705
705
|
}),
|
|
706
706
|
ne.map((e) => /* @__PURE__ */ D(y, {
|
|
707
707
|
text: v(e.message),
|
|
@@ -743,25 +743,25 @@ function Cn({ definition: e, formSchema: t, language: n, onApply: r, onClose: i,
|
|
|
743
743
|
}
|
|
744
744
|
//#endregion
|
|
745
745
|
//#region src/views/templates/designer/field-access-matrix/FieldAccessNodeSection.tsx
|
|
746
|
-
var
|
|
746
|
+
var Cn = {
|
|
747
747
|
borderTop: "1px solid var(--mzn-color-border-neutral)",
|
|
748
748
|
display: "grid",
|
|
749
749
|
gap: 8,
|
|
750
750
|
paddingTop: 12
|
|
751
|
-
},
|
|
751
|
+
}, wn = {
|
|
752
752
|
alignItems: "center",
|
|
753
753
|
display: "flex",
|
|
754
754
|
gap: 8,
|
|
755
755
|
justifyContent: "space-between"
|
|
756
756
|
};
|
|
757
|
-
function
|
|
758
|
-
let o =
|
|
757
|
+
function Tn({ definition: e, language: t, node: n, onOpenMatrix: r, onRemoveLegacy: i, openDisabledReason: a }) {
|
|
758
|
+
let o = tn(n), s = Ae(n).filter(an).map((n) => Xe(n.message, e, t));
|
|
759
759
|
return /* @__PURE__ */ O("section", {
|
|
760
760
|
"aria-label": "欄位顯示與補填",
|
|
761
|
-
style:
|
|
761
|
+
style: Cn,
|
|
762
762
|
children: [
|
|
763
763
|
/* @__PURE__ */ O("div", {
|
|
764
|
-
style:
|
|
764
|
+
style: wn,
|
|
765
765
|
children: [/* @__PURE__ */ D(T, {
|
|
766
766
|
component: "h3",
|
|
767
767
|
variant: "h3",
|
|
@@ -808,7 +808,7 @@ function En({ definition: e, language: t, node: n, onOpenMatrix: r, onRemoveLega
|
|
|
808
808
|
/* @__PURE__ */ D(T, {
|
|
809
809
|
color: "text-neutral",
|
|
810
810
|
variant: "caption",
|
|
811
|
-
children:
|
|
811
|
+
children: en
|
|
812
812
|
}),
|
|
813
813
|
n.data.fieldPermissions === void 0 ? null : /* @__PURE__ */ O(E, { children: [
|
|
814
814
|
/* @__PURE__ */ D(x, {
|
|
@@ -836,21 +836,21 @@ function En({ definition: e, language: t, node: n, onOpenMatrix: r, onRemoveLega
|
|
|
836
836
|
}
|
|
837
837
|
//#endregion
|
|
838
838
|
//#region src/views/templates/template-error-message.ts
|
|
839
|
-
var
|
|
839
|
+
var En = {
|
|
840
840
|
en: "An unknown error occurred",
|
|
841
841
|
"zh-TW": "發生未知錯誤"
|
|
842
|
-
},
|
|
842
|
+
}, q = {
|
|
843
843
|
en: "Webhook settings failed the publish check: ",
|
|
844
844
|
"zh-TW": "Webhook 設定未通過發布檢查:"
|
|
845
845
|
};
|
|
846
|
-
function
|
|
847
|
-
if (!(e instanceof Error)) return
|
|
846
|
+
function J(e, t, n) {
|
|
847
|
+
if (!(e instanceof Error)) return En[t];
|
|
848
848
|
let r = n ? Xe(e.message, n, t) : e.message;
|
|
849
|
-
return r.includes("WORKFLOW_WEBHOOK_") ? `${
|
|
849
|
+
return r.includes("WORKFLOW_WEBHOOK_") ? `${q[t]}${r}` : Ne(r, t);
|
|
850
850
|
}
|
|
851
851
|
//#endregion
|
|
852
852
|
//#region src/views/templates/designer/position-level-options.ts
|
|
853
|
-
function
|
|
853
|
+
function Dn(e, t) {
|
|
854
854
|
let n = [...new Set(e.map((e) => e.level))];
|
|
855
855
|
return [...n.includes(t) ? n : [...n, t]].sort((e, t) => t - e).map((t) => {
|
|
856
856
|
let n = e.filter((e) => e.level === t).map((e) => e.name);
|
|
@@ -861,12 +861,12 @@ function On(e, t) {
|
|
|
861
861
|
};
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function On(e) {
|
|
865
865
|
return e.reduce((e, t) => Math.max(e, t.level), 1);
|
|
866
866
|
}
|
|
867
867
|
//#endregion
|
|
868
868
|
//#region src/views/templates/designer/notify-webhook-designer.ts
|
|
869
|
-
var
|
|
869
|
+
var Y = {
|
|
870
870
|
"initiator.memberId": "發起人會員編號",
|
|
871
871
|
"instance.id": "案件編號",
|
|
872
872
|
"instance.templateId": "模板編號",
|
|
@@ -874,32 +874,32 @@ var J = {
|
|
|
874
874
|
"instance.title": "案件主旨",
|
|
875
875
|
"node.id": "節點編號",
|
|
876
876
|
"node.label": "節點名稱"
|
|
877
|
-
},
|
|
877
|
+
}, kn = {
|
|
878
878
|
boolean: "是/否",
|
|
879
879
|
json: "JSON",
|
|
880
880
|
number: "數字",
|
|
881
881
|
string: "文字",
|
|
882
882
|
stringArray: "文字清單"
|
|
883
883
|
};
|
|
884
|
-
function
|
|
884
|
+
function An(e) {
|
|
885
885
|
return `${e.key}@${e.version}`;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function jn(e, t) {
|
|
888
888
|
return e.find((e) => e.key === t.key && e.version === t.version) ?? null;
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Mn(e) {
|
|
891
891
|
return [
|
|
892
892
|
"FIELD",
|
|
893
893
|
...e === "stringArray" ? [] : ["CONSTANT"],
|
|
894
894
|
...e === "string" || e === "json" ? ["CONTEXT"] : []
|
|
895
895
|
];
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
return e.filter((e) =>
|
|
897
|
+
function X(e, t) {
|
|
898
|
+
return e.filter((e) => R(e, t));
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Nn(e, t, n) {
|
|
901
901
|
return e === "FIELD" ? {
|
|
902
|
-
fieldKey:
|
|
902
|
+
fieldKey: X(n, t.type)[0]?.fieldKey ?? "",
|
|
903
903
|
kind: "FIELD"
|
|
904
904
|
} : e === "CONTEXT" ? {
|
|
905
905
|
kind: "CONTEXT",
|
|
@@ -909,16 +909,16 @@ function Pn(e, t, n) {
|
|
|
909
909
|
value: t.type === "boolean" ? !0 : t.type === "number" ? null : ""
|
|
910
910
|
};
|
|
911
911
|
}
|
|
912
|
-
var
|
|
913
|
-
function
|
|
912
|
+
var Pn = /^-?\d+(\.\d+)?$/;
|
|
913
|
+
function Fn(e, t) {
|
|
914
914
|
if (e !== "number") return t;
|
|
915
915
|
let n = t.trim();
|
|
916
|
-
return n ?
|
|
916
|
+
return n ? Pn.test(n) ? Number(n) : t : null;
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
return !
|
|
918
|
+
function In(e) {
|
|
919
|
+
return !xt(e).some((e) => Ln.has(e.code));
|
|
920
920
|
}
|
|
921
|
-
var
|
|
921
|
+
var Ln = /* @__PURE__ */ new Set([
|
|
922
922
|
"BINDING_INVALID",
|
|
923
923
|
"BINDING_SOURCE_INVALID",
|
|
924
924
|
"BINDINGS_NOT_ARRAY",
|
|
@@ -928,7 +928,7 @@ var Rn = /* @__PURE__ */ new Set([
|
|
|
928
928
|
"TARGET_INVALID",
|
|
929
929
|
"WEBHOOKS_NOT_ARRAY"
|
|
930
930
|
]);
|
|
931
|
-
function
|
|
931
|
+
function Z(e, t, n) {
|
|
932
932
|
let r = e.bindings.filter((e) => e.parameter !== t), i = e.bindings.findIndex((e) => e.parameter === t);
|
|
933
933
|
if (!n) return {
|
|
934
934
|
...e,
|
|
@@ -943,11 +943,11 @@ function X(e, t, n) {
|
|
|
943
943
|
bindings: i === -1 ? [...e.bindings, a] : e.bindings.map((e, t) => t === i ? a : e)
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function Rn(e, t, n) {
|
|
947
947
|
return {
|
|
948
948
|
bindings: e.bindings.filter((r) => {
|
|
949
949
|
let i = t.parameters.find((e) => e.key === r.parameter);
|
|
950
|
-
return i !== void 0 && !
|
|
950
|
+
return i !== void 0 && !St({
|
|
951
951
|
endpoint: { parameters: [{
|
|
952
952
|
...i,
|
|
953
953
|
required: !1
|
|
@@ -966,15 +966,15 @@ function zn(e, t, n) {
|
|
|
966
966
|
id: e.id
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
function
|
|
970
|
-
return e.nodes.flatMap((e) => e.type !== "serviceTask" || e.data.action.type !== "NOTIFY" ||
|
|
971
|
-
let a =
|
|
972
|
-
return
|
|
969
|
+
function zn({ definition: e, endpoints: t, formFields: n }) {
|
|
970
|
+
return e.nodes.flatMap((e) => e.type !== "serviceTask" || e.data.action.type !== "NOTIFY" || xt(e.data.action.webhooks).length ? [] : Ct(e.data.action).flatMap((r, i) => {
|
|
971
|
+
let a = jn(t, r.endpoint);
|
|
972
|
+
return St({
|
|
973
973
|
endpoint: a,
|
|
974
974
|
formFields: n,
|
|
975
975
|
target: r
|
|
976
|
-
}).map((t) =>
|
|
977
|
-
endpointLabel: a?.label ??
|
|
976
|
+
}).map((t) => bt({
|
|
977
|
+
endpointLabel: a?.label ?? An(r.endpoint),
|
|
978
978
|
issue: t,
|
|
979
979
|
nodeLabel: e.data.label,
|
|
980
980
|
targetIndex: i
|
|
@@ -983,10 +983,10 @@ function Bn({ definition: e, endpoints: t, formFields: n }) {
|
|
|
983
983
|
}
|
|
984
984
|
//#endregion
|
|
985
985
|
//#region src/views/templates/designer/NotifyWebhookTargetsEditor.tsx
|
|
986
|
-
var
|
|
986
|
+
var Bn = {
|
|
987
987
|
display: "grid",
|
|
988
988
|
gap: "var(--mzn-spacing-gap-base)"
|
|
989
|
-
},
|
|
989
|
+
}, Vn = {
|
|
990
990
|
borderColor: "var(--mzn-color-border-neutral)",
|
|
991
991
|
borderRadius: "var(--mzn-radius-base)",
|
|
992
992
|
borderStyle: "solid",
|
|
@@ -994,19 +994,19 @@ var Vn = {
|
|
|
994
994
|
display: "grid",
|
|
995
995
|
gap: "var(--mzn-spacing-gap-base)",
|
|
996
996
|
padding: "var(--mzn-spacing-padding-horizontal-base)"
|
|
997
|
-
},
|
|
997
|
+
}, Hn = {
|
|
998
998
|
alignItems: "center",
|
|
999
999
|
display: "flex",
|
|
1000
1000
|
gap: "var(--mzn-spacing-gap-base)",
|
|
1001
1001
|
justifyContent: "space-between"
|
|
1002
|
-
},
|
|
1002
|
+
}, Un = {
|
|
1003
1003
|
display: "grid",
|
|
1004
1004
|
gap: "var(--mzn-spacing-gap-base)",
|
|
1005
1005
|
gridTemplateColumns: "minmax(0, 2fr) minmax(0, 3fr)"
|
|
1006
|
-
},
|
|
1006
|
+
}, Wn = {
|
|
1007
1007
|
id: "NONE",
|
|
1008
1008
|
name: "不傳送"
|
|
1009
|
-
},
|
|
1009
|
+
}, Gn = {
|
|
1010
1010
|
CONSTANT: {
|
|
1011
1011
|
id: "CONSTANT",
|
|
1012
1012
|
name: "固定值"
|
|
@@ -1019,17 +1019,17 @@ var Vn = {
|
|
|
1019
1019
|
id: "FIELD",
|
|
1020
1020
|
name: "表單欄位"
|
|
1021
1021
|
}
|
|
1022
|
-
},
|
|
1022
|
+
}, Kn = [{
|
|
1023
1023
|
id: "true",
|
|
1024
1024
|
name: "是"
|
|
1025
1025
|
}, {
|
|
1026
1026
|
id: "false",
|
|
1027
1027
|
name: "否"
|
|
1028
|
-
}],
|
|
1028
|
+
}], qn = rt.map((e) => ({
|
|
1029
1029
|
id: e,
|
|
1030
|
-
name:
|
|
1030
|
+
name: Y[e]
|
|
1031
1031
|
}));
|
|
1032
|
-
function
|
|
1032
|
+
function Jn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets: i }) {
|
|
1033
1033
|
let a = e.filter((e) => !e.deprecated);
|
|
1034
1034
|
if (!i.length && (t === "unavailable" || t === "ready" && !a.length)) return null;
|
|
1035
1035
|
function o(e, t) {
|
|
@@ -1037,13 +1037,13 @@ function Yn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
|
|
|
1037
1037
|
}
|
|
1038
1038
|
function s() {
|
|
1039
1039
|
let [e] = a;
|
|
1040
|
-
e && r([...i,
|
|
1040
|
+
e && r([...i, ut({
|
|
1041
1041
|
key: e.key,
|
|
1042
1042
|
version: e.version
|
|
1043
1043
|
})]);
|
|
1044
1044
|
}
|
|
1045
1045
|
return /* @__PURE__ */ O("div", {
|
|
1046
|
-
style:
|
|
1046
|
+
style: Bn,
|
|
1047
1047
|
children: [
|
|
1048
1048
|
/* @__PURE__ */ D(T, {
|
|
1049
1049
|
variant: "label-primary-highlight",
|
|
@@ -1064,7 +1064,7 @@ function Yn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
|
|
|
1064
1064
|
variant: "body",
|
|
1065
1065
|
children: "目前無法載入 Webhook 端點,已設定的內容會保留,請稍後重試。"
|
|
1066
1066
|
}) : null,
|
|
1067
|
-
i.map((s, c) => /* @__PURE__ */ D(
|
|
1067
|
+
i.map((s, c) => /* @__PURE__ */ D(Yn, {
|
|
1068
1068
|
activeEndpoints: a,
|
|
1069
1069
|
catalog: e,
|
|
1070
1070
|
catalogState: t,
|
|
@@ -1075,38 +1075,38 @@ function Yn({ catalog: e, catalogState: t, formFields: n, onChange: r, targets:
|
|
|
1075
1075
|
target: s
|
|
1076
1076
|
}, s.id)),
|
|
1077
1077
|
/* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(b, {
|
|
1078
|
-
disabled: t !== "ready" || !a.length || i.length >=
|
|
1078
|
+
disabled: t !== "ready" || !a.length || i.length >= it,
|
|
1079
1079
|
icon: he,
|
|
1080
1080
|
iconType: "leading",
|
|
1081
1081
|
onClick: s,
|
|
1082
1082
|
variant: "base-dashed",
|
|
1083
1083
|
children: "新增 Webhook"
|
|
1084
1084
|
}) }),
|
|
1085
|
-
i.length >=
|
|
1085
|
+
i.length >= it ? /* @__PURE__ */ O(T, {
|
|
1086
1086
|
color: "text-neutral",
|
|
1087
1087
|
variant: "caption",
|
|
1088
1088
|
children: [
|
|
1089
1089
|
"每個知會節點最多 ",
|
|
1090
|
-
|
|
1090
|
+
it,
|
|
1091
1091
|
" 個 Webhook。"
|
|
1092
1092
|
]
|
|
1093
1093
|
}) : null
|
|
1094
1094
|
]
|
|
1095
1095
|
});
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1098
|
-
let l =
|
|
1099
|
-
id:
|
|
1100
|
-
name:
|
|
1097
|
+
function Yn({ activeEndpoints: e, catalog: t, catalogState: n, formFields: i, index: a, onChange: o, onRemove: s, target: c }) {
|
|
1098
|
+
let l = jn(t, c.endpoint), u = An(c.endpoint), d = [...e.map((e) => ({
|
|
1099
|
+
id: An(e),
|
|
1100
|
+
name: $n(e)
|
|
1101
1101
|
})), ...l && !l.deprecated ? [] : [{
|
|
1102
1102
|
id: u,
|
|
1103
|
-
name: l ?
|
|
1103
|
+
name: l ? $n(l) : `${u}(找不到端點)`
|
|
1104
1104
|
}]], f = new Set((l?.parameters ?? []).map((e) => e.key)), p = l ? c.bindings.filter((e) => !f.has(e.parameter)) : [];
|
|
1105
1105
|
return /* @__PURE__ */ O("div", {
|
|
1106
|
-
style:
|
|
1106
|
+
style: Vn,
|
|
1107
1107
|
children: [
|
|
1108
1108
|
/* @__PURE__ */ O("div", {
|
|
1109
|
-
style:
|
|
1109
|
+
style: Hn,
|
|
1110
1110
|
children: [/* @__PURE__ */ O(T, {
|
|
1111
1111
|
variant: "label-primary",
|
|
1112
1112
|
children: [
|
|
@@ -1130,8 +1130,8 @@ function Xn({ activeEndpoints: e, catalog: t, catalogState: n, formFields: i, in
|
|
|
1130
1130
|
clearable: !1,
|
|
1131
1131
|
disabled: n !== "ready",
|
|
1132
1132
|
onChange: (t) => {
|
|
1133
|
-
let n = e.find((e) =>
|
|
1134
|
-
n && o(
|
|
1133
|
+
let n = e.find((e) => An(e) === t?.id);
|
|
1134
|
+
n && o(Rn(c, n, i ?? []));
|
|
1135
1135
|
},
|
|
1136
1136
|
options: [...d],
|
|
1137
1137
|
placeholder: "選擇端點",
|
|
@@ -1162,15 +1162,15 @@ function Xn({ activeEndpoints: e, catalog: t, catalogState: n, formFields: i, in
|
|
|
1162
1162
|
variant: "caption",
|
|
1163
1163
|
children: "這個端點不需要參數。"
|
|
1164
1164
|
}) : null,
|
|
1165
|
-
(l?.parameters ?? []).map((e) => /* @__PURE__ */ D(
|
|
1165
|
+
(l?.parameters ?? []).map((e) => /* @__PURE__ */ D(Xn, {
|
|
1166
1166
|
formFields: i,
|
|
1167
|
-
onChange: (t) => o(
|
|
1167
|
+
onChange: (t) => o(Z(c, e.key, t)),
|
|
1168
1168
|
parameter: e,
|
|
1169
1169
|
source: c.bindings.find((t) => t.parameter === e.key)?.from ?? null,
|
|
1170
1170
|
targetId: c.id
|
|
1171
1171
|
}, e.key)),
|
|
1172
1172
|
p.map((e) => /* @__PURE__ */ O("div", {
|
|
1173
|
-
style:
|
|
1173
|
+
style: Hn,
|
|
1174
1174
|
children: [/* @__PURE__ */ O(T, {
|
|
1175
1175
|
color: "text-warning",
|
|
1176
1176
|
variant: "body",
|
|
@@ -1180,7 +1180,7 @@ function Xn({ activeEndpoints: e, catalog: t, catalogState: n, formFields: i, in
|
|
|
1180
1180
|
"」已不在端點定義中。"
|
|
1181
1181
|
]
|
|
1182
1182
|
}), /* @__PURE__ */ D(b, {
|
|
1183
|
-
onClick: () => o(
|
|
1183
|
+
onClick: () => o(Z(c, e.parameter, null)),
|
|
1184
1184
|
variant: "base-text-link",
|
|
1185
1185
|
children: "移除設定"
|
|
1186
1186
|
})]
|
|
@@ -1188,8 +1188,8 @@ function Xn({ activeEndpoints: e, catalog: t, catalogState: n, formFields: i, in
|
|
|
1188
1188
|
]
|
|
1189
1189
|
});
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
let o = i?.kind === "FIELD" ||
|
|
1191
|
+
function Xn({ formFields: e, onChange: t, parameter: n, source: i, targetId: a }) {
|
|
1192
|
+
let o = i?.kind === "FIELD" || X(e ?? [], n.type).length > 0, s = [...n.required ? [] : [Wn], ...Mn(n.type).filter((e) => e !== "FIELD" || o).map((e) => Gn[e])], c = kn[n.type];
|
|
1193
1193
|
return /* @__PURE__ */ D(r, {
|
|
1194
1194
|
hintText: [
|
|
1195
1195
|
n.key,
|
|
@@ -1200,17 +1200,17 @@ function Zn({ formFields: e, onChange: t, parameter: n, source: i, targetId: a }
|
|
|
1200
1200
|
name: `webhookBinding-${a}-${n.key}`,
|
|
1201
1201
|
required: n.required,
|
|
1202
1202
|
children: /* @__PURE__ */ O("div", {
|
|
1203
|
-
style:
|
|
1203
|
+
style: Un,
|
|
1204
1204
|
children: [/* @__PURE__ */ D(S, {
|
|
1205
1205
|
clearable: !1,
|
|
1206
1206
|
onChange: (r) => {
|
|
1207
|
-
let i =
|
|
1208
|
-
t(i ?
|
|
1207
|
+
let i = er(r?.id ?? null);
|
|
1208
|
+
t(i ? Nn(i, n, e ?? []) : null);
|
|
1209
1209
|
},
|
|
1210
1210
|
options: [...s],
|
|
1211
1211
|
placeholder: "選擇來源",
|
|
1212
|
-
value: i ?
|
|
1213
|
-
}), i ? /* @__PURE__ */ D(
|
|
1212
|
+
value: i ? Gn[i.kind] : n.required ? null : Wn
|
|
1213
|
+
}), i ? /* @__PURE__ */ D(Zn, {
|
|
1214
1214
|
formFields: e,
|
|
1215
1215
|
onChange: t,
|
|
1216
1216
|
parameter: n,
|
|
@@ -1219,14 +1219,14 @@ function Zn({ formFields: e, onChange: t, parameter: n, source: i, targetId: a }
|
|
|
1219
1219
|
})
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function Zn({ formFields: e, onChange: t, parameter: n, source: r }) {
|
|
1223
1223
|
if (r.kind === "FIELD") {
|
|
1224
1224
|
if (!e) return /* @__PURE__ */ D(T, {
|
|
1225
1225
|
color: "text-neutral",
|
|
1226
1226
|
variant: "caption",
|
|
1227
1227
|
children: "請先綁定表單版本,才能選擇表單欄位。"
|
|
1228
1228
|
});
|
|
1229
|
-
let i =
|
|
1229
|
+
let i = X(e, n.type).map((e) => ({
|
|
1230
1230
|
id: e.fieldKey,
|
|
1231
1231
|
name: `${e.label}(${e.fieldKey})`
|
|
1232
1232
|
})), a = r.fieldKey && !i.some((e) => e.id === r.fieldKey) ? [...i, {
|
|
@@ -1247,22 +1247,22 @@ function Qn({ formFields: e, onChange: t, parameter: n, source: r }) {
|
|
|
1247
1247
|
return r.kind === "CONTEXT" ? /* @__PURE__ */ D(S, {
|
|
1248
1248
|
clearable: !1,
|
|
1249
1249
|
onChange: (e) => {
|
|
1250
|
-
|
|
1250
|
+
pt(e?.id) && t({
|
|
1251
1251
|
kind: "CONTEXT",
|
|
1252
1252
|
path: e.id
|
|
1253
1253
|
});
|
|
1254
1254
|
},
|
|
1255
|
-
options: [...
|
|
1256
|
-
value:
|
|
1255
|
+
options: [...qn],
|
|
1256
|
+
value: qn.find((e) => e.id === r.path) ?? null
|
|
1257
1257
|
}) : n.type === "boolean" ? /* @__PURE__ */ D(S, {
|
|
1258
1258
|
clearable: !1,
|
|
1259
1259
|
onChange: (e) => t({
|
|
1260
1260
|
kind: "CONSTANT",
|
|
1261
1261
|
value: e?.id === "true"
|
|
1262
1262
|
}),
|
|
1263
|
-
options: [...
|
|
1264
|
-
value: typeof r.value == "boolean" ?
|
|
1265
|
-
}) : /* @__PURE__ */ D(
|
|
1263
|
+
options: [...Kn],
|
|
1264
|
+
value: typeof r.value == "boolean" ? Kn.find((e) => e.id === String(r.value)) ?? null : null
|
|
1265
|
+
}) : /* @__PURE__ */ D(Qn, {
|
|
1266
1266
|
onChange: (e) => t({
|
|
1267
1267
|
kind: "CONSTANT",
|
|
1268
1268
|
value: e
|
|
@@ -1271,21 +1271,21 @@ function Qn({ formFields: e, onChange: t, parameter: n, source: r }) {
|
|
|
1271
1271
|
value: r.value
|
|
1272
1272
|
});
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function Qn({ onChange: e, type: t, value: n }) {
|
|
1275
1275
|
let [r, i] = _(n === null ? "" : String(n));
|
|
1276
1276
|
return m(() => {
|
|
1277
|
-
i((e) =>
|
|
1277
|
+
i((e) => Fn(t, e) === n ? e : n === null ? "" : String(n));
|
|
1278
1278
|
}, [t, n]), /* @__PURE__ */ D(te, {
|
|
1279
1279
|
inputProps: { inputMode: t === "number" ? "decimal" : void 0 },
|
|
1280
1280
|
onChange: (n) => {
|
|
1281
|
-
i(n.target.value), e(
|
|
1281
|
+
i(n.target.value), e(Fn(t, n.target.value));
|
|
1282
1282
|
},
|
|
1283
1283
|
placeholder: t === "number" ? "輸入數字" : "輸入固定值",
|
|
1284
1284
|
value: r,
|
|
1285
1285
|
variant: "base"
|
|
1286
1286
|
});
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function $n(e) {
|
|
1289
1289
|
let t = [
|
|
1290
1290
|
`v${e.version}`,
|
|
1291
1291
|
...e.source === "DATABASE" ? ["後台維護"] : [],
|
|
@@ -1293,25 +1293,25 @@ function er(e) {
|
|
|
1293
1293
|
];
|
|
1294
1294
|
return `${e.label}(${t.join(",")})`;
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function er(e) {
|
|
1297
1297
|
return e === "FIELD" || e === "CONSTANT" || e === "CONTEXT" ? e : null;
|
|
1298
1298
|
}
|
|
1299
1299
|
//#endregion
|
|
1300
1300
|
//#region src/views/templates/designer/dry-run-sample-data.ts
|
|
1301
|
-
function
|
|
1301
|
+
function tr(e) {
|
|
1302
1302
|
return (e?.fields ?? []).reduce((e, t) => ({
|
|
1303
1303
|
...e,
|
|
1304
|
-
[t.fieldKey]:
|
|
1304
|
+
[t.fieldKey]: rr(t)
|
|
1305
1305
|
}), {});
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1307
|
+
function nr(e) {
|
|
1308
1308
|
return `formMember:${e}`;
|
|
1309
1309
|
}
|
|
1310
|
-
function
|
|
1310
|
+
function rr(e) {
|
|
1311
1311
|
if (e.type === "number" || e.type === "money") return 1e3;
|
|
1312
1312
|
if (e.type === "boolean") return !0;
|
|
1313
1313
|
if (e.type === "member") {
|
|
1314
|
-
let t =
|
|
1314
|
+
let t = nr(e.fieldKey);
|
|
1315
1315
|
return e.multiple ? [t] : t;
|
|
1316
1316
|
}
|
|
1317
1317
|
if (j(e)) {
|
|
@@ -1323,36 +1323,36 @@ function ir(e) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
//#endregion
|
|
1325
1325
|
//#region src/views/templates/designer/dry-run-assignee-label.ts
|
|
1326
|
-
function
|
|
1326
|
+
function ir(e, t) {
|
|
1327
1327
|
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;
|
|
1328
1328
|
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;
|
|
1329
1329
|
}
|
|
1330
1330
|
//#endregion
|
|
1331
1331
|
//#region src/views/templates/designer/dynamic-form-resolver-options.ts
|
|
1332
|
-
var
|
|
1333
|
-
function
|
|
1332
|
+
var ar = "表單中沒有「人員選擇」欄位,請先到表單設計加入", or = "原本指定的欄位已不在表單中,或已不是「人員選擇」欄位,請重新選擇。", Q = "此欄位非必填", sr = "此欄位可能被條件隱藏", cr = "此欄位為隱藏欄位,申請人無法填寫", lr = ",空白時此關會找不到人員,發佈時會被拒絕;請在表單設計將它設為必填且不隱藏";
|
|
1333
|
+
function ur(e) {
|
|
1334
1334
|
let t = [
|
|
1335
|
-
...e.required ? [] : [
|
|
1336
|
-
...e.visibleWhen?.trim() ? [
|
|
1337
|
-
...e.hidden ? [
|
|
1335
|
+
...e.required ? [] : [Q],
|
|
1336
|
+
...e.visibleWhen?.trim() ? [sr] : [],
|
|
1337
|
+
...e.hidden ? [cr] : []
|
|
1338
1338
|
];
|
|
1339
|
-
return t.length > 0 ? `${t.join("、")}${
|
|
1339
|
+
return t.length > 0 ? `${t.join("、")}${lr}` : void 0;
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function dr(e) {
|
|
1342
1342
|
return `${e.required ? "" : "(非必填)"}${e.visibleWhen?.trim() ? "(可能被條件隱藏)" : ""}${e.hidden ? "(隱藏欄位)" : ""}`;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function fr(e) {
|
|
1345
1345
|
return (e?.fields ?? []).filter(N).map((e) => {
|
|
1346
|
-
let t =
|
|
1346
|
+
let t = ur(e);
|
|
1347
1347
|
return {
|
|
1348
1348
|
id: e.fieldKey,
|
|
1349
|
-
name: `${e.label} (${e.fieldKey})${
|
|
1349
|
+
name: `${e.label} (${e.fieldKey})${dr(e)}`,
|
|
1350
1350
|
...t ? { warning: t } : {}
|
|
1351
1351
|
};
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1355
|
-
let n =
|
|
1354
|
+
function pr(e, t) {
|
|
1355
|
+
let n = fr(e), r = n.find((e) => e.id === t) ?? null;
|
|
1356
1356
|
if (r) return {
|
|
1357
1357
|
options: n,
|
|
1358
1358
|
problem: r.warning ?? null,
|
|
@@ -1365,46 +1365,46 @@ function mr(e, t) {
|
|
|
1365
1365
|
};
|
|
1366
1366
|
return {
|
|
1367
1367
|
options: [...n, e],
|
|
1368
|
-
problem:
|
|
1368
|
+
problem: or,
|
|
1369
1369
|
selected: e
|
|
1370
1370
|
};
|
|
1371
1371
|
}
|
|
1372
1372
|
return {
|
|
1373
1373
|
options: n,
|
|
1374
|
-
problem: n.length === 0 ?
|
|
1374
|
+
problem: n.length === 0 ? ar : null,
|
|
1375
1375
|
selected: null
|
|
1376
1376
|
};
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function mr(e, t) {
|
|
1379
1379
|
if (!t.trim()) return "依表單欄位:未設定";
|
|
1380
1380
|
let n = e?.fields.find((e) => e.fieldKey === t);
|
|
1381
1381
|
return n && !N(n) ? `依表單欄位:${n.label || t}(非人員選擇欄位)` : `依表單欄位:${n?.label || t}`;
|
|
1382
1382
|
}
|
|
1383
1383
|
//#endregion
|
|
1384
1384
|
//#region src/views/templates/designer/designer-version-labels.ts
|
|
1385
|
-
function
|
|
1385
|
+
function hr(e) {
|
|
1386
1386
|
return `${e.draftVersion === null ? "尚未建立草稿" : `草稿 v${e.draftVersion}`} · ${e.publishedVersion === null ? e.hasPublishedVersion ? "已發布版本" : "尚未發布" : `已發布 v${e.publishedVersion}`}`;
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1388
|
+
function gr(e, t) {
|
|
1389
1389
|
return `表單:${e} v${t}`;
|
|
1390
1390
|
}
|
|
1391
1391
|
//#endregion
|
|
1392
1392
|
//#region src/views/templates/designer/TemplateDesignerView.tsx
|
|
1393
|
-
var
|
|
1393
|
+
var _r = {
|
|
1394
1394
|
display: "grid",
|
|
1395
1395
|
gap: 16
|
|
1396
|
-
},
|
|
1396
|
+
}, vr = {
|
|
1397
1397
|
alignItems: "start",
|
|
1398
1398
|
display: "grid",
|
|
1399
1399
|
gap: 16,
|
|
1400
1400
|
gridTemplateColumns: "minmax(0, 1fr) 420px"
|
|
1401
|
-
},
|
|
1401
|
+
}, yr = {
|
|
1402
1402
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
1403
1403
|
borderRadius: 6,
|
|
1404
1404
|
height: 620,
|
|
1405
1405
|
minWidth: 0,
|
|
1406
1406
|
overflow: "hidden"
|
|
1407
|
-
},
|
|
1407
|
+
}, br = {
|
|
1408
1408
|
alignItems: "center",
|
|
1409
1409
|
boxSizing: "border-box",
|
|
1410
1410
|
color: "var(--mzn-color-text-error)",
|
|
@@ -1414,24 +1414,24 @@ var vr = {
|
|
|
1414
1414
|
lineHeight: 0,
|
|
1415
1415
|
padding: 0,
|
|
1416
1416
|
width: 26
|
|
1417
|
-
},
|
|
1417
|
+
}, xr = {
|
|
1418
1418
|
alignItems: "center",
|
|
1419
1419
|
display: "flex",
|
|
1420
1420
|
height: "100%",
|
|
1421
1421
|
justifyContent: "center",
|
|
1422
1422
|
width: "100%"
|
|
1423
|
-
},
|
|
1424
|
-
.${
|
|
1425
|
-
.${
|
|
1426
|
-
flex: 0 0 ${
|
|
1427
|
-
width: ${
|
|
1423
|
+
}, Sr = "workflow-designer-side-panel", Cr = 96, wr = `
|
|
1424
|
+
.${Sr} .mzn-form-field--stretch .mzn-form-field__label-area,
|
|
1425
|
+
.${Sr} .mzn-form-field--horizontal .mzn-form-field__label-area {
|
|
1426
|
+
flex: 0 0 ${Cr}px;
|
|
1427
|
+
width: ${Cr}px;
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
|
-
.${
|
|
1431
|
-
.${
|
|
1430
|
+
.${Sr} .mzn-form-field--stretch .mzn-form-field__data-entry,
|
|
1431
|
+
.${Sr} .mzn-form-field--horizontal .mzn-form-field__data-entry {
|
|
1432
1432
|
min-width: 0;
|
|
1433
1433
|
}
|
|
1434
|
-
`,
|
|
1434
|
+
`, Tr = "#2563eb", Er = "#64748b", Dr = "var(--mzn-color-text-error, #dc2626)", Or = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", kr = `
|
|
1435
1435
|
.workflow-selection-delete-control.react-flow__controls-button {
|
|
1436
1436
|
align-items: center !important;
|
|
1437
1437
|
display: flex !important;
|
|
@@ -1458,14 +1458,14 @@ var vr = {
|
|
|
1458
1458
|
.react-flow__edge-path.workflow-edge--selected {
|
|
1459
1459
|
filter: ${Or};
|
|
1460
1460
|
opacity: 1 !important;
|
|
1461
|
-
stroke: ${
|
|
1461
|
+
stroke: ${Er} !important;
|
|
1462
1462
|
stroke-opacity: 1 !important;
|
|
1463
1463
|
stroke-width: 1.5px !important;
|
|
1464
1464
|
}
|
|
1465
1465
|
|
|
1466
1466
|
.workflow-edge--selected {
|
|
1467
|
-
--xy-edge-stroke: ${
|
|
1468
|
-
--xy-edge-stroke-selected: ${
|
|
1467
|
+
--xy-edge-stroke: ${Er};
|
|
1468
|
+
--xy-edge-stroke-selected: ${Er};
|
|
1469
1469
|
--xy-edge-stroke-width: 1.5px;
|
|
1470
1470
|
}
|
|
1471
1471
|
|
|
@@ -1574,13 +1574,26 @@ var vr = {
|
|
|
1574
1574
|
}, {
|
|
1575
1575
|
id: "OR",
|
|
1576
1576
|
name: "任一前置完成"
|
|
1577
|
-
}], ci = [
|
|
1577
|
+
}], ci = [
|
|
1578
|
+
{
|
|
1579
|
+
id: "INITIATOR",
|
|
1580
|
+
name: "退回申請人"
|
|
1581
|
+
},
|
|
1582
|
+
{
|
|
1583
|
+
id: "PREVIOUS",
|
|
1584
|
+
name: "退回上一個節點"
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
id: "ANY",
|
|
1588
|
+
name: "由簽核者選擇(申請人或之前的簽核節點)"
|
|
1589
|
+
}
|
|
1590
|
+
], li = [{
|
|
1578
1591
|
id: "RESTART",
|
|
1579
1592
|
name: "重新送出後從開始重跑"
|
|
1580
1593
|
}, {
|
|
1581
1594
|
id: "FROM_RETURN_POINT",
|
|
1582
1595
|
name: "重新送出後回到退回節點"
|
|
1583
|
-
}],
|
|
1596
|
+
}], ui = [
|
|
1584
1597
|
{
|
|
1585
1598
|
id: "NONE",
|
|
1586
1599
|
name: "不提醒",
|
|
@@ -1601,7 +1614,7 @@ var vr = {
|
|
|
1601
1614
|
name: "剩十分之一時提醒",
|
|
1602
1615
|
value: .9
|
|
1603
1616
|
}
|
|
1604
|
-
],
|
|
1617
|
+
], di = [
|
|
1605
1618
|
{
|
|
1606
1619
|
id: "DIRECT",
|
|
1607
1620
|
name: "指定會員"
|
|
@@ -1634,13 +1647,13 @@ var vr = {
|
|
|
1634
1647
|
id: "POSITION",
|
|
1635
1648
|
name: "指定職位"
|
|
1636
1649
|
}
|
|
1637
|
-
],
|
|
1650
|
+
], fi = [{
|
|
1638
1651
|
id: "COUNT",
|
|
1639
1652
|
name: "人數"
|
|
1640
1653
|
}, {
|
|
1641
1654
|
id: "PERCENTAGE",
|
|
1642
1655
|
name: "百分比"
|
|
1643
|
-
}],
|
|
1656
|
+
}], pi = [
|
|
1644
1657
|
{
|
|
1645
1658
|
id: "1",
|
|
1646
1659
|
name: "直屬主管",
|
|
@@ -1656,7 +1669,7 @@ var vr = {
|
|
|
1656
1669
|
name: "第三層主管",
|
|
1657
1670
|
value: 3
|
|
1658
1671
|
}
|
|
1659
|
-
],
|
|
1672
|
+
], mi = [
|
|
1660
1673
|
{
|
|
1661
1674
|
id: "NONE",
|
|
1662
1675
|
name: "停止流程並提示"
|
|
@@ -1669,10 +1682,10 @@ var vr = {
|
|
|
1669
1682
|
id: "POSITION",
|
|
1670
1683
|
name: "指定職位"
|
|
1671
1684
|
}
|
|
1672
|
-
],
|
|
1685
|
+
], hi = {
|
|
1673
1686
|
id: "UNSUPPORTED",
|
|
1674
1687
|
name: "不支援的備援設定"
|
|
1675
|
-
},
|
|
1688
|
+
}, gi = [
|
|
1676
1689
|
{
|
|
1677
1690
|
id: "INITIATOR_MANAGER",
|
|
1678
1691
|
name: "改由申請人的直屬主管簽核"
|
|
@@ -1685,14 +1698,14 @@ var vr = {
|
|
|
1685
1698
|
id: "FAIL",
|
|
1686
1699
|
name: "停止流程並提示"
|
|
1687
1700
|
}
|
|
1688
|
-
],
|
|
1701
|
+
], _i = { whenEmpty: "INITIATOR_MANAGER" }, vi = [
|
|
1689
1702
|
"EQUALS",
|
|
1690
1703
|
"GREATER_THAN",
|
|
1691
1704
|
"GREATER_THAN_OR_EQUALS",
|
|
1692
1705
|
"LESS_THAN",
|
|
1693
1706
|
"LESS_THAN_OR_EQUALS",
|
|
1694
1707
|
"NOT_EQUALS"
|
|
1695
|
-
],
|
|
1708
|
+
], yi = [
|
|
1696
1709
|
{
|
|
1697
1710
|
id: "NONE",
|
|
1698
1711
|
name: "未設定"
|
|
@@ -1709,41 +1722,41 @@ var vr = {
|
|
|
1709
1722
|
id: "ORG_UNIT_POSITION",
|
|
1710
1723
|
name: "指定組織職位"
|
|
1711
1724
|
}
|
|
1712
|
-
],
|
|
1725
|
+
], bi = {
|
|
1713
1726
|
id: "CUSTOM",
|
|
1714
1727
|
name: "既有自訂規則"
|
|
1715
|
-
},
|
|
1728
|
+
}, xi = "member-001", Si = {
|
|
1716
1729
|
display: "flex",
|
|
1717
1730
|
flexDirection: "column",
|
|
1718
1731
|
height: "100%"
|
|
1719
|
-
},
|
|
1732
|
+
}, Ci = {
|
|
1720
1733
|
flex: 1,
|
|
1721
1734
|
minHeight: 0,
|
|
1722
1735
|
overflowY: "auto"
|
|
1723
|
-
},
|
|
1736
|
+
}, wi = {
|
|
1724
1737
|
borderTop: "1px solid var(--mzn-color-border-neutral)",
|
|
1725
1738
|
display: "flex",
|
|
1726
1739
|
gap: 8,
|
|
1727
1740
|
paddingTop: 12
|
|
1728
|
-
},
|
|
1741
|
+
}, Ti = {
|
|
1729
1742
|
fields: [],
|
|
1730
1743
|
schemaVersion: 1
|
|
1731
|
-
},
|
|
1744
|
+
}, Ei = {
|
|
1732
1745
|
layout: [],
|
|
1733
1746
|
schemaVersion: 1
|
|
1734
|
-
},
|
|
1735
|
-
endEvent:
|
|
1736
|
-
exclusiveGateway:
|
|
1737
|
-
parallelGateway:
|
|
1738
|
-
serviceTask:
|
|
1739
|
-
startEvent:
|
|
1740
|
-
userTask:
|
|
1747
|
+
}, Di = {
|
|
1748
|
+
endEvent: ji,
|
|
1749
|
+
exclusiveGateway: ji,
|
|
1750
|
+
parallelGateway: ji,
|
|
1751
|
+
serviceTask: ji,
|
|
1752
|
+
startEvent: ji,
|
|
1753
|
+
userTask: ji
|
|
1741
1754
|
};
|
|
1742
|
-
function
|
|
1755
|
+
function Oi(e, t) {
|
|
1743
1756
|
return typeof e == "function" ? e(t) : e;
|
|
1744
1757
|
}
|
|
1745
|
-
function
|
|
1746
|
-
let me = e(), he = n(), k = t(), [A, ve] = _(null), [ye, be] = _(null), [xe, Se] = _(""), [Ce, we] = _(null), [Te, Ee] = _(null), De = g(null), [ke, Ae] = _(void 0), je = g([]), Ne = g([]), j =
|
|
1758
|
+
function ki({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride: s, initialInitiatorPolicyCel: f, initialWorkflowDefinition: y, onInitiatorPolicyChange: x, onWorkflowChange: C, showAiAssistant: oe = !1, showDryRun: de = !0, templateId: pe }) {
|
|
1759
|
+
let me = e(), he = n(), k = t(), [A, ve] = _(null), [ye, be] = _(null), [xe, Se] = _(""), [Ce, we] = _(null), [Te, Ee] = _(null), De = g(null), [ke, Ae] = _(void 0), je = g([]), Ne = g([]), j = At({
|
|
1747
1760
|
directory: h(() => ({
|
|
1748
1761
|
listOrgUnits: async () => je.current.map((e) => ({
|
|
1749
1762
|
id: e.id,
|
|
@@ -1753,14 +1766,14 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
1753
1766
|
id: e.id,
|
|
1754
1767
|
name: e.name
|
|
1755
1768
|
})),
|
|
1756
|
-
searchMembers: async (e) =>
|
|
1769
|
+
searchMembers: async (e) => Va(await Qe(e)).map((e) => ({
|
|
1757
1770
|
email: e.email,
|
|
1758
1771
|
id: e.memberId,
|
|
1759
1772
|
name: e.name
|
|
1760
1773
|
}))
|
|
1761
1774
|
}), []),
|
|
1762
1775
|
initialState: {
|
|
1763
|
-
definition: a && y != null ?
|
|
1776
|
+
definition: a && y != null ? Ui(y) : Ji(),
|
|
1764
1777
|
editingEdgeId: null,
|
|
1765
1778
|
formDefinitionVersionId: null,
|
|
1766
1779
|
formSchema: null,
|
|
@@ -1768,34 +1781,34 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
1768
1781
|
selectedEdgeIds: [],
|
|
1769
1782
|
selectedNodeId: a && y != null ? y.nodes[0]?.id ?? "start" : "start"
|
|
1770
1783
|
},
|
|
1771
|
-
layout:
|
|
1784
|
+
layout: Xi,
|
|
1772
1785
|
onLayout: (e) => {
|
|
1773
|
-
let t =
|
|
1786
|
+
let t = fo(e, De.current);
|
|
1774
1787
|
t && Ae(t);
|
|
1775
1788
|
}
|
|
1776
1789
|
}), M = j.state.definition, N = j.state.formDefinitionVersionId, P = j.state.initiatorPolicyCel, F = j.state.selectedNodeId, I = j.state.selectedEdgeIds, L = j.state.editingEdgeId, He = (e) => j.replaceState((t) => ({
|
|
1777
1790
|
...t,
|
|
1778
|
-
definition:
|
|
1791
|
+
definition: Oi(e, t.definition)
|
|
1779
1792
|
})), Ue = (e) => j.replaceState((t) => ({
|
|
1780
1793
|
...t,
|
|
1781
|
-
formDefinitionVersionId:
|
|
1794
|
+
formDefinitionVersionId: Oi(e, t.formDefinitionVersionId)
|
|
1782
1795
|
})), tt = (e) => j.replaceState((t) => ({
|
|
1783
1796
|
...t,
|
|
1784
|
-
initiatorPolicyCel:
|
|
1797
|
+
initiatorPolicyCel: Oi(e, t.initiatorPolicyCel)
|
|
1785
1798
|
})), rt = (e) => j.replaceState((t) => ({
|
|
1786
1799
|
...t,
|
|
1787
|
-
selectedNodeId:
|
|
1788
|
-
})),
|
|
1800
|
+
selectedNodeId: Oi(e, t.selectedNodeId)
|
|
1801
|
+
})), it = (e) => j.replaceState((t) => ({
|
|
1789
1802
|
...t,
|
|
1790
|
-
selectedEdgeIds:
|
|
1791
|
-
})),
|
|
1803
|
+
selectedEdgeIds: Oi(e, t.selectedEdgeIds)
|
|
1804
|
+
})), lt = (e) => j.replaceState((t) => ({
|
|
1792
1805
|
...t,
|
|
1793
|
-
editingEdgeId:
|
|
1794
|
-
})), [
|
|
1806
|
+
editingEdgeId: Oi(e, t.editingEdgeId)
|
|
1807
|
+
})), [ut, R] = _(null), [pt, z] = _(null);
|
|
1795
1808
|
m(() => {
|
|
1796
|
-
|
|
1809
|
+
z(null);
|
|
1797
1810
|
}, [F]);
|
|
1798
|
-
let [
|
|
1811
|
+
let [vt, yt] = _(!0), [bt, xt] = _(!1), [St, Tt] = _(!1), [jt, Mt] = _([]), Nt = h(() => JSON.stringify({
|
|
1799
1812
|
formDefinitionVersionId: N,
|
|
1800
1813
|
initiatorPolicyCel: P,
|
|
1801
1814
|
workflowDefinition: M
|
|
@@ -1803,186 +1816,186 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
1803
1816
|
N,
|
|
1804
1817
|
P,
|
|
1805
1818
|
M
|
|
1806
|
-
]),
|
|
1807
|
-
je.current =
|
|
1808
|
-
let [
|
|
1819
|
+
]), Pt = !!xe && Nt !== xe, [Ft, It] = _(!1), [B, Lt] = _([]), [Rt, zt] = _([]), Bt = g(0), Vt = g(/* @__PURE__ */ new Set()), [V, Ht] = _([]), [H, Ut] = _([]), [Wt, Gt] = _([]);
|
|
1820
|
+
je.current = V, Ne.current = H;
|
|
1821
|
+
let [Kt, qt] = _(!1), [Yt, Xt] = _(!1), [Zt, Qt] = _(!1), [$t, en] = _("{}"), [U, tn] = _(null), [nn, rn] = _(null), [an, on] = _([]), [sn, cn] = _("loading"), [ln, un] = _(!1), [dn, W] = _(!1), [G, fn] = _(null), [pn, mn] = _(!1), [hn, gn] = _(!1), _n = Pt || pn ? "保存並發布" : ye ? "發布草稿" : "已發布";
|
|
1809
1822
|
m(() => {
|
|
1810
|
-
a ?
|
|
1823
|
+
a ? Bn() : Vn();
|
|
1811
1824
|
}, [a, pe]), m(() => {
|
|
1812
1825
|
function e(e) {
|
|
1813
|
-
|
|
1826
|
+
Pt && (e.preventDefault(), e.returnValue = "");
|
|
1814
1827
|
}
|
|
1815
1828
|
return window.addEventListener("beforeunload", e), () => {
|
|
1816
1829
|
window.removeEventListener("beforeunload", e);
|
|
1817
1830
|
};
|
|
1818
|
-
}, [
|
|
1819
|
-
|
|
1820
|
-
}, [M,
|
|
1821
|
-
He((e) =>
|
|
1831
|
+
}, [Pt]), m(() => {
|
|
1832
|
+
Wn(M);
|
|
1833
|
+
}, [M, B]), m(() => {
|
|
1834
|
+
He((e) => Ui(e));
|
|
1822
1835
|
}, [M.edges, M.nodes]);
|
|
1823
|
-
function
|
|
1824
|
-
(!
|
|
1836
|
+
function vn() {
|
|
1837
|
+
(!Pt || window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?")) && me.push(he.templates());
|
|
1825
1838
|
}
|
|
1826
|
-
let
|
|
1839
|
+
let K = h(() => M.nodes.find((e) => e.id === F) ?? null, [F, M.nodes]), yn = K ? Aa(K) : !1, bn = I.length > 0 || yn, xn = p(() => {
|
|
1827
1840
|
j.getState().selectedEdgeIds.forEach((e) => j.dispatch({
|
|
1828
1841
|
edgeId: e,
|
|
1829
1842
|
type: "deleteEdge"
|
|
1830
|
-
})),
|
|
1831
|
-
nodeId:
|
|
1843
|
+
})), K && Aa(K) && j.dispatch({
|
|
1844
|
+
nodeId: K.id,
|
|
1832
1845
|
type: "deleteNode"
|
|
1833
1846
|
});
|
|
1834
|
-
}, [j,
|
|
1847
|
+
}, [j, K]);
|
|
1835
1848
|
m(() => {
|
|
1836
|
-
if (!
|
|
1849
|
+
if (!bn) return;
|
|
1837
1850
|
function e(e) {
|
|
1838
|
-
(e.key === "Delete" || e.key === "Backspace") && (
|
|
1851
|
+
(e.key === "Delete" || e.key === "Backspace") && (Pa(e.target) || (e.preventDefault(), xn()));
|
|
1839
1852
|
}
|
|
1840
1853
|
return window.addEventListener("keydown", e), () => {
|
|
1841
1854
|
window.removeEventListener("keydown", e);
|
|
1842
1855
|
};
|
|
1843
|
-
}, [
|
|
1844
|
-
let
|
|
1856
|
+
}, [bn, xn]);
|
|
1857
|
+
let Cn = h(() => M.edges.find((e) => e.id === L) ?? null, [L, M.edges]), wn = h(() => I.length === 1 ? M.edges.find((e) => e.id === I[0]) ?? null : null, [I, M.edges]), En = h(() => I.map((e) => M.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [I, M.edges]), q = h(() => Te ?? Sa(P, Ce), [
|
|
1845
1858
|
P,
|
|
1846
1859
|
Te,
|
|
1847
1860
|
Ce
|
|
1848
|
-
]),
|
|
1861
|
+
]), On = h(() => M.edges.map((e) => Vi(e, M.nodes, I.includes(e.id))), [
|
|
1849
1862
|
I,
|
|
1850
1863
|
M.edges,
|
|
1851
1864
|
M.nodes
|
|
1852
|
-
]),
|
|
1865
|
+
]), Y = h(() => $(jt, N) ?? $(Fa(A?.formVersions ?? []), N), [
|
|
1853
1866
|
N,
|
|
1854
|
-
|
|
1867
|
+
jt,
|
|
1855
1868
|
A?.formVersions
|
|
1856
|
-
]),
|
|
1869
|
+
]), kn = h(() => Ba(jt, Y), [jt, Y]), An = Y?.schema ?? null, jn = a ? s ?? null : An;
|
|
1857
1870
|
m(() => {
|
|
1858
|
-
j.getState().formSchema !==
|
|
1871
|
+
j.getState().formSchema !== jn && j.replaceState((e) => ({
|
|
1859
1872
|
...e,
|
|
1860
|
-
formSchema:
|
|
1873
|
+
formSchema: jn
|
|
1861
1874
|
}));
|
|
1862
|
-
}, [j,
|
|
1863
|
-
let
|
|
1875
|
+
}, [j, jn]);
|
|
1876
|
+
let Mn = h(() => po(M), [M]);
|
|
1864
1877
|
m(() => {
|
|
1865
1878
|
let e = !0;
|
|
1866
1879
|
return qe({ includeDeprecated: !0 }).then((t) => {
|
|
1867
|
-
e && (
|
|
1880
|
+
e && (on(t), cn("ready"));
|
|
1868
1881
|
}).catch(() => {
|
|
1869
|
-
e &&
|
|
1882
|
+
e && cn("unavailable");
|
|
1870
1883
|
}), () => {
|
|
1871
1884
|
e = !1;
|
|
1872
1885
|
};
|
|
1873
1886
|
}, []);
|
|
1874
|
-
let
|
|
1887
|
+
let X = pn && G ? G.schema : jn, Nn = h(() => sn === "ready" ? zn({
|
|
1875
1888
|
definition: M,
|
|
1876
|
-
endpoints:
|
|
1877
|
-
formFields:
|
|
1889
|
+
endpoints: an,
|
|
1890
|
+
formFields: X?.fields ?? []
|
|
1878
1891
|
})[0] ?? null : null, [
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1892
|
+
an,
|
|
1893
|
+
sn,
|
|
1894
|
+
X,
|
|
1882
1895
|
M
|
|
1883
|
-
]),
|
|
1884
|
-
let [e] = Oe(M,
|
|
1896
|
+
]), Pn = h(() => {
|
|
1897
|
+
let [e] = Oe(M, X).issues;
|
|
1885
1898
|
return e ? Xe(e.message, M, k) : null;
|
|
1886
1899
|
}, [
|
|
1887
1900
|
k,
|
|
1888
|
-
|
|
1901
|
+
X,
|
|
1889
1902
|
M
|
|
1890
|
-
]),
|
|
1891
|
-
|
|
1892
|
-
z,
|
|
1903
|
+
]), Fn = Nn ?? Pn, Ln = h(() => M.nodes.map((e) => Ii(e, B, V, H, e.id === F, q, X)), [
|
|
1904
|
+
q,
|
|
1893
1905
|
B,
|
|
1894
1906
|
V,
|
|
1907
|
+
H,
|
|
1895
1908
|
F,
|
|
1896
|
-
|
|
1909
|
+
X,
|
|
1897
1910
|
M.nodes
|
|
1898
|
-
]),
|
|
1911
|
+
]), Z = h(() => dt(M), [M]), Rn = h(() => Ca(q), [q]);
|
|
1899
1912
|
m(() => {
|
|
1900
1913
|
a && C?.(M);
|
|
1901
1914
|
}, [a, M]), m(() => {
|
|
1902
1915
|
a && x?.(P);
|
|
1903
1916
|
}, [a, P]);
|
|
1904
|
-
async function
|
|
1905
|
-
|
|
1917
|
+
async function Bn() {
|
|
1918
|
+
yt(!0), R(null);
|
|
1906
1919
|
try {
|
|
1907
1920
|
let e = await Pe();
|
|
1908
|
-
|
|
1921
|
+
Ht(e.orgUnits), Ut(e.positions), Gt(e.memberships);
|
|
1909
1922
|
} catch (e) {
|
|
1910
|
-
R(
|
|
1923
|
+
R(J(e, k));
|
|
1911
1924
|
} finally {
|
|
1912
|
-
|
|
1925
|
+
yt(!1);
|
|
1913
1926
|
}
|
|
1914
1927
|
}
|
|
1915
|
-
async function
|
|
1916
|
-
|
|
1928
|
+
async function Vn() {
|
|
1929
|
+
yt(!0), R(null), z(null);
|
|
1917
1930
|
try {
|
|
1918
1931
|
let [e, t] = await Promise.all([Ye(pe), Pe()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, r = n ?? e.versions[0] ?? null;
|
|
1919
|
-
ve(e), be(n),
|
|
1920
|
-
let i =
|
|
1932
|
+
ve(e), be(n), Ht(t.orgUnits), Ut(t.positions), Gt(t.memberships), Mt(Fa(e.formVersions));
|
|
1933
|
+
let i = Ui(r?.workflowDefinition ?? Ji()), a = r?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, o = r?.initiatorPolicyCel ?? null;
|
|
1921
1934
|
He(i), Ue(a), tt(o), Se(JSON.stringify({
|
|
1922
1935
|
formDefinitionVersionId: a,
|
|
1923
1936
|
initiatorPolicyCel: o,
|
|
1924
1937
|
workflowDefinition: i
|
|
1925
|
-
})), we(r && !e.template.currentVersionId && !r.initiatorPolicyCel &&
|
|
1938
|
+
})), we(r && !e.template.currentVersionId && !r.initiatorPolicyCel && Yi(r.workflowDefinition) ? "NONE" : null), Ee(null), rt(r?.workflowDefinition.nodes[0]?.id ?? "start"), it([]), lt(null), fn(null), mn(!1);
|
|
1926
1939
|
} catch (e) {
|
|
1927
|
-
R(
|
|
1940
|
+
R(J(e, k));
|
|
1928
1941
|
} finally {
|
|
1929
|
-
|
|
1942
|
+
yt(!1);
|
|
1930
1943
|
}
|
|
1931
1944
|
}
|
|
1932
|
-
async function
|
|
1945
|
+
async function Hn(e) {
|
|
1933
1946
|
Tt(!0), R(null);
|
|
1934
1947
|
try {
|
|
1935
1948
|
let t = await $e(e);
|
|
1936
|
-
|
|
1949
|
+
Mt(Ba(Fa(t), Y));
|
|
1937
1950
|
} catch (e) {
|
|
1938
|
-
R(
|
|
1951
|
+
R(J(e, k));
|
|
1939
1952
|
} finally {
|
|
1940
1953
|
Tt(!1);
|
|
1941
1954
|
}
|
|
1942
1955
|
}
|
|
1943
|
-
async function
|
|
1944
|
-
|
|
1945
|
-
let t = ++
|
|
1956
|
+
async function Un(e) {
|
|
1957
|
+
It(!0), R(null);
|
|
1958
|
+
let t = ++Bt.current;
|
|
1946
1959
|
try {
|
|
1947
|
-
let n =
|
|
1948
|
-
|
|
1960
|
+
let n = Va(await Qe(e));
|
|
1961
|
+
Lt((e) => to(e, n)), t === Bt.current && zt(n);
|
|
1949
1962
|
} catch (e) {
|
|
1950
|
-
t ===
|
|
1963
|
+
t === Bt.current && R(J(e, k));
|
|
1951
1964
|
} finally {
|
|
1952
|
-
t ===
|
|
1965
|
+
t === Bt.current && It(!1);
|
|
1953
1966
|
}
|
|
1954
1967
|
}
|
|
1955
|
-
async function
|
|
1956
|
-
let t =
|
|
1968
|
+
async function Wn(e) {
|
|
1969
|
+
let t = ro(e), n = l(t.filter((e) => !B.some((t) => t.memberId === e && !t.unresolved)), Vt.current);
|
|
1957
1970
|
if (n.length === 0) return;
|
|
1958
1971
|
let { profiles: r, skippedIds: i } = await u(n, Ze), a = new Set(r.map((e) => e.memberId)), o = n.filter((e) => !a.has(e) && !i.includes(e));
|
|
1959
|
-
o.forEach((e) =>
|
|
1972
|
+
o.forEach((e) => Vt.current.add(e)), Lt((e) => to(e, [...Va(r), ...[...o, ...i].map(Ha)]));
|
|
1960
1973
|
}
|
|
1961
|
-
async function
|
|
1962
|
-
|
|
1974
|
+
async function Gn(e) {
|
|
1975
|
+
xt(!0), R(null);
|
|
1963
1976
|
try {
|
|
1964
|
-
let t =
|
|
1977
|
+
let t = po(M), n = Ca(q), r = e ? Fn : null;
|
|
1965
1978
|
if (t || n || r) {
|
|
1966
1979
|
let e = t ?? n ?? r ?? "流程設定未完成";
|
|
1967
1980
|
throw R(e), Error(e);
|
|
1968
1981
|
}
|
|
1969
|
-
if (
|
|
1982
|
+
if (pn && G !== null) await We({
|
|
1970
1983
|
category: A?.template.category ?? null,
|
|
1971
1984
|
categoryId: A?.template.categoryId ?? null,
|
|
1972
|
-
formDefinitionId:
|
|
1985
|
+
formDefinitionId: Y?.formDefinitionId ?? null,
|
|
1973
1986
|
formDescription: null,
|
|
1974
|
-
formName:
|
|
1987
|
+
formName: Y?.formName ?? A?.template.name ?? "表單",
|
|
1975
1988
|
initiatorPolicyCel: P,
|
|
1976
1989
|
notificationConfig: null,
|
|
1977
1990
|
publish: e,
|
|
1978
|
-
schema:
|
|
1991
|
+
schema: G.schema,
|
|
1979
1992
|
slaDefaults: null,
|
|
1980
1993
|
templateDescription: null,
|
|
1981
1994
|
templateId: pe ?? null,
|
|
1982
1995
|
templateName: A?.template.name ?? "模板",
|
|
1983
|
-
uiSchema:
|
|
1996
|
+
uiSchema: G.uiSchema,
|
|
1984
1997
|
workflowDefinition: M
|
|
1985
|
-
}),
|
|
1998
|
+
}), mn(!1), fn(null), await Vn();
|
|
1986
1999
|
else {
|
|
1987
2000
|
let t = ye ?? await Ke(pe), n = await et({
|
|
1988
2001
|
formDefinitionVersionId: N,
|
|
@@ -1990,66 +2003,66 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
1990
2003
|
versionId: t.id,
|
|
1991
2004
|
workflowDefinition: M
|
|
1992
2005
|
});
|
|
1993
|
-
be(n), e && await Je(n.id), await
|
|
2006
|
+
be(n), e && await Je(n.id), await Vn();
|
|
1994
2007
|
}
|
|
1995
2008
|
} catch (e) {
|
|
1996
|
-
R(
|
|
2009
|
+
R(J(e, k, M));
|
|
1997
2010
|
} finally {
|
|
1998
|
-
|
|
2011
|
+
xt(!1);
|
|
1999
2012
|
}
|
|
2000
2013
|
}
|
|
2014
|
+
async function Kn() {
|
|
2015
|
+
await Gn(!1);
|
|
2016
|
+
}
|
|
2001
2017
|
async function qn() {
|
|
2002
|
-
await
|
|
2018
|
+
await Gn(!0);
|
|
2003
2019
|
}
|
|
2004
|
-
|
|
2005
|
-
|
|
2020
|
+
function Yn() {
|
|
2021
|
+
en(JSON.stringify(tr(X), null, 2)), tn(null), rn(null), qt(!0);
|
|
2006
2022
|
}
|
|
2007
2023
|
function Xn() {
|
|
2008
|
-
|
|
2024
|
+
Zt || qt(!1);
|
|
2009
2025
|
}
|
|
2010
|
-
function Zn() {
|
|
2011
|
-
Qt
|
|
2012
|
-
}
|
|
2013
|
-
async function Qn() {
|
|
2014
|
-
$t(!0), an(null), nn(null);
|
|
2026
|
+
async function Zn() {
|
|
2027
|
+
Qt(!0), rn(null), tn(null);
|
|
2015
2028
|
try {
|
|
2016
|
-
let e =
|
|
2029
|
+
let e = Ia($t), t = await Ge({
|
|
2017
2030
|
formData: e,
|
|
2018
|
-
initiatorMemberId:
|
|
2019
|
-
initiatorMetadataSnapshot:
|
|
2031
|
+
initiatorMemberId: xi,
|
|
2032
|
+
initiatorMetadataSnapshot: Ja(xi, Wt),
|
|
2020
2033
|
workflowDefinition: M
|
|
2021
2034
|
});
|
|
2022
|
-
|
|
2035
|
+
tn(t);
|
|
2023
2036
|
} catch (e) {
|
|
2024
|
-
|
|
2037
|
+
rn(J(e, k));
|
|
2025
2038
|
} finally {
|
|
2026
|
-
|
|
2039
|
+
Qt(!1);
|
|
2027
2040
|
}
|
|
2028
2041
|
}
|
|
2029
|
-
async function
|
|
2030
|
-
if (
|
|
2031
|
-
let e =
|
|
2032
|
-
if (!e)
|
|
2033
|
-
schema:
|
|
2034
|
-
uiSchema:
|
|
2042
|
+
async function Qn() {
|
|
2043
|
+
if (W(!0), G !== null) return;
|
|
2044
|
+
let e = Y?.formDefinitionId ?? null;
|
|
2045
|
+
if (!e) fn({
|
|
2046
|
+
schema: Ti,
|
|
2047
|
+
uiSchema: Ei
|
|
2035
2048
|
});
|
|
2036
2049
|
else {
|
|
2037
|
-
|
|
2050
|
+
gn(!0);
|
|
2038
2051
|
try {
|
|
2039
2052
|
let t = await Me(e), n = t.versions.find((e) => e.status === "DRAFT") ?? t.versions.find((e) => e.id === t.definition.currentVersionId) ?? t.versions[0] ?? null;
|
|
2040
|
-
|
|
2041
|
-
schema: n?.schema ??
|
|
2042
|
-
uiSchema: n?.uiSchema ??
|
|
2053
|
+
fn({
|
|
2054
|
+
schema: n?.schema ?? Ti,
|
|
2055
|
+
uiSchema: n?.uiSchema ?? Ei
|
|
2043
2056
|
});
|
|
2044
2057
|
} catch (e) {
|
|
2045
|
-
R(
|
|
2058
|
+
R(J(e, k));
|
|
2046
2059
|
} finally {
|
|
2047
|
-
|
|
2060
|
+
gn(!1);
|
|
2048
2061
|
}
|
|
2049
2062
|
}
|
|
2050
2063
|
}
|
|
2051
|
-
function
|
|
2052
|
-
let t = Ve(e,
|
|
2064
|
+
function $n(e) {
|
|
2065
|
+
let t = Ve(e, Ln);
|
|
2053
2066
|
He((e) => ({
|
|
2054
2067
|
...e,
|
|
2055
2068
|
nodes: e.nodes.map((e) => {
|
|
@@ -2061,110 +2074,117 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2061
2074
|
})
|
|
2062
2075
|
}));
|
|
2063
2076
|
}
|
|
2064
|
-
function
|
|
2065
|
-
|
|
2077
|
+
function er(e) {
|
|
2078
|
+
Oa(e, M.nodes) && e.source && e.target && j.dispatch({
|
|
2066
2079
|
source: e.source,
|
|
2067
2080
|
target: e.target,
|
|
2068
2081
|
type: "connectEdge"
|
|
2069
2082
|
});
|
|
2070
2083
|
}
|
|
2071
|
-
function
|
|
2072
|
-
e.stopPropagation(),
|
|
2084
|
+
function nr(e, t) {
|
|
2085
|
+
e.stopPropagation(), it((n) => e.shiftKey || e.metaKey || e.ctrlKey ? ka(n, t.id) : [t.id]), rt(null);
|
|
2073
2086
|
}
|
|
2074
|
-
function
|
|
2075
|
-
|
|
2087
|
+
function rr() {
|
|
2088
|
+
lt(null);
|
|
2076
2089
|
}
|
|
2077
|
-
function
|
|
2090
|
+
function ar(e) {
|
|
2078
2091
|
j.dispatch({
|
|
2079
2092
|
nodeType: e,
|
|
2080
2093
|
type: "addNode"
|
|
2081
2094
|
});
|
|
2082
2095
|
}
|
|
2083
|
-
function
|
|
2084
|
-
|
|
2096
|
+
function or(e) {
|
|
2097
|
+
K && j.dispatch({
|
|
2085
2098
|
label: e,
|
|
2086
|
-
nodeId:
|
|
2099
|
+
nodeId: K.id,
|
|
2087
2100
|
type: "renameNode"
|
|
2088
2101
|
});
|
|
2089
2102
|
}
|
|
2090
|
-
function
|
|
2091
|
-
if (!
|
|
2092
|
-
let t =
|
|
2103
|
+
function Q(e) {
|
|
2104
|
+
if (!K || K.type !== "userTask") return;
|
|
2105
|
+
let t = K.id, n = K.data.decisionPolicy;
|
|
2093
2106
|
j.dispatch({
|
|
2094
2107
|
approverResolver: e,
|
|
2095
2108
|
nodeId: t,
|
|
2096
2109
|
type: "setUserTaskApprover"
|
|
2097
|
-
}),
|
|
2110
|
+
}), z(null), mt(e, n) ? z({
|
|
2098
2111
|
message: "主管鏈會依序加入多位主管,簽核方式已改為「依序簽核」。",
|
|
2099
2112
|
nodeId: t,
|
|
2100
2113
|
policyType: "SEQUENTIAL"
|
|
2101
|
-
}) :
|
|
2102
|
-
message: `簽核者已變更為 ${
|
|
2114
|
+
}) : ft(n, e) && z({
|
|
2115
|
+
message: `簽核者已變更為 ${_t(e)} 位,不足原本設定的 ${n?.type === "QUORUM" ? n.threshold : 0} 位門檻,簽核政策已重設為單人簽核,請重新設定。`,
|
|
2103
2116
|
nodeId: t,
|
|
2104
2117
|
policyType: "SINGLE"
|
|
2105
2118
|
});
|
|
2106
2119
|
}
|
|
2120
|
+
function sr(e) {
|
|
2121
|
+
K && K.type === "userTask" && j.dispatch({
|
|
2122
|
+
allowedTargets: e,
|
|
2123
|
+
nodeId: K.id,
|
|
2124
|
+
type: "setUserTaskReturnAllowedTargets"
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2107
2127
|
function cr(e) {
|
|
2108
|
-
|
|
2109
|
-
nodeId:
|
|
2128
|
+
K && K.type === "userTask" && j.dispatch({
|
|
2129
|
+
nodeId: K.id,
|
|
2110
2130
|
resubmitStrategy: e,
|
|
2111
2131
|
type: "setUserTaskReturnResubmitStrategy"
|
|
2112
2132
|
});
|
|
2113
2133
|
}
|
|
2114
2134
|
function lr(e) {
|
|
2115
|
-
|
|
2116
|
-
nodeId:
|
|
2135
|
+
K && K.type === "userTask" && j.dispatch({
|
|
2136
|
+
nodeId: K.id,
|
|
2117
2137
|
requireComment: e,
|
|
2118
2138
|
type: "setUserTaskReturnRequireComment"
|
|
2119
2139
|
});
|
|
2120
2140
|
}
|
|
2121
2141
|
function ur(e) {
|
|
2122
|
-
|
|
2123
|
-
nodeId:
|
|
2142
|
+
K && K.type === "userTask" && j.dispatch({
|
|
2143
|
+
nodeId: K.id,
|
|
2124
2144
|
sla: e,
|
|
2125
2145
|
type: "setUserTaskSla"
|
|
2126
2146
|
});
|
|
2127
2147
|
}
|
|
2128
2148
|
function dr(e) {
|
|
2129
|
-
|
|
2149
|
+
K && K.type === "userTask" && j.dispatch({
|
|
2130
2150
|
excludeInitiator: e,
|
|
2131
|
-
nodeId:
|
|
2151
|
+
nodeId: K.id,
|
|
2132
2152
|
type: "setUserTaskExcludeInitiator"
|
|
2133
2153
|
});
|
|
2134
2154
|
}
|
|
2135
2155
|
function fr(e) {
|
|
2136
|
-
if (!
|
|
2137
|
-
|
|
2156
|
+
if (!K || K.type !== "userTask") return;
|
|
2157
|
+
z(null);
|
|
2138
2158
|
let t = e.type === "QUORUM" ? {
|
|
2139
2159
|
...e,
|
|
2140
|
-
threshold:
|
|
2160
|
+
threshold: ct(e.threshold, e.thresholdType)
|
|
2141
2161
|
} : e;
|
|
2142
2162
|
j.dispatch({
|
|
2143
2163
|
decisionPolicy: t,
|
|
2144
|
-
nodeId:
|
|
2164
|
+
nodeId: K.id,
|
|
2145
2165
|
type: "setUserTaskDecisionPolicy"
|
|
2146
2166
|
});
|
|
2147
2167
|
}
|
|
2148
|
-
function
|
|
2149
|
-
|
|
2168
|
+
function mr(e) {
|
|
2169
|
+
K && K.type === "userTask" && j.dispatch({
|
|
2150
2170
|
...e,
|
|
2151
|
-
nodeId:
|
|
2171
|
+
nodeId: K.id,
|
|
2152
2172
|
type: "setUserTaskOptions"
|
|
2153
2173
|
});
|
|
2154
2174
|
}
|
|
2155
|
-
function
|
|
2156
|
-
|
|
2175
|
+
function gr(e) {
|
|
2176
|
+
K && K.type === "serviceTask" && j.dispatch({
|
|
2157
2177
|
action: e,
|
|
2158
|
-
nodeId:
|
|
2178
|
+
nodeId: K.id,
|
|
2159
2179
|
type: "setServiceAction"
|
|
2160
2180
|
});
|
|
2161
2181
|
}
|
|
2162
|
-
function
|
|
2163
|
-
Ee(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), we(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), tt(
|
|
2182
|
+
function Cr(e) {
|
|
2183
|
+
Ee(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), we(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), tt(Ta(e, V));
|
|
2164
2184
|
}
|
|
2165
|
-
function
|
|
2166
|
-
|
|
2167
|
-
nodeId:
|
|
2185
|
+
function Tr(e) {
|
|
2186
|
+
K && K.type !== "startEvent" && j.dispatch({
|
|
2187
|
+
nodeId: K.id,
|
|
2168
2188
|
triggerMode: e,
|
|
2169
2189
|
type: "setNodeTriggerMode"
|
|
2170
2190
|
});
|
|
@@ -2176,7 +2196,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2176
2196
|
type: "setEdgeDefault"
|
|
2177
2197
|
});
|
|
2178
2198
|
}
|
|
2179
|
-
function
|
|
2199
|
+
function Or({ edgeId: e, fieldKey: t, operator: n, value: r }) {
|
|
2180
2200
|
j.dispatch({
|
|
2181
2201
|
edgeId: e,
|
|
2182
2202
|
fieldKey: t,
|
|
@@ -2185,85 +2205,85 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2185
2205
|
value: r
|
|
2186
2206
|
});
|
|
2187
2207
|
}
|
|
2188
|
-
function
|
|
2208
|
+
function zr() {
|
|
2189
2209
|
j.dispatch({ type: "autoLayout" });
|
|
2190
2210
|
}
|
|
2191
2211
|
return /* @__PURE__ */ O(E, { children: [
|
|
2192
|
-
/* @__PURE__ */ D("style", { children:
|
|
2212
|
+
/* @__PURE__ */ D("style", { children: wr }),
|
|
2193
2213
|
a ? null : /* @__PURE__ */ D(re, { children: /* @__PURE__ */ O(le, {
|
|
2194
|
-
description:
|
|
2214
|
+
description: hr({
|
|
2195
2215
|
draftVersion: ye?.version ?? null,
|
|
2196
2216
|
hasPublishedVersion: !!A?.template.currentVersionId,
|
|
2197
2217
|
publishedVersion: A?.versions.find((e) => e.id === A.template.currentVersionId)?.version ?? null
|
|
2198
2218
|
}),
|
|
2199
|
-
onBackClick:
|
|
2219
|
+
onBackClick: vn,
|
|
2200
2220
|
title: A?.template.name ?? "流程設計器",
|
|
2201
2221
|
children: [
|
|
2202
2222
|
oe ? /* @__PURE__ */ D(b, {
|
|
2203
2223
|
disabled: !i,
|
|
2204
|
-
onClick: () =>
|
|
2205
|
-
variant:
|
|
2224
|
+
onClick: () => un((e) => !e),
|
|
2225
|
+
variant: ln ? "base-primary" : "base-secondary",
|
|
2206
2226
|
children: i ? "AI 助理" : "AI 助理(未設定)"
|
|
2207
2227
|
}) : null,
|
|
2208
2228
|
/* @__PURE__ */ D(b, {
|
|
2209
2229
|
"aria-label": "儲存草稿",
|
|
2210
|
-
disabled:
|
|
2230
|
+
disabled: bt || !!Mn || !!Rn,
|
|
2211
2231
|
icon: ge,
|
|
2212
2232
|
iconType: "icon-only",
|
|
2213
|
-
onClick: () => void
|
|
2233
|
+
onClick: () => void Kn(),
|
|
2214
2234
|
variant: "base-secondary",
|
|
2215
2235
|
children: "儲存草稿"
|
|
2216
2236
|
}),
|
|
2217
2237
|
de ? /* @__PURE__ */ D(b, {
|
|
2218
|
-
disabled:
|
|
2238
|
+
disabled: vt || !!Mn || !!Rn,
|
|
2219
2239
|
icon: fe,
|
|
2220
2240
|
iconType: "leading",
|
|
2221
|
-
onClick:
|
|
2241
|
+
onClick: Yn,
|
|
2222
2242
|
variant: "base-secondary",
|
|
2223
2243
|
children: "試跑流程"
|
|
2224
2244
|
}) : null,
|
|
2225
2245
|
/* @__PURE__ */ D(b, {
|
|
2226
|
-
disabled:
|
|
2246
|
+
disabled: bt || !ye && !Pt && !pn || !!Mn || !!Rn || !!Fn,
|
|
2227
2247
|
icon: ue,
|
|
2228
2248
|
iconType: "leading",
|
|
2229
|
-
onClick: () => void
|
|
2249
|
+
onClick: () => void qn(),
|
|
2230
2250
|
variant: "base-primary",
|
|
2231
|
-
children:
|
|
2251
|
+
children: _n
|
|
2232
2252
|
})
|
|
2233
2253
|
]
|
|
2234
2254
|
}) }),
|
|
2235
2255
|
/* @__PURE__ */ D(ae, { children: /* @__PURE__ */ D(ie, { children: /* @__PURE__ */ O("div", {
|
|
2236
|
-
style:
|
|
2256
|
+
style: _r,
|
|
2237
2257
|
children: [
|
|
2238
|
-
|
|
2258
|
+
ut ? /* @__PURE__ */ D(T, {
|
|
2239
2259
|
color: "text-error",
|
|
2240
2260
|
variant: "body",
|
|
2241
|
-
children:
|
|
2261
|
+
children: ut
|
|
2242
2262
|
}) : null,
|
|
2243
|
-
|
|
2263
|
+
pt && pt.nodeId === K?.id && K.type === "userTask" && (K.data.decisionPolicy?.type ?? "SINGLE") === pt.policyType ? /* @__PURE__ */ D(T, {
|
|
2244
2264
|
color: "text-warning",
|
|
2245
2265
|
variant: "body",
|
|
2246
|
-
children:
|
|
2266
|
+
children: pt.message
|
|
2247
2267
|
}) : null,
|
|
2248
|
-
|
|
2268
|
+
Mn ? /* @__PURE__ */ D(T, {
|
|
2249
2269
|
color: "text-error",
|
|
2250
2270
|
variant: "body",
|
|
2251
|
-
children:
|
|
2271
|
+
children: Mn
|
|
2252
2272
|
}) : null,
|
|
2253
|
-
|
|
2273
|
+
Rn ? /* @__PURE__ */ D(T, {
|
|
2254
2274
|
color: "text-error",
|
|
2255
2275
|
variant: "body",
|
|
2256
|
-
children:
|
|
2276
|
+
children: Rn
|
|
2257
2277
|
}) : null,
|
|
2258
|
-
!
|
|
2278
|
+
!Mn && Fn ? /* @__PURE__ */ O(T, {
|
|
2259
2279
|
color: "text-error",
|
|
2260
2280
|
variant: "body",
|
|
2261
|
-
children: ["發布前需修正:",
|
|
2281
|
+
children: ["發布前需修正:", Fn]
|
|
2262
2282
|
}) : null,
|
|
2263
2283
|
a ? null : /* @__PURE__ */ D("div", {
|
|
2264
2284
|
style: jr,
|
|
2265
2285
|
children: /* @__PURE__ */ D(r, {
|
|
2266
|
-
hintText:
|
|
2286
|
+
hintText: Z ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
|
|
2267
2287
|
label: "綁定表單版本",
|
|
2268
2288
|
name: "formDefinitionVersionId",
|
|
2269
2289
|
required: !0,
|
|
@@ -2273,32 +2293,32 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2273
2293
|
style: Ir,
|
|
2274
2294
|
children: /* @__PURE__ */ D(v, {
|
|
2275
2295
|
asyncData: !0,
|
|
2276
|
-
disabled:
|
|
2296
|
+
disabled: vt || Z,
|
|
2277
2297
|
disabledOptionsFilter: !0,
|
|
2278
2298
|
emptyText: "沒有符合的已發布表單版本",
|
|
2279
|
-
isForceClearable: !!N && !
|
|
2280
|
-
loading:
|
|
2299
|
+
isForceClearable: !!N && !Z,
|
|
2300
|
+
loading: St,
|
|
2281
2301
|
loadingText: "搜尋表單版本中...",
|
|
2282
2302
|
mode: "single",
|
|
2283
2303
|
onChange: (e) => {
|
|
2284
|
-
|
|
2304
|
+
Z || Ue(e?.id ?? null);
|
|
2285
2305
|
},
|
|
2286
2306
|
onClear: () => {
|
|
2287
|
-
|
|
2307
|
+
Z || Ue(null);
|
|
2288
2308
|
},
|
|
2289
|
-
onSearch:
|
|
2309
|
+
onSearch: Hn,
|
|
2290
2310
|
onVisibilityChange: (e) => {
|
|
2291
|
-
e && !
|
|
2311
|
+
e && !Z && Hn("");
|
|
2292
2312
|
},
|
|
2293
|
-
options: [...
|
|
2313
|
+
options: [...kn],
|
|
2294
2314
|
placeholder: "選擇已發布表單版本",
|
|
2295
2315
|
searchDebounceTime: 300,
|
|
2296
|
-
value:
|
|
2316
|
+
value: Y
|
|
2297
2317
|
})
|
|
2298
2318
|
}), /* @__PURE__ */ D(b, {
|
|
2299
|
-
disabled:
|
|
2319
|
+
disabled: vt,
|
|
2300
2320
|
onClick: () => {
|
|
2301
|
-
|
|
2321
|
+
Qn();
|
|
2302
2322
|
},
|
|
2303
2323
|
style: Lr,
|
|
2304
2324
|
variant: "base-secondary",
|
|
@@ -2308,45 +2328,45 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2308
2328
|
})
|
|
2309
2329
|
}),
|
|
2310
2330
|
/* @__PURE__ */ O("div", {
|
|
2311
|
-
style:
|
|
2331
|
+
style: vr,
|
|
2312
2332
|
children: [/* @__PURE__ */ D("div", {
|
|
2313
2333
|
ref: De,
|
|
2314
|
-
style:
|
|
2334
|
+
style: yr,
|
|
2315
2335
|
children: /* @__PURE__ */ O(Be, {
|
|
2316
2336
|
connectionMode: Ie.Strict,
|
|
2317
|
-
edges:
|
|
2337
|
+
edges: On,
|
|
2318
2338
|
fitView: !0,
|
|
2319
|
-
isValidConnection: (e) =>
|
|
2320
|
-
nodeTypes:
|
|
2321
|
-
nodes:
|
|
2339
|
+
isValidConnection: (e) => Oa(e, M.nodes),
|
|
2340
|
+
nodeTypes: Di,
|
|
2341
|
+
nodes: Ln,
|
|
2322
2342
|
deleteKeyCode: null,
|
|
2323
2343
|
multiSelectionKeyCode: [
|
|
2324
2344
|
"Shift",
|
|
2325
2345
|
"Meta",
|
|
2326
2346
|
"Control"
|
|
2327
2347
|
],
|
|
2328
|
-
onConnect:
|
|
2329
|
-
onEdgeClick:
|
|
2348
|
+
onConnect: er,
|
|
2349
|
+
onEdgeClick: nr,
|
|
2330
2350
|
onNodeClick: (e, t) => {
|
|
2331
|
-
rt(t.id),
|
|
2351
|
+
rt(t.id), it([]);
|
|
2332
2352
|
},
|
|
2333
|
-
onNodesChange:
|
|
2353
|
+
onNodesChange: $n,
|
|
2334
2354
|
onPaneClick: () => {
|
|
2335
|
-
rt(null),
|
|
2355
|
+
rt(null), it([]);
|
|
2336
2356
|
},
|
|
2337
2357
|
onViewportChange: Ae,
|
|
2338
2358
|
viewport: ke,
|
|
2339
2359
|
children: [
|
|
2340
2360
|
/* @__PURE__ */ D(Fe, {}),
|
|
2341
2361
|
/* @__PURE__ */ D("style", { children: kr }),
|
|
2342
|
-
/* @__PURE__ */ D(Re, { children:
|
|
2362
|
+
/* @__PURE__ */ D(Re, { children: bn ? /* @__PURE__ */ D(Le, {
|
|
2343
2363
|
"aria-label": "刪除選取項目",
|
|
2344
2364
|
className: "workflow-selection-delete-control",
|
|
2345
|
-
onClick:
|
|
2346
|
-
style:
|
|
2365
|
+
onClick: xn,
|
|
2366
|
+
style: br,
|
|
2347
2367
|
title: "刪除選取項目",
|
|
2348
2368
|
children: /* @__PURE__ */ D("span", {
|
|
2349
|
-
style:
|
|
2369
|
+
style: xr,
|
|
2350
2370
|
children: /* @__PURE__ */ D(ee, {
|
|
2351
2371
|
color: "error",
|
|
2352
2372
|
icon: _e,
|
|
@@ -2354,12 +2374,12 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2354
2374
|
})
|
|
2355
2375
|
})
|
|
2356
2376
|
}) : null }),
|
|
2357
|
-
/* @__PURE__ */ D(
|
|
2377
|
+
/* @__PURE__ */ D(Ai, { onApplyAutoLayout: zr }),
|
|
2358
2378
|
/* @__PURE__ */ D(ze, {})
|
|
2359
2379
|
]
|
|
2360
2380
|
})
|
|
2361
2381
|
}), /* @__PURE__ */ O("div", {
|
|
2362
|
-
className:
|
|
2382
|
+
className: Sr,
|
|
2363
2383
|
style: Ar,
|
|
2364
2384
|
children: [
|
|
2365
2385
|
/* @__PURE__ */ D(T, {
|
|
@@ -2377,9 +2397,9 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2377
2397
|
style: Pr,
|
|
2378
2398
|
children: /* @__PURE__ */ D(b, {
|
|
2379
2399
|
disabled: !i,
|
|
2380
|
-
onClick: () =>
|
|
2400
|
+
onClick: () => un((e) => !e),
|
|
2381
2401
|
size: "sub",
|
|
2382
|
-
variant:
|
|
2402
|
+
variant: ln ? "base-primary" : "base-secondary",
|
|
2383
2403
|
children: i ? "AI 助理" : "AI 助理(未設定)"
|
|
2384
2404
|
})
|
|
2385
2405
|
})]
|
|
@@ -2395,7 +2415,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2395
2415
|
children: ai.map((e) => /* @__PURE__ */ D(b, {
|
|
2396
2416
|
icon: e.icon,
|
|
2397
2417
|
iconType: "leading",
|
|
2398
|
-
onClick: () =>
|
|
2418
|
+
onClick: () => ar(e.type),
|
|
2399
2419
|
size: "sub",
|
|
2400
2420
|
variant: "base-secondary",
|
|
2401
2421
|
children: e.label
|
|
@@ -2413,7 +2433,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2413
2433
|
children: oi.map((e) => /* @__PURE__ */ D(b, {
|
|
2414
2434
|
icon: e.icon,
|
|
2415
2435
|
iconType: "leading",
|
|
2416
|
-
onClick: () =>
|
|
2436
|
+
onClick: () => ar(e.type),
|
|
2417
2437
|
size: "sub",
|
|
2418
2438
|
variant: "base-secondary",
|
|
2419
2439
|
children: e.label
|
|
@@ -2429,78 +2449,78 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2429
2449
|
}), /* @__PURE__ */ D("div", {
|
|
2430
2450
|
style: Pr,
|
|
2431
2451
|
children: /* @__PURE__ */ D(b, {
|
|
2432
|
-
disabled:
|
|
2433
|
-
onClick: () =>
|
|
2452
|
+
disabled: X === null,
|
|
2453
|
+
onClick: () => Xt(!0),
|
|
2434
2454
|
size: "sub",
|
|
2435
|
-
title:
|
|
2455
|
+
title: X === null ? Gr : void 0,
|
|
2436
2456
|
variant: "base-secondary",
|
|
2437
2457
|
children: "欄位總覽"
|
|
2438
2458
|
})
|
|
2439
2459
|
})]
|
|
2440
2460
|
}),
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2461
|
+
En.length > 1 ? qr(En) : null,
|
|
2462
|
+
En.length === 1 && wn ? Jr(wn) : null,
|
|
2463
|
+
En.length === 0 && K ? Vr(K) : null
|
|
2444
2464
|
]
|
|
2445
2465
|
})]
|
|
2446
2466
|
})
|
|
2447
2467
|
]
|
|
2448
2468
|
}) }) }),
|
|
2449
|
-
|
|
2450
|
-
!a && de ?
|
|
2451
|
-
/* @__PURE__ */ D(
|
|
2469
|
+
Yr(Cn),
|
|
2470
|
+
!a && de ? Br() : null,
|
|
2471
|
+
/* @__PURE__ */ D(Sn, {
|
|
2452
2472
|
definition: M,
|
|
2453
|
-
formSchema:
|
|
2473
|
+
formSchema: X,
|
|
2454
2474
|
language: k,
|
|
2455
2475
|
onApply: (e) => j.dispatch({
|
|
2456
2476
|
entries: e,
|
|
2457
2477
|
type: "setFieldAccessMatrix"
|
|
2458
2478
|
}).error,
|
|
2459
|
-
onClose: () =>
|
|
2460
|
-
open:
|
|
2479
|
+
onClose: () => Xt(!1),
|
|
2480
|
+
open: Yt
|
|
2461
2481
|
}),
|
|
2462
|
-
oe && i ? /* @__PURE__ */ D(
|
|
2482
|
+
oe && i ? /* @__PURE__ */ D(Jt, {
|
|
2463
2483
|
controller: j,
|
|
2464
|
-
onClose: () =>
|
|
2465
|
-
open:
|
|
2484
|
+
onClose: () => un(!1),
|
|
2485
|
+
open: ln
|
|
2466
2486
|
}) : null,
|
|
2467
2487
|
a ? null : /* @__PURE__ */ D(ce, {
|
|
2468
2488
|
headerTitle: "編輯表單",
|
|
2469
2489
|
isHeaderDisplay: !0,
|
|
2470
|
-
onClose: () =>
|
|
2471
|
-
open:
|
|
2490
|
+
onClose: () => W(!1),
|
|
2491
|
+
open: dn,
|
|
2472
2492
|
size: "wide",
|
|
2473
2493
|
children: /* @__PURE__ */ O("div", {
|
|
2474
|
-
style:
|
|
2494
|
+
style: Si,
|
|
2475
2495
|
children: [/* @__PURE__ */ D("div", {
|
|
2476
|
-
style:
|
|
2477
|
-
children:
|
|
2496
|
+
style: Ci,
|
|
2497
|
+
children: hn ? /* @__PURE__ */ D(T, {
|
|
2478
2498
|
color: "text-neutral",
|
|
2479
2499
|
variant: "body",
|
|
2480
2500
|
children: "載入中…"
|
|
2481
2501
|
}) : /* @__PURE__ */ D(d, {
|
|
2482
2502
|
onChange: (e) => {
|
|
2483
|
-
|
|
2503
|
+
fn(e);
|
|
2484
2504
|
},
|
|
2485
|
-
value:
|
|
2486
|
-
schema:
|
|
2487
|
-
uiSchema:
|
|
2505
|
+
value: G ?? {
|
|
2506
|
+
schema: Ti,
|
|
2507
|
+
uiSchema: Ei
|
|
2488
2508
|
}
|
|
2489
2509
|
})
|
|
2490
2510
|
}), /* @__PURE__ */ O("div", {
|
|
2491
|
-
style:
|
|
2511
|
+
style: wi,
|
|
2492
2512
|
children: [/* @__PURE__ */ D(b, {
|
|
2493
|
-
disabled:
|
|
2513
|
+
disabled: hn,
|
|
2494
2514
|
onClick: () => {
|
|
2495
|
-
|
|
2515
|
+
G !== null && (mn(!0), j.replaceState((e) => ({
|
|
2496
2516
|
...e,
|
|
2497
|
-
formSchema:
|
|
2498
|
-
}))),
|
|
2517
|
+
formSchema: G.schema
|
|
2518
|
+
}))), W(!1);
|
|
2499
2519
|
},
|
|
2500
2520
|
variant: "base-primary",
|
|
2501
2521
|
children: "套用"
|
|
2502
2522
|
}), /* @__PURE__ */ D(b, {
|
|
2503
|
-
onClick: () =>
|
|
2523
|
+
onClick: () => W(!1),
|
|
2504
2524
|
variant: "base-secondary",
|
|
2505
2525
|
children: "取消"
|
|
2506
2526
|
})]
|
|
@@ -2508,26 +2528,26 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2508
2528
|
})
|
|
2509
2529
|
})
|
|
2510
2530
|
] });
|
|
2511
|
-
function
|
|
2531
|
+
function Br() {
|
|
2512
2532
|
let e = {
|
|
2513
|
-
formFields:
|
|
2514
|
-
memberName: (e) =>
|
|
2515
|
-
orgUnits:
|
|
2516
|
-
positions:
|
|
2533
|
+
formFields: X?.fields ?? [],
|
|
2534
|
+
memberName: (e) => B.find((t) => t.memberId === e && !t.unresolved)?.displayName ?? null,
|
|
2535
|
+
orgUnits: V,
|
|
2536
|
+
positions: H
|
|
2517
2537
|
};
|
|
2518
2538
|
return /* @__PURE__ */ D(ne, {
|
|
2519
2539
|
cancelText: "關閉",
|
|
2520
2540
|
confirmText: "執行試跑",
|
|
2521
|
-
loading:
|
|
2541
|
+
loading: Zt,
|
|
2522
2542
|
modalType: "standard",
|
|
2523
|
-
onCancel:
|
|
2524
|
-
onClose:
|
|
2525
|
-
onConfirm: () => void
|
|
2526
|
-
open:
|
|
2543
|
+
onCancel: Xn,
|
|
2544
|
+
onClose: Xn,
|
|
2545
|
+
onConfirm: () => void Zn(),
|
|
2546
|
+
open: Kt,
|
|
2527
2547
|
showModalFooter: !0,
|
|
2528
2548
|
showModalHeader: !0,
|
|
2529
2549
|
size: "wide",
|
|
2530
|
-
supportingText: `使用 ${
|
|
2550
|
+
supportingText: `使用 ${xi} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
|
|
2531
2551
|
title: "試跑流程",
|
|
2532
2552
|
children: /* @__PURE__ */ O("div", {
|
|
2533
2553
|
style: jr,
|
|
@@ -2537,31 +2557,31 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2537
2557
|
name: "dryRunFormDataJson",
|
|
2538
2558
|
required: !0,
|
|
2539
2559
|
children: /* @__PURE__ */ D(se, {
|
|
2540
|
-
onChange: (e) =>
|
|
2560
|
+
onChange: (e) => en(e.target.value),
|
|
2541
2561
|
resize: "vertical",
|
|
2542
2562
|
rows: 8,
|
|
2543
|
-
value:
|
|
2563
|
+
value: $t
|
|
2544
2564
|
})
|
|
2545
2565
|
}),
|
|
2546
|
-
|
|
2566
|
+
nn ? /* @__PURE__ */ D(T, {
|
|
2547
2567
|
color: "text-error",
|
|
2548
2568
|
variant: "body",
|
|
2549
|
-
children:
|
|
2569
|
+
children: nn
|
|
2550
2570
|
}) : null,
|
|
2551
|
-
|
|
2571
|
+
U ? /* @__PURE__ */ O("div", {
|
|
2552
2572
|
style: Mr,
|
|
2553
2573
|
children: [
|
|
2554
2574
|
/* @__PURE__ */ D(T, {
|
|
2555
|
-
color:
|
|
2575
|
+
color: U.valid ? "text-success" : "text-error",
|
|
2556
2576
|
variant: "label-primary-highlight",
|
|
2557
|
-
children:
|
|
2577
|
+
children: U.valid ? "試跑通過" : "試跑失敗"
|
|
2558
2578
|
}),
|
|
2559
|
-
|
|
2579
|
+
U.errors.map((e) => /* @__PURE__ */ D(T, {
|
|
2560
2580
|
color: "text-error",
|
|
2561
2581
|
variant: "body",
|
|
2562
2582
|
children: e
|
|
2563
2583
|
}, e)),
|
|
2564
|
-
|
|
2584
|
+
U.steps.map((t) => /* @__PURE__ */ O("div", {
|
|
2565
2585
|
style: Nr,
|
|
2566
2586
|
children: [
|
|
2567
2587
|
/* @__PURE__ */ O(T, {
|
|
@@ -2569,15 +2589,15 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2569
2589
|
children: [
|
|
2570
2590
|
t.nodeLabel,
|
|
2571
2591
|
" · ",
|
|
2572
|
-
|
|
2592
|
+
Ra(t.status)
|
|
2573
2593
|
]
|
|
2574
2594
|
}),
|
|
2575
2595
|
/* @__PURE__ */ O(T, {
|
|
2576
2596
|
color: "text-neutral",
|
|
2577
2597
|
variant: "caption",
|
|
2578
2598
|
children: [
|
|
2579
|
-
|
|
2580
|
-
t.assigneeMemberId ? ` · 處理者:${
|
|
2599
|
+
za(t.nodeType),
|
|
2600
|
+
t.assigneeMemberId ? ` · 處理者:${ir(t.assigneeMemberId, e)}` : "",
|
|
2581
2601
|
t.edgeLabel ? ` · 來源線段:${t.edgeLabel}` : ""
|
|
2582
2602
|
]
|
|
2583
2603
|
}),
|
|
@@ -2602,7 +2622,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2602
2622
|
variant: "body",
|
|
2603
2623
|
children: t.message
|
|
2604
2624
|
}),
|
|
2605
|
-
(t.status === "SKIPPED" ? [] :
|
|
2625
|
+
(t.status === "SKIPPED" ? [] : co(M, t.nodeId, an)).map((e) => /* @__PURE__ */ O(T, {
|
|
2606
2626
|
color: "text-neutral",
|
|
2607
2627
|
variant: "caption",
|
|
2608
2628
|
children: ["將送出 Webhook:", e.label]
|
|
@@ -2615,7 +2635,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2615
2635
|
})
|
|
2616
2636
|
});
|
|
2617
2637
|
}
|
|
2618
|
-
function
|
|
2638
|
+
function Vr(e) {
|
|
2619
2639
|
return /* @__PURE__ */ O("div", {
|
|
2620
2640
|
style: jr,
|
|
2621
2641
|
children: [
|
|
@@ -2638,29 +2658,29 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2638
2658
|
name: "nodeLabel",
|
|
2639
2659
|
required: !0,
|
|
2640
2660
|
children: /* @__PURE__ */ D(te, {
|
|
2641
|
-
onChange: (e) =>
|
|
2661
|
+
onChange: (e) => or(e.target.value),
|
|
2642
2662
|
value: e.data.label,
|
|
2643
2663
|
variant: "base"
|
|
2644
2664
|
})
|
|
2645
2665
|
}),
|
|
2646
|
-
e.type === "startEvent" ?
|
|
2647
|
-
e.type === "startEvent" ? null :
|
|
2648
|
-
e.type === "userTask" ?
|
|
2649
|
-
e.type === "serviceTask" ?
|
|
2666
|
+
e.type === "startEvent" ? Hr() : null,
|
|
2667
|
+
e.type === "startEvent" ? null : Ur(e),
|
|
2668
|
+
e.type === "userTask" ? Wr(e) : null,
|
|
2669
|
+
e.type === "serviceTask" ? Kr(e) : null
|
|
2650
2670
|
]
|
|
2651
2671
|
});
|
|
2652
2672
|
}
|
|
2653
|
-
function
|
|
2654
|
-
let e =
|
|
2655
|
-
includeDescendants: !!
|
|
2656
|
-
memberships:
|
|
2657
|
-
orgUnitId:
|
|
2658
|
-
orgUnits:
|
|
2659
|
-
positions:
|
|
2673
|
+
function Hr() {
|
|
2674
|
+
let e = q.mode === "CUSTOM" ? [...yi, bi] : [...yi], t = q.mode === "ORG_UNIT" || q.mode === "ORG_UNIT_POSITION" ? Wa(V, q.orgUnitId ?? "") : null, n = q.mode === "ORG_UNIT_POSITION" ? Ga(H, q.positionId ?? "") : null, i = q.mode === "ORG_UNIT_POSITION" ? $a({
|
|
2675
|
+
includeDescendants: !!q.includeDescendants,
|
|
2676
|
+
memberships: Wt,
|
|
2677
|
+
orgUnitId: q.orgUnitId ?? "",
|
|
2678
|
+
orgUnits: V,
|
|
2679
|
+
positions: H
|
|
2660
2680
|
}) : [];
|
|
2661
2681
|
return /* @__PURE__ */ O(E, { children: [
|
|
2662
2682
|
/* @__PURE__ */ D(r, {
|
|
2663
|
-
hintText:
|
|
2683
|
+
hintText: q.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
|
|
2664
2684
|
label: "發起權限",
|
|
2665
2685
|
name: "initiatorPolicyMode",
|
|
2666
2686
|
required: !0,
|
|
@@ -2671,62 +2691,62 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2671
2691
|
we(null), Ee(null);
|
|
2672
2692
|
return;
|
|
2673
2693
|
}
|
|
2674
|
-
let t =
|
|
2675
|
-
we(t === "ALL" ? null : t), Ee(t === "ALL" ? null : n), tt(
|
|
2694
|
+
let t = ba(e?.id ?? null), n = Da(t);
|
|
2695
|
+
we(t === "ALL" ? null : t), Ee(t === "ALL" ? null : n), tt(Ta(n, V));
|
|
2676
2696
|
},
|
|
2677
2697
|
options: e,
|
|
2678
2698
|
placeholder: "選擇誰可以發起",
|
|
2679
|
-
value: $(e,
|
|
2699
|
+
value: $(e, q.mode)
|
|
2680
2700
|
})
|
|
2681
2701
|
}),
|
|
2682
|
-
|
|
2702
|
+
q.mode === "ORG_UNIT" || q.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ D(r, {
|
|
2683
2703
|
label: "組織",
|
|
2684
2704
|
name: "initiatorOrgUnitId",
|
|
2685
2705
|
required: !0,
|
|
2686
2706
|
children: /* @__PURE__ */ D(o, {
|
|
2687
2707
|
name: "initiatorOrgUnitId",
|
|
2688
|
-
onChange: (e) =>
|
|
2689
|
-
...
|
|
2708
|
+
onChange: (e) => Cr({
|
|
2709
|
+
...q,
|
|
2690
2710
|
orgUnitId: e?.id ?? "",
|
|
2691
2711
|
positionId: "",
|
|
2692
2712
|
value: e?.id ?? ""
|
|
2693
2713
|
}),
|
|
2694
|
-
orgUnits:
|
|
2714
|
+
orgUnits: V,
|
|
2695
2715
|
placeholder: "選擇組織",
|
|
2696
2716
|
value: t
|
|
2697
2717
|
})
|
|
2698
2718
|
}) : null,
|
|
2699
|
-
|
|
2719
|
+
q.mode === "ORG_UNIT" || q.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ D(r, {
|
|
2700
2720
|
label: "包含下層",
|
|
2701
2721
|
name: "initiatorIncludeDescendants",
|
|
2702
2722
|
children: /* @__PURE__ */ D(w, {
|
|
2703
|
-
checked: !!
|
|
2704
|
-
onChange: (e) =>
|
|
2705
|
-
...
|
|
2723
|
+
checked: !!q.includeDescendants,
|
|
2724
|
+
onChange: (e) => Cr({
|
|
2725
|
+
...q,
|
|
2706
2726
|
includeDescendants: e.target.checked,
|
|
2707
|
-
...
|
|
2727
|
+
...q.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
|
|
2708
2728
|
})
|
|
2709
2729
|
})
|
|
2710
2730
|
}) : null,
|
|
2711
|
-
|
|
2731
|
+
q.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ D(r, {
|
|
2712
2732
|
label: "職位",
|
|
2713
2733
|
name: "initiatorPositionId",
|
|
2714
2734
|
required: !0,
|
|
2715
2735
|
children: /* @__PURE__ */ D(c, {
|
|
2716
|
-
disabled: !
|
|
2736
|
+
disabled: !q.orgUnitId?.trim(),
|
|
2717
2737
|
name: "initiatorPositionId",
|
|
2718
|
-
onChange: (e) =>
|
|
2719
|
-
...
|
|
2738
|
+
onChange: (e) => Cr({
|
|
2739
|
+
...q,
|
|
2720
2740
|
positionId: e?.id ?? ""
|
|
2721
2741
|
}),
|
|
2722
|
-
placeholder:
|
|
2742
|
+
placeholder: q.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
|
|
2723
2743
|
positions: i,
|
|
2724
2744
|
value: n
|
|
2725
2745
|
})
|
|
2726
2746
|
}) : null
|
|
2727
2747
|
] });
|
|
2728
2748
|
}
|
|
2729
|
-
function
|
|
2749
|
+
function Ur(e) {
|
|
2730
2750
|
let t = M.edges.filter((t) => t.target === e.id).length, n = t < 2, i = n ? "AND" : e.data.triggerMode ?? "AND";
|
|
2731
2751
|
return /* @__PURE__ */ D(r, {
|
|
2732
2752
|
hintText: n ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
|
|
@@ -2735,21 +2755,21 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2735
2755
|
required: !0,
|
|
2736
2756
|
children: /* @__PURE__ */ D(S, {
|
|
2737
2757
|
clearable: !1,
|
|
2738
|
-
onChange: (e) => n ? void 0 :
|
|
2758
|
+
onChange: (e) => n ? void 0 : Tr(Zi(e?.id ?? null)),
|
|
2739
2759
|
options: [...si],
|
|
2740
2760
|
readOnly: n,
|
|
2741
2761
|
value: $(si, i)
|
|
2742
2762
|
})
|
|
2743
2763
|
});
|
|
2744
2764
|
}
|
|
2745
|
-
function
|
|
2746
|
-
let t = e.data.approverResolver, n =
|
|
2765
|
+
function Wr(e) {
|
|
2766
|
+
let t = e.data.approverResolver, n = pa(t.type), i = t.type === "DIRECT" ? t.memberIds.map((e) => Ua(B, e)) : [], a = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Wa(V, t.orgUnitId) : null, s = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Ga(H, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? $a({
|
|
2747
2767
|
includeDescendants: !!t.includeDescendants,
|
|
2748
|
-
memberships:
|
|
2768
|
+
memberships: Wt,
|
|
2749
2769
|
orgUnitId: t.orgUnitId,
|
|
2750
|
-
orgUnits:
|
|
2751
|
-
positions:
|
|
2752
|
-
}) : [], u = t.type === "DYNAMIC_FORM" ?
|
|
2770
|
+
orgUnits: V,
|
|
2771
|
+
positions: H
|
|
2772
|
+
}) : [], u = t.type === "DYNAMIC_FORM" ? pr(X, t.formPath) : null, d = t.type === "ORG_MANAGER" ? va(t.levelsUp) : pi[0], f = t.type === "ORG_MANAGER" || t.type === "ORG_MANAGER_CHAIN" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, p = Et(f), m = p === null ? mi : [...mi, hi], h = t.type === "ORG_MANAGER_CHAIN" ? Dn(H, t.minPositionLevel) : [], g = f.type === "DIRECT" && f.memberId ? Ua(B, f.memberId) : null, _ = f.type === "POSITION" ? Ga(H, f.positionId) : null, y = e.data.returnBehavior.resubmitStrategy ?? "RESTART", b = e.data.sla ?? null, ee = e.data.excludeInitiator ?? null, x = b ? wt(b.duration) : null, ne = x?.unit ?? "DAY", re = sa(b?.warningAt ?? null), ie = va(b?.escalateLevelsUp ?? 1), ae = ea(e.data.decisionPolicy), C = na(e.data.decisionPolicy);
|
|
2753
2773
|
return /* @__PURE__ */ O(E, { children: [
|
|
2754
2774
|
/* @__PURE__ */ D(r, {
|
|
2755
2775
|
label: "簽核來源",
|
|
@@ -2757,13 +2777,13 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2757
2777
|
required: !0,
|
|
2758
2778
|
children: /* @__PURE__ */ D(S, {
|
|
2759
2779
|
clearable: !1,
|
|
2760
|
-
onChange: (e) =>
|
|
2761
|
-
options: [...
|
|
2762
|
-
value: $(
|
|
2780
|
+
onChange: (e) => Q(ma(e?.id ?? null, H)),
|
|
2781
|
+
options: [...di],
|
|
2782
|
+
value: $(di, n)
|
|
2763
2783
|
})
|
|
2764
2784
|
}),
|
|
2765
2785
|
t.type === "DIRECT" ? /* @__PURE__ */ D(r, {
|
|
2766
|
-
hintText:
|
|
2786
|
+
hintText: Ot(e.data.decisionPolicy),
|
|
2767
2787
|
label: "簽核者",
|
|
2768
2788
|
name: "memberId",
|
|
2769
2789
|
required: !0,
|
|
@@ -2777,18 +2797,18 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2777
2797
|
name: "workflow-approver-search",
|
|
2778
2798
|
spellCheck: !1
|
|
2779
2799
|
},
|
|
2780
|
-
loading:
|
|
2800
|
+
loading: Ft,
|
|
2781
2801
|
loadingText: "搜尋成員中...",
|
|
2782
2802
|
mode: "multiple",
|
|
2783
|
-
onChange: (e) =>
|
|
2803
|
+
onChange: (e) => Q({
|
|
2784
2804
|
memberIds: e.map((e) => e.id),
|
|
2785
2805
|
type: "DIRECT"
|
|
2786
2806
|
}),
|
|
2787
|
-
onSearch:
|
|
2807
|
+
onSearch: Un,
|
|
2788
2808
|
onVisibilityChange: (e) => {
|
|
2789
|
-
e && (
|
|
2809
|
+
e && (zt([]), Un(""));
|
|
2790
2810
|
},
|
|
2791
|
-
options: [
|
|
2811
|
+
options: [...to(i, Rt)],
|
|
2792
2812
|
placeholder: "搜尋姓名或信箱",
|
|
2793
2813
|
searchDebounceTime: 300,
|
|
2794
2814
|
value: i
|
|
@@ -2801,7 +2821,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2801
2821
|
required: !0,
|
|
2802
2822
|
children: /* @__PURE__ */ D(S, {
|
|
2803
2823
|
clearable: !1,
|
|
2804
|
-
onChange: (e) =>
|
|
2824
|
+
onChange: (e) => Q({
|
|
2805
2825
|
formPath: e?.id ?? "",
|
|
2806
2826
|
type: "DYNAMIC_FORM"
|
|
2807
2827
|
}),
|
|
@@ -2817,13 +2837,13 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2817
2837
|
required: !0,
|
|
2818
2838
|
children: /* @__PURE__ */ D(S, {
|
|
2819
2839
|
clearable: !1,
|
|
2820
|
-
onChange: (e) =>
|
|
2840
|
+
onChange: (e) => Q({
|
|
2821
2841
|
baseFromInitiator: !0,
|
|
2822
2842
|
...t.fallback ? { fallback: t.fallback } : {},
|
|
2823
|
-
levelsUp:
|
|
2843
|
+
levelsUp: ya(e?.id ?? null).value,
|
|
2824
2844
|
type: "ORG_MANAGER"
|
|
2825
2845
|
}),
|
|
2826
|
-
options: [...
|
|
2846
|
+
options: [...pi],
|
|
2827
2847
|
value: d
|
|
2828
2848
|
})
|
|
2829
2849
|
}) : null,
|
|
@@ -2834,7 +2854,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2834
2854
|
required: !0,
|
|
2835
2855
|
children: /* @__PURE__ */ D(S, {
|
|
2836
2856
|
clearable: !1,
|
|
2837
|
-
onChange: (e) =>
|
|
2857
|
+
onChange: (e) => Q({
|
|
2838
2858
|
...t,
|
|
2839
2859
|
minPositionLevel: Number(e?.id ?? t.minPositionLevel)
|
|
2840
2860
|
}),
|
|
@@ -2849,7 +2869,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2849
2869
|
required: !0,
|
|
2850
2870
|
children: /* @__PURE__ */ D(o, {
|
|
2851
2871
|
name: "orgUnitId",
|
|
2852
|
-
onChange: (e) =>
|
|
2872
|
+
onChange: (e) => Q(t.type === "ORG_UNIT_MEMBER" ? {
|
|
2853
2873
|
includeDescendants: t.includeDescendants,
|
|
2854
2874
|
orgUnitId: e?.id ?? "",
|
|
2855
2875
|
type: "ORG_UNIT_MEMBER"
|
|
@@ -2863,7 +2883,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2863
2883
|
orgUnitId: e?.id ?? "",
|
|
2864
2884
|
type: "ORG_UNIT_MANAGER"
|
|
2865
2885
|
}),
|
|
2866
|
-
orgUnits:
|
|
2886
|
+
orgUnits: V,
|
|
2867
2887
|
placeholder: "選擇組織",
|
|
2868
2888
|
value: a
|
|
2869
2889
|
})
|
|
@@ -2879,7 +2899,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2879
2899
|
id: "preferClosestOrgUnit",
|
|
2880
2900
|
name: "preferClosestOrgUnit"
|
|
2881
2901
|
},
|
|
2882
|
-
onChange: (e) =>
|
|
2902
|
+
onChange: (e) => Q({
|
|
2883
2903
|
...t,
|
|
2884
2904
|
preferClosestOrgUnit: e.target.checked
|
|
2885
2905
|
})
|
|
@@ -2893,10 +2913,10 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2893
2913
|
children: /* @__PURE__ */ D(S, {
|
|
2894
2914
|
clearable: !1,
|
|
2895
2915
|
onChange: (e) => {
|
|
2896
|
-
e?.id !== "UNSUPPORTED" &&
|
|
2916
|
+
e?.id !== "UNSUPPORTED" && Q(_a(t, ga(e?.id ?? null)));
|
|
2897
2917
|
},
|
|
2898
2918
|
options: [...m],
|
|
2899
|
-
value: p === null ? $(
|
|
2919
|
+
value: p === null ? $(mi, f.type) : hi
|
|
2900
2920
|
})
|
|
2901
2921
|
}),
|
|
2902
2922
|
f.type === "DIRECT" ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(r, {
|
|
@@ -2913,19 +2933,19 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2913
2933
|
name: "workflow-approver-fallback-search",
|
|
2914
2934
|
spellCheck: !1
|
|
2915
2935
|
},
|
|
2916
|
-
loading:
|
|
2936
|
+
loading: Ft,
|
|
2917
2937
|
loadingText: "搜尋成員中...",
|
|
2918
2938
|
mode: "single",
|
|
2919
|
-
onChange: (e) =>
|
|
2939
|
+
onChange: (e) => Q(_a(t, {
|
|
2920
2940
|
allowInitiatorSelfApproval: f.allowInitiatorSelfApproval,
|
|
2921
2941
|
memberId: e?.id ?? "",
|
|
2922
2942
|
type: "DIRECT"
|
|
2923
2943
|
})),
|
|
2924
|
-
onSearch:
|
|
2944
|
+
onSearch: Un,
|
|
2925
2945
|
onVisibilityChange: (e) => {
|
|
2926
|
-
e && (
|
|
2946
|
+
e && (zt([]), Un(""));
|
|
2927
2947
|
},
|
|
2928
|
-
options: [
|
|
2948
|
+
options: [...to(Rt, g ? [g] : [])],
|
|
2929
2949
|
placeholder: "搜尋姓名或信箱",
|
|
2930
2950
|
searchDebounceTime: 300,
|
|
2931
2951
|
value: g
|
|
@@ -2940,7 +2960,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2940
2960
|
id: "allowInitiatorSelfApproval",
|
|
2941
2961
|
name: "allowInitiatorSelfApproval"
|
|
2942
2962
|
},
|
|
2943
|
-
onChange: (e) =>
|
|
2963
|
+
onChange: (e) => Q(_a(t, {
|
|
2944
2964
|
allowInitiatorSelfApproval: e.target.checked,
|
|
2945
2965
|
memberId: f.memberId,
|
|
2946
2966
|
type: "DIRECT"
|
|
@@ -2954,13 +2974,13 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2954
2974
|
required: !0,
|
|
2955
2975
|
children: /* @__PURE__ */ D(c, {
|
|
2956
2976
|
name: "approverFallbackPositionId",
|
|
2957
|
-
onChange: (e) =>
|
|
2977
|
+
onChange: (e) => Q(_a(t, {
|
|
2958
2978
|
allowInitiatorSelfApproval: f.allowInitiatorSelfApproval,
|
|
2959
2979
|
positionId: e?.id ?? "",
|
|
2960
2980
|
type: "POSITION"
|
|
2961
2981
|
})),
|
|
2962
2982
|
placeholder: "選擇職位",
|
|
2963
|
-
positions:
|
|
2983
|
+
positions: H,
|
|
2964
2984
|
value: _
|
|
2965
2985
|
})
|
|
2966
2986
|
}), /* @__PURE__ */ D(r, {
|
|
@@ -2973,7 +2993,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2973
2993
|
id: "allowInitiatorSelfApproval",
|
|
2974
2994
|
name: "allowInitiatorSelfApproval"
|
|
2975
2995
|
},
|
|
2976
|
-
onChange: (e) =>
|
|
2996
|
+
onChange: (e) => Q(_a(t, {
|
|
2977
2997
|
allowInitiatorSelfApproval: e.target.checked,
|
|
2978
2998
|
positionId: f.positionId,
|
|
2979
2999
|
type: "POSITION"
|
|
@@ -2990,7 +3010,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
2990
3010
|
id: "includeDescendants",
|
|
2991
3011
|
name: "includeDescendants"
|
|
2992
3012
|
},
|
|
2993
|
-
onChange: (e) =>
|
|
3013
|
+
onChange: (e) => Q({
|
|
2994
3014
|
...t,
|
|
2995
3015
|
includeDescendants: e.target.checked,
|
|
2996
3016
|
...t.type === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
|
|
@@ -3004,12 +3024,12 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3004
3024
|
required: !0,
|
|
3005
3025
|
children: /* @__PURE__ */ D(c, {
|
|
3006
3026
|
name: "positionId",
|
|
3007
|
-
onChange: (e) =>
|
|
3027
|
+
onChange: (e) => Q({
|
|
3008
3028
|
positionId: e?.id ?? "",
|
|
3009
3029
|
type: "POSITION"
|
|
3010
3030
|
}),
|
|
3011
3031
|
placeholder: "選擇職位",
|
|
3012
|
-
positions:
|
|
3032
|
+
positions: H,
|
|
3013
3033
|
value: s
|
|
3014
3034
|
})
|
|
3015
3035
|
}) : null,
|
|
@@ -3021,7 +3041,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3021
3041
|
children: /* @__PURE__ */ D(c, {
|
|
3022
3042
|
disabled: !t.orgUnitId.trim(),
|
|
3023
3043
|
name: "orgUnitPositionId",
|
|
3024
|
-
onChange: (e) =>
|
|
3044
|
+
onChange: (e) => Q({
|
|
3025
3045
|
includeDescendants: t.includeDescendants,
|
|
3026
3046
|
orgUnitId: t.orgUnitId,
|
|
3027
3047
|
positionId: e?.id ?? "",
|
|
@@ -3039,9 +3059,9 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3039
3059
|
required: !0,
|
|
3040
3060
|
children: /* @__PURE__ */ D(S, {
|
|
3041
3061
|
clearable: !1,
|
|
3042
|
-
onChange: (t) => fr(
|
|
3043
|
-
options: [...
|
|
3044
|
-
value:
|
|
3062
|
+
onChange: (t) => fr(ta(t?.id ?? null, e.data.decisionPolicy)),
|
|
3063
|
+
options: [...Dt.filter((e) => t.type !== "ORG_MANAGER_CHAIN" || e.id === "SEQUENTIAL" || e.id === "PARALLEL_ALL")],
|
|
3064
|
+
value: kt(ae)
|
|
3045
3065
|
})
|
|
3046
3066
|
}),
|
|
3047
3067
|
ae === "QUORUM" ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(r, {
|
|
@@ -3052,11 +3072,11 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3052
3072
|
clearable: !1,
|
|
3053
3073
|
onChange: (e) => fr({
|
|
3054
3074
|
threshold: C.threshold,
|
|
3055
|
-
thresholdType:
|
|
3075
|
+
thresholdType: ra(e?.id ?? null),
|
|
3056
3076
|
type: "QUORUM"
|
|
3057
3077
|
}),
|
|
3058
|
-
options: [...
|
|
3059
|
-
value: $(
|
|
3078
|
+
options: [...fi],
|
|
3079
|
+
value: $(fi, C.thresholdType)
|
|
3060
3080
|
})
|
|
3061
3081
|
}), /* @__PURE__ */ D(r, {
|
|
3062
3082
|
hintText: C.thresholdType === "PERCENTAGE" ? "達到簽核者總數的這個百分比即通過,換算人數時無條件進位;超過 100 的輸入會自動夾至 100。" : "達到這個同意人數即通過;門檻超過實際簽核者人數時,這一關將永遠無法通過,請勿設定超過實際簽核者人數。",
|
|
@@ -3072,7 +3092,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3072
3092
|
inputType: "number",
|
|
3073
3093
|
name: "quorumThreshold",
|
|
3074
3094
|
onChange: (e) => fr({
|
|
3075
|
-
threshold:
|
|
3095
|
+
threshold: ct(Number(e.target.value), C.thresholdType),
|
|
3076
3096
|
thresholdType: C.thresholdType,
|
|
3077
3097
|
type: "QUORUM"
|
|
3078
3098
|
}),
|
|
@@ -3080,6 +3100,18 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3080
3100
|
variant: "base"
|
|
3081
3101
|
})
|
|
3082
3102
|
})] }) : null,
|
|
3103
|
+
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ D(r, {
|
|
3104
|
+
hintText: "簽核者按下退回時,單子要回到哪裡。選「由簽核者選擇」時,可以退回申請人,或這一關之前任一個簽核節點。",
|
|
3105
|
+
label: "可退回到",
|
|
3106
|
+
name: "returnAllowedTargets",
|
|
3107
|
+
required: !0,
|
|
3108
|
+
children: /* @__PURE__ */ D(S, {
|
|
3109
|
+
clearable: !1,
|
|
3110
|
+
onChange: (e) => sr(Qi(e?.id ?? null)),
|
|
3111
|
+
options: [...ci],
|
|
3112
|
+
value: $(ci, e.data.returnBehavior.allowedTargets)
|
|
3113
|
+
})
|
|
3114
|
+
}) : null,
|
|
3083
3115
|
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ D(r, {
|
|
3084
3116
|
hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
|
|
3085
3117
|
label: "重送策略",
|
|
@@ -3087,9 +3119,9 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3087
3119
|
required: !0,
|
|
3088
3120
|
children: /* @__PURE__ */ D(S, {
|
|
3089
3121
|
clearable: !1,
|
|
3090
|
-
onChange: (e) => cr(
|
|
3091
|
-
options: [...
|
|
3092
|
-
value: $(
|
|
3122
|
+
onChange: (e) => cr($i(e?.id ?? null)),
|
|
3123
|
+
options: [...li],
|
|
3124
|
+
value: $(li, y)
|
|
3093
3125
|
})
|
|
3094
3126
|
}) : null,
|
|
3095
3127
|
e.data.returnBehavior.allowReturn ? /* @__PURE__ */ D(r, {
|
|
@@ -3115,7 +3147,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3115
3147
|
id: "slaEnabled",
|
|
3116
3148
|
name: "slaEnabled"
|
|
3117
3149
|
},
|
|
3118
|
-
onChange: (e) => ur(e.target.checked ?
|
|
3150
|
+
onChange: (e) => ur(e.target.checked ? nt : null)
|
|
3119
3151
|
})
|
|
3120
3152
|
}),
|
|
3121
3153
|
b && !x ? /* @__PURE__ */ D(r, {
|
|
@@ -3137,7 +3169,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3137
3169
|
inputProps: { min: 1 },
|
|
3138
3170
|
inputType: "number",
|
|
3139
3171
|
name: "slaDurationValue",
|
|
3140
|
-
onChange: (e) => ur(
|
|
3172
|
+
onChange: (e) => ur(la(b, {
|
|
3141
3173
|
unit: ne,
|
|
3142
3174
|
value: Number(e.target.value)
|
|
3143
3175
|
})),
|
|
@@ -3150,12 +3182,12 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3150
3182
|
required: !0,
|
|
3151
3183
|
children: /* @__PURE__ */ D(S, {
|
|
3152
3184
|
clearable: !1,
|
|
3153
|
-
onChange: (e) => ur(
|
|
3154
|
-
unit:
|
|
3185
|
+
onChange: (e) => ur(la(b, {
|
|
3186
|
+
unit: ia(e?.id ?? null),
|
|
3155
3187
|
value: x.value
|
|
3156
3188
|
})),
|
|
3157
|
-
options: [...
|
|
3158
|
-
value: $(
|
|
3189
|
+
options: [...ot],
|
|
3190
|
+
value: $(ot, ne)
|
|
3159
3191
|
})
|
|
3160
3192
|
})] }) : null,
|
|
3161
3193
|
b && ne === "DAY" ? /* @__PURE__ */ D(r, {
|
|
@@ -3167,10 +3199,10 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3167
3199
|
clearable: !1,
|
|
3168
3200
|
onChange: (e) => ur({
|
|
3169
3201
|
...b,
|
|
3170
|
-
calendar:
|
|
3202
|
+
calendar: aa(e?.id ?? null)
|
|
3171
3203
|
}),
|
|
3172
|
-
options: [...
|
|
3173
|
-
value: $(
|
|
3204
|
+
options: [...at],
|
|
3205
|
+
value: $(at, b.calendar ?? "CALENDAR")
|
|
3174
3206
|
})
|
|
3175
3207
|
}) : null,
|
|
3176
3208
|
b ? /* @__PURE__ */ D(r, {
|
|
@@ -3179,9 +3211,9 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3179
3211
|
required: !0,
|
|
3180
3212
|
children: /* @__PURE__ */ D(S, {
|
|
3181
3213
|
clearable: !1,
|
|
3182
|
-
onChange: (e) => ur(
|
|
3183
|
-
options: [...
|
|
3184
|
-
value: $(
|
|
3214
|
+
onChange: (e) => ur(ua(b, oa(e?.id ?? null))),
|
|
3215
|
+
options: [...st],
|
|
3216
|
+
value: $(st, b.onTimeout)
|
|
3185
3217
|
})
|
|
3186
3218
|
}) : null,
|
|
3187
3219
|
b?.onTimeout === "ESCALATE" ? /* @__PURE__ */ D(r, {
|
|
@@ -3193,9 +3225,9 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3193
3225
|
clearable: !1,
|
|
3194
3226
|
onChange: (e) => ur({
|
|
3195
3227
|
...b,
|
|
3196
|
-
escalateLevelsUp:
|
|
3228
|
+
escalateLevelsUp: ya(e?.id ?? null).value
|
|
3197
3229
|
}),
|
|
3198
|
-
options: [...
|
|
3230
|
+
options: [...pi],
|
|
3199
3231
|
value: ie
|
|
3200
3232
|
})
|
|
3201
3233
|
}) : null,
|
|
@@ -3205,8 +3237,8 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3205
3237
|
name: "slaWarningAt",
|
|
3206
3238
|
children: /* @__PURE__ */ D(S, {
|
|
3207
3239
|
clearable: !1,
|
|
3208
|
-
onChange: (e) => ur(
|
|
3209
|
-
options: [...
|
|
3240
|
+
onChange: (e) => ur(da(b, ca(e?.id ?? null).value)),
|
|
3241
|
+
options: [...ui],
|
|
3210
3242
|
value: re
|
|
3211
3243
|
})
|
|
3212
3244
|
}) : null,
|
|
@@ -3220,7 +3252,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3220
3252
|
id: "allowReject",
|
|
3221
3253
|
name: "allowReject"
|
|
3222
3254
|
},
|
|
3223
|
-
onChange: (e) =>
|
|
3255
|
+
onChange: (e) => mr({ allowReject: e.target.checked })
|
|
3224
3256
|
})
|
|
3225
3257
|
}),
|
|
3226
3258
|
/* @__PURE__ */ D(r, {
|
|
@@ -3233,7 +3265,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3233
3265
|
id: "allowTransfer",
|
|
3234
3266
|
name: "allowTransfer"
|
|
3235
3267
|
},
|
|
3236
|
-
onChange: (e) =>
|
|
3268
|
+
onChange: (e) => mr({ allowTransfer: e.target.checked })
|
|
3237
3269
|
})
|
|
3238
3270
|
}),
|
|
3239
3271
|
/* @__PURE__ */ D(r, {
|
|
@@ -3246,7 +3278,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3246
3278
|
id: "allowAddSigner",
|
|
3247
3279
|
name: "allowAddSigner"
|
|
3248
3280
|
},
|
|
3249
|
-
onChange: (e) =>
|
|
3281
|
+
onChange: (e) => mr({ allowAddSigner: e.target.checked })
|
|
3250
3282
|
})
|
|
3251
3283
|
}),
|
|
3252
3284
|
/* @__PURE__ */ D(r, {
|
|
@@ -3259,7 +3291,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3259
3291
|
id: "excludeInitiator",
|
|
3260
3292
|
name: "excludeInitiator"
|
|
3261
3293
|
},
|
|
3262
|
-
onChange: (e) => dr(e.target.checked ?
|
|
3294
|
+
onChange: (e) => dr(e.target.checked ? _i : null)
|
|
3263
3295
|
})
|
|
3264
3296
|
}),
|
|
3265
3297
|
ee ? /* @__PURE__ */ D(r, {
|
|
@@ -3268,34 +3300,34 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3268
3300
|
required: !0,
|
|
3269
3301
|
children: /* @__PURE__ */ D(S, {
|
|
3270
3302
|
clearable: !1,
|
|
3271
|
-
onChange: (e) => dr({ whenEmpty: $(
|
|
3272
|
-
options: [...
|
|
3273
|
-
value: $(
|
|
3303
|
+
onChange: (e) => dr({ whenEmpty: $(gi, e?.id ?? null)?.id ?? _i.whenEmpty }),
|
|
3304
|
+
options: [...gi],
|
|
3305
|
+
value: $(gi, ee.whenEmpty)
|
|
3274
3306
|
})
|
|
3275
3307
|
}) : null,
|
|
3276
|
-
/* @__PURE__ */ D(
|
|
3308
|
+
/* @__PURE__ */ D(Tn, {
|
|
3277
3309
|
definition: M,
|
|
3278
3310
|
language: k,
|
|
3279
3311
|
node: e,
|
|
3280
|
-
onOpenMatrix: () =>
|
|
3312
|
+
onOpenMatrix: () => Xt(!0),
|
|
3281
3313
|
onRemoveLegacy: () => {
|
|
3282
3314
|
j.dispatch({
|
|
3283
3315
|
nodeId: e.id,
|
|
3284
3316
|
type: "removeLegacyFieldPermissions"
|
|
3285
3317
|
});
|
|
3286
3318
|
},
|
|
3287
|
-
openDisabledReason:
|
|
3319
|
+
openDisabledReason: X === null ? Gr : null
|
|
3288
3320
|
})
|
|
3289
3321
|
] });
|
|
3290
3322
|
}
|
|
3291
|
-
function
|
|
3292
|
-
let t = e.data.action, n =
|
|
3323
|
+
function Kr(e) {
|
|
3324
|
+
let t = e.data.action, n = So(t).map((e) => Ua(B, e)), i = t.type === "NOTIFY" && t.recipients.type !== "DIRECT" ? ao(t.recipients, B, V, H, X) : null;
|
|
3293
3325
|
function a(e) {
|
|
3294
3326
|
let n = {
|
|
3295
3327
|
memberIds: [...e],
|
|
3296
3328
|
type: "DIRECT"
|
|
3297
3329
|
};
|
|
3298
|
-
|
|
3330
|
+
gr(t.type === "NOTIFY" ? {
|
|
3299
3331
|
...t,
|
|
3300
3332
|
recipients: n
|
|
3301
3333
|
} : {
|
|
@@ -3305,7 +3337,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3305
3337
|
});
|
|
3306
3338
|
}
|
|
3307
3339
|
function o(e) {
|
|
3308
|
-
t.type === "NOTIFY" &&
|
|
3340
|
+
t.type === "NOTIFY" && gr({
|
|
3309
3341
|
...t,
|
|
3310
3342
|
webhooks: e
|
|
3311
3343
|
});
|
|
@@ -3319,22 +3351,22 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3319
3351
|
asyncData: !0,
|
|
3320
3352
|
disabledOptionsFilter: !0,
|
|
3321
3353
|
emptyText: "沒有符合的成員",
|
|
3322
|
-
loading:
|
|
3354
|
+
loading: Ft,
|
|
3323
3355
|
loadingText: "搜尋成員中...",
|
|
3324
3356
|
mode: "multiple",
|
|
3325
3357
|
onChange: (e) => a(e.map((e) => e.id)),
|
|
3326
|
-
onSearch:
|
|
3358
|
+
onSearch: Un,
|
|
3327
3359
|
onVisibilityChange: (e) => {
|
|
3328
|
-
e && (
|
|
3360
|
+
e && (zt([]), Un(""));
|
|
3329
3361
|
},
|
|
3330
|
-
options: [
|
|
3362
|
+
options: [...to(n, Rt)],
|
|
3331
3363
|
overflowStrategy: "wrap",
|
|
3332
3364
|
placeholder: "搜尋姓名或信箱",
|
|
3333
3365
|
searchDebounceTime: 300,
|
|
3334
3366
|
value: [...n]
|
|
3335
3367
|
})
|
|
3336
3368
|
}),
|
|
3337
|
-
t.type === "NOTIFY" && !
|
|
3369
|
+
t.type === "NOTIFY" && !In(t.webhooks) ? /* @__PURE__ */ O("div", {
|
|
3338
3370
|
style: jr,
|
|
3339
3371
|
children: [/* @__PURE__ */ D(T, {
|
|
3340
3372
|
color: "text-warning",
|
|
@@ -3346,16 +3378,16 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3346
3378
|
children: "清除 Webhook 設定"
|
|
3347
3379
|
}) })]
|
|
3348
3380
|
}) : null,
|
|
3349
|
-
t.type === "NOTIFY" &&
|
|
3350
|
-
catalog:
|
|
3351
|
-
catalogState:
|
|
3352
|
-
formFields:
|
|
3381
|
+
t.type === "NOTIFY" && In(t.webhooks) ? /* @__PURE__ */ D(Jn, {
|
|
3382
|
+
catalog: an,
|
|
3383
|
+
catalogState: sn,
|
|
3384
|
+
formFields: X?.fields ?? null,
|
|
3353
3385
|
onChange: o,
|
|
3354
|
-
targets:
|
|
3386
|
+
targets: Ct(t)
|
|
3355
3387
|
}) : null
|
|
3356
3388
|
] });
|
|
3357
3389
|
}
|
|
3358
|
-
function
|
|
3390
|
+
function qr(e) {
|
|
3359
3391
|
return /* @__PURE__ */ O("div", {
|
|
3360
3392
|
style: jr,
|
|
3361
3393
|
children: [/* @__PURE__ */ D(T, {
|
|
@@ -3373,8 +3405,8 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3373
3405
|
})]
|
|
3374
3406
|
});
|
|
3375
3407
|
}
|
|
3376
|
-
function
|
|
3377
|
-
let t =
|
|
3408
|
+
function Jr(e) {
|
|
3409
|
+
let t = bo(e, M.nodes);
|
|
3378
3410
|
return /* @__PURE__ */ O("div", {
|
|
3379
3411
|
style: jr,
|
|
3380
3412
|
children: [
|
|
@@ -3392,7 +3424,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3392
3424
|
e.target
|
|
3393
3425
|
]
|
|
3394
3426
|
}),
|
|
3395
|
-
t ?
|
|
3427
|
+
t ? Xr(e) : /* @__PURE__ */ D(T, {
|
|
3396
3428
|
color: "text-neutral",
|
|
3397
3429
|
variant: "body",
|
|
3398
3430
|
children: "這條線會直接把流程送到下一個節點。"
|
|
@@ -3400,26 +3432,26 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3400
3432
|
]
|
|
3401
3433
|
});
|
|
3402
3434
|
}
|
|
3403
|
-
function
|
|
3404
|
-
return !e || !
|
|
3435
|
+
function Yr(e) {
|
|
3436
|
+
return !e || !bo(e, M.nodes) ? null : /* @__PURE__ */ D(ne, {
|
|
3405
3437
|
cancelText: "取消",
|
|
3406
3438
|
confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
|
|
3407
3439
|
confirmText: "完成",
|
|
3408
3440
|
modalType: "standard",
|
|
3409
|
-
onCancel:
|
|
3410
|
-
onClose:
|
|
3411
|
-
onConfirm:
|
|
3441
|
+
onCancel: rr,
|
|
3442
|
+
onClose: rr,
|
|
3443
|
+
onConfirm: rr,
|
|
3412
3444
|
open: !!L,
|
|
3413
3445
|
showModalFooter: !0,
|
|
3414
3446
|
showModalHeader: !0,
|
|
3415
3447
|
size: "regular",
|
|
3416
3448
|
supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
|
|
3417
3449
|
title: "條件設定",
|
|
3418
|
-
children:
|
|
3450
|
+
children: Xr(e)
|
|
3419
3451
|
});
|
|
3420
3452
|
}
|
|
3421
|
-
function
|
|
3422
|
-
let t =
|
|
3453
|
+
function Xr(e) {
|
|
3454
|
+
let t = vo(e, M.nodes), n = mo(Y?.schema ?? null), i = ho(Y?.schema ?? null, e.data.conditionFieldKey ?? null), a = gt(i), o = go(i), s = $(a, e.data.conditionOperator ?? null), c = !e.data.isDefault && !e.data.condition;
|
|
3423
3455
|
return /* @__PURE__ */ O("div", {
|
|
3424
3456
|
style: jr,
|
|
3425
3457
|
children: [
|
|
@@ -3445,7 +3477,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3445
3477
|
variant: "body",
|
|
3446
3478
|
children: "其他條件都不符合時,流程會走這條線。"
|
|
3447
3479
|
}) : /* @__PURE__ */ O(E, { children: [
|
|
3448
|
-
|
|
3480
|
+
Y ? null : /* @__PURE__ */ D(T, {
|
|
3449
3481
|
color: "text-neutral",
|
|
3450
3482
|
variant: "body",
|
|
3451
3483
|
children: "請先綁定表單版本,才能選擇條件欄位。"
|
|
@@ -3456,7 +3488,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3456
3488
|
required: !0,
|
|
3457
3489
|
children: /* @__PURE__ */ D(S, {
|
|
3458
3490
|
clearable: !1,
|
|
3459
|
-
onChange: (t) =>
|
|
3491
|
+
onChange: (t) => Or({
|
|
3460
3492
|
edgeId: e.id,
|
|
3461
3493
|
fieldKey: t?.id ?? null,
|
|
3462
3494
|
operator: null,
|
|
@@ -3473,9 +3505,9 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3473
3505
|
required: !0,
|
|
3474
3506
|
children: /* @__PURE__ */ D(S, {
|
|
3475
3507
|
clearable: !1,
|
|
3476
|
-
onChange: (t) =>
|
|
3508
|
+
onChange: (t) => Or({
|
|
3477
3509
|
edgeId: e.id,
|
|
3478
|
-
operator:
|
|
3510
|
+
operator: ht(t?.id ?? null),
|
|
3479
3511
|
value: null
|
|
3480
3512
|
}),
|
|
3481
3513
|
options: [...a],
|
|
@@ -3483,13 +3515,13 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3483
3515
|
value: s
|
|
3484
3516
|
})
|
|
3485
3517
|
}),
|
|
3486
|
-
s &&
|
|
3518
|
+
s && _o(s.id) ? /* @__PURE__ */ D(r, {
|
|
3487
3519
|
label: "條件值",
|
|
3488
3520
|
name: "edgeConditionValue",
|
|
3489
3521
|
required: !0,
|
|
3490
3522
|
children: o.length > 0 ? /* @__PURE__ */ D(S, {
|
|
3491
3523
|
clearable: !1,
|
|
3492
|
-
onChange: (t) =>
|
|
3524
|
+
onChange: (t) => Or({
|
|
3493
3525
|
edgeId: e.id,
|
|
3494
3526
|
value: t?.id ?? null
|
|
3495
3527
|
}),
|
|
@@ -3497,7 +3529,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3497
3529
|
placeholder: "選擇條件值",
|
|
3498
3530
|
value: $(o, e.data.conditionValue ?? null)
|
|
3499
3531
|
}) : /* @__PURE__ */ D(te, {
|
|
3500
|
-
onChange: (t) =>
|
|
3532
|
+
onChange: (t) => Or({
|
|
3501
3533
|
edgeId: e.id,
|
|
3502
3534
|
value: t.target.value
|
|
3503
3535
|
}),
|
|
@@ -3511,7 +3543,7 @@ function Oi({ aiAssistantAvailable: i = !0, embedded: a = !1, formSchemaOverride
|
|
|
3511
3543
|
});
|
|
3512
3544
|
}
|
|
3513
3545
|
}
|
|
3514
|
-
function
|
|
3546
|
+
function Ai({ onApplyAutoLayout: e }) {
|
|
3515
3547
|
function t() {
|
|
3516
3548
|
e();
|
|
3517
3549
|
}
|
|
@@ -3527,12 +3559,12 @@ function ki({ onApplyAutoLayout: e }) {
|
|
|
3527
3559
|
})
|
|
3528
3560
|
});
|
|
3529
3561
|
}
|
|
3530
|
-
function
|
|
3531
|
-
let r = e.approverLines ?? [e.approverSummary ?? e.label], i =
|
|
3562
|
+
function ji({ data: e, selected: t, type: n }) {
|
|
3563
|
+
let r = e.approverLines ?? [e.approverSummary ?? e.label], i = Mi(e), a = Ni(n, t);
|
|
3532
3564
|
return /* @__PURE__ */ O("div", {
|
|
3533
3565
|
style: a,
|
|
3534
3566
|
children: [
|
|
3535
|
-
|
|
3567
|
+
Fi(e),
|
|
3536
3568
|
/* @__PURE__ */ D("div", {
|
|
3537
3569
|
style: ti,
|
|
3538
3570
|
children: r.map((e, t) => /* @__PURE__ */ D(T, {
|
|
@@ -3561,21 +3593,21 @@ function Ai({ data: e, selected: t, type: n }) {
|
|
|
3561
3593
|
]
|
|
3562
3594
|
});
|
|
3563
3595
|
}
|
|
3564
|
-
function
|
|
3596
|
+
function Mi(e) {
|
|
3565
3597
|
return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : ii[e.nodeKind];
|
|
3566
3598
|
}
|
|
3567
|
-
function
|
|
3568
|
-
let n =
|
|
3599
|
+
function Ni(e, t) {
|
|
3600
|
+
let n = Pi(e);
|
|
3569
3601
|
return t ? {
|
|
3570
3602
|
...n,
|
|
3571
3603
|
border: "1px solid var(--mzn-color-primary, #0057ff)",
|
|
3572
3604
|
boxShadow: Br
|
|
3573
3605
|
} : n;
|
|
3574
3606
|
}
|
|
3575
|
-
function
|
|
3607
|
+
function Pi(e) {
|
|
3576
3608
|
return e === "exclusiveGateway" ? Yr : e === "parallelGateway" ? Xr : e === "startEvent" ? Qr : e === "endEvent" ? $r : e === "userTask" ? Zr : zr;
|
|
3577
3609
|
}
|
|
3578
|
-
function
|
|
3610
|
+
function Fi(e) {
|
|
3579
3611
|
return !e.hasInput && e.hasOutput ? /* @__PURE__ */ D(F, {
|
|
3580
3612
|
id: ri,
|
|
3581
3613
|
position: L.Right,
|
|
@@ -3594,21 +3626,21 @@ function Pi(e) {
|
|
|
3594
3626
|
type: "source"
|
|
3595
3627
|
}, "source")];
|
|
3596
3628
|
}
|
|
3597
|
-
function
|
|
3598
|
-
let s =
|
|
3629
|
+
function Ii(e, t, n, r, i, a, o) {
|
|
3630
|
+
let s = Li(e);
|
|
3599
3631
|
return {
|
|
3600
3632
|
data: {
|
|
3601
|
-
approverLines:
|
|
3602
|
-
approverSummary:
|
|
3603
|
-
fieldAccessTag: e.type === "userTask" ?
|
|
3604
|
-
hasInput:
|
|
3605
|
-
hasOutput:
|
|
3606
|
-
initiatorPolicySummary: e.type === "startEvent" ?
|
|
3633
|
+
approverLines: oo(e, t, n, r, o),
|
|
3634
|
+
approverSummary: io(e, t, n, r, o),
|
|
3635
|
+
fieldAccessTag: e.type === "userTask" ? nn(e) : null,
|
|
3636
|
+
hasInput: ja(e),
|
|
3637
|
+
hasOutput: Ma(e),
|
|
3638
|
+
initiatorPolicySummary: e.type === "startEvent" ? Ea(a, n, r) : null,
|
|
3607
3639
|
label: e.data.label,
|
|
3608
3640
|
nodeKind: e.type
|
|
3609
3641
|
},
|
|
3610
3642
|
height: s.height,
|
|
3611
|
-
handles:
|
|
3643
|
+
handles: Ri(e),
|
|
3612
3644
|
id: e.id,
|
|
3613
3645
|
initialHeight: s.height,
|
|
3614
3646
|
initialWidth: s.width,
|
|
@@ -3620,23 +3652,23 @@ function Fi(e, t, n, r, i, a, o) {
|
|
|
3620
3652
|
width: s.width
|
|
3621
3653
|
};
|
|
3622
3654
|
}
|
|
3623
|
-
function
|
|
3655
|
+
function Li(e) {
|
|
3624
3656
|
return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
|
|
3625
3657
|
height: Kr,
|
|
3626
3658
|
width: qr
|
|
3627
3659
|
} : e.type === "serviceTask" ? {
|
|
3628
|
-
height: Vr + (
|
|
3660
|
+
height: Vr + (so(e.data.action) - 1) * Ur,
|
|
3629
3661
|
width: Hr
|
|
3630
3662
|
} : {
|
|
3631
|
-
height: Vr + (e.type === "userTask" &&
|
|
3663
|
+
height: Vr + (e.type === "userTask" && nn(e) !== null ? Wr : 0),
|
|
3632
3664
|
width: Hr
|
|
3633
3665
|
};
|
|
3634
3666
|
}
|
|
3635
|
-
function
|
|
3636
|
-
let t =
|
|
3637
|
-
return [...
|
|
3667
|
+
function Ri(e) {
|
|
3668
|
+
let t = Li(e);
|
|
3669
|
+
return [...ja(e) ? [zi(t)] : [], ...Ma(e) ? [Bi(t)] : []];
|
|
3638
3670
|
}
|
|
3639
|
-
function
|
|
3671
|
+
function zi({ height: e }) {
|
|
3640
3672
|
let t = e / 2 - 9 / 2;
|
|
3641
3673
|
return {
|
|
3642
3674
|
height: 9,
|
|
@@ -3648,7 +3680,7 @@ function Ri({ height: e }) {
|
|
|
3648
3680
|
y: t
|
|
3649
3681
|
};
|
|
3650
3682
|
}
|
|
3651
|
-
function
|
|
3683
|
+
function Bi({ height: e, width: t }) {
|
|
3652
3684
|
let n = e / 2 - 9 / 2;
|
|
3653
3685
|
return {
|
|
3654
3686
|
height: 9,
|
|
@@ -3660,8 +3692,8 @@ function zi({ height: e, width: t }) {
|
|
|
3660
3692
|
y: n
|
|
3661
3693
|
};
|
|
3662
3694
|
}
|
|
3663
|
-
function
|
|
3664
|
-
let r =
|
|
3695
|
+
function Vi(e, t, n) {
|
|
3696
|
+
let r = vo(e, t), i = bo(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Dr : i ? Tr : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Dr : i ? Tr : Er;
|
|
3665
3697
|
return {
|
|
3666
3698
|
className: n ? "workflow-edge--selected" : void 0,
|
|
3667
3699
|
data: e.data,
|
|
@@ -3686,7 +3718,7 @@ function Bi(e, t, n) {
|
|
|
3686
3718
|
style: {
|
|
3687
3719
|
filter: n ? Or : void 0,
|
|
3688
3720
|
opacity: 1,
|
|
3689
|
-
stroke:
|
|
3721
|
+
stroke: Er,
|
|
3690
3722
|
strokeOpacity: 1,
|
|
3691
3723
|
strokeWidth: 1.5
|
|
3692
3724
|
},
|
|
@@ -3695,7 +3727,7 @@ function Bi(e, t, n) {
|
|
|
3695
3727
|
type: e.type ?? "smoothstep"
|
|
3696
3728
|
};
|
|
3697
3729
|
}
|
|
3698
|
-
function
|
|
3730
|
+
function Hi(e, t) {
|
|
3699
3731
|
return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
|
|
3700
3732
|
...e,
|
|
3701
3733
|
data: {
|
|
@@ -3704,10 +3736,10 @@ function Vi(e, t) {
|
|
|
3704
3736
|
}
|
|
3705
3737
|
});
|
|
3706
3738
|
}
|
|
3707
|
-
function Hi(e) {
|
|
3708
|
-
return Ki(Wi(Gi(Ui(e))));
|
|
3709
|
-
}
|
|
3710
3739
|
function Ui(e) {
|
|
3740
|
+
return qi(Gi(Ki(Wi(e))));
|
|
3741
|
+
}
|
|
3742
|
+
function Wi(e) {
|
|
3711
3743
|
let t = e.edges.map((e) => {
|
|
3712
3744
|
let t = e.data ?? {};
|
|
3713
3745
|
return e.data === t ? e : {
|
|
@@ -3720,7 +3752,7 @@ function Ui(e) {
|
|
|
3720
3752
|
edges: t
|
|
3721
3753
|
} : e;
|
|
3722
3754
|
}
|
|
3723
|
-
function
|
|
3755
|
+
function Gi(e) {
|
|
3724
3756
|
let t = e.nodes.map((e) => {
|
|
3725
3757
|
if (e.type !== "userTask") return e;
|
|
3726
3758
|
let t = e.data.allowAddSigner ?? !1, n = e.data.allowReject ?? !0, r = e.data.allowTransfer ?? !0, i = !e.data.decisionPolicy;
|
|
@@ -3740,24 +3772,24 @@ function Wi(e) {
|
|
|
3740
3772
|
nodes: t
|
|
3741
3773
|
} : e;
|
|
3742
3774
|
}
|
|
3743
|
-
function
|
|
3744
|
-
let t = new Set(e.nodes.filter((e) =>
|
|
3775
|
+
function Ki(e) {
|
|
3776
|
+
let t = new Set(e.nodes.filter((e) => Na(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
|
|
3745
3777
|
return n.length === e.edges.length ? e : {
|
|
3746
3778
|
...e,
|
|
3747
3779
|
edges: n
|
|
3748
3780
|
};
|
|
3749
3781
|
}
|
|
3750
|
-
function
|
|
3782
|
+
function qi(e) {
|
|
3751
3783
|
let t = e.edges.reduce((e, t) => ({
|
|
3752
3784
|
...e,
|
|
3753
3785
|
[t.target]: (e[t.target] ?? 0) + 1
|
|
3754
|
-
}), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ?
|
|
3786
|
+
}), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? Hi(e, "AND") : e);
|
|
3755
3787
|
return n.some((t, n) => t !== e.nodes[n]) ? {
|
|
3756
3788
|
...e,
|
|
3757
3789
|
nodes: n
|
|
3758
3790
|
} : e;
|
|
3759
3791
|
}
|
|
3760
|
-
function
|
|
3792
|
+
function Ji() {
|
|
3761
3793
|
return {
|
|
3762
3794
|
edges: [],
|
|
3763
3795
|
meta: { schemaVersion: 1 },
|
|
@@ -3784,16 +3816,16 @@ function qi() {
|
|
|
3784
3816
|
}]
|
|
3785
3817
|
};
|
|
3786
3818
|
}
|
|
3787
|
-
function
|
|
3819
|
+
function Yi(e) {
|
|
3788
3820
|
return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
|
|
3789
3821
|
}
|
|
3790
|
-
function
|
|
3822
|
+
function Xi(e) {
|
|
3791
3823
|
let t = new Ue.graphlib.Graph();
|
|
3792
3824
|
return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
|
|
3793
3825
|
rankdir: "LR",
|
|
3794
3826
|
ranksep: 120
|
|
3795
3827
|
}), e.nodes.forEach((e) => {
|
|
3796
|
-
t.setNode(e.id,
|
|
3828
|
+
t.setNode(e.id, Li(e));
|
|
3797
3829
|
}), e.edges.forEach((e) => {
|
|
3798
3830
|
t.setEdge(e.source, e.target);
|
|
3799
3831
|
}), Ue.layout(t), {
|
|
@@ -3803,8 +3835,8 @@ function Yi(e) {
|
|
|
3803
3835
|
return n ? {
|
|
3804
3836
|
...e,
|
|
3805
3837
|
position: {
|
|
3806
|
-
x: n.x -
|
|
3807
|
-
y: n.y -
|
|
3838
|
+
x: n.x - Li(e).width / 2,
|
|
3839
|
+
y: n.y - Li(e).height / 2
|
|
3808
3840
|
}
|
|
3809
3841
|
} : e;
|
|
3810
3842
|
})
|
|
@@ -3813,51 +3845,54 @@ function Yi(e) {
|
|
|
3813
3845
|
function $(e, t) {
|
|
3814
3846
|
return t ? e.find((e) => e.id === t) ?? null : null;
|
|
3815
3847
|
}
|
|
3816
|
-
function
|
|
3848
|
+
function Zi(e) {
|
|
3817
3849
|
return e === "OR" ? "OR" : "AND";
|
|
3818
3850
|
}
|
|
3819
|
-
function
|
|
3851
|
+
function Qi(e) {
|
|
3852
|
+
return e === "PREVIOUS" || e === "ANY" ? e : "INITIATOR";
|
|
3853
|
+
}
|
|
3854
|
+
function $i(e) {
|
|
3820
3855
|
return e === "FROM_RETURN_POINT" ? "FROM_RETURN_POINT" : "RESTART";
|
|
3821
3856
|
}
|
|
3822
|
-
function
|
|
3857
|
+
function ea(e) {
|
|
3823
3858
|
return e?.type ?? "SINGLE";
|
|
3824
3859
|
}
|
|
3825
|
-
function
|
|
3860
|
+
function ta(e, t) {
|
|
3826
3861
|
return e === "QUORUM" ? t?.type === "QUORUM" ? t : {
|
|
3827
|
-
threshold:
|
|
3862
|
+
threshold: tt,
|
|
3828
3863
|
thresholdType: "COUNT",
|
|
3829
3864
|
type: "QUORUM"
|
|
3830
3865
|
} : e === "PARALLEL_ALL" || e === "PARALLEL_ANY" || e === "SEQUENTIAL" ? { type: e } : { type: "SINGLE" };
|
|
3831
3866
|
}
|
|
3832
|
-
function
|
|
3867
|
+
function na(e) {
|
|
3833
3868
|
return e?.type === "QUORUM" ? {
|
|
3834
|
-
threshold: Number.isFinite(e.threshold) ? e.threshold :
|
|
3835
|
-
thresholdType:
|
|
3869
|
+
threshold: Number.isFinite(e.threshold) ? e.threshold : tt,
|
|
3870
|
+
thresholdType: ra(e.thresholdType ?? null)
|
|
3836
3871
|
} : {
|
|
3837
|
-
threshold:
|
|
3872
|
+
threshold: tt,
|
|
3838
3873
|
thresholdType: "COUNT"
|
|
3839
3874
|
};
|
|
3840
3875
|
}
|
|
3841
|
-
function
|
|
3876
|
+
function ra(e) {
|
|
3842
3877
|
return e === "PERCENTAGE" ? "PERCENTAGE" : "COUNT";
|
|
3843
3878
|
}
|
|
3844
|
-
function
|
|
3879
|
+
function ia(e) {
|
|
3845
3880
|
return e === "HOUR" ? "HOUR" : "DAY";
|
|
3846
3881
|
}
|
|
3847
|
-
function
|
|
3882
|
+
function aa(e) {
|
|
3848
3883
|
return e === "BUSINESS_DAY" ? "BUSINESS_DAY" : "CALENDAR";
|
|
3849
3884
|
}
|
|
3850
|
-
function
|
|
3851
|
-
return
|
|
3885
|
+
function oa(e) {
|
|
3886
|
+
return st.find((t) => t.id === e)?.id ?? "REMIND";
|
|
3852
3887
|
}
|
|
3853
|
-
function
|
|
3854
|
-
return
|
|
3888
|
+
function sa(e) {
|
|
3889
|
+
return ui.find((t) => t.value === e) ?? ui[0];
|
|
3855
3890
|
}
|
|
3856
|
-
function
|
|
3857
|
-
return
|
|
3891
|
+
function ca(e) {
|
|
3892
|
+
return ui.find((t) => t.id === e) ?? ui[0];
|
|
3858
3893
|
}
|
|
3859
|
-
function
|
|
3860
|
-
let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r =
|
|
3894
|
+
function la(e, t) {
|
|
3895
|
+
let n = Number.isFinite(t.value) ? Math.trunc(t.value) : 1, r = lt({
|
|
3861
3896
|
unit: t.unit,
|
|
3862
3897
|
value: n
|
|
3863
3898
|
});
|
|
@@ -3867,30 +3902,30 @@ function sa(e, t) {
|
|
|
3867
3902
|
duration: r
|
|
3868
3903
|
};
|
|
3869
3904
|
}
|
|
3870
|
-
function
|
|
3905
|
+
function ua(e, t) {
|
|
3871
3906
|
return t === "ESCALATE" ? {
|
|
3872
3907
|
...e,
|
|
3873
3908
|
escalateLevelsUp: e.escalateLevelsUp ?? 1,
|
|
3874
3909
|
onTimeout: t
|
|
3875
3910
|
} : {
|
|
3876
|
-
...
|
|
3911
|
+
...fa(e, "escalateLevelsUp"),
|
|
3877
3912
|
onTimeout: t
|
|
3878
3913
|
};
|
|
3879
3914
|
}
|
|
3880
|
-
function
|
|
3881
|
-
return t === null ?
|
|
3915
|
+
function da(e, t) {
|
|
3916
|
+
return t === null ? fa(e, "warningAt") : {
|
|
3882
3917
|
...e,
|
|
3883
3918
|
warningAt: t
|
|
3884
3919
|
};
|
|
3885
3920
|
}
|
|
3886
|
-
function
|
|
3921
|
+
function fa(e, t) {
|
|
3887
3922
|
return Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
|
|
3888
3923
|
}
|
|
3889
|
-
function
|
|
3924
|
+
function pa(e) {
|
|
3890
3925
|
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";
|
|
3891
3926
|
}
|
|
3892
|
-
function
|
|
3893
|
-
let n =
|
|
3927
|
+
function ma(e, t) {
|
|
3928
|
+
let n = pa(e ?? "DIRECT");
|
|
3894
3929
|
return n === "DYNAMIC_FORM" ? {
|
|
3895
3930
|
formPath: "",
|
|
3896
3931
|
type: "DYNAMIC_FORM"
|
|
@@ -3899,7 +3934,7 @@ function fa(e, t) {
|
|
|
3899
3934
|
levelsUp: 1,
|
|
3900
3935
|
type: "ORG_MANAGER"
|
|
3901
3936
|
} : n === "ORG_MANAGER_CHAIN" ? {
|
|
3902
|
-
minPositionLevel:
|
|
3937
|
+
minPositionLevel: On(t),
|
|
3903
3938
|
type: "ORG_MANAGER_CHAIN"
|
|
3904
3939
|
} : n === "ORG_UNIT_MANAGER" ? {
|
|
3905
3940
|
orgUnitId: "",
|
|
@@ -3921,11 +3956,11 @@ function fa(e, t) {
|
|
|
3921
3956
|
type: "DIRECT"
|
|
3922
3957
|
};
|
|
3923
3958
|
}
|
|
3924
|
-
function
|
|
3959
|
+
function ha(e) {
|
|
3925
3960
|
return e === "DIRECT" || e === "POSITION" ? e : "NONE";
|
|
3926
3961
|
}
|
|
3927
|
-
function
|
|
3928
|
-
let t =
|
|
3962
|
+
function ga(e) {
|
|
3963
|
+
let t = ha(e);
|
|
3929
3964
|
return t === "DIRECT" ? {
|
|
3930
3965
|
memberId: "",
|
|
3931
3966
|
type: "DIRECT"
|
|
@@ -3934,28 +3969,28 @@ function ma(e) {
|
|
|
3934
3969
|
type: "POSITION"
|
|
3935
3970
|
} : { type: "NONE" };
|
|
3936
3971
|
}
|
|
3937
|
-
function
|
|
3972
|
+
function _a(e, t) {
|
|
3938
3973
|
return e.type === "ORG_MANAGER" || e.type === "ORG_MANAGER_CHAIN" || e.type === "ORG_UNIT_MANAGER" ? {
|
|
3939
3974
|
...e,
|
|
3940
3975
|
fallback: t
|
|
3941
3976
|
} : e;
|
|
3942
3977
|
}
|
|
3943
|
-
function
|
|
3944
|
-
return
|
|
3978
|
+
function va(e) {
|
|
3979
|
+
return pi.find((t) => t.value === e) ?? pi[0];
|
|
3945
3980
|
}
|
|
3946
|
-
function
|
|
3947
|
-
return
|
|
3981
|
+
function ya(e) {
|
|
3982
|
+
return pi.find((t) => t.id === e) ?? pi[0];
|
|
3948
3983
|
}
|
|
3949
|
-
function
|
|
3984
|
+
function ba(e) {
|
|
3950
3985
|
return e === "ORG_UNIT" || e === "ORG_UNIT_POSITION" || e === "NONE" ? e : "ALL";
|
|
3951
3986
|
}
|
|
3952
|
-
function
|
|
3987
|
+
function xa(e) {
|
|
3953
3988
|
let t = e?.trim();
|
|
3954
3989
|
if (!t) return {
|
|
3955
3990
|
mode: "ALL",
|
|
3956
3991
|
value: ""
|
|
3957
3992
|
};
|
|
3958
|
-
let n =
|
|
3993
|
+
let n = wa(t, /"([^"]+)" in subject\.orgUnitIds/gu), r = wa(t, /"([^"]+)" in subject\.positionIds/gu);
|
|
3959
3994
|
return n.length > 0 && r.length > 0 ? {
|
|
3960
3995
|
includeDescendants: n.length > 1,
|
|
3961
3996
|
mode: "ORG_UNIT_POSITION",
|
|
@@ -3972,32 +4007,32 @@ function ya(e) {
|
|
|
3972
4007
|
value: t
|
|
3973
4008
|
};
|
|
3974
4009
|
}
|
|
3975
|
-
function
|
|
3976
|
-
let n =
|
|
4010
|
+
function Sa(e, t) {
|
|
4011
|
+
let n = xa(e);
|
|
3977
4012
|
return !t || t === "ALL" || t === "NONE" ? t === "ALL" || t === "NONE" ? {
|
|
3978
4013
|
mode: t,
|
|
3979
4014
|
value: ""
|
|
3980
|
-
} : n : n.mode === t ? n :
|
|
4015
|
+
} : n : n.mode === t ? n : Da(t);
|
|
3981
4016
|
}
|
|
3982
|
-
function
|
|
4017
|
+
function Ca(e) {
|
|
3983
4018
|
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;
|
|
3984
4019
|
}
|
|
3985
|
-
function
|
|
4020
|
+
function wa(e, t) {
|
|
3986
4021
|
return [...e.matchAll(t)].map((e) => e[1]).filter((e) => !!e);
|
|
3987
4022
|
}
|
|
3988
|
-
function
|
|
4023
|
+
function Ta(e, t) {
|
|
3989
4024
|
if (e.mode === "ALL" || e.mode === "NONE") return null;
|
|
3990
4025
|
let n = e.orgUnitId?.trim() ?? "";
|
|
3991
4026
|
if (!n) return null;
|
|
3992
|
-
let r =
|
|
4027
|
+
let r = eo(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
|
|
3993
4028
|
if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
|
|
3994
4029
|
let i = e.positionId?.trim() ?? "";
|
|
3995
4030
|
return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
|
|
3996
4031
|
}
|
|
3997
|
-
function
|
|
3998
|
-
return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${
|
|
4032
|
+
function Ea(e, t, n) {
|
|
4033
|
+
return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${Ka(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${Ka(t, e.orgUnitId)} / ${qa(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
|
|
3999
4034
|
}
|
|
4000
|
-
function
|
|
4035
|
+
function Da(e) {
|
|
4001
4036
|
return {
|
|
4002
4037
|
includeDescendants: !0,
|
|
4003
4038
|
mode: e,
|
|
@@ -4006,64 +4041,64 @@ function Ta(e) {
|
|
|
4006
4041
|
value: ""
|
|
4007
4042
|
};
|
|
4008
4043
|
}
|
|
4009
|
-
function
|
|
4044
|
+
function Oa(e, t) {
|
|
4010
4045
|
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;
|
|
4011
|
-
return !!n && !!r && e.source !== e.target && e.sourceHandle === ri && e.targetHandle === ni && !!(n &&
|
|
4046
|
+
return !!n && !!r && e.source !== e.target && e.sourceHandle === ri && e.targetHandle === ni && !!(n && Ma(n)) && !!(r && ja(r));
|
|
4012
4047
|
}
|
|
4013
|
-
function
|
|
4048
|
+
function ka(e, t) {
|
|
4014
4049
|
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
4015
4050
|
}
|
|
4016
|
-
function
|
|
4051
|
+
function Aa(e) {
|
|
4017
4052
|
return e.type !== "startEvent" && e.type !== "endEvent";
|
|
4018
4053
|
}
|
|
4019
|
-
function
|
|
4054
|
+
function ja(e) {
|
|
4020
4055
|
return e.type !== "startEvent";
|
|
4021
4056
|
}
|
|
4022
|
-
function
|
|
4023
|
-
return e.type !== "endEvent" && !
|
|
4057
|
+
function Ma(e) {
|
|
4058
|
+
return e.type !== "endEvent" && !Na(e);
|
|
4024
4059
|
}
|
|
4025
|
-
function
|
|
4060
|
+
function Na(e) {
|
|
4026
4061
|
return e.type === "serviceTask" && e.data.action.type === "NOTIFY";
|
|
4027
4062
|
}
|
|
4028
|
-
function
|
|
4063
|
+
function Pa(e) {
|
|
4029
4064
|
return e instanceof HTMLElement ? e.isContentEditable || e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.tagName === "SELECT" || !!e.closest("[contenteditable=\"true\"]") : !1;
|
|
4030
4065
|
}
|
|
4031
|
-
function
|
|
4066
|
+
function Fa(e) {
|
|
4032
4067
|
return e.map((e) => ({
|
|
4033
4068
|
formDefinitionId: e.formDefinitionId,
|
|
4034
4069
|
formName: e.formName,
|
|
4035
4070
|
id: e.id,
|
|
4036
|
-
name:
|
|
4071
|
+
name: gr(e.formName, e.version),
|
|
4037
4072
|
schema: e.schema
|
|
4038
4073
|
}));
|
|
4039
4074
|
}
|
|
4040
|
-
function
|
|
4075
|
+
function Ia(e) {
|
|
4041
4076
|
let t = JSON.parse(e);
|
|
4042
|
-
if (!
|
|
4077
|
+
if (!La(t)) throw Error("表單資料 JSON 必須是物件。");
|
|
4043
4078
|
return t;
|
|
4044
4079
|
}
|
|
4045
|
-
function
|
|
4080
|
+
function La(e) {
|
|
4046
4081
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4047
4082
|
}
|
|
4048
|
-
function
|
|
4083
|
+
function Ra(e) {
|
|
4049
4084
|
return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
|
|
4050
4085
|
}
|
|
4051
|
-
function
|
|
4086
|
+
function za(e) {
|
|
4052
4087
|
return e in ii ? ii[e] : e;
|
|
4053
4088
|
}
|
|
4054
|
-
function
|
|
4089
|
+
function Ba(e, t) {
|
|
4055
4090
|
return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
|
|
4056
4091
|
}
|
|
4057
|
-
function
|
|
4092
|
+
function Va(e) {
|
|
4058
4093
|
return e.map((e) => ({
|
|
4059
4094
|
displayName: e.name,
|
|
4060
4095
|
email: e.email,
|
|
4061
4096
|
id: e.memberId,
|
|
4062
4097
|
memberId: e.memberId,
|
|
4063
|
-
name:
|
|
4098
|
+
name: uo(e.name, e.email)
|
|
4064
4099
|
}));
|
|
4065
4100
|
}
|
|
4066
|
-
function
|
|
4101
|
+
function Ha(e) {
|
|
4067
4102
|
return {
|
|
4068
4103
|
displayName: "未知會員",
|
|
4069
4104
|
email: "",
|
|
@@ -4073,101 +4108,101 @@ function Ba(e) {
|
|
|
4073
4108
|
unresolved: !0
|
|
4074
4109
|
};
|
|
4075
4110
|
}
|
|
4076
|
-
function
|
|
4077
|
-
return e.find((e) => e.memberId === t) ??
|
|
4111
|
+
function Ua(e, t) {
|
|
4112
|
+
return e.find((e) => e.memberId === t) ?? Ha(t);
|
|
4078
4113
|
}
|
|
4079
|
-
function
|
|
4114
|
+
function Wa(e, t) {
|
|
4080
4115
|
let n = e.find((e) => e.id === t);
|
|
4081
4116
|
return n ? a(n) : null;
|
|
4082
4117
|
}
|
|
4083
|
-
function
|
|
4118
|
+
function Ga(e, t) {
|
|
4084
4119
|
let n = e.find((e) => e.id === t);
|
|
4085
4120
|
return n ? s(n) : null;
|
|
4086
4121
|
}
|
|
4087
|
-
function
|
|
4088
|
-
return
|
|
4122
|
+
function Ka(e, t) {
|
|
4123
|
+
return Wa(e, t)?.name ?? "未指定組織";
|
|
4089
4124
|
}
|
|
4090
|
-
function
|
|
4091
|
-
return
|
|
4125
|
+
function qa(e, t) {
|
|
4126
|
+
return Ga(e, t)?.name ?? "未指定職位";
|
|
4092
4127
|
}
|
|
4093
|
-
function
|
|
4094
|
-
let n =
|
|
4128
|
+
function Ja(e, t) {
|
|
4129
|
+
let n = Ya(), r = t.filter((t) => t.memberId === e && Xa(t, n)), i = r.reduce((e, t) => e && Za(e, t) <= 0 ? e : t, null);
|
|
4095
4130
|
return {
|
|
4096
4131
|
customFields: {},
|
|
4097
4132
|
managerMemberId: "member-002",
|
|
4098
4133
|
memberId: e,
|
|
4099
4134
|
orgCode: "HQ",
|
|
4100
|
-
orgUnitIds:
|
|
4135
|
+
orgUnitIds: Qa(r.map((e) => e.orgUnitId)),
|
|
4101
4136
|
positionId: i?.positionId ?? null,
|
|
4102
|
-
positionIds:
|
|
4137
|
+
positionIds: Qa(r.map((e) => e.positionId)),
|
|
4103
4138
|
primaryOrgUnitId: i?.orgUnitId ?? null,
|
|
4104
4139
|
roles: ["manager"]
|
|
4105
4140
|
};
|
|
4106
4141
|
}
|
|
4107
|
-
function
|
|
4142
|
+
function Ya() {
|
|
4108
4143
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
4109
4144
|
}
|
|
4110
|
-
function
|
|
4145
|
+
function Xa(e, t) {
|
|
4111
4146
|
return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
|
|
4112
4147
|
}
|
|
4113
|
-
function
|
|
4148
|
+
function Za(e, t) {
|
|
4114
4149
|
return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
|
|
4115
4150
|
}
|
|
4116
|
-
function
|
|
4151
|
+
function Qa(e) {
|
|
4117
4152
|
return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
|
|
4118
4153
|
}
|
|
4119
|
-
function
|
|
4120
|
-
let a = new Set(
|
|
4154
|
+
function $a({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
|
|
4155
|
+
let a = new Set(eo(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
|
|
4121
4156
|
return i.filter((e) => o.has(e.id));
|
|
4122
4157
|
}
|
|
4123
|
-
function
|
|
4158
|
+
function eo(e, t, n) {
|
|
4124
4159
|
let r = e.find((e) => e.id === t);
|
|
4125
4160
|
return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
|
|
4126
4161
|
}
|
|
4127
|
-
function
|
|
4162
|
+
function to(e, t) {
|
|
4128
4163
|
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);
|
|
4129
4164
|
return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
|
|
4130
4165
|
}
|
|
4131
|
-
function
|
|
4166
|
+
function no(e) {
|
|
4132
4167
|
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] : [];
|
|
4133
4168
|
}
|
|
4134
|
-
function
|
|
4135
|
-
return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ?
|
|
4169
|
+
function ro(e) {
|
|
4170
|
+
return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? no(e.data.approverResolver) : e.type === "serviceTask" ? So(e.data.action) : []))];
|
|
4136
4171
|
}
|
|
4137
|
-
function
|
|
4138
|
-
return e.type === "userTask" ?
|
|
4172
|
+
function io(e, t, n, r, i) {
|
|
4173
|
+
return e.type === "userTask" ? ao(e.data.approverResolver, t, n, r, i) : null;
|
|
4139
4174
|
}
|
|
4140
|
-
function
|
|
4141
|
-
return e.type === "DIRECT" ?
|
|
4175
|
+
function ao(e, t, n, r, i) {
|
|
4176
|
+
return e.type === "DIRECT" ? lo(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? va(e.levelsUp).name : e.type === "ORG_MANAGER_CHAIN" ? `主管鏈:簽到職等 ${e.minPositionLevel}` : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${Ka(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${Ka(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${Ka(n, e.orgUnitId)} / ${qa(r, e.positionId)}` : e.type === "POSITION" ? `職位:${qa(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? mr(i, e.formPath) : "自訂表達式";
|
|
4142
4177
|
}
|
|
4143
|
-
function
|
|
4178
|
+
function oo(e, t, n, r, i) {
|
|
4144
4179
|
if (e.type !== "serviceTask") return null;
|
|
4145
|
-
let a = e.data.action, o = a.type === "NOTIFY" && a.recipients.type !== "DIRECT" ? [
|
|
4180
|
+
let a = e.data.action, o = a.type === "NOTIFY" && a.recipients.type !== "DIRECT" ? [ao(a.recipients, t, n, r, i)] : So(a).map((e) => Ua(t, e).name), s = Ct(a).length, c = [...o, ...s ? [`Webhook ${s} 個`] : []];
|
|
4146
4181
|
return c.length ? c : ["未指定知會對象"];
|
|
4147
4182
|
}
|
|
4148
|
-
function
|
|
4149
|
-
let t = e.type === "NOTIFY" && e.recipients.type !== "DIRECT" ? 1 :
|
|
4183
|
+
function so(e) {
|
|
4184
|
+
let t = e.type === "NOTIFY" && e.recipients.type !== "DIRECT" ? 1 : So(e).length, n = +!!Ct(e).length;
|
|
4150
4185
|
return Math.max(1, t + n);
|
|
4151
4186
|
}
|
|
4152
|
-
function
|
|
4187
|
+
function co(e, t, n) {
|
|
4153
4188
|
let r = e.nodes.find((e) => e.id === t);
|
|
4154
|
-
return r?.type === "serviceTask" && r.data.action.type === "NOTIFY" &&
|
|
4189
|
+
return r?.type === "serviceTask" && r.data.action.type === "NOTIFY" && In(r.data.action.webhooks) ? Ct(r.data.action).map((e) => ({
|
|
4155
4190
|
key: e.id,
|
|
4156
|
-
label:
|
|
4191
|
+
label: jn(n, e.endpoint)?.label ?? An(e.endpoint)
|
|
4157
4192
|
})) : [];
|
|
4158
4193
|
}
|
|
4159
|
-
function
|
|
4160
|
-
let r = e.map((e) =>
|
|
4194
|
+
function lo(e, t, n) {
|
|
4195
|
+
let r = e.map((e) => Ua(t, e).name);
|
|
4161
4196
|
return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
|
|
4162
4197
|
}
|
|
4163
|
-
function
|
|
4198
|
+
function uo(e, t) {
|
|
4164
4199
|
return i(e, t);
|
|
4165
4200
|
}
|
|
4166
|
-
function
|
|
4201
|
+
function fo(e, t) {
|
|
4167
4202
|
let n = t?.getBoundingClientRect();
|
|
4168
4203
|
if (!n || e.nodes.length === 0) return null;
|
|
4169
4204
|
let r = e.nodes.reduce((e, t) => {
|
|
4170
|
-
let n =
|
|
4205
|
+
let n = Li(t);
|
|
4171
4206
|
return {
|
|
4172
4207
|
maxX: Math.max(e.maxX, t.position.x + n.width),
|
|
4173
4208
|
maxY: Math.max(e.maxY, t.position.y + n.height),
|
|
@@ -4187,21 +4222,21 @@ function lo(e, t) {
|
|
|
4187
4222
|
y: r.minY
|
|
4188
4223
|
}, n.width, n.height, .1, 1, .2);
|
|
4189
4224
|
}
|
|
4190
|
-
function
|
|
4191
|
-
let t = e.nodes.find((e) => e.type === "userTask" && !!
|
|
4192
|
-
return t && t.type === "userTask" ?
|
|
4225
|
+
function po(e) {
|
|
4226
|
+
let t = e.nodes.find((e) => e.type === "userTask" && !!z(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "userTask" && !!vt(e.data.excludeInitiator)), r = e.nodes.map((e) => yt(e)).find((e) => e !== null) ?? null, i = e.edges.find((t) => bo(t, e.nodes) && !t.data.isDefault && !t.data.condition), a = e.nodes.find((e) => e.type === "userTask" && mt(e.data.approverResolver, e.data.decisionPolicy));
|
|
4227
|
+
return t && t.type === "userTask" ? z(t.data.approverResolver) : a && a.type === "userTask" ? `簽核節點「${a.data.label}」使用「沿主管鏈簽核」時,決策方式必須是「依序簽核或全部同意」,否則任一位主管簽完就會結案。` : n && n.type === "userTask" ? vt(n.data.excludeInitiator) : r || (i ? "條件分流的每條輸出連線都需要先設定條件。" : null);
|
|
4193
4228
|
}
|
|
4194
|
-
function
|
|
4229
|
+
function mo(e) {
|
|
4195
4230
|
return e?.fields.map((e) => ({
|
|
4196
4231
|
fieldType: e.type,
|
|
4197
4232
|
id: e.fieldKey,
|
|
4198
4233
|
name: `${e.label} (${e.fieldKey})`
|
|
4199
4234
|
})) ?? [];
|
|
4200
4235
|
}
|
|
4201
|
-
function
|
|
4236
|
+
function ho(e, t) {
|
|
4202
4237
|
return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
|
|
4203
4238
|
}
|
|
4204
|
-
function
|
|
4239
|
+
function go(e) {
|
|
4205
4240
|
return e ? e.type === "boolean" ? [{
|
|
4206
4241
|
id: "true",
|
|
4207
4242
|
name: "是"
|
|
@@ -4213,27 +4248,27 @@ function mo(e) {
|
|
|
4213
4248
|
name: e.label
|
|
4214
4249
|
})) : [] : [];
|
|
4215
4250
|
}
|
|
4216
|
-
function
|
|
4217
|
-
return
|
|
4251
|
+
function _o(e) {
|
|
4252
|
+
return vi.includes(e);
|
|
4218
4253
|
}
|
|
4219
|
-
function
|
|
4254
|
+
function vo(e, t) {
|
|
4220
4255
|
if (e.data.label) return e.data.label;
|
|
4221
|
-
if (
|
|
4222
|
-
if (
|
|
4256
|
+
if (bo(e, t)) return yo(e);
|
|
4257
|
+
if (xo(e, t)) return "同時進行";
|
|
4223
4258
|
}
|
|
4224
|
-
function
|
|
4259
|
+
function yo(e) {
|
|
4225
4260
|
return e.data.isDefault ? "其他情況" : "請設定條件";
|
|
4226
4261
|
}
|
|
4227
|
-
function
|
|
4262
|
+
function bo(e, t) {
|
|
4228
4263
|
return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
|
|
4229
4264
|
}
|
|
4230
|
-
function
|
|
4265
|
+
function xo(e, t) {
|
|
4231
4266
|
return t.some((t) => t.id === e.source && t.type === "parallelGateway");
|
|
4232
4267
|
}
|
|
4233
|
-
function
|
|
4268
|
+
function So(e) {
|
|
4234
4269
|
return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
|
|
4235
4270
|
}
|
|
4236
4271
|
//#endregion
|
|
4237
|
-
export {
|
|
4272
|
+
export { J as n, ki as t };
|
|
4238
4273
|
|
|
4239
|
-
//# sourceMappingURL=designer-
|
|
4274
|
+
//# sourceMappingURL=designer-BCLrjb4H.js.map
|