@vef-framework-react/approval 2.12.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 (176) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
  3. package/dist/cjs/api/admin-api.cjs +1 -0
  4. package/dist/cjs/api/category-api.cjs +1 -0
  5. package/dist/cjs/api/delegation-api.cjs +1 -0
  6. package/dist/cjs/api/flow-api.cjs +1 -0
  7. package/dist/cjs/api/index.cjs +1 -0
  8. package/dist/cjs/api/instance-api.cjs +1 -0
  9. package/dist/cjs/api/my-api.cjs +1 -0
  10. package/dist/cjs/api/query.cjs +1 -0
  11. package/dist/cjs/components/detail/action-modals.cjs +1 -0
  12. package/dist/cjs/components/detail/admin.cjs +1 -0
  13. package/dist/cjs/components/detail/drawer.cjs +1 -0
  14. package/dist/cjs/components/detail/index.cjs +1 -0
  15. package/dist/cjs/components/flow-graph/index.cjs +1 -0
  16. package/dist/cjs/components/form-panel/index.cjs +1 -0
  17. package/dist/cjs/components/format.cjs +1 -0
  18. package/dist/cjs/components/icon.cjs +1 -0
  19. package/dist/cjs/components/index.cjs +1 -0
  20. package/dist/cjs/components/principal/index.cjs +1 -0
  21. package/dist/cjs/components/status/colors.cjs +1 -0
  22. package/dist/cjs/components/status/index.cjs +1 -0
  23. package/dist/cjs/components/status/labels.cjs +1 -0
  24. package/dist/cjs/components/timeline/index.cjs +1 -0
  25. package/dist/cjs/components/user/index.cjs +1 -0
  26. package/dist/cjs/index.cjs +1 -0
  27. package/dist/cjs/pages/admin-page/index.cjs +1 -0
  28. package/dist/cjs/pages/admin-page/instances.cjs +1 -0
  29. package/dist/cjs/pages/admin-page/metrics.cjs +1 -0
  30. package/dist/cjs/pages/admin-page/projections.cjs +1 -0
  31. package/dist/cjs/pages/admin-page/tasks.cjs +1 -0
  32. package/dist/cjs/pages/category-page/columns.cjs +1 -0
  33. package/dist/cjs/pages/category-page/form.cjs +1 -0
  34. package/dist/cjs/pages/category-page/index.cjs +1 -0
  35. package/dist/cjs/pages/delegation-page/columns.cjs +1 -0
  36. package/dist/cjs/pages/delegation-page/form.cjs +1 -0
  37. package/dist/cjs/pages/delegation-page/index.cjs +1 -0
  38. package/dist/cjs/pages/flow-page/columns.cjs +1 -0
  39. package/dist/cjs/pages/flow-page/designer/basic-step.cjs +1 -0
  40. package/dist/cjs/pages/flow-page/designer/flow-step.cjs +1 -0
  41. package/dist/cjs/pages/flow-page/designer/form-step.cjs +1 -0
  42. package/dist/cjs/pages/flow-page/designer/index.cjs +1 -0
  43. package/dist/cjs/pages/flow-page/designer/review-step.cjs +1 -0
  44. package/dist/cjs/pages/flow-page/designer/types.cjs +1 -0
  45. package/dist/cjs/pages/flow-page/index.cjs +1 -0
  46. package/dist/cjs/pages/flow-page/search.cjs +1 -0
  47. package/dist/cjs/pages/flow-page/versions.cjs +1 -0
  48. package/dist/cjs/pages/index.cjs +1 -0
  49. package/dist/cjs/pages/initiate-page/index.cjs +1 -0
  50. package/dist/cjs/pages/initiate-page/start-drawer.cjs +1 -0
  51. package/dist/cjs/pages/my-instances-page/index.cjs +1 -0
  52. package/dist/cjs/pages/task-center-page/index.cjs +1 -0
  53. package/dist/cjs/permissions.cjs +1 -0
  54. package/dist/cjs/plugins/index.cjs +1 -0
  55. package/dist/cjs/types/enums.cjs +1 -0
  56. package/dist/cjs/types/index.cjs +1 -0
  57. package/dist/es/api/admin-api.js +33 -0
  58. package/dist/es/api/category-api.js +17 -0
  59. package/dist/es/api/delegation-api.js +21 -0
  60. package/dist/es/api/flow-api.js +22 -0
  61. package/dist/es/api/index.js +9 -0
  62. package/dist/es/api/instance-api.js +27 -0
  63. package/dist/es/api/my-api.js +29 -0
  64. package/dist/es/api/query.js +14 -0
  65. package/dist/es/components/detail/action-modals.js +280 -0
  66. package/dist/es/components/detail/admin.js +147 -0
  67. package/dist/es/components/detail/drawer.js +21 -0
  68. package/dist/es/components/detail/index.js +392 -0
  69. package/dist/es/components/flow-graph/index.js +218 -0
  70. package/dist/es/components/form-panel/index.js +23 -0
  71. package/dist/es/components/format.js +16 -0
  72. package/dist/es/components/icon.js +13 -0
  73. package/dist/es/components/index.js +14 -0
  74. package/dist/es/components/principal/index.js +31 -0
  75. package/dist/es/components/status/colors.js +39 -0
  76. package/dist/es/components/status/index.js +41 -0
  77. package/dist/es/components/status/labels.js +94 -0
  78. package/dist/es/components/timeline/index.js +173 -0
  79. package/dist/es/components/user/index.js +64 -0
  80. package/dist/es/index.js +34 -0
  81. package/dist/es/pages/admin-page/index.js +67 -0
  82. package/dist/es/pages/admin-page/instances.js +148 -0
  83. package/dist/es/pages/admin-page/metrics.js +153 -0
  84. package/dist/es/pages/admin-page/projections.js +122 -0
  85. package/dist/es/pages/admin-page/tasks.js +170 -0
  86. package/dist/es/pages/category-page/columns.js +56 -0
  87. package/dist/es/pages/category-page/form.js +106 -0
  88. package/dist/es/pages/category-page/index.js +136 -0
  89. package/dist/es/pages/delegation-page/columns.js +60 -0
  90. package/dist/es/pages/delegation-page/form.js +117 -0
  91. package/dist/es/pages/delegation-page/index.js +122 -0
  92. package/dist/es/pages/flow-page/columns.js +81 -0
  93. package/dist/es/pages/flow-page/designer/basic-step.js +396 -0
  94. package/dist/es/pages/flow-page/designer/flow-step.js +41 -0
  95. package/dist/es/pages/flow-page/designer/form-step.js +87 -0
  96. package/dist/es/pages/flow-page/designer/index.js +294 -0
  97. package/dist/es/pages/flow-page/designer/review-step.js +132 -0
  98. package/dist/es/pages/flow-page/designer/types.js +40 -0
  99. package/dist/es/pages/flow-page/index.js +99 -0
  100. package/dist/es/pages/flow-page/search.js +53 -0
  101. package/dist/es/pages/flow-page/versions.js +94 -0
  102. package/dist/es/pages/index.js +12 -0
  103. package/dist/es/pages/initiate-page/index.js +168 -0
  104. package/dist/es/pages/initiate-page/start-drawer.js +118 -0
  105. package/dist/es/pages/my-instances-page/index.js +223 -0
  106. package/dist/es/pages/task-center-page/index.js +182 -0
  107. package/dist/es/permissions.js +48 -0
  108. package/dist/es/plugins/index.js +34 -0
  109. package/dist/es/types/enums.js +12 -0
  110. package/dist/es/types/index.js +3 -0
  111. package/dist/types/api/admin-api.d.ts +30 -0
  112. package/dist/types/api/category-api.d.ts +17 -0
  113. package/dist/types/api/delegation-api.d.ts +18 -0
  114. package/dist/types/api/flow-api.d.ts +34 -0
  115. package/dist/types/api/index.d.ts +7 -0
  116. package/dist/types/api/instance-api.d.ts +22 -0
  117. package/dist/types/api/my-api.d.ts +29 -0
  118. package/dist/types/api/query.d.ts +15 -0
  119. package/dist/types/components/detail/action-modals.d.ts +82 -0
  120. package/dist/types/components/detail/admin.d.ts +11 -0
  121. package/dist/types/components/detail/drawer.d.ts +17 -0
  122. package/dist/types/components/detail/index.d.ts +36 -0
  123. package/dist/types/components/flow-graph/index.d.ts +17 -0
  124. package/dist/types/components/form-panel/index.d.ts +38 -0
  125. package/dist/types/components/format.d.ts +10 -0
  126. package/dist/types/components/icon.d.ts +15 -0
  127. package/dist/types/components/index.d.ts +12 -0
  128. package/dist/types/components/principal/index.d.ts +18 -0
  129. package/dist/types/components/status/colors.d.ts +13 -0
  130. package/dist/types/components/status/index.d.ts +37 -0
  131. package/dist/types/components/status/labels.d.ts +34 -0
  132. package/dist/types/components/timeline/index.d.ts +11 -0
  133. package/dist/types/components/user/index.d.ts +38 -0
  134. package/dist/types/index.d.ts +9 -0
  135. package/dist/types/pages/admin-page/index.d.ts +31 -0
  136. package/dist/types/pages/admin-page/instances.d.ts +9 -0
  137. package/dist/types/pages/admin-page/metrics.d.ts +9 -0
  138. package/dist/types/pages/admin-page/projections.d.ts +8 -0
  139. package/dist/types/pages/admin-page/tasks.d.ts +7 -0
  140. package/dist/types/pages/category-page/columns.d.ts +3 -0
  141. package/dist/types/pages/category-page/form.d.ts +25 -0
  142. package/dist/types/pages/category-page/index.d.ts +8 -0
  143. package/dist/types/pages/category-page/props.d.ts +24 -0
  144. package/dist/types/pages/delegation-page/columns.d.ts +3 -0
  145. package/dist/types/pages/delegation-page/form.d.ts +6 -0
  146. package/dist/types/pages/delegation-page/index.d.ts +7 -0
  147. package/dist/types/pages/delegation-page/props.d.ts +17 -0
  148. package/dist/types/pages/flow-page/columns.d.ts +12 -0
  149. package/dist/types/pages/flow-page/designer/basic-step.d.ts +20 -0
  150. package/dist/types/pages/flow-page/designer/flow-step.d.ts +16 -0
  151. package/dist/types/pages/flow-page/designer/form-step.d.ts +31 -0
  152. package/dist/types/pages/flow-page/designer/index.d.ts +20 -0
  153. package/dist/types/pages/flow-page/designer/review-step.d.ts +18 -0
  154. package/dist/types/pages/flow-page/designer/types.d.ts +52 -0
  155. package/dist/types/pages/flow-page/index.d.ts +11 -0
  156. package/dist/types/pages/flow-page/props.d.ts +24 -0
  157. package/dist/types/pages/flow-page/search.d.ts +8 -0
  158. package/dist/types/pages/flow-page/versions.d.ts +16 -0
  159. package/dist/types/pages/index.d.ts +8 -0
  160. package/dist/types/pages/initiate-page/index.d.ts +28 -0
  161. package/dist/types/pages/initiate-page/start-drawer.d.ts +23 -0
  162. package/dist/types/pages/my-instances-page/index.d.ts +16 -0
  163. package/dist/types/pages/task-center-page/index.d.ts +17 -0
  164. package/dist/types/permissions.d.ts +68 -0
  165. package/dist/types/plugins/index.d.ts +61 -0
  166. package/dist/types/types/admin.d.ts +185 -0
  167. package/dist/types/types/base.d.ts +36 -0
  168. package/dist/types/types/category.d.ts +37 -0
  169. package/dist/types/types/delegation.d.ts +38 -0
  170. package/dist/types/types/detail.d.ts +129 -0
  171. package/dist/types/types/enums.d.ts +81 -0
  172. package/dist/types/types/flow.d.ts +192 -0
  173. package/dist/types/types/index.d.ts +9 -0
  174. package/dist/types/types/instance.d.ts +83 -0
  175. package/dist/types/types/my.d.ts +203 -0
  176. package/package.json +71 -0
@@ -0,0 +1,173 @@
1
+ /*! @vef-framework-react/approval v2.12.0 made by Venus | 2026-07-17T09:23:57.723Z */
2
+ import { ACTIVITY_ACTION_LABELS as e } from "../status/labels.js";
3
+ import { formatTimestamp as t } from "../format.js";
4
+ import { TaskStatusTag as n } from "../status/index.js";
5
+ import { UserLabel as r } from "../user/index.js";
6
+ import { Empty as i, Flex as a, Stack as o, Tag as s, Text as c, Timeline as l, Tooltip as u, globalCssVars as d } from "@vef-framework-react/components";
7
+ import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
8
+ //#region src/components/timeline/index.tsx
9
+ var m = {
10
+ active: "blue",
11
+ passed: "green",
12
+ rejected: "red",
13
+ returned: "orange",
14
+ canceled: "gray"
15
+ };
16
+ function h({ opinion: e }) {
17
+ return /* @__PURE__ */ f("div", {
18
+ style: {
19
+ padding: "4px 10px",
20
+ borderInlineStart: `3px solid ${d.colorBorder}`,
21
+ background: d.colorFillQuaternary,
22
+ borderRadius: 4
23
+ },
24
+ children: /* @__PURE__ */ f(c, {
25
+ style: {
26
+ fontSize: d.fontSizeSm,
27
+ whiteSpace: "pre-wrap"
28
+ },
29
+ children: e
30
+ })
31
+ });
32
+ }
33
+ function g({ participant: e }) {
34
+ return /* @__PURE__ */ p(o, {
35
+ gap: 4,
36
+ children: [/* @__PURE__ */ p(a, {
37
+ align: "center",
38
+ gap: "small",
39
+ wrap: "wrap",
40
+ children: [
41
+ /* @__PURE__ */ f(r, { user: e.user }),
42
+ e.delegator && /* @__PURE__ */ f(c, {
43
+ style: { fontSize: d.fontSizeSm },
44
+ type: "secondary",
45
+ children: `(受 ${e.delegator.name || e.delegator.id} 委托)`
46
+ }),
47
+ /* @__PURE__ */ f(n, { status: e.status }),
48
+ e.isTimeout && /* @__PURE__ */ f(s, {
49
+ color: "error",
50
+ children: "已超时"
51
+ }),
52
+ e.transferTo && /* @__PURE__ */ f(c, {
53
+ style: { fontSize: d.fontSizeSm },
54
+ type: "secondary",
55
+ children: `转办给 ${e.transferTo.name || e.transferTo.id}`
56
+ }),
57
+ e.actionTime && /* @__PURE__ */ f(c, {
58
+ style: { fontSize: d.fontSizeSm },
59
+ type: "secondary",
60
+ children: t(e.actionTime)
61
+ })
62
+ ]
63
+ }), e.opinion && /* @__PURE__ */ f(h, { opinion: e.opinion })]
64
+ });
65
+ }
66
+ function _(t) {
67
+ let n = [e[t.action]];
68
+ t.transferTo && n.push(`给 ${t.transferTo.name || t.transferTo.id}`), t.target && n.push(`(${t.target.name || t.target.id})`), t.rollbackToNodeName && n.push(`至「${t.rollbackToNodeName}」`);
69
+ let r = [
70
+ ...t.addedAssignees ?? [],
71
+ ...t.removedAssignees ?? [],
72
+ ...t.ccUsers ?? []
73
+ ];
74
+ return r.length > 0 && n.push(r.map((e) => e.name || e.id).join("、")), n.join(" ");
75
+ }
76
+ function v({ activity: e }) {
77
+ return /* @__PURE__ */ p(o, {
78
+ gap: 4,
79
+ children: [/* @__PURE__ */ p(a, {
80
+ align: "center",
81
+ gap: "small",
82
+ wrap: "wrap",
83
+ children: [
84
+ /* @__PURE__ */ f(r, {
85
+ avatarSize: 18,
86
+ user: e.operator
87
+ }),
88
+ /* @__PURE__ */ f(c, {
89
+ style: { fontSize: d.fontSizeSm },
90
+ children: _(e)
91
+ }),
92
+ /* @__PURE__ */ f(c, {
93
+ style: { fontSize: d.fontSizeSm },
94
+ type: "secondary",
95
+ children: t(e.createdAt)
96
+ })
97
+ ]
98
+ }), e.opinion && /* @__PURE__ */ f(h, { opinion: e.opinion })]
99
+ });
100
+ }
101
+ function y({ recipients: e }) {
102
+ let n = e.filter((e) => e.readAt).length;
103
+ return /* @__PURE__ */ p(a, {
104
+ align: "center",
105
+ gap: "small",
106
+ wrap: "wrap",
107
+ children: [
108
+ /* @__PURE__ */ f(c, {
109
+ style: { fontSize: d.fontSizeSm },
110
+ type: "secondary",
111
+ children: "抄送"
112
+ }),
113
+ e.map((e) => /* @__PURE__ */ f(u, {
114
+ title: e.readAt ? `已读 ${t(e.readAt)}` : "未读",
115
+ children: /* @__PURE__ */ f(s, {
116
+ color: e.readAt ? "success" : "default",
117
+ style: { marginInlineEnd: 0 },
118
+ children: e.user.name || e.user.id
119
+ })
120
+ }, e.user.id)),
121
+ /* @__PURE__ */ f(c, {
122
+ style: { fontSize: d.fontSizeSm },
123
+ type: "secondary",
124
+ children: `已读 ${n}/${e.length}`
125
+ })
126
+ ]
127
+ });
128
+ }
129
+ function b(e) {
130
+ return e.kind === "withdraw" ? "gray" : e.kind === "terminate" ? "red" : e.status ? m[e.status] : "gray";
131
+ }
132
+ function x(e) {
133
+ return e.kind === "withdraw" ? "撤回" : e.kind === "terminate" ? "终止" : e.name ?? "";
134
+ }
135
+ function S({ entry: e }) {
136
+ return /* @__PURE__ */ p(a, {
137
+ align: "center",
138
+ gap: "small",
139
+ wrap: "wrap",
140
+ children: [/* @__PURE__ */ f(c, {
141
+ strong: !0,
142
+ children: x(e)
143
+ }), /* @__PURE__ */ p(c, {
144
+ style: { fontSize: d.fontSizeSm },
145
+ type: "secondary",
146
+ children: [t(e.startedAt), e.finishedAt ? ` → ${t(e.finishedAt)}` : ""]
147
+ })]
148
+ });
149
+ }
150
+ function C({ entry: e }) {
151
+ let t = e.participants ?? [], n = e.activities ?? [], r = e.ccRecipients ?? [];
152
+ return t.length === 0 && n.length === 0 && r.length === 0 ? null : /* @__PURE__ */ p(o, {
153
+ gap: 8,
154
+ children: [
155
+ t.map((e) => /* @__PURE__ */ f(g, { participant: e }, e.taskId)),
156
+ r.length > 0 && /* @__PURE__ */ f(y, { recipients: r }),
157
+ n.map((e, t) => /* @__PURE__ */ f(v, { activity: e }, t))
158
+ ]
159
+ });
160
+ }
161
+ function w({ timeline: e }) {
162
+ return e.length === 0 ? /* @__PURE__ */ f(i, { description: "暂无流转记录" }) : /* @__PURE__ */ f(l, {
163
+ items: e.map((e, t) => ({
164
+ key: String(t),
165
+ color: b(e),
166
+ title: /* @__PURE__ */ f(S, { entry: e }),
167
+ content: /* @__PURE__ */ f(C, { entry: e })
168
+ })),
169
+ mode: "left"
170
+ });
171
+ }
172
+ //#endregion
173
+ export { w as InstanceTimeline };
@@ -0,0 +1,64 @@
1
+ /*! @vef-framework-react/approval v2.12.0 made by Venus | 2026-07-17T09:23:57.723Z */
2
+ import { Avatar as e, Space as t, Text as n, Tooltip as r } from "@vef-framework-react/components";
3
+ import { jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
4
+ //#region src/components/user/index.tsx
5
+ var o = [
6
+ "var(--vef-color-primary)",
7
+ "#f56a00",
8
+ "#7265e6",
9
+ "#00a2ae",
10
+ "#c41d7f",
11
+ "#1677ff",
12
+ "#389e0d",
13
+ "#d46b08"
14
+ ];
15
+ function s(e) {
16
+ let t = 0;
17
+ for (let n of e) t = (t * 31 + (n.codePointAt(0) ?? 0)) % 1000000007;
18
+ return o[Math.abs(t) % o.length] ?? o[0];
19
+ }
20
+ function c({ user: o, showAvatar: c = !0, avatarSize: l = 22 }) {
21
+ let u = o.name || o.id;
22
+ return /* @__PURE__ */ i(r, {
23
+ title: o.departmentName ? `${u} · ${o.departmentName}` : u,
24
+ children: /* @__PURE__ */ a(t, {
25
+ size: 6,
26
+ style: {
27
+ display: "inline-flex",
28
+ alignItems: "center"
29
+ },
30
+ children: [c && /* @__PURE__ */ i(e, {
31
+ size: l,
32
+ style: {
33
+ backgroundColor: s(o.id),
34
+ fontSize: Math.round(l / 2)
35
+ },
36
+ children: u.slice(0, 1).toUpperCase()
37
+ }), /* @__PURE__ */ i(n, { children: u })]
38
+ })
39
+ });
40
+ }
41
+ function l({ users: o, maxCount: s = 5, avatarSize: l = 22 }) {
42
+ if (o.length === 0) return /* @__PURE__ */ i(n, {
43
+ type: "secondary",
44
+ children: "-"
45
+ });
46
+ let u = o.slice(0, s), d = o.slice(s);
47
+ return /* @__PURE__ */ a(t, {
48
+ wrap: !0,
49
+ size: 8,
50
+ children: [u.map((e) => /* @__PURE__ */ i(c, {
51
+ avatarSize: l,
52
+ user: e
53
+ }, e.id)), d.length > 0 && /* @__PURE__ */ i(r, {
54
+ title: d.map((e) => e.name || e.id).join("、"),
55
+ children: /* @__PURE__ */ i(e, {
56
+ size: l,
57
+ style: { fontSize: Math.round(l / 2) },
58
+ children: `+${d.length}`
59
+ })
60
+ })]
61
+ });
62
+ }
63
+ //#endregion
64
+ export { l as UserGroup, c as UserLabel };
@@ -0,0 +1,34 @@
1
+ /*! @vef-framework-react/approval v2.12.0 made by Venus | 2026-07-17T09:23:57.723Z */
2
+ import { API_PATH as e, toPagedParams as t } from "./api/query.js";
3
+ import { useAdminApprovalApi as n } from "./api/admin-api.js";
4
+ import { useCategoryApi as r } from "./api/category-api.js";
5
+ import { useDelegationApi as i } from "./api/delegation-api.js";
6
+ import { useFlowApi as a } from "./api/flow-api.js";
7
+ import { useInstanceApi as o } from "./api/instance-api.js";
8
+ import { useMyApprovalApi as s } from "./api/my-api.js";
9
+ import { ApprovalProvider as c, toEditorPlugins as l, useApprovalPlugins as u } from "./plugins/index.js";
10
+ import { ACTIVITY_ACTION_LABELS as d, BINDING_PROJECTION_STATUS_LABELS as f, BINDING_PROJECTION_STATUS_OPTIONS as p, INSTANCE_STATUS_LABELS as m, INSTANCE_STATUS_OPTIONS as h, NODE_PROGRESS_LABELS as g, PROCESS_TASK_ACTION_LABELS as _, TASK_STATUS_LABELS as v, TASK_STATUS_OPTIONS as y, VERSION_STATUS_LABELS as b } from "./components/status/labels.js";
11
+ import { InstanceFlowGraphViewer as x } from "./components/flow-graph/index.js";
12
+ import { InstanceFormPanel as S } from "./components/form-panel/index.js";
13
+ import { formatDurationSeconds as C, formatTimestamp as w } from "./components/format.js";
14
+ import { BINDING_PROJECTION_STATUS_COLORS as T, INSTANCE_STATUS_COLORS as E, NODE_PROGRESS_COLORS as D, TASK_STATUS_COLORS as O, VERSION_STATUS_COLORS as k } from "./components/status/colors.js";
15
+ import { InstanceStatusTag as A, NodeProgressTag as j, ProjectionStatusTag as M, TaskStatusTag as N, VersionStatusTag as P } from "./components/status/index.js";
16
+ import { UserGroup as F, UserLabel as I } from "./components/user/index.js";
17
+ import { InstanceTimeline as L } from "./components/timeline/index.js";
18
+ import { PrincipalSelect as R } from "./components/principal/index.js";
19
+ import { InstanceDetailPanel as z, InstanceHeader as B } from "./components/detail/index.js";
20
+ import { AdminInstanceDetailPanel as V } from "./components/detail/admin.js";
21
+ import { InstanceDetailDrawer as H } from "./components/detail/drawer.js";
22
+ import { APPROVAL_PERMISSIONS as U } from "./permissions.js";
23
+ import { ApprovalAdminPage as W } from "./pages/admin-page/index.js";
24
+ import { ApprovalCategoryPage as G } from "./pages/category-page/index.js";
25
+ import { ApprovalDelegationPage as K } from "./pages/delegation-page/index.js";
26
+ import { FlowDesignerDrawer as q } from "./pages/flow-page/designer/index.js";
27
+ import { FlowVersionsDrawer as J } from "./pages/flow-page/versions.js";
28
+ import { ApprovalFlowPage as Y } from "./pages/flow-page/index.js";
29
+ import { StartInstanceDrawer as X } from "./pages/initiate-page/start-drawer.js";
30
+ import { ApprovalInitiatePage as Z } from "./pages/initiate-page/index.js";
31
+ import { ApprovalMyInstancesPage as Q } from "./pages/my-instances-page/index.js";
32
+ import { ApprovalTaskCenterPage as $ } from "./pages/task-center-page/index.js";
33
+ import { FINAL_INSTANCE_STATUSES as ee, isFinalInstanceStatus as te } from "./types/enums.js";
34
+ export { d as ACTIVITY_ACTION_LABELS, e as API_PATH, U as APPROVAL_PERMISSIONS, V as AdminInstanceDetailPanel, W as ApprovalAdminPage, G as ApprovalCategoryPage, K as ApprovalDelegationPage, Y as ApprovalFlowPage, Z as ApprovalInitiatePage, Q as ApprovalMyInstancesPage, c as ApprovalProvider, $ as ApprovalTaskCenterPage, T as BINDING_PROJECTION_STATUS_COLORS, f as BINDING_PROJECTION_STATUS_LABELS, p as BINDING_PROJECTION_STATUS_OPTIONS, ee as FINAL_INSTANCE_STATUSES, q as FlowDesignerDrawer, J as FlowVersionsDrawer, E as INSTANCE_STATUS_COLORS, m as INSTANCE_STATUS_LABELS, h as INSTANCE_STATUS_OPTIONS, H as InstanceDetailDrawer, z as InstanceDetailPanel, x as InstanceFlowGraphViewer, S as InstanceFormPanel, B as InstanceHeader, A as InstanceStatusTag, L as InstanceTimeline, D as NODE_PROGRESS_COLORS, g as NODE_PROGRESS_LABELS, j as NodeProgressTag, _ as PROCESS_TASK_ACTION_LABELS, R as PrincipalSelect, M as ProjectionStatusTag, X as StartInstanceDrawer, O as TASK_STATUS_COLORS, v as TASK_STATUS_LABELS, y as TASK_STATUS_OPTIONS, N as TaskStatusTag, F as UserGroup, I as UserLabel, k as VERSION_STATUS_COLORS, b as VERSION_STATUS_LABELS, P as VersionStatusTag, C as formatDurationSeconds, w as formatTimestamp, te as isFinalInstanceStatus, l as toEditorPlugins, t as toPagedParams, n as useAdminApprovalApi, u as useApprovalPlugins, r as useCategoryApi, i as useDelegationApi, a as useFlowApi, o as useInstanceApi, s as useMyApprovalApi };
@@ -0,0 +1,67 @@
1
+ /*! @vef-framework-react/approval v2.12.0 made by Venus | 2026-07-17T09:23:57.723Z */
2
+ import { APPROVAL_PERMISSIONS as e } from "../../permissions.js";
3
+ import { InstancesPanel as t } from "./instances.js";
4
+ import { MetricsPanel as n } from "./metrics.js";
5
+ import { ProjectionsPanel as r } from "./projections.js";
6
+ import { TasksPanel as i } from "./tasks.js";
7
+ import { checkPermission as a, useAppContext as o } from "@vef-framework-react/core";
8
+ import { FlexTabs as s, Page as c, Result as l, Title as u, globalCssVars as d } from "@vef-framework-react/components";
9
+ import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
10
+ import { css as m } from "@emotion/react";
11
+ //#region src/pages/admin-page/index.tsx
12
+ var h = /*#__PURE__*/ m({
13
+ height: "100%",
14
+ display: "flex",
15
+ flexDirection: "column",
16
+ gap: d.spacingMd
17
+ }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhZ0IiLCJmaWxlIjoiaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGU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cbiAgICAgIGxhYmVsOiBcIui/kOihjOaMh+agh1wiLFxuICAgICAgY2hpbGRyZW46IDxNZXRyaWNzUGFuZWwgdGVuYW50SWQ9e3RlbmFudElkfSAvPlxuICAgIH0pO1xuICB9XG5cbiAgcmV0dXJuIChcbiAgICA8UGFnZSBtYXJnaW4+XG4gICAgICA8ZGl2IGNzcz17cm9vdENzc30+XG4gICAgICAgIHt0aXRsZSA/IDxUaXRsZSBsZXZlbD17NH0+e3RpdGxlfTwvVGl0bGU+IDogbnVsbH1cblxuICAgICAgICB7aXRlbXMubGVuZ3RoID4gMFxuICAgICAgICAgID8gPEZsZXhUYWJzIGRlZmF1bHRBY3RpdmVLZXk9e2l0ZW1zWzBdPy5rZXl9IGl0ZW1zPXtpdGVtc30gLz5cbiAgICAgICAgICA6IDxSZXN1bHQgc3RhdHVzPVwiNDAzXCIgc3ViVGl0bGU9XCLkvaDmsqHmnInlrqHmibnnrqHnkIblj7DnmoTku7vkvZXmk43kvZzmnYPpmZDjgIJcIiB0aXRsZT1cIuaXoOiuv+mXruadg+mZkFwiIC8+fVxuICAgICAgPC9kaXY+XG4gICAgPC9QYWdlPlxuICApO1xufVxuIl19 */");
18
+ function g({ permissions: d, tenantId: m, title: g }) {
19
+ let _ = {
20
+ instanceQuery: d?.instanceQuery ?? e.instance.query,
21
+ instanceDetail: d?.instanceDetail ?? e.instance.detail,
22
+ instanceTerminate: d?.instanceTerminate ?? e.instance.terminate,
23
+ taskQuery: d?.taskQuery ?? e.task.query,
24
+ taskReassign: d?.taskReassign ?? e.task.reassign,
25
+ bindingQuery: d?.bindingQuery ?? e.binding.query,
26
+ bindingRetry: d?.bindingRetry ?? e.binding.retry,
27
+ metricsQuery: d?.metricsQuery ?? e.metrics.query
28
+ }, { hasPermission: v = () => !0 } = o(), y = [];
29
+ return a(v, _.instanceQuery) && y.push({
30
+ key: "instances",
31
+ label: "实例管理",
32
+ children: /* @__PURE__ */ f(t, {
33
+ detailPermission: _.instanceDetail,
34
+ terminatePermission: _.instanceTerminate
35
+ })
36
+ }), a(v, _.taskQuery) && y.push({
37
+ key: "tasks",
38
+ label: "任务管理",
39
+ children: /* @__PURE__ */ f(i, { reassignPermission: _.taskReassign })
40
+ }), a(v, _.bindingQuery) && y.push({
41
+ key: "projections",
42
+ label: "业务回写",
43
+ children: /* @__PURE__ */ f(r, { retryPermission: _.bindingRetry })
44
+ }), a(v, _.metricsQuery) && y.push({
45
+ key: "metrics",
46
+ label: "运行指标",
47
+ children: /* @__PURE__ */ f(n, { tenantId: m })
48
+ }), /* @__PURE__ */ f(c, {
49
+ margin: !0,
50
+ children: /* @__PURE__ */ p("div", {
51
+ css: h,
52
+ children: [g ? /* @__PURE__ */ f(u, {
53
+ level: 4,
54
+ children: g
55
+ }) : null, y.length > 0 ? /* @__PURE__ */ f(s, {
56
+ defaultActiveKey: y[0]?.key,
57
+ items: y
58
+ }) : /* @__PURE__ */ f(l, {
59
+ status: "403",
60
+ subTitle: "你没有审批管理台的任何操作权限。",
61
+ title: "无访问权限"
62
+ })]
63
+ })
64
+ });
65
+ }
66
+ //#endregion
67
+ export { g as ApprovalAdminPage };
@@ -0,0 +1,148 @@
1
+ /*! @vef-framework-react/approval v2.12.0 made by Venus | 2026-07-17T09:23:57.723Z */
2
+ import { useAdminApprovalApi as e } from "../../api/admin-api.js";
3
+ import { INSTANCE_STATUS_OPTIONS as t } from "../../components/status/labels.js";
4
+ import { formatTimestamp as n } from "../../components/format.js";
5
+ import { InstanceStatusTag as r } from "../../components/status/index.js";
6
+ import { UserLabel as i } from "../../components/user/index.js";
7
+ import { ReasonModal as a } from "../../components/detail/action-modals.js";
8
+ import { AdminInstanceDetailPanel as o } from "../../components/detail/admin.js";
9
+ import { useMutation as s } from "@vef-framework-react/core";
10
+ import { useState as c } from "react";
11
+ import { Crud as l, Drawer as u, Flex as d, OperationButton as f, Text as p, showSuccessMessage as m, useFormContext as h } from "@vef-framework-react/components";
12
+ import { Fragment as g, jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
13
+ //#region src/pages/admin-page/instances.tsx
14
+ var y = [
15
+ {
16
+ title: "审批单",
17
+ dataIndex: "title",
18
+ render: (e, t) => /* @__PURE__ */ v(d, {
19
+ vertical: !0,
20
+ gap: 2,
21
+ children: [/* @__PURE__ */ _(p, { children: e }), /* @__PURE__ */ _(p, {
22
+ copyable: !0,
23
+ style: { fontSize: 12 },
24
+ type: "secondary",
25
+ children: t.instanceNo
26
+ })]
27
+ })
28
+ },
29
+ {
30
+ title: "所属流程",
31
+ dataIndex: "flowName",
32
+ width: 150
33
+ },
34
+ {
35
+ title: "申请人",
36
+ dataIndex: "applicant",
37
+ width: 150,
38
+ render: (e) => /* @__PURE__ */ _(i, { user: e })
39
+ },
40
+ {
41
+ title: "状态",
42
+ dataIndex: "status",
43
+ width: 100,
44
+ render: (e) => /* @__PURE__ */ _(r, { status: e })
45
+ },
46
+ {
47
+ title: "当前节点",
48
+ dataIndex: "currentNodeName",
49
+ width: 130,
50
+ render: (e) => e ?? "-"
51
+ },
52
+ {
53
+ title: "提交时间",
54
+ dataIndex: "createdAt",
55
+ width: 160,
56
+ render: (e) => n(e)
57
+ }
58
+ ];
59
+ function b() {
60
+ let { AppField: e } = h();
61
+ return /* @__PURE__ */ v(g, { children: [
62
+ /* @__PURE__ */ _(e, {
63
+ name: "keyword",
64
+ children: (e) => /* @__PURE__ */ _(e.Input, {
65
+ allowClear: !0,
66
+ noWrapper: !0,
67
+ placeholder: "标题 / 单号"
68
+ })
69
+ }),
70
+ /* @__PURE__ */ _(e, {
71
+ name: "applicantId",
72
+ children: (e) => /* @__PURE__ */ _(e.Input, {
73
+ allowClear: !0,
74
+ noWrapper: !0,
75
+ placeholder: "申请人 ID"
76
+ })
77
+ }),
78
+ /* @__PURE__ */ _(e, {
79
+ name: "status",
80
+ children: (e) => /* @__PURE__ */ _(e.Select, {
81
+ allowClear: !0,
82
+ noWrapper: !0,
83
+ options: t,
84
+ placeholder: "状态",
85
+ style: { minWidth: 110 }
86
+ })
87
+ })
88
+ ] });
89
+ }
90
+ function x({ detailPermission: t, terminatePermission: n }) {
91
+ let r = e(), [i, d] = c(null), [p, h] = c(null), [x, S] = c(0), C = s({
92
+ mutationFn: r.terminateInstance,
93
+ meta: {
94
+ shouldShowSuccessFeedback: !1,
95
+ invalidates: [[r.findInstances.key]]
96
+ }
97
+ });
98
+ return /* @__PURE__ */ v(g, { children: [
99
+ /* @__PURE__ */ _(l, {
100
+ basicSearch: /* @__PURE__ */ _(b, {}),
101
+ columnSettings: { storageKey: "approval.admin.instances" },
102
+ queryFn: r.findInstances,
103
+ rowKey: "instanceId",
104
+ tableColumns: y,
105
+ operationColumn: {
106
+ width: 160,
107
+ render(e) {
108
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(f, {
109
+ color: "primary",
110
+ requiredPermissions: t,
111
+ onClick: () => d(e.instanceId),
112
+ children: "详情"
113
+ }), e.status === "running" && /* @__PURE__ */ _(f, {
114
+ color: "danger",
115
+ requiredPermissions: n,
116
+ onClick: () => h(e.instanceId),
117
+ children: "终止"
118
+ })] });
119
+ }
120
+ }
121
+ }, String(x)),
122
+ /* @__PURE__ */ _(u, {
123
+ destroyOnHidden: !0,
124
+ open: i !== null,
125
+ placement: "right",
126
+ size: 880,
127
+ title: "审批详情",
128
+ onClose: () => d(null),
129
+ children: i !== null && /* @__PURE__ */ _(o, { instanceId: i })
130
+ }),
131
+ /* @__PURE__ */ _(a, {
132
+ danger: !0,
133
+ okText: "终止",
134
+ open: p !== null,
135
+ placeholder: "请输入终止原因(可选)",
136
+ title: "终止审批单",
137
+ onClose: () => h(null),
138
+ onConfirm: async (e) => {
139
+ p !== null && (await C.mutateAsync({
140
+ instanceId: p,
141
+ reason: e.trim() || void 0
142
+ }), m("已终止"), S((e) => e + 1));
143
+ }
144
+ })
145
+ ] });
146
+ }
147
+ //#endregion
148
+ export { x as InstancesPanel };