@hw-component/table 1.0.6 → 1.0.8
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/Table.js +2 -1
- package/es/hooks/useReq.d.ts +2 -1
- package/es/hooks/useReq.js +4 -2
- package/lib/Table.js +2 -1
- package/lib/hooks/useReq.d.ts +2 -1
- package/lib/hooks/useReq.js +4 -2
- package/package.json +1 -1
- package/src/components/Table.tsx +1 -1
- package/src/components/hooks/useReq.ts +4 -2
- package/src/pages/Table/index.tsx +3 -3
package/es/Table.js
CHANGED
|
@@ -49,7 +49,8 @@ var Table = (function (_ref) {
|
|
|
49
49
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
50
|
var _useReq = useReq({
|
|
51
51
|
request: request,
|
|
52
|
-
manual: manual
|
|
52
|
+
manual: manual,
|
|
53
|
+
formInitValues: formInitValues
|
|
53
54
|
}),
|
|
54
55
|
run = _useReq.run,
|
|
55
56
|
loading = _useReq.loading,
|
package/es/hooks/useReq.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export interface IParamsModal {
|
|
|
6
6
|
reload?: (params: any) => Promise<any>;
|
|
7
7
|
dataSource?: any;
|
|
8
8
|
manual?: boolean;
|
|
9
|
+
formInitValues?: Record<string, any>;
|
|
9
10
|
}
|
|
10
|
-
declare const _default: ({ request, loading, error, reload, dataSource, manual, }: IParamsModal) => {
|
|
11
|
+
declare const _default: ({ request, loading, error, reload, dataSource, manual, formInitValues }: IParamsModal) => {
|
|
11
12
|
saveParams: {
|
|
12
13
|
old: {};
|
|
13
14
|
};
|
package/es/hooks/useReq.js
CHANGED
|
@@ -25,7 +25,9 @@ var useReq = (function (_ref) {
|
|
|
25
25
|
reload = _ref.reload,
|
|
26
26
|
dataSource = _ref.dataSource,
|
|
27
27
|
_ref$manual = _ref.manual,
|
|
28
|
-
manual = _ref$manual === void 0 ? false : _ref$manual
|
|
28
|
+
manual = _ref$manual === void 0 ? false : _ref$manual,
|
|
29
|
+
_ref$formInitValues = _ref.formInitValues,
|
|
30
|
+
formInitValues = _ref$formInitValues === void 0 ? {} : _ref$formInitValues;
|
|
29
31
|
var saveParams = useMemo(function () {
|
|
30
32
|
return {
|
|
31
33
|
old: {}
|
|
@@ -83,7 +85,7 @@ var useReq = (function (_ref) {
|
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
87
|
if (request) {
|
|
86
|
-
resultAction.run();
|
|
88
|
+
resultAction.run(formInitValues);
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
89
91
|
reloadFn();
|
package/lib/Table.js
CHANGED
|
@@ -52,7 +52,8 @@ var Table = (function (_ref) {
|
|
|
52
52
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
53
|
var _useReq = useReq.default({
|
|
54
54
|
request: request,
|
|
55
|
-
manual: manual
|
|
55
|
+
manual: manual,
|
|
56
|
+
formInitValues: formInitValues
|
|
56
57
|
}),
|
|
57
58
|
run = _useReq.run,
|
|
58
59
|
loading = _useReq.loading,
|
package/lib/hooks/useReq.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export interface IParamsModal {
|
|
|
6
6
|
reload?: (params: any) => Promise<any>;
|
|
7
7
|
dataSource?: any;
|
|
8
8
|
manual?: boolean;
|
|
9
|
+
formInitValues?: Record<string, any>;
|
|
9
10
|
}
|
|
10
|
-
declare const _default: ({ request, loading, error, reload, dataSource, manual, }: IParamsModal) => {
|
|
11
|
+
declare const _default: ({ request, loading, error, reload, dataSource, manual, formInitValues }: IParamsModal) => {
|
|
11
12
|
saveParams: {
|
|
12
13
|
old: {};
|
|
13
14
|
};
|
package/lib/hooks/useReq.js
CHANGED
|
@@ -28,7 +28,9 @@ var useReq = (function (_ref) {
|
|
|
28
28
|
reload = _ref.reload,
|
|
29
29
|
dataSource = _ref.dataSource,
|
|
30
30
|
_ref$manual = _ref.manual,
|
|
31
|
-
manual = _ref$manual === void 0 ? false : _ref$manual
|
|
31
|
+
manual = _ref$manual === void 0 ? false : _ref$manual,
|
|
32
|
+
_ref$formInitValues = _ref.formInitValues,
|
|
33
|
+
formInitValues = _ref$formInitValues === void 0 ? {} : _ref$formInitValues;
|
|
32
34
|
var saveParams = React.useMemo(function () {
|
|
33
35
|
return {
|
|
34
36
|
old: {}
|
|
@@ -86,7 +88,7 @@ var useReq = (function (_ref) {
|
|
|
86
88
|
return;
|
|
87
89
|
}
|
|
88
90
|
if (request) {
|
|
89
|
-
resultAction.run();
|
|
91
|
+
resultAction.run(formInitValues);
|
|
90
92
|
return;
|
|
91
93
|
}
|
|
92
94
|
reloadFn();
|
package/package.json
CHANGED
package/src/components/Table.tsx
CHANGED
|
@@ -28,7 +28,7 @@ export default ({
|
|
|
28
28
|
labelWidth,
|
|
29
29
|
...props
|
|
30
30
|
}: HTableProps) => {
|
|
31
|
-
const { run, loading, data, error, saveParams } = useReq({ request, manual });
|
|
31
|
+
const { run, loading, data, error, saveParams } = useReq({ request, manual,formInitValues });
|
|
32
32
|
const dispatch = useDispatch(action);
|
|
33
33
|
const { selectedRowData, rowOnChange, allSelectChange, setSelectedRowData } =
|
|
34
34
|
useRowObj();
|
|
@@ -8,6 +8,7 @@ export interface IParamsModal {
|
|
|
8
8
|
reload?: (params: any) => Promise<any>;
|
|
9
9
|
dataSource?: any;
|
|
10
10
|
manual?: boolean;
|
|
11
|
+
formInitValues?: Record<string, any>;
|
|
11
12
|
}
|
|
12
13
|
export default ({
|
|
13
14
|
request,
|
|
@@ -16,10 +17,11 @@ export default ({
|
|
|
16
17
|
reload,
|
|
17
18
|
dataSource,
|
|
18
19
|
manual = false,
|
|
20
|
+
formInitValues={}
|
|
19
21
|
}: IParamsModal) => {
|
|
20
22
|
const saveParams = useMemo(() => {
|
|
21
23
|
return {
|
|
22
|
-
old:
|
|
24
|
+
old:{},
|
|
23
25
|
};
|
|
24
26
|
}, []);
|
|
25
27
|
const reloadFn = async (params: Record<string, any> = {}) => {
|
|
@@ -43,7 +45,7 @@ export default ({
|
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
45
47
|
if (request) {
|
|
46
|
-
resultAction.run();
|
|
48
|
+
resultAction.run(formInitValues);
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
49
51
|
reloadFn();
|
|
@@ -42,9 +42,10 @@ const configData = [
|
|
|
42
42
|
titleStr: "座位",
|
|
43
43
|
showSearch: true,
|
|
44
44
|
dataIndex: "name2",
|
|
45
|
+
searchType:"select",
|
|
45
46
|
sorter: true,
|
|
46
47
|
itemProps: {
|
|
47
|
-
options: [{ label: "
|
|
48
|
+
options: [{ label: "name2", value: 1 }],
|
|
48
49
|
},
|
|
49
50
|
},
|
|
50
51
|
{
|
|
@@ -95,8 +96,7 @@ export default () => {
|
|
|
95
96
|
x: 1000,
|
|
96
97
|
}}
|
|
97
98
|
formInitValues={{
|
|
98
|
-
|
|
99
|
-
idStartTime: "1713542400",
|
|
99
|
+
name2: 1,
|
|
100
100
|
}}
|
|
101
101
|
headerTitle={<Button type={"primary"}>操作</Button>}
|
|
102
102
|
options={false}
|