cloud-web-corejs 1.0.54-dev.685 → 1.0.54-dev.686
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/api/user.js +15 -2
- package/src/components/VabUpload/fileLibraryDialog.vue +296 -0
- package/src/components/VabUpload/index.js +22 -2
- package/src/components/VabUpload/index.vue +9 -1
- package/src/components/VabUpload/mixins/fileLibraryDialog.js +1112 -0
- package/src/components/VabUpload/mixins.js +106 -47
- package/src/components/xform/form-designer/designer.js +7 -0
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +601 -0
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +9 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +306 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +18 -0
- package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +285 -0
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +322 -0
- package/src/components/xform/form-render/container-item/table-item.vue +3 -5
- package/src/components/xform/form-render/formDynamicFieldMixin.js +131 -0
- package/src/components/xform/form-render/index.vue +2 -1
- package/src/components/xform/mixins/defaultHandle.js +33 -0
- package/src/components/xform/utils/util.js +7 -0
|
@@ -65,9 +65,13 @@ tmixins = {
|
|
|
65
65
|
type: Boolean,
|
|
66
66
|
default: false,
|
|
67
67
|
},
|
|
68
|
+
showFileLibraryButton: Boolean,
|
|
69
|
+
storeAreaPrefix: String,
|
|
70
|
+
storeAreaCode: String,
|
|
68
71
|
},
|
|
69
72
|
data() {
|
|
70
73
|
return {
|
|
74
|
+
fileLibraryName: null,
|
|
71
75
|
show: false,
|
|
72
76
|
loading: false,
|
|
73
77
|
dialogVisible: false,
|
|
@@ -145,6 +149,32 @@ tmixins = {
|
|
|
145
149
|
},
|
|
146
150
|
},
|
|
147
151
|
methods: {
|
|
152
|
+
openFileLibraryDialog() {
|
|
153
|
+
this.$openFileLibraryDialog({
|
|
154
|
+
prefix: this.storeAreaPrefix,
|
|
155
|
+
storeAreaCode: this.storeAreaCode,
|
|
156
|
+
callback: ({ rows, fileRows }) => {
|
|
157
|
+
this.addFileLibraryFiles(rows);
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
initFileLibraryTitle() {
|
|
162
|
+
this.fileLibraryName = null;
|
|
163
|
+
this.$http({
|
|
164
|
+
method: "post",
|
|
165
|
+
url: USER_PREFIX + "/file_store_area/getByCode",
|
|
166
|
+
data: {
|
|
167
|
+
stringOne: this.storeAreaCode,
|
|
168
|
+
},
|
|
169
|
+
isLoading: true,
|
|
170
|
+
success: (res) => {
|
|
171
|
+
let fileStoreArea = res.objx;
|
|
172
|
+
if (fileStoreArea) {
|
|
173
|
+
this.fileLibraryName = fileStoreArea.storeAreaName;
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
},
|
|
148
178
|
updateUploadingStatus() {
|
|
149
179
|
var target = this.$refs.upload;
|
|
150
180
|
let uploading, hasReadyFile;
|
|
@@ -224,8 +254,8 @@ tmixins = {
|
|
|
224
254
|
if (fileList.length === this.imgNum) {
|
|
225
255
|
this.fileList = fileList;
|
|
226
256
|
|
|
227
|
-
|
|
228
|
-
|
|
257
|
+
// 添加自动确认功能
|
|
258
|
+
// 当所有文件上传完成且 autoConfirmAfterUpload 为 true 时,自动调用 submitImage 方法
|
|
229
259
|
if (this.autoConfirmAfterUpload) {
|
|
230
260
|
// 使用 nextTick 确保所有文件状态已更新
|
|
231
261
|
this.$nextTick(() => {
|
|
@@ -233,7 +263,6 @@ tmixins = {
|
|
|
233
263
|
});
|
|
234
264
|
return; // 自动确认后直接返回,不执行后续的 setTimeout
|
|
235
265
|
}
|
|
236
|
-
|
|
237
266
|
}
|
|
238
267
|
|
|
239
268
|
setTimeout(() => {
|
|
@@ -286,15 +315,16 @@ tmixins = {
|
|
|
286
315
|
|
|
287
316
|
this.removePasteEvent();
|
|
288
317
|
this.addPasteEvent();
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
318
|
+
this.initFileLibraryTitle();
|
|
319
|
+
if (!option.files?.length) {
|
|
320
|
+
this.initUploadUrl();
|
|
321
|
+
} else {
|
|
322
|
+
this.initUploadUrl(() => {
|
|
323
|
+
this.handleUpload(option.files);
|
|
294
324
|
});
|
|
295
325
|
}
|
|
296
326
|
},
|
|
297
|
-
handleUpload(fileRawList){
|
|
327
|
+
handleUpload(fileRawList) {
|
|
298
328
|
let target = this.$refs.upload;
|
|
299
329
|
let innerTarget = target.$refs["upload-inner"];
|
|
300
330
|
if (fileRawList.length) {
|
|
@@ -500,19 +530,19 @@ tmixins = {
|
|
|
500
530
|
// resolve(ev.target.result);
|
|
501
531
|
};
|
|
502
532
|
},
|
|
503
|
-
getFileMd5(file, callback){
|
|
533
|
+
getFileMd5(file, callback) {
|
|
504
534
|
// 判断是否为大文件(例如大于10MB)
|
|
505
535
|
const isLargeFile = file.size > 20 * 1024 * 1024;
|
|
506
536
|
|
|
507
537
|
if (!isLargeFile) {
|
|
508
|
-
this.fileParse(file,"buffer", (buffer)=>{
|
|
538
|
+
this.fileParse(file, "buffer", (buffer) => {
|
|
509
539
|
let spark = new imFun.SparkMD5.ArrayBuffer();
|
|
510
540
|
spark.append(buffer);
|
|
511
541
|
let hash = spark.end();
|
|
512
|
-
callback(hash)
|
|
513
|
-
})
|
|
514
|
-
}else{
|
|
515
|
-
this.calculateFileMD5(file, callback)
|
|
542
|
+
callback(hash);
|
|
543
|
+
});
|
|
544
|
+
} else {
|
|
545
|
+
this.calculateFileMD5(file, callback);
|
|
516
546
|
}
|
|
517
547
|
},
|
|
518
548
|
calculateFileMD5(file, callback) {
|
|
@@ -523,15 +553,15 @@ tmixins = {
|
|
|
523
553
|
const fileReader = new FileReader();
|
|
524
554
|
|
|
525
555
|
// 处理读取错误
|
|
526
|
-
fileReader.onerror = function() {
|
|
527
|
-
console.error(
|
|
556
|
+
fileReader.onerror = function () {
|
|
557
|
+
console.error("文件读取错误");
|
|
528
558
|
callback(null);
|
|
529
559
|
};
|
|
530
560
|
|
|
531
561
|
// 处理进度回调(可选)
|
|
532
562
|
const onProgress = (progress) => {
|
|
533
563
|
// 可以在这里更新进度条
|
|
534
|
-
console.log(
|
|
564
|
+
console.log("MD5计算进度: " + Math.round(progress * 100) + "%");
|
|
535
565
|
};
|
|
536
566
|
|
|
537
567
|
// 递归读取下一块
|
|
@@ -543,7 +573,7 @@ tmixins = {
|
|
|
543
573
|
};
|
|
544
574
|
|
|
545
575
|
// 每块读取完成后的处理
|
|
546
|
-
fileReader.onload = function(e) {
|
|
576
|
+
fileReader.onload = function (e) {
|
|
547
577
|
spark.append(e.target.result);
|
|
548
578
|
currentChunk++;
|
|
549
579
|
|
|
@@ -621,7 +651,7 @@ tmixins = {
|
|
|
621
651
|
// HASH_2.mp4
|
|
622
652
|
// ...
|
|
623
653
|
|
|
624
|
-
this.getFileMd5(file,
|
|
654
|
+
this.getFileMd5(file, (md5) => {
|
|
625
655
|
/* let spark = new imFun.SparkMD5.ArrayBuffer(),
|
|
626
656
|
chunkSize = this.chunkSize * 1024 * 1024, // Read in chunks of 2MB
|
|
627
657
|
chunks = Math.ceil(file.size / chunkSize),
|
|
@@ -631,9 +661,9 @@ tmixins = {
|
|
|
631
661
|
hash = spark.end(); */
|
|
632
662
|
|
|
633
663
|
let chunkSize = this.chunkSize * 1024 * 1024, // Read in chunks of 2MB
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
664
|
+
chunks = Math.ceil(file.size / chunkSize),
|
|
665
|
+
hash = md5,
|
|
666
|
+
suffix;
|
|
637
667
|
|
|
638
668
|
let nameSplit = /\.([0-9a-zA-Z]+)$/i.exec(file.name);
|
|
639
669
|
|
|
@@ -989,7 +1019,7 @@ tmixins = {
|
|
|
989
1019
|
}
|
|
990
1020
|
return showUrl;
|
|
991
1021
|
},
|
|
992
|
-
|
|
1022
|
+
addFileLibraryFiles(rows) {
|
|
993
1023
|
var target = this.$refs.upload;
|
|
994
1024
|
let uploadFiles = target.uploadFiles;
|
|
995
1025
|
let sourceSns = uploadFiles
|
|
@@ -1033,6 +1063,12 @@ tmixins = {
|
|
|
1033
1063
|
medium: row.medium,
|
|
1034
1064
|
url: row.url,
|
|
1035
1065
|
sourceSn: row.sn,
|
|
1066
|
+
|
|
1067
|
+
attachCode: row.attachCode,
|
|
1068
|
+
docCategory: row.docCategory,
|
|
1069
|
+
drawingCode: row.drawingCode,
|
|
1070
|
+
version: row.version,
|
|
1071
|
+
rev: row.rev,
|
|
1036
1072
|
},
|
|
1037
1073
|
content: "success",
|
|
1038
1074
|
rmid: null,
|
|
@@ -1045,7 +1081,7 @@ tmixins = {
|
|
|
1045
1081
|
uploadFiles.push(...newFiles);
|
|
1046
1082
|
},
|
|
1047
1083
|
confirmPrivateProfileDialog(rows) {
|
|
1048
|
-
this.
|
|
1084
|
+
this.addFileLibraryFiles(rows);
|
|
1049
1085
|
},
|
|
1050
1086
|
initPrivateUploadBt() {
|
|
1051
1087
|
if (settingConfig.privateProfileCode && this.pickPrivateProfile) {
|
|
@@ -1074,14 +1110,16 @@ tmixins = {
|
|
|
1074
1110
|
let value = !res.objx || !res.objx.value ? "2" : res.objx.value;
|
|
1075
1111
|
if (value == "0") {
|
|
1076
1112
|
//启用本地上传,个人文档上传
|
|
1077
|
-
this.showLocalUploadBtn
|
|
1113
|
+
if (this.option.showLocalUploadBtn !== false)
|
|
1114
|
+
this.showLocalUploadBtn = true;
|
|
1078
1115
|
this.initPrivateUploadBt();
|
|
1079
1116
|
} else if (value == "1") {
|
|
1080
1117
|
//启用个人文档上传
|
|
1081
1118
|
this.initPrivateUploadBt();
|
|
1082
1119
|
} else if (value == "2") {
|
|
1083
1120
|
//启用本地上传
|
|
1084
|
-
this.showLocalUploadBtn
|
|
1121
|
+
if (this.option.showLocalUploadBtn !== false)
|
|
1122
|
+
this.showLocalUploadBtn = true;
|
|
1085
1123
|
}
|
|
1086
1124
|
},
|
|
1087
1125
|
});
|
|
@@ -1240,7 +1278,7 @@ tViewMixins = {
|
|
|
1240
1278
|
type: Boolean,
|
|
1241
1279
|
default: () => {
|
|
1242
1280
|
return settingConfig.isPartUpload ?? true;
|
|
1243
|
-
}
|
|
1281
|
+
},
|
|
1244
1282
|
},
|
|
1245
1283
|
autoConfirmAfterPasteUpload: {
|
|
1246
1284
|
type: Boolean,
|
|
@@ -1257,14 +1295,14 @@ tViewMixins = {
|
|
|
1257
1295
|
showViewer: false,
|
|
1258
1296
|
chooseIndex: 0,
|
|
1259
1297
|
fileServerInfo: {},
|
|
1260
|
-
model: null
|
|
1298
|
+
model: null,
|
|
1261
1299
|
};
|
|
1262
1300
|
},
|
|
1263
1301
|
computed: {
|
|
1264
|
-
fileServerPreviewEnabled(){
|
|
1302
|
+
fileServerPreviewEnabled() {
|
|
1265
1303
|
return this.getFileServerPreviewEnabled();
|
|
1266
1304
|
},
|
|
1267
|
-
fileShowImageEnabled(){
|
|
1305
|
+
fileShowImageEnabled() {
|
|
1268
1306
|
return this.getFileShowImageEnabled();
|
|
1269
1307
|
},
|
|
1270
1308
|
fileMaxSize() {
|
|
@@ -1326,35 +1364,48 @@ tViewMixins = {
|
|
|
1326
1364
|
pasteEvent(e) {
|
|
1327
1365
|
e.stopPropagation();
|
|
1328
1366
|
if (!(e.clipboardData && e.clipboardData.items)) {
|
|
1329
|
-
return
|
|
1367
|
+
return;
|
|
1330
1368
|
}
|
|
1331
1369
|
let files = Array.from(e.clipboardData.files);
|
|
1332
1370
|
if (files.length) {
|
|
1333
|
-
this.openUploadDialog(files, this.autoConfirmAfterPasteUpload)
|
|
1371
|
+
this.openUploadDialog(files, this.autoConfirmAfterPasteUpload);
|
|
1334
1372
|
}
|
|
1335
1373
|
},
|
|
1336
1374
|
uploadEnterOver() {
|
|
1337
1375
|
// if (this.isLoading) return;
|
|
1338
|
-
document.addEventListener(
|
|
1376
|
+
document.addEventListener("paste", this.pasteEvent);
|
|
1339
1377
|
},
|
|
1340
1378
|
uploadEnterLeave() {
|
|
1341
|
-
document.removeEventListener(
|
|
1379
|
+
document.removeEventListener("paste", this.pasteEvent);
|
|
1342
1380
|
},
|
|
1343
|
-
getFileServerPreviewEnabled(){
|
|
1344
|
-
let value =
|
|
1345
|
-
|
|
1346
|
-
|
|
1381
|
+
getFileServerPreviewEnabled() {
|
|
1382
|
+
let value =
|
|
1383
|
+
window.$vueRoot.$store.getters.fileServerInfo
|
|
1384
|
+
?.fileServerPreviewEnabled ??
|
|
1385
|
+
settingConfig.fileServerPreviewEnabled ??
|
|
1386
|
+
true;
|
|
1387
|
+
if (
|
|
1388
|
+
this.$attrs.fileServerPreviewEnabled !== null &&
|
|
1389
|
+
this.$attrs.fileServerPreviewEnabled !== undefined
|
|
1390
|
+
) {
|
|
1391
|
+
value = this.$attrs.fileServerPreviewEnabled;
|
|
1347
1392
|
}
|
|
1348
1393
|
return value;
|
|
1349
1394
|
},
|
|
1350
|
-
getFileShowImageEnabled(){
|
|
1351
|
-
let value =
|
|
1352
|
-
|
|
1353
|
-
|
|
1395
|
+
getFileShowImageEnabled() {
|
|
1396
|
+
let value =
|
|
1397
|
+
window.$vueRoot.$store.getters.fileServerInfo?.fileShowImageEnabled ??
|
|
1398
|
+
settingConfig.fileShowImageEnabled ??
|
|
1399
|
+
true;
|
|
1400
|
+
if (
|
|
1401
|
+
this.$attrs.fileShowImageEnabled !== null &&
|
|
1402
|
+
this.$attrs.fileShowImageEnabled !== undefined
|
|
1403
|
+
) {
|
|
1404
|
+
value = this.$attrs.fileShowImageEnabled;
|
|
1354
1405
|
}
|
|
1355
1406
|
return value;
|
|
1356
1407
|
},
|
|
1357
|
-
openUploadDialog(files,autoConfirmAfterUpload) {
|
|
1408
|
+
openUploadDialog(files, autoConfirmAfterUpload) {
|
|
1358
1409
|
this.$baseUpload.open({
|
|
1359
1410
|
files,
|
|
1360
1411
|
autoConfirmAfterUpload,
|
|
@@ -1378,7 +1429,8 @@ tViewMixins = {
|
|
|
1378
1429
|
this.model = this.$attrs.model;
|
|
1379
1430
|
// this.fileServerInfo = this.$attrs.fileServerInfo;
|
|
1380
1431
|
} else {
|
|
1381
|
-
this.model =
|
|
1432
|
+
this.model =
|
|
1433
|
+
window.$vueRoot.$store.getters.fileServerInfo?.model ?? null;
|
|
1382
1434
|
/* getFileServerInfo(this, (res) => {
|
|
1383
1435
|
if (res) {
|
|
1384
1436
|
let fileServerInfo = res;
|
|
@@ -1573,7 +1625,10 @@ tViewMixins = {
|
|
|
1573
1625
|
: attachment;
|
|
1574
1626
|
if (this.$commonFileUtil.isPictureFile(url)) {
|
|
1575
1627
|
this.openImagePreView(index);
|
|
1576
|
-
} else if (
|
|
1628
|
+
} else if (
|
|
1629
|
+
fileServerPreviewEnabled &&
|
|
1630
|
+
this.$commonFileUtil.isPreviewFile(url)
|
|
1631
|
+
) {
|
|
1577
1632
|
this.$openFilePreview(url);
|
|
1578
1633
|
}
|
|
1579
1634
|
},
|
|
@@ -1599,7 +1654,11 @@ tViewMixins = {
|
|
|
1599
1654
|
let typeStr = Object.prototype.toString.call(attachment);
|
|
1600
1655
|
if (typeStr == "[object Object]") {
|
|
1601
1656
|
let showField = field ? field : "medium";
|
|
1602
|
-
let fullUrl =
|
|
1657
|
+
let fullUrl =
|
|
1658
|
+
attachment.domain +
|
|
1659
|
+
(showImagePreview && attachment[showField]
|
|
1660
|
+
? attachment[showField]
|
|
1661
|
+
: attachment.url);
|
|
1603
1662
|
showUrl = this.$commonFileUtil.getShowUrl(fullUrl, showImagePreview);
|
|
1604
1663
|
} else {
|
|
1605
1664
|
showUrl = this.$commonFileUtil.getShowUrl(attachment, showImagePreview);
|
|
@@ -98,6 +98,13 @@ let chartContainers = [],
|
|
|
98
98
|
otherTabList: [],
|
|
99
99
|
customListTabLabel: null,
|
|
100
100
|
globalConfig: null,
|
|
101
|
+
// 表单级动态字段规则
|
|
102
|
+
dynamicFieldEnabled: false,
|
|
103
|
+
dynamicFieldSourceType: "local",
|
|
104
|
+
dynamicFieldRules: [],
|
|
105
|
+
dynamicFieldScriptCode: null,
|
|
106
|
+
dynamicFieldScriptParam: null,
|
|
107
|
+
dynamicFieldTriggerFields: [],
|
|
101
108
|
},
|
|
102
109
|
dataSources: [], //数据源
|
|
103
110
|
|