cloud-web-corejs 1.1.0-dev.45 → 1.1.0-dev.47
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 +1 -1
- package/src/app-bootstrap.js +6 -5
- package/src/components/Qrcode/fileParse.vue +11 -0
- package/src/components/VabUpload/index.js +11 -4
- package/src/components/VabUpload/mixins/fileLibraryDialog.js +2 -0
- package/src/components/VabUpload/mixins.js +72 -40
- package/src/components/VabUpload/partUploadConfig.js +95 -0
- package/src/components/VabUpload/privateProfileDialogMixins.js +2 -0
- package/src/components/baseInputExport/mixins.js +1 -0
- package/src/components/fileLibrary/mixins/indexMixins.js +2 -0
- package/src/components/jdPrint/mixins.js +2 -0
- package/src/components/obsUpload/index.js +4 -1
- package/src/components/obsUpload/mixins.js +45 -15
- package/src/components/onlineTalk/mixins.js +11 -0
- package/src/components/table/index.js +74 -78
- package/src/components/xform/docs/2026-09 /346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206P0/344/273/243/347/240/201/350/257/204/345/256/241.md" +255 -0
- package/src/components/xform/docs/2026-09 /346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206P0/346/265/213/350/257/225/351/252/214/350/257/201/345/256/236/346/226/275/346/226/207/346/241/243.md" +595 -0
- package/src/components/xform/docs//346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206/344/270/216/344/277/256/345/244/215/350/220/275/345/234/260/346/226/271/346/241/210.md +324 -0
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +24 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +413 -41
- package/src/components/xform/form-render/container-item/list-h5-item.vue +109 -38
- package/src/components/xform/styles/h5-designer.scss +13 -13
- package/src/components/xform/styles/h5-runtime.scss +520 -0
- package/src/components/xform/styles/h5.scss +5 -2
- package/src/layout/components/TagsView/index.vue +11 -10
- package/src/layout/components/TagsView/style.scss +92 -0
- package/src/styles/btn.scss +214 -3
- package/src/styles/dialog.scss +1710 -0
- package/src/styles/element-ui.scss +957 -36
- package/src/styles/index.scss +45 -0
- package/src/styles/layout-skins.scss +840 -0
- package/src/styles/mixin.scss +8 -0
- package/src/styles/page-shell.scss +622 -0
- package/src/styles/sidebar.scss +15 -0
- package/src/styles/utilities.scss +234 -118
- package/src/styles/variables.scss +28 -0
- package/src/views/user/home/wjl/content.vue +5 -0
- package/src/views/user/intf_permission/edit.vue +230 -0
- package/src/views/user/intf_permission/list.vue +196 -0
package/package.json
CHANGED
package/src/app-bootstrap.js
CHANGED
|
@@ -6,8 +6,8 @@ import store from "@base/store";
|
|
|
6
6
|
import router, { resetRouter } from "@base/router";
|
|
7
7
|
import settings from "@/settings";
|
|
8
8
|
import { setToken as setAuthToken } from "@base/utils/auth";
|
|
9
|
-
import { loadViewComponentAsync } from "@base/utils/resolveViewComponent";
|
|
10
|
-
import { installRuntimeRecovery } from "@base/utils/runtimeRecovery";
|
|
9
|
+
import { loadViewComponentAsync } from "@base/utils/resolveViewComponent";
|
|
10
|
+
import { installRuntimeRecovery } from "@base/utils/runtimeRecovery";
|
|
11
11
|
|
|
12
12
|
import "@base/permission"; // permission control
|
|
13
13
|
|
|
@@ -32,6 +32,7 @@ import "@base/components/xform/styles/containers.scss";
|
|
|
32
32
|
import "@base/components/xform/styles/skins.scss";
|
|
33
33
|
import "@base/components/xform/styles/detail-temp.scss";
|
|
34
34
|
import "@base/components/xform/styles/h5-designer.scss";
|
|
35
|
+
import "@base/components/xform/styles/h5-runtime.scss";
|
|
35
36
|
import "@base/components/hiprint/style.scss";
|
|
36
37
|
import "@base/components/wf/style.scss";
|
|
37
38
|
|
|
@@ -281,11 +282,11 @@ if (process.env.NODE_ENV === "production") {
|
|
|
281
282
|
mockXHR() */
|
|
282
283
|
}
|
|
283
284
|
|
|
284
|
-
Vue.use(Element, {
|
|
285
|
+
Vue.use(Element, {
|
|
285
286
|
size: Cookies.get("size") || "medium", // set element-ui default size
|
|
286
287
|
// locale: enLang // 如果使用中文,无需设置,请删除
|
|
287
|
-
});
|
|
288
|
-
installRuntimeRecovery();
|
|
288
|
+
});
|
|
289
|
+
installRuntimeRecovery();
|
|
289
290
|
|
|
290
291
|
// register global utility filters
|
|
291
292
|
Object.keys(filters).forEach((key) => {
|
|
@@ -56,7 +56,16 @@ export default {
|
|
|
56
56
|
downloadStatus: "", // 下载状态
|
|
57
57
|
};
|
|
58
58
|
},
|
|
59
|
+
beforeDestroy() {
|
|
60
|
+
this.revokeFileObjectUrl();
|
|
61
|
+
},
|
|
59
62
|
methods: {
|
|
63
|
+
revokeFileObjectUrl() {
|
|
64
|
+
const url = this.fileRaw?.showUrl;
|
|
65
|
+
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
66
|
+
URL.revokeObjectURL(url);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
60
69
|
clear() {
|
|
61
70
|
// this.$refs.uploadBtn.select();
|
|
62
71
|
// document.selection.clear();
|
|
@@ -64,6 +73,7 @@ export default {
|
|
|
64
73
|
// if (selection.rangeCount > 0) {
|
|
65
74
|
// selection.removeAllRanges(); // 清除所有选择范围
|
|
66
75
|
// }
|
|
76
|
+
this.revokeFileObjectUrl();
|
|
67
77
|
this.$nextTick(()=>{
|
|
68
78
|
this.fileRaw = false;
|
|
69
79
|
this.decodedText = null;
|
|
@@ -110,6 +120,7 @@ export default {
|
|
|
110
120
|
handleFileChange1(event) {
|
|
111
121
|
const file = event.target.files[0];
|
|
112
122
|
if (file) {
|
|
123
|
+
this.revokeFileObjectUrl();
|
|
113
124
|
this.fileRaw = this.createFile(file);
|
|
114
125
|
} else {
|
|
115
126
|
this.fileRaw = false;
|
|
@@ -3,6 +3,7 @@ import vue from "vue";
|
|
|
3
3
|
import objView from './index.vue';
|
|
4
4
|
import {openObsUploadDialog} from "@base/components/obsUpload/index.js"
|
|
5
5
|
import fileLibraryDialog from './fileLibraryDialog.vue'
|
|
6
|
+
import { loadIsPartUpload } from "./partUploadConfig.js";
|
|
6
7
|
|
|
7
8
|
let configUtil = {
|
|
8
9
|
vue,
|
|
@@ -16,6 +17,10 @@ const initInstance = (containter) => {
|
|
|
16
17
|
let currentInstance = new objInstance({i18n: window.$vueRoot._i18n});
|
|
17
18
|
let dom = currentInstance.$mount().$el;
|
|
18
19
|
containter.appendChild(dom);
|
|
20
|
+
currentInstance.$destroyOnDialogClose = () => {
|
|
21
|
+
if (!currentInstance._isDestroyed) currentInstance.$destroy();
|
|
22
|
+
if (dom.parentNode) dom.parentNode.removeChild(dom);
|
|
23
|
+
};
|
|
19
24
|
return currentInstance;
|
|
20
25
|
};
|
|
21
26
|
const initFileLibraryDialogInstance = (containter, options = {}) => {
|
|
@@ -37,10 +42,12 @@ function toDo(options) {
|
|
|
37
42
|
if(model==="obs"){
|
|
38
43
|
return openObsUploadDialog(options);
|
|
39
44
|
}else{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
return loadIsPartUpload().then(() => {
|
|
46
|
+
let containter = document.body;
|
|
47
|
+
let currentInstance = initInstance(containter);
|
|
48
|
+
Object.assign(currentInstance, options);
|
|
49
|
+
return currentInstance.handleShow(options);
|
|
50
|
+
});
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
};
|
|
@@ -946,6 +946,7 @@ modules = {
|
|
|
946
946
|
a.download = fileName;
|
|
947
947
|
a.href = blobUrl;
|
|
948
948
|
a.click();
|
|
949
|
+
setTimeout(() => window.URL.revokeObjectURL(blobUrl), 0);
|
|
949
950
|
},
|
|
950
951
|
});
|
|
951
952
|
},
|
|
@@ -968,6 +969,7 @@ modules = {
|
|
|
968
969
|
a.download = row.fileName;
|
|
969
970
|
a.href = blobUrl;
|
|
970
971
|
a.click();
|
|
972
|
+
setTimeout(() => window.URL.revokeObjectURL(blobUrl), 0);
|
|
971
973
|
},
|
|
972
974
|
});
|
|
973
975
|
},
|
|
@@ -3,11 +3,15 @@ let tmixins, tViewMixins, pmixins;
|
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import SparkMD5 from "spark-md5";
|
|
5
5
|
import settingConfig from "@/settings.js";
|
|
6
|
-
import {
|
|
7
|
-
registerPreviewInstance,
|
|
8
|
-
unregisterPreviewInstance,
|
|
9
|
-
collectPreviewList,
|
|
10
|
-
} from "./previewGroup.js";
|
|
6
|
+
import {
|
|
7
|
+
registerPreviewInstance,
|
|
8
|
+
unregisterPreviewInstance,
|
|
9
|
+
collectPreviewList,
|
|
10
|
+
} from "./previewGroup.js";
|
|
11
|
+
import {
|
|
12
|
+
pickExplicitIsPartUpload,
|
|
13
|
+
resolveIsPartUpload,
|
|
14
|
+
} from "./partUploadConfig.js";
|
|
11
15
|
|
|
12
16
|
let imFun = {
|
|
13
17
|
axios,
|
|
@@ -68,11 +72,9 @@ tmixins = {
|
|
|
68
72
|
type: Number,
|
|
69
73
|
default: 5, //5MB
|
|
70
74
|
},
|
|
71
|
-
isPartUpload: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default:
|
|
74
|
-
return settingConfig.isPartUpload ?? true;
|
|
75
|
-
},
|
|
75
|
+
isPartUpload: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: undefined,
|
|
76
78
|
},
|
|
77
79
|
autoConfirmAfterUpload: {
|
|
78
80
|
type: Boolean,
|
|
@@ -125,8 +127,9 @@ tmixins = {
|
|
|
125
127
|
uploadUrl: null,
|
|
126
128
|
};
|
|
127
129
|
},
|
|
128
|
-
beforeDestroy() {
|
|
129
|
-
this.removePasteEvent();
|
|
130
|
+
beforeDestroy() {
|
|
131
|
+
this.removePasteEvent();
|
|
132
|
+
this.revokeUploadObjectUrls();
|
|
130
133
|
},
|
|
131
134
|
filters: {
|
|
132
135
|
btnText(btn) {
|
|
@@ -420,8 +423,8 @@ tmixins = {
|
|
|
420
423
|
blurPasteEvent() {
|
|
421
424
|
this.pasteAreaStatus = false;
|
|
422
425
|
},
|
|
423
|
-
handleClose() {
|
|
424
|
-
let target = this.$refs.upload;
|
|
426
|
+
handleClose() {
|
|
427
|
+
let target = this.$refs.upload;
|
|
425
428
|
(target.uploadFiles || []).forEach((uploadFile) => {
|
|
426
429
|
if (uploadFile.status == "uploading" || uploadFile.status == "ready") {
|
|
427
430
|
uploadFile.raw.abort &&
|
|
@@ -429,10 +432,15 @@ tmixins = {
|
|
|
429
432
|
this.$t2("取消上传", "components.VabUpload.cancelUpload")
|
|
430
433
|
);
|
|
431
434
|
}
|
|
432
|
-
});
|
|
433
|
-
this.
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
435
|
+
});
|
|
436
|
+
this.revokeUploadObjectUrls();
|
|
437
|
+
this.pasteList = [];
|
|
438
|
+
this.removePasteEvent();
|
|
439
|
+
this.picture = "picture";
|
|
440
|
+
this.clearFileInfo();
|
|
441
|
+
this.dialogFormVisible = false;
|
|
442
|
+
const destroyRoot = this.$destroyOnDialogClose;
|
|
443
|
+
if (destroyRoot) this.$nextTick(destroyRoot);
|
|
436
444
|
},
|
|
437
445
|
clearFileInfo() {
|
|
438
446
|
this.fileList = [];
|
|
@@ -708,7 +716,11 @@ tmixins = {
|
|
|
708
716
|
if (!target) return;
|
|
709
717
|
let fileObj = target.getFile(file);
|
|
710
718
|
if (fileObj.status != "preUpload") return;
|
|
711
|
-
if (
|
|
719
|
+
if (
|
|
720
|
+
!resolveIsPartUpload(
|
|
721
|
+
pickExplicitIsPartUpload(this.option, this.isPartUpload)
|
|
722
|
+
)
|
|
723
|
+
) {
|
|
712
724
|
this.uploadSectionFile(fileObj.param);
|
|
713
725
|
return;
|
|
714
726
|
}
|
|
@@ -744,10 +756,9 @@ tmixins = {
|
|
|
744
756
|
|
|
745
757
|
suffix = nameSplit && nameSplit.length > 1 ? nameSplit[1] : "";
|
|
746
758
|
|
|
747
|
-
let checkUrl = this.uploadUrl
|
|
748
|
-
"/docfile/upload",
|
|
749
|
-
"/
|
|
750
|
-
);
|
|
759
|
+
let checkUrl = this.uploadUrl
|
|
760
|
+
.replace("/docfile/upload", "/docfile/check")
|
|
761
|
+
.replace("/bdfile/upload", "/bdfile/check");
|
|
751
762
|
let checkData = {
|
|
752
763
|
name: file.name,
|
|
753
764
|
md5: hash,
|
|
@@ -911,10 +922,9 @@ tmixins = {
|
|
|
911
922
|
let mergeData = param.mergeData;
|
|
912
923
|
let chunkParam = param.chunkParam;
|
|
913
924
|
let fullFile = chunkParam.fullFile;
|
|
914
|
-
let mergeUrl = this.uploadUrl
|
|
915
|
-
"/docfile/upload",
|
|
916
|
-
"/
|
|
917
|
-
);
|
|
925
|
+
let mergeUrl = this.uploadUrl
|
|
926
|
+
.replace("/docfile/upload", "/docfile/merge")
|
|
927
|
+
.replace("/bdfile/upload", "/bdfile/merge");
|
|
918
928
|
let target = this.$refs.upload;
|
|
919
929
|
this.$http({
|
|
920
930
|
url: mergeUrl,
|
|
@@ -984,15 +994,33 @@ tmixins = {
|
|
|
984
994
|
}
|
|
985
995
|
},
|
|
986
996
|
//end
|
|
987
|
-
getShowImage(file, fileName) {
|
|
997
|
+
getShowImage(file, fileName) {
|
|
988
998
|
fileName = fileName || file.name;
|
|
989
999
|
if (this.$commonFileUtil.isPictureFile(fileName)) {
|
|
990
1000
|
return file.showUrl || file.url;
|
|
991
1001
|
} else {
|
|
992
1002
|
return this.$commonFileUtil.getFileIconRequire(fileName);
|
|
993
1003
|
}
|
|
994
|
-
},
|
|
995
|
-
|
|
1004
|
+
},
|
|
1005
|
+
revokeUploadObjectUrl(url) {
|
|
1006
|
+
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
1007
|
+
URL.revokeObjectURL(url);
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
revokeUploadObjectUrls() {
|
|
1011
|
+
const files = [
|
|
1012
|
+
...(this.fileList || []),
|
|
1013
|
+
...(this.pasteList || []),
|
|
1014
|
+
...(this.$refs.upload?.uploadFiles || []),
|
|
1015
|
+
];
|
|
1016
|
+
const urls = new Set();
|
|
1017
|
+
files.forEach((file) => {
|
|
1018
|
+
if (file?.showUrl) urls.add(file.showUrl);
|
|
1019
|
+
if (file?.url) urls.add(file.url);
|
|
1020
|
+
});
|
|
1021
|
+
urls.forEach((url) => this.revokeUploadObjectUrl(url));
|
|
1022
|
+
},
|
|
1023
|
+
removeFile(sfile) {
|
|
996
1024
|
var target = this.$refs.upload;
|
|
997
1025
|
var index;
|
|
998
1026
|
var fileList = target.uploadFiles;
|
|
@@ -1012,7 +1040,8 @@ tmixins = {
|
|
|
1012
1040
|
}
|
|
1013
1041
|
}
|
|
1014
1042
|
|
|
1015
|
-
|
|
1043
|
+
this.revokeUploadObjectUrl(sfile?.showUrl || sfile?.url);
|
|
1044
|
+
target.uploadFiles.splice(index, 1);
|
|
1016
1045
|
this.handleChange(sfile, target.uploadFiles);
|
|
1017
1046
|
},
|
|
1018
1047
|
submitImage() {
|
|
@@ -1304,8 +1333,10 @@ tmixins = {
|
|
|
1304
1333
|
}
|
|
1305
1334
|
this.appendPasteFiles(files);
|
|
1306
1335
|
},
|
|
1307
|
-
deletePasteFile(index) {
|
|
1308
|
-
this.pasteList
|
|
1336
|
+
deletePasteFile(index) {
|
|
1337
|
+
const file = this.pasteList[index];
|
|
1338
|
+
this.revokeUploadObjectUrl(file?.showUrl || file?.url);
|
|
1339
|
+
this.pasteList.splice(index, 1);
|
|
1309
1340
|
},
|
|
1310
1341
|
confirmPasteFile() {
|
|
1311
1342
|
let target = this.$refs.upload;
|
|
@@ -1317,7 +1348,10 @@ tmixins = {
|
|
|
1317
1348
|
fileRaw.fileName = name;
|
|
1318
1349
|
return fileRaw;
|
|
1319
1350
|
});
|
|
1320
|
-
innerTarget.uploadFiles(files);
|
|
1351
|
+
innerTarget.uploadFiles(files);
|
|
1352
|
+
this.pasteList.forEach((file) =>
|
|
1353
|
+
this.revokeUploadObjectUrl(file?.showUrl || file?.url)
|
|
1354
|
+
);
|
|
1321
1355
|
this.$nextTick(() => {
|
|
1322
1356
|
target.uploadFiles.forEach((uploadFile) => {
|
|
1323
1357
|
let fileRaw = uploadFile.raw;
|
|
@@ -1327,7 +1361,7 @@ tmixins = {
|
|
|
1327
1361
|
}
|
|
1328
1362
|
});
|
|
1329
1363
|
});
|
|
1330
|
-
this.pasteList = [];
|
|
1364
|
+
this.pasteList = [];
|
|
1331
1365
|
},
|
|
1332
1366
|
changeFileName(file) {
|
|
1333
1367
|
if (file.fileSuffix) {
|
|
@@ -1431,11 +1465,9 @@ tViewMixins = {
|
|
|
1431
1465
|
type: Number,
|
|
1432
1466
|
default: 5, //5MB
|
|
1433
1467
|
},
|
|
1434
|
-
isPartUpload: {
|
|
1435
|
-
type: Boolean,
|
|
1436
|
-
default:
|
|
1437
|
-
return settingConfig.isPartUpload ?? true;
|
|
1438
|
-
},
|
|
1468
|
+
isPartUpload: {
|
|
1469
|
+
type: Boolean,
|
|
1470
|
+
default: undefined,
|
|
1439
1471
|
},
|
|
1440
1472
|
autoConfirmAfterPasteUpload: {
|
|
1441
1473
|
type: Boolean,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { getLogicParamValue } from "@base/api/user";
|
|
2
|
+
import settingConfig from "@/settings.js";
|
|
3
|
+
|
|
4
|
+
export const PART_UPLOAD_PARAM_CODE = "isPartUpload";
|
|
5
|
+
|
|
6
|
+
let cachedCompanyCode = null;
|
|
7
|
+
let cachedValue;
|
|
8
|
+
let cacheReady = false;
|
|
9
|
+
let inflight = null;
|
|
10
|
+
let requestId = 0;
|
|
11
|
+
|
|
12
|
+
function getCurrentCompanyCode() {
|
|
13
|
+
return window.$vueRoot?.$store?.getters?.companyCode ?? "";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function parseIsPartUpload(rawValue) {
|
|
17
|
+
if (typeof rawValue === "boolean") return rawValue;
|
|
18
|
+
if (rawValue == null) return undefined;
|
|
19
|
+
const value = String(rawValue).trim().toLowerCase();
|
|
20
|
+
if (value === "true" || value === "1") return true;
|
|
21
|
+
if (value === "false" || value === "0") return false;
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function readLogicParam() {
|
|
26
|
+
return getLogicParamValue({
|
|
27
|
+
data: { paramCode: PART_UPLOAD_PARAM_CODE },
|
|
28
|
+
modal: false,
|
|
29
|
+
failMsg: false,
|
|
30
|
+
errorMsg: false,
|
|
31
|
+
})
|
|
32
|
+
.then((res) => (res && res.type === "success" ? res.objx : ""))
|
|
33
|
+
.catch(() => "");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 同公司复用查询结果;切换公司后首次打开上传弹窗时重新获取。
|
|
37
|
+
export function loadIsPartUpload() {
|
|
38
|
+
const companyCode = getCurrentCompanyCode();
|
|
39
|
+
if (cacheReady && cachedCompanyCode === companyCode) {
|
|
40
|
+
return Promise.resolve(cachedValue);
|
|
41
|
+
}
|
|
42
|
+
if (inflight && cachedCompanyCode === companyCode) {
|
|
43
|
+
return inflight;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const id = ++requestId;
|
|
47
|
+
cachedCompanyCode = companyCode;
|
|
48
|
+
cacheReady = false;
|
|
49
|
+
inflight = readLogicParam()
|
|
50
|
+
.then((raw) => {
|
|
51
|
+
if (id !== requestId) return loadIsPartUpload();
|
|
52
|
+
cachedValue = parseIsPartUpload(raw);
|
|
53
|
+
cacheReady = true;
|
|
54
|
+
inflight = null;
|
|
55
|
+
return cachedValue;
|
|
56
|
+
})
|
|
57
|
+
.catch(() => {
|
|
58
|
+
if (id !== requestId) return loadIsPartUpload();
|
|
59
|
+
cachedValue = undefined;
|
|
60
|
+
cacheReady = true;
|
|
61
|
+
inflight = null;
|
|
62
|
+
return cachedValue;
|
|
63
|
+
});
|
|
64
|
+
return inflight;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getCachedIsPartUpload() {
|
|
68
|
+
const companyCode = getCurrentCompanyCode();
|
|
69
|
+
if (cacheReady && cachedCompanyCode === companyCode) {
|
|
70
|
+
return cachedValue;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function pickExplicitIsPartUpload(option, instanceValue) {
|
|
76
|
+
if (option && typeof option.isPartUpload === "boolean") {
|
|
77
|
+
return option.isPartUpload;
|
|
78
|
+
}
|
|
79
|
+
if (typeof instanceValue === "boolean") {
|
|
80
|
+
return instanceValue;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 显式传入 > 已缓存逻辑参数 > settings.js > 默认分片。
|
|
86
|
+
export function resolveIsPartUpload(explicitValue) {
|
|
87
|
+
if (typeof explicitValue === "boolean") return explicitValue;
|
|
88
|
+
|
|
89
|
+
const cached = getCachedIsPartUpload();
|
|
90
|
+
if (typeof cached === "boolean") return cached;
|
|
91
|
+
if (typeof settingConfig.isPartUpload === "boolean") {
|
|
92
|
+
return settingConfig.isPartUpload;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
@@ -908,6 +908,7 @@ modules = {
|
|
|
908
908
|
a.download = fileName;
|
|
909
909
|
a.href = blobUrl;
|
|
910
910
|
a.click();
|
|
911
|
+
setTimeout(() => window.URL.revokeObjectURL(blobUrl), 0);
|
|
911
912
|
},
|
|
912
913
|
});
|
|
913
914
|
},
|
|
@@ -930,6 +931,7 @@ modules = {
|
|
|
930
931
|
a.download = row.fileName;
|
|
931
932
|
a.href = blobUrl;
|
|
932
933
|
a.click();
|
|
934
|
+
setTimeout(() => window.URL.revokeObjectURL(blobUrl), 0);
|
|
933
935
|
},
|
|
934
936
|
});
|
|
935
937
|
},
|
|
@@ -1418,6 +1418,7 @@ modules = {
|
|
|
1418
1418
|
a.download = fileName;
|
|
1419
1419
|
a.href = blobUrl;
|
|
1420
1420
|
a.click();
|
|
1421
|
+
setTimeout(() => window.URL.revokeObjectURL(blobUrl), 0);
|
|
1421
1422
|
},
|
|
1422
1423
|
});
|
|
1423
1424
|
},
|
|
@@ -1440,6 +1441,7 @@ modules = {
|
|
|
1440
1441
|
a.download = row.fileName;
|
|
1441
1442
|
a.href = blobUrl;
|
|
1442
1443
|
a.click();
|
|
1444
|
+
setTimeout(() => window.URL.revokeObjectURL(blobUrl), 0);
|
|
1443
1445
|
},
|
|
1444
1446
|
});
|
|
1445
1447
|
},
|
|
@@ -108,6 +108,8 @@ modules = {
|
|
|
108
108
|
openUrl(file_data) {
|
|
109
109
|
let url = this.base64ToUrl(file_data, "image/png");
|
|
110
110
|
window.open(url);
|
|
111
|
+
// 新窗口完成 Blob URL 读取后释放;立即 revoke 可能让预览页尚未加载就失效。
|
|
112
|
+
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
|
111
113
|
},
|
|
112
114
|
base64ToUrl(base64String, fileType) {
|
|
113
115
|
// 将Base64字符串解码为二进制数据
|
|
@@ -13,6 +13,10 @@ const initInstance = (containter) => {
|
|
|
13
13
|
let currentInstance = new objInstance({i18n: window.$vueRoot._i18n});
|
|
14
14
|
let dom = currentInstance.$mount().$el;
|
|
15
15
|
containter.appendChild(dom);
|
|
16
|
+
currentInstance.$destroyOnDialogClose = () => {
|
|
17
|
+
if (!currentInstance._isDestroyed) currentInstance.$destroy();
|
|
18
|
+
if (dom.parentNode) dom.parentNode.removeChild(dom);
|
|
19
|
+
};
|
|
16
20
|
return currentInstance;
|
|
17
21
|
};
|
|
18
22
|
|
|
@@ -31,4 +35,3 @@ export function uploadOBS(options) {
|
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
|
|
@@ -109,8 +109,9 @@ tmixins = {
|
|
|
109
109
|
Bucket: "gztw-file01", // 你的桶名
|
|
110
110
|
};
|
|
111
111
|
},
|
|
112
|
-
beforeDestroy() {
|
|
113
|
-
this.removePasteEvent();
|
|
112
|
+
beforeDestroy() {
|
|
113
|
+
this.removePasteEvent();
|
|
114
|
+
this.revokeUploadObjectUrls();
|
|
114
115
|
},
|
|
115
116
|
filters: {
|
|
116
117
|
btnText(btn) {
|
|
@@ -349,7 +350,7 @@ tmixins = {
|
|
|
349
350
|
blurPasteEvent() {
|
|
350
351
|
this.pasteAreaStatus = false;
|
|
351
352
|
},
|
|
352
|
-
handleClose() {
|
|
353
|
+
handleClose() {
|
|
353
354
|
let target = this.$refs.upload;
|
|
354
355
|
(target.uploadFiles || []).forEach((uploadFile) => {
|
|
355
356
|
if (uploadFile.status == "uploading" || uploadFile.status == "ready") {
|
|
@@ -358,10 +359,15 @@ tmixins = {
|
|
|
358
359
|
this.$t2("取消上传", "components.VabUpload.cancelUpload")
|
|
359
360
|
);
|
|
360
361
|
}
|
|
361
|
-
});
|
|
362
|
-
this.
|
|
363
|
-
this.
|
|
364
|
-
this.
|
|
362
|
+
});
|
|
363
|
+
this.revokeUploadObjectUrls();
|
|
364
|
+
this.pasteList = [];
|
|
365
|
+
this.removePasteEvent();
|
|
366
|
+
this.picture = "picture";
|
|
367
|
+
this.clearFileInfo();
|
|
368
|
+
this.dialogFormVisible = false;
|
|
369
|
+
const destroyRoot = this.$destroyOnDialogClose;
|
|
370
|
+
if (destroyRoot) this.$nextTick(destroyRoot);
|
|
365
371
|
},
|
|
366
372
|
clearFileInfo() {
|
|
367
373
|
this.fileList = [];
|
|
@@ -1204,15 +1210,33 @@ tmixins = {
|
|
|
1204
1210
|
}
|
|
1205
1211
|
},
|
|
1206
1212
|
//end
|
|
1207
|
-
getShowImage(file, fileName) {
|
|
1213
|
+
getShowImage(file, fileName) {
|
|
1208
1214
|
fileName = fileName || file.name;
|
|
1209
1215
|
if (this.$commonFileUtil.isPictureFile(fileName)) {
|
|
1210
1216
|
return file.showUrl || file.url;
|
|
1211
1217
|
} else {
|
|
1212
1218
|
return this.$commonFileUtil.getFileIconRequire(fileName);
|
|
1213
1219
|
}
|
|
1214
|
-
},
|
|
1215
|
-
|
|
1220
|
+
},
|
|
1221
|
+
revokeUploadObjectUrl(url) {
|
|
1222
|
+
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
1223
|
+
URL.revokeObjectURL(url);
|
|
1224
|
+
}
|
|
1225
|
+
},
|
|
1226
|
+
revokeUploadObjectUrls() {
|
|
1227
|
+
const files = [
|
|
1228
|
+
...(this.fileList || []),
|
|
1229
|
+
...(this.pasteList || []),
|
|
1230
|
+
...(this.$refs.upload?.uploadFiles || []),
|
|
1231
|
+
];
|
|
1232
|
+
const urls = new Set();
|
|
1233
|
+
files.forEach((file) => {
|
|
1234
|
+
if (file?.showUrl) urls.add(file.showUrl);
|
|
1235
|
+
if (file?.url) urls.add(file.url);
|
|
1236
|
+
});
|
|
1237
|
+
urls.forEach((url) => this.revokeUploadObjectUrl(url));
|
|
1238
|
+
},
|
|
1239
|
+
removeFile(sfile) {
|
|
1216
1240
|
var target = this.$refs.upload;
|
|
1217
1241
|
var index;
|
|
1218
1242
|
var fileList = target.uploadFiles;
|
|
@@ -1233,7 +1257,8 @@ tmixins = {
|
|
|
1233
1257
|
}
|
|
1234
1258
|
}
|
|
1235
1259
|
|
|
1236
|
-
|
|
1260
|
+
this.revokeUploadObjectUrl(sfile?.showUrl || sfile?.url);
|
|
1261
|
+
target.uploadFiles.splice(index, 1);
|
|
1237
1262
|
this.handleChange(sfile, target.uploadFiles);
|
|
1238
1263
|
},
|
|
1239
1264
|
submitImage() {
|
|
@@ -1443,8 +1468,10 @@ tmixins = {
|
|
|
1443
1468
|
this.pasteList.push(...fileList);
|
|
1444
1469
|
}
|
|
1445
1470
|
},
|
|
1446
|
-
deletePasteFile(index) {
|
|
1447
|
-
this.pasteList
|
|
1471
|
+
deletePasteFile(index) {
|
|
1472
|
+
const file = this.pasteList[index];
|
|
1473
|
+
this.revokeUploadObjectUrl(file?.showUrl || file?.url);
|
|
1474
|
+
this.pasteList.splice(index, 1);
|
|
1448
1475
|
},
|
|
1449
1476
|
confirmPasteFile() {
|
|
1450
1477
|
let target = this.$refs.upload;
|
|
@@ -1456,7 +1483,10 @@ tmixins = {
|
|
|
1456
1483
|
fileRaw.fileName = name;
|
|
1457
1484
|
return fileRaw;
|
|
1458
1485
|
});
|
|
1459
|
-
innerTarget.uploadFiles(files);
|
|
1486
|
+
innerTarget.uploadFiles(files);
|
|
1487
|
+
this.pasteList.forEach((file) =>
|
|
1488
|
+
this.revokeUploadObjectUrl(file?.showUrl || file?.url)
|
|
1489
|
+
);
|
|
1460
1490
|
this.$nextTick(() => {
|
|
1461
1491
|
target.uploadFiles.forEach((uploadFile) => {
|
|
1462
1492
|
let fileRaw = uploadFile.raw;
|
|
@@ -1466,7 +1496,7 @@ tmixins = {
|
|
|
1466
1496
|
}
|
|
1467
1497
|
});
|
|
1468
1498
|
});
|
|
1469
|
-
this.pasteList = [];
|
|
1499
|
+
this.pasteList = [];
|
|
1470
1500
|
},
|
|
1471
1501
|
changeFileName(file) {
|
|
1472
1502
|
if (file.fileSuffix) {
|
|
@@ -92,6 +92,12 @@ tmixins = {
|
|
|
92
92
|
},
|
|
93
93
|
beforeDestroy() {
|
|
94
94
|
this.clearTimerHandle();
|
|
95
|
+
(this.files || []).forEach((file) => {
|
|
96
|
+
const url = file?.showUrl || file?.url;
|
|
97
|
+
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
98
|
+
URL.revokeObjectURL(url);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
95
101
|
},
|
|
96
102
|
methods: {
|
|
97
103
|
bindMove(e) {
|
|
@@ -678,6 +684,11 @@ tmixins = {
|
|
|
678
684
|
})
|
|
679
685
|
},
|
|
680
686
|
deleteFile(index) {
|
|
687
|
+
const file = this.files[index];
|
|
688
|
+
const url = file?.showUrl || file?.url;
|
|
689
|
+
if (typeof url === "string" && url.startsWith("blob:")) {
|
|
690
|
+
URL.revokeObjectURL(url);
|
|
691
|
+
}
|
|
681
692
|
this.files.splice(index, 1);
|
|
682
693
|
},
|
|
683
694
|
confirmPrivateProfileDialog(rows) {
|