@quansitech/antd-admin 1.1.18 → 1.1.20
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/dist/components/Table.js +15 -11
- package/package.json +1 -1
package/dist/components/Table.js
CHANGED
|
@@ -201,16 +201,20 @@ export default function (props) {
|
|
|
201
201
|
searchUrl = window.location.href;
|
|
202
202
|
}
|
|
203
203
|
if (props.defaultSearchValue !== undefined) {
|
|
204
|
-
|
|
204
|
+
var _formRef$current;
|
|
205
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setFieldsValue(props.defaultSearchValue);
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
Object.keys(query).
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
if (!modalContext.inModal) {
|
|
208
|
+
var query = qs.parse(window.location.search.replace(/^\?/, ''));
|
|
209
|
+
if (query && Object.keys(query).length) {
|
|
210
|
+
var _formRef$current2;
|
|
211
|
+
Object.keys(query).forEach(function (key) {
|
|
212
|
+
if (typeof query[key] === 'string') {
|
|
213
|
+
/^\d+$/.test(query[key]) && (query[key] = parseInt(query[key]));
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setFieldsValue(query);
|
|
217
|
+
}
|
|
214
218
|
}
|
|
215
219
|
}, []);
|
|
216
220
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableContext.Provider, {
|
|
@@ -255,9 +259,9 @@ export default function (props) {
|
|
|
255
259
|
}
|
|
256
260
|
// 是否立即搜索
|
|
257
261
|
if (c.searchOnChange) {
|
|
258
|
-
var _formRef$
|
|
262
|
+
var _formRef$current3;
|
|
259
263
|
// @ts-ignore
|
|
260
|
-
(_formRef$
|
|
264
|
+
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 || _formRef$current3.submit();
|
|
261
265
|
}
|
|
262
266
|
}
|
|
263
267
|
},
|