@vef-framework-react/approval 2.13.1 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/detail/admin.cjs +1 -1
- package/dist/cjs/components/detail/index.cjs +1 -1
- package/dist/cjs/components/flow-graph/index.cjs +1 -1
- package/dist/cjs/components/flow-graph/node.cjs +1 -0
- package/dist/cjs/components/flow-graph/people-overlay.cjs +1 -0
- package/dist/cjs/components/flow-graph/people.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/timeline/index.cjs +1 -1
- package/dist/cjs/components/user/index.cjs +1 -1
- package/dist/cjs/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/projections.cjs +1 -1
- package/dist/cjs/pages/admin-page/tasks.cjs +1 -1
- package/dist/cjs/pages/my-instances-page/index.cjs +1 -1
- package/dist/es/api/admin-api.js +1 -1
- 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 +1 -1
- package/dist/es/api/index.js +1 -1
- package/dist/es/api/instance-api.js +1 -1
- package/dist/es/api/my-api.js +1 -1
- package/dist/es/api/query.js +1 -1
- package/dist/es/components/detail/action-modals.js +1 -1
- package/dist/es/components/detail/admin.js +20 -20
- package/dist/es/components/detail/drawer.js +1 -1
- package/dist/es/components/detail/index.js +65 -65
- package/dist/es/components/flow-graph/index.js +42 -170
- package/dist/es/components/flow-graph/node.js +148 -0
- package/dist/es/components/flow-graph/people-overlay.js +212 -0
- package/dist/es/components/flow-graph/people.js +47 -0
- package/dist/es/components/form-panel/index.js +1 -1
- package/dist/es/components/format.js +1 -1
- package/dist/es/components/icon.js +1 -1
- package/dist/es/components/index.js +9 -9
- package/dist/es/components/principal/index.js +1 -1
- package/dist/es/components/status/colors.js +1 -1
- package/dist/es/components/status/index.js +1 -1
- package/dist/es/components/status/labels.js +1 -1
- package/dist/es/components/timeline/index.js +37 -37
- package/dist/es/components/user/index.js +2 -2
- package/dist/es/index.js +9 -9
- package/dist/es/pages/admin-page/index.js +1 -1
- package/dist/es/pages/admin-page/instances.js +5 -5
- package/dist/es/pages/admin-page/metrics.js +11 -11
- package/dist/es/pages/admin-page/projections.js +6 -6
- package/dist/es/pages/admin-page/tasks.js +6 -6
- 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 +1 -1
- 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 +1 -1
- package/dist/es/pages/flow-page/columns.js +1 -1
- package/dist/es/pages/flow-page/designer/basic-step.js +1 -1
- package/dist/es/pages/flow-page/designer/flow-step.js +1 -1
- package/dist/es/pages/flow-page/designer/form-step.js +1 -1
- package/dist/es/pages/flow-page/designer/index.js +1 -1
- package/dist/es/pages/flow-page/designer/review-step.js +1 -1
- package/dist/es/pages/flow-page/designer/types.js +1 -1
- package/dist/es/pages/flow-page/index.js +1 -1
- 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 +1 -1
- package/dist/es/pages/initiate-page/index.js +1 -1
- package/dist/es/pages/initiate-page/start-drawer.js +1 -1
- package/dist/es/pages/my-instances-page/index.js +7 -7
- package/dist/es/pages/task-center-page/index.js +1 -1
- package/dist/es/permissions.js +1 -1
- package/dist/es/plugins/index.js +1 -1
- package/dist/es/types/enums.js +1 -1
- package/dist/es/types/index.js +1 -1
- package/dist/types/components/flow-graph/index.d.ts +3 -2
- package/dist/types/components/flow-graph/node.d.ts +10 -0
- package/dist/types/components/flow-graph/people-overlay.d.ts +19 -0
- package/dist/types/components/flow-graph/people.d.ts +53 -0
- package/dist/types/components/user/index.d.ts +6 -0
- package/package.json +7 -7
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval v2.
|
|
1
|
+
/*! @vef-framework-react/approval v2.15.0 made by Venus | 2026-08-07T09:29:09.258Z */
|
|
2
2
|
import { useInstanceApi as e } from "../../api/instance-api.js";
|
|
3
3
|
import { useMyApprovalApi as t } from "../../api/my-api.js";
|
|
4
4
|
import { useApprovalPlugins as n } from "../../plugins/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { formatTimestamp as r } from "../format.js";
|
|
6
|
+
import { InstanceStatusTag as i } from "../status/index.js";
|
|
7
|
+
import { UserLabel as a } from "../user/index.js";
|
|
8
|
+
import { InstanceFlowGraphViewer as o } from "../flow-graph/index.js";
|
|
9
|
+
import { InstanceFormPanel as s } from "../form-panel/index.js";
|
|
10
10
|
import { InstanceTimeline as c } from "../timeline/index.js";
|
|
11
11
|
import { AddAssigneeModal as l, CCModal as u, ReasonModal as d, RemoveAssigneeModal as f, RollbackModal as p, TransferModal as m, UrgeModal as h } from "./action-modals.js";
|
|
12
|
-
import { useMutation as g, useQuery as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { Button as
|
|
12
|
+
import { useMutation as g, useQuery as _ } from "@vef-framework-react/core";
|
|
13
|
+
import { useMemo as v, useRef as y, useState as b } from "react";
|
|
14
|
+
import { Button as x, Descriptions as S, Empty as ee, Flex as C, Icon as w, Input as te, Labeled as ne, LabelsDisplay as T, Space as re, Spin as ie, Stack as E, Tabs as ae, Text as D, Title as O, globalCssVars as oe, showSuccessMessage as se, showWarningMessage as ce } from "@vef-framework-react/components";
|
|
15
15
|
import { CheckIcon as le, CornerUpLeftIcon as ue, MailPlusIcon as de, MegaphoneIcon as fe, RotateCcwIcon as pe, SendIcon as me, Undo2Icon as he, UserMinusIcon as ge, UserPlusIcon as _e, XIcon as ve } from "lucide-react";
|
|
16
16
|
import { Fragment as ye, jsx as k, jsxs as A } from "@emotion/react/jsx-runtime";
|
|
17
17
|
//#region src/components/detail/index.tsx
|
|
18
|
-
function j({ title: e, status: t, instanceNo:
|
|
18
|
+
function j({ title: e, status: t, instanceNo: o, flowName: s, flowCode: c, applicant: l, createdAt: u, finishedAt: d, currentNodeName: f, businessRef: p, labels: m }) {
|
|
19
19
|
let { renderBusinessRef: h } = n(), g = [
|
|
20
20
|
{
|
|
21
21
|
key: "no",
|
|
22
22
|
label: "审批单号",
|
|
23
23
|
children: /* @__PURE__ */ k(D, {
|
|
24
24
|
copyable: !0,
|
|
25
|
-
children:
|
|
25
|
+
children: o
|
|
26
26
|
})
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
key: "flow",
|
|
30
30
|
label: "所属流程",
|
|
31
|
-
children:
|
|
31
|
+
children: s
|
|
32
32
|
},
|
|
33
33
|
...c ? [{
|
|
34
34
|
key: "flowCode",
|
|
@@ -41,12 +41,12 @@ function j({ title: e, status: t, instanceNo: r, flowName: i, flowCode: c, appli
|
|
|
41
41
|
{
|
|
42
42
|
key: "applicant",
|
|
43
43
|
label: "申请人",
|
|
44
|
-
children: /* @__PURE__ */ k(
|
|
44
|
+
children: /* @__PURE__ */ k(a, { user: l })
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
key: "created",
|
|
48
48
|
label: "提交时间",
|
|
49
|
-
children:
|
|
49
|
+
children: r(u)
|
|
50
50
|
}
|
|
51
51
|
];
|
|
52
52
|
return f !== void 0 && g.push({
|
|
@@ -56,7 +56,7 @@ function j({ title: e, status: t, instanceNo: r, flowName: i, flowCode: c, appli
|
|
|
56
56
|
}), d !== void 0 && g.push({
|
|
57
57
|
key: "finished",
|
|
58
58
|
label: "完成时间",
|
|
59
|
-
children:
|
|
59
|
+
children: r(d)
|
|
60
60
|
}), p !== void 0 && p !== "" && g.push({
|
|
61
61
|
key: "businessRef",
|
|
62
62
|
label: "业务单据",
|
|
@@ -70,7 +70,7 @@ function j({ title: e, status: t, instanceNo: r, flowName: i, flowCode: c, appli
|
|
|
70
70
|
children: /* @__PURE__ */ k(T, { labels: m })
|
|
71
71
|
}), /* @__PURE__ */ A(E, {
|
|
72
72
|
gap: 12,
|
|
73
|
-
children: [/* @__PURE__ */ A(
|
|
73
|
+
children: [/* @__PURE__ */ A(C, {
|
|
74
74
|
align: "center",
|
|
75
75
|
gap: "middle",
|
|
76
76
|
wrap: "wrap",
|
|
@@ -78,8 +78,8 @@ function j({ title: e, status: t, instanceNo: r, flowName: i, flowCode: c, appli
|
|
|
78
78
|
level: 4,
|
|
79
79
|
style: { margin: 0 },
|
|
80
80
|
children: e
|
|
81
|
-
}), /* @__PURE__ */ k(
|
|
82
|
-
}), /* @__PURE__ */ k(
|
|
81
|
+
}), /* @__PURE__ */ k(i, { status: t })]
|
|
82
|
+
}), /* @__PURE__ */ k(S, {
|
|
83
83
|
colon: !0,
|
|
84
84
|
items: g,
|
|
85
85
|
size: "small",
|
|
@@ -91,33 +91,33 @@ function j({ title: e, status: t, instanceNo: r, flowName: i, flowCode: c, appli
|
|
|
91
91
|
})]
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
function M({ instanceId: n, onActionCompleted:
|
|
95
|
-
let
|
|
96
|
-
queryFn:
|
|
97
|
-
queryKey: [
|
|
94
|
+
function M({ instanceId: n, onActionCompleted: r }) {
|
|
95
|
+
let i = t(), a = e(), { data: S, isLoading: T, refetch: D } = _({
|
|
96
|
+
queryFn: i.getInstanceDetail,
|
|
97
|
+
queryKey: [i.getInstanceDetail.key, { instanceId: n }]
|
|
98
98
|
}), O = { meta: { shouldShowSuccessFeedback: !1 } }, M = g({
|
|
99
|
-
mutationFn:
|
|
99
|
+
mutationFn: a.processTask,
|
|
100
100
|
...O
|
|
101
101
|
}), be = g({
|
|
102
|
-
mutationFn:
|
|
102
|
+
mutationFn: a.resubmit,
|
|
103
103
|
...O
|
|
104
104
|
}), xe = g({
|
|
105
|
-
mutationFn:
|
|
105
|
+
mutationFn: a.withdraw,
|
|
106
106
|
...O
|
|
107
107
|
}), Se = g({
|
|
108
|
-
mutationFn:
|
|
108
|
+
mutationFn: a.addAssignee,
|
|
109
109
|
...O
|
|
110
110
|
}), Ce = g({
|
|
111
|
-
mutationFn:
|
|
111
|
+
mutationFn: a.removeAssignee,
|
|
112
112
|
...O
|
|
113
113
|
}), we = g({
|
|
114
|
-
mutationFn:
|
|
114
|
+
mutationFn: a.addCC,
|
|
115
115
|
...O
|
|
116
116
|
}), Te = g({
|
|
117
|
-
mutationFn:
|
|
117
|
+
mutationFn: a.urgeTask,
|
|
118
118
|
...O
|
|
119
|
-
}), [N, P] =
|
|
120
|
-
let e = [], t =
|
|
119
|
+
}), [N, P] = b(null), [F, I] = b(""), [L, R] = b(!1), z = y(null), B = y(null), V = v(() => new Set(S?.availableActions), [S]), H = S?.myTask, U = v(() => {
|
|
120
|
+
let e = [], t = S?.timeline ?? [];
|
|
121
121
|
for (let n of t) {
|
|
122
122
|
if (n.kind !== "approval" && n.kind !== "handle") continue;
|
|
123
123
|
let t = n.participants ?? [];
|
|
@@ -128,17 +128,17 @@ function M({ instanceId: n, onActionCompleted: a }) {
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
return e;
|
|
131
|
-
}, [
|
|
132
|
-
if (T) return /* @__PURE__ */ k(
|
|
131
|
+
}, [S]);
|
|
132
|
+
if (T) return /* @__PURE__ */ k(C, {
|
|
133
133
|
align: "center",
|
|
134
134
|
justify: "center",
|
|
135
135
|
style: { minHeight: 240 },
|
|
136
136
|
children: /* @__PURE__ */ k(ie, {})
|
|
137
137
|
});
|
|
138
|
-
if (!
|
|
139
|
-
let { instance: W } =
|
|
138
|
+
if (!S) return /* @__PURE__ */ k(ee, { description: "未找到审批单" });
|
|
139
|
+
let { instance: W } = S, G = V.has("handle") ? "handle" : V.has("approve") ? "approve" : null, K = G !== null && H !== void 0, q = V.has("resubmit"), Ee = K || q;
|
|
140
140
|
async function J(e) {
|
|
141
|
-
se(e), I(""), await D(),
|
|
141
|
+
se(e), I(""), await D(), r?.();
|
|
142
142
|
}
|
|
143
143
|
async function Y(e, t) {
|
|
144
144
|
R(!0);
|
|
@@ -153,7 +153,7 @@ function M({ instanceId: n, onActionCompleted: a }) {
|
|
|
153
153
|
}
|
|
154
154
|
async function Z(e) {
|
|
155
155
|
if (!(e !== "resubmit" && !X())) {
|
|
156
|
-
if (!
|
|
156
|
+
if (!S?.formSchema) {
|
|
157
157
|
await Q(e, void 0);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
@@ -195,43 +195,43 @@ function M({ instanceId: n, onActionCompleted: a }) {
|
|
|
195
195
|
}), "已拒绝");
|
|
196
196
|
}
|
|
197
197
|
let $ = [];
|
|
198
|
-
V.has("transfer") && H !== void 0 && $.push(/* @__PURE__ */ k(
|
|
199
|
-
icon: /* @__PURE__ */ k(
|
|
198
|
+
V.has("transfer") && H !== void 0 && $.push(/* @__PURE__ */ k(x, {
|
|
199
|
+
icon: /* @__PURE__ */ k(w, { component: ue }),
|
|
200
200
|
onClick: () => P("transfer"),
|
|
201
201
|
children: "转办"
|
|
202
|
-
}, "transfer")), V.has("rollback") && (H?.rollbackTargets?.length ?? 0) > 0 && $.push(/* @__PURE__ */ k(
|
|
203
|
-
icon: /* @__PURE__ */ k(
|
|
202
|
+
}, "transfer")), V.has("rollback") && (H?.rollbackTargets?.length ?? 0) > 0 && $.push(/* @__PURE__ */ k(x, {
|
|
203
|
+
icon: /* @__PURE__ */ k(w, { component: he }),
|
|
204
204
|
onClick: () => P("rollback"),
|
|
205
205
|
children: "回退"
|
|
206
|
-
}, "rollback")), V.has("add_assignee") && (H?.addAssigneeTypes?.length ?? 0) > 0 && $.push(/* @__PURE__ */ k(
|
|
207
|
-
icon: /* @__PURE__ */ k(
|
|
206
|
+
}, "rollback")), V.has("add_assignee") && (H?.addAssigneeTypes?.length ?? 0) > 0 && $.push(/* @__PURE__ */ k(x, {
|
|
207
|
+
icon: /* @__PURE__ */ k(w, { component: _e }),
|
|
208
208
|
onClick: () => P("addAssignee"),
|
|
209
209
|
children: "加签"
|
|
210
|
-
}, "addAssignee")), V.has("remove_assignee") && (H?.removableAssignees?.length ?? 0) > 0 && $.push(/* @__PURE__ */ k(
|
|
211
|
-
icon: /* @__PURE__ */ k(
|
|
210
|
+
}, "addAssignee")), V.has("remove_assignee") && (H?.removableAssignees?.length ?? 0) > 0 && $.push(/* @__PURE__ */ k(x, {
|
|
211
|
+
icon: /* @__PURE__ */ k(w, { component: ge }),
|
|
212
212
|
onClick: () => P("removeAssignee"),
|
|
213
213
|
children: "减签"
|
|
214
|
-
}, "removeAssignee")), V.has("add_cc") && $.push(/* @__PURE__ */ k(
|
|
215
|
-
icon: /* @__PURE__ */ k(
|
|
214
|
+
}, "removeAssignee")), V.has("add_cc") && $.push(/* @__PURE__ */ k(x, {
|
|
215
|
+
icon: /* @__PURE__ */ k(w, { component: de }),
|
|
216
216
|
onClick: () => P("cc"),
|
|
217
217
|
children: "抄送"
|
|
218
|
-
}, "cc")), V.has("urge") && U.length > 0 && $.push(/* @__PURE__ */ k(
|
|
219
|
-
icon: /* @__PURE__ */ k(
|
|
218
|
+
}, "cc")), V.has("urge") && U.length > 0 && $.push(/* @__PURE__ */ k(x, {
|
|
219
|
+
icon: /* @__PURE__ */ k(w, { component: fe }),
|
|
220
220
|
onClick: () => P("urge"),
|
|
221
221
|
children: "催办"
|
|
222
|
-
}, "urge")), V.has("withdraw") && $.push(/* @__PURE__ */ k(
|
|
223
|
-
icon: /* @__PURE__ */ k(
|
|
222
|
+
}, "urge")), V.has("withdraw") && $.push(/* @__PURE__ */ k(x, {
|
|
223
|
+
icon: /* @__PURE__ */ k(w, { component: pe }),
|
|
224
224
|
onClick: () => P("withdraw"),
|
|
225
225
|
children: "撤回"
|
|
226
226
|
}, "withdraw"));
|
|
227
227
|
let ke = K || q || $.length > 0, Ae = /* @__PURE__ */ A(E, {
|
|
228
228
|
gap: 16,
|
|
229
|
-
children: [/* @__PURE__ */ k(
|
|
229
|
+
children: [/* @__PURE__ */ k(s, {
|
|
230
230
|
apiRef: z,
|
|
231
231
|
disabled: !Ee,
|
|
232
|
-
fieldPermissions:
|
|
232
|
+
fieldPermissions: S.fieldPermissions,
|
|
233
233
|
formData: W.formData,
|
|
234
|
-
schema:
|
|
234
|
+
schema: S.formSchema,
|
|
235
235
|
onSubmit: De
|
|
236
236
|
}), ke && /* @__PURE__ */ A(E, {
|
|
237
237
|
gap: 12,
|
|
@@ -239,36 +239,36 @@ function M({ instanceId: n, onActionCompleted: a }) {
|
|
|
239
239
|
borderTop: `1px solid ${oe.colorBorderSecondary}`,
|
|
240
240
|
paddingTop: 16
|
|
241
241
|
},
|
|
242
|
-
children: [K && /* @__PURE__ */ k(
|
|
242
|
+
children: [K && /* @__PURE__ */ k(ne, {
|
|
243
243
|
label: "审批意见",
|
|
244
244
|
required: H?.isOpinionRequired === !0,
|
|
245
|
-
children: /* @__PURE__ */ k(
|
|
245
|
+
children: /* @__PURE__ */ k(te.TextArea, {
|
|
246
246
|
maxLength: 2e3,
|
|
247
247
|
placeholder: "请输入审批意见",
|
|
248
248
|
rows: 3,
|
|
249
249
|
value: F,
|
|
250
250
|
onChange: (e) => I(e.target.value)
|
|
251
251
|
})
|
|
252
|
-
}), /* @__PURE__ */ A(
|
|
252
|
+
}), /* @__PURE__ */ A(C, {
|
|
253
253
|
align: "center",
|
|
254
254
|
gap: "small",
|
|
255
255
|
wrap: "wrap",
|
|
256
256
|
children: [
|
|
257
|
-
K && /* @__PURE__ */ A(ye, { children: [/* @__PURE__ */ k(
|
|
258
|
-
icon: /* @__PURE__ */ k(
|
|
257
|
+
K && /* @__PURE__ */ A(ye, { children: [/* @__PURE__ */ k(x, {
|
|
258
|
+
icon: /* @__PURE__ */ k(w, { component: le }),
|
|
259
259
|
loading: L,
|
|
260
260
|
type: "primary",
|
|
261
261
|
onClick: () => void Z(G),
|
|
262
262
|
children: G === "handle" ? "办理" : "通过"
|
|
263
|
-
}), /* @__PURE__ */ k(
|
|
263
|
+
}), /* @__PURE__ */ k(x, {
|
|
264
264
|
danger: !0,
|
|
265
|
-
icon: /* @__PURE__ */ k(
|
|
265
|
+
icon: /* @__PURE__ */ k(w, { component: ve }),
|
|
266
266
|
loading: L,
|
|
267
267
|
onClick: () => void Oe(),
|
|
268
268
|
children: "拒绝"
|
|
269
269
|
})] }),
|
|
270
|
-
q && /* @__PURE__ */ k(
|
|
271
|
-
icon: /* @__PURE__ */ k(
|
|
270
|
+
q && /* @__PURE__ */ k(x, {
|
|
271
|
+
icon: /* @__PURE__ */ k(w, { component: me }),
|
|
272
272
|
loading: L,
|
|
273
273
|
type: "primary",
|
|
274
274
|
onClick: () => void Z("resubmit"),
|
|
@@ -307,12 +307,12 @@ function M({ instanceId: n, onActionCompleted: a }) {
|
|
|
307
307
|
{
|
|
308
308
|
key: "timeline",
|
|
309
309
|
label: "流转记录",
|
|
310
|
-
children: /* @__PURE__ */ k(c, { timeline:
|
|
310
|
+
children: /* @__PURE__ */ k(c, { timeline: S.timeline })
|
|
311
311
|
},
|
|
312
312
|
{
|
|
313
313
|
key: "graph",
|
|
314
314
|
label: "流程图",
|
|
315
|
-
children: /* @__PURE__ */ k(
|
|
315
|
+
children: /* @__PURE__ */ k(o, { flowGraph: S.flowGraph })
|
|
316
316
|
}
|
|
317
317
|
] }),
|
|
318
318
|
/* @__PURE__ */ k(m, {
|