@qfei-design/make-app-approval 0.2.7 → 0.2.8
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/PUBLIC_API.md +23 -1
- package/README.md +2 -2
- package/capabilities.json +1 -1
- package/dist/detail/types.d.ts +21 -0
- package/dist/detail.cjs +1 -1
- package/dist/detail.mjs +269 -256
- package/dist/list/approval-mobile-list.d.ts +12 -0
- package/dist/list/types.d.ts +5 -0
- package/dist/list.cjs +1 -1
- package/dist/list.mjs +371 -263
- package/dist/styles.css +24 -0
- package/docs/host-integration.md +3 -1
- package/docs/publishing.md +1 -1
- package/package.ai.json +1 -1
- package/package.json +1 -1
package/dist/list.mjs
CHANGED
|
@@ -1,282 +1,364 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getApprovalStatusDisplay as
|
|
4
|
-
const ve = {
|
|
1
|
+
import { jsxs as T, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useRef as V, useEffect as J, useMemo as me, useId as ge } from "react";
|
|
3
|
+
import { getApprovalStatusDisplay as fe } from "./index.mjs";
|
|
4
|
+
const de = (e) => typeof e == "object" && e !== null, ve = (e) => de(e) ? ["id", "entityKey", "recordId"].every((t) => typeof e[t] == "string" && e[t].trim().length > 0) && ["applicationNo", "applicationType", "applicantName", "applicationTime"].every((t) => typeof e[t] == "string") && ["taskId", "processInstanceId"].every((t) => e[t] === void 0 || typeof e[t] == "string" && e[t].trim().length > 0) && ["completionTime", "completionResult"].every((t) => e[t] === void 0 || typeof e[t] == "string") && (typeof e.processStatus == "string" || e.processStatus === null) : !1, ee = (e, t) => {
|
|
5
|
+
if (!de(e) || !Array.isArray(e.rows) || !e.rows.every(ve) || typeof e.total != "number" || !Number.isSafeInteger(e.total) || e.total < 0 || e.rows.length > t || e.rows.length > e.total || new Set(e.rows.map((h) => h.id)).size !== e.rows.length)
|
|
6
|
+
throw new Error("Invalid approval page contract");
|
|
7
|
+
return { rows: e.rows, total: e.total };
|
|
8
|
+
}, I = (e, t) => {
|
|
9
|
+
try {
|
|
10
|
+
e ? e(t) : t.phase === "error" ? console.warn("[make-app-approval]", t) : console.info("[make-app-approval]", t);
|
|
11
|
+
} catch {
|
|
12
|
+
console.warn("[make-app-approval] diagnostic sink failed");
|
|
13
|
+
}
|
|
14
|
+
}, be = ({ initialPage: e, query: t, provider: h, components: H, onOpen: j, onReload: B, logger: E }) => {
|
|
15
|
+
const [g, w] = L(e), [f, z] = L(2), [d, N] = L("idle"), s = V(void 0), [M, R] = L(!1), c = V(void 0);
|
|
16
|
+
J(() => () => {
|
|
17
|
+
c.current?.abort();
|
|
18
|
+
}, []);
|
|
19
|
+
const k = async () => {
|
|
20
|
+
if (c.current || g.rows.length >= g.total) return;
|
|
21
|
+
const o = new AbortController();
|
|
22
|
+
c.current = o, N("loading");
|
|
23
|
+
const l = { operation: "list", tab: t.tab, page: f, pageSize: t.pageSize };
|
|
24
|
+
I(E, { ...l, phase: "start" });
|
|
25
|
+
try {
|
|
26
|
+
const y = ee(await h.loadPage({ ...t, page: f }, { signal: o.signal }), t.pageSize);
|
|
27
|
+
if (o.signal.aborted) return;
|
|
28
|
+
if (y.total < g.total) {
|
|
29
|
+
I(E, { ...l, phase: "skip", rowCount: y.rows.length }), B();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const p = new Set(g.rows.map((C) => C.id));
|
|
33
|
+
if (!y.rows.length || y.rows.some((C) => p.has(C.id))) throw new Error("Invalid append page");
|
|
34
|
+
w({ rows: [...g.rows, ...y.rows], total: y.total }), z((C) => C + 1), N("idle"), I(E, { ...l, phase: "success", rowCount: y.rows.length });
|
|
35
|
+
} catch {
|
|
36
|
+
o.signal.aborted || (N("error"), I(E, { ...l, phase: "error" }));
|
|
37
|
+
} finally {
|
|
38
|
+
c.current === o && (c.current = void 0);
|
|
39
|
+
}
|
|
40
|
+
}, x = (o) => {
|
|
41
|
+
const { scrollHeight: l, scrollTop: y, clientHeight: p } = o.currentTarget;
|
|
42
|
+
d === "idle" && l - y - p < 120 && k();
|
|
43
|
+
}, { Button: O } = H;
|
|
44
|
+
return /* @__PURE__ */ T(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: "make-app-approval-mobile-list",
|
|
48
|
+
onScroll: x,
|
|
49
|
+
onTouchStart: (o) => {
|
|
50
|
+
s.current = o.currentTarget.scrollTop <= 0 && o.touches.length === 1 && d !== "loading" ? { start: o.touches[0].clientY, distance: 0 } : void 0;
|
|
51
|
+
},
|
|
52
|
+
onTouchMove: (o) => {
|
|
53
|
+
!s.current || o.touches.length !== 1 || (s.current.distance = o.touches[0].clientY - s.current.start, R(s.current.distance >= 60));
|
|
54
|
+
},
|
|
55
|
+
onTouchEnd: () => {
|
|
56
|
+
const o = (s.current?.distance ?? 0) >= 60;
|
|
57
|
+
s.current = void 0, R(!1), o && B();
|
|
58
|
+
},
|
|
59
|
+
onTouchCancel: () => {
|
|
60
|
+
s.current = void 0, R(!1);
|
|
61
|
+
},
|
|
62
|
+
"aria-label": "审批卡片列表",
|
|
63
|
+
"aria-busy": d === "loading",
|
|
64
|
+
children: [
|
|
65
|
+
M && /* @__PURE__ */ n("p", { role: "status", className: "make-app-approval-mobile-feedback", children: "松开刷新" }),
|
|
66
|
+
g.rows.map((o) => /* @__PURE__ */ T("button", { type: "button", className: "make-app-approval-mobile-card", onClick: () => j(o), "aria-label": `打开 ${o.applicationNo} 的审批详情`, children: [
|
|
67
|
+
/* @__PURE__ */ n("strong", { children: o.applicationType || "审批申请" }),
|
|
68
|
+
/* @__PURE__ */ T("span", { className: "make-app-approval-mobile-card-line", children: [
|
|
69
|
+
/* @__PURE__ */ n("span", { children: "申请单ID:" }),
|
|
70
|
+
/* @__PURE__ */ n("span", { children: o.applicationNo })
|
|
71
|
+
] }),
|
|
72
|
+
t.tab === "approved" && /* @__PURE__ */ T("span", { className: "make-app-approval-mobile-card-line", children: [
|
|
73
|
+
/* @__PURE__ */ n("span", { children: "审批结果:" }),
|
|
74
|
+
/* @__PURE__ */ n("span", { children: o.completionResult || "—" })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ T("span", { className: "make-app-approval-mobile-card-footer", children: [
|
|
77
|
+
/* @__PURE__ */ T("span", { className: "make-app-approval-mobile-person", children: [
|
|
78
|
+
/* @__PURE__ */ n("span", { className: "make-app-approval-mobile-avatar", "aria-hidden": "true", children: o.applicantName.slice(-2) }),
|
|
79
|
+
/* @__PURE__ */ n("span", { children: o.applicantName || "—" })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ n("span", { children: t.tab === "approved" ? `完成于 ${o.completionTime || "—"}` : `申请于 ${o.applicationTime || "—"}` })
|
|
82
|
+
] })
|
|
83
|
+
] }, o.id)),
|
|
84
|
+
!g.rows.length && /* @__PURE__ */ n("p", { className: "make-app-approval-mobile-feedback", children: "暂无审批记录" }),
|
|
85
|
+
d === "error" ? /* @__PURE__ */ T("div", { role: "alert", className: "make-app-approval-mobile-feedback", children: [
|
|
86
|
+
"部分审批记录加载失败",
|
|
87
|
+
/* @__PURE__ */ n(O, { htmlType: "button", variant: "text", onClick: () => {
|
|
88
|
+
k();
|
|
89
|
+
}, children: "重试加载" })
|
|
90
|
+
] }) : d === "loading" ? /* @__PURE__ */ n("p", { role: "status", className: "make-app-approval-mobile-feedback", children: "加载中" }) : g.rows.length < g.total ? /* @__PURE__ */ n(O, { htmlType: "button", variant: "text", onClick: () => {
|
|
91
|
+
k();
|
|
92
|
+
}, children: "加载更多" }) : g.rows.length > 0 && /* @__PURE__ */ n("p", { className: "make-app-approval-mobile-feedback", children: "没有更多了" })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}, we = {
|
|
5
97
|
applicationNo: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1d212a" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-fingerprint-pattern" aria-hidden="true"><path d="M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"></path><path d="M14 13.12c0 2.38 0 6.38-1 8.88"></path><path d="M17.29 21.02c.12-.6.43-2.3.5-3.02"></path><path d="M2 12a10 10 0 0 1 18-6"></path><path d="M2 16h.01"></path><path d="M21.8 16c.2-2 .131-5.354 0-6"></path><path d="M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2"></path><path d="M8.65 22c.21-.66.45-1.32.57-2"></path><path d="M9 6.8a6 6 0 0 1 9 5.2v2"></path></svg>',
|
|
6
98
|
applicationType: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1d212a" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type" aria-hidden="true"><path d="M12 4v16"></path><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"></path><path d="M9 20h6"></path></svg>',
|
|
7
99
|
applicantName: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1d212a" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user-round" aria-hidden="true"><circle cx="12" cy="8" r="5"></circle><path d="M20 21a8 8 0 0 0-16 0"></path></svg>',
|
|
8
100
|
applicationTime: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1d212a" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-calendar-clock" aria-hidden="true"><path d="M16 14v2.2l1.6 1"></path><path d="M16 2v3"></path><path d="M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338"></path><path d="M3 9h5.859"></path><path d="M8 2v3"></path><circle cx="16" cy="16" r="6"></circle></svg>'
|
|
9
|
-
},
|
|
10
|
-
Object.entries(
|
|
11
|
-
),
|
|
101
|
+
}, ke = Object.fromEntries(
|
|
102
|
+
Object.entries(we).map(([e, t]) => [e, `data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`])
|
|
103
|
+
), oe = 64, ne = [
|
|
12
104
|
{ key: "applicationNo", title: "申请单ID", width: 260 },
|
|
13
105
|
{ key: "applicationType", title: "业务表单", width: 180 },
|
|
14
106
|
{ key: "applicantName", title: "申请人", width: 170 },
|
|
15
107
|
{ key: "applicationTime", title: "申请时间", width: 220 }
|
|
16
|
-
],
|
|
17
|
-
const t = Math.max(0, e -
|
|
18
|
-
return
|
|
19
|
-
...
|
|
20
|
-
width:
|
|
108
|
+
], ye = ne.reduce((e, t) => e + t.width, oe), ce = (e) => {
|
|
109
|
+
const t = Math.max(0, e - ye) / ne.length;
|
|
110
|
+
return ne.map((h) => ({
|
|
111
|
+
...h,
|
|
112
|
+
width: h.width + t,
|
|
21
113
|
showEllipsis: !0,
|
|
22
114
|
sortable: !1,
|
|
23
|
-
prefixRender: () => ({ icon:
|
|
115
|
+
prefixRender: () => ({ icon: ke[h.key] })
|
|
24
116
|
}));
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return { rows: e.rows, total: e.total };
|
|
35
|
-
}, Se = ({ table: e, query: t, initialPage: l, loadPage: B, onChange: $, retryViewport: O, onReload: F, logger: R }) => {
|
|
36
|
-
const f = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Set();
|
|
37
|
-
let C = [];
|
|
38
|
-
const c = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new Set();
|
|
39
|
-
let w = l, b = l.total, h = 0, k = !1, S = !1, M;
|
|
40
|
-
const E = (r) => Number.isSafeInteger(r) && r >= 0 && r * t.pageSize < b, v = (r, a, n) => A(R, { operation: "list", phase: a, tab: t.tab, page: r + 1, pageSize: t.pageSize, rowCount: n }), m = () => {
|
|
41
|
-
k || $({ total: b, rows: C, failed: S || g.size > 0, loading: f.size > 0 });
|
|
42
|
-
}, N = (r) => {
|
|
43
|
-
r.finished || (r.finished = !0, r.removeAbort(), f.get(r.page) === r && f.delete(r.page), e.markPageLoadFailed(r.page, r.request), r.controller.abort(), v(r.page, "cancel"));
|
|
117
|
+
}, Se = (e) => e == null || e === "UNSUBMITTED" ? "状态未知" : fe(e).label, Ne = ({ table: e, query: t, initialPage: h, loadPage: H, onChange: j, retryViewport: B, onReload: E, logger: g }) => {
|
|
118
|
+
const w = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set();
|
|
119
|
+
let z = [];
|
|
120
|
+
const d = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new Set();
|
|
121
|
+
let s = h, M = h.total, R = 0, c = !1, k = !1, x;
|
|
122
|
+
const O = (r) => Number.isSafeInteger(r) && r >= 0 && r * t.pageSize < M, o = (r, a, u) => I(g, { operation: "list", phase: a, tab: t.tab, page: r + 1, pageSize: t.pageSize, rowCount: u }), l = () => {
|
|
123
|
+
c || j({ total: M, rows: z, failed: k || N.size > 0, loading: w.size > 0 });
|
|
124
|
+
}, y = (r) => {
|
|
125
|
+
r.finished || (r.finished = !0, r.removeAbort(), w.get(r.page) === r && w.delete(r.page), e.markPageLoadFailed(r.page, r.request), r.controller.abort(), o(r.page, "cancel"));
|
|
44
126
|
}, p = (r) => {
|
|
45
|
-
|
|
46
|
-
const a = e.getPagesInView() ?? [],
|
|
47
|
-
for (const
|
|
48
|
-
for (const
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
return
|
|
127
|
+
R = r;
|
|
128
|
+
const a = e.getPagesInView() ?? [], u = new Set([R, ...a].flatMap((v) => [v - 1, v, v + 1]).filter(O));
|
|
129
|
+
for (const v of w.values()) u.has(v.page) || y(v);
|
|
130
|
+
for (const v of N) u.has(v) || N.delete(v);
|
|
131
|
+
}, C = (r, a, u) => {
|
|
132
|
+
const v = a.rows.map((S) => {
|
|
133
|
+
const K = { ...S, statusLabel: Se(S.processStatus) };
|
|
134
|
+
return d.set(K, S), K;
|
|
53
135
|
});
|
|
54
|
-
if (!e.setVirtualPageData(
|
|
55
|
-
|
|
136
|
+
if (!e.setVirtualPageData(v, r, a.total, u)) {
|
|
137
|
+
o(r, "skip");
|
|
56
138
|
return;
|
|
57
139
|
}
|
|
58
|
-
|
|
140
|
+
M = a.total;
|
|
59
141
|
try {
|
|
60
|
-
|
|
61
|
-
} catch (
|
|
62
|
-
|
|
63
|
-
for (const
|
|
64
|
-
throw
|
|
142
|
+
z = ee({ rows: e.getTableData() ?? [], total: M }, Number.MAX_SAFE_INTEGER).rows.map((S) => d.get(S) ?? S);
|
|
143
|
+
} catch (S) {
|
|
144
|
+
k = !0, z = [], s = void 0, x && clearTimeout(x), x = void 0;
|
|
145
|
+
for (const K of w.values()) y(K);
|
|
146
|
+
throw S;
|
|
65
147
|
}
|
|
66
|
-
|
|
67
|
-
for (const
|
|
68
|
-
!
|
|
69
|
-
},
|
|
70
|
-
if (
|
|
71
|
-
const r = [...
|
|
148
|
+
s && s.total !== M && (s = void 0), N.delete(r);
|
|
149
|
+
for (const S of w.values()) O(S.page) || y(S);
|
|
150
|
+
!O(r) && r > 0 && e.scrollToRow(Math.max(0, M - 1)), o(r, "success", a.rows.length);
|
|
151
|
+
}, D = () => {
|
|
152
|
+
if (c || x) return;
|
|
153
|
+
const r = [...w.values()].filter((a) => !a.running && !a.finished).sort((a, u) => Math.abs(a.page - R) - Math.abs(u.page - R) || a.page - u.page);
|
|
72
154
|
for (const a of r) {
|
|
73
|
-
if (
|
|
74
|
-
a.running = !0,
|
|
155
|
+
if (f.size >= 2) break;
|
|
156
|
+
a.running = !0, f.add(a), o(a.page, "start"), (async () => {
|
|
75
157
|
try {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
a.finished = !0, a.removeAbort(),
|
|
158
|
+
const u = await H({ ...t, page: a.page + 1 }, { signal: a.controller.signal });
|
|
159
|
+
if (c || a.finished || a.controller.signal.aborted) return;
|
|
160
|
+
const v = ee(u, t.pageSize);
|
|
161
|
+
a.finished = !0, a.removeAbort(), w.delete(a.page), C(a.page, v, a.request);
|
|
80
162
|
} catch {
|
|
81
|
-
!
|
|
163
|
+
!c && !a.controller.signal.aborted && (N.add(a.page), o(a.page, "error"), e.markPageLoadFailed(a.page, a.request));
|
|
82
164
|
} finally {
|
|
83
|
-
a.finished || (a.finished = !0, a.removeAbort(),
|
|
165
|
+
a.finished || (a.finished = !0, a.removeAbort(), w.get(a.page) === a && w.delete(a.page)), f.delete(a), l(), D();
|
|
84
166
|
}
|
|
85
167
|
})();
|
|
86
168
|
}
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
169
|
+
l();
|
|
170
|
+
}, F = () => {
|
|
171
|
+
x && clearTimeout(x), x = setTimeout(() => {
|
|
172
|
+
x = void 0, D();
|
|
91
173
|
}, 120);
|
|
92
174
|
};
|
|
93
175
|
return {
|
|
94
176
|
load(r, a) {
|
|
95
|
-
if (a.useRequestIdentity(),
|
|
96
|
-
e.markPageLoadFailed(r, a),
|
|
177
|
+
if (a.useRequestIdentity(), c || k || a.signal.aborted || !O(r)) {
|
|
178
|
+
e.markPageLoadFailed(r, a), o(r, "skip");
|
|
97
179
|
return;
|
|
98
180
|
}
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
|
|
181
|
+
const u = w.get(r);
|
|
182
|
+
if (u?.request === a && !u.finished) return;
|
|
183
|
+
if (u && y(u), p(r), r === 0 && s) {
|
|
184
|
+
const S = s;
|
|
185
|
+
s = void 0;
|
|
104
186
|
try {
|
|
105
|
-
|
|
187
|
+
C(0, S, a);
|
|
106
188
|
} catch {
|
|
107
|
-
|
|
189
|
+
N.add(r), e.markPageLoadFailed(r, a), o(r, "error");
|
|
108
190
|
}
|
|
109
|
-
|
|
191
|
+
l();
|
|
110
192
|
return;
|
|
111
193
|
}
|
|
112
|
-
const
|
|
113
|
-
} },
|
|
114
|
-
|
|
194
|
+
const v = { page: r, request: a, controller: new AbortController(), running: !1, finished: !1, removeAbort: () => {
|
|
195
|
+
} }, $ = () => {
|
|
196
|
+
y(v), l();
|
|
115
197
|
};
|
|
116
|
-
a.signal.addEventListener("abort",
|
|
198
|
+
a.signal.addEventListener("abort", $, { once: !0 }), v.removeAbort = () => a.signal.removeEventListener("abort", $), w.set(r, v), F(), l();
|
|
117
199
|
},
|
|
118
200
|
viewportChanged() {
|
|
119
|
-
if (
|
|
201
|
+
if (c) return;
|
|
120
202
|
const r = e.getPagesInView();
|
|
121
|
-
r?.length && (p(r[0]),
|
|
203
|
+
r?.length && (p(r[0]), w.size && F(), l());
|
|
122
204
|
},
|
|
123
205
|
retry() {
|
|
124
|
-
if (!
|
|
125
|
-
if (
|
|
126
|
-
|
|
206
|
+
if (!c) {
|
|
207
|
+
if (k) {
|
|
208
|
+
E();
|
|
127
209
|
return;
|
|
128
210
|
}
|
|
129
|
-
|
|
211
|
+
N.size !== 0 && (N.clear(), B(), l());
|
|
130
212
|
}
|
|
131
213
|
},
|
|
132
214
|
dispose() {
|
|
133
|
-
|
|
134
|
-
for (const r of
|
|
135
|
-
|
|
215
|
+
c = !0, x && clearTimeout(x), x = void 0;
|
|
216
|
+
for (const r of w.values()) y(r);
|
|
217
|
+
z = [], N.clear(), s = void 0;
|
|
136
218
|
}
|
|
137
219
|
};
|
|
138
|
-
},
|
|
139
|
-
const t =
|
|
140
|
-
return e.initialPage ? /* @__PURE__ */
|
|
141
|
-
|
|
220
|
+
}, pe = 40, Te = (e) => {
|
|
221
|
+
const t = V(void 0);
|
|
222
|
+
return e.initialPage ? /* @__PURE__ */ n(
|
|
223
|
+
Ce,
|
|
142
224
|
{
|
|
143
225
|
...e,
|
|
144
226
|
initialPage: e.initialPage,
|
|
145
227
|
restoreScroll: t.current?.query === e.query ? t.current.position : void 0,
|
|
146
|
-
rememberScroll: (
|
|
147
|
-
t.current = { query: e.query, position:
|
|
228
|
+
rememberScroll: (h) => {
|
|
229
|
+
t.current = { query: e.query, position: h };
|
|
148
230
|
}
|
|
149
231
|
}
|
|
150
|
-
) : /* @__PURE__ */
|
|
151
|
-
},
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const
|
|
232
|
+
) : /* @__PURE__ */ n("div", { className: "make-app-approval-canvas", role: "group", "aria-label": "审批记录表格" });
|
|
233
|
+
}, Ce = ({ components: { Button: e }, initialPage: t, query: h, provider: H, themeKey: j, onOpen: B, onReload: E, logger: g, restoreScroll: w, rememberScroll: f }) => {
|
|
234
|
+
const z = V(null), d = V(null), N = V(null), [s, M] = L(!1), [R, c] = L(0), [k, x] = L({ ...t, failed: !1, loading: !1 }), O = V(t.rows), o = V(w), l = V({ provider: H, onOpen: B, onReload: E, logger: g, rememberScroll: f });
|
|
235
|
+
l.current = { provider: H, onOpen: B, onReload: E, logger: g, rememberScroll: f };
|
|
236
|
+
const y = V(() => {
|
|
155
237
|
});
|
|
156
|
-
return
|
|
157
|
-
const p =
|
|
238
|
+
return J(() => {
|
|
239
|
+
const p = z.current;
|
|
158
240
|
if (!p) return;
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
241
|
+
let C = !1, D, F, r, a, u, v = t.total;
|
|
242
|
+
I(l.current.logger, { operation: "table", phase: "start" });
|
|
243
|
+
const $ = () => {
|
|
244
|
+
C || (M(!0), I(l.current.logger, { operation: "table", phase: "error" }));
|
|
163
245
|
};
|
|
164
|
-
return import("@qfei-design/canvas-table").then((
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
if (!
|
|
246
|
+
return import("@qfei-design/canvas-table").then((S) => {
|
|
247
|
+
if (C) return;
|
|
248
|
+
const K = () => {
|
|
249
|
+
const m = d.current, A = m?.getScrollState();
|
|
250
|
+
m && A && S.globalEventBus.emitWithNamespace("scroll:change", m.tableId, A);
|
|
251
|
+
}, U = (m = !1) => {
|
|
252
|
+
if (!C)
|
|
171
253
|
try {
|
|
172
|
-
const { width:
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
rowHeight:
|
|
254
|
+
const { width: A, height: Y } = p.getBoundingClientRect();
|
|
255
|
+
if (A <= 0 || Y <= 0 || !m && u?.width === A && u.height === Y) return;
|
|
256
|
+
const W = getComputedStyle(p), ie = {
|
|
257
|
+
rowHeight: pe,
|
|
176
258
|
headerHeight: 40,
|
|
177
259
|
fontSize: 14,
|
|
178
|
-
fontFamily:
|
|
179
|
-
...
|
|
180
|
-
...
|
|
181
|
-
...
|
|
182
|
-
...
|
|
183
|
-
}, he = Math.max(Math.ceil(300 /
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
canvasWidth:
|
|
188
|
-
canvasHeight:
|
|
189
|
-
style:
|
|
190
|
-
virtualOptions:
|
|
191
|
-
...
|
|
192
|
-
}),
|
|
193
|
-
const
|
|
194
|
-
|
|
260
|
+
fontFamily: W.fontFamily || "Arial, sans-serif",
|
|
261
|
+
...W.color ? { textColor: W.color } : {},
|
|
262
|
+
...W.getPropertyValue("--make-approval-bg").trim() ? { rowBgColor: W.getPropertyValue("--make-approval-bg").trim() } : {},
|
|
263
|
+
...W.getPropertyValue("--make-approval-header").trim() ? { headerBgColor: W.getPropertyValue("--make-approval-header").trim() } : {},
|
|
264
|
+
...W.getPropertyValue("--make-approval-border").trim() ? { borderColor: W.getPropertyValue("--make-approval-border").trim() } : {}
|
|
265
|
+
}, he = Math.max(Math.ceil(300 / h.pageSize), Math.ceil(Y * 3 / pe / h.pageSize) + 2) * h.pageSize, le = { enabled: !0, totalRowCount: v, pageSize: h.pageSize, maxCachedRows: he };
|
|
266
|
+
if (d.current) {
|
|
267
|
+
const b = u?.width !== A ? ce(A) : void 0;
|
|
268
|
+
if (d.current.updateProps({
|
|
269
|
+
canvasWidth: A,
|
|
270
|
+
canvasHeight: Y,
|
|
271
|
+
style: ie,
|
|
272
|
+
virtualOptions: le,
|
|
273
|
+
...b ? { columns: b } : {}
|
|
274
|
+
}), b) {
|
|
275
|
+
const P = d.current.getScrollState(), X = Math.max(0, b.reduce((_, ae) => _ + ae.width, oe) - A);
|
|
276
|
+
P && P.scrollX > X && d.current.scrollTo(X, P.scrollY, !1);
|
|
195
277
|
}
|
|
196
|
-
|
|
278
|
+
u = { width: A, height: Y }, K();
|
|
197
279
|
return;
|
|
198
280
|
}
|
|
199
|
-
|
|
200
|
-
columns:
|
|
201
|
-
canvasWidth:
|
|
202
|
-
canvasHeight:
|
|
203
|
-
style:
|
|
281
|
+
d.current = new S.CanvasTableComponent(p, {
|
|
282
|
+
columns: ce(A),
|
|
283
|
+
canvasWidth: A,
|
|
284
|
+
canvasHeight: Y,
|
|
285
|
+
style: ie,
|
|
204
286
|
rowKey: "id",
|
|
205
|
-
showSN: { enabled: !0, width:
|
|
206
|
-
virtualOptions:
|
|
287
|
+
showSN: { enabled: !0, width: oe, formatter: (b, P) => P + 1 },
|
|
288
|
+
virtualOptions: le,
|
|
207
289
|
selectable: { enabled: !1 },
|
|
208
290
|
rowSortable: { enabled: !1 },
|
|
209
291
|
editApplyMode: "controlled",
|
|
210
|
-
customEdit: (
|
|
211
|
-
|
|
292
|
+
customEdit: (b) => {
|
|
293
|
+
b.cancel();
|
|
212
294
|
},
|
|
213
295
|
emptyStateOptions: { text: "暂无审批记录" },
|
|
214
296
|
bodyRowHeadSuffixOptions: {
|
|
215
297
|
enabled: !0,
|
|
216
298
|
width: 20,
|
|
217
|
-
render: ({ group:
|
|
218
|
-
const
|
|
219
|
-
|
|
299
|
+
render: ({ group: b, x: P, height: X, rowData: _ }) => {
|
|
300
|
+
const ae = _?.id, Q = new S.RectShape({ name: "approval-open", x: P, y: X / 2 - 10, cursor: "pointer", tooltip: "查看审批详情", attrs: { width: 20, height: 20, fill: "transparent", stroke: "transparent" } });
|
|
301
|
+
Q.addChild(new S.ImgShape({ name: "approval-open-icon", x: 3, y: 3, attrs: {
|
|
220
302
|
width: 14,
|
|
221
303
|
height: 14,
|
|
222
|
-
img: "data:image/svg+xml;charset=utf-8," + encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${
|
|
223
|
-
} })),
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
}),
|
|
304
|
+
img: "data:image/svg+xml;charset=utf-8," + encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${W.color || "#64748b"}" stroke-width="1.8"><path d="M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5"/></svg>`)
|
|
305
|
+
} })), Q.on("mousedown", (re) => re.stopPropagation?.()), Q.on("click", (re) => {
|
|
306
|
+
re.stopPropagation?.();
|
|
307
|
+
const se = O.current.find((ue) => ue.id === ae);
|
|
308
|
+
se && l.current.onOpen(se);
|
|
309
|
+
}), b.addChild(Q);
|
|
228
310
|
}
|
|
229
311
|
}
|
|
230
312
|
});
|
|
231
|
-
const G =
|
|
232
|
-
|
|
233
|
-
const
|
|
313
|
+
const G = d.current;
|
|
314
|
+
u = { width: A, height: Y };
|
|
315
|
+
const te = Ne({
|
|
234
316
|
table: G,
|
|
235
|
-
query:
|
|
317
|
+
query: h,
|
|
236
318
|
initialPage: t,
|
|
237
319
|
// 公开滚动同步事件会重新检测缺页,不移动视口,也不复用失败身份。
|
|
238
|
-
retryViewport:
|
|
239
|
-
onReload: () =>
|
|
240
|
-
loadPage: (
|
|
241
|
-
logger: (
|
|
242
|
-
onChange: (
|
|
243
|
-
|
|
320
|
+
retryViewport: K,
|
|
321
|
+
onReload: () => l.current.onReload(),
|
|
322
|
+
loadPage: (b, P) => l.current.provider.loadPage(b, P),
|
|
323
|
+
logger: (b) => I(l.current.logger, b),
|
|
324
|
+
onChange: (b) => {
|
|
325
|
+
C || (v = b.total, O.current = b.rows, x((P) => P.total === b.total && P.failed === b.failed && P.loading === b.loading && P.rows.length === b.rows.length && P.rows.every((X, _) => X === b.rows[_]) ? P : b));
|
|
244
326
|
}
|
|
245
327
|
});
|
|
246
|
-
|
|
328
|
+
N.current = te, F = S.globalEventBus.onWithNamespace("data:load", G.tableId, (b, P) => te.load(b, P)), r = S.globalEventBus.onWithNamespace("scroll:change", G.tableId, () => te.viewportChanged()), o.current && G.scrollTo(o.current.scrollX, o.current.scrollY), M(!1), I(l.current.logger, { operation: "table", phase: "success" });
|
|
247
329
|
} catch {
|
|
248
|
-
|
|
330
|
+
$();
|
|
249
331
|
}
|
|
250
332
|
};
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
}).catch(
|
|
255
|
-
|
|
256
|
-
},
|
|
333
|
+
y.current = () => U(!0);
|
|
334
|
+
const i = () => U();
|
|
335
|
+
D = new ResizeObserver(i), D.observe(p), window.addEventListener("resize", i), a = () => window.removeEventListener("resize", i), U();
|
|
336
|
+
}).catch($), () => {
|
|
337
|
+
C = !0, D?.disconnect(), a?.(), y.current = () => {
|
|
338
|
+
}, d.current && (o.current = d.current.getScrollState(), o.current && l.current.rememberScroll(o.current)), F?.(), r?.(), N.current?.dispose(), N.current = null, d.current?.destroy(), d.current = null, I(l.current.logger, { operation: "table", phase: "destroy" });
|
|
257
339
|
};
|
|
258
|
-
}, [t,
|
|
259
|
-
|
|
260
|
-
}, [
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
340
|
+
}, [t, h, R]), J(() => {
|
|
341
|
+
y.current();
|
|
342
|
+
}, [j]), /* @__PURE__ */ T("div", { className: "make-app-approval-table-frame", "aria-busy": k.loading, children: [
|
|
343
|
+
/* @__PURE__ */ n("div", { ref: z, className: "make-app-approval-canvas", role: "group", "aria-label": "审批记录表格" }),
|
|
344
|
+
s && /* @__PURE__ */ T("div", { className: "make-app-approval-overlay", role: "alert", children: [
|
|
263
345
|
"表格加载失败 ",
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
|
|
346
|
+
/* @__PURE__ */ n(e, { htmlType: "button", variant: "default", onClick: () => {
|
|
347
|
+
M(!1), c((p) => p + 1);
|
|
266
348
|
}, children: "重新加载表格" })
|
|
267
349
|
] }),
|
|
268
|
-
!
|
|
350
|
+
!s && k.failed && /* @__PURE__ */ T("div", { className: "make-app-approval-table-feedback", role: "alert", children: [
|
|
269
351
|
"部分审批记录加载失败 ",
|
|
270
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ n(e, { htmlType: "button", variant: "default", onClick: () => N.current?.retry(), children: "重试加载" })
|
|
271
353
|
] }),
|
|
272
|
-
!
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
354
|
+
!s && !k.failed && k.loading && /* @__PURE__ */ T("div", { className: "make-app-approval-table-loading", role: "status", "aria-label": "正在加载审批记录", "aria-live": "polite", children: [
|
|
355
|
+
/* @__PURE__ */ n("span", { className: "make-app-approval-loading-spinner", "aria-hidden": "true" }),
|
|
356
|
+
/* @__PURE__ */ n("span", { children: "加载中" })
|
|
275
357
|
] }),
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ T("ul", { className: "make-app-approval-accessible-rows", "aria-label": "审批记录文字视图", children: [
|
|
359
|
+
k.total === 0 && /* @__PURE__ */ n("li", { children: "暂无审批记录" }),
|
|
360
|
+
k.rows.map((p) => /* @__PURE__ */ T("li", { children: [
|
|
361
|
+
/* @__PURE__ */ T("span", { children: [
|
|
280
362
|
p.applicationNo,
|
|
281
363
|
",",
|
|
282
364
|
p.applicationType,
|
|
@@ -286,7 +368,7 @@ const ve = {
|
|
|
286
368
|
p.applicationTime,
|
|
287
369
|
"。"
|
|
288
370
|
] }),
|
|
289
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ T(e, { htmlType: "button", variant: "text", onClick: () => B(p), children: [
|
|
290
372
|
"打开 ",
|
|
291
373
|
p.applicationNo || p.applicationType,
|
|
292
374
|
" 的审批详情"
|
|
@@ -294,124 +376,150 @@ const ve = {
|
|
|
294
376
|
] }, p.id))
|
|
295
377
|
] })
|
|
296
378
|
] });
|
|
297
|
-
},
|
|
298
|
-
const [
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
let
|
|
379
|
+
}, Me = [], Re = (e, t, h, H) => {
|
|
380
|
+
const [j, B] = L(0), [E, g] = L(), w = V({ provider: e, logger: H });
|
|
381
|
+
w.current = { provider: e, logger: H };
|
|
382
|
+
const f = me(() => ({}), [t, h, j]);
|
|
383
|
+
J(() => {
|
|
384
|
+
const d = new AbortController(), { provider: N, logger: s } = w.current, M = { operation: "list", tab: t.tab, page: t.page, pageSize: t.pageSize };
|
|
385
|
+
I(s, { ...M, phase: "start" });
|
|
386
|
+
let R = !1;
|
|
305
387
|
return (async () => {
|
|
306
388
|
try {
|
|
307
|
-
if (await Promise.resolve(),
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
|
|
389
|
+
if (await Promise.resolve(), d.signal.aborted) return;
|
|
390
|
+
const c = await N.loadPage(t, { signal: d.signal });
|
|
391
|
+
if (d.signal.aborted) return;
|
|
392
|
+
const k = ee(c, t.pageSize);
|
|
393
|
+
R = !0, g({ ...k, token: f, status: "success" }), I(s, { ...M, phase: "success", rowCount: k.rows.length });
|
|
312
394
|
} catch {
|
|
313
|
-
if (
|
|
314
|
-
|
|
395
|
+
if (d.signal.aborted) return;
|
|
396
|
+
R = !0, g({ token: f, status: "error", rows: Me, total: 0 }), I(s, { ...M, phase: "error" });
|
|
315
397
|
}
|
|
316
398
|
})(), () => {
|
|
317
|
-
|
|
399
|
+
d.abort(), R || I(s, { ...M, phase: "cancel" });
|
|
318
400
|
};
|
|
319
|
-
}, [t,
|
|
320
|
-
const
|
|
401
|
+
}, [t, f]);
|
|
402
|
+
const z = E?.token === f ? E : void 0;
|
|
321
403
|
return {
|
|
322
|
-
initialPage:
|
|
323
|
-
total:
|
|
324
|
-
status:
|
|
325
|
-
reload: () =>
|
|
404
|
+
initialPage: z?.status === "success" ? z : void 0,
|
|
405
|
+
total: z?.total ?? 0,
|
|
406
|
+
status: z?.status ?? "loading",
|
|
407
|
+
reload: () => B((d) => d + 1)
|
|
326
408
|
};
|
|
327
|
-
},
|
|
409
|
+
}, Z = { keyword: "", applicantId: "", processStatus: "", startDate: "", endDate: "" }, Pe = [{ value: "pending", label: "待处理" }, { value: "approved", label: "已完成" }], q = (e) => {
|
|
328
410
|
if (e === "") return !0;
|
|
329
411
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(e)) return !1;
|
|
330
412
|
const t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
331
413
|
return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e;
|
|
332
|
-
},
|
|
333
|
-
const { Input:
|
|
334
|
-
|
|
335
|
-
|
|
414
|
+
}, xe = ({ components: e, provider: t, onOpenApproval: h, applicantOptions: H = [], pageSize: j = 20, refreshKey: B, themeKey: E, logger: g, className: w, presentation: f = "desktop" }) => {
|
|
415
|
+
const { Input: z, Select: d, DateRangePicker: N, Button: s, Tabs: M } = e, R = ge(), [c, k] = L(Z), [x, O] = L(0), [o, l] = L(""), [y, p] = L(""), [C, D] = L({ ...Z, tab: "pending", page: 1, pageSize: j }), { initialPage: F, status: r, reload: a } = Re(t, C, B, g), u = V(!1), v = V(!0);
|
|
416
|
+
J(() => (v.current = !0, () => {
|
|
417
|
+
v.current = !1;
|
|
336
418
|
}), []);
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
339
|
-
|
|
419
|
+
const $ = r === "loading", S = async (i) => {
|
|
420
|
+
if (!u.current) {
|
|
421
|
+
u.current = !0, p(""), I(g, { operation: "open", phase: "start" });
|
|
340
422
|
try {
|
|
341
|
-
await
|
|
423
|
+
await h(i), I(g, { operation: "open", phase: "success" });
|
|
342
424
|
} catch {
|
|
343
|
-
|
|
425
|
+
v.current && p("审批详情打开失败,请重试"), I(g, { operation: "open", phase: "error" });
|
|
344
426
|
} finally {
|
|
345
|
-
|
|
427
|
+
u.current = !1;
|
|
346
428
|
}
|
|
347
429
|
}
|
|
348
|
-
},
|
|
349
|
-
|
|
430
|
+
}, K = (i) => {
|
|
431
|
+
i !== C.tab && (l(""), p(""), D((m) => ({ ...m, tab: i, page: 1 })));
|
|
432
|
+
}, U = (i) => {
|
|
433
|
+
k((m) => ({ ...m, ...i })), f === "mobile" && (l(""), p(""), D((m) => ({ ...m, ...i, page: 1 })));
|
|
350
434
|
};
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
if (
|
|
354
|
-
|
|
435
|
+
return /* @__PURE__ */ n("section", { className: ["make-app-approval", f === "mobile" && "make-app-approval--mobile", w].filter(Boolean).join(" "), "aria-label": "我的审批", children: /* @__PURE__ */ T(M, { items: Pe, value: C.tab, onChange: K, ariaLabel: "审批分类", children: [
|
|
436
|
+
/* @__PURE__ */ T("form", { className: "make-app-approval-filters", onSubmit: (i) => {
|
|
437
|
+
if (i.preventDefault(), f === "mobile") {
|
|
438
|
+
l(""), p(""), D((m) => ({ ...m, keyword: c.keyword.trim(), page: 1 }));
|
|
355
439
|
return;
|
|
356
440
|
}
|
|
357
|
-
if (
|
|
358
|
-
|
|
441
|
+
if (!q(c.startDate) || !q(c.endDate)) {
|
|
442
|
+
l("请选择有效日期");
|
|
359
443
|
return;
|
|
360
444
|
}
|
|
361
|
-
|
|
445
|
+
if (c.startDate && c.endDate && c.startDate > c.endDate) {
|
|
446
|
+
l("开始日期不能晚于结束日期");
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
l(""), p(""), D((m) => ({ ...m, ...c, keyword: c.keyword.trim(), page: 1 }));
|
|
362
450
|
}, children: [
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
365
|
-
|
|
451
|
+
/* @__PURE__ */ T("div", { className: "make-app-approval-filter-field", children: [
|
|
452
|
+
f === "mobile" && /* @__PURE__ */ n(s, { htmlType: "submit", variant: "text", ariaLabel: "搜索申请单ID", children: /* @__PURE__ */ T("svg", { "aria-hidden": "true", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
453
|
+
/* @__PURE__ */ n("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
|
|
454
|
+
/* @__PURE__ */ n("path", { d: "m16 16 5 5" })
|
|
455
|
+
] }) }),
|
|
456
|
+
/* @__PURE__ */ n(z, { id: `${R}-keyword`, ariaLabel: "申请单ID", placeholder: "搜索申请单ID", value: c.keyword, onChange: (i) => {
|
|
457
|
+
k((m) => ({ ...m, keyword: i })), f === "mobile" && !i && D((m) => ({ ...m, keyword: "", page: 1 }));
|
|
458
|
+
} })
|
|
459
|
+
] }),
|
|
460
|
+
/* @__PURE__ */ n("div", { className: "make-app-approval-date-control", children: /* @__PURE__ */ n(
|
|
461
|
+
N,
|
|
366
462
|
{
|
|
367
|
-
id: `${
|
|
463
|
+
id: `${R}-period`,
|
|
368
464
|
ariaLabel: "申请时间",
|
|
369
465
|
placeholder: ["开始日期", "结束日期"],
|
|
370
|
-
value: [
|
|
371
|
-
onChange: ([
|
|
466
|
+
value: [c.startDate, c.endDate],
|
|
467
|
+
onChange: ([i, m]) => {
|
|
468
|
+
if (f === "mobile" && (!q(i) || !q(m) || i && m && i > m)) {
|
|
469
|
+
l("请选择有效日期范围");
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (f === "mobile" && !!i != !!m) {
|
|
473
|
+
k((A) => ({ ...A, startDate: i, endDate: m }));
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
U({ startDate: i, endDate: m });
|
|
477
|
+
}
|
|
372
478
|
},
|
|
373
|
-
|
|
479
|
+
x
|
|
374
480
|
) }),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
|
|
481
|
+
/* @__PURE__ */ n("div", { className: "make-app-approval-filter-field", children: /* @__PURE__ */ n(
|
|
482
|
+
d,
|
|
377
483
|
{
|
|
378
|
-
id: `${
|
|
484
|
+
id: `${R}-applicant`,
|
|
379
485
|
ariaLabel: "申请人",
|
|
380
486
|
purpose: "applicant",
|
|
381
|
-
value:
|
|
382
|
-
options: [{ value: "", label: "全部申请人" }, ...
|
|
383
|
-
onChange: (
|
|
487
|
+
value: c.applicantId ?? "",
|
|
488
|
+
options: [{ value: "", label: "全部申请人" }, ...H.filter((i) => i.value !== "")],
|
|
489
|
+
onChange: (i) => U({ applicantId: i })
|
|
384
490
|
}
|
|
385
491
|
) }),
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
k(
|
|
492
|
+
f !== "mobile" && /* @__PURE__ */ T("div", { className: "make-app-approval-filter-actions", children: [
|
|
493
|
+
/* @__PURE__ */ n(s, { htmlType: "submit", variant: "primary", children: "查询" }),
|
|
494
|
+
/* @__PURE__ */ n(s, { htmlType: "button", variant: "default", onClick: () => {
|
|
495
|
+
k(Z), O((i) => i + 1), l(""), p(""), D((i) => ({ ...i, ...Z, page: 1 }));
|
|
390
496
|
}, children: "重置" }),
|
|
391
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ n(s, { htmlType: "button", variant: "default", disabled: $, loading: $, onClick: a, children: "刷新" })
|
|
392
498
|
] })
|
|
393
499
|
] }),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
500
|
+
o && /* @__PURE__ */ n("p", { role: "alert", className: "make-app-approval-error", children: o }),
|
|
501
|
+
y && /* @__PURE__ */ n("p", { role: "alert", className: "make-app-approval-error", children: y }),
|
|
502
|
+
/* @__PURE__ */ T("div", { className: "make-app-approval-results", "aria-busy": $, children: [
|
|
503
|
+
f === "mobile" ? F && /* @__PURE__ */ n(be, { initialPage: F, query: C, provider: t, onReload: a, components: e, onOpen: (i) => {
|
|
504
|
+
S(i);
|
|
505
|
+
}, logger: g }, JSON.stringify([C, B, F])) : /* @__PURE__ */ n(Te, { components: e, initialPage: F, query: C, provider: t, onOpen: (i) => {
|
|
506
|
+
S(i);
|
|
507
|
+
}, onReload: a, themeKey: E, logger: g }),
|
|
508
|
+
$ && /* @__PURE__ */ n("div", { className: "make-app-approval-overlay", role: "status", children: "正在加载审批记录…" }),
|
|
509
|
+
r === "error" && /* @__PURE__ */ T("div", { className: "make-app-approval-overlay", role: "alert", children: [
|
|
510
|
+
/* @__PURE__ */ n("span", { children: "审批列表加载失败,请重试" }),
|
|
511
|
+
/* @__PURE__ */ n(s, { htmlType: "button", variant: "default", onClick: a, children: "重试" })
|
|
404
512
|
] })
|
|
405
513
|
] })
|
|
406
514
|
] }) });
|
|
407
|
-
},
|
|
515
|
+
}, Ee = (e) => {
|
|
408
516
|
const t = e.pageSize ?? 20;
|
|
409
517
|
if (!e.scopeKey.trim()) throw new Error("MyApprovalsPage requires scopeKey");
|
|
410
|
-
for (const
|
|
411
|
-
if (!e.components?.[
|
|
518
|
+
for (const h of ["Input", "Select", "DateRangePicker", "Button", "Tabs"])
|
|
519
|
+
if (!e.components?.[h]) throw new Error(`MyApprovalsPage requires components.${h}`);
|
|
412
520
|
if (!Number.isSafeInteger(t) || t < 1 || t > 200) throw new Error("pageSize must be an integer from 1 to 200");
|
|
413
|
-
return /* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ n(xe, { ...e, pageSize: t }, JSON.stringify([e.scopeKey, t]));
|
|
414
522
|
};
|
|
415
523
|
export {
|
|
416
|
-
|
|
524
|
+
Ee as MyApprovalsPage
|
|
417
525
|
};
|