@guo514360255/antd-lib 1.4.35 → 1.4.36

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.
@@ -9,6 +9,7 @@ export interface CustomUploadProps {
9
9
  imgCrop?: ImgCropProps;
10
10
  isCrop?: boolean;
11
11
  isDragger?: boolean;
12
+ isCustomUpload?: boolean;
12
13
  children?: React.ReactNode;
13
14
  rest?: {
14
15
  isDragger?: boolean;
@@ -18,5 +19,5 @@ export interface CustomUploadProps {
18
19
  };
19
20
  [key: string]: any;
20
21
  }
21
- declare const CustomUpload: ({ value, onChange, isDragger, children, ...rest }: CustomUploadProps) => JSX.Element;
22
+ declare const CustomUpload: ({ value, onChange, isDragger, children, isCustomUpload, ...rest }: CustomUploadProps) => JSX.Element;
22
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", "isCustomUpload"];
8
8
  /*
9
9
  * @Author: 郭郭
10
10
  * @Date: 2025/9/15
@@ -21,6 +21,8 @@ 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,
24
26
  rest = _objectWithoutProperties(_ref, _excluded);
25
27
  var props = (rest === null || rest === void 0 ? void 0 : rest.fieldProps) || rest;
26
28
  var _useState = useState([]),
@@ -92,17 +94,19 @@ var CustomUpload = function CustomUpload(_ref) {
92
94
  return _context2.abrupt("return");
93
95
  case 6:
94
96
  _context2.prev = 6;
95
- formData = new FormData();
96
- formData.append('file', file);
97
- formData.append('biz', props === null || props === void 0 ? void 0 : props.biz);
97
+ if (!isCustomUpload) {
98
+ formData = new FormData();
99
+ formData.append('file', file);
100
+ formData.append('biz', props === null || props === void 0 ? void 0 : props.biz);
101
+ }
98
102
  request = props === null || props === void 0 ? void 0 : props.request;
99
103
  if (!request) {
100
- _context2.next = 21;
104
+ _context2.next = 19;
101
105
  break;
102
106
  }
103
- _context2.next = 14;
104
- return request(formData);
105
- case 14:
107
+ _context2.next = 12;
108
+ return request(!isCustomUpload ? formData : file);
109
+ case 12:
106
110
  _yield$request = _context2.sent;
107
111
  url = _yield$request.url;
108
112
  originalName = _yield$request.originalName;
@@ -119,18 +123,18 @@ var CustomUpload = function CustomUpload(_ref) {
119
123
  setTimeout(function () {
120
124
  setFileList([].concat(_toConsumableArray(fileList), [obj]));
121
125
  }, 200);
122
- case 21:
123
- _context2.next = 26;
126
+ case 19:
127
+ _context2.next = 24;
124
128
  break;
125
- case 23:
126
- _context2.prev = 23;
129
+ case 21:
130
+ _context2.prev = 21;
127
131
  _context2.t0 = _context2["catch"](6);
128
132
  console.log(_context2.t0);
129
- case 26:
133
+ case 24:
130
134
  case "end":
131
135
  return _context2.stop();
132
136
  }
133
- }, _callee2, null, [[6, 23]]);
137
+ }, _callee2, null, [[6, 21]]);
134
138
  }));
135
139
  return function customRequest(_x2) {
136
140
  return _ref4.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guo514360255/antd-lib",
3
- "version": "1.4.35",
3
+ "version": "1.4.36",
4
4
  "description": "react design 5 lib",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",