@cqsjjb/jjb-react-admin-component 3.1.4 → 3.2.0-beta.1
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.
- package/BMap/index.d.ts +40 -0
- package/BMap/index.js +185 -0
- package/BMap/index.less +36 -0
- package/ControlWrapper/index.d.ts +45 -59
- package/ControlWrapper/index.js +70 -245
- package/Editor/index.js +330 -0
- package/Editor/index.ts +59 -0
- package/ErrorBoundary/index.d.ts +3 -6
- package/ErrorBoundary/index.js +3 -9
- package/FileUploader/index.d.ts +56 -0
- package/FileUploader/index.js +385 -0
- package/FileUploader/index.less +198 -0
- package/FormilyDescriptions/index.d.ts +116 -59
- package/FormilyDescriptions/index.js +202 -215
- package/FormilyRenderer/index.d.ts +15 -32
- package/FormilyRenderer/index.js +45 -25
- package/ImageCropper/index.d.ts +55 -0
- package/ImageCropper/index.js +131 -0
- package/ImageUploader/index.d.ts +79 -0
- package/ImageUploader/index.js +362 -0
- package/ImageUploader/index.less +100 -0
- package/MediaQuery/index.d.ts +9 -6
- package/MediaQuery/index.js +32 -81
- package/PageLayout/index.d.ts +44 -0
- package/PageLayout/index.js +85 -0
- package/PageLayout/index.less +47 -0
- package/SearchForm/index.d.ts +26 -49
- package/SearchForm/index.js +93 -108
- package/Table/index.d.ts +2 -6
- package/Table/index.js +1 -1
- package/TableAction/index.d.ts +15 -10
- package/TableAction/index.js +23 -15
- package/package.json +3 -3
- package/tools/index.d.ts +10 -0
- package/tools/index.js +87 -0
- package/SearchForm/index.less +0 -0
- package/Upload/index.d.ts +0 -76
- package/Upload/index.js +0 -334
- package/types/index.ts +0 -7
package/SearchForm/index.js
CHANGED
|
@@ -1,127 +1,112 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Form, Button, Space, Row, Col } from 'antd';
|
|
4
4
|
import { SearchOutlined, DoubleRightOutlined, UndoOutlined } from '@ant-design/icons';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onClick: () => {
|
|
40
|
-
const open = !this.state.isOpen;
|
|
41
|
-
this.setState({
|
|
42
|
-
isOpen: open
|
|
43
|
-
}, () => {
|
|
44
|
-
onExpand && onExpand(open);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}, this.state.isOpen ? '收起' : '展开'));
|
|
48
|
-
}
|
|
49
|
-
groupsList() {
|
|
50
|
-
const arr = [];
|
|
51
|
-
this.props.formLine.forEach(i => {
|
|
52
|
-
arr.push({
|
|
53
|
-
show: true,
|
|
54
|
-
node: i
|
|
5
|
+
const SearchForm = ({
|
|
6
|
+
form: externalForm,
|
|
7
|
+
style,
|
|
8
|
+
expand,
|
|
9
|
+
// 受控
|
|
10
|
+
defaultExpand = false,
|
|
11
|
+
// 内部默认展开
|
|
12
|
+
colSize = 3,
|
|
13
|
+
loading = false,
|
|
14
|
+
formLine = [],
|
|
15
|
+
initialValues = {},
|
|
16
|
+
onRef = () => {},
|
|
17
|
+
onReset = () => {},
|
|
18
|
+
onFinish = () => {},
|
|
19
|
+
onExpand
|
|
20
|
+
}) => {
|
|
21
|
+
const internalForm = useRef();
|
|
22
|
+
const form = externalForm || internalForm;
|
|
23
|
+
const [internalOpen, setInternalOpen] = useState(defaultExpand);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (onRef) {
|
|
26
|
+
onRef(form);
|
|
27
|
+
}
|
|
28
|
+
}, [form, onRef]);
|
|
29
|
+
const isControlled = expand !== undefined;
|
|
30
|
+
const isOpen = isControlled ? expand : internalOpen;
|
|
31
|
+
const handleToggle = () => {
|
|
32
|
+
if (isControlled) {
|
|
33
|
+
onExpand && onExpand(!expand);
|
|
34
|
+
} else {
|
|
35
|
+
setInternalOpen(prev => {
|
|
36
|
+
const next = !prev;
|
|
37
|
+
onExpand && onExpand(next);
|
|
38
|
+
return next;
|
|
55
39
|
});
|
|
56
|
-
});
|
|
57
|
-
if (this.props.expand && this.state.isOpen) {
|
|
58
|
-
return arr;
|
|
59
40
|
}
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
};
|
|
42
|
+
const getButtons = () => /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
43
|
+
type: "primary",
|
|
44
|
+
icon: /*#__PURE__*/React.createElement(SearchOutlined, null),
|
|
45
|
+
htmlType: "submit",
|
|
46
|
+
loading: loading
|
|
47
|
+
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
|
|
48
|
+
icon: /*#__PURE__*/React.createElement(UndoOutlined, null),
|
|
49
|
+
loading: loading,
|
|
50
|
+
onClick: () => {
|
|
51
|
+
form.current.resetFields();
|
|
52
|
+
onReset(form.current.getFieldsValue());
|
|
62
53
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
}, "\u91CD\u7F6E"), formLine.length / colSize > 1 && /*#__PURE__*/React.createElement(Button, {
|
|
55
|
+
icon: /*#__PURE__*/React.createElement(DoubleRightOutlined, {
|
|
56
|
+
style: {
|
|
57
|
+
transform: isOpen ? 'rotate(-90deg)' : 'rotate(90deg)'
|
|
66
58
|
}
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
}),
|
|
60
|
+
onClick: handleToggle
|
|
61
|
+
}, isOpen ? '收起' : '展开'));
|
|
62
|
+
const groupsList = () => {
|
|
63
|
+
const arr = formLine.map(node => ({
|
|
64
|
+
show: true,
|
|
65
|
+
node
|
|
66
|
+
}));
|
|
67
|
+
if (isOpen || arr.length <= 3) {
|
|
68
|
+
return arr;
|
|
73
69
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
100
|
-
noStyle: true
|
|
101
|
-
}, this.getButtons())))) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
searchForm.defaultProps = {
|
|
105
|
-
style: {},
|
|
106
|
-
expand: false,
|
|
107
|
-
colSize: 3,
|
|
108
|
-
loading: false,
|
|
109
|
-
formLine: [],
|
|
110
|
-
initialValues: {},
|
|
111
|
-
onRef: () => {},
|
|
112
|
-
onReset: () => {},
|
|
113
|
-
onFinish: () => {}
|
|
70
|
+
return arr.map((item, index) => index > 2 ? {
|
|
71
|
+
...item,
|
|
72
|
+
show: false
|
|
73
|
+
} : item);
|
|
74
|
+
};
|
|
75
|
+
const formItemList = groupsList();
|
|
76
|
+
if (formItemList.length === 0) return null;
|
|
77
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
78
|
+
ref: form,
|
|
79
|
+
style: style,
|
|
80
|
+
initialValues: initialValues,
|
|
81
|
+
onFinish: values => onFinish(values)
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
83
|
+
gutter: [16, 16]
|
|
84
|
+
}, formItemList.map((item, index) => /*#__PURE__*/React.createElement(Col, {
|
|
85
|
+
key: index,
|
|
86
|
+
span: 24 / colSize,
|
|
87
|
+
style: {
|
|
88
|
+
display: item.show ? 'block' : 'none'
|
|
89
|
+
}
|
|
90
|
+
}, item.node)), /*#__PURE__*/React.createElement(Col, {
|
|
91
|
+
span: 24 / colSize
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
93
|
+
noStyle: true
|
|
94
|
+
}, getButtons()))));
|
|
114
95
|
};
|
|
115
|
-
|
|
96
|
+
SearchForm.propTypes = {
|
|
116
97
|
form: PropTypes.object,
|
|
117
98
|
style: PropTypes.object,
|
|
118
99
|
expand: PropTypes.bool,
|
|
100
|
+
// 受控
|
|
101
|
+
defaultExpand: PropTypes.bool,
|
|
102
|
+
// 内部默认展开
|
|
119
103
|
colSize: PropTypes.number,
|
|
120
104
|
loading: PropTypes.bool,
|
|
121
105
|
formLine: PropTypes.array,
|
|
122
106
|
initialValues: PropTypes.object,
|
|
123
107
|
onRef: PropTypes.func,
|
|
124
108
|
onReset: PropTypes.func,
|
|
125
|
-
onFinish: PropTypes.func
|
|
109
|
+
onFinish: PropTypes.func,
|
|
110
|
+
onExpand: PropTypes.func
|
|
126
111
|
};
|
|
127
|
-
export default
|
|
112
|
+
export default SearchForm;
|
package/Table/index.d.ts
CHANGED
|
@@ -4,13 +4,9 @@ import * as React from 'react';
|
|
|
4
4
|
import type { TableProps } from 'antd';
|
|
5
5
|
|
|
6
6
|
interface OverTableProps extends TableProps {
|
|
7
|
-
|
|
8
|
-
* 是否禁用内容区滚动,默认false
|
|
9
|
-
*/
|
|
7
|
+
// 是否禁用内容区滚动,默认-false
|
|
10
8
|
disabledResizer?: boolean;
|
|
11
|
-
|
|
12
|
-
* 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖
|
|
13
|
-
*/
|
|
9
|
+
// 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖
|
|
14
10
|
storeIndex?: string;
|
|
15
11
|
}
|
|
16
12
|
|
package/Table/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
4
4
|
import { ProTable } from '@ant-design/pro-components';
|
package/TableAction/index.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { ComponentProps } from '../types';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DropdownProps } from 'antd';
|
|
4
3
|
|
|
5
|
-
interface TableActionProps
|
|
6
|
-
//
|
|
4
|
+
export interface TableActionProps {
|
|
5
|
+
// 图标 默认-MoreOutlined
|
|
6
|
+
icon?: React.ComponentType;
|
|
7
|
+
// 最大显示数量,超出的会放入下拉菜单 默认-3
|
|
7
8
|
maximum?: number;
|
|
8
|
-
//
|
|
9
|
-
|
|
9
|
+
// 子元素,可以是单个 ReactNode 或数组
|
|
10
|
+
children: ReactNode | ReactNode[];
|
|
11
|
+
// Space 间距 默认-8
|
|
12
|
+
space?: number | string;
|
|
13
|
+
// 下拉菜单位置,默认 bottomRight
|
|
14
|
+
placement?: DropdownProps['placement'];
|
|
15
|
+
// 下拉触发方式,默认 ['hover']
|
|
16
|
+
trigger?: DropdownProps['trigger'];
|
|
10
17
|
}
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
}
|
|
19
|
+
declare const TableAction: React.FC<TableActionProps>;
|
|
14
20
|
|
|
15
|
-
declare const TableAction: TableActionFc;
|
|
16
21
|
export default TableAction;
|
package/TableAction/index.js
CHANGED
|
@@ -2,21 +2,29 @@ import React from 'react';
|
|
|
2
2
|
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
3
3
|
import { MoreOutlined } from '@ant-design/icons';
|
|
4
4
|
import { Dropdown, Space } from 'antd';
|
|
5
|
-
export default function TableAction(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export default function TableAction({
|
|
6
|
+
maximum = 3,
|
|
7
|
+
children,
|
|
8
|
+
space,
|
|
9
|
+
icon: Icon = MoreOutlined,
|
|
10
|
+
placement = 'bottomRight',
|
|
11
|
+
// 下拉菜单位置,默认 bottomRight
|
|
12
|
+
trigger = ['hover'] // 下拉触发方式,默认 hover
|
|
13
|
+
}) {
|
|
14
|
+
// 将 children 统一成数组并过滤空值
|
|
15
|
+
const childArray = (tools.isArray(children) ? children : [].concat(children)).filter(Boolean);
|
|
16
|
+
const showArray = childArray.slice(0, maximum);
|
|
17
|
+
const hideArray = childArray.slice(maximum);
|
|
10
18
|
return /*#__PURE__*/React.createElement(Space, {
|
|
11
|
-
size:
|
|
12
|
-
}, showArray, hideArray.length
|
|
19
|
+
size: space
|
|
20
|
+
}, showArray, hideArray.length > 0 && /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
21
|
menu: {
|
|
14
|
-
items: hideArray.map((
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(
|
|
22
|
+
items: hideArray.map((child, index) => ({
|
|
23
|
+
key: index,
|
|
24
|
+
label: child
|
|
25
|
+
}))
|
|
26
|
+
},
|
|
27
|
+
placement: placement,
|
|
28
|
+
trigger: trigger
|
|
29
|
+
}, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(Icon, null))));
|
|
22
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cqsjjb/jjb-react-admin-component",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.0-beta.1",
|
|
4
4
|
"description": "jjb-react-admin-组件库@new",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "jjb-front-team",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.6.5",
|
|
13
13
|
"spark-md5": "^3.0.2",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"cropperjs": "^1.6.2",
|
|
15
|
+
"@wangeditor-next/editor": "latest",
|
|
16
16
|
"@cqsjjb-formily/renderer": "latest",
|
|
17
17
|
"@ant-design/pro-layout": "latest",
|
|
18
18
|
"use-antd-resizable-header": "latest",
|
package/tools/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function isVersion1(v: string): boolean;
|
|
2
|
+
export function isVersion2(v: string): boolean;
|
|
3
|
+
export function getToken(): string;
|
|
4
|
+
export function getAppKey(): string;
|
|
5
|
+
export function getTenantCode(): string;
|
|
6
|
+
export function getViewAsp(wh: string): number;
|
|
7
|
+
export function isHttpUrl(v: string): boolean;
|
|
8
|
+
export function getPrefixCls(): string;
|
|
9
|
+
export function getAlgorithm(): string;
|
|
10
|
+
export function getAlgorithm(): string;
|
package/tools/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
2
|
+
|
|
3
|
+
const { toObject } = tools;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description 版本1
|
|
7
|
+
* @param v {string}
|
|
8
|
+
* @return {boolean}
|
|
9
|
+
*/
|
|
10
|
+
export function isVersion1(v) {
|
|
11
|
+
return v === 'v1';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @description 版本2
|
|
16
|
+
* @param v {string}
|
|
17
|
+
* @return {boolean}
|
|
18
|
+
*/
|
|
19
|
+
export function isVersion2(v) {
|
|
20
|
+
return v === 'v2';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @description 读取token
|
|
25
|
+
* @return {string}
|
|
26
|
+
*/
|
|
27
|
+
export function getToken() {
|
|
28
|
+
return window.sessionStorage.getItem('token');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @description 读取appKey
|
|
33
|
+
* @return {string}
|
|
34
|
+
*/
|
|
35
|
+
export function getAppKey() {
|
|
36
|
+
return toObject(toObject(toObject(window.process).env).app).appKey;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @description 读取tenantCode
|
|
41
|
+
* @return {string}
|
|
42
|
+
*/
|
|
43
|
+
export function getTenantCode() {
|
|
44
|
+
return window.sessionStorage.getItem('tenantCode');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description 获取纵横比
|
|
49
|
+
* @param wh {string}
|
|
50
|
+
* @return {number[]}
|
|
51
|
+
*/
|
|
52
|
+
export function getViewAsp(wh) {
|
|
53
|
+
try {
|
|
54
|
+
return wh.split('*').map(v => parseInt(v));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
return [0, 0];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @description http
|
|
62
|
+
* @param v {string}
|
|
63
|
+
* @return {boolean}
|
|
64
|
+
*/
|
|
65
|
+
export function isHttpUrl(v) {
|
|
66
|
+
return /^http[s]?:\/\//.test(v);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @description 获取前缀
|
|
71
|
+
* @return {string}
|
|
72
|
+
*/
|
|
73
|
+
export function getPrefixCls() {
|
|
74
|
+
return window.process?.env?.app?.antd['ant-prefix'] || 'ant';
|
|
75
|
+
}
|
|
76
|
+
export function getAlgorithm() {
|
|
77
|
+
const value = document.documentElement.style.getPropertyValue(
|
|
78
|
+
'--gbs-var-algorithm'
|
|
79
|
+
);
|
|
80
|
+
return (
|
|
81
|
+
value ?
|
|
82
|
+
value === '#FFF' ?
|
|
83
|
+
'default'
|
|
84
|
+
: 'dark'
|
|
85
|
+
: 'default'
|
|
86
|
+
);
|
|
87
|
+
}
|
package/SearchForm/index.less
DELETED
|
File without changes
|
package/Upload/index.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { ComponentProps } from '../types';
|
|
4
|
-
|
|
5
|
-
interface UploadProps extends ComponentProps {
|
|
6
|
-
/**
|
|
7
|
-
* @description 上传提交字段名,默认file
|
|
8
|
-
*/
|
|
9
|
-
name?: string;
|
|
10
|
-
/**
|
|
11
|
-
* @description 上传文件大小限制,默认Infinity
|
|
12
|
-
*/
|
|
13
|
-
size?: number;
|
|
14
|
-
/**
|
|
15
|
-
* @description 是否开启图片裁剪,需和listType配合使用,text模式下无效
|
|
16
|
-
*/
|
|
17
|
-
crop?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* @description 上传接口地址
|
|
20
|
-
*/
|
|
21
|
-
action?: string;
|
|
22
|
-
/**
|
|
23
|
-
* @description 上传资源类型,参考HTML.Input,默认*
|
|
24
|
-
*/
|
|
25
|
-
accept?: string;
|
|
26
|
-
/**
|
|
27
|
-
* @description 最大上传数,参考antd官方文档,默认1
|
|
28
|
-
*/
|
|
29
|
-
maxCount?: number;
|
|
30
|
-
/**
|
|
31
|
-
* @description 展示效果,参考antd官方文档,默认text
|
|
32
|
-
*/
|
|
33
|
-
listType?: 'text' | 'picture' | 'picture-card' | 'picture-circle';
|
|
34
|
-
/**
|
|
35
|
-
* @description 开启后支持多选文件,默认false,注意:当maxCount为1时或开启crop时无效
|
|
36
|
-
*/
|
|
37
|
-
multiple?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* @description 上传类型,默认Post
|
|
40
|
-
*/
|
|
41
|
-
method?: 'POST' | 'PUT' | 'PATCH' | 'GET' | 'DELETE' | 'OPTIONS';
|
|
42
|
-
/**
|
|
43
|
-
* @description 开启后将计算文件签名,默认false,注意:开启了多图上传时建议不开启,可能会导致内存占用过大
|
|
44
|
-
*/
|
|
45
|
-
signature?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* @description 开启后将强制类型验证,默认false
|
|
48
|
-
*/
|
|
49
|
-
forceAccept?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* @description 上传是否携带浏览器cookie,默认false
|
|
52
|
-
*/
|
|
53
|
-
withCredentials?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* @description 上传携带的其他字段属性,默认{}
|
|
56
|
-
*/
|
|
57
|
-
data?: object,
|
|
58
|
-
/**
|
|
59
|
-
* @description 上传携带的请求头字段属性,默认{}
|
|
60
|
-
*/
|
|
61
|
-
headers?: object;
|
|
62
|
-
/**
|
|
63
|
-
* @description 是否开启拖拽上传,默认false
|
|
64
|
-
*/
|
|
65
|
-
drag?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* @description 应用appKey
|
|
68
|
-
*/
|
|
69
|
-
appKey?: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
interface UploadFc extends React.FC<UploadProps> {
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare const Upload: UploadFc;
|
|
76
|
-
export default Upload;
|