@yuku123/z-frontend-common 1.1.0 → 1.1.2
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/README.md +22 -10
- package/dist/ComponentDoc-C4XFElke.js +1657 -0
- package/dist/index.js +160 -154
- package/dist/ui-echarts.js +54 -0
- package/dist/ui.js +19 -19
- package/package.json +6 -2
- package/src/components/ui/ComponentDoc.jsx +890 -0
- package/src/components/ui/echarts.js +8 -0
- package/src/components/ui/index.js +3 -2
- package/src/index.js +19 -2
- package/src/services/request.js +19 -5
- package/dist/PagedTable-DyjNokXN.js +0 -1211
|
@@ -0,0 +1,1657 @@
|
|
|
1
|
+
import { jsxs as m, jsx as t, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useRef as M, useEffect as D, useCallback as ke, useMemo as G, useLayoutEffect as we, createElement as le, Fragment as O } from "react";
|
|
3
|
+
import { Button as V, Skeleton as _, Input as Ce, Breadcrumb as Re, Space as ae, Tag as se, Card as Te, Table as Ee } from "antd";
|
|
4
|
+
import { InboxOutlined as Ie, ExclamationCircleOutlined as ze, ReloadOutlined as re, SearchOutlined as Ae, ReadOutlined as Be } from "@ant-design/icons";
|
|
5
|
+
import { useNavigate as he, useInRouterContext as De } from "react-router-dom";
|
|
6
|
+
const T = {
|
|
7
|
+
// 主色 (蓝紫) - 顶导/重点按钮/链接
|
|
8
|
+
primary: "#7c3aed",
|
|
9
|
+
// violet-600
|
|
10
|
+
primaryHover: "#8b5cf6",
|
|
11
|
+
// violet-500
|
|
12
|
+
primaryActive: "#6d28d9",
|
|
13
|
+
// violet-700
|
|
14
|
+
primarySoft: "#ede9fe"
|
|
15
|
+
// violet-100 (淡背景)
|
|
16
|
+
}, E = {
|
|
17
|
+
pink: {
|
|
18
|
+
bg: "#ec4899",
|
|
19
|
+
fg: "#ffffff",
|
|
20
|
+
soft: "#fce7f3",
|
|
21
|
+
gradient: "linear-gradient(135deg, #ec4899 0%, #be185d 100%)"
|
|
22
|
+
},
|
|
23
|
+
blue: {
|
|
24
|
+
bg: "#3b82f6",
|
|
25
|
+
fg: "#ffffff",
|
|
26
|
+
soft: "#dbeafe",
|
|
27
|
+
gradient: "linear-gradient(135deg, #3b82f6 0%, #1e40af 100%)"
|
|
28
|
+
},
|
|
29
|
+
green: {
|
|
30
|
+
bg: "#10b981",
|
|
31
|
+
fg: "#ffffff",
|
|
32
|
+
soft: "#d1fae5",
|
|
33
|
+
gradient: "linear-gradient(135deg, #10b981 0%, #047857 100%)"
|
|
34
|
+
},
|
|
35
|
+
orange: {
|
|
36
|
+
bg: "#f97316",
|
|
37
|
+
fg: "#ffffff",
|
|
38
|
+
soft: "#ffedd5",
|
|
39
|
+
gradient: "linear-gradient(135deg, #f97316 0%, #c2410c 100%)"
|
|
40
|
+
},
|
|
41
|
+
violet: {
|
|
42
|
+
bg: "#8b5cf6",
|
|
43
|
+
fg: "#ffffff",
|
|
44
|
+
soft: "#ede9fe",
|
|
45
|
+
gradient: "linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%)"
|
|
46
|
+
},
|
|
47
|
+
cyan: {
|
|
48
|
+
bg: "#06b6d4",
|
|
49
|
+
fg: "#ffffff",
|
|
50
|
+
soft: "#cffafe",
|
|
51
|
+
gradient: "linear-gradient(135deg, #06b6d4 0%, #0e7490 100%)"
|
|
52
|
+
},
|
|
53
|
+
red: {
|
|
54
|
+
bg: "#ef4444",
|
|
55
|
+
fg: "#ffffff",
|
|
56
|
+
soft: "#fee2e2",
|
|
57
|
+
gradient: "linear-gradient(135deg, #ef4444 0%, #b91c1c 100%)"
|
|
58
|
+
},
|
|
59
|
+
yellow: {
|
|
60
|
+
bg: "#eab308",
|
|
61
|
+
fg: "#1f2937",
|
|
62
|
+
soft: "#fef3c7",
|
|
63
|
+
gradient: "linear-gradient(135deg, #eab308 0%, #a16207 100%)"
|
|
64
|
+
}
|
|
65
|
+
}, x = {
|
|
66
|
+
bg: "#f8fafc",
|
|
67
|
+
// 页面底色 (比 antd 默认 #f5f5f5 更冷一点, 更现代)
|
|
68
|
+
surface: "#ffffff",
|
|
69
|
+
// 卡片表面
|
|
70
|
+
surfaceAlt: "#fafbfc",
|
|
71
|
+
// 次级表面 (表格 hover 等)
|
|
72
|
+
border: "#e5e7eb",
|
|
73
|
+
// 默认边框 (比 antd 默认淡, 更现代)
|
|
74
|
+
borderStrong: "#d1d5db",
|
|
75
|
+
text: "#111827",
|
|
76
|
+
// 主文本
|
|
77
|
+
textMuted: "#6b7280",
|
|
78
|
+
// 次文本
|
|
79
|
+
textDisabled: "#9ca3af"
|
|
80
|
+
}, C = {
|
|
81
|
+
sm: 8,
|
|
82
|
+
md: 12,
|
|
83
|
+
lg: 16,
|
|
84
|
+
xl: 20,
|
|
85
|
+
pill: 999
|
|
86
|
+
}, z = {
|
|
87
|
+
sm: "0 1px 2px 0 rgba(15, 23, 42, 0.04), 0 1px 3px 0 rgba(15, 23, 42, 0.06)",
|
|
88
|
+
md: "0 2px 4px -1px rgba(15, 23, 42, 0.04), 0 4px 8px -1px rgba(15, 23, 42, 0.08)",
|
|
89
|
+
lg: "0 4px 6px -2px rgba(15, 23, 42, 0.05), 0 12px 16px -4px rgba(15, 23, 42, 0.10)",
|
|
90
|
+
xl: "0 8px 24px -6px rgba(15, 23, 42, 0.10), 0 24px 48px -12px rgba(15, 23, 42, 0.18)"
|
|
91
|
+
}, nt = {
|
|
92
|
+
rest: z.md,
|
|
93
|
+
hover: "0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 20px 32px -8px rgba(15, 23, 42, 0.14)"
|
|
94
|
+
}, H = {
|
|
95
|
+
1: 4,
|
|
96
|
+
2: 8,
|
|
97
|
+
3: 12,
|
|
98
|
+
4: 16,
|
|
99
|
+
5: 20,
|
|
100
|
+
6: 24,
|
|
101
|
+
8: 32,
|
|
102
|
+
10: 40,
|
|
103
|
+
12: 48,
|
|
104
|
+
16: 64
|
|
105
|
+
}, ce = {
|
|
106
|
+
xs: 11,
|
|
107
|
+
sm: 12,
|
|
108
|
+
base: 14,
|
|
109
|
+
md: 16,
|
|
110
|
+
lg: 18,
|
|
111
|
+
xl: 20,
|
|
112
|
+
"2xl": 24,
|
|
113
|
+
"3xl": 30,
|
|
114
|
+
"4xl": 36
|
|
115
|
+
}, L = {
|
|
116
|
+
token: {
|
|
117
|
+
// 主色
|
|
118
|
+
colorPrimary: T.primary,
|
|
119
|
+
colorInfo: T.primary,
|
|
120
|
+
colorSuccess: E.green.bg,
|
|
121
|
+
colorWarning: E.orange.bg,
|
|
122
|
+
colorError: E.red.bg,
|
|
123
|
+
// 链接
|
|
124
|
+
colorLink: T.primary,
|
|
125
|
+
colorLinkHover: T.primaryHover,
|
|
126
|
+
colorLinkActive: T.primaryActive,
|
|
127
|
+
// 文本
|
|
128
|
+
colorText: x.text,
|
|
129
|
+
colorTextSecondary: x.textMuted,
|
|
130
|
+
colorTextTertiary: x.textDisabled,
|
|
131
|
+
// 背景
|
|
132
|
+
colorBgBase: x.surface,
|
|
133
|
+
colorBgLayout: x.bg,
|
|
134
|
+
colorBgContainer: x.surface,
|
|
135
|
+
colorBgElevated: x.surface,
|
|
136
|
+
// 边框
|
|
137
|
+
colorBorder: x.border,
|
|
138
|
+
colorBorderSecondary: x.surfaceAlt,
|
|
139
|
+
// 圆角
|
|
140
|
+
borderRadius: C.md,
|
|
141
|
+
borderRadiusLG: C.lg,
|
|
142
|
+
borderRadiusSM: C.sm,
|
|
143
|
+
// 字体
|
|
144
|
+
fontSize: ce.base,
|
|
145
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif",
|
|
146
|
+
// 阴影
|
|
147
|
+
boxShadow: z.md,
|
|
148
|
+
boxShadowSecondary: z.lg
|
|
149
|
+
},
|
|
150
|
+
components: {
|
|
151
|
+
// Layout: 顶导白底更现代
|
|
152
|
+
Layout: {
|
|
153
|
+
headerBg: x.surface,
|
|
154
|
+
headerHeight: 64,
|
|
155
|
+
headerPadding: "0 24px",
|
|
156
|
+
siderBg: "#0f172a"
|
|
157
|
+
// 深色侧栏 (slate-900), 比纯黑更有质感
|
|
158
|
+
},
|
|
159
|
+
// Menu: 深色侧栏菜单
|
|
160
|
+
Menu: {
|
|
161
|
+
darkItemBg: "transparent",
|
|
162
|
+
darkSubMenuItemBg: "transparent",
|
|
163
|
+
darkItemSelectedBg: T.primary,
|
|
164
|
+
darkItemHoverBg: "rgba(255, 255, 255, 0.06)",
|
|
165
|
+
darkItemColor: "rgba(255, 255, 255, 0.75)",
|
|
166
|
+
itemBorderRadius: 8,
|
|
167
|
+
itemMarginInline: 8
|
|
168
|
+
},
|
|
169
|
+
// Card: 更柔和
|
|
170
|
+
Card: {
|
|
171
|
+
borderRadiusLG: C.lg,
|
|
172
|
+
boxShadowTertiary: z.sm
|
|
173
|
+
},
|
|
174
|
+
// Button: 主按钮圆角统一
|
|
175
|
+
Button: {
|
|
176
|
+
borderRadius: C.md,
|
|
177
|
+
borderRadiusLG: C.lg,
|
|
178
|
+
fontWeight: 500
|
|
179
|
+
},
|
|
180
|
+
// Tabs: 现代化下划线
|
|
181
|
+
Tabs: {
|
|
182
|
+
itemSelectedColor: T.primary,
|
|
183
|
+
inkBarColor: T.primary,
|
|
184
|
+
titleFontSize: ce.base
|
|
185
|
+
},
|
|
186
|
+
// Tag: 更小巧
|
|
187
|
+
Tag: {
|
|
188
|
+
borderRadiusSM: 6
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
function it({
|
|
193
|
+
icon: e,
|
|
194
|
+
label: n,
|
|
195
|
+
value: s,
|
|
196
|
+
suffix: l,
|
|
197
|
+
color: c = "blue",
|
|
198
|
+
trend: a,
|
|
199
|
+
href: r,
|
|
200
|
+
loading: o = !1,
|
|
201
|
+
precision: i = 0
|
|
202
|
+
}) {
|
|
203
|
+
const d = E[c] || E.blue, [f, g] = A(0), p = M(0);
|
|
204
|
+
D(() => {
|
|
205
|
+
if (o || s == null) return;
|
|
206
|
+
const b = p.current, S = Number(s) || 0;
|
|
207
|
+
if (b === S) {
|
|
208
|
+
g(S);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const k = 600, P = performance.now();
|
|
212
|
+
let N;
|
|
213
|
+
const q = (Y) => {
|
|
214
|
+
const j = Math.min(1, (Y - P) / k), J = 1 - Math.pow(1 - j, 3), u = b + (S - b) * J;
|
|
215
|
+
g(u), j < 1 ? N = requestAnimationFrame(q) : p.current = S;
|
|
216
|
+
};
|
|
217
|
+
return N = requestAnimationFrame(q), () => N && cancelAnimationFrame(N);
|
|
218
|
+
}, [s, o]);
|
|
219
|
+
const h = () => {
|
|
220
|
+
r && typeof window < "u" && (window.location.href = r);
|
|
221
|
+
}, w = o ? "--" : Number(f).toLocaleString("zh-CN", {
|
|
222
|
+
minimumFractionDigits: i,
|
|
223
|
+
maximumFractionDigits: i
|
|
224
|
+
}), v = a != null ? Number(a) : null, B = v != null && v >= 0;
|
|
225
|
+
return /* @__PURE__ */ m(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
onClick: h,
|
|
229
|
+
style: {
|
|
230
|
+
position: "relative",
|
|
231
|
+
background: d.gradient,
|
|
232
|
+
borderRadius: C.lg,
|
|
233
|
+
padding: H[5],
|
|
234
|
+
color: d.fg,
|
|
235
|
+
cursor: r ? "pointer" : "default",
|
|
236
|
+
boxShadow: z.md,
|
|
237
|
+
overflow: "hidden",
|
|
238
|
+
transition: "transform 200ms ease, box-shadow 200ms ease",
|
|
239
|
+
minHeight: 110,
|
|
240
|
+
display: "flex",
|
|
241
|
+
flexDirection: "column",
|
|
242
|
+
justifyContent: "space-between"
|
|
243
|
+
},
|
|
244
|
+
onMouseEnter: (b) => {
|
|
245
|
+
b.currentTarget.style.transform = "translateY(-2px)", b.currentTarget.style.boxShadow = z.lg;
|
|
246
|
+
},
|
|
247
|
+
onMouseLeave: (b) => {
|
|
248
|
+
b.currentTarget.style.transform = "translateY(0)", b.currentTarget.style.boxShadow = z.md;
|
|
249
|
+
},
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ t(
|
|
252
|
+
"div",
|
|
253
|
+
{
|
|
254
|
+
style: {
|
|
255
|
+
position: "absolute",
|
|
256
|
+
top: -32,
|
|
257
|
+
right: -32,
|
|
258
|
+
width: 96,
|
|
259
|
+
height: 96,
|
|
260
|
+
borderRadius: "50%",
|
|
261
|
+
background: "rgba(255, 255, 255, 0.15)",
|
|
262
|
+
pointerEvents: "none"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ m("div", { style: {
|
|
267
|
+
display: "flex",
|
|
268
|
+
alignItems: "center",
|
|
269
|
+
gap: H[2],
|
|
270
|
+
position: "relative"
|
|
271
|
+
}, children: [
|
|
272
|
+
/* @__PURE__ */ t("div", { style: {
|
|
273
|
+
width: 36,
|
|
274
|
+
height: 36,
|
|
275
|
+
borderRadius: C.sm,
|
|
276
|
+
background: "rgba(255, 255, 255, 0.20)",
|
|
277
|
+
backdropFilter: "blur(8px)",
|
|
278
|
+
display: "flex",
|
|
279
|
+
alignItems: "center",
|
|
280
|
+
justifyContent: "center",
|
|
281
|
+
fontSize: 18
|
|
282
|
+
}, children: e }),
|
|
283
|
+
/* @__PURE__ */ t("div", { style: {
|
|
284
|
+
fontSize: 13,
|
|
285
|
+
fontWeight: 500,
|
|
286
|
+
opacity: 0.92
|
|
287
|
+
}, children: n })
|
|
288
|
+
] }),
|
|
289
|
+
/* @__PURE__ */ m("div", { style: {
|
|
290
|
+
display: "flex",
|
|
291
|
+
alignItems: "baseline",
|
|
292
|
+
gap: H[2],
|
|
293
|
+
position: "relative",
|
|
294
|
+
marginTop: H[3]
|
|
295
|
+
}, children: [
|
|
296
|
+
/* @__PURE__ */ t("div", { style: {
|
|
297
|
+
fontSize: 30,
|
|
298
|
+
fontWeight: 700,
|
|
299
|
+
lineHeight: 1.1,
|
|
300
|
+
letterSpacing: "-0.02em",
|
|
301
|
+
fontVariantNumeric: "tabular-nums"
|
|
302
|
+
}, children: w }),
|
|
303
|
+
l && /* @__PURE__ */ t("div", { style: { fontSize: 14, opacity: 0.85, fontWeight: 500 }, children: l }),
|
|
304
|
+
v != null && /* @__PURE__ */ m("div", { style: {
|
|
305
|
+
marginLeft: "auto",
|
|
306
|
+
fontSize: 12,
|
|
307
|
+
fontWeight: 600,
|
|
308
|
+
padding: "2px 8px",
|
|
309
|
+
borderRadius: 999,
|
|
310
|
+
background: B ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.18)",
|
|
311
|
+
display: "flex",
|
|
312
|
+
alignItems: "center",
|
|
313
|
+
gap: 2
|
|
314
|
+
}, children: [
|
|
315
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: B ? "▲" : "▼" }),
|
|
316
|
+
Math.abs(v).toFixed(1),
|
|
317
|
+
"%"
|
|
318
|
+
] })
|
|
319
|
+
] })
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
function $e({ color: e = "blue", label: n, size: s = 8 }) {
|
|
325
|
+
const l = E[e] || E.blue;
|
|
326
|
+
return /* @__PURE__ */ m("span", { style: {
|
|
327
|
+
display: "inline-flex",
|
|
328
|
+
alignItems: "center",
|
|
329
|
+
gap: 8,
|
|
330
|
+
fontSize: 14,
|
|
331
|
+
fontWeight: 600,
|
|
332
|
+
color: "#111827"
|
|
333
|
+
}, children: [
|
|
334
|
+
/* @__PURE__ */ t("span", { style: {
|
|
335
|
+
width: s,
|
|
336
|
+
height: s,
|
|
337
|
+
borderRadius: "50%",
|
|
338
|
+
background: l.bg,
|
|
339
|
+
boxShadow: `0 0 0 3px ${l.soft}`,
|
|
340
|
+
flexShrink: 0
|
|
341
|
+
} }),
|
|
342
|
+
n && /* @__PURE__ */ t("span", { children: n })
|
|
343
|
+
] });
|
|
344
|
+
}
|
|
345
|
+
function ot({
|
|
346
|
+
color: e = "blue",
|
|
347
|
+
title: n,
|
|
348
|
+
subtitle: s,
|
|
349
|
+
moreText: l = "全部",
|
|
350
|
+
moreHref: c,
|
|
351
|
+
onMore: a
|
|
352
|
+
}) {
|
|
353
|
+
return /* @__PURE__ */ m("div", { style: {
|
|
354
|
+
display: "flex",
|
|
355
|
+
alignItems: "center",
|
|
356
|
+
justifyContent: "space-between",
|
|
357
|
+
marginBottom: 16
|
|
358
|
+
}, children: [
|
|
359
|
+
/* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "baseline", gap: 12 }, children: [
|
|
360
|
+
/* @__PURE__ */ t($e, { color: e, label: n, size: 10 }),
|
|
361
|
+
s && /* @__PURE__ */ t("span", { style: {
|
|
362
|
+
fontSize: 13,
|
|
363
|
+
color: "#6b7280",
|
|
364
|
+
fontWeight: 400
|
|
365
|
+
}, children: s })
|
|
366
|
+
] }),
|
|
367
|
+
(c || a) && /* @__PURE__ */ m(
|
|
368
|
+
"a",
|
|
369
|
+
{
|
|
370
|
+
href: c,
|
|
371
|
+
onClick: (r) => {
|
|
372
|
+
a && (r.preventDefault(), a());
|
|
373
|
+
},
|
|
374
|
+
style: {
|
|
375
|
+
fontSize: 13,
|
|
376
|
+
color: "#6b7280",
|
|
377
|
+
textDecoration: "none",
|
|
378
|
+
display: "inline-flex",
|
|
379
|
+
alignItems: "center",
|
|
380
|
+
gap: 4,
|
|
381
|
+
cursor: "pointer",
|
|
382
|
+
transition: "color 150ms ease"
|
|
383
|
+
},
|
|
384
|
+
onMouseEnter: (r) => {
|
|
385
|
+
r.currentTarget.style.color = "#7c3aed";
|
|
386
|
+
},
|
|
387
|
+
onMouseLeave: (r) => {
|
|
388
|
+
r.currentTarget.style.color = "#6b7280";
|
|
389
|
+
},
|
|
390
|
+
children: [
|
|
391
|
+
l,
|
|
392
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 12 }, children: "›" })
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
)
|
|
396
|
+
] });
|
|
397
|
+
}
|
|
398
|
+
function lt({
|
|
399
|
+
title: e,
|
|
400
|
+
description: n,
|
|
401
|
+
icon: s,
|
|
402
|
+
cover: l,
|
|
403
|
+
color: c = "violet",
|
|
404
|
+
tags: a = [],
|
|
405
|
+
meta: r,
|
|
406
|
+
href: o,
|
|
407
|
+
extra: i
|
|
408
|
+
}) {
|
|
409
|
+
const d = E[c] || E.violet, [f, g] = A(!1);
|
|
410
|
+
return /* @__PURE__ */ m(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
onClick: () => {
|
|
414
|
+
o && typeof window < "u" && (window.location.href = o);
|
|
415
|
+
},
|
|
416
|
+
onMouseEnter: () => g(!0),
|
|
417
|
+
onMouseLeave: () => g(!1),
|
|
418
|
+
style: {
|
|
419
|
+
background: "#ffffff",
|
|
420
|
+
borderRadius: C.lg,
|
|
421
|
+
overflow: "hidden",
|
|
422
|
+
cursor: o ? "pointer" : "default",
|
|
423
|
+
boxShadow: f ? z.lg : z.sm,
|
|
424
|
+
transform: f ? "translateY(-2px)" : "translateY(0)",
|
|
425
|
+
transition: "transform 200ms ease, box-shadow 200ms ease",
|
|
426
|
+
border: "1px solid #f1f5f9",
|
|
427
|
+
display: "flex",
|
|
428
|
+
flexDirection: "column"
|
|
429
|
+
},
|
|
430
|
+
children: [
|
|
431
|
+
/* @__PURE__ */ m("div", { style: {
|
|
432
|
+
position: "relative",
|
|
433
|
+
aspectRatio: "16 / 9",
|
|
434
|
+
background: l ? "#f1f5f9" : d.gradient,
|
|
435
|
+
display: "flex",
|
|
436
|
+
alignItems: "center",
|
|
437
|
+
justifyContent: "center",
|
|
438
|
+
overflow: "hidden"
|
|
439
|
+
}, children: [
|
|
440
|
+
l ? /* @__PURE__ */ t(
|
|
441
|
+
"img",
|
|
442
|
+
{
|
|
443
|
+
src: l,
|
|
444
|
+
alt: e,
|
|
445
|
+
style: {
|
|
446
|
+
width: "100%",
|
|
447
|
+
height: "100%",
|
|
448
|
+
objectFit: "cover"
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
) : /* @__PURE__ */ t("div", { style: {
|
|
452
|
+
fontSize: 48,
|
|
453
|
+
color: "rgba(255, 255, 255, 0.9)",
|
|
454
|
+
display: "flex"
|
|
455
|
+
}, children: s }),
|
|
456
|
+
!l && /* @__PURE__ */ t("div", { style: {
|
|
457
|
+
position: "absolute",
|
|
458
|
+
top: -24,
|
|
459
|
+
right: -24,
|
|
460
|
+
width: 80,
|
|
461
|
+
height: 80,
|
|
462
|
+
borderRadius: "50%",
|
|
463
|
+
background: "rgba(255, 255, 255, 0.15)"
|
|
464
|
+
} }),
|
|
465
|
+
i && /* @__PURE__ */ t("div", { style: {
|
|
466
|
+
position: "absolute",
|
|
467
|
+
top: 8,
|
|
468
|
+
right: 8
|
|
469
|
+
}, children: i })
|
|
470
|
+
] }),
|
|
471
|
+
/* @__PURE__ */ m("div", { style: {
|
|
472
|
+
padding: H[4],
|
|
473
|
+
display: "flex",
|
|
474
|
+
flexDirection: "column",
|
|
475
|
+
gap: H[2],
|
|
476
|
+
flex: 1
|
|
477
|
+
}, children: [
|
|
478
|
+
a.length > 0 && /* @__PURE__ */ t("div", { style: {
|
|
479
|
+
display: "flex",
|
|
480
|
+
flexWrap: "wrap",
|
|
481
|
+
gap: 6
|
|
482
|
+
}, children: a.slice(0, 3).map((h, w) => {
|
|
483
|
+
const v = E[h.color] || E.blue;
|
|
484
|
+
return /* @__PURE__ */ t(
|
|
485
|
+
"span",
|
|
486
|
+
{
|
|
487
|
+
style: {
|
|
488
|
+
fontSize: 11,
|
|
489
|
+
fontWeight: 500,
|
|
490
|
+
padding: "2px 8px",
|
|
491
|
+
borderRadius: 999,
|
|
492
|
+
background: v.soft,
|
|
493
|
+
color: v.bg
|
|
494
|
+
},
|
|
495
|
+
children: h.label
|
|
496
|
+
},
|
|
497
|
+
w
|
|
498
|
+
);
|
|
499
|
+
}) }),
|
|
500
|
+
/* @__PURE__ */ t("div", { style: {
|
|
501
|
+
fontSize: 15,
|
|
502
|
+
fontWeight: 600,
|
|
503
|
+
color: "#111827",
|
|
504
|
+
lineHeight: 1.3,
|
|
505
|
+
overflow: "hidden",
|
|
506
|
+
textOverflow: "ellipsis",
|
|
507
|
+
display: "-webkit-box",
|
|
508
|
+
WebkitLineClamp: 1,
|
|
509
|
+
WebkitBoxOrient: "vertical"
|
|
510
|
+
}, children: e }),
|
|
511
|
+
n && /* @__PURE__ */ t("div", { style: {
|
|
512
|
+
fontSize: 12,
|
|
513
|
+
color: "#6b7280",
|
|
514
|
+
lineHeight: 1.5,
|
|
515
|
+
overflow: "hidden",
|
|
516
|
+
textOverflow: "ellipsis",
|
|
517
|
+
display: "-webkit-box",
|
|
518
|
+
WebkitLineClamp: 2,
|
|
519
|
+
WebkitBoxOrient: "vertical",
|
|
520
|
+
minHeight: 36
|
|
521
|
+
}, children: n }),
|
|
522
|
+
r && /* @__PURE__ */ t("div", { style: {
|
|
523
|
+
fontSize: 11,
|
|
524
|
+
color: "#9ca3af",
|
|
525
|
+
marginTop: "auto",
|
|
526
|
+
paddingTop: H[2],
|
|
527
|
+
borderTop: "1px dashed #f1f5f9"
|
|
528
|
+
}, children: r })
|
|
529
|
+
] })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
function at({
|
|
535
|
+
tag: e,
|
|
536
|
+
title: n,
|
|
537
|
+
description: s,
|
|
538
|
+
buttonText: l,
|
|
539
|
+
buttonHref: c,
|
|
540
|
+
onButtonClick: a
|
|
541
|
+
}) {
|
|
542
|
+
return /* @__PURE__ */ m("div", { style: {
|
|
543
|
+
position: "relative",
|
|
544
|
+
borderRadius: C.lg,
|
|
545
|
+
padding: "40px 48px",
|
|
546
|
+
background: "linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%)",
|
|
547
|
+
color: "#ffffff",
|
|
548
|
+
overflow: "hidden",
|
|
549
|
+
boxShadow: z.lg
|
|
550
|
+
}, children: [
|
|
551
|
+
/* @__PURE__ */ t("div", { style: {
|
|
552
|
+
position: "absolute",
|
|
553
|
+
top: -64,
|
|
554
|
+
right: -64,
|
|
555
|
+
width: 200,
|
|
556
|
+
height: 200,
|
|
557
|
+
borderRadius: "50%",
|
|
558
|
+
background: "radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%)",
|
|
559
|
+
pointerEvents: "none"
|
|
560
|
+
} }),
|
|
561
|
+
/* @__PURE__ */ t("div", { style: {
|
|
562
|
+
position: "absolute",
|
|
563
|
+
bottom: -48,
|
|
564
|
+
left: "30%",
|
|
565
|
+
width: 160,
|
|
566
|
+
height: 160,
|
|
567
|
+
borderRadius: "50%",
|
|
568
|
+
background: "radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%)",
|
|
569
|
+
pointerEvents: "none"
|
|
570
|
+
} }),
|
|
571
|
+
/* @__PURE__ */ m("div", { style: {
|
|
572
|
+
position: "relative",
|
|
573
|
+
display: "flex",
|
|
574
|
+
alignItems: "center",
|
|
575
|
+
justifyContent: "space-between",
|
|
576
|
+
gap: 32,
|
|
577
|
+
flexWrap: "wrap"
|
|
578
|
+
}, children: [
|
|
579
|
+
/* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 240 }, children: [
|
|
580
|
+
e && /* @__PURE__ */ t("div", { style: {
|
|
581
|
+
fontSize: 11,
|
|
582
|
+
fontWeight: 600,
|
|
583
|
+
letterSpacing: "0.12em",
|
|
584
|
+
color: "#a5b4fc",
|
|
585
|
+
textTransform: "uppercase",
|
|
586
|
+
marginBottom: 12
|
|
587
|
+
}, children: e }),
|
|
588
|
+
/* @__PURE__ */ t("div", { style: {
|
|
589
|
+
fontSize: 24,
|
|
590
|
+
fontWeight: 700,
|
|
591
|
+
lineHeight: 1.3,
|
|
592
|
+
marginBottom: 8
|
|
593
|
+
}, children: n }),
|
|
594
|
+
s && /* @__PURE__ */ t("div", { style: {
|
|
595
|
+
fontSize: 14,
|
|
596
|
+
color: "rgba(255, 255, 255, 0.7)",
|
|
597
|
+
lineHeight: 1.6,
|
|
598
|
+
maxWidth: 540
|
|
599
|
+
}, children: s })
|
|
600
|
+
] }),
|
|
601
|
+
l && (c || a) && /* @__PURE__ */ m(
|
|
602
|
+
"a",
|
|
603
|
+
{
|
|
604
|
+
href: c || "#",
|
|
605
|
+
onClick: (r) => {
|
|
606
|
+
a && (r.preventDefault(), a());
|
|
607
|
+
},
|
|
608
|
+
style: {
|
|
609
|
+
display: "inline-flex",
|
|
610
|
+
alignItems: "center",
|
|
611
|
+
gap: 8,
|
|
612
|
+
padding: "12px 24px",
|
|
613
|
+
background: "linear-gradient(135deg, #10b981 0%, #059669 100%)",
|
|
614
|
+
color: "#ffffff",
|
|
615
|
+
borderRadius: 999,
|
|
616
|
+
fontSize: 14,
|
|
617
|
+
fontWeight: 600,
|
|
618
|
+
textDecoration: "none",
|
|
619
|
+
boxShadow: "0 4px 12px rgba(16, 185, 129, 0.4)",
|
|
620
|
+
transition: "transform 150ms ease, box-shadow 150ms ease",
|
|
621
|
+
whiteSpace: "nowrap"
|
|
622
|
+
},
|
|
623
|
+
onMouseEnter: (r) => {
|
|
624
|
+
r.currentTarget.style.transform = "translateY(-1px)", r.currentTarget.style.boxShadow = "0 6px 16px rgba(16, 185, 129, 0.5)";
|
|
625
|
+
},
|
|
626
|
+
onMouseLeave: (r) => {
|
|
627
|
+
r.currentTarget.style.transform = "translateY(0)", r.currentTarget.style.boxShadow = "0 4px 12px rgba(16, 185, 129, 0.4)";
|
|
628
|
+
},
|
|
629
|
+
children: [
|
|
630
|
+
l,
|
|
631
|
+
/* @__PURE__ */ t("span", { children: "→" })
|
|
632
|
+
]
|
|
633
|
+
}
|
|
634
|
+
)
|
|
635
|
+
] })
|
|
636
|
+
] });
|
|
637
|
+
}
|
|
638
|
+
function be({
|
|
639
|
+
icon: e,
|
|
640
|
+
title: n = "暂无数据",
|
|
641
|
+
description: s,
|
|
642
|
+
actionText: l,
|
|
643
|
+
onAction: c,
|
|
644
|
+
size: a = "md",
|
|
645
|
+
style: r
|
|
646
|
+
}) {
|
|
647
|
+
const o = { sm: 24, md: 40, lg: 64 }, i = { sm: 14, md: 16, lg: 20 };
|
|
648
|
+
return /* @__PURE__ */ m(
|
|
649
|
+
"div",
|
|
650
|
+
{
|
|
651
|
+
role: "status",
|
|
652
|
+
"aria-live": "polite",
|
|
653
|
+
style: {
|
|
654
|
+
padding: o[a] || o.md,
|
|
655
|
+
textAlign: "center",
|
|
656
|
+
background: "#ffffff",
|
|
657
|
+
borderRadius: C.md,
|
|
658
|
+
border: "1px dashed #e5e7eb",
|
|
659
|
+
...r
|
|
660
|
+
},
|
|
661
|
+
children: [
|
|
662
|
+
/* @__PURE__ */ t("div", { style: {
|
|
663
|
+
display: "inline-flex",
|
|
664
|
+
alignItems: "center",
|
|
665
|
+
justifyContent: "center",
|
|
666
|
+
width: 56,
|
|
667
|
+
height: 56,
|
|
668
|
+
borderRadius: "50%",
|
|
669
|
+
background: x.surfaceAlt,
|
|
670
|
+
marginBottom: 16,
|
|
671
|
+
fontSize: 28,
|
|
672
|
+
color: "#9ca3af"
|
|
673
|
+
}, children: e || /* @__PURE__ */ t(Ie, {}) }),
|
|
674
|
+
/* @__PURE__ */ t("div", { style: {
|
|
675
|
+
fontSize: i[a],
|
|
676
|
+
fontWeight: 600,
|
|
677
|
+
color: x.text,
|
|
678
|
+
marginBottom: s ? 6 : 16
|
|
679
|
+
}, children: n }),
|
|
680
|
+
s && /* @__PURE__ */ t("div", { style: {
|
|
681
|
+
fontSize: 13,
|
|
682
|
+
color: x.textMuted,
|
|
683
|
+
lineHeight: 1.6,
|
|
684
|
+
maxWidth: 360,
|
|
685
|
+
margin: "0 auto 16px"
|
|
686
|
+
}, children: s }),
|
|
687
|
+
l && c && /* @__PURE__ */ t(
|
|
688
|
+
V,
|
|
689
|
+
{
|
|
690
|
+
type: "primary",
|
|
691
|
+
onClick: c,
|
|
692
|
+
style: {
|
|
693
|
+
background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)",
|
|
694
|
+
border: "none",
|
|
695
|
+
minHeight: 36
|
|
696
|
+
},
|
|
697
|
+
children: l
|
|
698
|
+
}
|
|
699
|
+
)
|
|
700
|
+
]
|
|
701
|
+
}
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
function We({
|
|
705
|
+
error: e,
|
|
706
|
+
title: n = "加载失败",
|
|
707
|
+
description: s,
|
|
708
|
+
onRetry: l,
|
|
709
|
+
retryText: c = "重新加载",
|
|
710
|
+
variant: a = "inline",
|
|
711
|
+
style: r
|
|
712
|
+
}) {
|
|
713
|
+
var p;
|
|
714
|
+
const o = a === "full", i = (p = e == null ? void 0 : e.response) == null ? void 0 : p.data, d = i && typeof i == "object" && (typeof i.message == "string" && i.message || typeof i.msg == "string" && i.msg) || null, f = d || (typeof e == "string" ? e : (e == null ? void 0 : e.message) || (e == null ? void 0 : e.msg) || (e ? String(e) : null)), g = s || (d ? `原因: ${d}` : f ? `原因: ${f}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
|
|
715
|
+
return /* @__PURE__ */ m(
|
|
716
|
+
"div",
|
|
717
|
+
{
|
|
718
|
+
role: "alert",
|
|
719
|
+
"aria-live": "assertive",
|
|
720
|
+
style: {
|
|
721
|
+
padding: o ? "48px 24px" : "20px 24px",
|
|
722
|
+
background: o ? "#ffffff" : "#fef2f2",
|
|
723
|
+
border: o ? `1px dashed ${x.border}` : "1px solid #fecaca",
|
|
724
|
+
borderRadius: C.md,
|
|
725
|
+
textAlign: o ? "center" : "left",
|
|
726
|
+
display: "flex",
|
|
727
|
+
flexDirection: o ? "column" : "row",
|
|
728
|
+
alignItems: o ? "center" : "flex-start",
|
|
729
|
+
gap: o ? 12 : 16,
|
|
730
|
+
...r
|
|
731
|
+
},
|
|
732
|
+
children: [
|
|
733
|
+
/* @__PURE__ */ t("div", { style: {
|
|
734
|
+
display: "inline-flex",
|
|
735
|
+
alignItems: "center",
|
|
736
|
+
justifyContent: "center",
|
|
737
|
+
width: o ? 56 : 36,
|
|
738
|
+
height: o ? 56 : 36,
|
|
739
|
+
borderRadius: "50%",
|
|
740
|
+
background: o ? "#fef2f2" : "#ffffff",
|
|
741
|
+
color: "#dc2626",
|
|
742
|
+
fontSize: o ? 28 : 18,
|
|
743
|
+
flexShrink: 0
|
|
744
|
+
}, children: /* @__PURE__ */ t(ze, {}) }),
|
|
745
|
+
/* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
746
|
+
/* @__PURE__ */ t("div", { style: {
|
|
747
|
+
fontSize: o ? 16 : 14,
|
|
748
|
+
fontWeight: 600,
|
|
749
|
+
color: "#991b1b",
|
|
750
|
+
marginBottom: 4
|
|
751
|
+
}, children: n }),
|
|
752
|
+
/* @__PURE__ */ t("div", { style: {
|
|
753
|
+
fontSize: 13,
|
|
754
|
+
color: "#7f1d1d",
|
|
755
|
+
lineHeight: 1.6,
|
|
756
|
+
wordBreak: "break-word"
|
|
757
|
+
}, children: g }),
|
|
758
|
+
l && /* @__PURE__ */ t(
|
|
759
|
+
V,
|
|
760
|
+
{
|
|
761
|
+
type: "primary",
|
|
762
|
+
danger: !0,
|
|
763
|
+
icon: /* @__PURE__ */ t(re, {}),
|
|
764
|
+
onClick: l,
|
|
765
|
+
size: o ? "middle" : "small",
|
|
766
|
+
style: { marginTop: 12 },
|
|
767
|
+
children: c
|
|
768
|
+
}
|
|
769
|
+
)
|
|
770
|
+
] })
|
|
771
|
+
]
|
|
772
|
+
}
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
function st({
|
|
776
|
+
variant: e = "cards",
|
|
777
|
+
rows: n = 4,
|
|
778
|
+
active: s = !0,
|
|
779
|
+
style: l
|
|
780
|
+
}) {
|
|
781
|
+
return e === "cards" ? /* @__PURE__ */ t(
|
|
782
|
+
"div",
|
|
783
|
+
{
|
|
784
|
+
role: "status",
|
|
785
|
+
"aria-busy": "true",
|
|
786
|
+
"aria-label": "加载中",
|
|
787
|
+
style: {
|
|
788
|
+
display: "grid",
|
|
789
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
|
|
790
|
+
gap: 16,
|
|
791
|
+
...l
|
|
792
|
+
},
|
|
793
|
+
children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
|
|
794
|
+
"div",
|
|
795
|
+
{
|
|
796
|
+
style: {
|
|
797
|
+
background: "#ffffff",
|
|
798
|
+
borderRadius: C.lg,
|
|
799
|
+
overflow: "hidden",
|
|
800
|
+
border: "1px solid #f1f5f9"
|
|
801
|
+
},
|
|
802
|
+
children: [
|
|
803
|
+
/* @__PURE__ */ t(
|
|
804
|
+
_.Image,
|
|
805
|
+
{
|
|
806
|
+
active: s,
|
|
807
|
+
style: { width: "100%", height: 140, borderRadius: 0 }
|
|
808
|
+
}
|
|
809
|
+
),
|
|
810
|
+
/* @__PURE__ */ t("div", { style: { padding: 16 }, children: /* @__PURE__ */ t(_, { active: s, paragraph: { rows: 2 }, title: { width: "60%" } }) })
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
a
|
|
814
|
+
))
|
|
815
|
+
}
|
|
816
|
+
) : e === "table" ? /* @__PURE__ */ t(
|
|
817
|
+
"div",
|
|
818
|
+
{
|
|
819
|
+
role: "status",
|
|
820
|
+
"aria-busy": "true",
|
|
821
|
+
"aria-label": "加载中",
|
|
822
|
+
style: {
|
|
823
|
+
background: "#ffffff",
|
|
824
|
+
padding: 24,
|
|
825
|
+
borderRadius: C.md,
|
|
826
|
+
...l
|
|
827
|
+
},
|
|
828
|
+
children: /* @__PURE__ */ t(_, { active: s, paragraph: { rows: n } })
|
|
829
|
+
}
|
|
830
|
+
) : e === "list" ? /* @__PURE__ */ t("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: l, children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
|
|
831
|
+
"div",
|
|
832
|
+
{
|
|
833
|
+
style: {
|
|
834
|
+
display: "flex",
|
|
835
|
+
alignItems: "center",
|
|
836
|
+
gap: 12,
|
|
837
|
+
padding: "12px 0",
|
|
838
|
+
borderBottom: a < n - 1 ? "1px solid #f1f5f9" : "none"
|
|
839
|
+
},
|
|
840
|
+
children: [
|
|
841
|
+
/* @__PURE__ */ t(_.Avatar, { active: s, size: "default" }),
|
|
842
|
+
/* @__PURE__ */ t(_, { active: s, paragraph: { rows: 1 }, title: { width: 120 }, style: { flex: 1 } })
|
|
843
|
+
]
|
|
844
|
+
},
|
|
845
|
+
a
|
|
846
|
+
)) }) : /* @__PURE__ */ t(
|
|
847
|
+
"div",
|
|
848
|
+
{
|
|
849
|
+
role: "status",
|
|
850
|
+
"aria-busy": "true",
|
|
851
|
+
"aria-label": "加载中",
|
|
852
|
+
style: {
|
|
853
|
+
background: "#ffffff",
|
|
854
|
+
padding: 32,
|
|
855
|
+
borderRadius: C.md,
|
|
856
|
+
...l
|
|
857
|
+
},
|
|
858
|
+
children: /* @__PURE__ */ t(_, { active: s, title: { width: "40%" }, paragraph: { rows: n } })
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
function ct({
|
|
863
|
+
value: e,
|
|
864
|
+
onChange: n,
|
|
865
|
+
onSearch: s,
|
|
866
|
+
placeholder: l = "搜索...",
|
|
867
|
+
debounceMs: c = 300,
|
|
868
|
+
width: a = 280,
|
|
869
|
+
allowClear: r = !0,
|
|
870
|
+
// antd v6: enterButton 已被废弃,SearchInput 已通过 onKeyDown 自行处理 Enter 键,
|
|
871
|
+
// 所以从 rest 里过滤掉,避免透传到原生 <input> 报 React 警告。
|
|
872
|
+
enterButton: o,
|
|
873
|
+
...i
|
|
874
|
+
}) {
|
|
875
|
+
const [d, f] = A(e || ""), g = M(null), p = M(e || "");
|
|
876
|
+
D(() => {
|
|
877
|
+
e !== void 0 && e !== d && (f(e || ""), p.current = e || "");
|
|
878
|
+
}, [e]), D(() => () => {
|
|
879
|
+
g.current && clearTimeout(g.current);
|
|
880
|
+
}, []);
|
|
881
|
+
const h = (S) => {
|
|
882
|
+
p.current = S, n && n(S);
|
|
883
|
+
}, w = (S) => {
|
|
884
|
+
const k = S.target.value;
|
|
885
|
+
if (f(k), g.current && clearTimeout(g.current), k === "") {
|
|
886
|
+
h("");
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
g.current = setTimeout(() => h(k), c);
|
|
890
|
+
}, v = (S) => {
|
|
891
|
+
g.current && clearTimeout(g.current), h(S), s && s(S);
|
|
892
|
+
};
|
|
893
|
+
return /* @__PURE__ */ t(
|
|
894
|
+
Ce,
|
|
895
|
+
{
|
|
896
|
+
...i,
|
|
897
|
+
value: d,
|
|
898
|
+
onChange: w,
|
|
899
|
+
onPressEnter: v,
|
|
900
|
+
onKeyDown: (S) => {
|
|
901
|
+
S.key === "Enter" ? (S.preventDefault(), v(d)) : S.key === "Escape" && (f(""), v(""));
|
|
902
|
+
},
|
|
903
|
+
placeholder: l,
|
|
904
|
+
allowClear: r ? { clearIcon: /* @__PURE__ */ t("span", { onClick: () => {
|
|
905
|
+
f(""), v("");
|
|
906
|
+
}, children: "×" }) } : !1,
|
|
907
|
+
prefix: /* @__PURE__ */ t(Ae, { style: { color: "#9ca3af" } }),
|
|
908
|
+
style: {
|
|
909
|
+
width: a,
|
|
910
|
+
borderRadius: C.md,
|
|
911
|
+
...i.style || {}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
);
|
|
915
|
+
}
|
|
916
|
+
function me({
|
|
917
|
+
title: e,
|
|
918
|
+
subtitle: n,
|
|
919
|
+
breadcrumb: s,
|
|
920
|
+
extra: l,
|
|
921
|
+
back: c,
|
|
922
|
+
onBack: a
|
|
923
|
+
}) {
|
|
924
|
+
const r = he();
|
|
925
|
+
return /* @__PURE__ */ t("div", { style: {
|
|
926
|
+
marginBottom: 12,
|
|
927
|
+
paddingBottom: 10,
|
|
928
|
+
borderBottom: "1px solid #f1f5f9"
|
|
929
|
+
}, children: /* @__PURE__ */ m("div", { style: {
|
|
930
|
+
display: "flex",
|
|
931
|
+
alignItems: "center",
|
|
932
|
+
justifyContent: "space-between",
|
|
933
|
+
gap: 12,
|
|
934
|
+
flexWrap: "wrap"
|
|
935
|
+
}, children: [
|
|
936
|
+
/* @__PURE__ */ m("div", { style: {
|
|
937
|
+
display: "flex",
|
|
938
|
+
alignItems: "center",
|
|
939
|
+
gap: 10,
|
|
940
|
+
minWidth: 0,
|
|
941
|
+
flexWrap: "wrap"
|
|
942
|
+
}, children: [
|
|
943
|
+
c && /* @__PURE__ */ t(
|
|
944
|
+
"button",
|
|
945
|
+
{
|
|
946
|
+
onClick: () => {
|
|
947
|
+
a ? a() : r(-1);
|
|
948
|
+
},
|
|
949
|
+
"aria-label": "返回上一页",
|
|
950
|
+
style: {
|
|
951
|
+
width: 28,
|
|
952
|
+
height: 28,
|
|
953
|
+
borderRadius: 6,
|
|
954
|
+
border: "1px solid #e5e7eb",
|
|
955
|
+
background: "#ffffff",
|
|
956
|
+
color: "#6b7280",
|
|
957
|
+
cursor: "pointer",
|
|
958
|
+
display: "inline-flex",
|
|
959
|
+
alignItems: "center",
|
|
960
|
+
justifyContent: "center",
|
|
961
|
+
fontSize: 13,
|
|
962
|
+
transition: "all 150ms ease",
|
|
963
|
+
flexShrink: 0
|
|
964
|
+
},
|
|
965
|
+
onMouseEnter: (i) => {
|
|
966
|
+
i.currentTarget.style.background = "#f8fafc", i.currentTarget.style.color = "#111827", i.currentTarget.style.borderColor = "#7c3aed";
|
|
967
|
+
},
|
|
968
|
+
onMouseLeave: (i) => {
|
|
969
|
+
i.currentTarget.style.background = "#ffffff", i.currentTarget.style.color = "#6b7280", i.currentTarget.style.borderColor = "#e5e7eb";
|
|
970
|
+
},
|
|
971
|
+
children: "←"
|
|
972
|
+
}
|
|
973
|
+
),
|
|
974
|
+
s && s.length > 0 ? /* @__PURE__ */ t(
|
|
975
|
+
Re,
|
|
976
|
+
{
|
|
977
|
+
items: s.map((i, d) => {
|
|
978
|
+
const f = d === s.length - 1;
|
|
979
|
+
return {
|
|
980
|
+
title: i.href && !f ? /* @__PURE__ */ t("a", { onClick: (g) => {
|
|
981
|
+
g.preventDefault(), r(i.href);
|
|
982
|
+
}, children: i.label }) : /* @__PURE__ */ t("span", { style: f ? {
|
|
983
|
+
fontWeight: 600,
|
|
984
|
+
color: "#111827"
|
|
985
|
+
} : void 0, children: i.label })
|
|
986
|
+
};
|
|
987
|
+
})
|
|
988
|
+
}
|
|
989
|
+
) : e && /* @__PURE__ */ t("span", { role: "heading", "aria-level": 1, style: {
|
|
990
|
+
fontSize: 15,
|
|
991
|
+
fontWeight: 600,
|
|
992
|
+
color: "#111827",
|
|
993
|
+
lineHeight: 1.4
|
|
994
|
+
}, children: e }),
|
|
995
|
+
n && /* @__PURE__ */ t("span", { title: n, style: {
|
|
996
|
+
fontSize: 12,
|
|
997
|
+
color: "#94a3b8",
|
|
998
|
+
lineHeight: 1.4,
|
|
999
|
+
whiteSpace: "nowrap",
|
|
1000
|
+
overflow: "hidden",
|
|
1001
|
+
textOverflow: "ellipsis",
|
|
1002
|
+
maxWidth: 360
|
|
1003
|
+
}, children: n })
|
|
1004
|
+
] }),
|
|
1005
|
+
l && /* @__PURE__ */ t("div", { style: {
|
|
1006
|
+
display: "flex",
|
|
1007
|
+
gap: 8,
|
|
1008
|
+
flexShrink: 0
|
|
1009
|
+
}, children: l })
|
|
1010
|
+
] }) });
|
|
1011
|
+
}
|
|
1012
|
+
function dt({ left: e, right: n, extra: s }) {
|
|
1013
|
+
return /* @__PURE__ */ m(
|
|
1014
|
+
"div",
|
|
1015
|
+
{
|
|
1016
|
+
style: {
|
|
1017
|
+
display: "flex",
|
|
1018
|
+
alignItems: "center",
|
|
1019
|
+
justifyContent: "space-between",
|
|
1020
|
+
gap: 12,
|
|
1021
|
+
marginBottom: 12,
|
|
1022
|
+
flexWrap: "wrap"
|
|
1023
|
+
},
|
|
1024
|
+
children: [
|
|
1025
|
+
/* @__PURE__ */ t(ae, { size: 8, wrap: !0, children: e }),
|
|
1026
|
+
/* @__PURE__ */ m(ae, { size: 8, wrap: !0, children: [
|
|
1027
|
+
n,
|
|
1028
|
+
s
|
|
1029
|
+
] })
|
|
1030
|
+
]
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
function ft({ onClick: e, loading: n, title: s = "刷新" }) {
|
|
1035
|
+
return /* @__PURE__ */ t(V, { icon: /* @__PURE__ */ t(re, {}), onClick: e, loading: n, title: s, children: s });
|
|
1036
|
+
}
|
|
1037
|
+
const Le = {
|
|
1038
|
+
0: { label: "待办", color: "default" },
|
|
1039
|
+
1: { label: "进行中", color: "blue" },
|
|
1040
|
+
2: { label: "已完成", color: "green" }
|
|
1041
|
+
}, Me = {
|
|
1042
|
+
ACTIVE: { label: "正常", color: "green" },
|
|
1043
|
+
INACTIVE: { label: "禁用", color: "red" },
|
|
1044
|
+
ENABLED: { label: "启用", color: "green" },
|
|
1045
|
+
DISABLED: { label: "禁用", color: "red" }
|
|
1046
|
+
}, He = {
|
|
1047
|
+
low: { label: "低", color: "default" },
|
|
1048
|
+
medium: { label: "中", color: "orange" },
|
|
1049
|
+
high: { label: "高", color: "red" },
|
|
1050
|
+
1: { label: "低", color: "default" },
|
|
1051
|
+
2: { label: "中", color: "orange" },
|
|
1052
|
+
3: { label: "高", color: "red" }
|
|
1053
|
+
}, Pe = {
|
|
1054
|
+
PENDING: { label: "待审批", color: "orange" },
|
|
1055
|
+
APPROVED: { label: "已通过", color: "green" },
|
|
1056
|
+
REJECTED: { label: "已拒绝", color: "red" },
|
|
1057
|
+
CANCELLED: { label: "已撤回", color: "default" }
|
|
1058
|
+
}, Ne = {
|
|
1059
|
+
RUNNING: { label: "运行中", color: "green" },
|
|
1060
|
+
PAUSED: { label: "已暂停", color: "orange" },
|
|
1061
|
+
STOPPED: { label: "已停止", color: "default" },
|
|
1062
|
+
FAILED: { label: "失败", color: "red" },
|
|
1063
|
+
SUCCESS: { label: "成功", color: "green" }
|
|
1064
|
+
}, _e = {
|
|
1065
|
+
task: Le,
|
|
1066
|
+
model: Me,
|
|
1067
|
+
priority: He,
|
|
1068
|
+
approval: Pe,
|
|
1069
|
+
schedule: Ne
|
|
1070
|
+
};
|
|
1071
|
+
function gt({ status: e, type: n = "task", mapping: s, ...l }) {
|
|
1072
|
+
const a = (s || _e[n] || {})[e];
|
|
1073
|
+
return a ? /* @__PURE__ */ t(se, { color: a.color, ...l, children: a.label }) : /* @__PURE__ */ t(se, { ...l, children: String(e) });
|
|
1074
|
+
}
|
|
1075
|
+
function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", extra: a, expandable: r }) {
|
|
1076
|
+
const [o, i] = A([]), [d, f] = A({ current: 1, size: 10, total: null }), [g, p] = A(!1), [h, w] = A(null), v = ke(async (b = d.current, S = d.size) => {
|
|
1077
|
+
p(!0), w(null);
|
|
1078
|
+
try {
|
|
1079
|
+
const k = await s(b, S);
|
|
1080
|
+
if (Array.isArray(k))
|
|
1081
|
+
i(k || []), f({ current: b, size: S, total: k.length });
|
|
1082
|
+
else {
|
|
1083
|
+
const P = (k == null ? void 0 : k.records) || [];
|
|
1084
|
+
i(P), f({ current: b, size: S, total: (k == null ? void 0 : k.total) == null ? null : Number(k.total) });
|
|
1085
|
+
}
|
|
1086
|
+
} catch (k) {
|
|
1087
|
+
i([]), w(k);
|
|
1088
|
+
} finally {
|
|
1089
|
+
p(!1);
|
|
1090
|
+
}
|
|
1091
|
+
}, [s, d.current, d.size]);
|
|
1092
|
+
D(() => {
|
|
1093
|
+
v(1);
|
|
1094
|
+
}, []);
|
|
1095
|
+
const B = d.total != null && d.total > 0;
|
|
1096
|
+
return /* @__PURE__ */ m("div", { children: [
|
|
1097
|
+
/* @__PURE__ */ t(me, { title: e, subtitle: n }),
|
|
1098
|
+
/* @__PURE__ */ m(
|
|
1099
|
+
Te,
|
|
1100
|
+
{
|
|
1101
|
+
extra: /* @__PURE__ */ t(
|
|
1102
|
+
V,
|
|
1103
|
+
{
|
|
1104
|
+
icon: /* @__PURE__ */ t(re, {}),
|
|
1105
|
+
loading: g,
|
|
1106
|
+
onClick: () => v(d.current, d.size),
|
|
1107
|
+
children: "刷新"
|
|
1108
|
+
}
|
|
1109
|
+
),
|
|
1110
|
+
children: [
|
|
1111
|
+
a,
|
|
1112
|
+
h ? /* @__PURE__ */ t(We, { error: h, onRetry: () => v(d.current, d.size), type: "inline" }) : /* @__PURE__ */ t(
|
|
1113
|
+
Ee,
|
|
1114
|
+
{
|
|
1115
|
+
size: "small",
|
|
1116
|
+
columns: l,
|
|
1117
|
+
dataSource: o,
|
|
1118
|
+
loading: g,
|
|
1119
|
+
rowKey: (b) => (b == null ? void 0 : b[c]) ?? (b == null ? void 0 : b.key) ?? JSON.stringify(b).slice(0, 32),
|
|
1120
|
+
pagination: {
|
|
1121
|
+
current: d.current,
|
|
1122
|
+
pageSize: d.size,
|
|
1123
|
+
total: B ? d.total : o.length,
|
|
1124
|
+
showSizeChanger: !0,
|
|
1125
|
+
showTotal: () => B ? `共 ${d.total} 条` : `本页 ${o.length} 条(接口 total 未返回有效值)`
|
|
1126
|
+
},
|
|
1127
|
+
onChange: (b) => v(b.current, b.pageSize),
|
|
1128
|
+
expandable: r,
|
|
1129
|
+
locale: { emptyText: /* @__PURE__ */ t(be, { title: "暂无数据", description: "接口返回空列表" }) }
|
|
1130
|
+
}
|
|
1131
|
+
)
|
|
1132
|
+
]
|
|
1133
|
+
}
|
|
1134
|
+
)
|
|
1135
|
+
] });
|
|
1136
|
+
}
|
|
1137
|
+
const Oe = 240, de = 96, Fe = { behavior: "smooth", block: "start" }, je = `
|
|
1138
|
+
.zfc-doc-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
|
1139
|
+
@media (max-width: 800px) { .zfc-doc-table-wrap > table { min-width: 520px; } }
|
|
1140
|
+
`, qe = (e) => String(e || "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\p{M}\p{Pc}-]/gu, "").replace(/-+/g, "-").replace(/^-|-$/g, ""), ne = (e) => String(e || "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]*)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/\*([^*]+)\*/g, "$1").trim(), ye = () => {
|
|
1141
|
+
const e = /* @__PURE__ */ new Map();
|
|
1142
|
+
let n = 0;
|
|
1143
|
+
return (s) => {
|
|
1144
|
+
n += 1;
|
|
1145
|
+
const l = qe(s) || `section-${n}`, c = e.get(l) || 0;
|
|
1146
|
+
return e.set(l, c + 1), c > 0 ? `${l}-${c}` : l;
|
|
1147
|
+
};
|
|
1148
|
+
}, Ye = (e) => {
|
|
1149
|
+
const n = [], s = ye();
|
|
1150
|
+
let l = !1;
|
|
1151
|
+
for (const c of String(e || "").split(`
|
|
1152
|
+
`)) {
|
|
1153
|
+
const a = c.replace(/\s+$/, "");
|
|
1154
|
+
if (/^\s*(```|~~~)/.test(a)) {
|
|
1155
|
+
l = !l;
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
if (l) continue;
|
|
1159
|
+
const r = /^(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/.exec(a);
|
|
1160
|
+
if (!r) continue;
|
|
1161
|
+
const o = r[1].length;
|
|
1162
|
+
if (o > 3) continue;
|
|
1163
|
+
const i = ne(r[2]);
|
|
1164
|
+
i && n.push({ level: o, text: i, id: s(i) });
|
|
1165
|
+
}
|
|
1166
|
+
return n;
|
|
1167
|
+
}, X = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(X).join("") : e.props ? X(e.props.children) : "", fe = (e) => String(e).replace(/["\\]/g, "\\$&"), ge = (e, n = Fe) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, U = /^\s*>\s?(.*)$/, Ge = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
|
|
1168
|
+
let n = String(e).trim();
|
|
1169
|
+
return n.startsWith("|") && (n = n.slice(1)), n.endsWith("|") && (n = n.slice(0, -1)), n.split("|").map((s) => s.trim());
|
|
1170
|
+
}, Ue = (e) => {
|
|
1171
|
+
if (!String(e).includes("-")) return !1;
|
|
1172
|
+
const n = K(e);
|
|
1173
|
+
return n.length > 0 && n.every((s) => /^:?-+:?$/.test(s));
|
|
1174
|
+
}, Ke = (e) => {
|
|
1175
|
+
const n = e.startsWith(":"), s = e.endsWith(":");
|
|
1176
|
+
return n && s ? "center" : s ? "right" : "left";
|
|
1177
|
+
}, Ve = (e, n) => {
|
|
1178
|
+
const s = F.exec(e[n]), l = /\d/.test(s[2]), c = [];
|
|
1179
|
+
let a = n;
|
|
1180
|
+
for (; a < e.length; ) {
|
|
1181
|
+
const r = F.exec(e[a]);
|
|
1182
|
+
if (!r) break;
|
|
1183
|
+
const o = r[1].length, i = o + r[2].length + r[3].length, d = [r[4]];
|
|
1184
|
+
for (a += 1; a < e.length; ) {
|
|
1185
|
+
const f = e[a];
|
|
1186
|
+
if (!f.trim()) {
|
|
1187
|
+
let h = a;
|
|
1188
|
+
for (; h < e.length && !e[h].trim(); ) h += 1;
|
|
1189
|
+
const w = h < e.length ? F.exec(e[h]) : null;
|
|
1190
|
+
if (w && w[1].length >= o) {
|
|
1191
|
+
a = h;
|
|
1192
|
+
continue;
|
|
1193
|
+
}
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
const g = /^[ \t]*/.exec(f)[0].length, p = F.exec(f);
|
|
1197
|
+
if (p && p[1].length <= o) break;
|
|
1198
|
+
if (g >= i) {
|
|
1199
|
+
d.push(f.slice(i)), a += 1;
|
|
1200
|
+
continue;
|
|
1201
|
+
}
|
|
1202
|
+
if (g > o) {
|
|
1203
|
+
d.push(f.slice(g)), a += 1;
|
|
1204
|
+
continue;
|
|
1205
|
+
}
|
|
1206
|
+
if (!p && !Z.test(f) && !ee.test(f) && !te.test(f) && !U.test(f)) {
|
|
1207
|
+
d.push(f.trim()), a += 1;
|
|
1208
|
+
continue;
|
|
1209
|
+
}
|
|
1210
|
+
break;
|
|
1211
|
+
}
|
|
1212
|
+
c.push({ blocks: xe(d, !0) });
|
|
1213
|
+
}
|
|
1214
|
+
return { block: { type: "list", ordered: l, items: c }, next: a };
|
|
1215
|
+
};
|
|
1216
|
+
function xe(e, n = !1) {
|
|
1217
|
+
const s = [];
|
|
1218
|
+
let l = 0;
|
|
1219
|
+
for (; l < e.length; ) {
|
|
1220
|
+
const c = e[l];
|
|
1221
|
+
if (!c.trim()) {
|
|
1222
|
+
l += 1;
|
|
1223
|
+
continue;
|
|
1224
|
+
}
|
|
1225
|
+
const a = Z.exec(c);
|
|
1226
|
+
if (a) {
|
|
1227
|
+
const i = a[1][0], d = a[1].length, f = [];
|
|
1228
|
+
for (l += 1; l < e.length; ) {
|
|
1229
|
+
const g = e[l];
|
|
1230
|
+
if (new RegExp(`^\\s*\\${i}{${d},}\\s*$`).test(g)) {
|
|
1231
|
+
l += 1;
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
f.push(g), l += 1;
|
|
1235
|
+
}
|
|
1236
|
+
s.push({ type: "code", lang: a[2] || "", text: f.join(`
|
|
1237
|
+
`) });
|
|
1238
|
+
continue;
|
|
1239
|
+
}
|
|
1240
|
+
const r = ee.exec(c);
|
|
1241
|
+
if (r) {
|
|
1242
|
+
if (l += 1, !ne(r[2]).trim()) continue;
|
|
1243
|
+
n ? s.push({ type: "paragraph", text: r[2] }) : s.push({ type: "heading", level: r[1].length, text: r[2] });
|
|
1244
|
+
continue;
|
|
1245
|
+
}
|
|
1246
|
+
if (te.test(c)) {
|
|
1247
|
+
s.push({ type: "hr" }), l += 1;
|
|
1248
|
+
continue;
|
|
1249
|
+
}
|
|
1250
|
+
if (c.includes("|") && l + 1 < e.length && Ue(e[l + 1])) {
|
|
1251
|
+
const i = K(c), d = K(e[l + 1]).map(Ke);
|
|
1252
|
+
l += 2;
|
|
1253
|
+
const f = [];
|
|
1254
|
+
for (; l < e.length && e[l].trim() && e[l].includes("|"); )
|
|
1255
|
+
f.push(K(e[l])), l += 1;
|
|
1256
|
+
s.push({ type: "table", header: i, aligns: d, rows: f });
|
|
1257
|
+
continue;
|
|
1258
|
+
}
|
|
1259
|
+
if (U.test(c)) {
|
|
1260
|
+
const i = [];
|
|
1261
|
+
for (; l < e.length; ) {
|
|
1262
|
+
const d = U.exec(e[l]);
|
|
1263
|
+
if (!d) break;
|
|
1264
|
+
i.push(d[1]), l += 1;
|
|
1265
|
+
}
|
|
1266
|
+
s.push({ type: "quote", lines: i });
|
|
1267
|
+
continue;
|
|
1268
|
+
}
|
|
1269
|
+
if (F.test(c)) {
|
|
1270
|
+
const i = Ve(e, l);
|
|
1271
|
+
s.push(i.block), l = i.next;
|
|
1272
|
+
continue;
|
|
1273
|
+
}
|
|
1274
|
+
const o = [];
|
|
1275
|
+
for (; l < e.length; ) {
|
|
1276
|
+
const i = e[l];
|
|
1277
|
+
if (!i.trim() || o.length && (Z.test(i) || ee.test(i) || te.test(i) || F.test(i) || U.test(i))) break;
|
|
1278
|
+
o.push(i.trim()), l += 1;
|
|
1279
|
+
}
|
|
1280
|
+
s.push({ type: "paragraph", text: o.join(" ") });
|
|
1281
|
+
}
|
|
1282
|
+
return s;
|
|
1283
|
+
}
|
|
1284
|
+
const I = (e, n) => {
|
|
1285
|
+
const s = [];
|
|
1286
|
+
let l = 0, c = 0;
|
|
1287
|
+
const a = (r) => s.push(/* @__PURE__ */ t(O, { children: r }, `i${c++}`));
|
|
1288
|
+
for (const r of e.matchAll(Ge)) {
|
|
1289
|
+
if (r.index > l && a(e.slice(l, r.index)), r[1] !== void 0)
|
|
1290
|
+
if (r[0].startsWith("!"))
|
|
1291
|
+
a(n.img ? n.img({ src: r[3], alt: r[2] }) : /* @__PURE__ */ t("img", { src: r[3], alt: r[2] || "" }));
|
|
1292
|
+
else {
|
|
1293
|
+
const o = I(r[2], n);
|
|
1294
|
+
a(n.a ? n.a({ href: r[3], children: o }) : /* @__PURE__ */ t("a", { href: r[3], children: o }));
|
|
1295
|
+
}
|
|
1296
|
+
else r[4] !== void 0 ? a(n.code ? n.code({ children: r[4] }) : /* @__PURE__ */ t("code", { children: r[4] })) : r[5] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: I(r[5], n) })) : r[6] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: I(r[6], n) })) : r[7] !== void 0 ? a(/* @__PURE__ */ t("del", { children: I(r[7], n) })) : r[8] !== void 0 ? a(/* @__PURE__ */ t("em", { children: I(r[8], n) })) : r[9] !== void 0 && a(n.a ? n.a({ href: r[9], children: r[9] }) : /* @__PURE__ */ t("a", { href: r[9], children: r[9] }));
|
|
1297
|
+
l = r.index + r[0].length;
|
|
1298
|
+
}
|
|
1299
|
+
return l < e.length && a(e.slice(l)), s;
|
|
1300
|
+
}, ve = (e, n, s) => {
|
|
1301
|
+
const l = [];
|
|
1302
|
+
return e.forEach((c, a) => {
|
|
1303
|
+
const r = `b${a}`, o = (i) => l.push(/* @__PURE__ */ t(O, { children: i }, r));
|
|
1304
|
+
if (c.type === "heading") {
|
|
1305
|
+
const i = Math.min(c.level, 6), d = `h${i}`, f = n[d], g = I(c.text, n), p = i <= 3 ? s(ne(c.text)) : void 0;
|
|
1306
|
+
o(f ? f({ children: g, id: p }) : le(d, { id: p }, g));
|
|
1307
|
+
} else if (c.type === "paragraph") {
|
|
1308
|
+
const i = I(c.text, n);
|
|
1309
|
+
o(n.p ? n.p({ children: i }) : /* @__PURE__ */ t("p", { children: i }));
|
|
1310
|
+
} else if (c.type === "code") {
|
|
1311
|
+
const i = /* @__PURE__ */ t("code", { className: c.lang ? `language-${c.lang}` : void 0, children: c.text });
|
|
1312
|
+
o(n.pre ? n.pre({ children: i }) : /* @__PURE__ */ t("pre", { children: i }));
|
|
1313
|
+
} else if (c.type === "list") {
|
|
1314
|
+
const i = c.ordered ? "ol" : "ul", d = n[i], f = c.items.map((g, p) => {
|
|
1315
|
+
const h = ve(g.blocks, n, s), w = n.li ? n.li({ children: h }) : /* @__PURE__ */ t("li", { children: h });
|
|
1316
|
+
return /* @__PURE__ */ t(O, { children: w }, `li${p}`);
|
|
1317
|
+
});
|
|
1318
|
+
o(d ? d({ children: f }) : le(i, null, f));
|
|
1319
|
+
} else if (c.type === "table") {
|
|
1320
|
+
const i = /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: c.header.map((g, p) => {
|
|
1321
|
+
const h = n.th ? n.th({ children: I(g, n), align: c.aligns[p] }) : /* @__PURE__ */ t("th", { children: g });
|
|
1322
|
+
return /* @__PURE__ */ t(O, { children: h }, `th${p}`);
|
|
1323
|
+
}) }) }, "thead"), d = /* @__PURE__ */ t("tbody", { children: c.rows.map((g, p) => /* @__PURE__ */ t("tr", { children: g.map((h, w) => {
|
|
1324
|
+
const v = n.td ? n.td({ children: I(h, n), align: c.aligns[w] }) : /* @__PURE__ */ t("td", { children: h });
|
|
1325
|
+
return /* @__PURE__ */ t(O, { children: v }, `td${w}`);
|
|
1326
|
+
}) }, `tr${p}`)) }, "tbody"), f = n.table ? n.table({ children: [i, d] }) : /* @__PURE__ */ t("table", { children: [i, d] });
|
|
1327
|
+
o(f);
|
|
1328
|
+
} else if (c.type === "quote") {
|
|
1329
|
+
const i = c.lines.filter((d) => d.trim()).map((d, f) => {
|
|
1330
|
+
const g = n.p ? n.p({ children: I(d, n) }) : /* @__PURE__ */ t("p", { children: d });
|
|
1331
|
+
return /* @__PURE__ */ t(O, { children: g }, `q${f}`);
|
|
1332
|
+
});
|
|
1333
|
+
o(n.blockquote ? n.blockquote({ children: i }) : /* @__PURE__ */ t("blockquote", { children: i }));
|
|
1334
|
+
} else c.type === "hr" && o(n.hr ? n.hr({}) : /* @__PURE__ */ t("hr", {}));
|
|
1335
|
+
}), l;
|
|
1336
|
+
}, Je = (e, n = {}) => ve(xe(String(e || "").split(`
|
|
1337
|
+
`)), n, ye());
|
|
1338
|
+
let ue = null;
|
|
1339
|
+
const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s, onAnchorClick: l }) => {
|
|
1340
|
+
const c = {
|
|
1341
|
+
background: T.primarySoft,
|
|
1342
|
+
color: T.primary,
|
|
1343
|
+
padding: "1px 6px",
|
|
1344
|
+
borderRadius: 4,
|
|
1345
|
+
fontSize: "0.92em",
|
|
1346
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace"
|
|
1347
|
+
};
|
|
1348
|
+
return {
|
|
1349
|
+
h1: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h1", { ...o, style: {
|
|
1350
|
+
fontSize: 22,
|
|
1351
|
+
fontWeight: 700,
|
|
1352
|
+
margin: "8px 0 16px",
|
|
1353
|
+
borderBottom: `1px solid ${x.border}`,
|
|
1354
|
+
paddingBottom: 8,
|
|
1355
|
+
scrollMarginTop: 16
|
|
1356
|
+
}, children: r }),
|
|
1357
|
+
h2: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h2", { ...o, style: {
|
|
1358
|
+
fontSize: 18,
|
|
1359
|
+
fontWeight: 700,
|
|
1360
|
+
margin: "24px 0 12px",
|
|
1361
|
+
color: x.text,
|
|
1362
|
+
scrollMarginTop: 16
|
|
1363
|
+
}, children: r }),
|
|
1364
|
+
h3: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h3", { ...o, style: {
|
|
1365
|
+
fontSize: 15,
|
|
1366
|
+
fontWeight: 600,
|
|
1367
|
+
margin: "16px 0 8px",
|
|
1368
|
+
color: "#334155",
|
|
1369
|
+
scrollMarginTop: 16
|
|
1370
|
+
}, children: r }),
|
|
1371
|
+
p: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("p", { ...o, style: { margin: "8px 0", color: "#1f2937" }, children: r }),
|
|
1372
|
+
ul: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("ul", { ...o, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
|
|
1373
|
+
ol: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("ol", { ...o, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
|
|
1374
|
+
li: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("li", { ...o, style: { margin: "4px 0" }, children: r }),
|
|
1375
|
+
blockquote: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("blockquote", { ...o, style: {
|
|
1376
|
+
margin: "12px 0",
|
|
1377
|
+
padding: "8px 14px",
|
|
1378
|
+
borderLeft: `3px solid ${L.token.colorPrimary}`,
|
|
1379
|
+
background: T.primarySoft,
|
|
1380
|
+
color: "#475569",
|
|
1381
|
+
borderRadius: 4
|
|
1382
|
+
}, children: r }),
|
|
1383
|
+
hr: () => /* @__PURE__ */ t("hr", { style: { border: "none", borderTop: `1px solid ${x.border}`, margin: "20px 0" } }),
|
|
1384
|
+
img: ({ node: a, src: r, alt: o, ...i }) => /* @__PURE__ */ t("img", { ...i, src: r, alt: o || "", style: { maxWidth: "100%", height: "auto", display: "block" } }),
|
|
1385
|
+
table: ({ node: a, children: r, ...o }) => (
|
|
1386
|
+
// §7:窄屏表格要能横向滚动,不能把列挤成一团
|
|
1387
|
+
/* @__PURE__ */ t("div", { className: "zfc-doc-table-wrap", children: /* @__PURE__ */ t("table", { ...o, style: { width: "100%", borderCollapse: "collapse", fontSize: 13 }, children: r }) })
|
|
1388
|
+
),
|
|
1389
|
+
th: ({ node: a, children: r, align: o, ...i }) => /* @__PURE__ */ t("th", { ...i, style: {
|
|
1390
|
+
padding: "8px 10px",
|
|
1391
|
+
background: x.surfaceAlt,
|
|
1392
|
+
border: `1px solid ${x.border}`,
|
|
1393
|
+
textAlign: o || "left",
|
|
1394
|
+
fontWeight: 600,
|
|
1395
|
+
color: "#334155"
|
|
1396
|
+
}, children: r }),
|
|
1397
|
+
td: ({ node: a, children: r, align: o, ...i }) => /* @__PURE__ */ t("td", { ...i, style: {
|
|
1398
|
+
padding: "8px 10px",
|
|
1399
|
+
border: `1px solid ${x.border}`,
|
|
1400
|
+
textAlign: o || "left",
|
|
1401
|
+
color: "#1f2937"
|
|
1402
|
+
}, children: r }),
|
|
1403
|
+
pre: ({ node: a, children: r }) => {
|
|
1404
|
+
const o = Array.isArray(r) ? r[0] : r;
|
|
1405
|
+
o && o.props && o.props.className;
|
|
1406
|
+
const i = X(o).replace(/\n$/, "");
|
|
1407
|
+
return /* @__PURE__ */ t("pre", { style: {
|
|
1408
|
+
margin: "12px 0",
|
|
1409
|
+
padding: "12px 14px",
|
|
1410
|
+
borderRadius: C.sm,
|
|
1411
|
+
background: "#1e293b",
|
|
1412
|
+
color: "#e2e8f0",
|
|
1413
|
+
overflowX: "auto",
|
|
1414
|
+
fontSize: 13
|
|
1415
|
+
}, children: /* @__PURE__ */ t("code", { style: { background: "transparent", color: "inherit", padding: 0, fontSize: "inherit" }, children: i }) });
|
|
1416
|
+
},
|
|
1417
|
+
code: ({ node: a, className: r, children: o, ...i }) => /* @__PURE__ */ t("code", { ...i, className: r, style: c, children: o }),
|
|
1418
|
+
a: ({ node: a, href: r, children: o, ...i }) => {
|
|
1419
|
+
const d = r || "";
|
|
1420
|
+
return /^https?:\/\//i.test(d) || d.startsWith("//") ? /* @__PURE__ */ t(
|
|
1421
|
+
"a",
|
|
1422
|
+
{
|
|
1423
|
+
...i,
|
|
1424
|
+
href: d,
|
|
1425
|
+
target: "_blank",
|
|
1426
|
+
rel: "noopener noreferrer",
|
|
1427
|
+
style: { color: L.token.colorPrimary },
|
|
1428
|
+
children: o
|
|
1429
|
+
}
|
|
1430
|
+
) : d.startsWith("#") ? /* @__PURE__ */ t(
|
|
1431
|
+
"a",
|
|
1432
|
+
{
|
|
1433
|
+
...i,
|
|
1434
|
+
href: d,
|
|
1435
|
+
style: { color: L.token.colorPrimary },
|
|
1436
|
+
onClick: (g) => l(g, d.slice(1)),
|
|
1437
|
+
children: o
|
|
1438
|
+
}
|
|
1439
|
+
) : d.startsWith("/") ? /* @__PURE__ */ t(
|
|
1440
|
+
"a",
|
|
1441
|
+
{
|
|
1442
|
+
...i,
|
|
1443
|
+
href: d,
|
|
1444
|
+
style: { color: L.token.colorPrimary },
|
|
1445
|
+
onClick: (g) => {
|
|
1446
|
+
g.preventDefault(), e ? e(d) : typeof window < "u" && (window.location.href = d);
|
|
1447
|
+
},
|
|
1448
|
+
children: o
|
|
1449
|
+
}
|
|
1450
|
+
) : /* @__PURE__ */ t("a", { ...i, href: d, style: { color: L.token.colorPrimary }, children: o });
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
};
|
|
1454
|
+
function pt({
|
|
1455
|
+
markdown: e,
|
|
1456
|
+
title: n,
|
|
1457
|
+
tocWidth: s = Oe,
|
|
1458
|
+
tocLevels: l = [2],
|
|
1459
|
+
height: c = "calc(100vh - 120px)",
|
|
1460
|
+
markdownComponents: a,
|
|
1461
|
+
renderMarkdown: r
|
|
1462
|
+
}) {
|
|
1463
|
+
const i = De() ? he() : null, d = M(null), f = M(null), g = M(""), p = M(null), [h, w] = A(""), [v, B] = A(0), b = G(() => Ye(e), [e]), S = G(
|
|
1464
|
+
() => b.filter((u) => l.includes(u.level)),
|
|
1465
|
+
[b, l]
|
|
1466
|
+
);
|
|
1467
|
+
D(() => {
|
|
1468
|
+
const u = () => B((y) => y + 1);
|
|
1469
|
+
return pe.add(u), () => {
|
|
1470
|
+
pe.delete(u);
|
|
1471
|
+
};
|
|
1472
|
+
}, []);
|
|
1473
|
+
const k = (u) => {
|
|
1474
|
+
g.current = u, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
1475
|
+
g.current = "";
|
|
1476
|
+
}, 700);
|
|
1477
|
+
};
|
|
1478
|
+
D(() => () => {
|
|
1479
|
+
p.current && clearTimeout(p.current);
|
|
1480
|
+
}, []), we(() => {
|
|
1481
|
+
const u = d.current;
|
|
1482
|
+
if (!u) return;
|
|
1483
|
+
const y = Array.from(u.querySelectorAll("h1, h2, h3"));
|
|
1484
|
+
b.forEach((R, $) => {
|
|
1485
|
+
const W = y[$];
|
|
1486
|
+
W && (W.id !== R.id && (W.id = R.id), W.setAttribute("data-anchor", R.id));
|
|
1487
|
+
});
|
|
1488
|
+
}, [b, v, r]), D(() => {
|
|
1489
|
+
const u = d.current;
|
|
1490
|
+
if (!u) return;
|
|
1491
|
+
const y = Array.from(u.querySelectorAll("h1, h2, h3"));
|
|
1492
|
+
if (!y.length) return;
|
|
1493
|
+
const R = () => {
|
|
1494
|
+
const Q = u.getBoundingClientRect().top;
|
|
1495
|
+
let ie = y[0];
|
|
1496
|
+
for (const oe of y)
|
|
1497
|
+
if (oe.getBoundingClientRect().top - Q <= de) ie = oe;
|
|
1498
|
+
else break;
|
|
1499
|
+
g.current || w(ie.id);
|
|
1500
|
+
}, $ = new IntersectionObserver(R, {
|
|
1501
|
+
root: u,
|
|
1502
|
+
rootMargin: `-${de}px 0px 0px 0px`,
|
|
1503
|
+
threshold: 0
|
|
1504
|
+
});
|
|
1505
|
+
y.forEach((Q) => $.observe(Q)), R();
|
|
1506
|
+
const W = () => {
|
|
1507
|
+
g.current = "";
|
|
1508
|
+
};
|
|
1509
|
+
return u.addEventListener("scrollend", W), () => {
|
|
1510
|
+
$.disconnect(), u.removeEventListener("scrollend", W);
|
|
1511
|
+
};
|
|
1512
|
+
}, [b, v, r]), D(() => {
|
|
1513
|
+
const u = f.current;
|
|
1514
|
+
if (!u || !h) return;
|
|
1515
|
+
const y = u.querySelector(`[data-toc-id="${fe(h)}"]`);
|
|
1516
|
+
if (!y) return;
|
|
1517
|
+
const R = u.getBoundingClientRect(), $ = y.getBoundingClientRect();
|
|
1518
|
+
($.top < R.top + 24 || $.bottom > R.bottom - 24) && y.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
1519
|
+
}, [h]);
|
|
1520
|
+
const P = (u) => {
|
|
1521
|
+
const y = d.current;
|
|
1522
|
+
return y && y.querySelector(`[data-anchor="${fe(u)}"]`) || (typeof document < "u" ? document.getElementById(u) : null);
|
|
1523
|
+
}, N = (u, y) => {
|
|
1524
|
+
u.preventDefault(), k(y), ge(P(y)), w(y);
|
|
1525
|
+
}, q = (u, y) => {
|
|
1526
|
+
u.preventDefault(), k(y), ge(P(y)), w(y);
|
|
1527
|
+
}, Y = G(
|
|
1528
|
+
() => Qe({
|
|
1529
|
+
navigate: i,
|
|
1530
|
+
Prism: ue,
|
|
1531
|
+
oneDark: ue,
|
|
1532
|
+
onAnchorClick: q
|
|
1533
|
+
}),
|
|
1534
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1535
|
+
[i, v]
|
|
1536
|
+
), j = G(
|
|
1537
|
+
() => ({ ...Y, ...a || {} }),
|
|
1538
|
+
[Y, a]
|
|
1539
|
+
), J = () => !e || !String(e).trim() ? /* @__PURE__ */ t(
|
|
1540
|
+
be,
|
|
1541
|
+
{
|
|
1542
|
+
title: "暂无文档",
|
|
1543
|
+
description: "把组件说明写成 DOC.md,用编译期 import 的字符串传给 ComponentDoc 即可"
|
|
1544
|
+
}
|
|
1545
|
+
) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(Se, { children: Je(e, j) });
|
|
1546
|
+
return /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", minHeight: 0, flex: 1 }, children: [
|
|
1547
|
+
/* @__PURE__ */ t("style", { children: je }),
|
|
1548
|
+
n ? /* @__PURE__ */ t(me, { title: n }) : null,
|
|
1549
|
+
/* @__PURE__ */ m("div", { style: { display: "flex", gap: 16, alignItems: "flex-start", minHeight: 0 }, children: [
|
|
1550
|
+
/* @__PURE__ */ m(
|
|
1551
|
+
"aside",
|
|
1552
|
+
{
|
|
1553
|
+
ref: f,
|
|
1554
|
+
style: {
|
|
1555
|
+
width: s,
|
|
1556
|
+
flexShrink: 0,
|
|
1557
|
+
position: "sticky",
|
|
1558
|
+
top: 12,
|
|
1559
|
+
alignSelf: "flex-start",
|
|
1560
|
+
maxHeight: c,
|
|
1561
|
+
overflowY: "auto",
|
|
1562
|
+
padding: "8px 8px 12px",
|
|
1563
|
+
background: x.surface,
|
|
1564
|
+
border: `1px solid ${x.border}`,
|
|
1565
|
+
borderRadius: C.sm
|
|
1566
|
+
},
|
|
1567
|
+
children: [
|
|
1568
|
+
/* @__PURE__ */ m("div", { style: {
|
|
1569
|
+
display: "flex",
|
|
1570
|
+
alignItems: "center",
|
|
1571
|
+
gap: 6,
|
|
1572
|
+
fontSize: 12,
|
|
1573
|
+
color: x.textMuted,
|
|
1574
|
+
marginBottom: 8,
|
|
1575
|
+
padding: "0 4px"
|
|
1576
|
+
}, children: [
|
|
1577
|
+
/* @__PURE__ */ t(Be, {}),
|
|
1578
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 600 }, children: "本文目录" })
|
|
1579
|
+
] }),
|
|
1580
|
+
/* @__PURE__ */ t("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: S.map((u) => {
|
|
1581
|
+
const y = h === u.id;
|
|
1582
|
+
return /* @__PURE__ */ t("li", { "data-toc-id": u.id, children: /* @__PURE__ */ t(
|
|
1583
|
+
"a",
|
|
1584
|
+
{
|
|
1585
|
+
href: "#" + u.id,
|
|
1586
|
+
onClick: (R) => N(R, u.id),
|
|
1587
|
+
style: {
|
|
1588
|
+
display: "block",
|
|
1589
|
+
padding: "6px 10px",
|
|
1590
|
+
borderLeft: `3px solid ${y ? L.token.colorPrimary : "transparent"}`,
|
|
1591
|
+
background: y ? T.primarySoft : "transparent",
|
|
1592
|
+
color: y ? L.token.colorPrimary : "#475569",
|
|
1593
|
+
fontWeight: y ? 600 : 400,
|
|
1594
|
+
fontSize: 13,
|
|
1595
|
+
lineHeight: 1.5,
|
|
1596
|
+
textDecoration: "none",
|
|
1597
|
+
borderRadius: y ? "0 4px 4px 0" : 4,
|
|
1598
|
+
transition: "all 120ms ease",
|
|
1599
|
+
whiteSpace: "nowrap",
|
|
1600
|
+
overflow: "hidden",
|
|
1601
|
+
textOverflow: "ellipsis"
|
|
1602
|
+
},
|
|
1603
|
+
children: u.text
|
|
1604
|
+
}
|
|
1605
|
+
) }, u.id);
|
|
1606
|
+
}) })
|
|
1607
|
+
]
|
|
1608
|
+
}
|
|
1609
|
+
),
|
|
1610
|
+
/* @__PURE__ */ t(
|
|
1611
|
+
"article",
|
|
1612
|
+
{
|
|
1613
|
+
ref: d,
|
|
1614
|
+
style: {
|
|
1615
|
+
flex: 1,
|
|
1616
|
+
minWidth: 0,
|
|
1617
|
+
background: x.surface,
|
|
1618
|
+
border: `1px solid ${x.border}`,
|
|
1619
|
+
borderRadius: C.sm,
|
|
1620
|
+
padding: "24px 32px",
|
|
1621
|
+
lineHeight: 1.75,
|
|
1622
|
+
color: x.text,
|
|
1623
|
+
overflowY: c === "auto" ? "visible" : "auto",
|
|
1624
|
+
maxHeight: c === "auto" ? "none" : c
|
|
1625
|
+
},
|
|
1626
|
+
children: J()
|
|
1627
|
+
}
|
|
1628
|
+
)
|
|
1629
|
+
] })
|
|
1630
|
+
] });
|
|
1631
|
+
}
|
|
1632
|
+
export {
|
|
1633
|
+
$e as C,
|
|
1634
|
+
at as D,
|
|
1635
|
+
be as E,
|
|
1636
|
+
lt as F,
|
|
1637
|
+
it as G,
|
|
1638
|
+
st as L,
|
|
1639
|
+
me as P,
|
|
1640
|
+
ft as R,
|
|
1641
|
+
ct as S,
|
|
1642
|
+
dt as T,
|
|
1643
|
+
pt as a,
|
|
1644
|
+
We as b,
|
|
1645
|
+
ut as c,
|
|
1646
|
+
ot as d,
|
|
1647
|
+
gt as e,
|
|
1648
|
+
L as f,
|
|
1649
|
+
T as g,
|
|
1650
|
+
ce as h,
|
|
1651
|
+
H as i,
|
|
1652
|
+
nt as l,
|
|
1653
|
+
x as n,
|
|
1654
|
+
E as p,
|
|
1655
|
+
C as r,
|
|
1656
|
+
z as s
|
|
1657
|
+
};
|