@hw-component/table 1.9.13 → 1.9.15

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.
Files changed (37) hide show
  1. package/es/DialogTable/Content.d.ts +2 -1
  2. package/es/DialogTable/Content.js +4 -2
  3. package/es/DialogTable/DwTable.d.ts +1 -0
  4. package/es/DialogTable/DwTable.js +10 -4
  5. package/es/DialogTable/ModalTable.d.ts +1 -0
  6. package/es/DialogTable/ModalTable.js +9 -3
  7. package/es/DialogTable/hooks.d.ts +3 -1
  8. package/es/DialogTable/hooks.js +4 -2
  9. package/es/Table.d.ts +1 -1
  10. package/es/Table.js +8 -9
  11. package/es/hooks/useReq.d.ts +3 -3
  12. package/es/hooks/useReq.js +82 -19
  13. package/es/modal.d.ts +3 -1
  14. package/lib/DialogTable/Content.d.ts +2 -1
  15. package/lib/DialogTable/Content.js +4 -2
  16. package/lib/DialogTable/DwTable.d.ts +1 -0
  17. package/lib/DialogTable/DwTable.js +10 -4
  18. package/lib/DialogTable/ModalTable.d.ts +1 -0
  19. package/lib/DialogTable/ModalTable.js +9 -3
  20. package/lib/DialogTable/hooks.d.ts +3 -1
  21. package/lib/DialogTable/hooks.js +4 -2
  22. package/lib/Table.d.ts +1 -1
  23. package/lib/Table.js +8 -9
  24. package/lib/hooks/useReq.d.ts +3 -3
  25. package/lib/hooks/useReq.js +81 -18
  26. package/lib/modal.d.ts +3 -1
  27. package/package.json +15 -14
  28. package/src/components/DialogTable/Content.tsx +2 -0
  29. package/src/components/DialogTable/DwTable.tsx +10 -2
  30. package/src/components/DialogTable/ModalTable.tsx +11 -2
  31. package/src/components/DialogTable/hooks.ts +2 -0
  32. package/src/components/Table.tsx +7 -5
  33. package/src/components/hooks/useReq.ts +57 -8
  34. package/src/components/modal.ts +3 -1
  35. package/src/pages/DwTable/index.tsx +16 -2
  36. package/src/pages/ModalTable/index.tsx +14 -2
  37. package/src/pages/Table/index.tsx +27 -32
@@ -4,6 +4,7 @@ import { HFormConfigProvider } from "@hw-component/form";
4
4
  import { SettingOutlined } from "@ant-design/icons";
5
5
  import ProTable from "@ant-design/pro-table";
6
6
  import { useRequest } from "ahooks";
7
+ import {useState} from "react";
7
8
 
8
9
  const TagsComponent = ({ data, labelKey }) => {
9
10
  const len = data?.length;
@@ -100,6 +101,16 @@ const Test = ({ name, selectedRowData }) => {
100
101
  console.log(selectedRowData);
101
102
  return <div>{name}</div>;
102
103
  };
104
+ const maker=(name)=>{
105
+ const data=[];
106
+ for (let i=0;i<10;i+=1){
107
+ data.push({
108
+ name,
109
+ id:i
110
+ })
111
+ };
112
+ return data;
113
+ }
103
114
  export default () => {
104
115
  const hTable = useHTable();
105
116
  const { loading, data } = useRequest(() => {
@@ -129,6 +140,12 @@ export default () => {
129
140
  }, 2000);
130
141
  });
131
142
  });
143
+ const [dataSource,setDataSource]=useState({
144
+ records:[],
145
+ total:"100",
146
+ size:"10",
147
+ current:"1"
148
+ });
132
149
  return (
133
150
  <HFormConfigProvider>
134
151
  <div>
@@ -189,39 +206,17 @@ export default () => {
189
206
  操作
190
207
  </Button>
191
208
  }
192
- request={(params) => {
193
- const { current = 1, size = "10" } = params;
194
- const arrayData: any[] = [];
195
- for (let i = 0; i < 1; i = i + 1) {
196
- arrayData.push({
197
- id: i,
198
- name: "仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人仙人312321",
199
- mobileList: [{ name: "1" }, { name: "2" }],
200
- mailList: null,
201
- openidList: ["okSMy58P_PE9sQkAG03gkpiTk-hs"],
202
- dingdingList: [
203
- {
204
- webhook:
205
- "https://oapi.dingtalk.com/robot/send?access_token=fa1483607ad55fc115ae45219f661248a42b6c40a487f95469b39ee49420a2dc",
206
- secretkey:
207
- "SEC1603b7a13fec76f6ec9e1eedbd44279f61b4298142d42616a4a672c245a37f3d",
208
- },
209
- ],
210
- notifyAll: 0,
211
- });
212
- }
213
- return new Promise((resolve, reject) => {
214
- setTimeout(() => {
215
- // reject(new Error("错误"));
216
- resolve({
217
- size: size,
218
- current: current.toString(10),
219
- total: "1000",
220
- records: arrayData,
221
- });
222
- }, 2000);
223
- });
209
+ reload={(params)=>{
210
+ const {size,current}=params;
211
+ setDataSource({
212
+ records: maker(`第${current}页`),
213
+ size,
214
+ current,
215
+ total:"100"
216
+ })
217
+ return Promise.resolve();
224
218
  }}
219
+ dataSource={dataSource}
225
220
  options={{
226
221
  settingRender: () => {
227
222
  return (