@hw-component/table 1.10.12 → 1.10.13
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/.eslintcache +1 -1
- package/es/EditTable/hooks.d.ts +1 -1
- package/es/EditTable/hooks.js +4 -2
- package/es/EditTable/index.js +3 -2
- package/es/index.css +28 -28
- package/lib/EditTable/hooks.d.ts +1 -1
- package/lib/EditTable/hooks.js +4 -2
- package/lib/EditTable/index.js +3 -2
- package/lib/index.css +28 -28
- package/package.json +1 -1
- package/src/components/EditTable/hooks.ts +5 -4
- package/src/components/EditTable/index.tsx +2 -1
- package/src/components/HTableBody/hooks/useColData.tsx +10 -8
- package/src/components/index.less +52 -52
- package/src/components/modal.ts +2 -2
- package/src/pages/EditTable/index.tsx +50 -57
- package/src/pages/Table/index.tsx +2 -2
|
@@ -7,67 +7,60 @@ const dataSource = [
|
|
|
7
7
|
id: 1,
|
|
8
8
|
title: "1",
|
|
9
9
|
time: "1757574280",
|
|
10
|
-
}
|
|
11
|
-
{
|
|
12
|
-
id: 2,
|
|
13
|
-
title: "2",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: 3,
|
|
17
|
-
title: "3",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: 4,
|
|
21
|
-
title: "4",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 5,
|
|
25
|
-
title: "5",
|
|
26
|
-
},
|
|
10
|
+
}
|
|
27
11
|
];
|
|
28
12
|
export default () => {
|
|
29
13
|
const defaultActionRef = useRef<ActionType>();
|
|
30
14
|
const [cuData, setCuData] = useState(dataSource);
|
|
15
|
+
console.log(defaultActionRef,"defaultActionRef")
|
|
31
16
|
return (
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
17
|
+
<div>
|
|
18
|
+
<div onClick={()=>{
|
|
19
|
+
defaultActionRef.current?.reload();
|
|
20
|
+
}}>刷新</div>
|
|
21
|
+
<HEditTable
|
|
22
|
+
actionRef={defaultActionRef}
|
|
23
|
+
manual
|
|
24
|
+
onAdd={async (data) => {
|
|
25
|
+
const newData = [...cuData];
|
|
26
|
+
newData.push({
|
|
27
|
+
id:new Date().valueOf(),
|
|
28
|
+
...data
|
|
29
|
+
});
|
|
30
|
+
setCuData(newData);
|
|
31
|
+
}}
|
|
32
|
+
onEdit={async (data) => {}}
|
|
33
|
+
request={()=>{
|
|
34
|
+
console.log("rrrrr")
|
|
35
|
+
return {
|
|
36
|
+
records:[{
|
|
37
|
+
id: 1,
|
|
38
|
+
title: "1",
|
|
39
|
+
time: "1757574280",
|
|
40
|
+
}]
|
|
41
|
+
}
|
|
42
|
+
}}
|
|
43
|
+
configData={[
|
|
44
|
+
{ title: "标题", dataIndex: "title" },
|
|
45
|
+
{ title: "标题2", dataIndex: "time", valueType: "date" },
|
|
46
|
+
{
|
|
47
|
+
title: "操作",
|
|
48
|
+
valueType: "option",
|
|
49
|
+
align: "center",
|
|
50
|
+
render: (text: any, record: any, index: any, action: any) => [
|
|
51
|
+
<a
|
|
52
|
+
key="editable"
|
|
53
|
+
type={"link"}
|
|
54
|
+
onClick={() => {
|
|
55
|
+
action?.startEditable?.(record.id);
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
编辑
|
|
59
|
+
</a>
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
]}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
72
65
|
);
|
|
73
66
|
};
|
|
@@ -126,7 +126,7 @@ export default () => {
|
|
|
126
126
|
"SEC1603b7a13fec76f6ec9e1eedbd44279f61b4298142d42616a4a672c245a37f3d",
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
|
-
notifyAll: 0
|
|
129
|
+
notifyAll: 0,
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
return new Promise((resolve, reject) => {
|
|
@@ -202,7 +202,7 @@ export default () => {
|
|
|
202
202
|
for (let i = 0; i < 10; i += 1) {
|
|
203
203
|
records.push({
|
|
204
204
|
id: `${current}-${i}`,
|
|
205
|
-
lastPullGroupTime:1760420231
|
|
205
|
+
lastPullGroupTime: 1760420231,
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
console.log(records);
|