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