@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.
@@ -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
- <HEditTable
33
- actionRef={defaultActionRef}
34
- onAdd={async (data) => {
35
- const newData = [...cuData];
36
- }}
37
- onEdit={async (data) => {}}
38
- request={async () => {
39
- return {
40
- records: [
41
- {
42
- id: "213213",
43
- title: "100",
44
- },
45
- ],
46
- current: "1",
47
- size: "10",
48
- total: "10",
49
- };
50
- }}
51
- configData={[
52
- { title: "标题", dataIndex: "title" },
53
- { title: "标题2", dataIndex: "time", valueType: "date" },
54
- {
55
- title: "操作",
56
- valueType: "option",
57
- align: "center",
58
- render: (text: any, record: any, _: any, action: any) => [
59
- <a
60
- key="editable"
61
- type={"link"}
62
- onClick={() => {
63
- action?.startEditable?.(record.id);
64
- }}
65
- >
66
- 编辑
67
- </a>,
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);