@vef-framework-react/approval 2.30.0 → 2.31.1
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/dist/cjs/api/admin-api.cjs +1 -1
- package/dist/cjs/api/flow-api.cjs +1 -1
- package/dist/cjs/api/instance-api.cjs +1 -1
- package/dist/cjs/api/my-api.cjs +1 -1
- package/dist/cjs/components/action-dialog/index.cjs +1 -1
- package/dist/cjs/components/action-dialog/user-selection.cjs +1 -0
- package/dist/cjs/components/annotations/composers.cjs +1 -0
- package/dist/cjs/components/annotations/field-anchor.cjs +1 -0
- package/dist/cjs/components/annotations/index.cjs +1 -0
- package/dist/cjs/components/annotations/use-annotations.cjs +1 -0
- package/dist/cjs/components/business-form.cjs +1 -0
- package/dist/cjs/components/capped-modal.cjs +1 -0
- package/dist/cjs/components/detail/action-modals.cjs +1 -1
- package/dist/cjs/components/detail/admin.cjs +1 -1
- package/dist/cjs/components/detail/index.cjs +1 -1
- package/dist/cjs/components/flow-graph/node.cjs +1 -1
- package/dist/cjs/components/flow-graph/people-overlay.cjs +1 -1
- package/dist/cjs/components/form-panel/index.cjs +1 -1
- package/dist/cjs/components/format.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/instance-list-title.cjs +1 -0
- package/dist/cjs/components/principal/index.cjs +1 -1
- package/dist/cjs/components/status/colors.cjs +1 -1
- package/dist/cjs/components/status/index.cjs +1 -1
- package/dist/cjs/components/status/labels.cjs +1 -1
- package/dist/cjs/components/timeline/index.cjs +1 -1
- package/dist/cjs/components/user/index.cjs +1 -1
- package/dist/cjs/components/void/direct-dialog.cjs +1 -0
- package/dist/cjs/components/void/form.cjs +1 -0
- package/dist/cjs/components/void/request-renderer.cjs +1 -0
- package/dist/cjs/components/void/summary.cjs +1 -0
- package/dist/cjs/components/void/use-refresh.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pages/admin-page/apply-handovers.cjs +1 -0
- package/dist/cjs/pages/admin-page/index.cjs +1 -1
- package/dist/cjs/pages/admin-page/instances.cjs +1 -1
- package/dist/cjs/pages/admin-page/metrics.cjs +1 -1
- package/dist/cjs/pages/admin-page/tasks.cjs +1 -1
- package/dist/cjs/pages/category-page/index.cjs +1 -1
- package/dist/cjs/pages/delegation-page/index.cjs +1 -1
- package/dist/cjs/pages/flow-page/columns.cjs +1 -1
- package/dist/cjs/pages/flow-page/designer/basic-step.cjs +1 -1
- package/dist/cjs/pages/flow-page/designer/field-catalog.cjs +1 -0
- package/dist/cjs/pages/flow-page/designer/form-step.cjs +1 -1
- package/dist/cjs/pages/flow-page/designer/index.cjs +1 -1
- package/dist/cjs/pages/flow-page/designer/review-step.cjs +1 -1
- package/dist/cjs/pages/flow-page/designer/types.cjs +1 -1
- package/dist/cjs/pages/flow-page/designer/void-policy.cjs +1 -0
- package/dist/cjs/pages/flow-page/index.cjs +1 -1
- package/dist/cjs/pages/index.cjs +1 -1
- package/dist/cjs/pages/initiate-page/index.cjs +1 -1
- package/dist/cjs/pages/initiate-page/start-drawer.cjs +1 -1
- package/dist/cjs/pages/my-instances-page/index.cjs +1 -1
- package/dist/cjs/pages/task-center-page/index.cjs +1 -1
- package/dist/cjs/permissions.cjs +1 -1
- package/dist/cjs/plugins/index.cjs +1 -1
- package/dist/cjs/types/annotation.cjs +1 -0
- package/dist/cjs/types/detail.cjs +1 -0
- package/dist/cjs/types/enums.cjs +1 -1
- package/dist/cjs/types/index.cjs +1 -1
- package/dist/cjs/types/void.cjs +1 -0
- package/dist/es/api/admin-api.js +5 -2
- package/dist/es/api/category-api.js +1 -1
- package/dist/es/api/delegation-api.js +1 -1
- package/dist/es/api/flow-api.js +19 -15
- package/dist/es/api/index.js +1 -1
- package/dist/es/api/instance-api.js +3 -1
- package/dist/es/api/my-api.js +2 -1
- package/dist/es/api/query.js +1 -1
- package/dist/es/components/action-dialog/index.js +64 -41
- package/dist/es/components/action-dialog/user-selection.js +48 -0
- package/dist/es/components/annotations/composers.js +231 -0
- package/dist/es/components/annotations/field-anchor.js +18 -0
- package/dist/es/components/annotations/index.js +271 -0
- package/dist/es/components/annotations/use-annotations.js +77 -0
- package/dist/es/components/business-form.js +36 -0
- package/dist/es/components/capped-modal.js +27 -0
- package/dist/es/components/detail/action-modals.js +120 -132
- package/dist/es/components/detail/admin.js +109 -74
- package/dist/es/components/detail/drawer.js +1 -1
- package/dist/es/components/detail/index.js +298 -233
- package/dist/es/components/flow-graph/index.js +1 -1
- package/dist/es/components/flow-graph/node.js +26 -26
- package/dist/es/components/flow-graph/people-overlay.js +104 -100
- package/dist/es/components/flow-graph/people.js +1 -1
- package/dist/es/components/form-panel/index.js +10 -9
- package/dist/es/components/format.js +7 -4
- package/dist/es/components/icon.js +1 -1
- package/dist/es/components/index.js +11 -8
- package/dist/es/components/instance-list-title.js +31 -0
- package/dist/es/components/principal/index.js +4 -2
- package/dist/es/components/status/colors.js +3 -2
- package/dist/es/components/status/index.js +14 -14
- package/dist/es/components/status/labels.js +7 -3
- package/dist/es/components/timeline/index.js +79 -69
- package/dist/es/components/user/index.js +32 -25
- package/dist/es/components/void/direct-dialog.js +62 -0
- package/dist/es/components/void/form.js +100 -0
- package/dist/es/components/void/request-renderer.js +91 -0
- package/dist/es/components/void/summary.js +142 -0
- package/dist/es/components/void/use-refresh.js +22 -0
- package/dist/es/index.js +33 -27
- package/dist/es/pages/admin-page/apply-handovers.js +185 -0
- package/dist/es/pages/admin-page/index.js +50 -43
- package/dist/es/pages/admin-page/instances.js +50 -52
- package/dist/es/pages/admin-page/metrics.js +34 -33
- package/dist/es/pages/admin-page/projections.js +1 -1
- package/dist/es/pages/admin-page/tasks.js +59 -57
- package/dist/es/pages/category-page/columns.js +1 -1
- package/dist/es/pages/category-page/form.js +1 -1
- package/dist/es/pages/category-page/index.js +21 -21
- package/dist/es/pages/delegation-page/columns.js +1 -1
- package/dist/es/pages/delegation-page/form.js +1 -1
- package/dist/es/pages/delegation-page/index.js +19 -19
- package/dist/es/pages/flow-page/columns.js +6 -6
- package/dist/es/pages/flow-page/designer/basic-step.js +202 -146
- package/dist/es/pages/flow-page/designer/field-catalog.js +47 -0
- package/dist/es/pages/flow-page/designer/flow-step.js +1 -1
- package/dist/es/pages/flow-page/designer/form-step.js +14 -14
- package/dist/es/pages/flow-page/designer/index.js +248 -202
- package/dist/es/pages/flow-page/designer/review-step.js +38 -60
- package/dist/es/pages/flow-page/designer/types.js +13 -5
- package/dist/es/pages/flow-page/designer/void-policy.js +135 -0
- package/dist/es/pages/flow-page/index.js +18 -18
- package/dist/es/pages/flow-page/search.js +1 -1
- package/dist/es/pages/flow-page/versions.js +1 -1
- package/dist/es/pages/index.js +9 -9
- package/dist/es/pages/initiate-page/index.js +133 -86
- package/dist/es/pages/initiate-page/start-drawer.js +153 -64
- package/dist/es/pages/my-instances-page/index.js +57 -77
- package/dist/es/pages/task-center-page/index.js +73 -68
- package/dist/es/pages/task-center-page/search.js +1 -1
- package/dist/es/permissions.js +6 -3
- package/dist/es/plugins/form-context.js +1 -1
- package/dist/es/plugins/index.js +32 -21
- package/dist/es/types/annotation.js +18 -0
- package/dist/es/types/detail.js +7 -0
- package/dist/es/types/enums.js +3 -2
- package/dist/es/types/index.js +6 -3
- package/dist/es/types/void.js +5 -0
- package/dist/types/api/admin-api.d.ts +4 -1
- package/dist/types/api/flow-api.d.ts +4 -2
- package/dist/types/api/instance-api.d.ts +5 -1
- package/dist/types/api/my-api.d.ts +2 -1
- package/dist/types/components/action-dialog/index.d.ts +8 -2
- package/dist/types/components/action-dialog/user-selection.d.ts +18 -0
- package/dist/types/components/annotations/composers.d.ts +14 -0
- package/dist/types/components/annotations/field-anchor.d.ts +3 -0
- package/dist/types/components/annotations/index.d.ts +22 -0
- package/dist/types/components/annotations/use-annotations.d.ts +24 -0
- package/dist/types/components/business-form.d.ts +14 -0
- package/dist/types/components/capped-modal.d.ts +2 -0
- package/dist/types/components/detail/admin.d.ts +2 -1
- package/dist/types/components/form-panel/index.d.ts +3 -2
- package/dist/types/components/format.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/instance-list-title.d.ts +5 -0
- package/dist/types/components/timeline/index.d.ts +3 -1
- package/dist/types/components/user/index.d.ts +4 -0
- package/dist/types/components/void/direct-dialog.d.ts +8 -0
- package/dist/types/components/void/form.d.ts +27 -0
- package/dist/types/components/void/request-renderer.d.ts +3 -0
- package/dist/types/components/void/summary.d.ts +16 -0
- package/dist/types/components/void/use-refresh.d.ts +4 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/pages/admin-page/apply-handovers.d.ts +3 -0
- package/dist/types/pages/admin-page/index.d.ts +2 -0
- package/dist/types/pages/admin-page/instances.d.ts +2 -1
- package/dist/types/pages/flow-page/designer/basic-step.d.ts +7 -2
- package/dist/types/pages/flow-page/designer/field-catalog.d.ts +5 -0
- package/dist/types/pages/flow-page/designer/review-step.d.ts +2 -1
- package/dist/types/pages/flow-page/designer/types.d.ts +13 -2
- package/dist/types/pages/flow-page/designer/void-policy.d.ts +14 -0
- package/dist/types/pages/initiate-page/start-drawer.d.ts +7 -1
- package/dist/types/permissions.d.ts +8 -0
- package/dist/types/plugins/index.d.ts +28 -3
- package/dist/types/types/admin.d.ts +27 -0
- package/dist/types/types/annotation.d.ts +60 -0
- package/dist/types/types/detail.d.ts +8 -1
- package/dist/types/types/enums.d.ts +5 -10
- package/dist/types/types/flow.d.ts +25 -5
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/types/instance.d.ts +1 -2
- package/dist/types/types/my.d.ts +16 -0
- package/dist/types/types/void.d.ts +58 -0
- package/package.json +13 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval v2.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/*! @vef-framework-react/approval v2.31.1 made by Venus | 2026-11-19T04:58:06.116Z */
|
|
2
|
+
import { toFormContextSources as e } from "../../../plugins/form-context.js";
|
|
3
|
+
import { useApprovalPlugins as t } from "../../../plugins/index.js";
|
|
4
4
|
import { useMemo as n } from "react";
|
|
5
5
|
import { Flex as r, Segmented as i, Stack as a, Text as o, globalCssVars as s } from "@vef-framework-react/components";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
7
|
+
import { validateApprovalProjection as u } from "@vef-framework-react/approval-form-bridge";
|
|
8
8
|
import { FormEditor as d } from "@vef-framework-react/form-editor";
|
|
9
9
|
//#region src/pages/flow-page/designer/form-step.tsx
|
|
10
10
|
var f = [{
|
|
@@ -22,36 +22,36 @@ var m = {
|
|
|
22
22
|
table: "表单数据投影到按版本生成的独立表(明细表各自成表),适合复杂查询与数据分析。"
|
|
23
23
|
};
|
|
24
24
|
function h({ storageMode: h, initialSchema: g, registries: _, onStorageModeChange: v, onSchemaChange: y }) {
|
|
25
|
-
let { codeSets: b, dataSourceApis: x, dataSourceResolver: S, evaluators: C, formGlobals: w } =
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
let { codeSets: b, dataSourceApis: x, dataSourceResolver: S, evaluators: C, formGlobals: w } = t(), T = n(() => e(w), [w]);
|
|
26
|
+
return /* @__PURE__ */ l(a, {
|
|
27
27
|
gap: 8,
|
|
28
28
|
style: {
|
|
29
29
|
height: "100%",
|
|
30
30
|
minHeight: 0
|
|
31
31
|
},
|
|
32
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ l(r, {
|
|
33
33
|
align: "center",
|
|
34
34
|
gap: "middle",
|
|
35
35
|
wrap: "wrap",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ c(o, {
|
|
38
38
|
type: "secondary",
|
|
39
39
|
children: "存储模式"
|
|
40
40
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ c(i, {
|
|
42
42
|
options: f,
|
|
43
43
|
value: h,
|
|
44
44
|
onChange: (e) => {
|
|
45
45
|
p(e) && v(e);
|
|
46
46
|
}
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ c(o, {
|
|
49
49
|
style: { fontSize: s.fontSizeSm },
|
|
50
50
|
type: "secondary",
|
|
51
51
|
children: m[h]
|
|
52
52
|
})
|
|
53
53
|
]
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ c("div", {
|
|
55
55
|
style: {
|
|
56
56
|
flex: 1,
|
|
57
57
|
minHeight: 0,
|
|
@@ -59,7 +59,7 @@ function h({ storageMode: h, initialSchema: g, registries: _, onStorageModeChang
|
|
|
59
59
|
borderRadius: 8,
|
|
60
60
|
overflow: "hidden"
|
|
61
61
|
},
|
|
62
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ c(d, {
|
|
63
63
|
codeSets: b,
|
|
64
64
|
contextSources: T,
|
|
65
65
|
dataSourceApis: x,
|
|
@@ -67,7 +67,7 @@ function h({ storageMode: h, initialSchema: g, registries: _, onStorageModeChang
|
|
|
67
67
|
evaluators: C,
|
|
68
68
|
initialSchema: g,
|
|
69
69
|
registries: _,
|
|
70
|
-
validate:
|
|
70
|
+
validate: u,
|
|
71
71
|
onSchemaChange: y
|
|
72
72
|
})
|
|
73
73
|
})]
|
|
@@ -1,250 +1,296 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval v2.
|
|
1
|
+
/*! @vef-framework-react/approval v2.31.1 made by Venus | 2026-11-19T04:58:06.116Z */
|
|
2
2
|
import { useCategoryApi as e } from "../../../api/category-api.js";
|
|
3
3
|
import { useFlowApi as t } from "../../../api/flow-api.js";
|
|
4
|
+
import "../../../types/void.js";
|
|
4
5
|
import { toEditorPlugins as n, useApprovalPlugins as r } from "../../../plugins/index.js";
|
|
5
|
-
import { buildCategoryTreeOptions as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
6
|
+
import { buildCategoryTreeOptions as i } from "../../category-page/form.js";
|
|
7
|
+
import { useSelectedVoidFlow as ee, voidPolicyIssue as te } from "./void-policy.js";
|
|
8
|
+
import { BasicStep as ne } from "./basic-step.js";
|
|
9
|
+
import { FieldCatalog as re } from "./field-catalog.js";
|
|
10
|
+
import { FlowStep as ie } from "./flow-step.js";
|
|
11
|
+
import { FormStep as ae } from "./form-step.js";
|
|
12
|
+
import { EMPTY_FLOW_DEFINITION as oe, createEmptyDraft as se, initiatorsForSubmit as a, isBindingValid as ce, missingTitleField as le } from "./types.js";
|
|
13
|
+
import { ReviewStep as ue } from "./review-step.js";
|
|
14
|
+
import { useMutation as o, useQuery as s } from "@vef-framework-react/core";
|
|
15
|
+
import { useCallback as c, useEffect as de, useMemo as l, useState as u } from "react";
|
|
16
|
+
import { Button as d, Drawer as f, Flex as p, Spin as fe, Steps as pe, Text as me, globalCssVars as he, showSuccessMessage as ge } from "@vef-framework-react/components";
|
|
17
|
+
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
18
|
+
import { projectFormSchema as _e, validateApprovalSchema as ve } from "@vef-framework-react/approval-form-bridge";
|
|
19
|
+
import { validateFlowDefinition as ye } from "@vef-framework-react/approval-flow-editor";
|
|
20
|
+
import { windowRuleIssue as be } from "@vef-framework-react/calendar";
|
|
17
21
|
//#region src/pages/flow-page/designer/index.tsx
|
|
18
|
-
var
|
|
22
|
+
var g = [
|
|
19
23
|
{ title: "流程设置" },
|
|
20
24
|
{ title: "表单设计" },
|
|
21
25
|
{ title: "流程设计" },
|
|
22
26
|
{ title: "审阅提交" }
|
|
23
27
|
];
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
queryFn:
|
|
27
|
-
queryKey: [
|
|
28
|
-
}),
|
|
29
|
-
queryFn:
|
|
30
|
-
queryKey: [
|
|
31
|
-
enabled:
|
|
32
|
-
}),
|
|
33
|
-
queryFn:
|
|
34
|
-
queryKey: [
|
|
35
|
-
flowId:
|
|
36
|
-
versionId:
|
|
28
|
+
function _({ flow: f, tenantId: _, onClose: v }) {
|
|
29
|
+
let y = t(), b = e(), x = r(), S = f !== void 0, [C, w] = u(0), [T, E] = u(() => S ? null : se(_)), [D, xe] = u(""), [O, Se] = u(!0), [k, A] = u(!1), j = f?.tenantId ?? _, M = f?.isShared ?? T?.basic.isShared ?? !1, { data: N } = s({
|
|
30
|
+
queryFn: b.findTree,
|
|
31
|
+
queryKey: [b.findTree.key, { tenantId: j }]
|
|
32
|
+
}), Ce = l(() => i(N ?? []), [N]), { data: P } = s({
|
|
33
|
+
queryFn: y.findVersions,
|
|
34
|
+
queryKey: [y.findVersions.key, { flowId: f?.id ?? "" }],
|
|
35
|
+
enabled: S
|
|
36
|
+
}), F = P?.[0]?.id, { data: I } = s({
|
|
37
|
+
queryFn: y.getGraph,
|
|
38
|
+
queryKey: [y.getGraph.key, {
|
|
39
|
+
flowId: f?.id ?? "",
|
|
40
|
+
versionId: F ?? ""
|
|
37
41
|
}],
|
|
38
|
-
enabled:
|
|
39
|
-
}), { data:
|
|
40
|
-
queryFn:
|
|
41
|
-
queryKey: [
|
|
42
|
-
enabled:
|
|
43
|
-
}), { data:
|
|
44
|
-
queryFn:
|
|
45
|
-
queryKey: [
|
|
42
|
+
enabled: S && F !== void 0
|
|
43
|
+
}), { data: L } = s({
|
|
44
|
+
queryFn: y.findInitiators,
|
|
45
|
+
queryKey: [y.findInitiators.key, { flowId: f?.id ?? "" }],
|
|
46
|
+
enabled: S
|
|
47
|
+
}), { data: R } = s({
|
|
48
|
+
queryFn: y.listKindOptions,
|
|
49
|
+
queryKey: [y.listKindOptions.key, {}],
|
|
46
50
|
staleTime: Infinity
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
}), { data: z, isFetching: we, error: Te } = s({
|
|
52
|
+
meta: { shouldShowErrorFeedback: !1 },
|
|
53
|
+
queryFn: y.listBusinessKinds,
|
|
54
|
+
queryKey: [y.listBusinessKinds.key, {}],
|
|
55
|
+
staleTime: Infinity
|
|
56
|
+
}), B = z?.find((e) => e.kind === T?.basic.businessKind), V = !T?.basic.businessKind || z && B?.isVoidable === !0 && B.kind !== "approval.void_request", { data: H } = ee(j, T?.basic.voidPolicy === "approval" ? T.basic.voidFlowCode : void 0);
|
|
57
|
+
de(() => {
|
|
58
|
+
if (!S || T !== null || P === void 0 || L === void 0 || P.length > 0 && I === void 0) return;
|
|
59
|
+
let e = I?.version ?? null;
|
|
60
|
+
E({
|
|
61
|
+
flowId: f.id,
|
|
53
62
|
basic: {
|
|
54
|
-
tenantId:
|
|
55
|
-
isShared:
|
|
56
|
-
code:
|
|
57
|
-
name:
|
|
58
|
-
categoryId:
|
|
59
|
-
icon:
|
|
60
|
-
description:
|
|
61
|
-
labels:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
tenantId: f.tenantId,
|
|
64
|
+
isShared: f.isShared,
|
|
65
|
+
code: f.code,
|
|
66
|
+
name: f.name,
|
|
67
|
+
categoryId: f.categoryId,
|
|
68
|
+
icon: f.icon ?? void 0,
|
|
69
|
+
description: f.description ?? void 0,
|
|
70
|
+
labels: f.labels ?? {},
|
|
71
|
+
businessKind: f.businessKind,
|
|
72
|
+
voidPolicy: f.voidPolicy ?? "disabled",
|
|
73
|
+
voidFlowCode: f.voidFlowCode ?? void 0,
|
|
74
|
+
businessBinding: f.businessBinding ?? void 0,
|
|
75
|
+
adminUserIds: f.adminUserIds,
|
|
76
|
+
isAllInitiationAllowed: f.isAllInitiationAllowed,
|
|
77
|
+
instanceTitleTemplate: f.instanceTitleTemplate,
|
|
78
|
+
initiationWindow: f.initiationWindow ?? void 0
|
|
67
79
|
},
|
|
68
|
-
initiators:
|
|
80
|
+
initiators: L.map((e) => ({
|
|
69
81
|
kind: e.kind,
|
|
70
82
|
ids: e.ids
|
|
71
83
|
})),
|
|
72
84
|
storageMode: e?.storageMode ?? "json",
|
|
73
85
|
formSchema: e?.formSchema ?? null,
|
|
74
|
-
flowDefinition: e?.flowSchema ??
|
|
86
|
+
flowDefinition: e?.flowSchema ?? oe
|
|
75
87
|
});
|
|
76
88
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
S,
|
|
90
|
+
T,
|
|
91
|
+
P,
|
|
92
|
+
I,
|
|
93
|
+
L,
|
|
94
|
+
f
|
|
83
95
|
]);
|
|
84
|
-
let
|
|
96
|
+
let U = {
|
|
85
97
|
shouldShowSuccessFeedback: !1,
|
|
86
|
-
invalidates: [[
|
|
87
|
-
},
|
|
88
|
-
mutationFn:
|
|
89
|
-
meta:
|
|
90
|
-
}),
|
|
91
|
-
mutationFn:
|
|
92
|
-
meta:
|
|
93
|
-
}),
|
|
94
|
-
mutationFn:
|
|
95
|
-
meta:
|
|
96
|
-
}),
|
|
97
|
-
mutationFn:
|
|
98
|
-
meta:
|
|
99
|
-
}),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
invalidates: [[y.findFlows.key], [y.findVersions.key]]
|
|
99
|
+
}, Ee = o({
|
|
100
|
+
mutationFn: y.create,
|
|
101
|
+
meta: U
|
|
102
|
+
}), De = o({
|
|
103
|
+
mutationFn: y.update,
|
|
104
|
+
meta: U
|
|
105
|
+
}), Oe = o({
|
|
106
|
+
mutationFn: y.deploy,
|
|
107
|
+
meta: U
|
|
108
|
+
}), ke = o({
|
|
109
|
+
mutationFn: y.publishVersion,
|
|
110
|
+
meta: U
|
|
111
|
+
}), W = l(() => T?.formSchema ? _e(T.formSchema) : null, [T?.formSchema]), G = l(() => T?.formSchema ? ve(T.formSchema, x.registries) : null, [T?.formSchema, x.registries]), K = l(() => T?.basic.businessKind ? B?.formFields : W?.formFields ?? [], [
|
|
112
|
+
T?.basic.businessKind,
|
|
113
|
+
B,
|
|
114
|
+
W
|
|
115
|
+
]), q = l(() => T ? ye(T.flowDefinition, {
|
|
116
|
+
formFields: K,
|
|
117
|
+
businessKind: T.basic.businessKind,
|
|
118
|
+
assigneeKinds: R?.assignees,
|
|
119
|
+
ccKinds: R?.ccs
|
|
103
120
|
}) : [], [
|
|
104
|
-
|
|
121
|
+
T,
|
|
105
122
|
K,
|
|
106
|
-
|
|
107
|
-
]),
|
|
108
|
-
...n(
|
|
109
|
-
shared:
|
|
123
|
+
R
|
|
124
|
+
]), Ae = l(() => ({
|
|
125
|
+
...n(x, K, R),
|
|
126
|
+
shared: M,
|
|
127
|
+
businessKind: T?.basic.businessKind
|
|
110
128
|
}), [
|
|
111
|
-
|
|
129
|
+
x,
|
|
112
130
|
K,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
R,
|
|
132
|
+
M,
|
|
133
|
+
T?.basic.businessKind
|
|
134
|
+
]), je = c((e) => {
|
|
135
|
+
E((t) => {
|
|
136
|
+
if (!t) return t;
|
|
137
|
+
let n = {
|
|
119
138
|
...t.basic,
|
|
120
139
|
...e
|
|
121
|
-
}
|
|
140
|
+
}, r = e.businessKind && e.businessKind !== t.basic.businessKind ? {
|
|
141
|
+
...t.flowDefinition,
|
|
142
|
+
nodes: t.flowDefinition.nodes.map((e) => {
|
|
143
|
+
if (!e.data || e.data.rollbackDataStrategy === void 0) return e;
|
|
144
|
+
let t = structuredClone(e);
|
|
145
|
+
return t.data && delete t.data.rollbackDataStrategy, t;
|
|
146
|
+
})
|
|
147
|
+
} : t.flowDefinition;
|
|
148
|
+
return {
|
|
149
|
+
...t,
|
|
150
|
+
basic: n,
|
|
151
|
+
flowDefinition: r
|
|
152
|
+
};
|
|
122
153
|
});
|
|
123
|
-
}, []),
|
|
124
|
-
|
|
154
|
+
}, []), Me = c((e) => {
|
|
155
|
+
E((t) => t && {
|
|
125
156
|
...t,
|
|
126
157
|
initiators: e
|
|
127
158
|
});
|
|
128
|
-
}, []),
|
|
129
|
-
|
|
159
|
+
}, []), Ne = c((e) => {
|
|
160
|
+
E((t) => t && {
|
|
130
161
|
...t,
|
|
131
162
|
formSchema: e
|
|
132
163
|
});
|
|
133
|
-
}, []),
|
|
134
|
-
|
|
164
|
+
}, []), Pe = c((e) => {
|
|
165
|
+
E((t) => t && {
|
|
135
166
|
...t,
|
|
136
167
|
flowDefinition: e
|
|
137
168
|
});
|
|
138
169
|
}, []);
|
|
139
|
-
if (
|
|
170
|
+
if (T === null) return /* @__PURE__ */ m(p, {
|
|
140
171
|
align: "center",
|
|
141
172
|
justify: "center",
|
|
142
173
|
style: { height: "100%" },
|
|
143
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ m(fe, {})
|
|
144
175
|
});
|
|
145
|
-
let
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
176
|
+
let J = T, { basic: Y } = J, X = be(Y.initiationWindow), Z = K && le(Y.instanceTitleTemplate, K), Q = te(Y, V, H), $ = [
|
|
177
|
+
!Q && !X && Y.code.trim() !== "" && Y.name.trim() !== "" && Y.categoryId !== "" && Y.instanceTitleTemplate.trim() !== "" && (!Y.businessKind || B !== void 0 && !Z) && (!Y.businessBinding || !!(B && ce(Y.businessBinding))) && (Y.isAllInitiationAllowed || a(T).length > 0),
|
|
178
|
+
!!B || !Z && (G === null || G.valid),
|
|
179
|
+
q.length === 0,
|
|
149
180
|
!0
|
|
150
|
-
][
|
|
151
|
-
"请先完善流程设置中的必填项",
|
|
152
|
-
|
|
153
|
-
`流程存在 ${
|
|
181
|
+
][C] ?? !1, Fe = G?.issues.filter((e) => e.severity === "error").length ?? 0, Ie = [
|
|
182
|
+
Q ?? X ?? (Y.businessKind && Z ? `单据标题引用的字段「${Z}」不在业务字段目录中` : "请先完善流程设置中的必填项"),
|
|
183
|
+
Z ? `单据标题引用的字段「${Z}」不在表单中` : `表单存在 ${Fe} 个错误,可在编辑器底部的问题提示中查看并定位`,
|
|
184
|
+
`流程存在 ${q.length} 个问题,可在画布工具栏的问题提示中查看并定位`,
|
|
154
185
|
void 0
|
|
155
|
-
],
|
|
156
|
-
async function
|
|
157
|
-
|
|
186
|
+
], Le = $ ? void 0 : Ie[C];
|
|
187
|
+
async function Re() {
|
|
188
|
+
A(!0);
|
|
158
189
|
try {
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
tenantId:
|
|
162
|
-
isShared:
|
|
163
|
-
code:
|
|
164
|
-
name:
|
|
165
|
-
categoryId:
|
|
166
|
-
icon:
|
|
167
|
-
description:
|
|
168
|
-
labels:
|
|
169
|
-
|
|
170
|
-
businessBinding:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
let { businessKind: e, businessBinding: t } = Y, n = a(J), r;
|
|
191
|
+
r = J.flowId === void 0 ? (await Ee.mutateAsync({
|
|
192
|
+
tenantId: Y.tenantId,
|
|
193
|
+
isShared: Y.isShared,
|
|
194
|
+
code: Y.code,
|
|
195
|
+
name: Y.name,
|
|
196
|
+
categoryId: Y.categoryId,
|
|
197
|
+
icon: Y.icon,
|
|
198
|
+
description: Y.description,
|
|
199
|
+
labels: Y.labels,
|
|
200
|
+
businessKind: e,
|
|
201
|
+
businessBinding: t,
|
|
202
|
+
voidPolicy: Y.voidPolicy ?? "disabled",
|
|
203
|
+
voidFlowCode: Y.voidFlowCode,
|
|
204
|
+
adminUserIds: Y.adminUserIds,
|
|
205
|
+
isAllInitiationAllowed: Y.isAllInitiationAllowed,
|
|
206
|
+
instanceTitleTemplate: Y.instanceTitleTemplate,
|
|
207
|
+
initiators: n,
|
|
208
|
+
initiationWindow: Y.initiationWindow ?? null
|
|
209
|
+
})).id : (await De.mutateAsync({
|
|
210
|
+
flowId: J.flowId,
|
|
211
|
+
name: Y.name,
|
|
212
|
+
icon: Y.icon,
|
|
213
|
+
description: Y.description,
|
|
214
|
+
labels: Y.labels,
|
|
215
|
+
businessKind: e,
|
|
216
|
+
businessBinding: t,
|
|
217
|
+
voidPolicy: Y.voidPolicy ?? "disabled",
|
|
218
|
+
voidFlowCode: Y.voidFlowCode,
|
|
219
|
+
adminUserIds: Y.adminUserIds,
|
|
220
|
+
isAllInitiationAllowed: Y.isAllInitiationAllowed,
|
|
221
|
+
instanceTitleTemplate: Y.instanceTitleTemplate,
|
|
222
|
+
initiators: n,
|
|
223
|
+
initiationWindow: Y.initiationWindow ?? null
|
|
187
224
|
})).id;
|
|
188
|
-
let
|
|
189
|
-
flowId:
|
|
190
|
-
description:
|
|
191
|
-
storageMode:
|
|
192
|
-
flowDefinition:
|
|
193
|
-
formSchema:
|
|
225
|
+
let i = await Oe.mutateAsync({
|
|
226
|
+
flowId: r,
|
|
227
|
+
description: D.trim() || void 0,
|
|
228
|
+
storageMode: e ? "json" : J.storageMode,
|
|
229
|
+
flowDefinition: J.flowDefinition,
|
|
230
|
+
formSchema: e ? void 0 : J.formSchema ?? void 0
|
|
194
231
|
});
|
|
195
|
-
|
|
232
|
+
O && await ke.mutateAsync({ versionId: i.id }), ge(O ? "流程已部署并发布" : "流程已部署为草稿版本"), v();
|
|
196
233
|
} catch {} finally {
|
|
197
|
-
|
|
234
|
+
A(!1);
|
|
198
235
|
}
|
|
199
236
|
}
|
|
200
|
-
let
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
basic:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
237
|
+
let ze = [
|
|
238
|
+
/* @__PURE__ */ m(ne, {
|
|
239
|
+
basic: Y,
|
|
240
|
+
businessKinds: z,
|
|
241
|
+
businessKindsError: Te?.message,
|
|
242
|
+
categoryOptions: Ce,
|
|
243
|
+
initiatorKinds: R?.initiators,
|
|
244
|
+
initiators: T.initiators,
|
|
245
|
+
isEditing: S,
|
|
246
|
+
isVoidable: V,
|
|
247
|
+
loadingBusinessKinds: we,
|
|
248
|
+
selectedVoidFlow: H,
|
|
249
|
+
onBasicChange: je,
|
|
250
|
+
onInitiatorsChange: Me
|
|
209
251
|
}, "basic"),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
252
|
+
Y.businessKind ? /* @__PURE__ */ m(re, {
|
|
253
|
+
fields: B?.formFields ?? [],
|
|
254
|
+
title: "业务字段目录"
|
|
255
|
+
}, "catalog") : /* @__PURE__ */ m(ae, {
|
|
256
|
+
initialSchema: T.formSchema ?? void 0,
|
|
257
|
+
registries: x.registries,
|
|
258
|
+
storageMode: T.storageMode,
|
|
259
|
+
onSchemaChange: Ne,
|
|
260
|
+
onStorageModeChange: (e) => E((t) => t && {
|
|
216
261
|
...t,
|
|
217
262
|
storageMode: e
|
|
218
263
|
})
|
|
219
264
|
}, "form"),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
plugins:
|
|
222
|
-
value:
|
|
223
|
-
onChange:
|
|
265
|
+
/* @__PURE__ */ m(ie, {
|
|
266
|
+
plugins: Ae,
|
|
267
|
+
value: T.flowDefinition,
|
|
268
|
+
onChange: Pe
|
|
224
269
|
}, "flow"),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
270
|
+
/* @__PURE__ */ m(ue, {
|
|
271
|
+
businessKindLabel: B?.label,
|
|
272
|
+
draft: T,
|
|
273
|
+
fields: B?.formFields ?? W?.fields ?? [],
|
|
274
|
+
publishNow: O,
|
|
275
|
+
versionDescription: D,
|
|
276
|
+
onPublishNowChange: Se,
|
|
277
|
+
onVersionDescriptionChange: xe
|
|
232
278
|
}, "review")
|
|
233
279
|
];
|
|
234
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ h(p, {
|
|
235
281
|
style: {
|
|
236
282
|
height: "100%",
|
|
237
283
|
flexDirection: "column"
|
|
238
284
|
},
|
|
239
285
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ m("div", {
|
|
241
287
|
style: {
|
|
242
288
|
padding: "12px 32px",
|
|
243
289
|
borderBottom: "1px solid var(--vef-color-border-secondary)"
|
|
244
290
|
},
|
|
245
|
-
children: /* @__PURE__ */
|
|
246
|
-
current:
|
|
247
|
-
items:
|
|
291
|
+
children: /* @__PURE__ */ m(pe, {
|
|
292
|
+
current: C,
|
|
293
|
+
items: g.map((e, t) => t === 1 && Y.businessKind ? { title: "字段目录" } : e),
|
|
248
294
|
size: "small",
|
|
249
295
|
style: {
|
|
250
296
|
maxWidth: 720,
|
|
@@ -252,16 +298,16 @@ function x({ flow: m, tenantId: x, onClose: S }) {
|
|
|
252
298
|
}
|
|
253
299
|
})
|
|
254
300
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ m("div", {
|
|
256
302
|
style: {
|
|
257
303
|
flex: 1,
|
|
258
304
|
minHeight: 0,
|
|
259
305
|
display: "flex",
|
|
260
306
|
flexDirection: "column"
|
|
261
307
|
},
|
|
262
|
-
children:
|
|
263
|
-
let n = t ===
|
|
264
|
-
return /* @__PURE__ */
|
|
308
|
+
children: ze.map((e, t) => {
|
|
309
|
+
let n = t === C, r = t === 0 || t === 3 || t === 1 && !!Y.businessKind;
|
|
310
|
+
return /* @__PURE__ */ m("div", {
|
|
265
311
|
style: {
|
|
266
312
|
display: n ? "flex" : "none",
|
|
267
313
|
flexDirection: "column",
|
|
@@ -274,42 +320,42 @@ function x({ flow: m, tenantId: x, onClose: S }) {
|
|
|
274
320
|
}, t);
|
|
275
321
|
})
|
|
276
322
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ h(p, {
|
|
278
324
|
align: "center",
|
|
279
325
|
justify: "space-between",
|
|
280
326
|
style: {
|
|
281
327
|
padding: "12px 32px",
|
|
282
328
|
borderTop: "1px solid var(--vef-color-border-secondary)"
|
|
283
329
|
},
|
|
284
|
-
children: [/* @__PURE__ */
|
|
285
|
-
disabled:
|
|
286
|
-
onClick: () =>
|
|
330
|
+
children: [/* @__PURE__ */ m(d, {
|
|
331
|
+
disabled: C === 0 || k,
|
|
332
|
+
onClick: () => w((e) => e - 1),
|
|
287
333
|
children: "上一步"
|
|
288
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ h(p, {
|
|
289
335
|
align: "center",
|
|
290
336
|
gap: "middle",
|
|
291
|
-
children: [
|
|
292
|
-
style: { fontSize:
|
|
337
|
+
children: [Le === void 0 ? null : /* @__PURE__ */ m(me, {
|
|
338
|
+
style: { fontSize: he.fontSizeSm },
|
|
293
339
|
type: "danger",
|
|
294
|
-
children:
|
|
295
|
-
}),
|
|
296
|
-
disabled:
|
|
340
|
+
children: Le
|
|
341
|
+
}), C < g.length - 1 ? /* @__PURE__ */ m(d, {
|
|
342
|
+
disabled: !$,
|
|
297
343
|
type: "primary",
|
|
298
|
-
onClick: () =>
|
|
344
|
+
onClick: () => w((e) => e + 1),
|
|
299
345
|
children: "下一步"
|
|
300
|
-
}) : /* @__PURE__ */
|
|
301
|
-
loading:
|
|
346
|
+
}) : /* @__PURE__ */ m(d, {
|
|
347
|
+
loading: k,
|
|
302
348
|
type: "primary",
|
|
303
|
-
onClick: () => void
|
|
304
|
-
children:
|
|
349
|
+
onClick: () => void Re(),
|
|
350
|
+
children: O ? "部署并发布" : "部署为草稿"
|
|
305
351
|
})]
|
|
306
352
|
})]
|
|
307
353
|
})
|
|
308
354
|
]
|
|
309
355
|
});
|
|
310
356
|
}
|
|
311
|
-
function
|
|
312
|
-
return /* @__PURE__ */
|
|
357
|
+
function v({ open: e, flow: t, tenantId: n, onClose: r }) {
|
|
358
|
+
return /* @__PURE__ */ m(f, {
|
|
313
359
|
destroyOnHidden: !0,
|
|
314
360
|
open: e,
|
|
315
361
|
placement: "right",
|
|
@@ -317,7 +363,7 @@ function S({ open: e, flow: t, tenantId: n, onClose: r }) {
|
|
|
317
363
|
styles: { body: { padding: 0 } },
|
|
318
364
|
title: t ? `流程设计 · ${t.name}` : "新建流程",
|
|
319
365
|
onClose: r,
|
|
320
|
-
children: e && /* @__PURE__ */ _
|
|
366
|
+
children: e && /* @__PURE__ */ m(_, {
|
|
321
367
|
flow: t,
|
|
322
368
|
tenantId: n,
|
|
323
369
|
onClose: r
|
|
@@ -325,4 +371,4 @@ function S({ open: e, flow: t, tenantId: n, onClose: r }) {
|
|
|
325
371
|
});
|
|
326
372
|
}
|
|
327
373
|
//#endregion
|
|
328
|
-
export {
|
|
374
|
+
export { v as FlowDesignerDrawer };
|