@vef-framework-react/approval 2.30.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/cjs/api/admin-api.cjs +1 -1
  2. package/dist/cjs/api/flow-api.cjs +1 -1
  3. package/dist/cjs/api/instance-api.cjs +1 -1
  4. package/dist/cjs/api/my-api.cjs +1 -1
  5. package/dist/cjs/components/action-dialog/index.cjs +1 -1
  6. package/dist/cjs/components/action-dialog/user-selection.cjs +1 -0
  7. package/dist/cjs/components/annotations/composers.cjs +1 -0
  8. package/dist/cjs/components/annotations/field-anchor.cjs +1 -0
  9. package/dist/cjs/components/annotations/index.cjs +1 -0
  10. package/dist/cjs/components/annotations/use-annotations.cjs +1 -0
  11. package/dist/cjs/components/business-form.cjs +1 -0
  12. package/dist/cjs/components/capped-modal.cjs +1 -0
  13. package/dist/cjs/components/detail/action-modals.cjs +1 -1
  14. package/dist/cjs/components/detail/admin.cjs +1 -1
  15. package/dist/cjs/components/detail/index.cjs +1 -1
  16. package/dist/cjs/components/flow-graph/node.cjs +1 -1
  17. package/dist/cjs/components/flow-graph/people-overlay.cjs +1 -1
  18. package/dist/cjs/components/form-panel/index.cjs +1 -1
  19. package/dist/cjs/components/format.cjs +1 -1
  20. package/dist/cjs/components/index.cjs +1 -1
  21. package/dist/cjs/components/instance-list-title.cjs +1 -0
  22. package/dist/cjs/components/principal/index.cjs +1 -1
  23. package/dist/cjs/components/status/colors.cjs +1 -1
  24. package/dist/cjs/components/status/index.cjs +1 -1
  25. package/dist/cjs/components/status/labels.cjs +1 -1
  26. package/dist/cjs/components/timeline/index.cjs +1 -1
  27. package/dist/cjs/components/user/index.cjs +1 -1
  28. package/dist/cjs/components/void/direct-dialog.cjs +1 -0
  29. package/dist/cjs/components/void/form.cjs +1 -0
  30. package/dist/cjs/components/void/request-renderer.cjs +1 -0
  31. package/dist/cjs/components/void/summary.cjs +1 -0
  32. package/dist/cjs/components/void/use-refresh.cjs +1 -0
  33. package/dist/cjs/index.cjs +1 -1
  34. package/dist/cjs/pages/admin-page/apply-handovers.cjs +1 -0
  35. package/dist/cjs/pages/admin-page/index.cjs +1 -1
  36. package/dist/cjs/pages/admin-page/instances.cjs +1 -1
  37. package/dist/cjs/pages/admin-page/metrics.cjs +1 -1
  38. package/dist/cjs/pages/admin-page/tasks.cjs +1 -1
  39. package/dist/cjs/pages/category-page/index.cjs +1 -1
  40. package/dist/cjs/pages/delegation-page/index.cjs +1 -1
  41. package/dist/cjs/pages/flow-page/columns.cjs +1 -1
  42. package/dist/cjs/pages/flow-page/designer/basic-step.cjs +1 -1
  43. package/dist/cjs/pages/flow-page/designer/field-catalog.cjs +1 -0
  44. package/dist/cjs/pages/flow-page/designer/form-step.cjs +1 -1
  45. package/dist/cjs/pages/flow-page/designer/index.cjs +1 -1
  46. package/dist/cjs/pages/flow-page/designer/review-step.cjs +1 -1
  47. package/dist/cjs/pages/flow-page/designer/types.cjs +1 -1
  48. package/dist/cjs/pages/flow-page/designer/void-policy.cjs +1 -0
  49. package/dist/cjs/pages/flow-page/index.cjs +1 -1
  50. package/dist/cjs/pages/index.cjs +1 -1
  51. package/dist/cjs/pages/initiate-page/index.cjs +1 -1
  52. package/dist/cjs/pages/initiate-page/start-drawer.cjs +1 -1
  53. package/dist/cjs/pages/my-instances-page/index.cjs +1 -1
  54. package/dist/cjs/pages/task-center-page/index.cjs +1 -1
  55. package/dist/cjs/permissions.cjs +1 -1
  56. package/dist/cjs/plugins/index.cjs +1 -1
  57. package/dist/cjs/types/annotation.cjs +1 -0
  58. package/dist/cjs/types/detail.cjs +1 -0
  59. package/dist/cjs/types/enums.cjs +1 -1
  60. package/dist/cjs/types/index.cjs +1 -1
  61. package/dist/cjs/types/void.cjs +1 -0
  62. package/dist/es/api/admin-api.js +5 -2
  63. package/dist/es/api/category-api.js +1 -1
  64. package/dist/es/api/delegation-api.js +1 -1
  65. package/dist/es/api/flow-api.js +19 -15
  66. package/dist/es/api/index.js +1 -1
  67. package/dist/es/api/instance-api.js +3 -1
  68. package/dist/es/api/my-api.js +2 -1
  69. package/dist/es/api/query.js +1 -1
  70. package/dist/es/components/action-dialog/index.js +64 -41
  71. package/dist/es/components/action-dialog/user-selection.js +48 -0
  72. package/dist/es/components/annotations/composers.js +231 -0
  73. package/dist/es/components/annotations/field-anchor.js +18 -0
  74. package/dist/es/components/annotations/index.js +271 -0
  75. package/dist/es/components/annotations/use-annotations.js +77 -0
  76. package/dist/es/components/business-form.js +36 -0
  77. package/dist/es/components/capped-modal.js +27 -0
  78. package/dist/es/components/detail/action-modals.js +120 -132
  79. package/dist/es/components/detail/admin.js +109 -74
  80. package/dist/es/components/detail/drawer.js +1 -1
  81. package/dist/es/components/detail/index.js +298 -233
  82. package/dist/es/components/flow-graph/index.js +1 -1
  83. package/dist/es/components/flow-graph/node.js +26 -26
  84. package/dist/es/components/flow-graph/people-overlay.js +104 -100
  85. package/dist/es/components/flow-graph/people.js +1 -1
  86. package/dist/es/components/form-panel/index.js +10 -9
  87. package/dist/es/components/format.js +7 -4
  88. package/dist/es/components/icon.js +1 -1
  89. package/dist/es/components/index.js +11 -8
  90. package/dist/es/components/instance-list-title.js +31 -0
  91. package/dist/es/components/principal/index.js +4 -2
  92. package/dist/es/components/status/colors.js +3 -2
  93. package/dist/es/components/status/index.js +14 -14
  94. package/dist/es/components/status/labels.js +7 -3
  95. package/dist/es/components/timeline/index.js +79 -69
  96. package/dist/es/components/user/index.js +32 -25
  97. package/dist/es/components/void/direct-dialog.js +62 -0
  98. package/dist/es/components/void/form.js +100 -0
  99. package/dist/es/components/void/request-renderer.js +91 -0
  100. package/dist/es/components/void/summary.js +142 -0
  101. package/dist/es/components/void/use-refresh.js +22 -0
  102. package/dist/es/index.js +33 -27
  103. package/dist/es/pages/admin-page/apply-handovers.js +185 -0
  104. package/dist/es/pages/admin-page/index.js +50 -43
  105. package/dist/es/pages/admin-page/instances.js +50 -52
  106. package/dist/es/pages/admin-page/metrics.js +34 -33
  107. package/dist/es/pages/admin-page/projections.js +1 -1
  108. package/dist/es/pages/admin-page/tasks.js +59 -57
  109. package/dist/es/pages/category-page/columns.js +1 -1
  110. package/dist/es/pages/category-page/form.js +1 -1
  111. package/dist/es/pages/category-page/index.js +21 -21
  112. package/dist/es/pages/delegation-page/columns.js +1 -1
  113. package/dist/es/pages/delegation-page/form.js +1 -1
  114. package/dist/es/pages/delegation-page/index.js +19 -19
  115. package/dist/es/pages/flow-page/columns.js +6 -6
  116. package/dist/es/pages/flow-page/designer/basic-step.js +202 -146
  117. package/dist/es/pages/flow-page/designer/field-catalog.js +47 -0
  118. package/dist/es/pages/flow-page/designer/flow-step.js +1 -1
  119. package/dist/es/pages/flow-page/designer/form-step.js +14 -14
  120. package/dist/es/pages/flow-page/designer/index.js +248 -202
  121. package/dist/es/pages/flow-page/designer/review-step.js +38 -60
  122. package/dist/es/pages/flow-page/designer/types.js +13 -5
  123. package/dist/es/pages/flow-page/designer/void-policy.js +135 -0
  124. package/dist/es/pages/flow-page/index.js +18 -18
  125. package/dist/es/pages/flow-page/search.js +1 -1
  126. package/dist/es/pages/flow-page/versions.js +1 -1
  127. package/dist/es/pages/index.js +9 -9
  128. package/dist/es/pages/initiate-page/index.js +133 -86
  129. package/dist/es/pages/initiate-page/start-drawer.js +153 -64
  130. package/dist/es/pages/my-instances-page/index.js +57 -77
  131. package/dist/es/pages/task-center-page/index.js +73 -68
  132. package/dist/es/pages/task-center-page/search.js +1 -1
  133. package/dist/es/permissions.js +6 -3
  134. package/dist/es/plugins/form-context.js +1 -1
  135. package/dist/es/plugins/index.js +32 -21
  136. package/dist/es/types/annotation.js +18 -0
  137. package/dist/es/types/detail.js +7 -0
  138. package/dist/es/types/enums.js +3 -2
  139. package/dist/es/types/index.js +6 -3
  140. package/dist/es/types/void.js +5 -0
  141. package/dist/types/api/admin-api.d.ts +4 -1
  142. package/dist/types/api/flow-api.d.ts +4 -2
  143. package/dist/types/api/instance-api.d.ts +5 -1
  144. package/dist/types/api/my-api.d.ts +2 -1
  145. package/dist/types/components/action-dialog/index.d.ts +8 -2
  146. package/dist/types/components/action-dialog/user-selection.d.ts +18 -0
  147. package/dist/types/components/annotations/composers.d.ts +14 -0
  148. package/dist/types/components/annotations/field-anchor.d.ts +3 -0
  149. package/dist/types/components/annotations/index.d.ts +22 -0
  150. package/dist/types/components/annotations/use-annotations.d.ts +24 -0
  151. package/dist/types/components/business-form.d.ts +14 -0
  152. package/dist/types/components/capped-modal.d.ts +2 -0
  153. package/dist/types/components/detail/admin.d.ts +2 -1
  154. package/dist/types/components/form-panel/index.d.ts +3 -2
  155. package/dist/types/components/format.d.ts +1 -0
  156. package/dist/types/components/index.d.ts +1 -0
  157. package/dist/types/components/instance-list-title.d.ts +5 -0
  158. package/dist/types/components/timeline/index.d.ts +3 -1
  159. package/dist/types/components/user/index.d.ts +4 -0
  160. package/dist/types/components/void/direct-dialog.d.ts +8 -0
  161. package/dist/types/components/void/form.d.ts +27 -0
  162. package/dist/types/components/void/request-renderer.d.ts +3 -0
  163. package/dist/types/components/void/summary.d.ts +16 -0
  164. package/dist/types/components/void/use-refresh.d.ts +4 -0
  165. package/dist/types/index.d.ts +2 -2
  166. package/dist/types/pages/admin-page/apply-handovers.d.ts +3 -0
  167. package/dist/types/pages/admin-page/index.d.ts +2 -0
  168. package/dist/types/pages/admin-page/instances.d.ts +2 -1
  169. package/dist/types/pages/flow-page/designer/basic-step.d.ts +7 -2
  170. package/dist/types/pages/flow-page/designer/field-catalog.d.ts +5 -0
  171. package/dist/types/pages/flow-page/designer/review-step.d.ts +2 -1
  172. package/dist/types/pages/flow-page/designer/types.d.ts +13 -2
  173. package/dist/types/pages/flow-page/designer/void-policy.d.ts +14 -0
  174. package/dist/types/pages/initiate-page/start-drawer.d.ts +7 -1
  175. package/dist/types/permissions.d.ts +8 -0
  176. package/dist/types/plugins/index.d.ts +28 -3
  177. package/dist/types/types/admin.d.ts +27 -0
  178. package/dist/types/types/annotation.d.ts +60 -0
  179. package/dist/types/types/detail.d.ts +8 -1
  180. package/dist/types/types/enums.d.ts +5 -10
  181. package/dist/types/types/flow.d.ts +25 -5
  182. package/dist/types/types/index.d.ts +3 -1
  183. package/dist/types/types/instance.d.ts +1 -2
  184. package/dist/types/types/my.d.ts +16 -0
  185. package/dist/types/types/void.d.ts +58 -0
  186. package/package.json +8 -7
@@ -1,10 +1,10 @@
1
- /*! @vef-framework-react/approval v2.30.0 made by Venus | 2026-10-16T04:17:33.743Z */
2
- import { useApprovalPlugins as e } from "../../../plugins/index.js";
3
- import { toFormContextSources as t } from "../../../plugins/form-context.js";
1
+ /*! @vef-framework-react/approval v2.31.0 made by Venus | 2026-11-19T01:43:39.549Z */
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 { validateApprovalProjection as c } from "@vef-framework-react/approval-form-bridge";
7
- import { jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
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 } = e(), T = n(() => t(w), [w]);
26
- return /* @__PURE__ */ u(a, {
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__ */ u(r, {
32
+ children: [/* @__PURE__ */ l(r, {
33
33
  align: "center",
34
34
  gap: "middle",
35
35
  wrap: "wrap",
36
36
  children: [
37
- /* @__PURE__ */ l(o, {
37
+ /* @__PURE__ */ c(o, {
38
38
  type: "secondary",
39
39
  children: "存储模式"
40
40
  }),
41
- /* @__PURE__ */ l(i, {
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__ */ l(o, {
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__ */ l("div", {
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__ */ l(d, {
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: c,
70
+ validate: u,
71
71
  onSchemaChange: y
72
72
  })
73
73
  })]
@@ -1,250 +1,296 @@
1
- /*! @vef-framework-react/approval v2.30.0 made by Venus | 2026-10-16T04:17:33.743Z */
1
+ /*! @vef-framework-react/approval v2.31.0 made by Venus | 2026-11-19T01:43:39.549Z */
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 ee } from "../../category-page/form.js";
6
- import { BasicStep as i } from "./basic-step.js";
7
- import { FlowStep as a } from "./flow-step.js";
8
- import { FormStep as o } from "./form-step.js";
9
- import { EMPTY_FLOW_DEFINITION as te, createEmptyDraft as ne, initiatorsForSubmit as s, isBindingValid as re } from "./types.js";
10
- import { ReviewStep as ie } from "./review-step.js";
11
- import { useMutation as c, useQuery as l } from "@vef-framework-react/core";
12
- import { useCallback as u, useEffect as ae, useMemo as d, useState as f } from "react";
13
- import { Button as p, Drawer as m, Flex as h, Spin as oe, Steps as se, Text as ce, globalCssVars as le, showSuccessMessage as ue } from "@vef-framework-react/components";
14
- import { projectFormSchema as de, validateApprovalSchema as g } from "@vef-framework-react/approval-form-bridge";
15
- import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
16
- import { validateFlowDefinition as y } from "@vef-framework-react/approval-flow-editor";
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 b = [
22
+ var g = [
19
23
  { title: "流程设置" },
20
24
  { title: "表单设计" },
21
25
  { title: "流程设计" },
22
26
  { title: "审阅提交" }
23
27
  ];
24
- function x({ flow: m, tenantId: x, onClose: S }) {
25
- let C = t(), w = e(), T = r(), E = m !== void 0, [D, O] = f(0), [k, A] = f(() => E ? null : ne(x)), [j, fe] = f(""), [M, N] = f(!0), [P, F] = f(!1), I = m?.tenantId ?? x, L = m?.isShared ?? k?.basic.isShared ?? !1, { data: R } = l({
26
- queryFn: w.findTree,
27
- queryKey: [w.findTree.key, { tenantId: I }]
28
- }), z = d(() => ee(R ?? []), [R]), { data: B } = l({
29
- queryFn: C.findVersions,
30
- queryKey: [C.findVersions.key, { flowId: m?.id ?? "" }],
31
- enabled: E
32
- }), V = B?.[0]?.id, { data: H } = l({
33
- queryFn: C.getGraph,
34
- queryKey: [C.getGraph.key, {
35
- flowId: m?.id ?? "",
36
- versionId: V ?? ""
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: E && V !== void 0
39
- }), { data: U } = l({
40
- queryFn: C.findInitiators,
41
- queryKey: [C.findInitiators.key, { flowId: m?.id ?? "" }],
42
- enabled: E
43
- }), { data: W } = l({
44
- queryFn: C.listKindOptions,
45
- queryKey: [C.listKindOptions.key, {}],
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
- ae(() => {
49
- if (!E || k !== null || B === void 0 || U === void 0 || B.length > 0 && H === void 0) return;
50
- let e = H?.version ?? null;
51
- A({
52
- flowId: m.id,
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: m.tenantId,
55
- isShared: m.isShared,
56
- code: m.code,
57
- name: m.name,
58
- categoryId: m.categoryId,
59
- icon: m.icon ?? void 0,
60
- description: m.description ?? void 0,
61
- labels: m.labels ?? {},
62
- bindingMode: m.bindingMode,
63
- businessBinding: m.businessBinding ?? void 0,
64
- adminUserIds: m.adminUserIds,
65
- isAllInitiationAllowed: m.isAllInitiationAllowed,
66
- instanceTitleTemplate: m.instanceTitleTemplate
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: U.map((e) => ({
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 ?? te
86
+ flowDefinition: e?.flowSchema ?? oe
75
87
  });
76
88
  }, [
77
- E,
78
- k,
79
- B,
80
- H,
81
- U,
82
- m
89
+ S,
90
+ T,
91
+ P,
92
+ I,
93
+ L,
94
+ f
83
95
  ]);
84
- let G = {
96
+ let U = {
85
97
  shouldShowSuccessFeedback: !1,
86
- invalidates: [[C.findFlows.key], [C.findVersions.key]]
87
- }, pe = c({
88
- mutationFn: C.create,
89
- meta: G
90
- }), me = c({
91
- mutationFn: C.update,
92
- meta: G
93
- }), he = c({
94
- mutationFn: C.deploy,
95
- meta: G
96
- }), ge = c({
97
- mutationFn: C.publishVersion,
98
- meta: G
99
- }), K = d(() => k?.formSchema ? de(k.formSchema) : null, [k?.formSchema]), q = d(() => k?.formSchema ? g(k.formSchema, T.registries) : null, [k?.formSchema, T.registries]), J = d(() => k ? y(k.flowDefinition, {
100
- formFields: K?.formFields ?? [],
101
- assigneeKinds: W?.assignees,
102
- ccKinds: W?.ccs
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
- k,
121
+ T,
105
122
  K,
106
- W
107
- ]), _e = d(() => ({
108
- ...n(T, K?.formFields ?? [], W),
109
- shared: L
123
+ R
124
+ ]), Ae = l(() => ({
125
+ ...n(x, K, R),
126
+ shared: M,
127
+ businessKind: T?.basic.businessKind
110
128
  }), [
111
- T,
129
+ x,
112
130
  K,
113
- W,
114
- L
115
- ]), ve = u((e) => {
116
- A((t) => t && {
117
- ...t,
118
- basic: {
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
- }, []), ye = u((e) => {
124
- A((t) => t && {
154
+ }, []), Me = c((e) => {
155
+ E((t) => t && {
125
156
  ...t,
126
157
  initiators: e
127
158
  });
128
- }, []), be = u((e) => {
129
- A((t) => t && {
159
+ }, []), Ne = c((e) => {
160
+ E((t) => t && {
130
161
  ...t,
131
162
  formSchema: e
132
163
  });
133
- }, []), Y = u((e) => {
134
- A((t) => t && {
164
+ }, []), Pe = c((e) => {
165
+ E((t) => t && {
135
166
  ...t,
136
167
  flowDefinition: e
137
168
  });
138
169
  }, []);
139
- if (k === null) return /* @__PURE__ */ _(h, {
170
+ if (T === null) return /* @__PURE__ */ m(p, {
140
171
  align: "center",
141
172
  justify: "center",
142
173
  style: { height: "100%" },
143
- children: /* @__PURE__ */ _(oe, {})
174
+ children: /* @__PURE__ */ m(fe, {})
144
175
  });
145
- let X = k, { basic: Z } = X, Q = [
146
- Z.code.trim() !== "" && Z.name.trim() !== "" && Z.categoryId !== "" && Z.instanceTitleTemplate.trim() !== "" && (Z.bindingMode !== "business" || re(Z.businessBinding)) && (Z.isAllInitiationAllowed || s(k).length > 0),
147
- q === null || q.valid,
148
- J.length === 0,
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
- ][D] ?? !1, xe = [
151
- "请先完善流程设置中的必填项",
152
- `表单存在 ${q?.issues.filter((e) => e.severity === "error").length ?? 0} 个错误,可在编辑器底部的问题提示中查看并定位`,
153
- `流程存在 ${J.length} 个问题,可在画布工具栏的问题提示中查看并定位`,
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
- ], $ = Q ? void 0 : xe[D];
156
- async function Se() {
157
- F(!0);
186
+ ], Le = $ ? void 0 : Ie[C];
187
+ async function Re() {
188
+ A(!0);
158
189
  try {
159
- let e = Z.bindingMode === "business" ? Z.businessBinding : void 0, t = s(X), n;
160
- n = X.flowId === void 0 ? (await pe.mutateAsync({
161
- tenantId: Z.tenantId,
162
- isShared: Z.isShared,
163
- code: Z.code,
164
- name: Z.name,
165
- categoryId: Z.categoryId,
166
- icon: Z.icon,
167
- description: Z.description,
168
- labels: Z.labels,
169
- bindingMode: Z.bindingMode,
170
- businessBinding: e,
171
- adminUserIds: Z.adminUserIds,
172
- isAllInitiationAllowed: Z.isAllInitiationAllowed,
173
- instanceTitleTemplate: Z.instanceTitleTemplate,
174
- initiators: t
175
- })).id : (await me.mutateAsync({
176
- flowId: X.flowId,
177
- name: Z.name,
178
- icon: Z.icon,
179
- description: Z.description,
180
- labels: Z.labels,
181
- bindingMode: Z.bindingMode,
182
- businessBinding: e,
183
- adminUserIds: Z.adminUserIds,
184
- isAllInitiationAllowed: Z.isAllInitiationAllowed,
185
- instanceTitleTemplate: Z.instanceTitleTemplate,
186
- initiators: t
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 r = await he.mutateAsync({
189
- flowId: n,
190
- description: j.trim() || void 0,
191
- storageMode: X.storageMode,
192
- flowDefinition: X.flowDefinition,
193
- formSchema: X.formSchema ?? void 0
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
- M && await ge.mutateAsync({ versionId: r.id }), ue(M ? "流程已部署并发布" : "流程已部署为草稿版本"), S();
232
+ O && await ke.mutateAsync({ versionId: i.id }), ge(O ? "流程已部署并发布" : "流程已部署为草稿版本"), v();
196
233
  } catch {} finally {
197
- F(!1);
234
+ A(!1);
198
235
  }
199
236
  }
200
- let Ce = [
201
- /* @__PURE__ */ _(i, {
202
- basic: Z,
203
- categoryOptions: z,
204
- initiatorKinds: W?.initiators,
205
- initiators: k.initiators,
206
- isEditing: E,
207
- onBasicChange: ve,
208
- onInitiatorsChange: ye
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__ */ _(o, {
211
- initialSchema: k.formSchema ?? void 0,
212
- registries: T.registries,
213
- storageMode: k.storageMode,
214
- onSchemaChange: be,
215
- onStorageModeChange: (e) => A((t) => t && {
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__ */ _(a, {
221
- plugins: _e,
222
- value: k.flowDefinition,
223
- onChange: Y
265
+ /* @__PURE__ */ m(ie, {
266
+ plugins: Ae,
267
+ value: T.flowDefinition,
268
+ onChange: Pe
224
269
  }, "flow"),
225
- /* @__PURE__ */ _(ie, {
226
- draft: k,
227
- fields: K?.fields ?? [],
228
- publishNow: M,
229
- versionDescription: j,
230
- onPublishNowChange: N,
231
- onVersionDescriptionChange: fe
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__ */ v(h, {
280
+ return /* @__PURE__ */ h(p, {
235
281
  style: {
236
282
  height: "100%",
237
283
  flexDirection: "column"
238
284
  },
239
285
  children: [
240
- /* @__PURE__ */ _("div", {
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__ */ _(se, {
246
- current: D,
247
- items: b,
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__ */ _("div", {
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: Ce.map((e, t) => {
263
- let n = t === D, r = t === 0 || t === 3;
264
- return /* @__PURE__ */ _("div", {
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__ */ v(h, {
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__ */ _(p, {
285
- disabled: D === 0 || P,
286
- onClick: () => O((e) => e - 1),
330
+ children: [/* @__PURE__ */ m(d, {
331
+ disabled: C === 0 || k,
332
+ onClick: () => w((e) => e - 1),
287
333
  children: "上一步"
288
- }), /* @__PURE__ */ v(h, {
334
+ }), /* @__PURE__ */ h(p, {
289
335
  align: "center",
290
336
  gap: "middle",
291
- children: [$ === void 0 ? null : /* @__PURE__ */ _(ce, {
292
- style: { fontSize: le.fontSizeSm },
337
+ children: [Le === void 0 ? null : /* @__PURE__ */ m(me, {
338
+ style: { fontSize: he.fontSizeSm },
293
339
  type: "danger",
294
- children: $
295
- }), D < b.length - 1 ? /* @__PURE__ */ _(p, {
296
- disabled: !Q,
340
+ children: Le
341
+ }), C < g.length - 1 ? /* @__PURE__ */ m(d, {
342
+ disabled: !$,
297
343
  type: "primary",
298
- onClick: () => O((e) => e + 1),
344
+ onClick: () => w((e) => e + 1),
299
345
  children: "下一步"
300
- }) : /* @__PURE__ */ _(p, {
301
- loading: P,
346
+ }) : /* @__PURE__ */ m(d, {
347
+ loading: k,
302
348
  type: "primary",
303
- onClick: () => void Se(),
304
- children: M ? "部署并发布" : "部署为草稿"
349
+ onClick: () => void Re(),
350
+ children: O ? "部署并发布" : "部署为草稿"
305
351
  })]
306
352
  })]
307
353
  })
308
354
  ]
309
355
  });
310
356
  }
311
- function S({ open: e, flow: t, tenantId: n, onClose: r }) {
312
- return /* @__PURE__ */ _(m, {
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__ */ _(x, {
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 { S as FlowDesignerDrawer };
374
+ export { v as FlowDesignerDrawer };