@quansitech/antd-admin 1.2.0 → 1.2.1
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.d.ts +1 -0
- package/dist/components/Table.js +14 -25
- package/package.json +1 -1
package/dist/components/Table.js
CHANGED
|
@@ -199,7 +199,7 @@ export default function (props) {
|
|
|
199
199
|
*/
|
|
200
200
|
var createSearchRangeColumn = function createSearchRangeColumn(column, rangeType) {
|
|
201
201
|
return _objectSpread(_objectSpread({}, column), {}, {
|
|
202
|
-
dataIndex: column.dataIndex
|
|
202
|
+
dataIndex: column.dataIndex,
|
|
203
203
|
valueType: rangeType,
|
|
204
204
|
title: typeof column.title === 'string' ? "".concat(column.title, "\u8303\u56F4") : column.title,
|
|
205
205
|
hideInTable: true,
|
|
@@ -219,18 +219,6 @@ export default function (props) {
|
|
|
219
219
|
search: false
|
|
220
220
|
});
|
|
221
221
|
};
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* 处理普通column
|
|
225
|
-
*/
|
|
226
|
-
var processNormalColumn = function processNormalColumn(column, processedColumns) {
|
|
227
|
-
if (container.schemaHandler[column.valueType]) {
|
|
228
|
-
var processedColumn = container.schemaHandler[column.valueType](column);
|
|
229
|
-
processedColumns.push(processedColumn);
|
|
230
|
-
} else {
|
|
231
|
-
processedColumns.push(column);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
222
|
(_cloneDeep = cloneDeep(columns)) === null || _cloneDeep === void 0 || _cloneDeep.forEach(function (column) {
|
|
235
223
|
// 设置column的key
|
|
236
224
|
column.key = column.dataIndex;
|
|
@@ -248,10 +236,15 @@ export default function (props) {
|
|
|
248
236
|
processedColumns.push(searchColumn, tableColumn);
|
|
249
237
|
} else {
|
|
250
238
|
// 处理普通column
|
|
251
|
-
|
|
239
|
+
processedColumns.push(column);
|
|
252
240
|
}
|
|
253
241
|
});
|
|
254
|
-
return processedColumns
|
|
242
|
+
return processedColumns.map(function (column) {
|
|
243
|
+
if (container.schemaHandler[column.valueType]) {
|
|
244
|
+
column = container.schemaHandler[column.valueType](column);
|
|
245
|
+
}
|
|
246
|
+
return column;
|
|
247
|
+
});
|
|
255
248
|
}, [columns]);
|
|
256
249
|
var handleSearchRangeValue = function handleSearchRangeValue(processedValue) {
|
|
257
250
|
Object.keys(processedValue).forEach(function (key) {
|
|
@@ -266,14 +259,6 @@ export default function (props) {
|
|
|
266
259
|
}
|
|
267
260
|
});
|
|
268
261
|
};
|
|
269
|
-
|
|
270
|
-
// 处理搜索表单的初始值转换(将字符串格式的日期范围转换为数组)
|
|
271
|
-
var processedDefaultSearchValue = useMemo(function () {
|
|
272
|
-
if (!props.defaultSearchValue) return props.defaultSearchValue;
|
|
273
|
-
var processedValue = _objectSpread({}, props.defaultSearchValue);
|
|
274
|
-
handleSearchRangeValue(processedValue);
|
|
275
|
-
return processedValue;
|
|
276
|
-
}, [props.defaultSearchValue]);
|
|
277
262
|
var modalContext = useContext(ModalContext);
|
|
278
263
|
var tabsContext = useContext(TabsContext);
|
|
279
264
|
useEffect(function () {
|
|
@@ -313,7 +298,11 @@ export default function (props) {
|
|
|
313
298
|
}
|
|
314
299
|
}
|
|
315
300
|
}, []);
|
|
316
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
301
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
302
|
+
dangerouslySetInnerHTML: {
|
|
303
|
+
__html: props.description
|
|
304
|
+
}
|
|
305
|
+
}), /*#__PURE__*/React.createElement(TableContext.Provider, {
|
|
317
306
|
value: {
|
|
318
307
|
getTableProps: function getTableProps() {
|
|
319
308
|
return props;
|
|
@@ -354,7 +343,7 @@ export default function (props) {
|
|
|
354
343
|
reload: true
|
|
355
344
|
},
|
|
356
345
|
form: {
|
|
357
|
-
initialValues:
|
|
346
|
+
initialValues: props.defaultSearchValue,
|
|
358
347
|
onValuesChange: function onValuesChange(changedValues, allValues) {
|
|
359
348
|
var _formRef$current2;
|
|
360
349
|
var submit = realColumns.filter(function (c) {
|