@yilianjituan/yilian_dgerm 0.0.1-alpha.31 → 0.0.1-alpha.32
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/.eslintrc.js +0 -0
- package/LICENSE +0 -0
- package/README.md +8 -6
- package/dist/business/Entry/index.d.ts +0 -0
- package/dist/business/Entry/index.interface.d.ts +0 -0
- package/dist/business/Entry/index.interface.js +0 -0
- package/dist/business/Entry/index.js +0 -0
- package/dist/business/Entry/index.scss +0 -0
- package/dist/business/TestBtn/index.d.ts +0 -0
- package/dist/business/TestBtn/index.interface.d.ts +0 -0
- package/dist/business/TestBtn/index.interface.js +0 -0
- package/dist/business/TestBtn/index.js +0 -0
- package/dist/commonAxios/Axios.d.ts +0 -0
- package/dist/commonAxios/Axios.js +0 -0
- package/dist/commonAxios/http.d.ts +0 -0
- package/dist/commonAxios/http.js +0 -0
- package/dist/commonAxios/index.d.ts +0 -0
- package/dist/commonAxios/index.js +0 -0
- package/dist/commonAxios/juicer.d.ts +0 -0
- package/dist/commonAxios/juicer.js +0 -0
- package/dist/commonData/address.d.ts +0 -0
- package/dist/commonData/address.js +0 -0
- package/dist/commonImg/ic_im_no_archives_new.png +0 -0
- package/dist/commonType/globalEnum.d.ts +0 -0
- package/dist/commonType/globalEnum.js +0 -0
- package/dist/commonType/globalFun.d.ts +0 -0
- package/dist/commonType/globalFun.js +0 -0
- package/dist/components/BigImage/index.d.ts +0 -0
- package/dist/components/BigImage/index.interface.d.ts +0 -0
- package/dist/components/BigImage/index.interface.js +0 -0
- package/dist/components/BigImage/index.js +0 -0
- package/dist/components/DropDownSelect/index.d.ts +0 -0
- package/dist/components/DropDownSelect/index.interface.d.ts +4 -0
- package/dist/components/DropDownSelect/index.interface.js +0 -0
- package/dist/components/DropDownSelect/index.js +4 -2
- package/dist/components/EmptyDom/index.d.ts +0 -0
- package/dist/components/EmptyDom/index.interface.d.ts +0 -0
- package/dist/components/EmptyDom/index.interface.js +0 -0
- package/dist/components/EmptyDom/index.js +0 -0
- package/dist/components/Entry/index.d.ts +0 -0
- package/dist/components/Entry/index.interface.d.ts +0 -0
- package/dist/components/Entry/index.interface.js +0 -0
- package/dist/components/Entry/index.js +0 -0
- package/dist/components/Entry/index.scss +0 -0
- package/dist/components/ExportExcels/ExportExcels.scss +0 -0
- package/dist/components/ExportExcels/index.d.ts +0 -0
- package/dist/components/ExportExcels/index.interface.d.ts +0 -0
- package/dist/components/ExportExcels/index.interface.js +0 -0
- package/dist/components/ExportExcels/index.js +0 -0
- package/dist/components/FilterRadio/index.d.ts +0 -0
- package/dist/components/FilterRadio/index.interface.d.ts +0 -0
- package/dist/components/FilterRadio/index.interface.js +0 -0
- package/dist/components/FilterRadio/index.js +0 -0
- package/dist/components/FilterRadio/index.scss +0 -0
- package/dist/components/MyBtn/index.d.ts +0 -0
- package/dist/components/MyBtn/index.interface.d.ts +0 -0
- package/dist/components/MyBtn/index.interface.js +0 -0
- package/dist/components/MyBtn/index.js +0 -0
- package/dist/components/NumberInput/index.d.ts +0 -0
- package/dist/components/NumberInput/index.interface.d.ts +0 -0
- package/dist/components/NumberInput/index.interface.js +0 -0
- package/dist/components/NumberInput/index.js +0 -0
- package/dist/components/NumberInput/index.scss +0 -0
- package/dist/components/OcrCommon/index.config.d.ts +8 -0
- package/dist/components/OcrCommon/index.config.js +38 -0
- package/dist/components/OcrCommon/index.d.ts +5 -0
- package/dist/components/OcrCommon/index.interface.d.ts +16 -0
- package/dist/components/{FileUpload → OcrCommon}/index.interface.js +0 -0
- package/dist/components/OcrCommon/index.js +443 -0
- package/dist/components/OcrCommon/index.scss +124 -0
- package/dist/components/PageTemplate/index.d.ts +0 -0
- package/dist/components/PageTemplate/index.interface.d.ts +0 -0
- package/dist/components/PageTemplate/index.interface.js +0 -0
- package/dist/components/PageTemplate/index.js +0 -0
- package/dist/components/PageTemplate/index.scss +0 -0
- package/dist/components/ReactEcharts/index.d.ts +0 -0
- package/dist/components/ReactEcharts/index.interface.d.ts +0 -0
- package/dist/components/ReactEcharts/index.interface.js +0 -0
- package/dist/components/ReactEcharts/index.js +0 -0
- package/dist/components/SelectMax/index.d.ts +0 -0
- package/dist/components/SelectMax/index.interface.d.ts +0 -0
- package/dist/components/SelectMax/index.interface.js +0 -0
- package/dist/components/SelectMax/index.js +0 -0
- package/dist/components/SelectPosition/index.d.ts +5 -0
- package/dist/components/SelectPosition/index.interface.d.ts +65 -0
- package/dist/components/SelectPosition/index.interface.js +1 -0
- package/dist/components/SelectPosition/index.js +353 -0
- package/dist/components/SelectPosition/index.scss +19 -0
- package/dist/components/SuperCascader/index.d.ts +0 -0
- package/dist/components/SuperCascader/index.interface.d.ts +0 -0
- package/dist/components/SuperCascader/index.interface.js +0 -0
- package/dist/components/SuperCascader/index.js +0 -0
- package/dist/components/SuperInput/index.d.ts +0 -0
- package/dist/components/SuperInput/index.interface.d.ts +0 -0
- package/dist/components/SuperInput/index.interface.js +0 -0
- package/dist/components/SuperInput/index.js +0 -0
- package/dist/components/TabsMode/index.d.ts +0 -0
- package/dist/components/TabsMode/index.interface.d.ts +0 -0
- package/dist/components/TabsMode/index.interface.js +0 -0
- package/dist/components/TabsMode/index.js +0 -0
- package/dist/components/VideoProgressModal/index.d.ts +0 -0
- package/dist/components/VideoProgressModal/index.interface.d.ts +0 -0
- package/dist/components/VideoProgressModal/index.interface.js +0 -0
- package/dist/components/VideoProgressModal/index.js +0 -0
- package/dist/components/VideoProgressModal/index.scss +0 -0
- package/dist/components/YLModal/drag.d.ts +0 -0
- package/dist/components/YLModal/drag.js +0 -0
- package/dist/components/YLModal/index.d.ts +0 -0
- package/dist/components/YLModal/index.interface.d.ts +0 -0
- package/dist/components/YLModal/index.interface.js +0 -0
- package/dist/components/YLModal/index.js +0 -0
- package/dist/index.d.ts +13 -12
- package/dist/index.js +13 -12
- package/dist/react-app-env.d.ts +0 -0
- package/dist/utils/common.d.ts +0 -0
- package/dist/utils/common.js +0 -0
- package/dist/utils/index.d.ts +0 -0
- package/dist/utils/index.js +0 -0
- package/dist/utils/notificationHelper.d.ts +0 -0
- package/dist/utils/notificationHelper.js +0 -0
- package/dist/utils/responseMessage.d.ts +0 -0
- package/dist/utils/responseMessage.js +0 -0
- package/dist/utils/userSessionActions.d.ts +0 -0
- package/dist/utils/userSessionActions.js +0 -0
- package/package.json +29 -31
- package/dist/components/FileUpload/fileUtil.d.ts +0 -34
- package/dist/components/FileUpload/fileUtil.js +0 -146
- package/dist/components/FileUpload/index.d.ts +0 -5
- package/dist/components/FileUpload/index.interface.d.ts +0 -119
- package/dist/components/FileUpload/index.js +0 -389
- package/dist/components/FileUpload/index.scss +0 -78
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yilianjituan/yilian_dgerm",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.32",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"React",
|
|
7
|
+
"Component"
|
|
8
|
+
],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": "yljt",
|
|
11
|
+
"main": ".eslintrc.js",
|
|
5
12
|
"module": "dist/index.js",
|
|
6
13
|
"types": "dist/index.d.ts",
|
|
7
|
-
"
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
8
17
|
"scripts": {
|
|
9
|
-
"start": "npm run dev",
|
|
10
|
-
"dev": "dumi dev",
|
|
11
18
|
"build": "father build",
|
|
19
|
+
"build-copy": "npm run build && npm run copy-dist",
|
|
12
20
|
"build:watch": "father dev",
|
|
21
|
+
"copy-dist": "node ./scripts/copyDist.js",
|
|
22
|
+
"dev": "dumi dev",
|
|
13
23
|
"docs:build": "dumi build",
|
|
14
24
|
"docs:preview": "dumi preview",
|
|
15
|
-
"prepare": "husky install && dumi setup",
|
|
16
25
|
"doctor": "father doctor",
|
|
17
26
|
"lint": "npm run lint:es && npm run lint:css",
|
|
18
27
|
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
19
28
|
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
29
|
+
"prepare": "husky install && dumi setup",
|
|
20
30
|
"prepublishOnly": "father doctor && npm run build",
|
|
21
|
-
"
|
|
22
|
-
"build-copy": "npm run build && npm run copy-dist"
|
|
31
|
+
"start": "npm run dev"
|
|
23
32
|
},
|
|
24
|
-
"authors": [],
|
|
25
|
-
"license": "MIT",
|
|
26
|
-
"files": [
|
|
27
|
-
"dist"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"React",
|
|
31
|
-
"Component"
|
|
32
|
-
],
|
|
33
33
|
"commitlint": {
|
|
34
34
|
"extends": [
|
|
35
35
|
"@commitlint/config-conventional"
|
|
@@ -52,29 +52,22 @@
|
|
|
52
52
|
"prettier --parser=typescript --write"
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"registry": "https://registry.npmjs.org/"
|
|
58
|
-
},
|
|
59
|
-
"peerDependencies": {
|
|
60
|
-
"react": ">=16.9.0",
|
|
61
|
-
"react-dom": ">=16.9.0"
|
|
55
|
+
"resolutions": {
|
|
56
|
+
"zod-validation-error": "^1.5.0"
|
|
62
57
|
},
|
|
63
58
|
"dependencies": {
|
|
64
59
|
"@ant-design/icons": "^5.5.1",
|
|
65
60
|
"@hanyk/rc-viewer": "^0.0.3",
|
|
66
61
|
"antd": "^5.18.0",
|
|
67
62
|
"axios": "^1.7.7",
|
|
63
|
+
"copy-to-clipboard": "^3.3.3",
|
|
68
64
|
"dayjs": "^1.11.11",
|
|
69
65
|
"echarts": "^5.0.0",
|
|
70
66
|
"jsdom": "20.0.0",
|
|
71
67
|
"lodash": "^4.17.20",
|
|
72
68
|
"qs": "^6.9.7",
|
|
73
69
|
"react": ">=16.9.0",
|
|
74
|
-
"react-dom": ">=16.9.0"
|
|
75
|
-
"ahooks": "^3.7.2",
|
|
76
|
-
"heic2any": "^0.0.4"
|
|
77
|
-
|
|
70
|
+
"react-dom": ">=16.9.0"
|
|
78
71
|
},
|
|
79
72
|
"devDependencies": {
|
|
80
73
|
"@commitlint/cli": "^17.1.2",
|
|
@@ -89,6 +82,7 @@
|
|
|
89
82
|
"dumi": "^2.3.0",
|
|
90
83
|
"eslint": "^8.23.0",
|
|
91
84
|
"father": "^4.1.0",
|
|
85
|
+
"fs-extra": "^11.2.0",
|
|
92
86
|
"husky": "^8.0.1",
|
|
93
87
|
"lint-staged": "^13.0.3",
|
|
94
88
|
"prettier": "^2.7.1",
|
|
@@ -96,11 +90,15 @@
|
|
|
96
90
|
"prettier-plugin-packagejson": "^2.2.18",
|
|
97
91
|
"react-scripts": "5.0.1",
|
|
98
92
|
"sass": "^1.75.0",
|
|
99
|
-
"fs-extra": "^11.2.0",
|
|
100
93
|
"stylelint": "^14.9.1"
|
|
101
94
|
},
|
|
102
|
-
"
|
|
103
|
-
"
|
|
95
|
+
"peerDependencies": {
|
|
96
|
+
"react": ">=16.9.0",
|
|
97
|
+
"react-dom": ">=16.9.0"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public",
|
|
101
|
+
"registry": "https://registry.npmjs.org/"
|
|
104
102
|
},
|
|
105
|
-
"
|
|
103
|
+
"authors": []
|
|
106
104
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IInitDataType } from './index.interface';
|
|
2
|
-
export declare const accept = ".rar,.zip,.gzip,.txt,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.sav,.caj,.rtf,.hlp,.jpg,.jpeg,.png,.gif,.bmp,.psd,.tif,.mkv,.mp4,.avi,.swf,.wmv,.rmvb,.mov,.mpq,.3gp,.m4v,.webm,.flv,.mp3,.wma,.wav,.amr,.m4a,.aac";
|
|
3
|
-
export declare const acceptList: string[];
|
|
4
|
-
export declare const fileExtensions: string[];
|
|
5
|
-
export declare const videoFormats: string[];
|
|
6
|
-
export declare const documentExtensions: string[];
|
|
7
|
-
export declare const acceptTypes: {
|
|
8
|
-
image: string;
|
|
9
|
-
video: string;
|
|
10
|
-
document: string;
|
|
11
|
-
all: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const acceptListTypes: {
|
|
14
|
-
image: string[];
|
|
15
|
-
video: string[];
|
|
16
|
-
document: string[];
|
|
17
|
-
all: string[];
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* 数据转换.
|
|
21
|
-
* 需要兼容多种情况
|
|
22
|
-
* 1:初始化正常数据回填
|
|
23
|
-
* 2:外部设置(映射)的数据回填
|
|
24
|
-
* 3:组件上传可能有已完成和未完成的数据回填
|
|
25
|
-
* 4:同时多个上传时,需考虑oss返回的数据格式
|
|
26
|
-
*
|
|
27
|
-
* 对未完成的增加URL参数是为了防止完成后的数据diff重新渲染,导致上传组件闪烁
|
|
28
|
-
* @param data - 需要转换的数据
|
|
29
|
-
* @param loading - 判断是否是已完成的数据
|
|
30
|
-
* @returns 返回组好的数据
|
|
31
|
-
*/
|
|
32
|
-
export declare const dataChange: (dataFormat: string, data: IInitDataType[], loading?: boolean) => any[];
|
|
33
|
-
export declare const fileChange: (file: any) => any;
|
|
34
|
-
export declare const imageListChange: (file: any) => any;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
/*
|
|
8
|
-
* @Author: 耿禹
|
|
9
|
-
* @Date: 2024-09-20 09:49:47
|
|
10
|
-
* @Last Modified by: 耿禹
|
|
11
|
-
* @Last Modified time: 2024-10-29 18:10:56
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
// 所有类型
|
|
15
|
-
export var accept = '.rar,.zip,.gzip,.txt,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.sav,.caj,.rtf,.hlp,.jpg,.jpeg,.png,.gif,.bmp,.psd,.tif,.mkv,.mp4,.avi,.swf,.wmv,.rmvb,.mov,.mpq,.3gp,.m4v,.webm,.flv,.mp3,.wma,.wav,.amr,.m4a,.aac';
|
|
16
|
-
// 所有类型List
|
|
17
|
-
export var acceptList = accept.split(',');
|
|
18
|
-
// 图片类型
|
|
19
|
-
var imageAccept = '.png,.jpg,.jpeg,.gif,.bmp,.heic,.svg';
|
|
20
|
-
export var fileExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.heic', '.svg'];
|
|
21
|
-
// 视频类型
|
|
22
|
-
var videoAccept = '.mp4,.3gp,.m4v,.webm';
|
|
23
|
-
export var videoFormats = ['.mp4', '.3gp', '.m4v', '.webm'];
|
|
24
|
-
// 默认文件类型
|
|
25
|
-
var documentAccept = '.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf';
|
|
26
|
-
// 可在三方链接打开的文件类型
|
|
27
|
-
export var documentExtensions = ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf'];
|
|
28
|
-
// 类型枚举
|
|
29
|
-
export var acceptTypes = {
|
|
30
|
-
image: imageAccept,
|
|
31
|
-
video: videoAccept,
|
|
32
|
-
document: documentAccept,
|
|
33
|
-
all: accept
|
|
34
|
-
};
|
|
35
|
-
// 默认类型list
|
|
36
|
-
export var acceptListTypes = {
|
|
37
|
-
image: fileExtensions,
|
|
38
|
-
video: videoFormats,
|
|
39
|
-
document: documentExtensions,
|
|
40
|
-
all: acceptList
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* 数据转换.
|
|
44
|
-
* 需要兼容多种情况
|
|
45
|
-
* 1:初始化正常数据回填
|
|
46
|
-
* 2:外部设置(映射)的数据回填
|
|
47
|
-
* 3:组件上传可能有已完成和未完成的数据回填
|
|
48
|
-
* 4:同时多个上传时,需考虑oss返回的数据格式
|
|
49
|
-
*
|
|
50
|
-
* 对未完成的增加URL参数是为了防止完成后的数据diff重新渲染,导致上传组件闪烁
|
|
51
|
-
* @param data - 需要转换的数据
|
|
52
|
-
* @param loading - 判断是否是已完成的数据
|
|
53
|
-
* @returns 返回组好的数据
|
|
54
|
-
*/
|
|
55
|
-
export var dataChange = function dataChange(dataFormat, data) {
|
|
56
|
-
var loading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
57
|
-
// 未完成的增加空URL
|
|
58
|
-
if (loading) {
|
|
59
|
-
return data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
60
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
61
|
-
url: ''
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
// 已完成的数据处理
|
|
66
|
-
// 文件
|
|
67
|
-
if (dataFormat === 'object') {
|
|
68
|
-
return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
|
|
69
|
-
var content = item.content,
|
|
70
|
-
name = item.name,
|
|
71
|
-
fileSize = item.fileSize,
|
|
72
|
-
uid = item.uid,
|
|
73
|
-
url = item.url,
|
|
74
|
-
response = item.response,
|
|
75
|
-
size = item.size;
|
|
76
|
-
var _url = url || content || (response === null || response === void 0 ? void 0 : response.url) || ''; // url: 已经处理完的时候,content: 未处理的时候,response: 多文件同时上传时
|
|
77
|
-
var _size = fileSize || size || 0; // 文件大小
|
|
78
|
-
var isVideo = videoFormats.some(function (format) {
|
|
79
|
-
return _url === null || _url === void 0 ? void 0 : _url.endsWith(format);
|
|
80
|
-
}); // 判断是否为视频格式
|
|
81
|
-
var _thumbUrl = isVideo ? "".concat(_url, "?x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast,ar_auto") : _url; // 视频的缩略图处理, 非视频文件直接使用原始 URL 作为缩略图
|
|
82
|
-
return {
|
|
83
|
-
uid: uid || _url,
|
|
84
|
-
// 每个文件的唯一标识符
|
|
85
|
-
name: name || "\u6587\u4EF6-".concat(index + 1),
|
|
86
|
-
// 自定义名称
|
|
87
|
-
status: 'done',
|
|
88
|
-
// 标记文件已成功上传
|
|
89
|
-
url: _url,
|
|
90
|
-
// 使用 URL 作为资源链接
|
|
91
|
-
thumbUrl: _thumbUrl,
|
|
92
|
-
// 缩略图
|
|
93
|
-
fileSize: _size // 文件大小
|
|
94
|
-
};
|
|
95
|
-
});
|
|
96
|
-
} else {
|
|
97
|
-
// 图片
|
|
98
|
-
return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
|
|
99
|
-
// 未处理时为string
|
|
100
|
-
if (typeof item === 'string') {
|
|
101
|
-
return {
|
|
102
|
-
uid: item,
|
|
103
|
-
name: "picture-".concat(index + 1),
|
|
104
|
-
status: 'done',
|
|
105
|
-
url: item
|
|
106
|
-
};
|
|
107
|
-
} else {
|
|
108
|
-
var url = item.url,
|
|
109
|
-
name = item.name,
|
|
110
|
-
uid = item.uid,
|
|
111
|
-
response = item.response,
|
|
112
|
-
status = item.status;
|
|
113
|
-
var _url = url || (response === null || response === void 0 ? void 0 : response.url); // url: 已经处理完的时候,response: 多文件同时上传时
|
|
114
|
-
return {
|
|
115
|
-
uid: uid || _url,
|
|
116
|
-
// 每个文件的唯一标识符
|
|
117
|
-
name: name || "\u6587\u4EF6-".concat(index + 1),
|
|
118
|
-
// 自定义名称
|
|
119
|
-
status: status,
|
|
120
|
-
// 标记文件已成功上传
|
|
121
|
-
url: _url // 使用 URL 作为资源链接
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
// 文件改变存储文件处理
|
|
129
|
-
export var fileChange = function fileChange(file) {
|
|
130
|
-
return file.map(function (file) {
|
|
131
|
-
var _file$response;
|
|
132
|
-
return {
|
|
133
|
-
content: file.url || ((_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.url) || file.content,
|
|
134
|
-
name: file.name,
|
|
135
|
-
fileSize: file.fileSize || file.size
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
// string 或 image 数据处理
|
|
141
|
-
export var imageListChange = function imageListChange(file) {
|
|
142
|
-
return file.map(function (file) {
|
|
143
|
-
var _file$response2;
|
|
144
|
-
return file.url || ((_file$response2 = file.response) === null || _file$response2 === void 0 ? void 0 : _file$response2.url) || file.content;
|
|
145
|
-
});
|
|
146
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { FormItemProps, UploadProps } from "antd";
|
|
2
|
-
export interface IProps {
|
|
3
|
-
/**
|
|
4
|
-
* @description 阿里云上传实例和配置
|
|
5
|
-
*/
|
|
6
|
-
aliyunProps: {
|
|
7
|
-
ossUpload: any;
|
|
8
|
-
OSSINIT: any;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @description 上传的提示信息
|
|
12
|
-
* @required
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
tips?: {
|
|
16
|
-
/**
|
|
17
|
-
* @description 是否需要提示
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
needTips?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @description 提示文字
|
|
23
|
-
*/
|
|
24
|
-
tipsText?: string;
|
|
25
|
-
/**
|
|
26
|
-
* @description 自定义提示样式
|
|
27
|
-
*/
|
|
28
|
-
tipsStyle?: object;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* @description 表单属性配置
|
|
32
|
-
*/
|
|
33
|
-
formProps: {
|
|
34
|
-
/**
|
|
35
|
-
* @description 表单字段名称
|
|
36
|
-
*/
|
|
37
|
-
name: string;
|
|
38
|
-
/**
|
|
39
|
-
* @description 如果为 Form.List,则需要指定父级 name
|
|
40
|
-
*/
|
|
41
|
-
parentName?: string;
|
|
42
|
-
/**
|
|
43
|
-
* @description 如果为 Form.List,则需要指定当前项的索引
|
|
44
|
-
*/
|
|
45
|
-
index?: number;
|
|
46
|
-
/**
|
|
47
|
-
* @description 需要传入和返回的数据格式,必须一致
|
|
48
|
-
* @default 'string'
|
|
49
|
-
*/
|
|
50
|
-
dataFormat?: 'string' | 'object';
|
|
51
|
-
} & FormItemProps;
|
|
52
|
-
/**
|
|
53
|
-
* @description 上传组件的配置
|
|
54
|
-
*/
|
|
55
|
-
uploadProps?: {
|
|
56
|
-
/**
|
|
57
|
-
* @description 最大上传数量
|
|
58
|
-
* @default 1
|
|
59
|
-
*/
|
|
60
|
-
maxCount?: number;
|
|
61
|
-
/**
|
|
62
|
-
* @description 接受的文件类型
|
|
63
|
-
* @default 'image'
|
|
64
|
-
*/
|
|
65
|
-
type?: 'image' | 'video' | 'document' | 'all';
|
|
66
|
-
/**
|
|
67
|
-
* @description 最大文件大小(单位:MB)
|
|
68
|
-
* @default 2
|
|
69
|
-
*/
|
|
70
|
-
maxSize?: number;
|
|
71
|
-
/**
|
|
72
|
-
* @description 是否为编辑状态
|
|
73
|
-
*/
|
|
74
|
-
isDetails?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* @description 上传列表的样式类型
|
|
77
|
-
* @default 'picture-card'
|
|
78
|
-
*/
|
|
79
|
-
listType?: 'text' | 'picture' | 'picture-card' | 'picture-circle';
|
|
80
|
-
/**
|
|
81
|
-
* @description 接受上传的文件类型;如果设置了 accept,则 type 无效
|
|
82
|
-
*/
|
|
83
|
-
accept?: string;
|
|
84
|
-
} & Omit<UploadProps, 'type'>;
|
|
85
|
-
}
|
|
86
|
-
export interface AliyunOSSUploadProps extends IProps {
|
|
87
|
-
/**
|
|
88
|
-
* @description 当前上传的文件列表
|
|
89
|
-
*/
|
|
90
|
-
value?: any[];
|
|
91
|
-
/**
|
|
92
|
-
* @description 上传文件变更事件
|
|
93
|
-
*/
|
|
94
|
-
onChange?: (value: any) => void;
|
|
95
|
-
/**
|
|
96
|
-
* @description 视频播放链接设置方法
|
|
97
|
-
*/
|
|
98
|
-
setCurrVideoLink: (value: string) => void;
|
|
99
|
-
/**
|
|
100
|
-
* @description 图片预览弹窗设置方法
|
|
101
|
-
*/
|
|
102
|
-
setPreviewOpen: (value: boolean) => void;
|
|
103
|
-
/**
|
|
104
|
-
* @description 图片预览链接设置方法
|
|
105
|
-
*/
|
|
106
|
-
setPreviewImage: (value: string) => void;
|
|
107
|
-
}
|
|
108
|
-
export interface IInitDataType {
|
|
109
|
-
content?: string;
|
|
110
|
-
name?: string;
|
|
111
|
-
fileSize?: string;
|
|
112
|
-
size?: string;
|
|
113
|
-
uid?: string;
|
|
114
|
-
url?: string;
|
|
115
|
-
response?: {
|
|
116
|
-
url: string;
|
|
117
|
-
};
|
|
118
|
-
status?: 'done' | 'error' | 'uploading' | 'removed';
|
|
119
|
-
}
|