@guo514360255/antd-lib 1.4.35 → 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.
@@ -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;
@@ -84,25 +84,27 @@ var CustomUpload = function CustomUpload(_ref) {
84
84
  }
85
85
  return _context2.abrupt("return");
86
86
  case 3:
87
- 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))) {
88
88
  _context2.next = 6;
89
89
  break;
90
90
  }
91
- 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"));
92
92
  return _context2.abrupt("return");
93
93
  case 6:
94
94
  _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);
95
+ if (!(props !== null && props !== void 0 && props.isCustomUpload)) {
96
+ formData = new FormData();
97
+ formData.append('file', file);
98
+ formData.append('biz', props === null || props === void 0 ? void 0 : props.biz);
99
+ }
98
100
  request = props === null || props === void 0 ? void 0 : props.request;
99
101
  if (!request) {
100
- _context2.next = 21;
102
+ _context2.next = 19;
101
103
  break;
102
104
  }
103
- _context2.next = 14;
104
- return request(formData);
105
- case 14:
105
+ _context2.next = 12;
106
+ return request(!(props !== null && props !== void 0 && props.isCustomUpload) ? formData : file);
107
+ case 12:
106
108
  _yield$request = _context2.sent;
107
109
  url = _yield$request.url;
108
110
  originalName = _yield$request.originalName;
@@ -119,18 +121,18 @@ var CustomUpload = function CustomUpload(_ref) {
119
121
  setTimeout(function () {
120
122
  setFileList([].concat(_toConsumableArray(fileList), [obj]));
121
123
  }, 200);
122
- case 21:
123
- _context2.next = 26;
124
+ case 19:
125
+ _context2.next = 24;
124
126
  break;
125
- case 23:
126
- _context2.prev = 23;
127
+ case 21:
128
+ _context2.prev = 21;
127
129
  _context2.t0 = _context2["catch"](6);
128
130
  console.log(_context2.t0);
129
- case 26:
131
+ case 24:
130
132
  case "end":
131
133
  return _context2.stop();
132
134
  }
133
- }, _callee2, null, [[6, 23]]);
135
+ }, _callee2, null, [[6, 21]]);
134
136
  }));
135
137
  return function customRequest(_x2) {
136
138
  return _ref4.apply(this, arguments);
@@ -68,6 +68,11 @@ interface CustomColumnProps extends ProColumns {
68
68
  */
69
69
  isCrop?: boolean;
70
70
 
71
+ /**
72
+ * 是否自定义上传
73
+ */
74
+ isCustomUpload?: boolean;
75
+
71
76
  [key: string]: any;
72
77
  };
73
78
 
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.37",
4
4
  "description": "react design 5 lib",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",