ds-web-all 1.0.1-beta.90 → 1.0.1-beta.91
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.
|
@@ -15,7 +15,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
var _fileRequest = _interopRequireDefault(require("../../common/fileRequest"));
|
|
16
16
|
require("./index.less");
|
|
17
17
|
var _Confirm = _interopRequireDefault(require("../Confirm"));
|
|
18
|
-
var _excluded = ["onFinish", "listType", "multiple", "accept", "value", "text", "buttonProps", "requestUrl", "confirmProps", "onError"];
|
|
18
|
+
var _excluded = ["onFinish", "listType", "multiple", "accept", "value", "text", "buttonProps", "requestUrl", "confirmProps", "onError", "requestTimeout", "defaultErrorMsg"];
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -49,6 +49,10 @@ var BaseUpload = function BaseUpload(_ref) {
|
|
|
49
49
|
requestUrl = _ref.requestUrl,
|
|
50
50
|
confirmProps = _ref.confirmProps,
|
|
51
51
|
onError = _ref.onError,
|
|
52
|
+
_ref$requestTimeout = _ref.requestTimeout,
|
|
53
|
+
requestTimeout = _ref$requestTimeout === void 0 ? 30000 : _ref$requestTimeout,
|
|
54
|
+
_ref$defaultErrorMsg = _ref.defaultErrorMsg,
|
|
55
|
+
defaultErrorMsg = _ref$defaultErrorMsg === void 0 ? '上传失败' : _ref$defaultErrorMsg,
|
|
52
56
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
57
|
var headers = {
|
|
54
58
|
Authorization: window.token
|
|
@@ -114,7 +118,8 @@ var BaseUpload = function BaseUpload(_ref) {
|
|
|
114
118
|
headers: {
|
|
115
119
|
'Content-Type': 'multipart/form-data'
|
|
116
120
|
},
|
|
117
|
-
data: formData
|
|
121
|
+
data: formData,
|
|
122
|
+
timeout: requestTimeout
|
|
118
123
|
});
|
|
119
124
|
case 6:
|
|
120
125
|
res = _context.sent;
|
|
@@ -124,7 +129,7 @@ var BaseUpload = function BaseUpload(_ref) {
|
|
|
124
129
|
case 10:
|
|
125
130
|
_context.prev = 10;
|
|
126
131
|
_context.t0 = _context["catch"](3);
|
|
127
|
-
errorMessage = (_context.t0 === null || _context.t0 === void 0 ? void 0 : (_error$response = _context.t0.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message) || (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) ||
|
|
132
|
+
errorMessage = (_context.t0 === null || _context.t0 === void 0 ? void 0 : (_error$response = _context.t0.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message) || (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || defaultErrorMsg;
|
|
128
133
|
_message2.default.error(errorMessage);
|
|
129
134
|
onError === null || onError === void 0 ? void 0 : onError(_context.t0);
|
|
130
135
|
console.error('Upload error:', _context.t0);
|
|
@@ -421,6 +421,13 @@ var ComposeManage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
421
421
|
}
|
|
422
422
|
formRef.current.resetFields(); // 重置搜索框中表单
|
|
423
423
|
formRef.current.setFieldsValue(initialFilterValues);
|
|
424
|
+
if (!dataRequest && typeof staticFilter === 'function') {
|
|
425
|
+
var newData = staticDataSourceCache.current.filter(function (el, i) {
|
|
426
|
+
return staticFilter(initialFilterValues, el, i);
|
|
427
|
+
});
|
|
428
|
+
setTableSource(_toConsumableArray(newData));
|
|
429
|
+
setTotal(newData.length);
|
|
430
|
+
}
|
|
424
431
|
if (!dataRequest && typeof staticSearch === 'function') {
|
|
425
432
|
staticSearch(initialFilterValues);
|
|
426
433
|
}
|
|
@@ -633,15 +640,23 @@ var ComposeManage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
633
640
|
newTotal = _ref6.total,
|
|
634
641
|
newPageNo = _ref6.pageNo,
|
|
635
642
|
newPageSize = _ref6.pageSize;
|
|
636
|
-
|
|
637
|
-
|
|
643
|
+
staticDataSourceCache.current = dataSorce;
|
|
644
|
+
if (!dataRequest && typeof staticFilter === 'function') {
|
|
645
|
+
var newData = staticDataSourceCache.current.filter(function (el, i) {
|
|
646
|
+
return staticFilter(search, el, i);
|
|
647
|
+
});
|
|
648
|
+
setTableSource(_toConsumableArray(newData));
|
|
649
|
+
setTotal(newData.length);
|
|
650
|
+
} else {
|
|
651
|
+
setTableSource(dataSorce);
|
|
652
|
+
setTotal(newTotal !== null && newTotal !== void 0 ? newTotal : dataSorce.length);
|
|
653
|
+
}
|
|
638
654
|
if (typeof newPageNo === 'number') {
|
|
639
655
|
setPageNo(newPageNo);
|
|
640
656
|
}
|
|
641
657
|
if (typeof newPageSize === 'number') {
|
|
642
658
|
setPageSize(newPageSize);
|
|
643
659
|
}
|
|
644
|
-
staticDataSourceCache.current = dataSorce;
|
|
645
660
|
};
|
|
646
661
|
var scrollTableRefCb = function scrollTableRefCb(ref) {
|
|
647
662
|
if (scrollTableRef.current) {
|
|
@@ -474,19 +474,21 @@ function CFTable(_ref2) {
|
|
|
474
474
|
return JSON.stringify(simpleColumns);
|
|
475
475
|
}, [simpleColumns]);
|
|
476
476
|
(0, _react.useEffect)(function () {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
477
|
+
if (resizeable) {
|
|
478
|
+
columnWidthMapRef.current = columnWidthMap;
|
|
479
|
+
var sum = rowSelectWidth;
|
|
480
|
+
var _loopForEach = function loopForEach(arr) {
|
|
481
|
+
arr.forEach(function (col) {
|
|
482
|
+
if (col.children && col.children.length > 0) {
|
|
483
|
+
_loopForEach(col.children);
|
|
484
|
+
} else {
|
|
485
|
+
sum += columnWidthMap[col.name] || 0;
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
_loopForEach(columns);
|
|
490
|
+
setResizeScrollX(sum);
|
|
491
|
+
}
|
|
490
492
|
}, [columnWidthMap, rowSelectWidth]);
|
|
491
493
|
(0, _react.useEffect)(function () {
|
|
492
494
|
columnConfigWidthMapOld.current = _objectSpread({}, columnConfigWidthMap.current);
|