@hw-component/table 0.0.4-beta-v3 → 0.0.4-beta-v7
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/es/HTableFooter/index.d.ts +1 -1
- package/es/ModalTable/hooks.d.ts +26 -0
- package/es/ModalTable/hooks.js +70 -0
- package/es/ModalTable/index.d.ts +3 -0
- package/es/ModalTable/index.js +91 -0
- package/es/Table.js +1 -1
- package/es/hooks/useReq.d.ts +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/modal.d.ts +24 -0
- package/lib/HTableFooter/index.d.ts +1 -1
- package/lib/ModalTable/hooks.d.ts +26 -0
- package/lib/ModalTable/hooks.js +74 -0
- package/lib/ModalTable/index.d.ts +3 -0
- package/lib/ModalTable/index.js +94 -0
- package/lib/Table.js +1 -1
- package/lib/hooks/useReq.d.ts +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -0
- package/lib/modal.d.ts +24 -0
- package/package.json +1 -1
- package/src/components/HTableBody/index.tsx +28 -12
- package/src/components/HTableFooter/index.tsx +27 -16
- package/src/components/HTableHeader/utils.ts +3 -3
- package/src/components/ModalTable/hooks.ts +58 -0
- package/src/components/ModalTable/index.tsx +71 -0
- package/src/components/Table.tsx +22 -21
- package/src/components/TableCustomize.tsx +6 -5
- package/src/components/context.ts +1 -1
- package/src/components/hooks/useCurrentTable.ts +1 -1
- package/src/components/hooks/useHTable.tsx +1 -1
- package/src/components/hooks/useReq.ts +36 -27
- package/src/components/hooks/useRowObj.ts +2 -2
- package/src/components/index.tsx +2 -0
- package/src/components/modal.ts +28 -4
- package/src/pages/ModalTable/index.tsx +93 -0
- package/src/pages/Table/index.tsx +14 -14
- package/src/pages/TableCustomize/index.tsx +28 -25
- package/src/routes.tsx +6 -1
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
HTableFooter,
|
|
6
6
|
HTablePagination,
|
|
7
7
|
} from "../../components";
|
|
8
|
-
import {useRequest} from "ahooks";
|
|
9
|
-
import {Space} from "antd";
|
|
8
|
+
import { useRequest } from "ahooks";
|
|
9
|
+
import { Space } from "antd";
|
|
10
10
|
|
|
11
11
|
const configData = [
|
|
12
12
|
{
|
|
@@ -19,31 +19,34 @@ const configData = [
|
|
|
19
19
|
title: "操作",
|
|
20
20
|
name: "aaa",
|
|
21
21
|
showSearch: true,
|
|
22
|
-
fixed:"right",
|
|
22
|
+
fixed: "right",
|
|
23
23
|
searchType: "rangePicker",
|
|
24
24
|
},
|
|
25
25
|
];
|
|
26
26
|
export default () => {
|
|
27
|
-
const {run,loading,error,data}=useRequest(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
const { run, loading, error, data } = useRequest(
|
|
28
|
+
(params) => {
|
|
29
|
+
const { current = 1 } = params;
|
|
30
|
+
console.log(params, "params");
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
// reject(new Error("错误"));
|
|
34
|
+
resolve({
|
|
35
|
+
size: "10",
|
|
36
|
+
current: current.toString(10),
|
|
37
|
+
total: "100",
|
|
38
|
+
records: [
|
|
39
|
+
{
|
|
40
|
+
id: 1,
|
|
41
|
+
name: "111",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
}, 2000);
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
{ manual: true }
|
|
49
|
+
);
|
|
47
50
|
return (
|
|
48
51
|
<TableCustomize
|
|
49
52
|
configData={configData}
|
|
@@ -52,9 +55,9 @@ export default () => {
|
|
|
52
55
|
dataSource={data}
|
|
53
56
|
reload={run}
|
|
54
57
|
>
|
|
55
|
-
<Space direction={"vertical"} style={{width:"100%"}}>
|
|
58
|
+
<Space direction={"vertical"} style={{ width: "100%" }}>
|
|
56
59
|
<HTableHeader />
|
|
57
|
-
<HTableBody pagination={false} scroll={{x:1000,y:100}}/>
|
|
60
|
+
<HTableBody pagination={false} scroll={{ x: 1000, y: 100 }} />
|
|
58
61
|
<HTablePagination />
|
|
59
62
|
<HTableFooter />
|
|
60
63
|
</Space>
|
package/src/routes.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Navigate } from "react-router-dom";
|
|
3
3
|
import Table from "./pages/Table";
|
|
4
4
|
import TableCustomize from "./pages/TableCustomize";
|
|
5
|
-
|
|
5
|
+
import ModalTable from "./pages/ModalTable";
|
|
6
6
|
export interface RouteModal {
|
|
7
7
|
path?: string;
|
|
8
8
|
name?: string;
|
|
@@ -27,6 +27,11 @@ const routes: RouteModal[] = [
|
|
|
27
27
|
name: "tableCustomize",
|
|
28
28
|
element: <TableCustomize />,
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
path: "/modalTable",
|
|
32
|
+
name: "ModalTable",
|
|
33
|
+
element: <ModalTable />,
|
|
34
|
+
},
|
|
30
35
|
];
|
|
31
36
|
|
|
32
37
|
export default routes;
|