@guo514360255/antd-lib 1.4.34 → 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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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 =
|
|
104
|
+
_context2.next = 19;
|
|
101
105
|
break;
|
|
102
106
|
}
|
|
103
|
-
_context2.next =
|
|
104
|
-
return request(formData);
|
|
105
|
-
case
|
|
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
|
|
123
|
-
_context2.next =
|
|
126
|
+
case 19:
|
|
127
|
+
_context2.next = 24;
|
|
124
128
|
break;
|
|
125
|
-
case
|
|
126
|
-
_context2.prev =
|
|
129
|
+
case 21:
|
|
130
|
+
_context2.prev = 21;
|
|
127
131
|
_context2.t0 = _context2["catch"](6);
|
|
128
132
|
console.log(_context2.t0);
|
|
129
|
-
case
|
|
133
|
+
case 24:
|
|
130
134
|
case "end":
|
|
131
135
|
return _context2.stop();
|
|
132
136
|
}
|
|
133
|
-
}, _callee2, null, [[6,
|
|
137
|
+
}, _callee2, null, [[6, 21]]);
|
|
134
138
|
}));
|
|
135
139
|
return function customRequest(_x2) {
|
|
136
140
|
return _ref4.apply(this, arguments);
|
package/dist/FormItem/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var _excluded = ["value", "onChange"];
|
|
|
7
7
|
* @Description:
|
|
8
8
|
*/
|
|
9
9
|
import { valueEnumTransform } from "../utils/util";
|
|
10
|
-
import { Checkbox, ColorPicker, Input, InputNumber, Radio, Select, TreeSelect } from 'antd';
|
|
10
|
+
import { Checkbox, ColorPicker, DatePicker, Input, InputNumber, Radio, Select, TreeSelect } from 'antd';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
var FormItem = function FormItem(_ref) {
|
|
13
13
|
var value = _ref.value,
|
|
@@ -21,14 +21,15 @@ var FormItem = function FormItem(_ref) {
|
|
|
21
21
|
treeSelect: TreeSelect,
|
|
22
22
|
textArea: Input.TextArea,
|
|
23
23
|
checkbox: Checkbox.Group,
|
|
24
|
-
color: ColorPicker
|
|
24
|
+
color: ColorPicker,
|
|
25
|
+
date: DatePicker
|
|
25
26
|
};
|
|
26
27
|
var placeholder = rest.defaultPlaceholder || ['input', 'inputNumber', 'textArea'].includes(rest.type) ? '请输入' : '请选择';
|
|
27
28
|
var FieldComponent = comField[rest.type || 'input'];
|
|
28
29
|
return /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
29
30
|
value: value,
|
|
30
31
|
onChange: function onChange(e) {
|
|
31
|
-
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(['treeSelect', 'select', 'checkbox', 'color'].includes(rest.type) ? e : !rest.type || ['input', 'inputNumber'].includes(rest.type) ? e : e.target.value);
|
|
32
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(['treeSelect', 'select', 'checkbox', 'color', 'date'].includes(rest.type) ? e : !rest.type || ['input', 'inputNumber'].includes(rest.type) ? e : e.target.value);
|
|
32
33
|
}
|
|
33
34
|
}, ['radio', 'checkbox', 'inputNumber'].includes(rest.type) ? {} : {
|
|
34
35
|
allowClear: true
|
package/dist/compontent.d.ts
CHANGED