@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.
- package/es/DialogTable/Content.d.ts +2 -1
- package/es/DialogTable/Content.js +4 -2
- package/es/DialogTable/DwTable.d.ts +1 -0
- package/es/DialogTable/DwTable.js +10 -4
- package/es/DialogTable/ModalTable.d.ts +1 -0
- package/es/DialogTable/ModalTable.js +9 -3
- package/es/DialogTable/hooks.d.ts +3 -1
- package/es/DialogTable/hooks.js +4 -2
- package/es/Table.d.ts +1 -1
- package/es/Table.js +8 -9
- package/es/hooks/useReq.d.ts +3 -3
- package/es/hooks/useReq.js +82 -19
- package/es/modal.d.ts +3 -1
- package/lib/DialogTable/Content.d.ts +2 -1
- package/lib/DialogTable/Content.js +4 -2
- package/lib/DialogTable/DwTable.d.ts +1 -0
- package/lib/DialogTable/DwTable.js +10 -4
- package/lib/DialogTable/ModalTable.d.ts +1 -0
- package/lib/DialogTable/ModalTable.js +9 -3
- package/lib/DialogTable/hooks.d.ts +3 -1
- package/lib/DialogTable/hooks.js +4 -2
- package/lib/Table.d.ts +1 -1
- package/lib/Table.js +8 -9
- package/lib/hooks/useReq.d.ts +3 -3
- package/lib/hooks/useReq.js +81 -18
- package/lib/modal.d.ts +3 -1
- package/package.json +15 -14
- package/src/components/DialogTable/Content.tsx +2 -0
- package/src/components/DialogTable/DwTable.tsx +10 -2
- package/src/components/DialogTable/ModalTable.tsx +11 -2
- package/src/components/DialogTable/hooks.ts +2 -0
- package/src/components/Table.tsx +7 -5
- package/src/components/hooks/useReq.ts +57 -8
- package/src/components/modal.ts +3 -1
- package/src/pages/DwTable/index.tsx +16 -2
- package/src/pages/ModalTable/index.tsx +14 -2
- 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
|
-
|
|
193
|
-
const {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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 (
|