@yuku123/z-frontend-common 1.1.4 → 1.1.5
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 +2 -1
- package/dist/{ComponentDoc-22ujWxLE.js → ComponentDoc-rk9VdFSV.js} +161 -146
- package/dist/index.js +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/src/components/ui/PagedTable.jsx +26 -2
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|------|-----|
|
|
16
16
|
| 仓 | `z-opc-foundation/z-frontend-common`(本仓) |
|
|
17
17
|
| npm 包 | `@yuku123/z-frontend-common`(scope 沿用 yuku123,与 0.1.x/0.2.x 旧线连续) |
|
|
18
|
-
| 当前版本 | `1.1.
|
|
18
|
+
| 当前版本 | `1.1.5` —— 1.0 语义:§1-§16 规范化起点;1.1.x 在其上追加扁平 ui 组件桶。0.1.x 是 pre-§16 形态;0.2.x 内嵌 react-dom 已废弃 |
|
|
19
19
|
| 技术栈 | React 19 + antd 6 + react-router-dom 7 + Vite 6(lead 005 §3.0 版本线单一尺子) |
|
|
20
20
|
| 产物 | ESM **3 入口**(`formats: ['es']`):`dist/index.js`(主桶)+ `dist/ui.js`(扁平 ui 桶)+ `dist/ui-echarts.js`(`ui/echarts` 子路径) |
|
|
21
21
|
| 打包策略 | external 精确 **9** 个包 + **1** 条前缀规则(`echarts/*`):react / react-dom / react-dom/client / react/jsx-runtime / react-router-dom / antd / @ant-design/icons / axios / echarts |
|
|
@@ -83,4 +83,5 @@ const MOCK_AUTH = { username: 'admin', password: '123456', user: { name: 'admin'
|
|
|
83
83
|
- `1.1.1`:在 1.0.0 之上追加扁平 ui 组件桶(13 个 UI 组件 + design token)与 `ui/echarts` 子路径
|
|
84
84
|
- `1.1.2`:ui 桶追加 `ComponentDoc`(§7 组件文档页:240px TOC + 正文两栏、滚动联动、锚点跳转、自带零依赖 markdown 引擎,宿主可注册 react-markdown 三件套升级为 GFM + Prism 高亮)
|
|
85
85
|
- `1.1.4`:ui 桶的 `ListTable` 支持 `cardExtra`(Card 动作按钮)与 `searchKeys`(过滤框)**并排**渲染 —— 原实现二选一,会把其中一个静默吞掉(页面同时有「搜索」和「新增」按钮时按钮消失)。
|
|
86
|
+
- `1.1.5`:`PagedTable`(**服务端分页**变体)补上 `pageSizeOptions` —— §2 强制规则 2 要求分页凑齐 `pageSize` + `showSizeChanger` + `pageSizeOptions` + `showTotal` 四件套,而 `PagedTable` 的分页参数是内联在组件里的(不走 `DEFAULT_PAGINATION`),此前漏了 `pageSizeOptions` ⇒ 全库 §2 元素级普查把 **8 个仓**的 `PagedTable` 拷贝一起判红(根因是这一处漏项被复制了 8 遍)。同版把 `showTotal` 的两支文案提成纯函数 `PAGED_TOTAL_TEXT` 并加 `test/paged-table.test.mjs`(含变异必须真红)—— antd Table 在空数据时整个分页块不渲染,闭包式文案没法被测到。
|
|
86
87
|
- `1.1.3`:ui 桶追加 `useListFilter` / `filterRows`(§2 强制规则 3 的客户端过滤口径统一收在基座:大小写不敏感、多字段「或」匹配、null 字段不参与匹配、空关键字原样返回)与 `ListTable`(§2 规则 2/3/4 的成品件:分页三件套 + Card extra 过滤框 + EmptyState 空态一次到位)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as m, jsx as t, Fragment as
|
|
2
|
-
import { useState as B, useRef as
|
|
3
|
-
import { Button as V, Skeleton as
|
|
4
|
-
import { InboxOutlined as Ie, ExclamationCircleOutlined as
|
|
5
|
-
import { useNavigate as
|
|
1
|
+
import { jsxs as m, jsx as t, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import { useState as B, useRef as P, useEffect as L, useMemo as q, useCallback as me, useLayoutEffect as Te, createElement as ae, Fragment as O } from "react";
|
|
3
|
+
import { Button as V, Skeleton as N, Input as Ee, Card as ye, Table as xe, Breadcrumb as Ae, Space as se, Tag as ce } from "antd";
|
|
4
|
+
import { InboxOutlined as Ie, ExclamationCircleOutlined as ze, ReloadOutlined as re, SearchOutlined as Be, ReadOutlined as De } from "@ant-design/icons";
|
|
5
|
+
import { useNavigate as ve, useInRouterContext as Le } from "react-router-dom";
|
|
6
6
|
const T = {
|
|
7
7
|
// 主色 (蓝紫) - 顶导/重点按钮/链接
|
|
8
8
|
primary: "#7c3aed",
|
|
@@ -88,10 +88,10 @@ const T = {
|
|
|
88
88
|
md: "0 2px 4px -1px rgba(15, 23, 42, 0.04), 0 4px 8px -1px rgba(15, 23, 42, 0.08)",
|
|
89
89
|
lg: "0 4px 6px -2px rgba(15, 23, 42, 0.05), 0 12px 16px -4px rgba(15, 23, 42, 0.10)",
|
|
90
90
|
xl: "0 8px 24px -6px rgba(15, 23, 42, 0.10), 0 24px 48px -12px rgba(15, 23, 42, 0.18)"
|
|
91
|
-
},
|
|
91
|
+
}, st = {
|
|
92
92
|
rest: D.md,
|
|
93
93
|
hover: "0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 20px 32px -8px rgba(15, 23, 42, 0.14)"
|
|
94
|
-
},
|
|
94
|
+
}, _ = {
|
|
95
95
|
1: 4,
|
|
96
96
|
2: 8,
|
|
97
97
|
3: 12,
|
|
@@ -189,7 +189,7 @@ const T = {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
|
-
function
|
|
192
|
+
function ct({
|
|
193
193
|
icon: e,
|
|
194
194
|
label: n,
|
|
195
195
|
value: s,
|
|
@@ -200,7 +200,7 @@ function st({
|
|
|
200
200
|
loading: l = !1,
|
|
201
201
|
precision: i = 0
|
|
202
202
|
}) {
|
|
203
|
-
const d = E[c] || E.blue, [f, g] = B(0), p =
|
|
203
|
+
const d = E[c] || E.blue, [f, g] = B(0), p = P(0);
|
|
204
204
|
L(() => {
|
|
205
205
|
if (l || s == null) return;
|
|
206
206
|
const b = p.current, S = Number(s) || 0;
|
|
@@ -208,10 +208,10 @@ function st({
|
|
|
208
208
|
g(S);
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
|
-
const w = 600,
|
|
211
|
+
const w = 600, I = performance.now();
|
|
212
212
|
let $;
|
|
213
213
|
const G = (U) => {
|
|
214
|
-
const j = Math.min(1, (U -
|
|
214
|
+
const j = Math.min(1, (U - I) / w), J = 1 - Math.pow(1 - j, 3), u = b + (S - b) * J;
|
|
215
215
|
g(u), j < 1 ? $ = requestAnimationFrame(G) : p.current = S;
|
|
216
216
|
};
|
|
217
217
|
return $ = requestAnimationFrame(G), () => $ && cancelAnimationFrame($);
|
|
@@ -221,7 +221,7 @@ function st({
|
|
|
221
221
|
}, k = l ? "--" : Number(f).toLocaleString("zh-CN", {
|
|
222
222
|
minimumFractionDigits: i,
|
|
223
223
|
maximumFractionDigits: i
|
|
224
|
-
}), v = a != null ? Number(a) : null,
|
|
224
|
+
}), v = a != null ? Number(a) : null, A = v != null && v >= 0;
|
|
225
225
|
return /* @__PURE__ */ m(
|
|
226
226
|
"div",
|
|
227
227
|
{
|
|
@@ -230,7 +230,7 @@ function st({
|
|
|
230
230
|
position: "relative",
|
|
231
231
|
background: d.gradient,
|
|
232
232
|
borderRadius: C.lg,
|
|
233
|
-
padding:
|
|
233
|
+
padding: _[5],
|
|
234
234
|
color: d.fg,
|
|
235
235
|
cursor: r ? "pointer" : "default",
|
|
236
236
|
boxShadow: D.md,
|
|
@@ -266,7 +266,7 @@ function st({
|
|
|
266
266
|
/* @__PURE__ */ m("div", { style: {
|
|
267
267
|
display: "flex",
|
|
268
268
|
alignItems: "center",
|
|
269
|
-
gap:
|
|
269
|
+
gap: _[2],
|
|
270
270
|
position: "relative"
|
|
271
271
|
}, children: [
|
|
272
272
|
/* @__PURE__ */ t("div", { style: {
|
|
@@ -289,9 +289,9 @@ function st({
|
|
|
289
289
|
/* @__PURE__ */ m("div", { style: {
|
|
290
290
|
display: "flex",
|
|
291
291
|
alignItems: "baseline",
|
|
292
|
-
gap:
|
|
292
|
+
gap: _[2],
|
|
293
293
|
position: "relative",
|
|
294
|
-
marginTop:
|
|
294
|
+
marginTop: _[3]
|
|
295
295
|
}, children: [
|
|
296
296
|
/* @__PURE__ */ t("div", { style: {
|
|
297
297
|
fontSize: 30,
|
|
@@ -307,12 +307,12 @@ function st({
|
|
|
307
307
|
fontWeight: 600,
|
|
308
308
|
padding: "2px 8px",
|
|
309
309
|
borderRadius: 999,
|
|
310
|
-
background:
|
|
310
|
+
background: A ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.18)",
|
|
311
311
|
display: "flex",
|
|
312
312
|
alignItems: "center",
|
|
313
313
|
gap: 2
|
|
314
314
|
}, children: [
|
|
315
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children:
|
|
315
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: A ? "▲" : "▼" }),
|
|
316
316
|
Math.abs(v).toFixed(1),
|
|
317
317
|
"%"
|
|
318
318
|
] })
|
|
@@ -321,7 +321,7 @@ function st({
|
|
|
321
321
|
}
|
|
322
322
|
);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function $e({ color: e = "blue", label: n, size: s = 8 }) {
|
|
325
325
|
const o = E[e] || E.blue;
|
|
326
326
|
return /* @__PURE__ */ m("span", { style: {
|
|
327
327
|
display: "inline-flex",
|
|
@@ -342,7 +342,7 @@ function Le({ color: e = "blue", label: n, size: s = 8 }) {
|
|
|
342
342
|
n && /* @__PURE__ */ t("span", { children: n })
|
|
343
343
|
] });
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function dt({
|
|
346
346
|
color: e = "blue",
|
|
347
347
|
title: n,
|
|
348
348
|
subtitle: s,
|
|
@@ -357,7 +357,7 @@ function ct({
|
|
|
357
357
|
marginBottom: 16
|
|
358
358
|
}, children: [
|
|
359
359
|
/* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "baseline", gap: 12 }, children: [
|
|
360
|
-
/* @__PURE__ */ t(
|
|
360
|
+
/* @__PURE__ */ t($e, { color: e, label: n, size: 10 }),
|
|
361
361
|
s && /* @__PURE__ */ t("span", { style: {
|
|
362
362
|
fontSize: 13,
|
|
363
363
|
color: "#6b7280",
|
|
@@ -395,7 +395,7 @@ function ct({
|
|
|
395
395
|
)
|
|
396
396
|
] });
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function ft({
|
|
399
399
|
title: e,
|
|
400
400
|
description: n,
|
|
401
401
|
icon: s,
|
|
@@ -469,10 +469,10 @@ function dt({
|
|
|
469
469
|
}, children: i })
|
|
470
470
|
] }),
|
|
471
471
|
/* @__PURE__ */ m("div", { style: {
|
|
472
|
-
padding:
|
|
472
|
+
padding: _[4],
|
|
473
473
|
display: "flex",
|
|
474
474
|
flexDirection: "column",
|
|
475
|
-
gap:
|
|
475
|
+
gap: _[2],
|
|
476
476
|
flex: 1
|
|
477
477
|
}, children: [
|
|
478
478
|
a.length > 0 && /* @__PURE__ */ t("div", { style: {
|
|
@@ -523,7 +523,7 @@ function dt({
|
|
|
523
523
|
fontSize: 11,
|
|
524
524
|
color: "#9ca3af",
|
|
525
525
|
marginTop: "auto",
|
|
526
|
-
paddingTop:
|
|
526
|
+
paddingTop: _[2],
|
|
527
527
|
borderTop: "1px dashed #f1f5f9"
|
|
528
528
|
}, children: r })
|
|
529
529
|
] })
|
|
@@ -531,7 +531,7 @@ function dt({
|
|
|
531
531
|
}
|
|
532
532
|
);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function gt({
|
|
535
535
|
tag: e,
|
|
536
536
|
title: n,
|
|
537
537
|
description: s,
|
|
@@ -701,7 +701,7 @@ function ne({
|
|
|
701
701
|
}
|
|
702
702
|
);
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function We({
|
|
705
705
|
error: e,
|
|
706
706
|
title: n = "加载失败",
|
|
707
707
|
description: s,
|
|
@@ -741,7 +741,7 @@ function $e({
|
|
|
741
741
|
color: "#dc2626",
|
|
742
742
|
fontSize: l ? 28 : 18,
|
|
743
743
|
flexShrink: 0
|
|
744
|
-
}, children: /* @__PURE__ */ t(
|
|
744
|
+
}, children: /* @__PURE__ */ t(ze, {}) }),
|
|
745
745
|
/* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
746
746
|
/* @__PURE__ */ t("div", { style: {
|
|
747
747
|
fontSize: l ? 16 : 14,
|
|
@@ -772,7 +772,7 @@ function $e({
|
|
|
772
772
|
}
|
|
773
773
|
);
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function ut({
|
|
776
776
|
variant: e = "cards",
|
|
777
777
|
rows: n = 4,
|
|
778
778
|
active: s = !0,
|
|
@@ -801,13 +801,13 @@ function gt({
|
|
|
801
801
|
},
|
|
802
802
|
children: [
|
|
803
803
|
/* @__PURE__ */ t(
|
|
804
|
-
|
|
804
|
+
N.Image,
|
|
805
805
|
{
|
|
806
806
|
active: s,
|
|
807
807
|
style: { width: "100%", height: 140, borderRadius: 0 }
|
|
808
808
|
}
|
|
809
809
|
),
|
|
810
|
-
/* @__PURE__ */ t("div", { style: { padding: 16 }, children: /* @__PURE__ */ t(
|
|
810
|
+
/* @__PURE__ */ t("div", { style: { padding: 16 }, children: /* @__PURE__ */ t(N, { active: s, paragraph: { rows: 2 }, title: { width: "60%" } }) })
|
|
811
811
|
]
|
|
812
812
|
},
|
|
813
813
|
a
|
|
@@ -825,7 +825,7 @@ function gt({
|
|
|
825
825
|
borderRadius: C.md,
|
|
826
826
|
...o
|
|
827
827
|
},
|
|
828
|
-
children: /* @__PURE__ */ t(
|
|
828
|
+
children: /* @__PURE__ */ t(N, { active: s, paragraph: { rows: n } })
|
|
829
829
|
}
|
|
830
830
|
) : e === "list" ? /* @__PURE__ */ t("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: o, children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
|
|
831
831
|
"div",
|
|
@@ -838,8 +838,8 @@ function gt({
|
|
|
838
838
|
borderBottom: a < n - 1 ? "1px solid #f1f5f9" : "none"
|
|
839
839
|
},
|
|
840
840
|
children: [
|
|
841
|
-
/* @__PURE__ */ t(
|
|
842
|
-
/* @__PURE__ */ t(
|
|
841
|
+
/* @__PURE__ */ t(N.Avatar, { active: s, size: "default" }),
|
|
842
|
+
/* @__PURE__ */ t(N, { active: s, paragraph: { rows: 1 }, title: { width: 120 }, style: { flex: 1 } })
|
|
843
843
|
]
|
|
844
844
|
},
|
|
845
845
|
a
|
|
@@ -855,11 +855,11 @@ function gt({
|
|
|
855
855
|
borderRadius: C.md,
|
|
856
856
|
...o
|
|
857
857
|
},
|
|
858
|
-
children: /* @__PURE__ */ t(
|
|
858
|
+
children: /* @__PURE__ */ t(N, { active: s, title: { width: "40%" }, paragraph: { rows: n } })
|
|
859
859
|
}
|
|
860
860
|
);
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function Me({
|
|
863
863
|
value: e,
|
|
864
864
|
onChange: n,
|
|
865
865
|
onSearch: s,
|
|
@@ -872,7 +872,7 @@ function We({
|
|
|
872
872
|
enterButton: l,
|
|
873
873
|
...i
|
|
874
874
|
}) {
|
|
875
|
-
const [d, f] = B(e || ""), g =
|
|
875
|
+
const [d, f] = B(e || ""), g = P(null), p = P(e || "");
|
|
876
876
|
L(() => {
|
|
877
877
|
e !== void 0 && e !== d && (f(e || ""), p.current = e || "");
|
|
878
878
|
}, [e]), L(() => () => {
|
|
@@ -891,7 +891,7 @@ function We({
|
|
|
891
891
|
g.current && clearTimeout(g.current), h(S), s && s(S);
|
|
892
892
|
};
|
|
893
893
|
return /* @__PURE__ */ t(
|
|
894
|
-
|
|
894
|
+
Ee,
|
|
895
895
|
{
|
|
896
896
|
...i,
|
|
897
897
|
value: d,
|
|
@@ -904,7 +904,7 @@ function We({
|
|
|
904
904
|
allowClear: r ? { clearIcon: /* @__PURE__ */ t("span", { onClick: () => {
|
|
905
905
|
f(""), v("");
|
|
906
906
|
}, children: "×" }) } : !1,
|
|
907
|
-
prefix: /* @__PURE__ */ t(
|
|
907
|
+
prefix: /* @__PURE__ */ t(Be, { style: { color: "#9ca3af" } }),
|
|
908
908
|
style: {
|
|
909
909
|
width: a,
|
|
910
910
|
borderRadius: C.md,
|
|
@@ -913,7 +913,7 @@ function We({
|
|
|
913
913
|
}
|
|
914
914
|
);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function He(e, n, s) {
|
|
917
917
|
const o = Array.isArray(e) ? e : [], c = String(s ?? "").trim().toLowerCase();
|
|
918
918
|
if (!c) return o;
|
|
919
919
|
const a = (Array.isArray(n) ? n : String(n || "").split(",")).map((r) => String(r || "").trim()).filter(Boolean);
|
|
@@ -922,20 +922,20 @@ function Me(e, n, s) {
|
|
|
922
922
|
return i == null ? !1 : String(i).toLowerCase().includes(c);
|
|
923
923
|
})) : o;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Pe(e, n) {
|
|
926
926
|
const [s, o] = B(""), c = (Array.isArray(n) ? n.join(",") : String(n || "")).trim(), a = q(
|
|
927
|
-
() =>
|
|
927
|
+
() => He(e, c, s),
|
|
928
928
|
[e, c, s]
|
|
929
|
-
), r =
|
|
929
|
+
), r = me(() => o(""), []);
|
|
930
930
|
return { keyword: s, setKeyword: o, filtered: a, reset: r };
|
|
931
931
|
}
|
|
932
|
-
const
|
|
932
|
+
const _e = {
|
|
933
933
|
pageSize: 10,
|
|
934
934
|
showSizeChanger: !0,
|
|
935
935
|
pageSizeOptions: ["10", "20", "50", "100"],
|
|
936
936
|
showTotal: (e) => `共 ${e} 条`
|
|
937
937
|
};
|
|
938
|
-
function
|
|
938
|
+
function pt({
|
|
939
939
|
rows: e,
|
|
940
940
|
columns: n,
|
|
941
941
|
rowKey: s,
|
|
@@ -949,13 +949,13 @@ function ut({
|
|
|
949
949
|
emptyDescription: f,
|
|
950
950
|
emptyActionText: g,
|
|
951
951
|
emptyOnAction: p,
|
|
952
|
-
pagination: h =
|
|
952
|
+
pagination: h = _e,
|
|
953
953
|
cardProps: k = {},
|
|
954
954
|
tableProps: v = {},
|
|
955
|
-
...
|
|
955
|
+
...A
|
|
956
956
|
}) {
|
|
957
|
-
const { keyword: b, setKeyword: S, filtered: w } =
|
|
958
|
-
|
|
957
|
+
const { keyword: b, setKeyword: S, filtered: w } = Pe(e, c), I = c ? /* @__PURE__ */ t(
|
|
958
|
+
Me,
|
|
959
959
|
{
|
|
960
960
|
allowClear: !0,
|
|
961
961
|
width: r,
|
|
@@ -964,11 +964,11 @@ function ut({
|
|
|
964
964
|
onChange: S
|
|
965
965
|
}
|
|
966
966
|
) : null;
|
|
967
|
-
return /* @__PURE__ */ t(
|
|
968
|
-
|
|
967
|
+
return /* @__PURE__ */ t(ye, { title: l, extra: I && i ? /* @__PURE__ */ m("span", { style: { display: "inline-flex", alignItems: "center", gap: 8 }, children: [
|
|
968
|
+
I,
|
|
969
969
|
i
|
|
970
|
-
] }) :
|
|
971
|
-
|
|
970
|
+
] }) : I || i, ...k, children: /* @__PURE__ */ t(
|
|
971
|
+
xe,
|
|
972
972
|
{
|
|
973
973
|
rowKey: s,
|
|
974
974
|
columns: n,
|
|
@@ -988,11 +988,11 @@ function ut({
|
|
|
988
988
|
)
|
|
989
989
|
},
|
|
990
990
|
...v,
|
|
991
|
-
...
|
|
991
|
+
...A
|
|
992
992
|
}
|
|
993
993
|
) });
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Se({
|
|
996
996
|
title: e,
|
|
997
997
|
subtitle: n,
|
|
998
998
|
breadcrumb: s,
|
|
@@ -1000,7 +1000,7 @@ function ve({
|
|
|
1000
1000
|
back: c,
|
|
1001
1001
|
onBack: a
|
|
1002
1002
|
}) {
|
|
1003
|
-
const r =
|
|
1003
|
+
const r = ve();
|
|
1004
1004
|
return /* @__PURE__ */ t("div", { style: {
|
|
1005
1005
|
marginBottom: 12,
|
|
1006
1006
|
paddingBottom: 10,
|
|
@@ -1051,7 +1051,7 @@ function ve({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
),
|
|
1053
1053
|
s && s.length > 0 ? /* @__PURE__ */ t(
|
|
1054
|
-
|
|
1054
|
+
Ae,
|
|
1055
1055
|
{
|
|
1056
1056
|
items: s.map((i, d) => {
|
|
1057
1057
|
const f = d === s.length - 1;
|
|
@@ -1088,7 +1088,7 @@ function ve({
|
|
|
1088
1088
|
}, children: o })
|
|
1089
1089
|
] }) });
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function ht({ left: e, right: n, extra: s }) {
|
|
1092
1092
|
return /* @__PURE__ */ m(
|
|
1093
1093
|
"div",
|
|
1094
1094
|
{
|
|
@@ -1110,57 +1110,64 @@ function pt({ left: e, right: n, extra: s }) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function bt({ onClick: e, loading: n, title: s = "刷新" }) {
|
|
1114
1114
|
return /* @__PURE__ */ t(V, { icon: /* @__PURE__ */ t(re, {}), onClick: e, loading: n, title: s, children: s });
|
|
1115
1115
|
}
|
|
1116
|
-
const
|
|
1116
|
+
const Ne = {
|
|
1117
1117
|
0: { label: "待办", color: "default" },
|
|
1118
1118
|
1: { label: "进行中", color: "blue" },
|
|
1119
1119
|
2: { label: "已完成", color: "green" }
|
|
1120
|
-
},
|
|
1120
|
+
}, Oe = {
|
|
1121
1121
|
ACTIVE: { label: "正常", color: "green" },
|
|
1122
1122
|
INACTIVE: { label: "禁用", color: "red" },
|
|
1123
1123
|
ENABLED: { label: "启用", color: "green" },
|
|
1124
1124
|
DISABLED: { label: "禁用", color: "red" }
|
|
1125
|
-
},
|
|
1125
|
+
}, Fe = {
|
|
1126
1126
|
low: { label: "低", color: "default" },
|
|
1127
1127
|
medium: { label: "中", color: "orange" },
|
|
1128
1128
|
high: { label: "高", color: "red" },
|
|
1129
1129
|
1: { label: "低", color: "default" },
|
|
1130
1130
|
2: { label: "中", color: "orange" },
|
|
1131
1131
|
3: { label: "高", color: "red" }
|
|
1132
|
-
},
|
|
1132
|
+
}, je = {
|
|
1133
1133
|
PENDING: { label: "待审批", color: "orange" },
|
|
1134
1134
|
APPROVED: { label: "已通过", color: "green" },
|
|
1135
1135
|
REJECTED: { label: "已拒绝", color: "red" },
|
|
1136
1136
|
CANCELLED: { label: "已撤回", color: "default" }
|
|
1137
|
-
},
|
|
1137
|
+
}, qe = {
|
|
1138
1138
|
RUNNING: { label: "运行中", color: "green" },
|
|
1139
1139
|
PAUSED: { label: "已暂停", color: "orange" },
|
|
1140
1140
|
STOPPED: { label: "已停止", color: "default" },
|
|
1141
1141
|
FAILED: { label: "失败", color: "red" },
|
|
1142
1142
|
SUCCESS: { label: "成功", color: "green" }
|
|
1143
|
-
},
|
|
1144
|
-
task:
|
|
1145
|
-
model:
|
|
1146
|
-
priority:
|
|
1147
|
-
approval:
|
|
1148
|
-
schedule:
|
|
1143
|
+
}, Ge = {
|
|
1144
|
+
task: Ne,
|
|
1145
|
+
model: Oe,
|
|
1146
|
+
priority: Fe,
|
|
1147
|
+
approval: je,
|
|
1148
|
+
schedule: qe
|
|
1149
1149
|
};
|
|
1150
|
-
function
|
|
1151
|
-
const a = (s ||
|
|
1150
|
+
function mt({ status: e, type: n = "task", mapping: s, ...o }) {
|
|
1151
|
+
const a = (s || Ge[n] || {})[e];
|
|
1152
1152
|
return a ? /* @__PURE__ */ t(ce, { color: a.color, ...o, children: a.label }) : /* @__PURE__ */ t(ce, { ...o, children: String(e) });
|
|
1153
1153
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1154
|
+
const fe = {
|
|
1155
|
+
// total 有效 ⇒ 标准口径
|
|
1156
|
+
known: (e) => `共 ${e} 条`,
|
|
1157
|
+
// total 缺失/为 0 —— 后端 z-meta 的分页 count 有缺陷(records 有值但 total 返回 "0"),
|
|
1158
|
+
// 这时不能显示「共 0 条」(页面上会出现"有数据却说没有数据"的假象)
|
|
1159
|
+
unknown: (e) => `本页 ${e} 条(接口 total 未返回有效值)`
|
|
1160
|
+
};
|
|
1161
|
+
function yt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", extra: a, expandable: r }) {
|
|
1162
|
+
const [l, i] = B([]), [d, f] = B({ current: 1, size: 10, total: null }), [g, p] = B(!1), [h, k] = B(null), v = me(async (b = d.current, S = d.size) => {
|
|
1156
1163
|
p(!0), k(null);
|
|
1157
1164
|
try {
|
|
1158
1165
|
const w = await s(b, S);
|
|
1159
1166
|
if (Array.isArray(w))
|
|
1160
1167
|
i(w || []), f({ current: b, size: S, total: w.length });
|
|
1161
1168
|
else {
|
|
1162
|
-
const
|
|
1163
|
-
i(
|
|
1169
|
+
const I = (w == null ? void 0 : w.records) || [];
|
|
1170
|
+
i(I), f({ current: b, size: S, total: (w == null ? void 0 : w.total) == null ? null : Number(w.total) });
|
|
1164
1171
|
}
|
|
1165
1172
|
} catch (w) {
|
|
1166
1173
|
i([]), k(w);
|
|
@@ -1171,11 +1178,11 @@ function mt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", e
|
|
|
1171
1178
|
L(() => {
|
|
1172
1179
|
v(1);
|
|
1173
1180
|
}, []);
|
|
1174
|
-
const
|
|
1181
|
+
const A = d.total != null && d.total > 0;
|
|
1175
1182
|
return /* @__PURE__ */ m("div", { children: [
|
|
1176
|
-
/* @__PURE__ */ t(
|
|
1183
|
+
/* @__PURE__ */ t(Se, { title: e, subtitle: n }),
|
|
1177
1184
|
/* @__PURE__ */ m(
|
|
1178
|
-
|
|
1185
|
+
ye,
|
|
1179
1186
|
{
|
|
1180
1187
|
extra: /* @__PURE__ */ t(
|
|
1181
1188
|
V,
|
|
@@ -1188,8 +1195,8 @@ function mt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", e
|
|
|
1188
1195
|
),
|
|
1189
1196
|
children: [
|
|
1190
1197
|
a,
|
|
1191
|
-
h ? /* @__PURE__ */ t(
|
|
1192
|
-
|
|
1198
|
+
h ? /* @__PURE__ */ t(We, { error: h, onRetry: () => v(d.current, d.size), type: "inline" }) : /* @__PURE__ */ t(
|
|
1199
|
+
xe,
|
|
1193
1200
|
{
|
|
1194
1201
|
size: "small",
|
|
1195
1202
|
columns: o,
|
|
@@ -1199,9 +1206,17 @@ function mt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", e
|
|
|
1199
1206
|
pagination: {
|
|
1200
1207
|
current: d.current,
|
|
1201
1208
|
pageSize: d.size,
|
|
1202
|
-
total:
|
|
1209
|
+
total: A ? d.total : l.length,
|
|
1203
1210
|
showSizeChanger: !0,
|
|
1204
|
-
|
|
1211
|
+
// §2 强制规则 2:分页必须凑齐 pageSize + showSizeChanger
|
|
1212
|
+
// + pageSizeOptions + showTotal 四件套。只给 showSizeChanger
|
|
1213
|
+
// 而不给 pageSizeOptions,antd 会用默认的 ['10','20','50','100']
|
|
1214
|
+
// 之外的行为渲染(实际 antd 默认也是这组,但那是**默认值**不是
|
|
1215
|
+
// **声明值**)—— 规范要的是声明,不是碰巧对。
|
|
1216
|
+
// 少这一项时,全库尺子(lead 008 §2 元素级普查)会把本页判成
|
|
1217
|
+
// 「分页参数不全」⇒ 8 个仓的 PagedTable 拷贝全部误红。
|
|
1218
|
+
pageSizeOptions: ["10", "20", "50", "100"],
|
|
1219
|
+
showTotal: () => A ? fe.known(d.total) : fe.unknown(l.length)
|
|
1205
1220
|
},
|
|
1206
1221
|
onChange: (b) => v(b.current, b.pageSize),
|
|
1207
1222
|
expandable: r,
|
|
@@ -1213,19 +1228,19 @@ function mt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", e
|
|
|
1213
1228
|
)
|
|
1214
1229
|
] });
|
|
1215
1230
|
}
|
|
1216
|
-
const
|
|
1231
|
+
const Ue = 240, ge = 96, Ye = { behavior: "smooth", block: "start" }, Ke = `
|
|
1217
1232
|
.zfc-doc-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
|
1218
1233
|
@media (max-width: 800px) { .zfc-doc-table-wrap > table { min-width: 520px; } }
|
|
1219
|
-
`,
|
|
1234
|
+
`, Ve = (e) => String(e || "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\p{M}\p{Pc}-]/gu, "").replace(/-+/g, "-").replace(/^-|-$/g, ""), ie = (e) => String(e || "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]*)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/\*([^*]+)\*/g, "$1").trim(), we = () => {
|
|
1220
1235
|
const e = /* @__PURE__ */ new Map();
|
|
1221
1236
|
let n = 0;
|
|
1222
1237
|
return (s) => {
|
|
1223
1238
|
n += 1;
|
|
1224
|
-
const o =
|
|
1239
|
+
const o = Ve(s) || `section-${n}`, c = e.get(o) || 0;
|
|
1225
1240
|
return e.set(o, c + 1), c > 0 ? `${o}-${c}` : o;
|
|
1226
1241
|
};
|
|
1227
|
-
},
|
|
1228
|
-
const n = [], s =
|
|
1242
|
+
}, Je = (e) => {
|
|
1243
|
+
const n = [], s = we();
|
|
1229
1244
|
let o = !1;
|
|
1230
1245
|
for (const c of String(e || "").split(`
|
|
1231
1246
|
`)) {
|
|
@@ -1243,17 +1258,17 @@ const Ge = 240, fe = 96, Ue = { behavior: "smooth", block: "start" }, Ye = `
|
|
|
1243
1258
|
i && n.push({ level: l, text: i, id: s(i) });
|
|
1244
1259
|
}
|
|
1245
1260
|
return n;
|
|
1246
|
-
},
|
|
1261
|
+
}, Q = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Q).join("") : e.props ? Q(e.props.children) : "", ue = (e) => String(e).replace(/["\\]/g, "\\$&"), pe = (e, n = Ye) => !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+)(.*)$/, Y = /^\s*>\s?(.*)$/, Xe = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
|
|
1247
1262
|
let n = String(e).trim();
|
|
1248
1263
|
return n.startsWith("|") && (n = n.slice(1)), n.endsWith("|") && (n = n.slice(0, -1)), n.split("|").map((s) => s.trim());
|
|
1249
1264
|
}, Qe = (e) => {
|
|
1250
1265
|
if (!String(e).includes("-")) return !1;
|
|
1251
1266
|
const n = K(e);
|
|
1252
1267
|
return n.length > 0 && n.every((s) => /^:?-+:?$/.test(s));
|
|
1253
|
-
},
|
|
1268
|
+
}, Ze = (e) => {
|
|
1254
1269
|
const n = e.startsWith(":"), s = e.endsWith(":");
|
|
1255
1270
|
return n && s ? "center" : s ? "right" : "left";
|
|
1256
|
-
},
|
|
1271
|
+
}, et = (e, n) => {
|
|
1257
1272
|
const s = F.exec(e[n]), o = /\d/.test(s[2]), c = [];
|
|
1258
1273
|
let a = n;
|
|
1259
1274
|
for (; a < e.length; ) {
|
|
@@ -1288,11 +1303,11 @@ const Ge = 240, fe = 96, Ue = { behavior: "smooth", block: "start" }, Ye = `
|
|
|
1288
1303
|
}
|
|
1289
1304
|
break;
|
|
1290
1305
|
}
|
|
1291
|
-
c.push({ blocks:
|
|
1306
|
+
c.push({ blocks: ke(d, !0) });
|
|
1292
1307
|
}
|
|
1293
1308
|
return { block: { type: "list", ordered: o, items: c }, next: a };
|
|
1294
1309
|
};
|
|
1295
|
-
function
|
|
1310
|
+
function ke(e, n = !1) {
|
|
1296
1311
|
const s = [];
|
|
1297
1312
|
let o = 0;
|
|
1298
1313
|
for (; o < e.length; ) {
|
|
@@ -1327,7 +1342,7 @@ function we(e, n = !1) {
|
|
|
1327
1342
|
continue;
|
|
1328
1343
|
}
|
|
1329
1344
|
if (c.includes("|") && o + 1 < e.length && Qe(e[o + 1])) {
|
|
1330
|
-
const i = K(c), d = K(e[o + 1]).map(
|
|
1345
|
+
const i = K(c), d = K(e[o + 1]).map(Ze);
|
|
1331
1346
|
o += 2;
|
|
1332
1347
|
const f = [];
|
|
1333
1348
|
for (; o < e.length && e[o].trim() && e[o].includes("|"); )
|
|
@@ -1346,7 +1361,7 @@ function we(e, n = !1) {
|
|
|
1346
1361
|
continue;
|
|
1347
1362
|
}
|
|
1348
1363
|
if (F.test(c)) {
|
|
1349
|
-
const i =
|
|
1364
|
+
const i = et(e, o);
|
|
1350
1365
|
s.push(i.block), o = i.next;
|
|
1351
1366
|
continue;
|
|
1352
1367
|
}
|
|
@@ -1364,7 +1379,7 @@ const z = (e, n) => {
|
|
|
1364
1379
|
const s = [];
|
|
1365
1380
|
let o = 0, c = 0;
|
|
1366
1381
|
const a = (r) => s.push(/* @__PURE__ */ t(O, { children: r }, `i${c++}`));
|
|
1367
|
-
for (const r of e.matchAll(
|
|
1382
|
+
for (const r of e.matchAll(Xe)) {
|
|
1368
1383
|
if (r.index > o && a(e.slice(o, r.index)), r[1] !== void 0)
|
|
1369
1384
|
if (r[0].startsWith("!"))
|
|
1370
1385
|
a(n.img ? n.img({ src: r[3], alt: r[2] }) : /* @__PURE__ */ t("img", { src: r[3], alt: r[2] || "" }));
|
|
@@ -1376,7 +1391,7 @@ const z = (e, n) => {
|
|
|
1376
1391
|
o = r.index + r[0].length;
|
|
1377
1392
|
}
|
|
1378
1393
|
return o < e.length && a(e.slice(o)), s;
|
|
1379
|
-
},
|
|
1394
|
+
}, Ce = (e, n, s) => {
|
|
1380
1395
|
const o = [];
|
|
1381
1396
|
return e.forEach((c, a) => {
|
|
1382
1397
|
const r = `b${a}`, l = (i) => o.push(/* @__PURE__ */ t(O, { children: i }, r));
|
|
@@ -1391,7 +1406,7 @@ const z = (e, n) => {
|
|
|
1391
1406
|
l(n.pre ? n.pre({ children: i }) : /* @__PURE__ */ t("pre", { children: i }));
|
|
1392
1407
|
} else if (c.type === "list") {
|
|
1393
1408
|
const i = c.ordered ? "ol" : "ul", d = n[i], f = c.items.map((g, p) => {
|
|
1394
|
-
const h =
|
|
1409
|
+
const h = Ce(g.blocks, n, s), k = n.li ? n.li({ children: h }) : /* @__PURE__ */ t("li", { children: h });
|
|
1395
1410
|
return /* @__PURE__ */ t(O, { children: k }, `li${p}`);
|
|
1396
1411
|
});
|
|
1397
1412
|
l(d ? d({ children: f }) : ae(i, null, f));
|
|
@@ -1412,10 +1427,10 @@ const z = (e, n) => {
|
|
|
1412
1427
|
l(n.blockquote ? n.blockquote({ children: i }) : /* @__PURE__ */ t("blockquote", { children: i }));
|
|
1413
1428
|
} else c.type === "hr" && l(n.hr ? n.hr({}) : /* @__PURE__ */ t("hr", {}));
|
|
1414
1429
|
}), o;
|
|
1415
|
-
},
|
|
1416
|
-
`)), n,
|
|
1417
|
-
let
|
|
1418
|
-
const
|
|
1430
|
+
}, tt = (e, n = {}) => Ce(ke(String(e || "").split(`
|
|
1431
|
+
`)), n, we());
|
|
1432
|
+
let he = null;
|
|
1433
|
+
const be = /* @__PURE__ */ new Set(), rt = ({ navigate: e, Prism: n, oneDark: s, onAnchorClick: o }) => {
|
|
1419
1434
|
const c = {
|
|
1420
1435
|
background: T.primarySoft,
|
|
1421
1436
|
color: T.primary,
|
|
@@ -1482,7 +1497,7 @@ const he = /* @__PURE__ */ new Set(), tt = ({ navigate: e, Prism: n, oneDark: s,
|
|
|
1482
1497
|
pre: ({ node: a, children: r }) => {
|
|
1483
1498
|
const l = Array.isArray(r) ? r[0] : r;
|
|
1484
1499
|
l && l.props && l.props.className;
|
|
1485
|
-
const i =
|
|
1500
|
+
const i = Q(l).replace(/\n$/, "");
|
|
1486
1501
|
return /* @__PURE__ */ t("pre", { style: {
|
|
1487
1502
|
margin: "12px 0",
|
|
1488
1503
|
padding: "12px 14px",
|
|
@@ -1530,23 +1545,23 @@ const he = /* @__PURE__ */ new Set(), tt = ({ navigate: e, Prism: n, oneDark: s,
|
|
|
1530
1545
|
}
|
|
1531
1546
|
};
|
|
1532
1547
|
};
|
|
1533
|
-
function
|
|
1548
|
+
function xt({
|
|
1534
1549
|
markdown: e,
|
|
1535
1550
|
title: n,
|
|
1536
|
-
tocWidth: s =
|
|
1551
|
+
tocWidth: s = Ue,
|
|
1537
1552
|
tocLevels: o = [2],
|
|
1538
1553
|
height: c = "calc(100vh - 120px)",
|
|
1539
1554
|
markdownComponents: a,
|
|
1540
1555
|
renderMarkdown: r
|
|
1541
1556
|
}) {
|
|
1542
|
-
const i =
|
|
1557
|
+
const i = Le() ? ve() : null, d = P(null), f = P(null), g = P(""), p = P(null), [h, k] = B(""), [v, A] = B(0), b = q(() => Je(e), [e]), S = q(
|
|
1543
1558
|
() => b.filter((u) => o.includes(u.level)),
|
|
1544
1559
|
[b, o]
|
|
1545
1560
|
);
|
|
1546
1561
|
L(() => {
|
|
1547
|
-
const u = () =>
|
|
1548
|
-
return
|
|
1549
|
-
|
|
1562
|
+
const u = () => A((y) => y + 1);
|
|
1563
|
+
return be.add(u), () => {
|
|
1564
|
+
be.delete(u);
|
|
1550
1565
|
};
|
|
1551
1566
|
}, []);
|
|
1552
1567
|
const w = (u) => {
|
|
@@ -1556,7 +1571,7 @@ function yt({
|
|
|
1556
1571
|
};
|
|
1557
1572
|
L(() => () => {
|
|
1558
1573
|
p.current && clearTimeout(p.current);
|
|
1559
|
-
}, []),
|
|
1574
|
+
}, []), Te(() => {
|
|
1560
1575
|
const u = d.current;
|
|
1561
1576
|
if (!u) return;
|
|
1562
1577
|
const y = Array.from(u.querySelectorAll("h1, h2, h3"));
|
|
@@ -1570,18 +1585,18 @@ function yt({
|
|
|
1570
1585
|
const y = Array.from(u.querySelectorAll("h1, h2, h3"));
|
|
1571
1586
|
if (!y.length) return;
|
|
1572
1587
|
const R = () => {
|
|
1573
|
-
const
|
|
1588
|
+
const X = u.getBoundingClientRect().top;
|
|
1574
1589
|
let oe = y[0];
|
|
1575
1590
|
for (const le of y)
|
|
1576
|
-
if (le.getBoundingClientRect().top -
|
|
1591
|
+
if (le.getBoundingClientRect().top - X <= ge) oe = le;
|
|
1577
1592
|
else break;
|
|
1578
1593
|
g.current || k(oe.id);
|
|
1579
1594
|
}, W = new IntersectionObserver(R, {
|
|
1580
1595
|
root: u,
|
|
1581
|
-
rootMargin: `-${
|
|
1596
|
+
rootMargin: `-${ge}px 0px 0px 0px`,
|
|
1582
1597
|
threshold: 0
|
|
1583
1598
|
});
|
|
1584
|
-
y.forEach((
|
|
1599
|
+
y.forEach((X) => W.observe(X)), R();
|
|
1585
1600
|
const M = () => {
|
|
1586
1601
|
g.current = "";
|
|
1587
1602
|
};
|
|
@@ -1591,23 +1606,23 @@ function yt({
|
|
|
1591
1606
|
}, [b, v, r]), L(() => {
|
|
1592
1607
|
const u = f.current;
|
|
1593
1608
|
if (!u || !h) return;
|
|
1594
|
-
const y = u.querySelector(`[data-toc-id="${
|
|
1609
|
+
const y = u.querySelector(`[data-toc-id="${ue(h)}"]`);
|
|
1595
1610
|
if (!y) return;
|
|
1596
1611
|
const R = u.getBoundingClientRect(), W = y.getBoundingClientRect();
|
|
1597
1612
|
(W.top < R.top + 24 || W.bottom > R.bottom - 24) && y.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
1598
1613
|
}, [h]);
|
|
1599
|
-
const
|
|
1614
|
+
const I = (u) => {
|
|
1600
1615
|
const y = d.current;
|
|
1601
|
-
return y && y.querySelector(`[data-anchor="${
|
|
1616
|
+
return y && y.querySelector(`[data-anchor="${ue(u)}"]`) || (typeof document < "u" ? document.getElementById(u) : null);
|
|
1602
1617
|
}, $ = (u, y) => {
|
|
1603
|
-
u.preventDefault(), w(y),
|
|
1618
|
+
u.preventDefault(), w(y), pe(I(y)), k(y);
|
|
1604
1619
|
}, G = (u, y) => {
|
|
1605
|
-
u.preventDefault(), w(y),
|
|
1620
|
+
u.preventDefault(), w(y), pe(I(y)), k(y);
|
|
1606
1621
|
}, U = q(
|
|
1607
|
-
() =>
|
|
1622
|
+
() => rt({
|
|
1608
1623
|
navigate: i,
|
|
1609
|
-
Prism:
|
|
1610
|
-
oneDark:
|
|
1624
|
+
Prism: he,
|
|
1625
|
+
oneDark: he,
|
|
1611
1626
|
onAnchorClick: G
|
|
1612
1627
|
}),
|
|
1613
1628
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1621,10 +1636,10 @@ function yt({
|
|
|
1621
1636
|
title: "暂无文档",
|
|
1622
1637
|
description: "把组件说明写成 DOC.md,用编译期 import 的字符串传给 ComponentDoc 即可"
|
|
1623
1638
|
}
|
|
1624
|
-
) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(
|
|
1639
|
+
) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(Re, { children: tt(e, j) });
|
|
1625
1640
|
return /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", minHeight: 0, flex: 1 }, children: [
|
|
1626
|
-
/* @__PURE__ */ t("style", { children:
|
|
1627
|
-
n ? /* @__PURE__ */ t(
|
|
1641
|
+
/* @__PURE__ */ t("style", { children: Ke }),
|
|
1642
|
+
n ? /* @__PURE__ */ t(Se, { title: n }) : null,
|
|
1628
1643
|
/* @__PURE__ */ m("div", { style: { display: "flex", gap: 16, alignItems: "flex-start", minHeight: 0 }, children: [
|
|
1629
1644
|
/* @__PURE__ */ m(
|
|
1630
1645
|
"aside",
|
|
@@ -1653,7 +1668,7 @@ function yt({
|
|
|
1653
1668
|
marginBottom: 8,
|
|
1654
1669
|
padding: "0 4px"
|
|
1655
1670
|
}, children: [
|
|
1656
|
-
/* @__PURE__ */ t(
|
|
1671
|
+
/* @__PURE__ */ t(De, {}),
|
|
1657
1672
|
/* @__PURE__ */ t("span", { style: { fontWeight: 600 }, children: "本文目录" })
|
|
1658
1673
|
] }),
|
|
1659
1674
|
/* @__PURE__ */ t("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: S.map((u) => {
|
|
@@ -1709,32 +1724,32 @@ function yt({
|
|
|
1709
1724
|
] });
|
|
1710
1725
|
}
|
|
1711
1726
|
export {
|
|
1712
|
-
|
|
1713
|
-
|
|
1727
|
+
$e as C,
|
|
1728
|
+
_e as D,
|
|
1714
1729
|
ne as E,
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1730
|
+
ft as F,
|
|
1731
|
+
ct as G,
|
|
1732
|
+
pt as L,
|
|
1733
|
+
Se as P,
|
|
1734
|
+
bt as R,
|
|
1735
|
+
Me as S,
|
|
1736
|
+
ht as T,
|
|
1737
|
+
xt as a,
|
|
1738
|
+
gt as b,
|
|
1739
|
+
We as c,
|
|
1740
|
+
ut as d,
|
|
1741
|
+
yt as e,
|
|
1742
|
+
dt as f,
|
|
1743
|
+
mt as g,
|
|
1729
1744
|
H as h,
|
|
1730
1745
|
T as i,
|
|
1731
|
-
|
|
1746
|
+
He as j,
|
|
1732
1747
|
de as k,
|
|
1733
|
-
|
|
1734
|
-
|
|
1748
|
+
st as l,
|
|
1749
|
+
_ as m,
|
|
1735
1750
|
x as n,
|
|
1736
1751
|
E as p,
|
|
1737
1752
|
C as r,
|
|
1738
1753
|
D as s,
|
|
1739
|
-
|
|
1754
|
+
Pe as u
|
|
1740
1755
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as be, a as we, D as Ie, b as ke, E as Ce, c as Re, F as ve, G as Le, L as ze, d as Me, P as Be, e as Oe, R as Te, S as je, f as Ee, g as $e, T as De, h as Ke, i as Fe, j as Pe, k as qe, l as He, n as Ne, p as We, r as Ge, s as Je, m as _e, u as Ae } from "./ComponentDoc-
|
|
1
|
+
import { C as be, a as we, D as Ie, b as ke, E as Ce, c as Re, F as ve, G as Le, L as ze, d as Me, P as Be, e as Oe, R as Te, S as je, f as Ee, g as $e, T as De, h as Ke, i as Fe, j as Pe, k as qe, l as He, n as Ne, p as We, r as Ge, s as Je, m as _e, u as Ae } from "./ComponentDoc-rk9VdFSV.js";
|
|
2
2
|
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { Layout as I, Spin as j, Menu as E, Dropdown as $, Avatar as D, Button as k, Tooltip as K, Card as F, Alert as P, Form as x, Input as L, message as S, Tag as q, Result as H } from "antd";
|
|
4
4
|
import { MenuUnfoldOutlined as N, MenuFoldOutlined as W, DownOutlined as G, LoginOutlined as J, UserOutlined as _, LockOutlined as A } from "@ant-design/icons";
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, a as t, D as r, b as o, E as n, c as d, F as i, G as l, L as S, d as u, P as T, e as p, R as b, S as f, f as g, g as c, T as h, h as m, i as C, j as D, k as L, l as E, n as F, p as P, r as A, s as B, m as G, u as I } from "./ComponentDoc-
|
|
1
|
+
import { C as e, a as t, D as r, b as o, E as n, c as d, F as i, G as l, L as S, d as u, P as T, e as p, R as b, S as f, f as g, g as c, T as h, h as m, i as C, j as D, k as L, l as E, n as F, p as P, r as A, s as B, m as G, u as I } from "./ComponentDoc-rk9VdFSV.js";
|
|
2
2
|
export {
|
|
3
3
|
e as CategoryDot,
|
|
4
4
|
t as ComponentDoc,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuku123/z-frontend-common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "z-opc 全仓共享前端基座 — AppLayout(§1/§11/§12/§15/§16) + LoginPage(mockAuth 双模式) + EmptyState/StatusTag/ErrorBoundary + createRequest 工厂。lead 008 前端开发规范唯一承载仓",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,6 +10,22 @@ import {EmptyState, ErrorState, PageHeader} from './index'
|
|
|
10
10
|
* 后端 z-meta 的分页 count 有缺陷(records 有值但 total 返回 "0"),这里不把 0 当"共 0 条"显示,
|
|
11
11
|
* 而是显式标出接口给的总数,避免页面上出现"有数据却说没有数据"的假象。
|
|
12
12
|
*/
|
|
13
|
+
/**
|
|
14
|
+
* 分页总数文案 —— 提成导出是为了让它**可单测**。
|
|
15
|
+
*
|
|
16
|
+
* 为什么必须提成导出:antd 的 Table 在**数据为空**时不渲染整个分页块
|
|
17
|
+
* (实测 SSR 空数据产物里连 `ant-pagination` 容器都没有)⇒
|
|
18
|
+
* `showTotal` 那个闭包在 SSR 下**永远不会被执行**,任何针对文案本身的断言都无从下手。
|
|
19
|
+
* 提成纯函数后,文案口径就能被直接测到,而不用去构造「有数据」的场景。
|
|
20
|
+
*/
|
|
21
|
+
export const PAGED_TOTAL_TEXT = {
|
|
22
|
+
// total 有效 ⇒ 标准口径
|
|
23
|
+
known: (total) => `共 ${total} 条`,
|
|
24
|
+
// total 缺失/为 0 —— 后端 z-meta 的分页 count 有缺陷(records 有值但 total 返回 "0"),
|
|
25
|
+
// 这时不能显示「共 0 条」(页面上会出现"有数据却说没有数据"的假象)
|
|
26
|
+
unknown: (rowsLength) => `本页 ${rowsLength} 条(接口 total 未返回有效值)`,
|
|
27
|
+
}
|
|
28
|
+
|
|
13
29
|
export default function PagedTable({title, description, load, columns, rowKey = 'id', extra, expandable}) {
|
|
14
30
|
const [rows, setRows] = useState([])
|
|
15
31
|
const [page, setPage] = useState({current: 1, size: 10, total: null})
|
|
@@ -67,10 +83,18 @@ export default function PagedTable({title, description, load, columns, rowKey =
|
|
|
67
83
|
pageSize: page.size,
|
|
68
84
|
total: totalKnown ? page.total : rows.length,
|
|
69
85
|
showSizeChanger: true,
|
|
86
|
+
// §2 强制规则 2:分页必须凑齐 pageSize + showSizeChanger
|
|
87
|
+
// + pageSizeOptions + showTotal 四件套。只给 showSizeChanger
|
|
88
|
+
// 而不给 pageSizeOptions,antd 会用默认的 ['10','20','50','100']
|
|
89
|
+
// 之外的行为渲染(实际 antd 默认也是这组,但那是**默认值**不是
|
|
90
|
+
// **声明值**)—— 规范要的是声明,不是碰巧对。
|
|
91
|
+
// 少这一项时,全库尺子(lead 008 §2 元素级普查)会把本页判成
|
|
92
|
+
// 「分页参数不全」⇒ 8 个仓的 PagedTable 拷贝全部误红。
|
|
93
|
+
pageSizeOptions: ['10', '20', '50', '100'],
|
|
70
94
|
showTotal: () =>
|
|
71
95
|
totalKnown
|
|
72
|
-
?
|
|
73
|
-
:
|
|
96
|
+
? PAGED_TOTAL_TEXT.known(page.total)
|
|
97
|
+
: PAGED_TOTAL_TEXT.unknown(rows.length),
|
|
74
98
|
}}
|
|
75
99
|
onChange={(p) => fetch(p.current, p.pageSize)}
|
|
76
100
|
expandable={expandable}
|