@dignite-ng/expand.file-explorer 3.0.0-rc.33 → 3.0.0-rc.35
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/esm2022/lib/components/file-modal/file-modal.component.mjs +274 -68
- package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +125 -52
- package/esm2022/lib/components/file-picker/file-picker.component.mjs +14 -5
- package/esm2022/lib/file-explorer.module.mjs +14 -3
- package/esm2022/lib/pipe/get-directory-name.pipe.mjs +20 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +10 -3
- package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +1 -1
- package/fesm2022/dignite-ng-expand.file-explorer.mjs +448 -131
- package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +1 -1
- package/lib/components/file-modal/file-modal.component.d.ts +61 -20
- package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +21 -10
- package/lib/components/file-picker/file-picker.component.d.ts +2 -0
- package/lib/file-explorer.module.d.ts +4 -1
- package/lib/pipe/get-directory-name.pipe.d.ts +7 -0
- package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +3 -1
- package/lib/proxy/dignite/file-explorer/files/models.d.ts +5 -2
- package/package.json +1 -1
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Input, Component, EventEmitter, ViewChild, Output, inject, NgModule, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { Injectable, Input, Component, EventEmitter, ViewChild, Output, inject, Pipe, NgModule, ChangeDetectorRef } from '@angular/core';
|
|
3
3
|
import * as i3 from '@abp/ng.core';
|
|
4
4
|
import { ListService, LIST_QUERY_DEBOUNCE_TIME, ConfigStateService, EnvironmentService, CoreModule } from '@abp/ng.core';
|
|
5
5
|
import * as i2$1 from '@abp/ng.theme.shared';
|
|
6
6
|
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
7
|
-
import * as i1 from '@angular/forms';
|
|
8
|
-
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as
|
|
7
|
+
import * as i1$1 from '@angular/forms';
|
|
8
|
+
import { Validators, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import * as i1 from '@ng-bootstrap/ng-bootstrap';
|
|
10
10
|
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
11
|
-
import * as i9 from 'ng-zorro-antd/tree';
|
|
12
11
|
import { NzTreeModule } from 'ng-zorro-antd/tree';
|
|
13
12
|
import * as i3$1 from '@ngx-validate/core';
|
|
14
13
|
import { NgxValidateCoreModule } from '@ngx-validate/core';
|
|
15
|
-
import * as i1$
|
|
14
|
+
import * as i1$2 from '@angular/router';
|
|
16
15
|
import { RouterModule } from '@angular/router';
|
|
17
16
|
import * as i2 from '@angular/common';
|
|
18
|
-
import * as
|
|
17
|
+
import * as i4 from '@angular/cdk/drag-drop';
|
|
18
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
19
|
+
import * as i7 from '@swimlane/ngx-datatable';
|
|
19
20
|
import { SelectionType } from '@swimlane/ngx-datatable';
|
|
20
|
-
import { of } from 'rxjs';
|
|
21
|
+
import { tap, map, of, finalize } from 'rxjs';
|
|
22
|
+
import { ValidatorsService } from '@dignite-ng/expand.core';
|
|
23
|
+
import * as i9 from '@abp/ng.components/tree';
|
|
24
|
+
import { TreeModule } from '@abp/ng.components/tree';
|
|
21
25
|
|
|
22
26
|
class FileApiService {
|
|
23
27
|
constructor() { }
|
|
@@ -233,13 +237,13 @@ class FilePreviewComponent {
|
|
|
233
237
|
return this.rotate = 0;
|
|
234
238
|
this.rotate += 90;
|
|
235
239
|
}
|
|
236
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePreviewComponent, deps: [{ token:
|
|
240
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePreviewComponent, deps: [{ token: i1.NgbModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
237
241
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FilePreviewComponent, selector: "fe-file-preview", inputs: { width: "width", src: "src", preview: "preview", type: "type", name: "name", className: "className" }, ngImport: i0, template: "<div class=\"image_box\" [style]=\"{width:width,maxWidth:'100%'}\">\n <div class=\"img_box\" [class]=\"className\" *ngIf=\"isImage\">\n <img [src]=\"src\" />\n <div class=\"option_box\" *ngIf=\"preview\">\n <i class=\"fa fa-eye \" (click.stop)=\"OpenPreviewImage(content)\"></i>\n </div>\n </div>\n <a [href]=\"src\" [download]=\"name\" target>\n <i class=\"fa fa-file-audio-o fs-1\" *ngIf=\"isAudio\"></i>\n <i class=\"fa fa-file-video-o fs-1\" *ngIf=\"isVideo\"></i>\n <ng-container *ngIf=\"!(isImage||isAudio||isVideo)\">\n <ng-container *ngFor=\"let item of _ImageTypeOption; let i=index\">\n <i class=\"fs-1\" [ngClass]=\"item.icon\" *ngIf=\"item.type===type\"></i>\n </ng-container>\n </ng-container>\n </a>\n</div>\n\n<ng-template #content let-modal>\n <div class=\"modal-header\">\n <div class=\"d-flex justify-content-end w-100 fs-3\">\n <i class=\"mx-2 fa fa fa-repeat\" aria-hidden=\"true\" title=\"\u53F3\u65CB\u8F6C\" role=\"button\" (click)=\"RotateRight()\"></i>\n <i class=\"mx-2 fa fa-search-minus\" aria-hidden=\"true\" title=\"\u7F29\u5C0F\" role=\"button\" (click)=\"zoomOut()\"></i>\n <i class=\"mx-2 fa fa-search-plus\" aria-hidden=\"true\" title=\"\u653E\u5927\" role=\"button\" (click)=\"zoomIn()\"></i>\n <i class=\"mx-2 fa fa-times\" aria-hidden=\"true\" role=\"button\" (click)=\"modal.dismiss('Cross click')\"></i>\n </div>\n </div> \n <div class=\"modal-body d-flex justify-content-center align-items-center \">\n <img width=\"400\" class=\"modal-body-preview\" [src]=\"src\" [style.transform]=\"'scale('+zoom/10+') rotate('+rotate+'deg)'\" >\n </div>\n</ng-template>", styles: [".image_box{text-align:center;position:relative}.image_box img{width:100%}.image_box .img_box:hover .option_box{display:flex}.image_box .option_box{position:absolute;top:0;left:0;width:100%;height:100%;background:#00000040;align-items:center;justify-content:center;display:none;transition:all .2s linear}.image_box .option_box i{cursor:pointer;font-size:18px;color:#fff}.modal-body-preview{transition:all .2s}::ng-deep .dignite-preview .modal-content{background-color:transparent;color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }] }); }
|
|
238
242
|
}
|
|
239
243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePreviewComponent, decorators: [{
|
|
240
244
|
type: Component,
|
|
241
245
|
args: [{ selector: 'fe-file-preview', template: "<div class=\"image_box\" [style]=\"{width:width,maxWidth:'100%'}\">\n <div class=\"img_box\" [class]=\"className\" *ngIf=\"isImage\">\n <img [src]=\"src\" />\n <div class=\"option_box\" *ngIf=\"preview\">\n <i class=\"fa fa-eye \" (click.stop)=\"OpenPreviewImage(content)\"></i>\n </div>\n </div>\n <a [href]=\"src\" [download]=\"name\" target>\n <i class=\"fa fa-file-audio-o fs-1\" *ngIf=\"isAudio\"></i>\n <i class=\"fa fa-file-video-o fs-1\" *ngIf=\"isVideo\"></i>\n <ng-container *ngIf=\"!(isImage||isAudio||isVideo)\">\n <ng-container *ngFor=\"let item of _ImageTypeOption; let i=index\">\n <i class=\"fs-1\" [ngClass]=\"item.icon\" *ngIf=\"item.type===type\"></i>\n </ng-container>\n </ng-container>\n </a>\n</div>\n\n<ng-template #content let-modal>\n <div class=\"modal-header\">\n <div class=\"d-flex justify-content-end w-100 fs-3\">\n <i class=\"mx-2 fa fa fa-repeat\" aria-hidden=\"true\" title=\"\u53F3\u65CB\u8F6C\" role=\"button\" (click)=\"RotateRight()\"></i>\n <i class=\"mx-2 fa fa-search-minus\" aria-hidden=\"true\" title=\"\u7F29\u5C0F\" role=\"button\" (click)=\"zoomOut()\"></i>\n <i class=\"mx-2 fa fa-search-plus\" aria-hidden=\"true\" title=\"\u653E\u5927\" role=\"button\" (click)=\"zoomIn()\"></i>\n <i class=\"mx-2 fa fa-times\" aria-hidden=\"true\" role=\"button\" (click)=\"modal.dismiss('Cross click')\"></i>\n </div>\n </div> \n <div class=\"modal-body d-flex justify-content-center align-items-center \">\n <img width=\"400\" class=\"modal-body-preview\" [src]=\"src\" [style.transform]=\"'scale('+zoom/10+') rotate('+rotate+'deg)'\" >\n </div>\n</ng-template>", styles: [".image_box{text-align:center;position:relative}.image_box img{width:100%}.image_box .img_box:hover .option_box{display:flex}.image_box .option_box{position:absolute;top:0;left:0;width:100%;height:100%;background:#00000040;align-items:center;justify-content:center;display:none;transition:all .2s linear}.image_box .option_box i{cursor:pointer;font-size:18px;color:#fff}.modal-body-preview{transition:all .2s}::ng-deep .dignite-preview .modal-content{background-color:transparent;color:#fff}\n"] }]
|
|
242
|
-
}], ctorParameters: () => [{ type:
|
|
246
|
+
}], ctorParameters: () => [{ type: i1.NgbModal }], propDecorators: { width: [{
|
|
243
247
|
type: Input
|
|
244
248
|
}], src: [{
|
|
245
249
|
type: Input
|
|
@@ -360,6 +364,10 @@ let FileDescriptorService$1 = class FileDescriptorService {
|
|
|
360
364
|
method: 'DELETE',
|
|
361
365
|
url: `/api/file-explorer/files/${id}`,
|
|
362
366
|
}, { apiName: this.apiName, ...config });
|
|
367
|
+
this.deleteByEntityId = (containerName, entityId, config) => this.restService.request({
|
|
368
|
+
method: 'DELETE',
|
|
369
|
+
url: `/api/file-explorer/files/${containerName}/${entityId}`,
|
|
370
|
+
}, { apiName: this.apiName, ...config });
|
|
363
371
|
this.download = (containerName, blobName, fileName, config) => this.restService.request({
|
|
364
372
|
method: 'GET',
|
|
365
373
|
url: `/api/file-explorer/files/download/${containerName}/${blobName}`,
|
|
@@ -371,14 +379,17 @@ let FileDescriptorService$1 = class FileDescriptorService {
|
|
|
371
379
|
}, { apiName: this.apiName, ...config });
|
|
372
380
|
this.getFileContainerConfiguration = (containerName, config) => this.restService.request({
|
|
373
381
|
method: 'GET',
|
|
374
|
-
url:
|
|
375
|
-
params: { containerName },
|
|
382
|
+
url: `/api/file-explorer/files/${containerName}/configuration`,
|
|
376
383
|
}, { apiName: this.apiName, ...config });
|
|
377
384
|
this.getList = (input, config) => this.restService.request({
|
|
378
385
|
method: 'GET',
|
|
379
386
|
url: '/api/file-explorer/files',
|
|
380
387
|
params: { containerName: input.containerName, directoryId: input.directoryId, creatorId: input.creatorId, filter: input.filter, entityId: input.entityId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
381
388
|
}, { apiName: this.apiName, ...config });
|
|
389
|
+
this.getListByEntityId = (containerName, entityId, config) => this.restService.request({
|
|
390
|
+
method: 'GET',
|
|
391
|
+
url: `/api/file-explorer/files/${containerName}/${entityId}/all`,
|
|
392
|
+
}, { apiName: this.apiName, ...config });
|
|
382
393
|
this.getStream = (containerName, blobName, imageResize, config) => this.restService.request({
|
|
383
394
|
method: 'GET',
|
|
384
395
|
responseType: 'blob',
|
|
@@ -447,12 +458,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
447
458
|
/* eslint-disable @angular-eslint/component-selector */
|
|
448
459
|
var that$1;
|
|
449
460
|
class FileModalTreeComponent {
|
|
450
|
-
constructor(_DescriptorService, fb, toaster, _FileApiService, _LocalizationService) {
|
|
461
|
+
constructor(_DescriptorService, fb, toaster, _FileApiService, _LocalizationService, confirmation) {
|
|
451
462
|
this._DescriptorService = _DescriptorService;
|
|
452
463
|
this.fb = fb;
|
|
453
464
|
this.toaster = toaster;
|
|
454
465
|
this._FileApiService = _FileApiService;
|
|
455
466
|
this._LocalizationService = _LocalizationService;
|
|
467
|
+
this.confirmation = confirmation;
|
|
456
468
|
/**文件分组列表 */
|
|
457
469
|
this.fileGroupList = [];
|
|
458
470
|
/**选择的tree节点 */
|
|
@@ -463,25 +475,41 @@ class FileModalTreeComponent {
|
|
|
463
475
|
this.anExpandedNode = [];
|
|
464
476
|
/**tree节点选择回调 */
|
|
465
477
|
this.nodeClick = new EventEmitter();
|
|
466
|
-
|
|
478
|
+
/**获取数据后回调给file-modal */
|
|
479
|
+
this.treeNodeData = new EventEmitter();
|
|
480
|
+
/**查看所有文件回调函数,在file-modal中处理逻辑 */
|
|
481
|
+
this.lookAllBtn = new EventEmitter();
|
|
482
|
+
this.handleClick = event => event.stopPropagation();
|
|
483
|
+
this.selectedNode = [];
|
|
467
484
|
/**判断节点是否选中 */
|
|
468
|
-
this.isNodeSelected =
|
|
485
|
+
this.isNodeSelected = el => {
|
|
486
|
+
return el.key === this._theSelectedTreeNode?.key;
|
|
487
|
+
};
|
|
469
488
|
/**分组 */
|
|
470
489
|
/**模态框-状态-是否打开 */
|
|
471
490
|
this.ModalDescriptorOpen = false;
|
|
472
491
|
/**模态框-descriptor-繁忙状态-用于确定模态的繁忙状态是否为真 */
|
|
473
492
|
this.ModalDescriptorBusy = false;
|
|
493
|
+
this.formValidation = '';
|
|
494
|
+
this._ValidatorsService = inject(ValidatorsService);
|
|
474
495
|
that$1 = this;
|
|
475
496
|
}
|
|
476
497
|
set theSelectedTreeNode(v) {
|
|
477
498
|
this._theSelectedTreeNode = v;
|
|
478
|
-
if (v
|
|
499
|
+
if (v == '') {
|
|
479
500
|
this.loadData();
|
|
480
501
|
}
|
|
481
502
|
}
|
|
482
503
|
set fileContainerName(v) {
|
|
483
504
|
if (v) {
|
|
484
505
|
this._fileContainerName = v;
|
|
506
|
+
// this.loadData();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
ngAfterContentInit() {
|
|
510
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
511
|
+
//Add 'implements AfterContentInit' to the class.
|
|
512
|
+
if (this._fileContainerName) {
|
|
485
513
|
this.loadData();
|
|
486
514
|
}
|
|
487
515
|
}
|
|
@@ -492,48 +520,70 @@ class FileModalTreeComponent {
|
|
|
492
520
|
}
|
|
493
521
|
/**获取文件分组 */
|
|
494
522
|
getFileGroupList() {
|
|
495
|
-
this._DescriptorService
|
|
523
|
+
this._DescriptorService
|
|
524
|
+
.getList({
|
|
496
525
|
containerName: this._fileContainerName,
|
|
497
|
-
})
|
|
526
|
+
})
|
|
527
|
+
.subscribe(async (res) => {
|
|
498
528
|
this.fileGroupList = await this.setTheValueOfTheNodeRecursively(res.items);
|
|
529
|
+
this.treeNodeData.emit(this.fileGroupList);
|
|
499
530
|
});
|
|
500
531
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
532
|
+
/**查看所有文件 */
|
|
533
|
+
onLookAllBtn() {
|
|
534
|
+
this.lookAllBtn.emit();
|
|
535
|
+
}
|
|
536
|
+
/**递归-将列表转化为父子级结构 */
|
|
537
|
+
setTheValueOfTheNodeRecursively(array, parentId = null, root) {
|
|
538
|
+
let rootList = root || array;
|
|
539
|
+
let result = array.filter(item => item.parentId === parentId);
|
|
540
|
+
result.sort((a, b) => a.order - b.order);
|
|
541
|
+
result.map((el) => {
|
|
542
|
+
el.title = el.name;
|
|
543
|
+
el.key = el.id;
|
|
544
|
+
el.entity = el.id; /** 节点值 */
|
|
545
|
+
el.expanded = this.anExpandedNode.includes(el.key);
|
|
546
|
+
el.children.sort((a, b) => a.order - b.order);
|
|
547
|
+
if (el.children.length > 0) {
|
|
548
|
+
this.setTheValueOfTheNodeRecursively(el.children, el.id, rootList);
|
|
549
|
+
}
|
|
513
550
|
});
|
|
551
|
+
return result;
|
|
514
552
|
}
|
|
515
553
|
/**tree-拖拽 */
|
|
516
|
-
nzEvent(event) {
|
|
517
|
-
}
|
|
554
|
+
nzEvent(event) { }
|
|
518
555
|
/**tree-拖拽 -验证*/
|
|
519
556
|
beforeDrop(arg) {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
557
|
+
const { pos, dragNode, node } = arg;
|
|
558
|
+
// 只处理有效的拖拽位置
|
|
559
|
+
if (pos === 0 || pos === 1 || pos === -1) {
|
|
560
|
+
// 根据不同的拖拽位置计算参数
|
|
561
|
+
const parentId = pos === 0 ? node.key : node.parentNode?.key || '';
|
|
562
|
+
let order;
|
|
563
|
+
if (pos === 1) {
|
|
564
|
+
order = node.origin.order + 1;
|
|
565
|
+
}
|
|
566
|
+
else if (pos === 0) {
|
|
567
|
+
order = node.origin.children.length + 1;
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
// pos === -1
|
|
571
|
+
order = Math.max(0, node.origin.order - 1);
|
|
572
|
+
}
|
|
573
|
+
// 统一处理移动逻辑
|
|
574
|
+
return that$1._DescriptorService.move(dragNode.key, { parentId, order }).pipe(tap(() => that$1.getFileGroupList()), map(() => true));
|
|
531
575
|
}
|
|
576
|
+
return of(false);
|
|
532
577
|
}
|
|
533
578
|
/**tree--选择节点 */
|
|
534
|
-
activeNode(
|
|
535
|
-
|
|
536
|
-
|
|
579
|
+
activeNode(node) {
|
|
580
|
+
if (event?.target?.localName == 'i')
|
|
581
|
+
return;
|
|
582
|
+
if (this._theSelectedTreeNode?.key == node.key)
|
|
583
|
+
return;
|
|
584
|
+
this.selectedNode = [node];
|
|
585
|
+
this._theSelectedTreeNode = node;
|
|
586
|
+
this.nodeClick.emit(node);
|
|
537
587
|
}
|
|
538
588
|
/**点击展开树节点图标触发 */
|
|
539
589
|
nzExpandChange(event) {
|
|
@@ -552,23 +602,32 @@ class FileModalTreeComponent {
|
|
|
552
602
|
this.ModalDescriptorForm = this.fb.group({
|
|
553
603
|
containerName: [this._fileContainerName || '', Validators.required],
|
|
554
604
|
name: ['', Validators.required],
|
|
555
|
-
parentId: [items?.key || ''
|
|
605
|
+
parentId: [items?.key || ''],
|
|
556
606
|
});
|
|
557
607
|
/**编辑 */
|
|
558
608
|
if (edit) {
|
|
559
609
|
this.theNodeBeingEdited = items.origin;
|
|
560
610
|
this.ModalDescriptorForm.patchValue({
|
|
561
|
-
name: items.origin.name
|
|
611
|
+
name: items.origin.name,
|
|
562
612
|
});
|
|
563
613
|
}
|
|
564
614
|
}
|
|
565
615
|
/**删除分组 */
|
|
566
616
|
deleteDescriptorBtn(node) {
|
|
567
|
-
this.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
617
|
+
this.confirmation
|
|
618
|
+
.warn('', {
|
|
619
|
+
key: '',
|
|
620
|
+
defaultValue: this._LocalizationService.instant(`FileExplorer::DeletionConfirmationMessage`, node.title),
|
|
621
|
+
})
|
|
622
|
+
.subscribe((status) => {
|
|
623
|
+
if (status == 'confirm') {
|
|
624
|
+
this._DescriptorService.delete(node.key).subscribe(res => {
|
|
625
|
+
this.ModalDescriptorOpen = false;
|
|
626
|
+
if (this.theNodeBeingEdited.key == node.key)
|
|
627
|
+
this.theNodeBeingEdited = '';
|
|
628
|
+
this.getFileGroupList();
|
|
629
|
+
});
|
|
630
|
+
}
|
|
572
631
|
});
|
|
573
632
|
}
|
|
574
633
|
/**模态框-descriptor-状态改变回调 */
|
|
@@ -582,28 +641,52 @@ class FileModalTreeComponent {
|
|
|
582
641
|
/**f分组模态框保存 */
|
|
583
642
|
createOrEditSave() {
|
|
584
643
|
let input = this.ModalDescriptorForm.value;
|
|
644
|
+
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.ModalDescriptorForm);
|
|
645
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'FileExplorer'))
|
|
646
|
+
return;
|
|
647
|
+
if (!this.ModalDescriptorForm.valid)
|
|
648
|
+
return;
|
|
649
|
+
if (this.ModalDescriptorBusy)
|
|
650
|
+
return;
|
|
651
|
+
this.ModalDescriptorBusy = true;
|
|
585
652
|
if (this.theNodeBeingEdited) {
|
|
586
|
-
this._DescriptorService
|
|
653
|
+
this._DescriptorService
|
|
654
|
+
.update(this.theNodeBeingEdited.key, input)
|
|
655
|
+
.pipe(finalize(() => {
|
|
656
|
+
this.ModalDescriptorBusy = false;
|
|
657
|
+
}))
|
|
658
|
+
.subscribe(res => {
|
|
587
659
|
this.ModalDescriptorOpen = false;
|
|
660
|
+
this.ModalDescriptorVisibleChange(false);
|
|
588
661
|
this.getFileGroupList();
|
|
589
662
|
});
|
|
590
663
|
return;
|
|
591
664
|
}
|
|
592
|
-
this._DescriptorService
|
|
665
|
+
this._DescriptorService
|
|
666
|
+
.create(input)
|
|
667
|
+
.pipe(finalize(() => {
|
|
668
|
+
this.ModalDescriptorBusy = false;
|
|
669
|
+
}))
|
|
670
|
+
.subscribe(res => {
|
|
593
671
|
this.ModalDescriptorOpen = false;
|
|
672
|
+
this.ModalDescriptorVisibleChange(false);
|
|
594
673
|
this.getFileGroupList();
|
|
595
674
|
});
|
|
596
675
|
}
|
|
597
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalTreeComponent, deps: [{ token: FileDescriptorService }, { token: i1.FormBuilder }, { token: i2$1.ToasterService }, { token: FileApiService }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
598
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
676
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalTreeComponent, deps: [{ token: FileDescriptorService }, { token: i1$1.FormBuilder }, { token: i2$1.ToasterService }, { token: FileApiService }, { token: i3.LocalizationService }, { token: i2$1.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
677
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: FileModalTreeComponent, selector: "fe-file-modal-tree", inputs: { theSelectedTreeNode: "theSelectedTreeNode", fileContainerName: "fileContainerName" }, outputs: { nodeClick: "nodeClick", treeNodeData: "treeNodeData", lookAllBtn: "lookAllBtn" }, viewQueries: [{ propertyName: "ModalFormDescriptorSubmit", first: true, predicate: ["ModalFormDescriptorSubmit"], descendants: true }], ngImport: i0, template: "<div class=\"card-header p-0 mb-1 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0 btn-link\" role=\"button\" (click.stop)=\"onLookAllBtn()\">{{'FileExplorer::MyDirectories' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-light btn-sm ms-2\" (click.stop)=\"addDescriptorBtn()\"><i\n class=\"fas fa-plus-circle\" aria-hidden=\"true\"></i></button>\n</div>\n@if(fileGroupList.length>0){\n<abp-tree [nodes]=\"fileGroupList\" (nzExpandChange)=\"nzExpandChange($event)\" [draggable]=\"true\"\n (dropOver)=\"nzEvent($event)\" [beforeDrop]=\"beforeDrop\" (selectedNodeChange)=\"activeNode($event)\" [changeCheckboxWithNode]=\"true\" [isNodeSelected]=\"isNodeSelected\">\n\n <ng-template #menu let-node>\n <button ngbDropdownItem (click.stop)=\"addDescriptorBtn(node)\"><i\n class=\" me-1 fa fa-pencil\"></i>{{'FileExplorer::NewDirectory' | abpLocalization}}</button>\n <button ngbDropdownItem (click.stop)=\"addDescriptorBtn(node,true)\"><i\n class=\" me-1 fa fa-plus\"></i>{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem (click.stop)=\"deleteDescriptorBtn(node)\"><i\n class=\" me-1 fa fa-remove\"></i>{{'AbpUi::Delete' | abpLocalization}}</button>\n </ng-template>\n\n <ng-template abpTreeExpandedIconTemplate let-node let-origin=\"origin\">\n <i aria-hidden=\"true\" *ngIf=\"node.children.length>0\">\n <ng-container *ngTemplateOutlet=\"node.isExpanded ? minusIcon : plusIcon\"></ng-container></i>\n </ng-template>\n\n <ng-template #minusIcon>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\"\n clip-rule=\"evenodd\">\n <path\n d=\"M11.5 0c6.347 0 11.5 5.153 11.5 11.5s-5.153 11.5-11.5 11.5-11.5-5.153-11.5-11.5 5.153-11.5 11.5-11.5zm0 1c5.795 0 10.5 4.705 10.5 10.5s-4.705 10.5-10.5 10.5-10.5-4.705-10.5-10.5 4.705-10.5 10.5-10.5zm-6.5 10h13v1h-13v-1z\" />\n </svg>\n </ng-template>\n\n <ng-template #plusIcon>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\"\n clip-rule=\"evenodd\">\n <path\n d=\"M11.5 0c6.347 0 11.5 5.153 11.5 11.5s-5.153 11.5-11.5 11.5-11.5-5.153-11.5-11.5 5.153-11.5 11.5-11.5zm0 1c5.795 0 10.5 4.705 10.5 10.5s-4.705 10.5-10.5 10.5-10.5-4.705-10.5-10.5 4.705-10.5 10.5-10.5zm.5 10h6v1h-6v6h-1v-6h-6v-1h6v-6h1v6z\" />\n </svg>\n </ng-template>\n</abp-tree>\n\n}\n<abp-modal [(visible)]=\"ModalDescriptorOpen\" [busy]=\"ModalDescriptorBusy\"\n (visibleChange)=\"ModalDescriptorVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{theNodeBeingEdited?('AbpUi::Edit' | abpLocalization):('FileExplorer::NewDirectory' | abpLocalization)}}\n </h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"ModalDescriptorForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"ModalDescriptorForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #ModalFormDescriptorSubmit style=\"display: none\"></button>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'FileExplorer::DirectoryName' | abpLocalization}}</label>\n <input type=\"email\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [loading]=\"ModalDescriptorBusy\"\n (click)=\"ModalFormDescriptorSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i3$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2$1.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2$1.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i1.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i1.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "directive", type: i9.ExpandedIconTemplateDirective, selector: "[abpTreeExpandedIconTemplate],[abp-tree-expanded-icon-template]" }, { kind: "component", type: i9.TreeComponent, selector: "abp-tree", inputs: ["noAnimation", "draggable", "checkable", "checkStrictly", "checkedKeys", "nodes", "expandedKeys", "selectedNode", "changeCheckboxWithNode", "isNodeSelected", "beforeDrop"], outputs: ["checkedKeysChange", "expandedKeysChange", "selectedNodeChange", "dropOver", "nzExpandChange"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
599
678
|
}
|
|
600
679
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalTreeComponent, decorators: [{
|
|
601
680
|
type: Component,
|
|
602
|
-
args: [{ selector: 'fe-file-modal-tree', template: "<div class=\"card-header p-0 mb-1 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0\">{{'FileExplorer::MyDirectories' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-light btn-sm ms-2\" (click.stop)=\"addDescriptorBtn()\"><i\n class=\"fas fa-plus-circle\" aria-hidden=\"true\"></i></button>\n</div>\n<
|
|
603
|
-
}], ctorParameters: () => [{ type: FileDescriptorService }, { type: i1.FormBuilder }, { type: i2$1.ToasterService }, { type: FileApiService }, { type: i3.LocalizationService }], propDecorators: { theSelectedTreeNode: [{
|
|
681
|
+
args: [{ selector: 'fe-file-modal-tree', template: "<div class=\"card-header p-0 mb-1 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0 btn-link\" role=\"button\" (click.stop)=\"onLookAllBtn()\">{{'FileExplorer::MyDirectories' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-light btn-sm ms-2\" (click.stop)=\"addDescriptorBtn()\"><i\n class=\"fas fa-plus-circle\" aria-hidden=\"true\"></i></button>\n</div>\n@if(fileGroupList.length>0){\n<abp-tree [nodes]=\"fileGroupList\" (nzExpandChange)=\"nzExpandChange($event)\" [draggable]=\"true\"\n (dropOver)=\"nzEvent($event)\" [beforeDrop]=\"beforeDrop\" (selectedNodeChange)=\"activeNode($event)\" [changeCheckboxWithNode]=\"true\" [isNodeSelected]=\"isNodeSelected\">\n\n <ng-template #menu let-node>\n <button ngbDropdownItem (click.stop)=\"addDescriptorBtn(node)\"><i\n class=\" me-1 fa fa-pencil\"></i>{{'FileExplorer::NewDirectory' | abpLocalization}}</button>\n <button ngbDropdownItem (click.stop)=\"addDescriptorBtn(node,true)\"><i\n class=\" me-1 fa fa-plus\"></i>{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem (click.stop)=\"deleteDescriptorBtn(node)\"><i\n class=\" me-1 fa fa-remove\"></i>{{'AbpUi::Delete' | abpLocalization}}</button>\n </ng-template>\n\n <ng-template abpTreeExpandedIconTemplate let-node let-origin=\"origin\">\n <i aria-hidden=\"true\" *ngIf=\"node.children.length>0\">\n <ng-container *ngTemplateOutlet=\"node.isExpanded ? minusIcon : plusIcon\"></ng-container></i>\n </ng-template>\n\n <ng-template #minusIcon>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\"\n clip-rule=\"evenodd\">\n <path\n d=\"M11.5 0c6.347 0 11.5 5.153 11.5 11.5s-5.153 11.5-11.5 11.5-11.5-5.153-11.5-11.5 5.153-11.5 11.5-11.5zm0 1c5.795 0 10.5 4.705 10.5 10.5s-4.705 10.5-10.5 10.5-10.5-4.705-10.5-10.5 4.705-10.5 10.5-10.5zm-6.5 10h13v1h-13v-1z\" />\n </svg>\n </ng-template>\n\n <ng-template #plusIcon>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\"\n clip-rule=\"evenodd\">\n <path\n d=\"M11.5 0c6.347 0 11.5 5.153 11.5 11.5s-5.153 11.5-11.5 11.5-11.5-5.153-11.5-11.5 5.153-11.5 11.5-11.5zm0 1c5.795 0 10.5 4.705 10.5 10.5s-4.705 10.5-10.5 10.5-10.5-4.705-10.5-10.5 4.705-10.5 10.5-10.5zm.5 10h6v1h-6v6h-1v-6h-6v-1h6v-6h1v6z\" />\n </svg>\n </ng-template>\n</abp-tree>\n\n}\n<abp-modal [(visible)]=\"ModalDescriptorOpen\" [busy]=\"ModalDescriptorBusy\"\n (visibleChange)=\"ModalDescriptorVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{theNodeBeingEdited?('AbpUi::Edit' | abpLocalization):('FileExplorer::NewDirectory' | abpLocalization)}}\n </h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"ModalDescriptorForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"ModalDescriptorForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #ModalFormDescriptorSubmit style=\"display: none\"></button>\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'FileExplorer::DirectoryName' | abpLocalization}}</label>\n <input type=\"email\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [loading]=\"ModalDescriptorBusy\"\n (click)=\"ModalFormDescriptorSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
|
|
682
|
+
}], ctorParameters: () => [{ type: FileDescriptorService }, { type: i1$1.FormBuilder }, { type: i2$1.ToasterService }, { type: FileApiService }, { type: i3.LocalizationService }, { type: i2$1.ConfirmationService }], propDecorators: { theSelectedTreeNode: [{
|
|
604
683
|
type: Input
|
|
605
684
|
}], nodeClick: [{
|
|
606
685
|
type: Output
|
|
686
|
+
}], treeNodeData: [{
|
|
687
|
+
type: Output
|
|
688
|
+
}], lookAllBtn: [{
|
|
689
|
+
type: Output
|
|
607
690
|
}], fileContainerName: [{
|
|
608
691
|
type: Input
|
|
609
692
|
}], ModalFormDescriptorSubmit: [{
|
|
@@ -611,6 +694,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
611
694
|
args: ['ModalFormDescriptorSubmit', { static: false }]
|
|
612
695
|
}] } });
|
|
613
696
|
|
|
697
|
+
class GetDirectoryNamePipe {
|
|
698
|
+
transform(value, ...args) {
|
|
699
|
+
if (value) {
|
|
700
|
+
return args[0].find(el => el.id == value)?.name;
|
|
701
|
+
}
|
|
702
|
+
return '';
|
|
703
|
+
}
|
|
704
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetDirectoryNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
705
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: GetDirectoryNamePipe, isStandalone: true, name: "getDirectoryName" }); }
|
|
706
|
+
}
|
|
707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetDirectoryNamePipe, decorators: [{
|
|
708
|
+
type: Pipe,
|
|
709
|
+
args: [{
|
|
710
|
+
name: 'getDirectoryName',
|
|
711
|
+
standalone: true
|
|
712
|
+
}]
|
|
713
|
+
}] });
|
|
714
|
+
|
|
614
715
|
var that;
|
|
615
716
|
class FileModalComponent {
|
|
616
717
|
constructor(_FileService, toaster, list, _FileApiService, restService, confirmation, _LocalizationService) {
|
|
@@ -627,8 +728,8 @@ class FileModalComponent {
|
|
|
627
728
|
/**是否多选 */
|
|
628
729
|
this._multiple = false;
|
|
629
730
|
/**文件大小限制
|
|
630
|
-
|
|
631
|
-
|
|
731
|
+
* @param 1mb
|
|
732
|
+
*/
|
|
632
733
|
this.sizeLimit = 1048576;
|
|
633
734
|
/**模态框状态回调 */
|
|
634
735
|
this.visibleChange = new EventEmitter();
|
|
@@ -639,6 +740,9 @@ class FileModalComponent {
|
|
|
639
740
|
/**dignite-file-modal-tree */
|
|
640
741
|
/**选择的tree节点 */
|
|
641
742
|
this._theSelectedTreeNode = '';
|
|
743
|
+
this.isCreateList = false;
|
|
744
|
+
/** 从tree获取来的数据 */
|
|
745
|
+
this.fileGroupList = [];
|
|
642
746
|
/**图片上传-要上传图片的状态文件列表 */
|
|
643
747
|
this.uploadPictureStatusList = [];
|
|
644
748
|
/**文件表格-数据*/
|
|
@@ -650,45 +754,57 @@ class FileModalComponent {
|
|
|
650
754
|
this.filters = {};
|
|
651
755
|
/**文件表格-表格自带选择类型 */
|
|
652
756
|
this.SelectionType = SelectionType;
|
|
653
|
-
/**文件表格-选择的表格数据项 */
|
|
654
|
-
this.selectedTable = [];
|
|
655
|
-
/**当前选择的table项 id */
|
|
656
|
-
this.nowSelectId = '';
|
|
657
757
|
/**选择文件回调 */
|
|
658
758
|
this.selectFilefn = new EventEmitter();
|
|
659
|
-
/**一个布尔or函数,可用于检查是否要根据条件选择特定行。 */
|
|
660
|
-
this.selectCheck = (row, column, value) => {
|
|
661
|
-
this.nowSelectId = row.id;
|
|
662
|
-
return true;
|
|
663
|
-
};
|
|
664
|
-
/**判断row是否选中 */
|
|
665
|
-
this.selectedcheckbox = (id) => {
|
|
666
|
-
return this.selectedTable.some(el => el.id == id);
|
|
667
|
-
};
|
|
668
759
|
/**创建图片的接口,代理中的file类型不匹配,切换为any类型 */
|
|
669
760
|
this.createFile = (input, config) => this.restService.request({
|
|
670
761
|
method: 'POST',
|
|
671
762
|
url: '/api/file-explorer/files',
|
|
672
|
-
params: {
|
|
763
|
+
params: {
|
|
764
|
+
containerName: input.containerName,
|
|
765
|
+
cellName: input.cellName,
|
|
766
|
+
directoryId: input.directoryId,
|
|
767
|
+
entityId: input.entityId,
|
|
768
|
+
},
|
|
673
769
|
body: input.file,
|
|
674
770
|
}, { apiName: 'FileExplorer', ...config });
|
|
771
|
+
/**文件表格-选择的表格数据项 */
|
|
772
|
+
this.selectedTable = [];
|
|
773
|
+
/**当前选择的table项 id */
|
|
774
|
+
this.nowSelectId = '';
|
|
775
|
+
/**是否全选 */
|
|
776
|
+
this.isAllSelected = false;
|
|
777
|
+
/**判断row是否选中 */
|
|
778
|
+
this.selectedcheckbox = id => {
|
|
779
|
+
return this.selectedTable.some(el => el.id === id);
|
|
780
|
+
};
|
|
781
|
+
/**当前编辑的row */
|
|
782
|
+
this.newEditRow = '';
|
|
783
|
+
/**是否正在加载 */
|
|
784
|
+
this.isloading = false;
|
|
675
785
|
that = this;
|
|
676
786
|
}
|
|
677
787
|
/**获取目录配置 */
|
|
678
788
|
getFilesConfiguration() {
|
|
679
|
-
|
|
680
|
-
this.
|
|
789
|
+
return new Promise((resolve, reject) => {
|
|
790
|
+
this._FileDescriptorService
|
|
791
|
+
.getFileContainerConfiguration(this._fileContainerName)
|
|
792
|
+
.subscribe(res => {
|
|
793
|
+
this.createDirectoryPermissionName = res?.createDirectoryPermissionName;
|
|
794
|
+
resolve(res);
|
|
795
|
+
});
|
|
681
796
|
});
|
|
682
797
|
}
|
|
683
798
|
set fileContainerName(v) {
|
|
684
799
|
if (v) {
|
|
685
800
|
this._fileContainerName = v;
|
|
686
|
-
this.loadData()
|
|
801
|
+
// this.loadData()
|
|
687
802
|
}
|
|
688
803
|
}
|
|
689
804
|
set multiple(v) {
|
|
690
805
|
this._multiple = v;
|
|
691
|
-
if (v) {
|
|
806
|
+
if (v) {
|
|
807
|
+
}
|
|
692
808
|
}
|
|
693
809
|
set limit(v) {
|
|
694
810
|
this.sizeLimit = v;
|
|
@@ -703,7 +819,13 @@ class FileModalComponent {
|
|
|
703
819
|
/**模态框-状态改变回调 */
|
|
704
820
|
ModalVisibleChange(event) {
|
|
705
821
|
if (!event) {
|
|
822
|
+
this.ModalOpen = false;
|
|
823
|
+
this.ModalBusy = false;
|
|
706
824
|
this.visibleChange.emit(event);
|
|
825
|
+
this.createDirectoryPermissionName = '';
|
|
826
|
+
this._theSelectedTreeNode = '';
|
|
827
|
+
this.selectedTable = [];
|
|
828
|
+
this.uploadPictureStatusList = [];
|
|
707
829
|
return;
|
|
708
830
|
}
|
|
709
831
|
}
|
|
@@ -716,12 +838,47 @@ class FileModalComponent {
|
|
|
716
838
|
/**初始化数据 */
|
|
717
839
|
loadData() {
|
|
718
840
|
if (this.ModalOpen && this._fileContainerName) {
|
|
719
|
-
this.
|
|
841
|
+
this.list.maxResultCount = 100;
|
|
842
|
+
// this.filters.skipCount = 0;
|
|
720
843
|
this.getFilesConfiguration();
|
|
844
|
+
if (!this.isCreateList) {
|
|
845
|
+
this.hookToQuery();
|
|
846
|
+
this.isCreateList = true;
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
this.list.get();
|
|
850
|
+
}
|
|
721
851
|
}
|
|
722
852
|
}
|
|
853
|
+
/** 从tree获取数据 */
|
|
854
|
+
treeNodeData(event) {
|
|
855
|
+
this.fileGroupList = this.flattenNestedArray(event);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* 将嵌套数组扁平化
|
|
859
|
+
* @param {Array} nestedArray - 包含嵌套children的数组
|
|
860
|
+
* @returns {Array} - 扁平化后的数组
|
|
861
|
+
*/
|
|
862
|
+
flattenNestedArray(nestedArray) {
|
|
863
|
+
let result = [];
|
|
864
|
+
function flatten(items) {
|
|
865
|
+
if (!items)
|
|
866
|
+
return;
|
|
867
|
+
for (const item of items) {
|
|
868
|
+
// 将当前项添加到结果数组
|
|
869
|
+
result.push({ ...item });
|
|
870
|
+
// 如果有children属性且是数组,递归处理
|
|
871
|
+
if (item.children && Array.isArray(item.children)) {
|
|
872
|
+
flatten(item.children);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
flatten(nestedArray);
|
|
877
|
+
return result;
|
|
878
|
+
}
|
|
723
879
|
/**tree-节点选择 */
|
|
724
880
|
_nodeClick(event) {
|
|
881
|
+
this.filters.skipCount = 0;
|
|
725
882
|
this._theSelectedTreeNode = event;
|
|
726
883
|
this.list.get();
|
|
727
884
|
}
|
|
@@ -734,12 +891,15 @@ class FileModalComponent {
|
|
|
734
891
|
this.setuploadPictureStatus(file, 2);
|
|
735
892
|
continue;
|
|
736
893
|
}
|
|
737
|
-
await this.uploadingFile(file)
|
|
894
|
+
await this.uploadingFile(file)
|
|
895
|
+
.then(res => {
|
|
896
|
+
this.selectedTable.push(res);
|
|
738
897
|
this.setuploadPictureStatus(file, 1);
|
|
739
|
-
this.list.get()
|
|
740
|
-
})
|
|
898
|
+
// this.list.get()
|
|
899
|
+
})
|
|
900
|
+
.catch(() => {
|
|
741
901
|
this.setuploadPictureStatus(file, 2);
|
|
742
|
-
}); // 等待每个文件上传完成
|
|
902
|
+
}); // 等待每个文件上传完成
|
|
743
903
|
}
|
|
744
904
|
this.list.get();
|
|
745
905
|
let isSubmit = !this.uploadPictureStatusList.some(el => el.status == 2);
|
|
@@ -747,7 +907,7 @@ class FileModalComponent {
|
|
|
747
907
|
// this.toaster.success("上传完成");
|
|
748
908
|
setTimeout(() => {
|
|
749
909
|
this.uploadPictureStatusList = [];
|
|
750
|
-
},
|
|
910
|
+
}, 4000);
|
|
751
911
|
}
|
|
752
912
|
}
|
|
753
913
|
/**图片上传-设置uploadPictureStatusList的状态 */
|
|
@@ -766,43 +926,156 @@ class FileModalComponent {
|
|
|
766
926
|
file: formData,
|
|
767
927
|
containerName: this._fileContainerName,
|
|
768
928
|
directoryId: this._theSelectedTreeNode?.key || '',
|
|
769
|
-
entityId: ''
|
|
929
|
+
entityId: '',
|
|
770
930
|
}).subscribe(res => {
|
|
771
|
-
resolve(
|
|
772
|
-
},
|
|
931
|
+
resolve(res);
|
|
932
|
+
}, err => {
|
|
773
933
|
rejects(false);
|
|
774
934
|
});
|
|
775
935
|
});
|
|
776
936
|
}
|
|
777
|
-
ngOnChanges(changes) {
|
|
778
|
-
//Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
|
|
779
|
-
//Add '${implements OnChanges}' to the class.
|
|
780
|
-
this.selectedTable = this._FileApiService.deepClone(this.selectPickerFile);
|
|
781
|
-
}
|
|
782
937
|
/**文件表格-获取表格数据 */
|
|
783
938
|
hookToQuery() {
|
|
784
939
|
const getData = (query) => this._FileService.getList({
|
|
785
940
|
...query,
|
|
786
941
|
...this.filters,
|
|
787
942
|
containerName: this._fileContainerName,
|
|
788
|
-
directoryId: this._theSelectedTreeNode.key
|
|
943
|
+
directoryId: this._theSelectedTreeNode.key,
|
|
789
944
|
});
|
|
790
|
-
const setData = (list) =>
|
|
945
|
+
const setData = (list) => {
|
|
946
|
+
this.data = list;
|
|
947
|
+
this.onPageChange(list.items);
|
|
948
|
+
};
|
|
791
949
|
this.list.hookToQuery(getData).subscribe(setData);
|
|
792
950
|
}
|
|
793
951
|
/**文件表格-查看所有分组的文件数据 */
|
|
794
952
|
lookAllFile() {
|
|
953
|
+
this.filters.skipCount = 0;
|
|
795
954
|
this._theSelectedTreeNode = '';
|
|
796
955
|
this.list.get();
|
|
797
956
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
this.
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
957
|
+
/**删除图片 */
|
|
958
|
+
deleteFile(file) {
|
|
959
|
+
this._FileService.delete(file.id).subscribe(res => {
|
|
960
|
+
this.toaster.success(this._LocalizationService.instant(`FileExplorer::DeletedSuccessfully`));
|
|
961
|
+
this.list.get();
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
/**删除所有选中图片 */
|
|
965
|
+
onDeleteAllSelectFile() {
|
|
966
|
+
this.confirmation
|
|
967
|
+
.warn('', {
|
|
968
|
+
key: '',
|
|
969
|
+
defaultValue: this._LocalizationService.instant(`FileExplorer::AreYouSure`),
|
|
970
|
+
})
|
|
971
|
+
.subscribe(async (status) => {
|
|
972
|
+
if (status == 'confirm') {
|
|
973
|
+
let selectedTable = this.selectedTable;
|
|
974
|
+
try {
|
|
975
|
+
const result = await this.batchDeleteItems(selectedTable);
|
|
976
|
+
if (result.success) {
|
|
977
|
+
this.toaster.success(result.message);
|
|
978
|
+
this.list.get();
|
|
979
|
+
// 可能需要刷新表格或更新UI
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
//删除失败的项
|
|
983
|
+
this.list.get();
|
|
984
|
+
// console.warn(result.message);
|
|
985
|
+
// 可以选择展示失败项或重试
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
catch (error) {
|
|
989
|
+
//批量删除过程中发生错误
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* 批量删除表格项
|
|
996
|
+
* @param selectedTable 需要删除的表格项数组
|
|
997
|
+
* @returns 包含成功状态和失败项的结果对象
|
|
998
|
+
*/
|
|
999
|
+
async batchDeleteItems(selectedTable) {
|
|
1000
|
+
// 存储所有删除请求的Promise
|
|
1001
|
+
const deletePromises = selectedTable.map(item => {
|
|
1002
|
+
return new Promise((resolve, reject) => {
|
|
1003
|
+
this._FileService.delete(item.id).subscribe(() => {
|
|
1004
|
+
resolve(null);
|
|
1005
|
+
}, () => {
|
|
1006
|
+
reject(item);
|
|
1007
|
+
});
|
|
1008
|
+
});
|
|
1009
|
+
});
|
|
1010
|
+
// 等待所有请求完成
|
|
1011
|
+
const results = await Promise.allSettled(deletePromises);
|
|
1012
|
+
console.log(results, 'resultsresultsresults');
|
|
1013
|
+
// 收集失败的项
|
|
1014
|
+
const failedItems = [];
|
|
1015
|
+
results.forEach(result => {
|
|
1016
|
+
if (result.status === 'rejected') {
|
|
1017
|
+
failedItems.push(result.reason);
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
return {
|
|
1021
|
+
success: failedItems.length === 0,
|
|
1022
|
+
failedItems,
|
|
1023
|
+
message: failedItems.length === 0
|
|
1024
|
+
? this._LocalizationService.instant(`FileExplorer::DeletedSuccessfully`)
|
|
1025
|
+
: `${failedItems.length}个项删除失败`,
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
// 使用示例
|
|
1029
|
+
async handleBatchDelete() { }
|
|
1030
|
+
/**关闭文件状态弹窗 */
|
|
1031
|
+
closeFileStatusModal() {
|
|
1032
|
+
this.uploadPictureStatusList = [];
|
|
1033
|
+
}
|
|
1034
|
+
ngOnChanges(changes) {
|
|
1035
|
+
//Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
|
|
1036
|
+
//Add '${implements OnChanges}' to the class.
|
|
1037
|
+
this.selectedTable = this._FileApiService.deepClone(this.selectPickerFile);
|
|
1038
|
+
}
|
|
1039
|
+
/**表格分页切换 */
|
|
1040
|
+
onPageChange(newArray) {
|
|
1041
|
+
this.isAllSelected = this.isAllSelectedFn(newArray, this.selectedTable);
|
|
1042
|
+
}
|
|
1043
|
+
/**行选择框改变 */
|
|
1044
|
+
onCheckboxChangeFn(event, row, array) {
|
|
1045
|
+
const { checked } = event.target;
|
|
1046
|
+
let selectedTableArray = [...this.selectedTable];
|
|
1047
|
+
if (this._multiple) {
|
|
1048
|
+
if (checked) {
|
|
1049
|
+
selectedTableArray.push(row);
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
selectedTableArray = selectedTableArray.filter(el => el.id != row.id);
|
|
1053
|
+
}
|
|
1054
|
+
this.isAllSelected = this.isAllSelectedFn(array, selectedTableArray);
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
selectedTableArray.length = 0;
|
|
1058
|
+
selectedTableArray = checked ? [row] : [];
|
|
1059
|
+
}
|
|
1060
|
+
this.selectedTable = this.removeDuplicatesById(selectedTableArray);
|
|
1061
|
+
}
|
|
1062
|
+
/**如果selectedTableArray不含array中的所有项,则将isAllSelected设为true,否则设为false */
|
|
1063
|
+
isAllSelectedFn(tolalArray, selectedArray = []) {
|
|
1064
|
+
if (tolalArray.length == 0)
|
|
1065
|
+
return false;
|
|
1066
|
+
return tolalArray.every(item => selectedArray.some(el => el.id === item.id));
|
|
1067
|
+
}
|
|
1068
|
+
/**选择当前页全部 */
|
|
1069
|
+
onSelectAllFn(event, array) {
|
|
1070
|
+
let selectedTableArray = this.selectedTable;
|
|
1071
|
+
if (event.target.checked) {
|
|
1072
|
+
selectedTableArray = this.removeDuplicatesById([...selectedTableArray, ...array]);
|
|
1073
|
+
}
|
|
1074
|
+
else {
|
|
1075
|
+
selectedTableArray = selectedTableArray.filter(el => !array.some(item => item.id === el.id));
|
|
804
1076
|
}
|
|
805
|
-
this.
|
|
1077
|
+
this.isAllSelected = event.target.checked;
|
|
1078
|
+
this.selectedTable = selectedTableArray;
|
|
806
1079
|
}
|
|
807
1080
|
/**删除数组中重复的项 */
|
|
808
1081
|
removeDuplicatesById(array) {
|
|
@@ -815,32 +1088,61 @@ class FileModalComponent {
|
|
|
815
1088
|
return false;
|
|
816
1089
|
});
|
|
817
1090
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
this.
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1091
|
+
/**提交FileName编辑 */
|
|
1092
|
+
onSubmitFileName(event) {
|
|
1093
|
+
let input = this.FileNameForm.value;
|
|
1094
|
+
if (!this.FileNameForm.valid)
|
|
1095
|
+
return;
|
|
1096
|
+
if (this.isloading)
|
|
1097
|
+
return;
|
|
1098
|
+
this.isloading = true;
|
|
1099
|
+
this._FileService
|
|
1100
|
+
.update(input.id, {
|
|
1101
|
+
name: input.fileName
|
|
1102
|
+
})
|
|
1103
|
+
.pipe(finalize(() => {
|
|
1104
|
+
this.isloading = false;
|
|
1105
|
+
}))
|
|
1106
|
+
.subscribe(res => {
|
|
1107
|
+
//通过当前newEditRow的id,修改data.items中对应项的name
|
|
1108
|
+
for (const element of this.data.items) {
|
|
1109
|
+
if (element.id == this.newEditRow.id) {
|
|
1110
|
+
element.name = input.fileName;
|
|
1111
|
+
break;
|
|
1112
|
+
}
|
|
828
1113
|
}
|
|
1114
|
+
this.FileNameForm = undefined;
|
|
1115
|
+
this.newEditRow = '';
|
|
1116
|
+
this.toaster.success(this._LocalizationService.instant(`FileExplorer::SavedSuccessfully`));
|
|
1117
|
+
// this.list.get();
|
|
829
1118
|
});
|
|
830
1119
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
this.
|
|
1120
|
+
/**打开编辑 */
|
|
1121
|
+
onEditFileName(row) {
|
|
1122
|
+
this.FileNameForm = new FormGroup({
|
|
1123
|
+
fileName: new FormControl('', [Validators.required]),
|
|
1124
|
+
id: new FormControl('', [Validators.required]),
|
|
1125
|
+
});
|
|
1126
|
+
this.FileNameForm.patchValue({
|
|
1127
|
+
fileName: row.name,
|
|
1128
|
+
id: row.id,
|
|
1129
|
+
});
|
|
1130
|
+
this.newEditRow = row;
|
|
1131
|
+
}
|
|
1132
|
+
/**关闭编辑 */
|
|
1133
|
+
onCancelFileName(row) {
|
|
1134
|
+
this.newEditRow = '';
|
|
1135
|
+
this.FileNameForm = undefined;
|
|
834
1136
|
}
|
|
835
1137
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalComponent, deps: [{ token: FileDescriptorService$1 }, { token: i2$1.ToasterService }, { token: i3.ListService }, { token: FileApiService }, { token: i3.RestService }, { token: i2$1.ConfirmationService }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
836
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1138
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: FileModalComponent, selector: "fe-file-modal", inputs: { fileContainerName: "fileContainerName", multiple: "multiple", limit: "limit", visible: "visible", selectPickerFile: "selectPickerFile" }, outputs: { visibleChange: "visibleChange", selectFilefn: "selectFilefn" }, providers: [
|
|
837
1139
|
// [Required]
|
|
838
1140
|
ListService,
|
|
839
1141
|
// [Optional]
|
|
840
1142
|
// Provide this token if you want a different debounce time.
|
|
841
1143
|
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
842
1144
|
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
843
|
-
], usesOnChanges: true, ngImport: i0, template: "<abp-modal [(visible)]=\"ModalOpen\" (visibleChange)=\"ModalVisibleChange($event)\"\n [options]=\"{ size: 'xl', scrollable: false }\">\n <ng-template #abpHeader>\n <h3>{{'FileExplorer::FileExplorer' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <div class=\"row file-explorer-modal-body file-modal\">\n <div class=\"col-3\" *ngIf=\"createDirectoryPermissionName\" style=\"overflow: auto; height: calc(100vh - 240px)\">\n <fe-file-modal-tree [theSelectedTreeNode]=\"_theSelectedTreeNode\" (nodeClick)=\"_nodeClick($event)\"\n [fileContainerName]=\"_fileContainerName\"></fe-file-modal-tree>\n </div>\n <div [class]=\"createDirectoryPermissionName?'col-9':'col-12'\" style=\"height: calc(100vh - 240px)\">\n <div class=\"mb-3 d-flex justify-content-between align-items-center\">\n <div class=\"btn-link\" role=button style=\"flex: 2\" (click)=\"lookAllFile()\">{{'FileExplorer::AllFiles' | abpLocalization}}</div>\n <div class=\"input-group form-file\" style=\"flex: 2\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" \n (change)=\"getFileChange($event)\" />\n </div>\n </div>\n <div>\n <ngx-datatable class=\"material container-height\" [rows]=\"data.items\" [list]=\"list\" columnMode=\"flex\"\n [columns]=\"columns\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\" [scrollbarV]=\"true\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [selected]=\"selectedTable\"\n [selectCheck]=\"selectCheck\" [selectionType]=\"_multiple?SelectionType.multiClick:SelectionType.single\" (select)=\"onSelectTableItem($event)\">\n <ngx-datatable-column [width]=\"50\" prop=\"id\" [sortable]=\"false\" [canAutoResize]=\"false\" [draggable]=\"false\"\n [resizeable]=\"false\">\n <ng-template ngx-datatable-header-template let-value=\"value\" let-allRowsSelected=\"allRowsSelected\"\n let-selectFn=\"selectFn\">\n <input type=\"checkbox\" class=\"form-check-input\" [checked]=\"allRowsSelected\"\n (change)=\"selectFn(!allRowsSelected)\" />\n </ng-template>\n <ng-template ngx-datatable-cell-template let-row=\"row\" let-value=\"value\" let-isSelected=\"isSelected\"\n let-onCheckboxChangeFn=\"onCheckboxChangeFn\">\n <input type=\"checkbox\" class=\"form-check-input\" [checked]=\"selectedcheckbox(value)\"\n (change)=\"onCheckboxChangeFn($event)\" />\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <fe-file-preview [width]=\"'80px'\" [src]=\"row.url\" [name]=\"row.name\" [type]=\"row.mimeType\" [preview]=\"true\"></fe-file-preview>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileName' | abpLocalization\" prop=\"name\" [flexGrow]=\"4\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileSize' | abpLocalization\" prop=\"size\" [flexGrow]=\"1.5\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ _FileApiService.formatFileSize(value) }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::Directory' | abpLocalization\" prop=\"cellName\" [flexGrow]=\"1\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::CreationTime' | abpLocalization\" prop=\"creationTime\" [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'YYYY/MM/dd HH:mm:s' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [flexGrow]=\"1\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteFile(row)\">\n <i class=\"fas fa-trash text-primary p-2\"></i>\n </button>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n <div *ngIf=\"uploadPictureStatusList.length > 0\"\n class=\"position-fixed bottom-0 end-0 shadow-lg file-status-modal m-5\"\n style=\"border-radius: 10px\">\n <div class=\"card p-1\">\n <div class=\"card-header d-flex align-items-center justify-content-between p-0 py-1 border-bottom\">\n <div>{{'FileExplorer::UploadFiles' | abpLocalization}}</div>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click.stop)=\"closeFileStatusModal()\"></button>\n </div>\n <div class=\"card-body\">\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'FileExplorer::FileName' | abpLocalization}}</th>\n <th scope=\"col\">{{'FileExplorer::FileSize' | abpLocalization}}</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of uploadPictureStatusList; let i = index\">\n <tr>\n <th scope=\"row\">\n <div>{{ item.name }}</div>\n <div class=\"form-text text-danger\" *ngIf=\"item.size > sizeLimit\">\n {{'FileExplorer::ExceedsMaximumSize' | abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}\n </div>\n </th>\n <td>{{ item.fileSize }}</td>\n <td>\n <i *ngIf=\"item.status === 1\" class=\"fas fa-check text-primary\"></i>\n <i *ngIf=\"item.status === 2\" class=\"fas fa-times-circle text-danger\"></i>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"modalSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .file-modal .container-height{height:calc(100vh - 284px)}::ng-deep .file-modal .file-status-modal{background:#fff}::ng-deep .file-modal .file-status-modal .card-body{max-height:300px;overflow-y:auto}::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active .datatable-row-group{background-color:transparent!important}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper{padding:0}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .custom-node{width:100%}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .selected{background-color:var(--lpx-brand)!important}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .selected .btn{color:var(--lpx-navbar-color)}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:transparent}::ng-deep .file-modal .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell,::ng-deep .file-modal .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{overflow:initial;line-break:anywhere}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i6.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i6.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i6.DataTableColumnHeaderDirective, selector: "[ngx-datatable-header-template]" }, { kind: "directive", type: i6.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i2$1.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2$1.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2$1.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: FileModalTreeComponent, selector: "fe-file-modal-tree", inputs: ["theSelectedTreeNode", "fileContainerName"], outputs: ["nodeClick"] }, { kind: "component", type: FilePreviewComponent, selector: "fe-file-preview", inputs: ["width", "src", "preview", "type", "name", "className"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
1145
|
+
], usesOnChanges: true, ngImport: i0, template: "<abp-modal [(visible)]=\"ModalOpen\" (visibleChange)=\"ModalVisibleChange($event)\"\n [options]=\"{ size: 'xl', scrollable: false }\">\n <ng-template #abpHeader>\n <h3>{{'FileExplorer::FileExplorer' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <div class=\"row file-explorer-modal-body file-modal\" *ngIf=\"ModalOpen\">\n <div class=\"col-3\" *ngIf=\"createDirectoryPermissionName\" style=\"overflow: auto; height: calc(100vh - 240px)\">\n <fe-file-modal-tree [theSelectedTreeNode]=\"_theSelectedTreeNode\" (nodeClick)=\"_nodeClick($event)\"\n (lookAllBtn)=\"lookAllFile()\" (treeNodeData)=\"treeNodeData($event)\"\n [fileContainerName]=\"_fileContainerName\"></fe-file-modal-tree>\n </div>\n <div [class]=\"createDirectoryPermissionName?'col-9':'col-12'\" style=\"height: calc(100vh - 240px)\">\n <div class=\"mb-3 d-flex justify-content-between align-items-center\">\n <div style=\"flex: 2\"><span *ngIf=\"selectedTable.length>1\" class=\"btn-link\"\n (click.stop)=\"onDeleteAllSelectFile()\" role=\"button\">{{'FileExplorer::Delete' | abpLocalization}}</span>\n </div>\n <div class=\"input-group form-file\" style=\"flex: 2\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" (change)=\"getFileChange($event)\" />\n </div>\n </div>\n <div>\n <!-- [selectionType]=\"_multiple?SelectionType.checkbox:SelectionType.single\" -->\n <!-- [selectCheck]=\"selectCheck\" -->\n <ngx-datatable class=\"material container-height\" [rows]=\"data.items\" [list]=\"list\" columnMode=\"flex\"\n [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\" [scrollbarV]=\"true\" [virtualization]=\"false\"\n [externalPaging]=\"true\" [count]=\"data.totalCount\">\n <ngx-datatable-column [width]=\"50\" prop=\"id\" [sortable]=\"false\" [canAutoResize]=\"false\" [draggable]=\"false\"\n [resizeable]=\"false\">\n <ng-template ngx-datatable-header-template let-value=\"value\" let-allRowsSelected=\"allRowsSelected\"\n let-selectFn=\"selectFn\">\n <input type=\"checkbox\" class=\"form-check-input\" *ngIf=\"_multiple\" [checked]=\"isAllSelected\"\n (change)=\"onSelectAllFn($event,data.items)\" />\n </ng-template>\n <ng-template ngx-datatable-cell-template let-row=\"row\" let-value=\"value\">\n <input type=\"checkbox\" class=\"form-check-input\" [checked]=\"selectedcheckbox(value)\"\n (change)=\"onCheckboxChangeFn($event,row,data.items)\" />\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <fe-file-preview [width]=\"'80px'\" [src]=\"row.url\" [name]=\"row.name\" [type]=\"row.mimeType\"\n [preview]=\"true\"></fe-file-preview>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileName' | abpLocalization\" prop=\"name\" [sortable]=\"false\"\n [flexGrow]=\"4\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div class=\"d-flex align-items-start titlehover\" *ngIf=\"newEditRow.id!==row.id\">\n <span class=\"me-2\">{{ value }}</span>\n <i class=\"fa fa-pencil-square-o\" role=\"button\" (click.stop)=\"onEditFileName(row)\" style=\"line-height:2;\" aria-hidden=\"true\"></i>\n </div>\n <div *ngIf=\"FileNameForm&&newEditRow.id===row.id\">\n <form [formGroup]=\"FileNameForm\" (ngSubmit)=\"onSubmitFileName($event)\">\n <div class=\"d-flex align-items-start\">\n <div class=\"me-2\">\n <input class=\"form-control \" type=\"text\" formControlName=\"fileName\">\n </div>\n <button class=\" btn btn-sm\" type=\"submit\">\n <i class=\"fa-spin fa fa-spinner\" *ngIf=\"isloading\"></i>\n <i class=\"fa fa-check\" aria-hidden=\"true\" *ngIf=\"!isloading\"></i></button>\n <button class=\" btn btn-sm\" (click.stop)=\"onCancelFileName(row)\"><i class=\"fa fa-times\" type=\"reset\" aria-hidden=\"true\"></i></button>\n \n </div>\n </form>\n </div>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileSize' | abpLocalization\" prop=\"size\" [flexGrow]=\"1.5\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ _FileApiService.formatFileSize(value) }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::Directory' | abpLocalization\" prop=\"directoryId\"\n [sortable]=\"false\" [flexGrow]=\"1\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|getDirectoryName:fileGroupList }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::CreationTime' | abpLocalization\" prop=\"creationTime\"\n [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'YYYY/MM/dd HH:mm:s' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [flexGrow]=\"1\" [sortable]=\"false\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteFile(row)\">\n <i class=\"fas fa-trash text-primary p-2\"></i>\n </button>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n <div *ngIf=\"uploadPictureStatusList.length > 0\"\n class=\"position-fixed bottom-0 end-0 shadow-lg file-status-modal m-5\" style=\"border-radius: 10px\">\n <div class=\"card p-1\">\n <div class=\"card-header d-flex align-items-center justify-content-between p-0 py-1 border-bottom\">\n <div>{{'FileExplorer::UploadFiles' | abpLocalization}}</div>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click.stop)=\"closeFileStatusModal()\"></button>\n </div>\n <div class=\"card-body\">\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'FileExplorer::FileName' | abpLocalization}}</th>\n <th scope=\"col\">{{'FileExplorer::FileSize' | abpLocalization}}</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of uploadPictureStatusList; let i = index\">\n <tr>\n <th scope=\"row\">\n <div>{{ item.name }}</div>\n <div class=\"form-text text-danger\" *ngIf=\"item.size > sizeLimit\">\n {{'FileExplorer::ExceedsMaximumSize' |\n abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}\n </div>\n </th>\n <td>{{ item.fileSize }}</td>\n <td>\n <i *ngIf=\"item.status === 1\" class=\"fas fa-check text-primary\"></i>\n <i *ngIf=\"item.status === 2\" class=\"fas fa-times-circle text-danger\"></i>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"modalSave()\">{{'FileExplorer::Confirm' | abpLocalization}}\n @if(selectedTable.length>0){\n ({{selectedTable.length}})\n }\n </abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .file-modal .container-height{height:calc(100vh - 284px)}::ng-deep .file-modal .file-status-modal{background:#fff}::ng-deep .file-modal .file-status-modal .card-body{max-height:300px;overflow-y:auto}::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active .datatable-row-group{background-color:transparent!important}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper{padding:0}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .ng-star-inserted[title]{padding:0 10px}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .custom-node{width:100%}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .selected{background-color:var(--lpx-brand)!important;color:var(--lpx-brand-text)}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:transparent}::ng-deep .file-modal .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell,::ng-deep .file-modal .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{overflow:initial;line-break:anywhere}::ng-deep .file-modal input[type=checkbox]{cursor:pointer}::ng-deep .file-modal .titlehover i{display:none}::ng-deep .file-modal .titlehover:hover i{display:block}\n"], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i7.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i7.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i7.DataTableColumnHeaderDirective, selector: "[ngx-datatable-header-template]" }, { kind: "directive", type: i7.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i3$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i2$1.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2$1.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2$1.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: FileModalTreeComponent, selector: "fe-file-modal-tree", inputs: ["theSelectedTreeNode", "fileContainerName"], outputs: ["nodeClick", "treeNodeData", "lookAllBtn"] }, { kind: "component", type: FilePreviewComponent, selector: "fe-file-preview", inputs: ["width", "src", "preview", "type", "name", "className"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: GetDirectoryNamePipe, name: "getDirectoryName" }] }); }
|
|
844
1146
|
}
|
|
845
1147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalComponent, decorators: [{
|
|
846
1148
|
type: Component,
|
|
@@ -851,7 +1153,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
851
1153
|
// Provide this token if you want a different debounce time.
|
|
852
1154
|
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
853
1155
|
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
854
|
-
], template: "<abp-modal [(visible)]=\"ModalOpen\" (visibleChange)=\"ModalVisibleChange($event)\"\n [options]=\"{ size: 'xl', scrollable: false }\">\n <ng-template #abpHeader>\n <h3>{{'FileExplorer::FileExplorer' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <div class=\"row file-explorer-modal-body file-modal\">\n <div class=\"col-3\" *ngIf=\"createDirectoryPermissionName\" style=\"overflow: auto; height: calc(100vh - 240px)\">\n <fe-file-modal-tree [theSelectedTreeNode]=\"_theSelectedTreeNode\" (nodeClick)=\"_nodeClick($event)\"\n [fileContainerName]=\"_fileContainerName\"></fe-file-modal-tree>\n </div>\n <div [class]=\"createDirectoryPermissionName?'col-9':'col-12'\" style=\"height: calc(100vh - 240px)\">\n <div class=\"mb-3 d-flex justify-content-between align-items-center\">\n <div class=\"btn-link\" role=button style=\"flex: 2\" (click)=\"lookAllFile()\">{{'FileExplorer::AllFiles' | abpLocalization}}</div>\n <div class=\"input-group form-file\" style=\"flex: 2\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" \n (change)=\"getFileChange($event)\" />\n </div>\n </div>\n <div>\n <ngx-datatable class=\"material container-height\" [rows]=\"data.items\" [list]=\"list\" columnMode=\"flex\"\n [columns]=\"columns\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\" [scrollbarV]=\"true\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [selected]=\"selectedTable\"\n [selectCheck]=\"selectCheck\" [selectionType]=\"_multiple?SelectionType.multiClick:SelectionType.single\" (select)=\"onSelectTableItem($event)\">\n <ngx-datatable-column [width]=\"50\" prop=\"id\" [sortable]=\"false\" [canAutoResize]=\"false\" [draggable]=\"false\"\n [resizeable]=\"false\">\n <ng-template ngx-datatable-header-template let-value=\"value\" let-allRowsSelected=\"allRowsSelected\"\n let-selectFn=\"selectFn\">\n <input type=\"checkbox\" class=\"form-check-input\" [checked]=\"allRowsSelected\"\n (change)=\"selectFn(!allRowsSelected)\" />\n </ng-template>\n <ng-template ngx-datatable-cell-template let-row=\"row\" let-value=\"value\" let-isSelected=\"isSelected\"\n let-onCheckboxChangeFn=\"onCheckboxChangeFn\">\n <input type=\"checkbox\" class=\"form-check-input\" [checked]=\"selectedcheckbox(value)\"\n (change)=\"onCheckboxChangeFn($event)\" />\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <fe-file-preview [width]=\"'80px'\" [src]=\"row.url\" [name]=\"row.name\" [type]=\"row.mimeType\" [preview]=\"true\"></fe-file-preview>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileName' | abpLocalization\" prop=\"name\" [flexGrow]=\"4\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileSize' | abpLocalization\" prop=\"size\" [flexGrow]=\"1.5\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ _FileApiService.formatFileSize(value) }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::Directory' | abpLocalization\" prop=\"cellName\" [flexGrow]=\"1\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::CreationTime' | abpLocalization\" prop=\"creationTime\" [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'YYYY/MM/dd HH:mm:s' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [flexGrow]=\"1\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteFile(row)\">\n <i class=\"fas fa-trash text-primary p-2\"></i>\n </button>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n <div *ngIf=\"uploadPictureStatusList.length > 0\"\n class=\"position-fixed bottom-0 end-0 shadow-lg file-status-modal m-5\"\n style=\"border-radius: 10px\">\n <div class=\"card p-1\">\n <div class=\"card-header d-flex align-items-center justify-content-between p-0 py-1 border-bottom\">\n <div>{{'FileExplorer::UploadFiles' | abpLocalization}}</div>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click.stop)=\"closeFileStatusModal()\"></button>\n </div>\n <div class=\"card-body\">\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'FileExplorer::FileName' | abpLocalization}}</th>\n <th scope=\"col\">{{'FileExplorer::FileSize' | abpLocalization}}</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of uploadPictureStatusList; let i = index\">\n <tr>\n <th scope=\"row\">\n <div>{{ item.name }}</div>\n <div class=\"form-text text-danger\" *ngIf=\"item.size > sizeLimit\">\n {{'FileExplorer::ExceedsMaximumSize' | abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}\n </div>\n </th>\n <td>{{ item.fileSize }}</td>\n <td>\n <i *ngIf=\"item.status === 1\" class=\"fas fa-check text-primary\"></i>\n <i *ngIf=\"item.status === 2\" class=\"fas fa-times-circle text-danger\"></i>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"modalSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .file-modal .container-height{height:calc(100vh - 284px)}::ng-deep .file-modal .file-status-modal{background:#fff}::ng-deep .file-modal .file-status-modal .card-body{max-height:300px;overflow-y:auto}::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active .datatable-row-group{background-color:transparent!important}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper{padding:0}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .custom-node{width:100%}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .selected{background-color:var(--lpx-brand)!important}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .selected .btn{color:var(--lpx-navbar-color)}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:transparent}::ng-deep .file-modal .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell,::ng-deep .file-modal .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{overflow:initial;line-break:anywhere}\n"] }]
|
|
1156
|
+
], template: "<abp-modal [(visible)]=\"ModalOpen\" (visibleChange)=\"ModalVisibleChange($event)\"\n [options]=\"{ size: 'xl', scrollable: false }\">\n <ng-template #abpHeader>\n <h3>{{'FileExplorer::FileExplorer' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <div class=\"row file-explorer-modal-body file-modal\" *ngIf=\"ModalOpen\">\n <div class=\"col-3\" *ngIf=\"createDirectoryPermissionName\" style=\"overflow: auto; height: calc(100vh - 240px)\">\n <fe-file-modal-tree [theSelectedTreeNode]=\"_theSelectedTreeNode\" (nodeClick)=\"_nodeClick($event)\"\n (lookAllBtn)=\"lookAllFile()\" (treeNodeData)=\"treeNodeData($event)\"\n [fileContainerName]=\"_fileContainerName\"></fe-file-modal-tree>\n </div>\n <div [class]=\"createDirectoryPermissionName?'col-9':'col-12'\" style=\"height: calc(100vh - 240px)\">\n <div class=\"mb-3 d-flex justify-content-between align-items-center\">\n <div style=\"flex: 2\"><span *ngIf=\"selectedTable.length>1\" class=\"btn-link\"\n (click.stop)=\"onDeleteAllSelectFile()\" role=\"button\">{{'FileExplorer::Delete' | abpLocalization}}</span>\n </div>\n <div class=\"input-group form-file\" style=\"flex: 2\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" (change)=\"getFileChange($event)\" />\n </div>\n </div>\n <div>\n <!-- [selectionType]=\"_multiple?SelectionType.checkbox:SelectionType.single\" -->\n <!-- [selectCheck]=\"selectCheck\" -->\n <ngx-datatable class=\"material container-height\" [rows]=\"data.items\" [list]=\"list\" columnMode=\"flex\"\n [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\" [scrollbarV]=\"true\" [virtualization]=\"false\"\n [externalPaging]=\"true\" [count]=\"data.totalCount\">\n <ngx-datatable-column [width]=\"50\" prop=\"id\" [sortable]=\"false\" [canAutoResize]=\"false\" [draggable]=\"false\"\n [resizeable]=\"false\">\n <ng-template ngx-datatable-header-template let-value=\"value\" let-allRowsSelected=\"allRowsSelected\"\n let-selectFn=\"selectFn\">\n <input type=\"checkbox\" class=\"form-check-input\" *ngIf=\"_multiple\" [checked]=\"isAllSelected\"\n (change)=\"onSelectAllFn($event,data.items)\" />\n </ng-template>\n <ng-template ngx-datatable-cell-template let-row=\"row\" let-value=\"value\">\n <input type=\"checkbox\" class=\"form-check-input\" [checked]=\"selectedcheckbox(value)\"\n (change)=\"onCheckboxChangeFn($event,row,data.items)\" />\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <fe-file-preview [width]=\"'80px'\" [src]=\"row.url\" [name]=\"row.name\" [type]=\"row.mimeType\"\n [preview]=\"true\"></fe-file-preview>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileName' | abpLocalization\" prop=\"name\" [sortable]=\"false\"\n [flexGrow]=\"4\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div class=\"d-flex align-items-start titlehover\" *ngIf=\"newEditRow.id!==row.id\">\n <span class=\"me-2\">{{ value }}</span>\n <i class=\"fa fa-pencil-square-o\" role=\"button\" (click.stop)=\"onEditFileName(row)\" style=\"line-height:2;\" aria-hidden=\"true\"></i>\n </div>\n <div *ngIf=\"FileNameForm&&newEditRow.id===row.id\">\n <form [formGroup]=\"FileNameForm\" (ngSubmit)=\"onSubmitFileName($event)\">\n <div class=\"d-flex align-items-start\">\n <div class=\"me-2\">\n <input class=\"form-control \" type=\"text\" formControlName=\"fileName\">\n </div>\n <button class=\" btn btn-sm\" type=\"submit\">\n <i class=\"fa-spin fa fa-spinner\" *ngIf=\"isloading\"></i>\n <i class=\"fa fa-check\" aria-hidden=\"true\" *ngIf=\"!isloading\"></i></button>\n <button class=\" btn btn-sm\" (click.stop)=\"onCancelFileName(row)\"><i class=\"fa fa-times\" type=\"reset\" aria-hidden=\"true\"></i></button>\n \n </div>\n </form>\n </div>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::FileSize' | abpLocalization\" prop=\"size\" [flexGrow]=\"1.5\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ _FileApiService.formatFileSize(value) }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::Directory' | abpLocalization\" prop=\"directoryId\"\n [sortable]=\"false\" [flexGrow]=\"1\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|getDirectoryName:fileGroupList }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'FileExplorer::CreationTime' | abpLocalization\" prop=\"creationTime\"\n [flexGrow]=\"2\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'YYYY/MM/dd HH:mm:s' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [flexGrow]=\"1\" [sortable]=\"false\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteFile(row)\">\n <i class=\"fas fa-trash text-primary p-2\"></i>\n </button>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n <div *ngIf=\"uploadPictureStatusList.length > 0\"\n class=\"position-fixed bottom-0 end-0 shadow-lg file-status-modal m-5\" style=\"border-radius: 10px\">\n <div class=\"card p-1\">\n <div class=\"card-header d-flex align-items-center justify-content-between p-0 py-1 border-bottom\">\n <div>{{'FileExplorer::UploadFiles' | abpLocalization}}</div>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click.stop)=\"closeFileStatusModal()\"></button>\n </div>\n <div class=\"card-body\">\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'FileExplorer::FileName' | abpLocalization}}</th>\n <th scope=\"col\">{{'FileExplorer::FileSize' | abpLocalization}}</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of uploadPictureStatusList; let i = index\">\n <tr>\n <th scope=\"row\">\n <div>{{ item.name }}</div>\n <div class=\"form-text text-danger\" *ngIf=\"item.size > sizeLimit\">\n {{'FileExplorer::ExceedsMaximumSize' |\n abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}\n </div>\n </th>\n <td>{{ item.fileSize }}</td>\n <td>\n <i *ngIf=\"item.status === 1\" class=\"fas fa-check text-primary\"></i>\n <i *ngIf=\"item.status === 2\" class=\"fas fa-times-circle text-danger\"></i>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"modalSave()\">{{'FileExplorer::Confirm' | abpLocalization}}\n @if(selectedTable.length>0){\n ({{selectedTable.length}})\n }\n </abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .file-modal .container-height{height:calc(100vh - 284px)}::ng-deep .file-modal .file-status-modal{background:#fff}::ng-deep .file-modal .file-status-modal .card-body{max-height:300px;overflow-y:auto}::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.single-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-selection .datatable-body-row.active .datatable-row-group,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active,::ng-deep .file-modal .ngx-datatable.material.multi-click-selection .datatable-body-row.active .datatable-row-group{background-color:transparent!important}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper{padding:0}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .ng-star-inserted[title]{padding:0 10px}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .custom-node{width:100%}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper .selected{background-color:var(--lpx-brand)!important;color:var(--lpx-brand-text)}::ng-deep .file-modal .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:transparent}::ng-deep .file-modal .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell,::ng-deep .file-modal .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{overflow:initial;line-break:anywhere}::ng-deep .file-modal input[type=checkbox]{cursor:pointer}::ng-deep .file-modal .titlehover i{display:none}::ng-deep .file-modal .titlehover:hover i{display:block}\n"] }]
|
|
855
1157
|
}], ctorParameters: () => [{ type: FileDescriptorService$1 }, { type: i2$1.ToasterService }, { type: i3.ListService }, { type: FileApiService }, { type: i3.RestService }, { type: i2$1.ConfirmationService }, { type: i3.LocalizationService }], propDecorators: { fileContainerName: [{
|
|
856
1158
|
type: Input
|
|
857
1159
|
}], multiple: [{
|
|
@@ -862,10 +1164,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
862
1164
|
type: Input
|
|
863
1165
|
}], visibleChange: [{
|
|
864
1166
|
type: Output
|
|
865
|
-
}], selectPickerFile: [{
|
|
866
|
-
type: Input
|
|
867
1167
|
}], selectFilefn: [{
|
|
868
1168
|
type: Output
|
|
1169
|
+
}], selectPickerFile: [{
|
|
1170
|
+
type: Input
|
|
869
1171
|
}] } });
|
|
870
1172
|
|
|
871
1173
|
/* eslint-disable @angular-eslint/component-selector */
|
|
@@ -907,12 +1209,19 @@ class FilePickerComponent {
|
|
|
907
1209
|
this.selectedFileChange.emit([]);
|
|
908
1210
|
this.selectedFileChange.emit(this.selectFormFile);
|
|
909
1211
|
}
|
|
1212
|
+
/**调整表格位置 */
|
|
1213
|
+
drop(event) {
|
|
1214
|
+
moveItemInArray(this._fileShowTable, event.previousIndex, event.currentIndex);
|
|
1215
|
+
this.selectFormFile = this._fileShowTable;
|
|
1216
|
+
this.selectedFileChange.emit(this.selectFormFile);
|
|
1217
|
+
// this._fileShowTable.updateValueAndValidity()
|
|
1218
|
+
}
|
|
910
1219
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePickerComponent, deps: [{ token: FileApiService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
911
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FilePickerComponent, selector: "fe-file-picker", inputs: { multiple: "multiple", fileContainerName: "fileContainerName", selectFormFile: "selectFormFile" }, outputs: { selectedFileChange: "selectedFileChange" }, usesOnChanges: true, ngImport: i0, template: "<button class=\"btn btn-sm btn-primary ms-2 float-end\" type=\"button\"
|
|
1220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FilePickerComponent, selector: "fe-file-picker", inputs: { multiple: "multiple", fileContainerName: "fileContainerName", selectFormFile: "selectFormFile" }, outputs: { selectedFileChange: "selectedFileChange" }, usesOnChanges: true, ngImport: i0, template: "<button class=\"btn btn-sm btn-primary ms-2 float-end\" type=\"button\"\n (click.stop)=\"ModalOpen = true\">{{'FileExplorer::SelectFile' | abpLocalization}}</button>\n\n<fe-file-modal [(visible)]=\"ModalOpen\" [selectPickerFile]=\"selectFormFile\" [multiple]=\"_multiple\"\n (selectFilefn)=\"_selectFilefn($event)\" [fileContainerName]=\"_fileContainerName\"></fe-file-modal>\n<table class=\"table\" *ngIf=\"_fileShowTable.length>0\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <thead>\n <tr>\n <th scope=\"col\" style=\"width: 30px;\"></th>\n <th scope=\"col\"></th>\n <th scope=\"col\">{{'FileExplorer::FileName' | abpLocalization}}</th>\n <th scope=\"col\">{{'FileExplorer::FileSize' | abpLocalization}}</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of _fileShowTable;let i =index\">\n <tr cdkDrag cdkDragLockAxis=\"y\" [cdkDragData]=\"item\">\n <td>\n <div class=\"drag-handle\" cdkDragHandle>\n <span class=\"bi bi-arrows-move fs-5\"></span>\n </div>\n </td>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.url||item.Url\" [name]=\"item.name||item.Name\"\n [type]=\"item.mimeType||item.MimeType\" [preview]=\"true\"></fe-file-preview>\n </td>\n <th scope=\"row\">\n <div>{{item.name||item.Name}}</div>\n </th>\n <td>{{_FileApiService.formatFileSize(item.Size||item.size)}}</td>\n <td>\n <button class=\"btn btn-sm p-0 btn-light \" (click.stop)=\"deleteFileTableItem(i,item)\">\n <i class=\"fas fa-trash p-2\"></i>\n </button>\n </td>\n </tr>\n </ng-container>\n </tbody>\n</table>", styles: [".table{border-collapse:collapse;table-layout:fixed}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i4.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: FileModalComponent, selector: "fe-file-modal", inputs: ["fileContainerName", "multiple", "limit", "visible", "selectPickerFile"], outputs: ["visibleChange", "selectFilefn"] }, { kind: "component", type: FilePreviewComponent, selector: "fe-file-preview", inputs: ["width", "src", "preview", "type", "name", "className"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
912
1221
|
}
|
|
913
1222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePickerComponent, decorators: [{
|
|
914
1223
|
type: Component,
|
|
915
|
-
args: [{ selector: 'fe-file-picker', template: "<button class=\"btn btn-sm btn-primary ms-2 float-end\" type=\"button\"
|
|
1224
|
+
args: [{ selector: 'fe-file-picker', template: "<button class=\"btn btn-sm btn-primary ms-2 float-end\" type=\"button\"\n (click.stop)=\"ModalOpen = true\">{{'FileExplorer::SelectFile' | abpLocalization}}</button>\n\n<fe-file-modal [(visible)]=\"ModalOpen\" [selectPickerFile]=\"selectFormFile\" [multiple]=\"_multiple\"\n (selectFilefn)=\"_selectFilefn($event)\" [fileContainerName]=\"_fileContainerName\"></fe-file-modal>\n<table class=\"table\" *ngIf=\"_fileShowTable.length>0\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <thead>\n <tr>\n <th scope=\"col\" style=\"width: 30px;\"></th>\n <th scope=\"col\"></th>\n <th scope=\"col\">{{'FileExplorer::FileName' | abpLocalization}}</th>\n <th scope=\"col\">{{'FileExplorer::FileSize' | abpLocalization}}</th>\n <th scope=\"col\"></th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let item of _fileShowTable;let i =index\">\n <tr cdkDrag cdkDragLockAxis=\"y\" [cdkDragData]=\"item\">\n <td>\n <div class=\"drag-handle\" cdkDragHandle>\n <span class=\"bi bi-arrows-move fs-5\"></span>\n </div>\n </td>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.url||item.Url\" [name]=\"item.name||item.Name\"\n [type]=\"item.mimeType||item.MimeType\" [preview]=\"true\"></fe-file-preview>\n </td>\n <th scope=\"row\">\n <div>{{item.name||item.Name}}</div>\n </th>\n <td>{{_FileApiService.formatFileSize(item.Size||item.size)}}</td>\n <td>\n <button class=\"btn btn-sm p-0 btn-light \" (click.stop)=\"deleteFileTableItem(i,item)\">\n <i class=\"fas fa-trash p-2\"></i>\n </button>\n </td>\n </tr>\n </ng-container>\n </tbody>\n</table>", styles: [".table{border-collapse:collapse;table-layout:fixed}\n"] }]
|
|
916
1225
|
}], ctorParameters: () => [{ type: FileApiService }], propDecorators: { multiple: [{
|
|
917
1226
|
type: Input
|
|
918
1227
|
}], fileContainerName: [{
|
|
@@ -955,7 +1264,7 @@ const routes = [
|
|
|
955
1264
|
];
|
|
956
1265
|
class FileExplorerRoutingModule {
|
|
957
1266
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
958
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, imports: [i1$
|
|
1267
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, imports: [i1$2.RouterModule], exports: [RouterModule] }); }
|
|
959
1268
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
|
|
960
1269
|
}
|
|
961
1270
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, decorators: [{
|
|
@@ -1020,13 +1329,13 @@ class FileExplorerConfigComponent {
|
|
|
1020
1329
|
resolve(true);
|
|
1021
1330
|
});
|
|
1022
1331
|
}
|
|
1023
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerConfigComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1024
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FileExplorerConfigComponent, selector: "fe-file-explorer-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsFileExplorer::FileContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FileExplorer.FileContainerName\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"FileExplorer.UploadFileMultiple\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpDynamicFormsFileExplorer::UploadFileMultiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
1332
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerConfigComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1333
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FileExplorerConfigComponent, selector: "fe-file-explorer-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsFileExplorer::FileContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FileExplorer.FileContainerName\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"FileExplorer.UploadFileMultiple\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpDynamicFormsFileExplorer::UploadFileMultiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i3$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i3$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
1025
1334
|
}
|
|
1026
1335
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerConfigComponent, decorators: [{
|
|
1027
1336
|
type: Component,
|
|
1028
1337
|
args: [{ selector: 'fe-file-explorer-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{'DigniteAbpDynamicFormsFileExplorer::FileContainerName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"FileExplorer.FileContainerName\">\n </div>\n <div class=\"mb-3\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"FileExplorer.UploadFileMultiple\" id=\"flexRadioDefault1\">\n <label class=\"form-check-label\" for=\"flexRadioDefault1\">\n {{'DigniteAbpDynamicFormsFileExplorer::UploadFileMultiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
|
|
1029
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
1338
|
+
}], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { type: [{
|
|
1030
1339
|
type: Input
|
|
1031
1340
|
}], Entity: [{
|
|
1032
1341
|
type: Input
|
|
@@ -1118,13 +1427,13 @@ class FileExplorerControlComponent {
|
|
|
1118
1427
|
obj[fieldName] = event;
|
|
1119
1428
|
this.extraProperties.patchValue(obj);
|
|
1120
1429
|
}
|
|
1121
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerControlComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1122
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FileExplorerControlComponent, selector: "fe-file-explorer-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <fe-file-picker [selectFormFile]=\"selectedFileGroup\" [multiple]=\"formConfiguration['FileExplorer.UploadFileMultiple']\"\n (selectedFileChange)=\"_selectedFileChange($event)\" [fileContainerName]=\"FileContainerName\"></fe-file-picker>\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: FilePickerComponent, selector: "fe-file-picker", inputs: ["multiple", "fileContainerName", "selectFormFile"], outputs: ["selectedFileChange"] }] }); }
|
|
1430
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerControlComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1431
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FileExplorerControlComponent, selector: "fe-file-explorer-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <fe-file-picker [selectFormFile]=\"selectedFileGroup\" [multiple]=\"formConfiguration['FileExplorer.UploadFileMultiple']\"\n (selectedFileChange)=\"_selectedFileChange($event)\" [fileContainerName]=\"FileContainerName\"></fe-file-picker>\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: FilePickerComponent, selector: "fe-file-picker", inputs: ["multiple", "fileContainerName", "selectFormFile"], outputs: ["selectedFileChange"] }] }); }
|
|
1123
1432
|
}
|
|
1124
1433
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerControlComponent, decorators: [{
|
|
1125
1434
|
type: Component,
|
|
1126
1435
|
args: [{ selector: 'fe-file-explorer-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-3\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <fe-file-picker [selectFormFile]=\"selectedFileGroup\" [multiple]=\"formConfiguration['FileExplorer.UploadFileMultiple']\"\n (selectedFileChange)=\"_selectedFileChange($event)\" [fileContainerName]=\"FileContainerName\"></fe-file-picker>\n <small class=\"form-text text-muted d-block\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</small>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
|
|
1127
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
|
|
1436
|
+
}], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { entity: [{
|
|
1128
1437
|
type: Input
|
|
1129
1438
|
}], fields: [{
|
|
1130
1439
|
type: Input
|
|
@@ -1211,7 +1520,10 @@ class FileExplorerModule {
|
|
|
1211
1520
|
NgbDropdownModule,
|
|
1212
1521
|
NzTreeModule,
|
|
1213
1522
|
NgxValidateCoreModule,
|
|
1214
|
-
FileExplorerRoutingModule
|
|
1523
|
+
FileExplorerRoutingModule,
|
|
1524
|
+
TreeModule,
|
|
1525
|
+
GetDirectoryNamePipe,
|
|
1526
|
+
DragDropModule], exports: [FileEditComponent,
|
|
1215
1527
|
FilePickerComponent,
|
|
1216
1528
|
FileModalComponent,
|
|
1217
1529
|
FileModalTreeComponent,
|
|
@@ -1224,7 +1536,9 @@ class FileExplorerModule {
|
|
|
1224
1536
|
NgbDropdownModule,
|
|
1225
1537
|
NzTreeModule,
|
|
1226
1538
|
NgxValidateCoreModule,
|
|
1227
|
-
FileExplorerRoutingModule
|
|
1539
|
+
FileExplorerRoutingModule,
|
|
1540
|
+
TreeModule,
|
|
1541
|
+
DragDropModule] }); }
|
|
1228
1542
|
}
|
|
1229
1543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerModule, decorators: [{
|
|
1230
1544
|
type: NgModule,
|
|
@@ -1249,6 +1563,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1249
1563
|
NzTreeModule,
|
|
1250
1564
|
NgxValidateCoreModule,
|
|
1251
1565
|
FileExplorerRoutingModule,
|
|
1566
|
+
TreeModule,
|
|
1567
|
+
GetDirectoryNamePipe,
|
|
1568
|
+
DragDropModule,
|
|
1252
1569
|
],
|
|
1253
1570
|
exports: [
|
|
1254
1571
|
FileEditComponent,
|