gxxc-ui 1.0.42 → 1.0.43
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 +12 -20
- package/package.json +1 -1
package/dist/UploadUI/index.js
CHANGED
|
@@ -86,10 +86,15 @@ var UploadUI = function UploadUI(props) {
|
|
|
86
86
|
useEffect(function () {
|
|
87
87
|
var newFileList = (value === null || value === void 0 ? void 0 : value.map(function (item, index) {
|
|
88
88
|
var _getUrlConfig, _item$url;
|
|
89
|
-
|
|
89
|
+
var param = _objectSpread(_objectSpread({}, item), {}, {
|
|
90
90
|
uid: (item === null || item === void 0 ? void 0 : item.uid) || (item === null || item === void 0 ? void 0 : item.md5) || "temp_uid_".concat(Date.now(), "_").concat(index),
|
|
91
91
|
name: (item === null || item === void 0 ? void 0 : item.name) || ((_getUrlConfig = getUrlConfig((_item$url = item === null || item === void 0 ? void 0 : item.url) !== null && _item$url !== void 0 ? _item$url : '')) === null || _getUrlConfig === void 0 ? void 0 : _getUrlConfig.fileName) || "file_".concat(index + 1)
|
|
92
92
|
});
|
|
93
|
+
/// 如果是 h264 编码 显示第一帧
|
|
94
|
+
if (file_url_is_video_H264(param.url)) {
|
|
95
|
+
param.thumbUrl = "".concat(item.url, "?x-oss-process=video/snapshot,t_1000,f_jpg");
|
|
96
|
+
}
|
|
97
|
+
return param;
|
|
93
98
|
})) || [];
|
|
94
99
|
setFileList(newFileList);
|
|
95
100
|
}, [value]);
|
|
@@ -206,7 +211,6 @@ var UploadUI = function UploadUI(props) {
|
|
|
206
211
|
};
|
|
207
212
|
var onPreview = /*#__PURE__*/function () {
|
|
208
213
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file) {
|
|
209
|
-
var mp4Url;
|
|
210
214
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
211
215
|
while (1) switch (_context2.prev = _context2.next) {
|
|
212
216
|
case 0:
|
|
@@ -219,25 +223,13 @@ var UploadUI = function UploadUI(props) {
|
|
|
219
223
|
case 3:
|
|
220
224
|
file.preview = _context2.sent;
|
|
221
225
|
case 4:
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
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;
|
|
226
|
+
if (file_url_is_image(file.url)) {
|
|
227
|
+
setPreviewImage(file.url || file.preview);
|
|
228
|
+
setPreviewOpen(true);
|
|
229
|
+
} else {
|
|
230
|
+
open(file.url);
|
|
233
231
|
}
|
|
234
|
-
|
|
235
|
-
setPreviewImage(mp4Url);
|
|
236
|
-
setPreviewOpen(true);
|
|
237
|
-
return _context2.abrupt("return");
|
|
238
|
-
case 13:
|
|
239
|
-
open(file.url);
|
|
240
|
-
case 14:
|
|
232
|
+
case 5:
|
|
241
233
|
case "end":
|
|
242
234
|
return _context2.stop();
|
|
243
235
|
}
|