cloud-web-corejs 1.1.0-dev.81 → 1.1.0-dev.82
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/package.json
CHANGED
|
@@ -102,16 +102,11 @@ tmixins = {
|
|
|
102
102
|
editFileSuffix: null,
|
|
103
103
|
beforeUploadFlag: false,
|
|
104
104
|
uploadUrl: null,
|
|
105
|
-
|
|
106
|
-
access_key_id: "HPUAQ1TAFXWGOKSNKCGW", // 你的ak
|
|
107
|
-
secret_access_key: "Ns1nwPwikK67Acbhj3wlfUambjbdroqpk0TFv7qg", // 你的sk
|
|
108
|
-
server: "https://obs.cn-south-1.myhuaweicloud.com", // 你的endPoint 记得加入https://
|
|
109
|
-
Bucket: "gztw-file01", // 你的桶名
|
|
110
105
|
};
|
|
111
106
|
},
|
|
112
|
-
beforeDestroy() {
|
|
113
|
-
this.removePasteEvent();
|
|
114
|
-
this.revokeUploadObjectUrls();
|
|
107
|
+
beforeDestroy() {
|
|
108
|
+
this.removePasteEvent();
|
|
109
|
+
this.revokeUploadObjectUrls();
|
|
115
110
|
},
|
|
116
111
|
filters: {
|
|
117
112
|
btnText(btn) {
|
|
@@ -348,7 +343,7 @@ tmixins = {
|
|
|
348
343
|
blurPasteEvent() {
|
|
349
344
|
this.pasteAreaStatus = false;
|
|
350
345
|
},
|
|
351
|
-
handleClose() {
|
|
346
|
+
handleClose() {
|
|
352
347
|
let target = this.$refs.upload;
|
|
353
348
|
(target.uploadFiles || []).forEach((uploadFile) => {
|
|
354
349
|
if (uploadFile.status == "uploading" || uploadFile.status == "ready") {
|
|
@@ -357,15 +352,15 @@ tmixins = {
|
|
|
357
352
|
this.$t2("取消上传", "components.VabUpload.cancelUpload")
|
|
358
353
|
);
|
|
359
354
|
}
|
|
360
|
-
});
|
|
361
|
-
this.revokeUploadObjectUrls();
|
|
362
|
-
this.pasteList = [];
|
|
363
|
-
this.removePasteEvent();
|
|
364
|
-
this.picture = "picture";
|
|
365
|
-
this.clearFileInfo();
|
|
366
|
-
this.dialogFormVisible = false;
|
|
367
|
-
const destroyRoot = this.$destroyOnDialogClose;
|
|
368
|
-
if (destroyRoot) this.$nextTick(destroyRoot);
|
|
355
|
+
});
|
|
356
|
+
this.revokeUploadObjectUrls();
|
|
357
|
+
this.pasteList = [];
|
|
358
|
+
this.removePasteEvent();
|
|
359
|
+
this.picture = "picture";
|
|
360
|
+
this.clearFileInfo();
|
|
361
|
+
this.dialogFormVisible = false;
|
|
362
|
+
const destroyRoot = this.$destroyOnDialogClose;
|
|
363
|
+
if (destroyRoot) this.$nextTick(destroyRoot);
|
|
369
364
|
},
|
|
370
365
|
clearFileInfo() {
|
|
371
366
|
this.fileList = [];
|
|
@@ -1208,33 +1203,33 @@ tmixins = {
|
|
|
1208
1203
|
}
|
|
1209
1204
|
},
|
|
1210
1205
|
//end
|
|
1211
|
-
getShowImage(file, fileName) {
|
|
1206
|
+
getShowImage(file, fileName) {
|
|
1212
1207
|
fileName = fileName || file.name;
|
|
1213
1208
|
if (this.$commonFileUtil.isPictureFile(fileName)) {
|
|
1214
1209
|
return file.showUrl || file.url;
|
|
1215
1210
|
} else {
|
|
1216
1211
|
return this.$commonFileUtil.getFileIconRequire(fileName);
|
|
1217
1212
|
}
|
|
1218
|
-
},
|
|
1219
|
-
revokeUploadObjectUrl(url) {
|
|
1220
|
-
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
1221
|
-
URL.revokeObjectURL(url);
|
|
1222
|
-
}
|
|
1223
|
-
},
|
|
1224
|
-
revokeUploadObjectUrls() {
|
|
1225
|
-
const files = [
|
|
1226
|
-
...(this.fileList || []),
|
|
1227
|
-
...(this.pasteList || []),
|
|
1228
|
-
...(this.$refs.upload?.uploadFiles || []),
|
|
1229
|
-
];
|
|
1230
|
-
const urls = new Set();
|
|
1231
|
-
files.forEach((file) => {
|
|
1232
|
-
if (file?.showUrl) urls.add(file.showUrl);
|
|
1233
|
-
if (file?.url) urls.add(file.url);
|
|
1234
|
-
});
|
|
1235
|
-
urls.forEach((url) => this.revokeUploadObjectUrl(url));
|
|
1236
|
-
},
|
|
1237
|
-
removeFile(sfile) {
|
|
1213
|
+
},
|
|
1214
|
+
revokeUploadObjectUrl(url) {
|
|
1215
|
+
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
1216
|
+
URL.revokeObjectURL(url);
|
|
1217
|
+
}
|
|
1218
|
+
},
|
|
1219
|
+
revokeUploadObjectUrls() {
|
|
1220
|
+
const files = [
|
|
1221
|
+
...(this.fileList || []),
|
|
1222
|
+
...(this.pasteList || []),
|
|
1223
|
+
...(this.$refs.upload?.uploadFiles || []),
|
|
1224
|
+
];
|
|
1225
|
+
const urls = new Set();
|
|
1226
|
+
files.forEach((file) => {
|
|
1227
|
+
if (file?.showUrl) urls.add(file.showUrl);
|
|
1228
|
+
if (file?.url) urls.add(file.url);
|
|
1229
|
+
});
|
|
1230
|
+
urls.forEach((url) => this.revokeUploadObjectUrl(url));
|
|
1231
|
+
},
|
|
1232
|
+
removeFile(sfile) {
|
|
1238
1233
|
var target = this.$refs.upload;
|
|
1239
1234
|
var index;
|
|
1240
1235
|
var fileList = target.uploadFiles;
|
|
@@ -1255,8 +1250,8 @@ tmixins = {
|
|
|
1255
1250
|
}
|
|
1256
1251
|
}
|
|
1257
1252
|
|
|
1258
|
-
this.revokeUploadObjectUrl(sfile?.showUrl || sfile?.url);
|
|
1259
|
-
target.uploadFiles.splice(index, 1);
|
|
1253
|
+
this.revokeUploadObjectUrl(sfile?.showUrl || sfile?.url);
|
|
1254
|
+
target.uploadFiles.splice(index, 1);
|
|
1260
1255
|
this.handleChange(sfile, target.uploadFiles);
|
|
1261
1256
|
},
|
|
1262
1257
|
submitImage() {
|
|
@@ -1466,10 +1461,10 @@ tmixins = {
|
|
|
1466
1461
|
this.pasteList.push(...fileList);
|
|
1467
1462
|
}
|
|
1468
1463
|
},
|
|
1469
|
-
deletePasteFile(index) {
|
|
1470
|
-
const file = this.pasteList[index];
|
|
1471
|
-
this.revokeUploadObjectUrl(file?.showUrl || file?.url);
|
|
1472
|
-
this.pasteList.splice(index, 1);
|
|
1464
|
+
deletePasteFile(index) {
|
|
1465
|
+
const file = this.pasteList[index];
|
|
1466
|
+
this.revokeUploadObjectUrl(file?.showUrl || file?.url);
|
|
1467
|
+
this.pasteList.splice(index, 1);
|
|
1473
1468
|
},
|
|
1474
1469
|
confirmPasteFile() {
|
|
1475
1470
|
let target = this.$refs.upload;
|
|
@@ -1481,10 +1476,10 @@ tmixins = {
|
|
|
1481
1476
|
fileRaw.fileName = name;
|
|
1482
1477
|
return fileRaw;
|
|
1483
1478
|
});
|
|
1484
|
-
innerTarget.uploadFiles(files);
|
|
1485
|
-
this.pasteList.forEach((file) =>
|
|
1486
|
-
this.revokeUploadObjectUrl(file?.showUrl || file?.url)
|
|
1487
|
-
);
|
|
1479
|
+
innerTarget.uploadFiles(files);
|
|
1480
|
+
this.pasteList.forEach((file) =>
|
|
1481
|
+
this.revokeUploadObjectUrl(file?.showUrl || file?.url)
|
|
1482
|
+
);
|
|
1488
1483
|
this.$nextTick(() => {
|
|
1489
1484
|
target.uploadFiles.forEach((uploadFile) => {
|
|
1490
1485
|
let fileRaw = uploadFile.raw;
|
|
@@ -1494,7 +1489,7 @@ tmixins = {
|
|
|
1494
1489
|
}
|
|
1495
1490
|
});
|
|
1496
1491
|
});
|
|
1497
|
-
this.pasteList = [];
|
|
1492
|
+
this.pasteList = [];
|
|
1498
1493
|
},
|
|
1499
1494
|
changeFileName(file) {
|
|
1500
1495
|
if (file.fileSuffix) {
|