gxxc-ui 1.0.40 → 1.0.42
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/dist/UploadUI/index.js +21 -8
- package/package.json +2 -2
package/dist/UploadUI/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { DownloadOutlined, RotateLeftOutlined, RotateRightOutlined, SwapOutlined
|
|
|
25
25
|
import { Image, Space, Upload } from 'antd';
|
|
26
26
|
import React, { useEffect, useState } from 'react';
|
|
27
27
|
import { IconUI, MessageUI } from "./..";
|
|
28
|
-
import { file_calculate_md5, file_url_is_image, getUrlConfig } from 'gxxc-util';
|
|
28
|
+
import { file_calculate_md5, file_url_is_image, file_url_is_video_H264, getUrlConfig } from 'gxxc-util';
|
|
29
29
|
import "./index.scss";
|
|
30
30
|
import { DraggerFileItems } from "./type";
|
|
31
31
|
// 文件名转义 后端解析地址需要排除部分符号
|
|
@@ -97,7 +97,7 @@ var UploadUI = function UploadUI(props) {
|
|
|
97
97
|
// 检查文件大小
|
|
98
98
|
var fileSize = ((file === null || file === void 0 ? void 0 : file.size) || 0) / 1024 / 1024;
|
|
99
99
|
if (maxSize && fileSize > maxSize) {
|
|
100
|
-
MessageUI.error("\u6587\u4EF6\u6700\u5927\u652F\u6301".concat(maxSize, "M\uFF0C\u8BF7\u4FEE\u6539\
|
|
100
|
+
MessageUI.error("\u6587\u4EF6\u6700\u5927\u652F\u6301".concat(maxSize, "M\uFF0C\u8BF7\u4FEE\u6539\u5927\u5C0F\u540E\u91CD\u8BD5\uFF01"));
|
|
101
101
|
return false;
|
|
102
102
|
} else {
|
|
103
103
|
return true;
|
|
@@ -206,6 +206,7 @@ var UploadUI = function UploadUI(props) {
|
|
|
206
206
|
};
|
|
207
207
|
var onPreview = /*#__PURE__*/function () {
|
|
208
208
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file) {
|
|
209
|
+
var mp4Url;
|
|
209
210
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
210
211
|
while (1) switch (_context2.prev = _context2.next) {
|
|
211
212
|
case 0:
|
|
@@ -218,13 +219,25 @@ var UploadUI = function UploadUI(props) {
|
|
|
218
219
|
case 3:
|
|
219
220
|
file.preview = _context2.sent;
|
|
220
221
|
case 4:
|
|
221
|
-
if (file_url_is_image(file.url)) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
} else {
|
|
225
|
-
open(file.url);
|
|
222
|
+
if (!file_url_is_image(file.url)) {
|
|
223
|
+
_context2.next = 8;
|
|
224
|
+
break;
|
|
226
225
|
}
|
|
227
|
-
|
|
226
|
+
setPreviewImage(file.url || file.preview);
|
|
227
|
+
setPreviewOpen(true);
|
|
228
|
+
return _context2.abrupt("return");
|
|
229
|
+
case 8:
|
|
230
|
+
if (!file_url_is_video_H264(file.url)) {
|
|
231
|
+
_context2.next = 13;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
mp4Url = file.url + "?x-oss-process=video/snapshot,t_1000,f_jp" || file.preview;
|
|
235
|
+
setPreviewImage(mp4Url);
|
|
236
|
+
setPreviewOpen(true);
|
|
237
|
+
return _context2.abrupt("return");
|
|
238
|
+
case 13:
|
|
239
|
+
open(file.url);
|
|
240
|
+
case 14:
|
|
228
241
|
case "end":
|
|
229
242
|
return _context2.stop();
|
|
230
243
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gxxc-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"react-countup": "^6.5.3",
|
|
55
55
|
"react-draggable": "^4.4.6",
|
|
56
56
|
"react-router-dom": "^6.13.0",
|
|
57
|
-
"gxxc-util": "^1.0.
|
|
57
|
+
"gxxc-util": "^1.0.19"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@commitlint/cli": "^17.1.2",
|