@yuku123/z-frontend-common 1.0.0 → 1.1.1

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.
@@ -0,0 +1,1161 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { useState as R, useRef as L, useEffect as D, useCallback as Y } from "react";
3
+ import { Button as W, Skeleton as B, Input as K, Breadcrumb as $, Space as P, Tag as F, Card as _, Table as q } from "antd";
4
+ import { InboxOutlined as J, ExclamationCircleOutlined as Q, ReloadOutlined as M, SearchOutlined as X } from "@ant-design/icons";
5
+ import { useNavigate as Z } 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
+ }, w = {
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
+ }, y = {
81
+ sm: 8,
82
+ md: 12,
83
+ lg: 16,
84
+ xl: 20,
85
+ pill: 999
86
+ }, k = {
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
+ }, ue = {
92
+ rest: k.md,
93
+ hover: "0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 20px 32px -8px rgba(15, 23, 42, 0.14)"
94
+ }, z = {
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
+ }, O = {
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
+ }, be = {
116
+ token: {
117
+ // 主色
118
+ colorPrimary: T.primary,
119
+ colorInfo: T.primary,
120
+ colorSuccess: w.green.bg,
121
+ colorWarning: w.orange.bg,
122
+ colorError: w.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: y.md,
141
+ borderRadiusLG: y.lg,
142
+ borderRadiusSM: y.sm,
143
+ // 字体
144
+ fontSize: O.base,
145
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif",
146
+ // 阴影
147
+ boxShadow: k.md,
148
+ boxShadowSecondary: k.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: y.lg,
172
+ boxShadowTertiary: k.sm
173
+ },
174
+ // Button: 主按钮圆角统一
175
+ Button: {
176
+ borderRadius: y.md,
177
+ borderRadiusLG: y.lg,
178
+ fontWeight: 500
179
+ },
180
+ // Tabs: 现代化下划线
181
+ Tabs: {
182
+ itemSelectedColor: T.primary,
183
+ inkBarColor: T.primary,
184
+ titleFontSize: O.base
185
+ },
186
+ // Tag: 更小巧
187
+ Tag: {
188
+ borderRadiusSM: 6
189
+ }
190
+ }
191
+ };
192
+ function he({
193
+ icon: t,
194
+ label: n,
195
+ value: r,
196
+ suffix: a,
197
+ color: g = "blue",
198
+ trend: i,
199
+ href: o,
200
+ loading: d = !1,
201
+ precision: l = 0
202
+ }) {
203
+ const s = w[g] || w.blue, [b, p] = R(0), v = L(0);
204
+ D(() => {
205
+ if (d || r == null) return;
206
+ const f = v.current, u = Number(r) || 0;
207
+ if (f === u) {
208
+ p(u);
209
+ return;
210
+ }
211
+ const h = 600, A = performance.now();
212
+ let E;
213
+ const H = (j) => {
214
+ const N = Math.min(1, (j - A) / h), G = 1 - Math.pow(1 - N, 3), U = f + (u - f) * G;
215
+ p(U), N < 1 ? E = requestAnimationFrame(H) : v.current = u;
216
+ };
217
+ return E = requestAnimationFrame(H), () => E && cancelAnimationFrame(E);
218
+ }, [r, d]);
219
+ const S = () => {
220
+ o && typeof window < "u" && (window.location.href = o);
221
+ }, C = d ? "--" : Number(b).toLocaleString("zh-CN", {
222
+ minimumFractionDigits: l,
223
+ maximumFractionDigits: l
224
+ }), m = i != null ? Number(i) : null, I = m != null && m >= 0;
225
+ return /* @__PURE__ */ c(
226
+ "div",
227
+ {
228
+ onClick: S,
229
+ style: {
230
+ position: "relative",
231
+ background: s.gradient,
232
+ borderRadius: y.lg,
233
+ padding: z[5],
234
+ color: s.fg,
235
+ cursor: o ? "pointer" : "default",
236
+ boxShadow: k.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: (f) => {
245
+ f.currentTarget.style.transform = "translateY(-2px)", f.currentTarget.style.boxShadow = k.lg;
246
+ },
247
+ onMouseLeave: (f) => {
248
+ f.currentTarget.style.transform = "translateY(0)", f.currentTarget.style.boxShadow = k.md;
249
+ },
250
+ children: [
251
+ /* @__PURE__ */ e(
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__ */ c("div", { style: {
267
+ display: "flex",
268
+ alignItems: "center",
269
+ gap: z[2],
270
+ position: "relative"
271
+ }, children: [
272
+ /* @__PURE__ */ e("div", { style: {
273
+ width: 36,
274
+ height: 36,
275
+ borderRadius: y.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: t }),
283
+ /* @__PURE__ */ e("div", { style: {
284
+ fontSize: 13,
285
+ fontWeight: 500,
286
+ opacity: 0.92
287
+ }, children: n })
288
+ ] }),
289
+ /* @__PURE__ */ c("div", { style: {
290
+ display: "flex",
291
+ alignItems: "baseline",
292
+ gap: z[2],
293
+ position: "relative",
294
+ marginTop: z[3]
295
+ }, children: [
296
+ /* @__PURE__ */ e("div", { style: {
297
+ fontSize: 30,
298
+ fontWeight: 700,
299
+ lineHeight: 1.1,
300
+ letterSpacing: "-0.02em",
301
+ fontVariantNumeric: "tabular-nums"
302
+ }, children: C }),
303
+ a && /* @__PURE__ */ e("div", { style: { fontSize: 14, opacity: 0.85, fontWeight: 500 }, children: a }),
304
+ m != null && /* @__PURE__ */ c("div", { style: {
305
+ marginLeft: "auto",
306
+ fontSize: 12,
307
+ fontWeight: 600,
308
+ padding: "2px 8px",
309
+ borderRadius: 999,
310
+ background: I ? "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__ */ e("span", { style: { fontSize: 10 }, children: I ? "▲" : "▼" }),
316
+ Math.abs(m).toFixed(1),
317
+ "%"
318
+ ] })
319
+ ] })
320
+ ]
321
+ }
322
+ );
323
+ }
324
+ function V({ color: t = "blue", label: n, size: r = 8 }) {
325
+ const a = w[t] || w.blue;
326
+ return /* @__PURE__ */ c("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__ */ e("span", { style: {
335
+ width: r,
336
+ height: r,
337
+ borderRadius: "50%",
338
+ background: a.bg,
339
+ boxShadow: `0 0 0 3px ${a.soft}`,
340
+ flexShrink: 0
341
+ } }),
342
+ n && /* @__PURE__ */ e("span", { children: n })
343
+ ] });
344
+ }
345
+ function me({
346
+ color: t = "blue",
347
+ title: n,
348
+ subtitle: r,
349
+ moreText: a = "全部",
350
+ moreHref: g,
351
+ onMore: i
352
+ }) {
353
+ return /* @__PURE__ */ c("div", { style: {
354
+ display: "flex",
355
+ alignItems: "center",
356
+ justifyContent: "space-between",
357
+ marginBottom: 16
358
+ }, children: [
359
+ /* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "baseline", gap: 12 }, children: [
360
+ /* @__PURE__ */ e(V, { color: t, label: n, size: 10 }),
361
+ r && /* @__PURE__ */ e("span", { style: {
362
+ fontSize: 13,
363
+ color: "#6b7280",
364
+ fontWeight: 400
365
+ }, children: r })
366
+ ] }),
367
+ (g || i) && /* @__PURE__ */ c(
368
+ "a",
369
+ {
370
+ href: g,
371
+ onClick: (o) => {
372
+ i && (o.preventDefault(), i());
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: (o) => {
385
+ o.currentTarget.style.color = "#7c3aed";
386
+ },
387
+ onMouseLeave: (o) => {
388
+ o.currentTarget.style.color = "#6b7280";
389
+ },
390
+ children: [
391
+ a,
392
+ /* @__PURE__ */ e("span", { style: { fontSize: 12 }, children: "›" })
393
+ ]
394
+ }
395
+ )
396
+ ] });
397
+ }
398
+ function ye({
399
+ title: t,
400
+ description: n,
401
+ icon: r,
402
+ cover: a,
403
+ color: g = "violet",
404
+ tags: i = [],
405
+ meta: o,
406
+ href: d,
407
+ extra: l
408
+ }) {
409
+ const s = w[g] || w.violet, [b, p] = R(!1);
410
+ return /* @__PURE__ */ c(
411
+ "div",
412
+ {
413
+ onClick: () => {
414
+ d && typeof window < "u" && (window.location.href = d);
415
+ },
416
+ onMouseEnter: () => p(!0),
417
+ onMouseLeave: () => p(!1),
418
+ style: {
419
+ background: "#ffffff",
420
+ borderRadius: y.lg,
421
+ overflow: "hidden",
422
+ cursor: d ? "pointer" : "default",
423
+ boxShadow: b ? k.lg : k.sm,
424
+ transform: b ? "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__ */ c("div", { style: {
432
+ position: "relative",
433
+ aspectRatio: "16 / 9",
434
+ background: a ? "#f1f5f9" : s.gradient,
435
+ display: "flex",
436
+ alignItems: "center",
437
+ justifyContent: "center",
438
+ overflow: "hidden"
439
+ }, children: [
440
+ a ? /* @__PURE__ */ e(
441
+ "img",
442
+ {
443
+ src: a,
444
+ alt: t,
445
+ style: {
446
+ width: "100%",
447
+ height: "100%",
448
+ objectFit: "cover"
449
+ }
450
+ }
451
+ ) : /* @__PURE__ */ e("div", { style: {
452
+ fontSize: 48,
453
+ color: "rgba(255, 255, 255, 0.9)",
454
+ display: "flex"
455
+ }, children: r }),
456
+ !a && /* @__PURE__ */ e("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
+ l && /* @__PURE__ */ e("div", { style: {
466
+ position: "absolute",
467
+ top: 8,
468
+ right: 8
469
+ }, children: l })
470
+ ] }),
471
+ /* @__PURE__ */ c("div", { style: {
472
+ padding: z[4],
473
+ display: "flex",
474
+ flexDirection: "column",
475
+ gap: z[2],
476
+ flex: 1
477
+ }, children: [
478
+ i.length > 0 && /* @__PURE__ */ e("div", { style: {
479
+ display: "flex",
480
+ flexWrap: "wrap",
481
+ gap: 6
482
+ }, children: i.slice(0, 3).map((S, C) => {
483
+ const m = w[S.color] || w.blue;
484
+ return /* @__PURE__ */ e(
485
+ "span",
486
+ {
487
+ style: {
488
+ fontSize: 11,
489
+ fontWeight: 500,
490
+ padding: "2px 8px",
491
+ borderRadius: 999,
492
+ background: m.soft,
493
+ color: m.bg
494
+ },
495
+ children: S.label
496
+ },
497
+ C
498
+ );
499
+ }) }),
500
+ /* @__PURE__ */ e("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: t }),
511
+ n && /* @__PURE__ */ e("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
+ o && /* @__PURE__ */ e("div", { style: {
523
+ fontSize: 11,
524
+ color: "#9ca3af",
525
+ marginTop: "auto",
526
+ paddingTop: z[2],
527
+ borderTop: "1px dashed #f1f5f9"
528
+ }, children: o })
529
+ ] })
530
+ ]
531
+ }
532
+ );
533
+ }
534
+ function xe({
535
+ tag: t,
536
+ title: n,
537
+ description: r,
538
+ buttonText: a,
539
+ buttonHref: g,
540
+ onButtonClick: i
541
+ }) {
542
+ return /* @__PURE__ */ c("div", { style: {
543
+ position: "relative",
544
+ borderRadius: y.lg,
545
+ padding: "40px 48px",
546
+ background: "linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%)",
547
+ color: "#ffffff",
548
+ overflow: "hidden",
549
+ boxShadow: k.lg
550
+ }, children: [
551
+ /* @__PURE__ */ e("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__ */ e("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__ */ c("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__ */ c("div", { style: { flex: 1, minWidth: 240 }, children: [
580
+ t && /* @__PURE__ */ e("div", { style: {
581
+ fontSize: 11,
582
+ fontWeight: 600,
583
+ letterSpacing: "0.12em",
584
+ color: "#a5b4fc",
585
+ textTransform: "uppercase",
586
+ marginBottom: 12
587
+ }, children: t }),
588
+ /* @__PURE__ */ e("div", { style: {
589
+ fontSize: 24,
590
+ fontWeight: 700,
591
+ lineHeight: 1.3,
592
+ marginBottom: 8
593
+ }, children: n }),
594
+ r && /* @__PURE__ */ e("div", { style: {
595
+ fontSize: 14,
596
+ color: "rgba(255, 255, 255, 0.7)",
597
+ lineHeight: 1.6,
598
+ maxWidth: 540
599
+ }, children: r })
600
+ ] }),
601
+ a && (g || i) && /* @__PURE__ */ c(
602
+ "a",
603
+ {
604
+ href: g || "#",
605
+ onClick: (o) => {
606
+ i && (o.preventDefault(), i());
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: (o) => {
624
+ o.currentTarget.style.transform = "translateY(-1px)", o.currentTarget.style.boxShadow = "0 6px 16px rgba(16, 185, 129, 0.5)";
625
+ },
626
+ onMouseLeave: (o) => {
627
+ o.currentTarget.style.transform = "translateY(0)", o.currentTarget.style.boxShadow = "0 4px 12px rgba(16, 185, 129, 0.4)";
628
+ },
629
+ children: [
630
+ a,
631
+ /* @__PURE__ */ e("span", { children: "→" })
632
+ ]
633
+ }
634
+ )
635
+ ] })
636
+ ] });
637
+ }
638
+ function ee({
639
+ icon: t,
640
+ title: n = "暂无数据",
641
+ description: r,
642
+ actionText: a,
643
+ onAction: g,
644
+ size: i = "md",
645
+ style: o
646
+ }) {
647
+ const d = { sm: 24, md: 40, lg: 64 }, l = { sm: 14, md: 16, lg: 20 };
648
+ return /* @__PURE__ */ c(
649
+ "div",
650
+ {
651
+ role: "status",
652
+ "aria-live": "polite",
653
+ style: {
654
+ padding: d[i] || d.md,
655
+ textAlign: "center",
656
+ background: "#ffffff",
657
+ borderRadius: y.md,
658
+ border: "1px dashed #e5e7eb",
659
+ ...o
660
+ },
661
+ children: [
662
+ /* @__PURE__ */ e("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: t || /* @__PURE__ */ e(J, {}) }),
674
+ /* @__PURE__ */ e("div", { style: {
675
+ fontSize: l[i],
676
+ fontWeight: 600,
677
+ color: x.text,
678
+ marginBottom: r ? 6 : 16
679
+ }, children: n }),
680
+ r && /* @__PURE__ */ e("div", { style: {
681
+ fontSize: 13,
682
+ color: x.textMuted,
683
+ lineHeight: 1.6,
684
+ maxWidth: 360,
685
+ margin: "0 auto 16px"
686
+ }, children: r }),
687
+ a && g && /* @__PURE__ */ e(
688
+ W,
689
+ {
690
+ type: "primary",
691
+ onClick: g,
692
+ style: {
693
+ background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)",
694
+ border: "none",
695
+ minHeight: 36
696
+ },
697
+ children: a
698
+ }
699
+ )
700
+ ]
701
+ }
702
+ );
703
+ }
704
+ function te({
705
+ error: t,
706
+ title: n = "加载失败",
707
+ description: r,
708
+ onRetry: a,
709
+ retryText: g = "重新加载",
710
+ variant: i = "inline",
711
+ style: o
712
+ }) {
713
+ var v;
714
+ const d = i === "full", l = (v = t == null ? void 0 : t.response) == null ? void 0 : v.data, s = l && typeof l == "object" && (typeof l.message == "string" && l.message || typeof l.msg == "string" && l.msg) || null, b = s || (typeof t == "string" ? t : (t == null ? void 0 : t.message) || (t == null ? void 0 : t.msg) || (t ? String(t) : null)), p = r || (s ? `原因: ${s}` : b ? `原因: ${b}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
715
+ return /* @__PURE__ */ c(
716
+ "div",
717
+ {
718
+ role: "alert",
719
+ "aria-live": "assertive",
720
+ style: {
721
+ padding: d ? "48px 24px" : "20px 24px",
722
+ background: d ? "#ffffff" : "#fef2f2",
723
+ border: d ? `1px dashed ${x.border}` : "1px solid #fecaca",
724
+ borderRadius: y.md,
725
+ textAlign: d ? "center" : "left",
726
+ display: "flex",
727
+ flexDirection: d ? "column" : "row",
728
+ alignItems: d ? "center" : "flex-start",
729
+ gap: d ? 12 : 16,
730
+ ...o
731
+ },
732
+ children: [
733
+ /* @__PURE__ */ e("div", { style: {
734
+ display: "inline-flex",
735
+ alignItems: "center",
736
+ justifyContent: "center",
737
+ width: d ? 56 : 36,
738
+ height: d ? 56 : 36,
739
+ borderRadius: "50%",
740
+ background: d ? "#fef2f2" : "#ffffff",
741
+ color: "#dc2626",
742
+ fontSize: d ? 28 : 18,
743
+ flexShrink: 0
744
+ }, children: /* @__PURE__ */ e(Q, {}) }),
745
+ /* @__PURE__ */ c("div", { style: { flex: 1, minWidth: 0 }, children: [
746
+ /* @__PURE__ */ e("div", { style: {
747
+ fontSize: d ? 16 : 14,
748
+ fontWeight: 600,
749
+ color: "#991b1b",
750
+ marginBottom: 4
751
+ }, children: n }),
752
+ /* @__PURE__ */ e("div", { style: {
753
+ fontSize: 13,
754
+ color: "#7f1d1d",
755
+ lineHeight: 1.6,
756
+ wordBreak: "break-word"
757
+ }, children: p }),
758
+ a && /* @__PURE__ */ e(
759
+ W,
760
+ {
761
+ type: "primary",
762
+ danger: !0,
763
+ icon: /* @__PURE__ */ e(M, {}),
764
+ onClick: a,
765
+ size: d ? "middle" : "small",
766
+ style: { marginTop: 12 },
767
+ children: g
768
+ }
769
+ )
770
+ ] })
771
+ ]
772
+ }
773
+ );
774
+ }
775
+ function ve({
776
+ variant: t = "cards",
777
+ rows: n = 4,
778
+ active: r = !0,
779
+ style: a
780
+ }) {
781
+ return t === "cards" ? /* @__PURE__ */ e(
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
+ ...a
792
+ },
793
+ children: Array.from({ length: n }).map((g, i) => /* @__PURE__ */ c(
794
+ "div",
795
+ {
796
+ style: {
797
+ background: "#ffffff",
798
+ borderRadius: y.lg,
799
+ overflow: "hidden",
800
+ border: "1px solid #f1f5f9"
801
+ },
802
+ children: [
803
+ /* @__PURE__ */ e(
804
+ B.Image,
805
+ {
806
+ active: r,
807
+ style: { width: "100%", height: 140, borderRadius: 0 }
808
+ }
809
+ ),
810
+ /* @__PURE__ */ e("div", { style: { padding: 16 }, children: /* @__PURE__ */ e(B, { active: r, paragraph: { rows: 2 }, title: { width: "60%" } }) })
811
+ ]
812
+ },
813
+ i
814
+ ))
815
+ }
816
+ ) : t === "table" ? /* @__PURE__ */ e(
817
+ "div",
818
+ {
819
+ role: "status",
820
+ "aria-busy": "true",
821
+ "aria-label": "加载中",
822
+ style: {
823
+ background: "#ffffff",
824
+ padding: 24,
825
+ borderRadius: y.md,
826
+ ...a
827
+ },
828
+ children: /* @__PURE__ */ e(B, { active: r, paragraph: { rows: n } })
829
+ }
830
+ ) : t === "list" ? /* @__PURE__ */ e("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: a, children: Array.from({ length: n }).map((g, i) => /* @__PURE__ */ c(
831
+ "div",
832
+ {
833
+ style: {
834
+ display: "flex",
835
+ alignItems: "center",
836
+ gap: 12,
837
+ padding: "12px 0",
838
+ borderBottom: i < n - 1 ? "1px solid #f1f5f9" : "none"
839
+ },
840
+ children: [
841
+ /* @__PURE__ */ e(B.Avatar, { active: r, size: "default" }),
842
+ /* @__PURE__ */ e(B, { active: r, paragraph: { rows: 1 }, title: { width: 120 }, style: { flex: 1 } })
843
+ ]
844
+ },
845
+ i
846
+ )) }) : /* @__PURE__ */ e(
847
+ "div",
848
+ {
849
+ role: "status",
850
+ "aria-busy": "true",
851
+ "aria-label": "加载中",
852
+ style: {
853
+ background: "#ffffff",
854
+ padding: 32,
855
+ borderRadius: y.md,
856
+ ...a
857
+ },
858
+ children: /* @__PURE__ */ e(B, { active: r, title: { width: "40%" }, paragraph: { rows: n } })
859
+ }
860
+ );
861
+ }
862
+ function Se({
863
+ value: t,
864
+ onChange: n,
865
+ onSearch: r,
866
+ placeholder: a = "搜索...",
867
+ debounceMs: g = 300,
868
+ width: i = 280,
869
+ allowClear: o = !0,
870
+ // antd v6: enterButton 已被废弃,SearchInput 已通过 onKeyDown 自行处理 Enter 键,
871
+ // 所以从 rest 里过滤掉,避免透传到原生 <input> 报 React 警告。
872
+ enterButton: d,
873
+ ...l
874
+ }) {
875
+ const [s, b] = R(t || ""), p = L(null), v = L(t || "");
876
+ D(() => {
877
+ t !== void 0 && t !== s && (b(t || ""), v.current = t || "");
878
+ }, [t]), D(() => () => {
879
+ p.current && clearTimeout(p.current);
880
+ }, []);
881
+ const S = (u) => {
882
+ v.current = u, n && n(u);
883
+ }, C = (u) => {
884
+ const h = u.target.value;
885
+ if (b(h), p.current && clearTimeout(p.current), h === "") {
886
+ S("");
887
+ return;
888
+ }
889
+ p.current = setTimeout(() => S(h), g);
890
+ }, m = (u) => {
891
+ p.current && clearTimeout(p.current), S(u), r && r(u);
892
+ };
893
+ return /* @__PURE__ */ e(
894
+ K,
895
+ {
896
+ ...l,
897
+ value: s,
898
+ onChange: C,
899
+ onPressEnter: m,
900
+ onKeyDown: (u) => {
901
+ u.key === "Enter" ? (u.preventDefault(), m(s)) : u.key === "Escape" && (b(""), m(""));
902
+ },
903
+ placeholder: a,
904
+ allowClear: o ? { clearIcon: /* @__PURE__ */ e("span", { onClick: () => {
905
+ b(""), m("");
906
+ }, children: "×" }) } : !1,
907
+ prefix: /* @__PURE__ */ e(X, { style: { color: "#9ca3af" } }),
908
+ style: {
909
+ width: i,
910
+ borderRadius: y.md,
911
+ ...l.style || {}
912
+ }
913
+ }
914
+ );
915
+ }
916
+ function re({
917
+ title: t,
918
+ subtitle: n,
919
+ breadcrumb: r,
920
+ extra: a,
921
+ back: g,
922
+ onBack: i
923
+ }) {
924
+ const o = Z();
925
+ return /* @__PURE__ */ e("div", { style: {
926
+ marginBottom: 12,
927
+ paddingBottom: 10,
928
+ borderBottom: "1px solid #f1f5f9"
929
+ }, children: /* @__PURE__ */ c("div", { style: {
930
+ display: "flex",
931
+ alignItems: "center",
932
+ justifyContent: "space-between",
933
+ gap: 12,
934
+ flexWrap: "wrap"
935
+ }, children: [
936
+ /* @__PURE__ */ c("div", { style: {
937
+ display: "flex",
938
+ alignItems: "center",
939
+ gap: 10,
940
+ minWidth: 0,
941
+ flexWrap: "wrap"
942
+ }, children: [
943
+ g && /* @__PURE__ */ e(
944
+ "button",
945
+ {
946
+ onClick: () => {
947
+ i ? i() : o(-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: (l) => {
966
+ l.currentTarget.style.background = "#f8fafc", l.currentTarget.style.color = "#111827", l.currentTarget.style.borderColor = "#7c3aed";
967
+ },
968
+ onMouseLeave: (l) => {
969
+ l.currentTarget.style.background = "#ffffff", l.currentTarget.style.color = "#6b7280", l.currentTarget.style.borderColor = "#e5e7eb";
970
+ },
971
+ children: "←"
972
+ }
973
+ ),
974
+ r && r.length > 0 ? /* @__PURE__ */ e(
975
+ $,
976
+ {
977
+ items: r.map((l, s) => {
978
+ const b = s === r.length - 1;
979
+ return {
980
+ title: l.href && !b ? /* @__PURE__ */ e("a", { onClick: (p) => {
981
+ p.preventDefault(), o(l.href);
982
+ }, children: l.label }) : /* @__PURE__ */ e("span", { style: b ? {
983
+ fontWeight: 600,
984
+ color: "#111827"
985
+ } : void 0, children: l.label })
986
+ };
987
+ })
988
+ }
989
+ ) : t && /* @__PURE__ */ e("span", { role: "heading", "aria-level": 1, style: {
990
+ fontSize: 15,
991
+ fontWeight: 600,
992
+ color: "#111827",
993
+ lineHeight: 1.4
994
+ }, children: t }),
995
+ n && /* @__PURE__ */ e("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
+ a && /* @__PURE__ */ e("div", { style: {
1006
+ display: "flex",
1007
+ gap: 8,
1008
+ flexShrink: 0
1009
+ }, children: a })
1010
+ ] }) });
1011
+ }
1012
+ function we({ left: t, right: n, extra: r }) {
1013
+ return /* @__PURE__ */ c(
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__ */ e(P, { size: 8, wrap: !0, children: t }),
1026
+ /* @__PURE__ */ c(P, { size: 8, wrap: !0, children: [
1027
+ n,
1028
+ r
1029
+ ] })
1030
+ ]
1031
+ }
1032
+ );
1033
+ }
1034
+ function ke({ onClick: t, loading: n, title: r = "刷新" }) {
1035
+ return /* @__PURE__ */ e(W, { icon: /* @__PURE__ */ e(M, {}), onClick: t, loading: n, title: r, children: r });
1036
+ }
1037
+ const ne = {
1038
+ 0: { label: "待办", color: "default" },
1039
+ 1: { label: "进行中", color: "blue" },
1040
+ 2: { label: "已完成", color: "green" }
1041
+ }, ae = {
1042
+ ACTIVE: { label: "正常", color: "green" },
1043
+ INACTIVE: { label: "禁用", color: "red" },
1044
+ ENABLED: { label: "启用", color: "green" },
1045
+ DISABLED: { label: "禁用", color: "red" }
1046
+ }, ie = {
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
+ }, le = {
1054
+ PENDING: { label: "待审批", color: "orange" },
1055
+ APPROVED: { label: "已通过", color: "green" },
1056
+ REJECTED: { label: "已拒绝", color: "red" },
1057
+ CANCELLED: { label: "已撤回", color: "default" }
1058
+ }, oe = {
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
+ }, de = {
1065
+ task: ne,
1066
+ model: ae,
1067
+ priority: ie,
1068
+ approval: le,
1069
+ schedule: oe
1070
+ };
1071
+ function Ce({ status: t, type: n = "task", mapping: r, ...a }) {
1072
+ const i = (r || de[n] || {})[t];
1073
+ return i ? /* @__PURE__ */ e(F, { color: i.color, ...a, children: i.label }) : /* @__PURE__ */ e(F, { ...a, children: String(t) });
1074
+ }
1075
+ function Te({ title: t, description: n, load: r, columns: a, rowKey: g = "id", extra: i, expandable: o }) {
1076
+ const [d, l] = R([]), [s, b] = R({ current: 1, size: 10, total: null }), [p, v] = R(!1), [S, C] = R(null), m = Y(async (f = s.current, u = s.size) => {
1077
+ v(!0), C(null);
1078
+ try {
1079
+ const h = await r(f, u);
1080
+ if (Array.isArray(h))
1081
+ l(h || []), b({ current: f, size: u, total: h.length });
1082
+ else {
1083
+ const A = (h == null ? void 0 : h.records) || [];
1084
+ l(A), b({ current: f, size: u, total: (h == null ? void 0 : h.total) == null ? null : Number(h.total) });
1085
+ }
1086
+ } catch (h) {
1087
+ l([]), C(h);
1088
+ } finally {
1089
+ v(!1);
1090
+ }
1091
+ }, [r, s.current, s.size]);
1092
+ D(() => {
1093
+ m(1);
1094
+ }, []);
1095
+ const I = s.total != null && s.total > 0;
1096
+ return /* @__PURE__ */ c("div", { children: [
1097
+ /* @__PURE__ */ e(re, { title: t, subtitle: n }),
1098
+ /* @__PURE__ */ c(
1099
+ _,
1100
+ {
1101
+ extra: /* @__PURE__ */ e(
1102
+ W,
1103
+ {
1104
+ icon: /* @__PURE__ */ e(M, {}),
1105
+ loading: p,
1106
+ onClick: () => m(s.current, s.size),
1107
+ children: "刷新"
1108
+ }
1109
+ ),
1110
+ children: [
1111
+ i,
1112
+ S ? /* @__PURE__ */ e(te, { error: S, onRetry: () => m(s.current, s.size), type: "inline" }) : /* @__PURE__ */ e(
1113
+ q,
1114
+ {
1115
+ size: "small",
1116
+ columns: a,
1117
+ dataSource: d,
1118
+ loading: p,
1119
+ rowKey: (f) => (f == null ? void 0 : f[g]) ?? (f == null ? void 0 : f.key) ?? JSON.stringify(f).slice(0, 32),
1120
+ pagination: {
1121
+ current: s.current,
1122
+ pageSize: s.size,
1123
+ total: I ? s.total : d.length,
1124
+ showSizeChanger: !0,
1125
+ showTotal: () => I ? `共 ${s.total} 条` : `本页 ${d.length} 条(接口 total 未返回有效值)`
1126
+ },
1127
+ onChange: (f) => m(f.current, f.pageSize),
1128
+ expandable: o,
1129
+ locale: { emptyText: /* @__PURE__ */ e(ee, { title: "暂无数据", description: "接口返回空列表" }) }
1130
+ }
1131
+ )
1132
+ ]
1133
+ }
1134
+ )
1135
+ ] });
1136
+ }
1137
+ export {
1138
+ V as C,
1139
+ xe as D,
1140
+ ee as E,
1141
+ ye as F,
1142
+ he as G,
1143
+ ve as L,
1144
+ re as P,
1145
+ ke as R,
1146
+ Se as S,
1147
+ we as T,
1148
+ te as a,
1149
+ Te as b,
1150
+ me as c,
1151
+ Ce as d,
1152
+ be as e,
1153
+ T as f,
1154
+ O as g,
1155
+ z as h,
1156
+ ue as l,
1157
+ x as n,
1158
+ w as p,
1159
+ y as r,
1160
+ k as s
1161
+ };