cloud-web-corejs-haier 1.0.19 → 1.0.21
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 +2 -1
- package/src/components/code-editor/index.vue +136 -51
- package/src/components/fileLibrary/index.vue +17 -14
- package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
- package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +350 -202
- package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +33 -26
- package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +5 -5
- package/src/components/fileLibrary/mixins/indexMixins.js +250 -106
- package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
- package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -4
- package/src/components/luckysheet/index.js +3 -0
- package/src/components/table/CellSlot.vue +29 -2
- package/src/components/table/util/index.js +10 -3
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {treeScollx} from "
|
|
2
|
-
import ElImageViewer from "
|
|
3
|
-
import propertiesDialog from "
|
|
4
|
-
import categoryMoveDialog from "
|
|
5
|
-
import fileHistoryDialog from "
|
|
6
|
-
import shareDialog from "
|
|
7
|
-
import recycleBinDialog from "
|
|
8
|
-
import videoDialog from "
|
|
9
|
-
import userDialog from "
|
|
1
|
+
import { treeScollx } from "@base/utils/global.js";
|
|
2
|
+
import ElImageViewer from "@base/components/VabUpload/image-viewer";
|
|
3
|
+
import propertiesDialog from "@base/components/fileLibrary/propertiesDialog";
|
|
4
|
+
import categoryMoveDialog from "@base/components/fileLibrary/categoryMoveDialog";
|
|
5
|
+
import fileHistoryDialog from "@base/components/fileLibrary/fileHistoryDialog";
|
|
6
|
+
import shareDialog from "@base/components/fileLibrary/shareDialog";
|
|
7
|
+
import recycleBinDialog from "@base/components/fileLibrary/recycleBinDialog";
|
|
8
|
+
import videoDialog from "@base/components/video/dialog";
|
|
9
|
+
import userDialog from "@base/views/user/user/dialog";
|
|
10
|
+
import { encode } from "js-base64";
|
|
11
|
+
import fileObjAuthDialog from "@base/components/fileLibrary/fileObjAuthDialog";
|
|
12
|
+
import filterDialog from "@base/components/fileLibrary/filterDialog.vue";
|
|
10
13
|
|
|
11
14
|
let modules;
|
|
12
15
|
modules = {
|
|
@@ -24,6 +27,8 @@ modules = {
|
|
|
24
27
|
recycleBinDialog,
|
|
25
28
|
videoDialog,
|
|
26
29
|
userDialog,
|
|
30
|
+
fileObjAuthDialog,
|
|
31
|
+
filterDialog,
|
|
27
32
|
},
|
|
28
33
|
provide() {
|
|
29
34
|
return {
|
|
@@ -43,6 +48,9 @@ modules = {
|
|
|
43
48
|
getObjectForeignId: () => {
|
|
44
49
|
return this.objectForeignId;
|
|
45
50
|
},
|
|
51
|
+
getFileStoreArea: () => {
|
|
52
|
+
return this.fileStoreArea;
|
|
53
|
+
},
|
|
46
54
|
};
|
|
47
55
|
},
|
|
48
56
|
async created() {
|
|
@@ -72,6 +80,7 @@ modules = {
|
|
|
72
80
|
billDialogContent: null,
|
|
73
81
|
checkBillDatas: [],
|
|
74
82
|
title: "",
|
|
83
|
+
fileStoreArea: {},
|
|
75
84
|
folderStatus: false,
|
|
76
85
|
filterText: "",
|
|
77
86
|
defaultProps: {
|
|
@@ -79,8 +88,7 @@ modules = {
|
|
|
79
88
|
label: "fileName",
|
|
80
89
|
isLeaf: "leaf",
|
|
81
90
|
},
|
|
82
|
-
resolveFunc: function () {
|
|
83
|
-
},
|
|
91
|
+
resolveFunc: function () {},
|
|
84
92
|
fileAttachmentCategorys: [],
|
|
85
93
|
currentFileCategoryCode: null,
|
|
86
94
|
chooseIndex: -1,
|
|
@@ -149,6 +157,10 @@ modules = {
|
|
|
149
157
|
end_y: 0,
|
|
150
158
|
scrollTop1: 0,
|
|
151
159
|
scrollTop2: 0,
|
|
160
|
+
showFileObjAuthDialog: false,
|
|
161
|
+
fileObjAuth: {},
|
|
162
|
+
popAnnexFilter: false,
|
|
163
|
+
showFilterDialog: false,
|
|
152
164
|
};
|
|
153
165
|
},
|
|
154
166
|
computed: {
|
|
@@ -172,8 +184,8 @@ modules = {
|
|
|
172
184
|
let dataId = this.isBillEnabled
|
|
173
185
|
? this.checkBillDatas.map((row) => row.id)
|
|
174
186
|
: this.option.dataId
|
|
175
|
-
|
|
176
|
-
|
|
187
|
+
? [this.option.dataId]
|
|
188
|
+
: [0];
|
|
177
189
|
return dataId;
|
|
178
190
|
},
|
|
179
191
|
objectForeignId() {
|
|
@@ -242,8 +254,8 @@ modules = {
|
|
|
242
254
|
},
|
|
243
255
|
currentCategoryId() {
|
|
244
256
|
return this.currentFileCategory &&
|
|
245
|
-
|
|
246
|
-
|
|
257
|
+
this.currentFileCategory.id &&
|
|
258
|
+
this.currentFileCategory.id > 0
|
|
247
259
|
? this.currentFileCategory.id
|
|
248
260
|
: 0;
|
|
249
261
|
},
|
|
@@ -254,9 +266,39 @@ modules = {
|
|
|
254
266
|
customToobarButtons() {
|
|
255
267
|
let buttonConfig = this.option.buttonConfig || {};
|
|
256
268
|
return buttonConfig && buttonConfig.toobar ? buttonConfig.toobar : [];
|
|
257
|
-
}
|
|
269
|
+
},
|
|
258
270
|
},
|
|
259
271
|
methods: {
|
|
272
|
+
openFileDirs(row) {
|
|
273
|
+
let keys = row.treePath.split(",").filter((item) => !!item);
|
|
274
|
+
if(row.dirs){
|
|
275
|
+
keys.push(row.id + "")
|
|
276
|
+
}
|
|
277
|
+
let size = keys.length;
|
|
278
|
+
let tree = this.$refs.tree;
|
|
279
|
+
|
|
280
|
+
let parent = null;
|
|
281
|
+
let loopDo = (index) => {
|
|
282
|
+
if (size <= index) return;
|
|
283
|
+
let key = keys[index];
|
|
284
|
+
let node = tree.getNode(key + "");
|
|
285
|
+
let data = node.data;
|
|
286
|
+
if (size == index + 1) {
|
|
287
|
+
tree.setCurrentKey(data);
|
|
288
|
+
this.handleNodeClick(data, node, this);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (!data.leaf) {
|
|
293
|
+
node.expand(() => {
|
|
294
|
+
loopDo(index + 1);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
this.getTopNode().expand(() => {
|
|
299
|
+
loopDo(0);
|
|
300
|
+
});
|
|
301
|
+
},
|
|
260
302
|
getTopNode() {
|
|
261
303
|
return this.$refs.tree.root.childNodes[0];
|
|
262
304
|
},
|
|
@@ -297,7 +339,12 @@ modules = {
|
|
|
297
339
|
let checkRows = this.getCheckRows();
|
|
298
340
|
if (!checkRows.length) {
|
|
299
341
|
let msg =
|
|
300
|
-
handleType == 1
|
|
342
|
+
handleType == 1
|
|
343
|
+
? this.$t2("请选择需要移动的文件", "components.fileLibrary.moveTip")
|
|
344
|
+
: this.$t2(
|
|
345
|
+
"请选择需要复制的文件",
|
|
346
|
+
"components.fileLibrary.copyTip"
|
|
347
|
+
);
|
|
301
348
|
this.$message({
|
|
302
349
|
message: msg,
|
|
303
350
|
type: "error",
|
|
@@ -369,14 +416,22 @@ modules = {
|
|
|
369
416
|
deleteCategory(category) {
|
|
370
417
|
if (!category && !this.currentCategoryId) {
|
|
371
418
|
this.$message({
|
|
372
|
-
message: this.$t2(
|
|
419
|
+
message: this.$t2(
|
|
420
|
+
"请选择需要删除的文件夹",
|
|
421
|
+
"components.fileLibrary.deleteCategoryTip"
|
|
422
|
+
),
|
|
373
423
|
type: "error",
|
|
374
424
|
showClose: true,
|
|
375
425
|
duration: 3000,
|
|
376
426
|
});
|
|
377
427
|
return;
|
|
378
428
|
}
|
|
379
|
-
this.$baseConfirm(
|
|
429
|
+
this.$baseConfirm(
|
|
430
|
+
this.$t2(
|
|
431
|
+
"您确定要删除文件夹吗?",
|
|
432
|
+
"components.fileLibrary.deleteCategoryConfirmTip"
|
|
433
|
+
)
|
|
434
|
+
).then(() => {
|
|
380
435
|
let categoryId = category ? category.id : this.currentCategoryId;
|
|
381
436
|
this.$http({
|
|
382
437
|
method: "post",
|
|
@@ -445,7 +500,7 @@ modules = {
|
|
|
445
500
|
if (!field) field = "medium";
|
|
446
501
|
return this.$commonFileUtil.getShowUrl(
|
|
447
502
|
attachment.domain +
|
|
448
|
-
|
|
503
|
+
(attachment[field] ? attachment[field] : attachment.url)
|
|
449
504
|
);
|
|
450
505
|
},
|
|
451
506
|
isVideo(fileSuffix) {
|
|
@@ -487,7 +542,7 @@ modules = {
|
|
|
487
542
|
};
|
|
488
543
|
|
|
489
544
|
let parent = this.currentCategoryId;
|
|
490
|
-
this.$
|
|
545
|
+
this.$commonHttp({
|
|
491
546
|
method: "post",
|
|
492
547
|
url: this.current_prefix + "/file_obj/listPage",
|
|
493
548
|
data: {
|
|
@@ -506,21 +561,25 @@ modules = {
|
|
|
506
561
|
let checkBillDatas = this.checkBillDatas;
|
|
507
562
|
let done = (res) => {
|
|
508
563
|
this.page = res;
|
|
509
|
-
}
|
|
564
|
+
};
|
|
510
565
|
let preHandlePage = this.option.preHandlePage;
|
|
511
566
|
if (preHandlePage) {
|
|
512
|
-
preHandlePage({page, objectForeignId, checkBillDatas, done})
|
|
567
|
+
preHandlePage({ page, objectForeignId, checkBillDatas, done });
|
|
513
568
|
} else {
|
|
514
569
|
done(page);
|
|
515
570
|
}
|
|
516
|
-
}
|
|
571
|
+
},
|
|
517
572
|
});
|
|
518
573
|
},
|
|
519
574
|
addFile() {
|
|
520
575
|
let currentFileCategory = this.currentFileCategory;
|
|
521
576
|
if (!currentFileCategory || !currentFileCategory.id) {
|
|
522
577
|
this.$message({
|
|
523
|
-
message: this.$t2(
|
|
578
|
+
message: this.$t2(
|
|
579
|
+
"文件夹[" + this.title + "]不允许上传",
|
|
580
|
+
"components.fileLibrary.uploadTip1",
|
|
581
|
+
{ title: this.title }
|
|
582
|
+
),
|
|
524
583
|
type: "error",
|
|
525
584
|
showClose: true,
|
|
526
585
|
duration: 3000,
|
|
@@ -531,7 +590,11 @@ modules = {
|
|
|
531
590
|
if (!this.checkBillDatas.length) {
|
|
532
591
|
let billName = this.billConfig.name;
|
|
533
592
|
this.$message({
|
|
534
|
-
message: this.$t2(
|
|
593
|
+
message: this.$t2(
|
|
594
|
+
"请选择" + billName,
|
|
595
|
+
"components.fileLibrary.uploadTip2",
|
|
596
|
+
{ billName: billName }
|
|
597
|
+
),
|
|
535
598
|
type: "error",
|
|
536
599
|
showClose: true,
|
|
537
600
|
duration: 3000,
|
|
@@ -591,8 +654,8 @@ modules = {
|
|
|
591
654
|
if (attachment) {
|
|
592
655
|
if (attachment.status == 1) {
|
|
593
656
|
this.$message({
|
|
594
|
-
message:
|
|
595
|
-
type:
|
|
657
|
+
message: "归档文件不允许删除",
|
|
658
|
+
type: "error",
|
|
596
659
|
showClose: true,
|
|
597
660
|
duration: 3000,
|
|
598
661
|
});
|
|
@@ -602,13 +665,13 @@ modules = {
|
|
|
602
665
|
if (attachment.dirs) {
|
|
603
666
|
categorys.push(attachment);
|
|
604
667
|
}
|
|
605
|
-
checkRows = [attachment]
|
|
668
|
+
checkRows = [attachment];
|
|
606
669
|
} else {
|
|
607
670
|
checkRows = this.getCheckRows();
|
|
608
|
-
if (checkRows.find(row => row.status == 1)) {
|
|
671
|
+
if (checkRows.find((row) => row.status == 1)) {
|
|
609
672
|
this.$message({
|
|
610
|
-
message:
|
|
611
|
-
type:
|
|
673
|
+
message: "归档文件不允许删除",
|
|
674
|
+
type: "error",
|
|
612
675
|
showClose: true,
|
|
613
676
|
duration: 3000,
|
|
614
677
|
});
|
|
@@ -619,7 +682,10 @@ modules = {
|
|
|
619
682
|
}
|
|
620
683
|
if (!data.length) {
|
|
621
684
|
this.$message({
|
|
622
|
-
message: this.$t2(
|
|
685
|
+
message: this.$t2(
|
|
686
|
+
"请选择需要删除的文件",
|
|
687
|
+
"components.fileLibrary.deleteFileTip"
|
|
688
|
+
),
|
|
623
689
|
type: "error",
|
|
624
690
|
showClose: true,
|
|
625
691
|
duration: 3000,
|
|
@@ -627,13 +693,17 @@ modules = {
|
|
|
627
693
|
return;
|
|
628
694
|
}
|
|
629
695
|
|
|
630
|
-
let deleteDirAuth =
|
|
696
|
+
let deleteDirAuth =
|
|
697
|
+
this.fileObjAuth && this.fileObjAuth.deleteDirAuth ? 1 : 0;
|
|
631
698
|
let deleteAuth = this.fileObjAuth && this.fileObjAuth.deleteAuth ? 1 : 0;
|
|
632
699
|
for (let i = 0; i < checkRows.length; i++) {
|
|
633
700
|
let item = checkRows[i];
|
|
634
701
|
if (item.dirs && !deleteDirAuth) {
|
|
635
702
|
this.$message({
|
|
636
|
-
message: this.$t2(
|
|
703
|
+
message: this.$t2(
|
|
704
|
+
"您没有删除文件夹的权限!",
|
|
705
|
+
"components.fileLibrary.deleteCategoryTip2"
|
|
706
|
+
),
|
|
637
707
|
type: "error",
|
|
638
708
|
showClose: true,
|
|
639
709
|
duration: 3000,
|
|
@@ -641,7 +711,10 @@ modules = {
|
|
|
641
711
|
return;
|
|
642
712
|
} else if (!item.dirs && !deleteAuth) {
|
|
643
713
|
this.$message({
|
|
644
|
-
message: this.$t2(
|
|
714
|
+
message: this.$t2(
|
|
715
|
+
"您没有删除文件的权限!",
|
|
716
|
+
"components.fileLibrary.deleteFileTip2"
|
|
717
|
+
),
|
|
645
718
|
type: "error",
|
|
646
719
|
showClose: true,
|
|
647
720
|
duration: 3000,
|
|
@@ -651,7 +724,9 @@ modules = {
|
|
|
651
724
|
}
|
|
652
725
|
|
|
653
726
|
// let data = [attachment.id];
|
|
654
|
-
this.$baseConfirm(
|
|
727
|
+
this.$baseConfirm(
|
|
728
|
+
this.$t2("您确定要删除吗?", "components.fileLibrary.deleteConfirmTip")
|
|
729
|
+
).then(() => {
|
|
655
730
|
this.$http({
|
|
656
731
|
method: "post",
|
|
657
732
|
url: this.current_prefix + "/file_obj/setDisable",
|
|
@@ -675,7 +750,9 @@ modules = {
|
|
|
675
750
|
},
|
|
676
751
|
initTableList() {
|
|
677
752
|
let that = this;
|
|
678
|
-
let customColumns = this.option.customColumns
|
|
753
|
+
let customColumns = this.option.customColumns
|
|
754
|
+
? this.option.customColumns()
|
|
755
|
+
: [];
|
|
679
756
|
let tableOption = {
|
|
680
757
|
vue: this,
|
|
681
758
|
tableRef: "table-m1",
|
|
@@ -688,14 +765,14 @@ modules = {
|
|
|
688
765
|
},
|
|
689
766
|
},
|
|
690
767
|
columns: [
|
|
691
|
-
{type: "checkbox", width: 48, resizable: false, fixed: "left"},
|
|
768
|
+
{ type: "checkbox", width: 48, resizable: false, fixed: "left" },
|
|
692
769
|
{
|
|
693
|
-
title: this.$t2(
|
|
770
|
+
title: this.$t2("文件名称", "components.fileLibrary.fileName"),
|
|
694
771
|
field: "fileName",
|
|
695
772
|
width: 250,
|
|
696
773
|
fixed: "left",
|
|
697
774
|
slots: {
|
|
698
|
-
default: ({row, $rowIndex}) => {
|
|
775
|
+
default: ({ row, $rowIndex }) => {
|
|
699
776
|
let h = this.$createElement;
|
|
700
777
|
if (!row.dirs) {
|
|
701
778
|
let showUrl = that.getShowUrl(row, "thumbnail");
|
|
@@ -718,7 +795,10 @@ modules = {
|
|
|
718
795
|
props: {
|
|
719
796
|
enterable: false,
|
|
720
797
|
effect: "dark",
|
|
721
|
-
content: this.$t2(
|
|
798
|
+
content: this.$t2(
|
|
799
|
+
"预览",
|
|
800
|
+
"components.fileLibrary.preview"
|
|
801
|
+
),
|
|
722
802
|
placement: "top",
|
|
723
803
|
"popper-class": "tooltip-skin",
|
|
724
804
|
},
|
|
@@ -756,7 +836,7 @@ modules = {
|
|
|
756
836
|
},
|
|
757
837
|
[
|
|
758
838
|
h("svg-icon", {
|
|
759
|
-
props: {"icon-class": "ico-wenjianjia"},
|
|
839
|
+
props: { "icon-class": "ico-wenjianjia" },
|
|
760
840
|
}),
|
|
761
841
|
h("span", row.fileName),
|
|
762
842
|
]
|
|
@@ -769,11 +849,11 @@ modules = {
|
|
|
769
849
|
},
|
|
770
850
|
},
|
|
771
851
|
{
|
|
772
|
-
title: this.$t2(
|
|
852
|
+
title: this.$t2("文件大小", "components.fileLibrary.fileSize"),
|
|
773
853
|
field: "fileSize",
|
|
774
854
|
width: 150,
|
|
775
855
|
slots: {
|
|
776
|
-
default: ({row, $rowIndex}) => {
|
|
856
|
+
default: ({ row, $rowIndex }) => {
|
|
777
857
|
if (!row.dirs) {
|
|
778
858
|
return this.formatFileSize(row.fileSize);
|
|
779
859
|
}
|
|
@@ -781,41 +861,53 @@ modules = {
|
|
|
781
861
|
},
|
|
782
862
|
},
|
|
783
863
|
{
|
|
784
|
-
title: this.$t2(
|
|
864
|
+
title: this.$t2("版本号", "components.fileLibrary.fileRev"),
|
|
785
865
|
field: "rev",
|
|
786
866
|
width: 150,
|
|
787
867
|
slots: {
|
|
788
|
-
default: ({row, $rowIndex}) => {
|
|
868
|
+
default: ({ row, $rowIndex }) => {
|
|
789
869
|
if (!row.dirs) {
|
|
790
870
|
return row.rev;
|
|
791
871
|
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
872
|
+
},
|
|
873
|
+
},
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
title: this.$t2("分辨率", "components.fileLibrary.widthHeight"),
|
|
877
|
+
field: "widthHeight",
|
|
878
|
+
width: 150,
|
|
794
879
|
},
|
|
795
|
-
{title: this.$t2('分辨率', 'components.fileLibrary.widthHeight'), field: "widthHeight", width: 150},
|
|
796
|
-
{title: this.$t2('所属对象描述', 'components.fileLibrary.note'), field: "note", width: 250},
|
|
797
880
|
{
|
|
798
|
-
title:
|
|
799
|
-
field:
|
|
881
|
+
title: this.$t2("所属对象描述", "components.fileLibrary.note"),
|
|
882
|
+
field: "note",
|
|
883
|
+
width: 250,
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
title: "状态",
|
|
887
|
+
field: "status",
|
|
800
888
|
width: 150,
|
|
801
889
|
slots: {
|
|
802
|
-
default: ({row, $rowIndex}) => {
|
|
890
|
+
default: ({ row, $rowIndex }) => {
|
|
803
891
|
if (!row.dirs) {
|
|
804
|
-
return row.status == 1 ?
|
|
892
|
+
return row.status == 1 ? "已归档" : "未归档";
|
|
805
893
|
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
894
|
+
},
|
|
895
|
+
},
|
|
808
896
|
},
|
|
809
897
|
{
|
|
810
|
-
title: this.$t2(
|
|
898
|
+
title: this.$t2("文件编码", "components.fileLibrary.fileSn"),
|
|
811
899
|
field: "fileSn",
|
|
812
|
-
width: 150
|
|
900
|
+
width: 150,
|
|
813
901
|
},
|
|
814
902
|
...customColumns,
|
|
815
|
-
{
|
|
903
|
+
{
|
|
904
|
+
title: this.$t2("创建人", "components.fileLibrary.createBy"),
|
|
905
|
+
field: "_createBy",
|
|
906
|
+
width: 150,
|
|
907
|
+
},
|
|
816
908
|
{
|
|
817
909
|
field: "createDate",
|
|
818
|
-
title: this.$t2(
|
|
910
|
+
title: this.$t2("创建时间", "components.fileLibrary.createDate"),
|
|
819
911
|
width: 150,
|
|
820
912
|
},
|
|
821
913
|
{
|
|
@@ -824,12 +916,11 @@ modules = {
|
|
|
824
916
|
title: "",
|
|
825
917
|
sortable: false,
|
|
826
918
|
slots: {
|
|
827
|
-
default: "operate"
|
|
919
|
+
default: "operate",
|
|
828
920
|
},
|
|
829
921
|
},
|
|
830
922
|
],
|
|
831
|
-
callback(a, b) {
|
|
832
|
-
},
|
|
923
|
+
callback(a, b) {},
|
|
833
924
|
};
|
|
834
925
|
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
835
926
|
this.vxeOption = opts;
|
|
@@ -839,15 +930,21 @@ modules = {
|
|
|
839
930
|
let customFileButtons = this.customFileButtons;
|
|
840
931
|
let nodes = [];
|
|
841
932
|
customFileButtons.forEach((fileButton, index) => {
|
|
842
|
-
if (
|
|
933
|
+
if (
|
|
934
|
+
fileButton.dirs === null ||
|
|
935
|
+
fileButton.dirs === undefined ||
|
|
936
|
+
attachment.dirs === fileButton.dirs
|
|
937
|
+
) {
|
|
843
938
|
if (this.customFileButtonVisable(fileButton, attachment)) {
|
|
844
|
-
nodes.push(
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
939
|
+
nodes.push(
|
|
940
|
+
this.getBtnVnode({
|
|
941
|
+
class: fileButton.icon,
|
|
942
|
+
title: fileButton.label,
|
|
943
|
+
click: (event) => {
|
|
944
|
+
that.customFileButtonEvent(fileButton, attachment);
|
|
945
|
+
},
|
|
946
|
+
})
|
|
947
|
+
);
|
|
851
948
|
}
|
|
852
949
|
}
|
|
853
950
|
});
|
|
@@ -889,7 +986,7 @@ modules = {
|
|
|
889
986
|
);
|
|
890
987
|
}
|
|
891
988
|
},
|
|
892
|
-
changePageNew({type, currentPage, pageSize, $event}) {
|
|
989
|
+
changePageNew({ type, currentPage, pageSize, $event }) {
|
|
893
990
|
this.checkList = [];
|
|
894
991
|
this.checkAll = false;
|
|
895
992
|
this.initAttchInfo({
|
|
@@ -939,7 +1036,7 @@ modules = {
|
|
|
939
1036
|
if (page.pages > page.current) {
|
|
940
1037
|
rows.push({
|
|
941
1038
|
parent: param.parent,
|
|
942
|
-
fileName: this.$t2(
|
|
1039
|
+
fileName: this.$t2("更多", "components.fileLibrary.more"),
|
|
943
1040
|
moreBtn: true,
|
|
944
1041
|
leaf: true,
|
|
945
1042
|
pages: page.pages,
|
|
@@ -990,7 +1087,7 @@ modules = {
|
|
|
990
1087
|
if (page.pages > page.current) {
|
|
991
1088
|
rows.push({
|
|
992
1089
|
parent: param.parent,
|
|
993
|
-
fileName: this.$t2(
|
|
1090
|
+
fileName: this.$t2("更多", "components.fileLibrary.more"),
|
|
994
1091
|
moreBtn: true,
|
|
995
1092
|
leaf: true,
|
|
996
1093
|
pages: page.pages,
|
|
@@ -1003,36 +1100,44 @@ modules = {
|
|
|
1003
1100
|
rows.forEach((value) => {
|
|
1004
1101
|
value.leaf = !value.hasChild;
|
|
1005
1102
|
});
|
|
1103
|
+
let items = [];
|
|
1006
1104
|
if (node.level === 0) {
|
|
1105
|
+
let item = {
|
|
1106
|
+
parent: null,
|
|
1107
|
+
fileName: this.title,
|
|
1108
|
+
leaf: rows.length == 0,
|
|
1109
|
+
allFileBtn: true,
|
|
1110
|
+
id: 0,
|
|
1111
|
+
children: rows,
|
|
1112
|
+
};
|
|
1113
|
+
items.push(item);
|
|
1007
1114
|
setTimeout(() => {
|
|
1008
1115
|
this.$refs.tree.setCurrentKey(node.childNodes[0].data);
|
|
1009
1116
|
this.handleNodeData(node.childNodes[0]);
|
|
1010
1117
|
node.childNodes[0].expand();
|
|
1118
|
+
if (this.option.treeExpandAll) {
|
|
1119
|
+
//默认全部展开树分类
|
|
1120
|
+
node.childNodes[0].childNodes.forEach((item) => {
|
|
1121
|
+
if (!item.data.leaf) item.expand();
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1011
1124
|
}, 200);
|
|
1012
1125
|
this.$nextTick(() => {
|
|
1013
1126
|
callback && callback();
|
|
1014
1127
|
});
|
|
1015
1128
|
this.searchEvent();
|
|
1016
1129
|
} else {
|
|
1130
|
+
items = rows;
|
|
1017
1131
|
this.$nextTick(() => {
|
|
1132
|
+
if (this.option.treeExpandAll) {
|
|
1133
|
+
//默认全部展开树分类
|
|
1134
|
+
node.childNodes.forEach((item) => {
|
|
1135
|
+
if (!item.data.leaf) item.expand();
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1018
1138
|
callback && callback();
|
|
1019
1139
|
});
|
|
1020
1140
|
}
|
|
1021
|
-
let items = [];
|
|
1022
|
-
if (node.level === 0) {
|
|
1023
|
-
let item = {
|
|
1024
|
-
parent: null,
|
|
1025
|
-
fileName: this.title,
|
|
1026
|
-
leaf: rows.length == 0,
|
|
1027
|
-
allFileBtn: true,
|
|
1028
|
-
id: 0,
|
|
1029
|
-
children: rows,
|
|
1030
|
-
};
|
|
1031
|
-
items.push(item);
|
|
1032
|
-
} else {
|
|
1033
|
-
items = rows;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
1141
|
resolve(items);
|
|
1037
1142
|
},
|
|
1038
1143
|
});
|
|
@@ -1059,7 +1164,10 @@ modules = {
|
|
|
1059
1164
|
let currentFileCategory = category || this.currentFileCategory;
|
|
1060
1165
|
if (!currentFileCategory) {
|
|
1061
1166
|
this.$message({
|
|
1062
|
-
message: this.$t2(
|
|
1167
|
+
message: this.$t2(
|
|
1168
|
+
"请选择文件夹",
|
|
1169
|
+
"components.fileLibrary.editCategoryTip"
|
|
1170
|
+
),
|
|
1063
1171
|
type: "error",
|
|
1064
1172
|
showClose: true,
|
|
1065
1173
|
duration: 3000,
|
|
@@ -1072,7 +1180,12 @@ modules = {
|
|
|
1072
1180
|
confirmEditCategoryDialog() {
|
|
1073
1181
|
this.$refs.editCategoryForm.$baseValidate((valid) => {
|
|
1074
1182
|
if (valid) {
|
|
1075
|
-
this.$baseConfirm(
|
|
1183
|
+
this.$baseConfirm(
|
|
1184
|
+
this.$t2(
|
|
1185
|
+
"您确定要保存吗?",
|
|
1186
|
+
"components.fileLibrary.saveConfirmTip"
|
|
1187
|
+
)
|
|
1188
|
+
).then(() => {
|
|
1076
1189
|
var url =
|
|
1077
1190
|
this.current_prefix +
|
|
1078
1191
|
(this.editCategory.id ? "/file_obj/update" : "/file_obj/save");
|
|
@@ -1098,8 +1211,7 @@ modules = {
|
|
|
1098
1211
|
message: res.content,
|
|
1099
1212
|
type: "success",
|
|
1100
1213
|
duration: 500,
|
|
1101
|
-
onClose: (t) => {
|
|
1102
|
-
},
|
|
1214
|
+
onClose: (t) => {},
|
|
1103
1215
|
});
|
|
1104
1216
|
let nodeData = res.objx;
|
|
1105
1217
|
nodeData.leaf = !nodeData.hasChild;
|
|
@@ -1194,7 +1306,10 @@ modules = {
|
|
|
1194
1306
|
let checkRows = this.getCheckRows();
|
|
1195
1307
|
if (!checkRows.length) {
|
|
1196
1308
|
this.$message({
|
|
1197
|
-
message: this.$t2(
|
|
1309
|
+
message: this.$t2(
|
|
1310
|
+
"请选择需要下载的文件",
|
|
1311
|
+
"components.fileLibrary.downloadTip"
|
|
1312
|
+
),
|
|
1198
1313
|
type: "error",
|
|
1199
1314
|
showClose: true,
|
|
1200
1315
|
duration: 3000,
|
|
@@ -1210,7 +1325,10 @@ modules = {
|
|
|
1210
1325
|
let checkRows = this.getCheckRows();
|
|
1211
1326
|
if (!checkRows.length) {
|
|
1212
1327
|
this.$message({
|
|
1213
|
-
message: this.$t2(
|
|
1328
|
+
message: this.$t2(
|
|
1329
|
+
"请选择需要下载的文件",
|
|
1330
|
+
"components.fileLibrary.downloadTip"
|
|
1331
|
+
),
|
|
1214
1332
|
type: "error",
|
|
1215
1333
|
showClose: true,
|
|
1216
1334
|
duration: 3000,
|
|
@@ -1256,7 +1374,7 @@ modules = {
|
|
|
1256
1374
|
let ids = rows.map((row) => row.id);
|
|
1257
1375
|
let data = {
|
|
1258
1376
|
ids: ids,
|
|
1259
|
-
objectForeignId: this.objectForeignId
|
|
1377
|
+
objectForeignId: this.objectForeignId,
|
|
1260
1378
|
};
|
|
1261
1379
|
if (this.option.foreignDirs === true) {
|
|
1262
1380
|
data.foreignDirs = true;
|
|
@@ -1402,13 +1520,23 @@ modules = {
|
|
|
1402
1520
|
success: (res) => {
|
|
1403
1521
|
let fileStoreArea = res.objx;
|
|
1404
1522
|
if (fileStoreArea) {
|
|
1523
|
+
this.fileStoreArea = fileStoreArea;
|
|
1405
1524
|
this.title = fileStoreArea.storeAreaName;
|
|
1525
|
+
let tabType = this.option.tabType;
|
|
1526
|
+
if (tabType) {
|
|
1527
|
+
this.showType = tabType === "table" ? 2 : 1;
|
|
1528
|
+
}
|
|
1406
1529
|
this.$nextTick(() => {
|
|
1407
|
-
treeScollx({target: this, type: "default"});
|
|
1530
|
+
treeScollx({ target: this, type: "default" });
|
|
1408
1531
|
this.treeFlag = true;
|
|
1409
1532
|
});
|
|
1410
1533
|
} else {
|
|
1411
|
-
this.$baseAlert(
|
|
1534
|
+
this.$baseAlert(
|
|
1535
|
+
this.$t2(
|
|
1536
|
+
"文档工作区未维护",
|
|
1537
|
+
"components.fileLibrary.fileStoreAreaTip"
|
|
1538
|
+
)
|
|
1539
|
+
);
|
|
1412
1540
|
}
|
|
1413
1541
|
},
|
|
1414
1542
|
});
|
|
@@ -1508,7 +1636,10 @@ modules = {
|
|
|
1508
1636
|
let checkRows = this.getCheckRows();
|
|
1509
1637
|
if (!checkRows.length) {
|
|
1510
1638
|
this.$message({
|
|
1511
|
-
message: this.$t2(
|
|
1639
|
+
message: this.$t2(
|
|
1640
|
+
"请选择需要替换的文件",
|
|
1641
|
+
"components.fileLibrary.replaceFileTip"
|
|
1642
|
+
),
|
|
1512
1643
|
type: "error",
|
|
1513
1644
|
showClose: true,
|
|
1514
1645
|
duration: 3000,
|
|
@@ -1531,7 +1662,7 @@ modules = {
|
|
|
1531
1662
|
},
|
|
1532
1663
|
});
|
|
1533
1664
|
},
|
|
1534
|
-
checkBatchReplace({files, done}) {
|
|
1665
|
+
checkBatchReplace({ files, done }) {
|
|
1535
1666
|
let newFileObjDTOs = files.map((file) => {
|
|
1536
1667
|
return {
|
|
1537
1668
|
name: file.name,
|
|
@@ -1729,24 +1860,37 @@ modules = {
|
|
|
1729
1860
|
},
|
|
1730
1861
|
customFileButtonEvent(customFileButton, attachment) {
|
|
1731
1862
|
customFileButton.onclick({
|
|
1732
|
-
row: attachment
|
|
1863
|
+
row: attachment,
|
|
1733
1864
|
});
|
|
1734
1865
|
},
|
|
1735
1866
|
customToobarButtonEvent(customFileButton) {
|
|
1736
1867
|
customFileButton.onclick({
|
|
1737
|
-
rows: this.checkRows
|
|
1868
|
+
rows: this.checkRows,
|
|
1738
1869
|
});
|
|
1739
1870
|
},
|
|
1740
1871
|
customFileButtonVisable(customFileButton, attachment) {
|
|
1741
1872
|
if (customFileButton.visable === "function") {
|
|
1742
1873
|
let checkBillDatas = this.checkBillDatas;
|
|
1743
|
-
return customFileButton.visable({row: attachment, checkBillDatas});
|
|
1744
|
-
} else if (
|
|
1874
|
+
return customFileButton.visable({ row: attachment, checkBillDatas });
|
|
1875
|
+
} else if (
|
|
1876
|
+
customFileButton.visable === null ||
|
|
1877
|
+
customFileButton.visable == undefined
|
|
1878
|
+
) {
|
|
1745
1879
|
return true;
|
|
1746
1880
|
} else {
|
|
1747
1881
|
return customFileButton.visable;
|
|
1748
1882
|
}
|
|
1749
|
-
}
|
|
1883
|
+
},
|
|
1884
|
+
downloadSingerFile(attachment) {
|
|
1885
|
+
let fileObjAuth = this.fileObjAuth;
|
|
1886
|
+
if (attachment.dirs || !fileObjAuth.downloadAuth) return;
|
|
1887
|
+
let url = attachment.domain + attachment.url;
|
|
1888
|
+
if (this.fileStoreArea.toDownWatermark && fileObjAuth.downWatermarkAuth) {
|
|
1889
|
+
let loginAccount = this.$store.getters.loginAccount;
|
|
1890
|
+
url += "?_w=" + encodeURIComponent(encode(loginAccount));
|
|
1891
|
+
}
|
|
1892
|
+
this.$commonFileUtil.downloadFile(url, attachment.fileName);
|
|
1893
|
+
},
|
|
1750
1894
|
},
|
|
1751
1895
|
};
|
|
1752
1896
|
export default modules;
|