@guo514360255/antd-lib 1.4.36 → 1.4.37
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.
|
@@ -19,5 +19,5 @@ export interface CustomUploadProps {
|
|
|
19
19
|
};
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}
|
|
22
|
-
declare const CustomUpload: ({ value, onChange, isDragger, children,
|
|
22
|
+
declare const CustomUpload: ({ value, onChange, isDragger, children, ...rest }: CustomUploadProps) => JSX.Element;
|
|
23
23
|
export default CustomUpload;
|
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["value", "onChange", "isDragger", "children"
|
|
7
|
+
var _excluded = ["value", "onChange", "isDragger", "children"];
|
|
8
8
|
/*
|
|
9
9
|
* @Author: 郭郭
|
|
10
10
|
* @Date: 2025/9/15
|
|
@@ -21,8 +21,6 @@ var CustomUpload = function CustomUpload(_ref) {
|
|
|
21
21
|
onChange = _ref.onChange,
|
|
22
22
|
isDragger = _ref.isDragger,
|
|
23
23
|
children = _ref.children,
|
|
24
|
-
_ref$isCustomUpload = _ref.isCustomUpload,
|
|
25
|
-
isCustomUpload = _ref$isCustomUpload === void 0 ? false : _ref$isCustomUpload,
|
|
26
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
25
|
var props = (rest === null || rest === void 0 ? void 0 : rest.fieldProps) || rest;
|
|
28
26
|
var _useState = useState([]),
|
|
@@ -86,15 +84,15 @@ var CustomUpload = function CustomUpload(_ref) {
|
|
|
86
84
|
}
|
|
87
85
|
return _context2.abrupt("return");
|
|
88
86
|
case 3:
|
|
89
|
-
if (!(props && props.maxCount && value.length >= props.maxCount)) {
|
|
87
|
+
if (!(props !== null && props !== void 0 && props.maxCount && value.length >= (props === null || props === void 0 ? void 0 : props.maxCount))) {
|
|
90
88
|
_context2.next = 6;
|
|
91
89
|
break;
|
|
92
90
|
}
|
|
93
|
-
messageApi.warning("\u6700\u591A\u4E0A\u4F20".concat(props.maxCount, "\u4E2A\u6587\u4EF6"));
|
|
91
|
+
messageApi.warning("\u6700\u591A\u4E0A\u4F20".concat(props === null || props === void 0 ? void 0 : props.maxCount, "\u4E2A\u6587\u4EF6"));
|
|
94
92
|
return _context2.abrupt("return");
|
|
95
93
|
case 6:
|
|
96
94
|
_context2.prev = 6;
|
|
97
|
-
if (!isCustomUpload) {
|
|
95
|
+
if (!(props !== null && props !== void 0 && props.isCustomUpload)) {
|
|
98
96
|
formData = new FormData();
|
|
99
97
|
formData.append('file', file);
|
|
100
98
|
formData.append('biz', props === null || props === void 0 ? void 0 : props.biz);
|
|
@@ -105,7 +103,7 @@ var CustomUpload = function CustomUpload(_ref) {
|
|
|
105
103
|
break;
|
|
106
104
|
}
|
|
107
105
|
_context2.next = 12;
|
|
108
|
-
return request(!isCustomUpload ? formData : file);
|
|
106
|
+
return request(!(props !== null && props !== void 0 && props.isCustomUpload) ? formData : file);
|
|
109
107
|
case 12:
|
|
110
108
|
_yield$request = _context2.sent;
|
|
111
109
|
url = _yield$request.url;
|
package/dist/compontent.d.ts
CHANGED