@dignite-ng/expand.file-explorer 3.0.0-rc.5 → 3.0.0-rc.50
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/README.md +128 -24
- package/esm2022/config/dignite-ng-expand.file-explorer-config.mjs +1 -1
- package/esm2022/config/enums/index.mjs +1 -1
- package/esm2022/config/enums/route-names.mjs +1 -1
- package/esm2022/config/file-config.module.mjs +1 -1
- package/esm2022/config/providers/index.mjs +1 -1
- package/esm2022/config/providers/route.provider.mjs +1 -1
- package/esm2022/config/public-api.mjs +1 -1
- package/esm2022/dignite-ng-expand.file-explorer.mjs +1 -1
- package/esm2022/lib/components/dome/file-dome.component.mjs +2 -4
- package/esm2022/lib/components/dynamic-form/file-explorer/file-explorer-config.component.mjs +3 -2
- package/esm2022/lib/components/dynamic-form/file-explorer/file-explorer-config.mjs +1 -1
- package/esm2022/lib/components/dynamic-form/file-explorer/file-explorer-control.component.mjs +3 -3
- package/esm2022/lib/components/dynamic-form/file-explorer/file-explorer-view.component.mjs +41 -0
- package/esm2022/lib/components/dynamic-form/file-explorer/index.mjs +1 -1
- package/esm2022/lib/components/dynamic-form/form-control-group.mjs +3 -2
- package/esm2022/lib/components/file-edit/file-edit.component.mjs +34 -24
- package/esm2022/lib/components/file-modal/file-modal.component.mjs +293 -85
- package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +135 -60
- package/esm2022/lib/components/file-picker/file-picker.component.mjs +20 -12
- package/esm2022/lib/components/index.mjs +1 -1
- package/esm2022/lib/file-explorer-routing.module.mjs +1 -1
- package/esm2022/lib/file-explorer.module.mjs +40 -12
- package/esm2022/lib/pipe/format-file-size.pipe.mjs +35 -0
- package/esm2022/lib/pipe/get-directory-name.pipe.mjs +20 -0
- package/esm2022/lib/previews/file-preview.component.mjs +7 -3
- package/esm2022/lib/previews/index.mjs +1 -1
- package/esm2022/lib/previews/models.mjs +1 -1
- package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +2 -1
- package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +1 -1
- package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +1 -1
- package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +11 -3
- package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +1 -1
- package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +1 -1
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +1 -1
- package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +1 -1
- package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +1 -1
- package/esm2022/lib/proxy/volo/abp/content/models.mjs +1 -1
- package/esm2022/public-api.mjs +1 -3
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs.map +1 -1
- package/fesm2022/dignite-ng-expand.file-explorer.mjs +584 -239
- package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +1 -1
- package/lib/components/dome/file-dome.component.d.ts +0 -1
- package/lib/components/dynamic-form/file-explorer/file-explorer-control.component.d.ts +1 -1
- package/lib/components/dynamic-form/file-explorer/file-explorer-view.component.d.ts +17 -0
- package/lib/components/file-edit/file-edit.component.d.ts +6 -4
- package/lib/components/file-modal/file-modal.component.d.ts +63 -25
- package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +21 -12
- package/lib/components/file-picker/file-picker.component.d.ts +2 -3
- package/lib/file-explorer.module.d.ts +13 -8
- package/lib/pipe/format-file-size.pipe.d.ts +14 -0
- package/lib/pipe/get-directory-name.pipe.d.ts +7 -0
- package/lib/previews/file-preview.component.d.ts +2 -1
- 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 +25 -7
- package/esm2022/lib/services/file-api.service.mjs +0 -68
- package/lib/services/file-api.service.d.ts +0 -14
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Pipe, Input, Component, EventEmitter, ViewChild, Output, Injectable, inject, 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
|
-
import * as i2 from '@
|
|
16
|
+
import * as i2 from '@dignite-ng/expand.core';
|
|
17
|
+
import { ValidatorsService } from '@dignite-ng/expand.core';
|
|
18
|
+
import * as i5 from '@angular/common';
|
|
19
|
+
import * as i3$2 from '@angular/cdk/drag-drop';
|
|
20
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
18
21
|
import * as i6 from '@swimlane/ngx-datatable';
|
|
19
22
|
import { SelectionType } from '@swimlane/ngx-datatable';
|
|
20
|
-
import { of } from 'rxjs';
|
|
23
|
+
import { tap, map, of, finalize } from 'rxjs';
|
|
24
|
+
import * as i8 from '@abp/ng.components/tree';
|
|
25
|
+
import { TreeModule } from '@abp/ng.components/tree';
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 转换文件大小单位 输入k
|
|
29
|
+
* @description 用于转换文件大小单位 输入k
|
|
30
|
+
* @returns {string} 文件大小单位 输入k
|
|
31
|
+
*/
|
|
32
|
+
class FormatFileSizePipe {
|
|
33
|
+
transform(value, ...args) {
|
|
34
|
+
return this.get(value);
|
|
35
|
+
}
|
|
24
36
|
/**转换文件大小单位 输入k */
|
|
25
|
-
|
|
37
|
+
get(bytes) {
|
|
26
38
|
const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
27
39
|
let size = bytes;
|
|
28
40
|
let unitIndex = 0;
|
|
@@ -34,56 +46,16 @@ class FileApiService {
|
|
|
34
46
|
size = size.toFixed(1);
|
|
35
47
|
return `${size} ${units[unitIndex]}`;
|
|
36
48
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return new Promise((resolve, rejects) => {
|
|
40
|
-
const reader = new FileReader();
|
|
41
|
-
reader.readAsDataURL(file);
|
|
42
|
-
reader.onload = (e) => {
|
|
43
|
-
resolve(e.target.result);
|
|
44
|
-
};
|
|
45
|
-
reader.onerror = error => rejects(error);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 深拷贝--方法
|
|
50
|
-
* $api.deepClone() */
|
|
51
|
-
deepClone(obj) {
|
|
52
|
-
if (typeof obj !== 'object' || obj === null)
|
|
53
|
-
return obj;
|
|
54
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
55
|
-
for (let key in obj) {
|
|
56
|
-
if (obj.hasOwnProperty(key)) {
|
|
57
|
-
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
58
|
-
if (obj[key] instanceof Date) {
|
|
59
|
-
result[key] = new Date(obj[key].getTime());
|
|
60
|
-
}
|
|
61
|
-
else if (obj[key] instanceof RegExp) {
|
|
62
|
-
result[key] = new RegExp(obj[key]);
|
|
63
|
-
}
|
|
64
|
-
else if (obj[key] instanceof File) {
|
|
65
|
-
result[key] = obj[key];
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
result[key] = this.deepClone(obj[key]);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
result[key] = obj[key];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
79
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileApiService, providedIn: 'root' }); }
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormatFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
50
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: FormatFileSizePipe, isStandalone: true, name: "formatFileSize" }); }
|
|
80
51
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type:
|
|
82
|
-
type:
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormatFileSizePipe, decorators: [{
|
|
53
|
+
type: Pipe,
|
|
83
54
|
args: [{
|
|
84
|
-
|
|
55
|
+
name: 'formatFileSize',
|
|
56
|
+
standalone: true
|
|
85
57
|
}]
|
|
86
|
-
}]
|
|
58
|
+
}] });
|
|
87
59
|
|
|
88
60
|
let ImageTypeOption = [{
|
|
89
61
|
label: '',
|
|
@@ -173,6 +145,7 @@ class FilePreviewComponent {
|
|
|
173
145
|
this.type = '';
|
|
174
146
|
/**文件名称 */
|
|
175
147
|
this.name = '';
|
|
148
|
+
this.className = '';
|
|
176
149
|
/**是否是文件 */
|
|
177
150
|
this.isImage = true;
|
|
178
151
|
/**是否是视频 */
|
|
@@ -232,13 +205,13 @@ class FilePreviewComponent {
|
|
|
232
205
|
return this.rotate = 0;
|
|
233
206
|
this.rotate += 90;
|
|
234
207
|
}
|
|
235
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePreviewComponent, deps: [{ token:
|
|
236
|
-
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" }, ngImport: i0, template: "<div class=\"image_box\" [style]=\"{width:width,maxWidth:'100%'}\">\n <div class=\"img_box\" *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:
|
|
208
|
+
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 }); }
|
|
209
|
+
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: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }] }); }
|
|
237
210
|
}
|
|
238
211
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePreviewComponent, decorators: [{
|
|
239
212
|
type: Component,
|
|
240
|
-
args: [{ selector: 'fe-file-preview', template: "<div class=\"image_box\" [style]=\"{width:width,maxWidth:'100%'}\">\n <div class=\"img_box\" *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"] }]
|
|
241
|
-
}], ctorParameters: () => [{ type:
|
|
213
|
+
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"] }]
|
|
214
|
+
}], ctorParameters: () => [{ type: i1.NgbModal }], propDecorators: { width: [{
|
|
242
215
|
type: Input
|
|
243
216
|
}], src: [{
|
|
244
217
|
type: Input
|
|
@@ -248,11 +221,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
248
221
|
type: Input
|
|
249
222
|
}], name: [{
|
|
250
223
|
type: Input
|
|
224
|
+
}], className: [{
|
|
225
|
+
type: Input
|
|
251
226
|
}] } });
|
|
252
227
|
|
|
228
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
253
229
|
class FileEditComponent {
|
|
254
|
-
constructor(
|
|
255
|
-
this.
|
|
230
|
+
constructor(_FormatFileSizePipe, _GetImageLacolBase64urlService) {
|
|
231
|
+
this._FormatFileSizePipe = _FormatFileSizePipe;
|
|
232
|
+
this._GetImageLacolBase64urlService = _GetImageLacolBase64urlService;
|
|
256
233
|
/**是否多选 */
|
|
257
234
|
this._multiple = true;
|
|
258
235
|
/**文件数据--已上传的数据 */
|
|
@@ -261,7 +238,7 @@ class FileEditComponent {
|
|
|
261
238
|
this.fileDataChange = new EventEmitter();
|
|
262
239
|
/**文件大小限制
|
|
263
240
|
* @param 1mb
|
|
264
|
-
|
|
241
|
+
*/
|
|
265
242
|
this.sizeLimit = 1048576;
|
|
266
243
|
/**文件表格数据 */
|
|
267
244
|
this.filesTableData = [];
|
|
@@ -270,7 +247,7 @@ class FileEditComponent {
|
|
|
270
247
|
}
|
|
271
248
|
set multiple(v) {
|
|
272
249
|
this._multiple = v;
|
|
273
|
-
if (v) { }
|
|
250
|
+
// if (v) { }
|
|
274
251
|
}
|
|
275
252
|
set fileData(v) {
|
|
276
253
|
this._fileData = v;
|
|
@@ -283,15 +260,16 @@ class FileEditComponent {
|
|
|
283
260
|
}
|
|
284
261
|
/**获取文件信息改变 */
|
|
285
262
|
async getFileChange(event) {
|
|
286
|
-
|
|
263
|
+
const files = new Array(...event.target.files);
|
|
287
264
|
/**需要等待setfileSizeUnits执行完后在执行其他方法--需要完善 */
|
|
288
265
|
await this.waitFileToAddTable(files);
|
|
289
266
|
this.fileHandling();
|
|
290
267
|
}
|
|
291
268
|
/**等待将文件数据加入到文件表格数据中 */
|
|
292
269
|
waitFileToAddTable(files) {
|
|
293
|
-
|
|
294
|
-
|
|
270
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
271
|
+
return new Promise(async (resolve) => {
|
|
272
|
+
this.filesTableData.push(...(await this.setfileSizeUnits(files)));
|
|
295
273
|
resolve(true);
|
|
296
274
|
});
|
|
297
275
|
}
|
|
@@ -305,32 +283,36 @@ class FileEditComponent {
|
|
|
305
283
|
}
|
|
306
284
|
/**文件处理-调用回调函数 */
|
|
307
285
|
fileHandling() {
|
|
308
|
-
|
|
286
|
+
const theFilesToBeUploaded = this.filesTableData.filter(el => !el.id);
|
|
309
287
|
//判断图片大小是否超过限制-用于判断表单是否允许提交
|
|
310
|
-
|
|
311
|
-
this.fileDataChange.emit({
|
|
288
|
+
const isSubmit = !this.filesTableData.some(el => el.size > this.sizeLimit);
|
|
289
|
+
this.fileDataChange.emit({
|
|
290
|
+
theFilesToBeUploaded,
|
|
291
|
+
deleteTheUploadedFiles: this.deleteTheUploadedFiles,
|
|
292
|
+
isSubmit,
|
|
293
|
+
});
|
|
312
294
|
}
|
|
313
295
|
/**设置值文件大小单位/ */
|
|
314
296
|
async setfileSizeUnits(files) {
|
|
315
|
-
return new Promise((resolve
|
|
316
|
-
|
|
297
|
+
return new Promise((resolve) => {
|
|
298
|
+
const formattedFiles = [];
|
|
317
299
|
files.forEach(async (file) => {
|
|
318
|
-
file.fileSize = this.
|
|
300
|
+
file.fileSize = this._FormatFileSizePipe.transform(file.size);
|
|
319
301
|
formattedFiles.push(file);
|
|
320
302
|
//设置选择图片的本地url
|
|
321
303
|
if (!file.src)
|
|
322
|
-
file.src = await this.
|
|
304
|
+
file.src = await this._GetImageLacolBase64urlService.get(file);
|
|
323
305
|
});
|
|
324
306
|
resolve(files);
|
|
325
307
|
});
|
|
326
308
|
}
|
|
327
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileEditComponent, deps: [{ token:
|
|
328
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FileEditComponent, selector: "fe-file-edit", inputs: { multiple: "multiple", fileData: "fileData", limit: "limit" }, outputs: { fileDataChange: "fileDataChange" }, viewQueries: [{ propertyName: "fileEdit", first: true, predicate: ["fileEdit"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"input-group mb-3\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" (change)=\"getFileChange($event)\">\n</div>\n\n<table class=\"table\" *ngIf=\"filesTableData.length>0\">\n <thead>\n <tr>\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 filesTableData;let i =index\">\n <tr>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.src\" [name]=\"item.name\" [type]=\"item.type\" [preview]=\"true\"></fe-file-preview>\n </td>\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:
|
|
309
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileEditComponent, deps: [{ token: FormatFileSizePipe }, { token: i2.GetImageLacolBase64urlService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
310
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FileEditComponent, selector: "fe-file-edit", inputs: { multiple: "multiple", fileData: "fileData", limit: "limit" }, outputs: { fileDataChange: "fileDataChange" }, viewQueries: [{ propertyName: "fileEdit", first: true, predicate: ["fileEdit"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"input-group mb-3\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" (change)=\"getFileChange($event)\">\n</div>\n\n<table class=\"table\" *ngIf=\"filesTableData.length>0\">\n <thead>\n <tr>\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 filesTableData;let i =index\">\n <tr>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.src\" [name]=\"item.name\" [type]=\"item.type\" [preview]=\"true\"></fe-file-preview>\n </td>\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:(sizeLimit|formatFileSize)}}</div>\n </th>\n <td>{{item.fileSize}}</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: [""], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: FilePreviewComponent, selector: "fe-file-preview", inputs: ["width", "src", "preview", "type", "name", "className"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }] }); }
|
|
329
311
|
}
|
|
330
312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileEditComponent, decorators: [{
|
|
331
313
|
type: Component,
|
|
332
|
-
args: [{ selector: 'fe-file-edit', template: "<div class=\"input-group mb-3\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" (change)=\"getFileChange($event)\">\n</div>\n\n<table class=\"table\" *ngIf=\"filesTableData.length>0\">\n <thead>\n <tr>\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 filesTableData;let i =index\">\n <tr>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.src\" [name]=\"item.name\" [type]=\"item.type\" [preview]=\"true\"></fe-file-preview>\n </td>\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:
|
|
333
|
-
}], ctorParameters: () => [{ type:
|
|
314
|
+
args: [{ selector: 'fe-file-edit', template: "<div class=\"input-group mb-3\">\n <input type=\"file\" class=\"form-control\" #fileEdit [multiple]=\"_multiple\" (change)=\"getFileChange($event)\">\n</div>\n\n<table class=\"table\" *ngIf=\"filesTableData.length>0\">\n <thead>\n <tr>\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 filesTableData;let i =index\">\n <tr>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.src\" [name]=\"item.name\" [type]=\"item.type\" [preview]=\"true\"></fe-file-preview>\n </td>\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:(sizeLimit|formatFileSize)}}</div>\n </th>\n <td>{{item.fileSize}}</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>" }]
|
|
315
|
+
}], ctorParameters: () => [{ type: FormatFileSizePipe }, { type: i2.GetImageLacolBase64urlService }], propDecorators: { multiple: [{
|
|
334
316
|
type: Input
|
|
335
317
|
}], fileData: [{
|
|
336
318
|
type: Input
|
|
@@ -357,6 +339,10 @@ let FileDescriptorService$1 = class FileDescriptorService {
|
|
|
357
339
|
method: 'DELETE',
|
|
358
340
|
url: `/api/file-explorer/files/${id}`,
|
|
359
341
|
}, { apiName: this.apiName, ...config });
|
|
342
|
+
this.deleteByEntityId = (containerName, entityId, config) => this.restService.request({
|
|
343
|
+
method: 'DELETE',
|
|
344
|
+
url: `/api/file-explorer/files/${containerName}/${entityId}`,
|
|
345
|
+
}, { apiName: this.apiName, ...config });
|
|
360
346
|
this.download = (containerName, blobName, fileName, config) => this.restService.request({
|
|
361
347
|
method: 'GET',
|
|
362
348
|
url: `/api/file-explorer/files/download/${containerName}/${blobName}`,
|
|
@@ -368,14 +354,17 @@ let FileDescriptorService$1 = class FileDescriptorService {
|
|
|
368
354
|
}, { apiName: this.apiName, ...config });
|
|
369
355
|
this.getFileContainerConfiguration = (containerName, config) => this.restService.request({
|
|
370
356
|
method: 'GET',
|
|
371
|
-
url:
|
|
372
|
-
params: { containerName },
|
|
357
|
+
url: `/api/file-explorer/files/${containerName}/configuration`,
|
|
373
358
|
}, { apiName: this.apiName, ...config });
|
|
374
359
|
this.getList = (input, config) => this.restService.request({
|
|
375
360
|
method: 'GET',
|
|
376
361
|
url: '/api/file-explorer/files',
|
|
377
362
|
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 },
|
|
378
363
|
}, { apiName: this.apiName, ...config });
|
|
364
|
+
this.getListByEntityId = (containerName, entityId, config) => this.restService.request({
|
|
365
|
+
method: 'GET',
|
|
366
|
+
url: `/api/file-explorer/files/${containerName}/${entityId}/all`,
|
|
367
|
+
}, { apiName: this.apiName, ...config });
|
|
379
368
|
this.getStream = (containerName, blobName, imageResize, config) => this.restService.request({
|
|
380
369
|
method: 'GET',
|
|
381
370
|
responseType: 'blob',
|
|
@@ -441,15 +430,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
441
430
|
}]
|
|
442
431
|
}], ctorParameters: () => [{ type: i3.RestService }] });
|
|
443
432
|
|
|
433
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
444
434
|
/* eslint-disable @angular-eslint/component-selector */
|
|
445
|
-
|
|
435
|
+
let that;
|
|
446
436
|
class FileModalTreeComponent {
|
|
447
|
-
constructor(_DescriptorService, fb, toaster,
|
|
437
|
+
constructor(_DescriptorService, fb, toaster, _LocalizationService, confirmation) {
|
|
448
438
|
this._DescriptorService = _DescriptorService;
|
|
449
439
|
this.fb = fb;
|
|
450
440
|
this.toaster = toaster;
|
|
451
|
-
this._FileApiService = _FileApiService;
|
|
452
441
|
this._LocalizationService = _LocalizationService;
|
|
442
|
+
this.confirmation = confirmation;
|
|
453
443
|
/**文件分组列表 */
|
|
454
444
|
this.fileGroupList = [];
|
|
455
445
|
/**选择的tree节点 */
|
|
@@ -460,25 +450,41 @@ class FileModalTreeComponent {
|
|
|
460
450
|
this.anExpandedNode = [];
|
|
461
451
|
/**tree节点选择回调 */
|
|
462
452
|
this.nodeClick = new EventEmitter();
|
|
463
|
-
|
|
453
|
+
/**获取数据后回调给file-modal */
|
|
454
|
+
this.treeNodeData = new EventEmitter();
|
|
455
|
+
/**查看所有文件回调函数,在file-modal中处理逻辑 */
|
|
456
|
+
this.lookAllBtn = new EventEmitter();
|
|
457
|
+
this.handleClick = event => event.stopPropagation();
|
|
458
|
+
this.selectedNode = [];
|
|
464
459
|
/**判断节点是否选中 */
|
|
465
|
-
this.isNodeSelected =
|
|
460
|
+
this.isNodeSelected = el => {
|
|
461
|
+
return el.key === this._theSelectedTreeNode?.key;
|
|
462
|
+
};
|
|
466
463
|
/**分组 */
|
|
467
464
|
/**模态框-状态-是否打开 */
|
|
468
465
|
this.ModalDescriptorOpen = false;
|
|
469
466
|
/**模态框-descriptor-繁忙状态-用于确定模态的繁忙状态是否为真 */
|
|
470
467
|
this.ModalDescriptorBusy = false;
|
|
471
|
-
|
|
468
|
+
this.formValidation = '';
|
|
469
|
+
this._ValidatorsService = inject(ValidatorsService);
|
|
470
|
+
that = this;
|
|
472
471
|
}
|
|
473
472
|
set theSelectedTreeNode(v) {
|
|
474
473
|
this._theSelectedTreeNode = v;
|
|
475
|
-
if (v
|
|
474
|
+
if (v == '') {
|
|
476
475
|
this.loadData();
|
|
477
476
|
}
|
|
478
477
|
}
|
|
479
478
|
set fileContainerName(v) {
|
|
480
479
|
if (v) {
|
|
481
480
|
this._fileContainerName = v;
|
|
481
|
+
// this.loadData();
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
ngAfterContentInit() {
|
|
485
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
486
|
+
//Add 'implements AfterContentInit' to the class.
|
|
487
|
+
if (this._fileContainerName) {
|
|
482
488
|
this.loadData();
|
|
483
489
|
}
|
|
484
490
|
}
|
|
@@ -489,48 +495,70 @@ class FileModalTreeComponent {
|
|
|
489
495
|
}
|
|
490
496
|
/**获取文件分组 */
|
|
491
497
|
getFileGroupList() {
|
|
492
|
-
this._DescriptorService
|
|
498
|
+
this._DescriptorService
|
|
499
|
+
.getList({
|
|
493
500
|
containerName: this._fileContainerName,
|
|
494
|
-
})
|
|
501
|
+
})
|
|
502
|
+
.subscribe(async (res) => {
|
|
495
503
|
this.fileGroupList = await this.setTheValueOfTheNodeRecursively(res.items);
|
|
504
|
+
this.treeNodeData.emit(this.fileGroupList);
|
|
496
505
|
});
|
|
497
506
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
507
|
+
/**查看所有文件 */
|
|
508
|
+
onLookAllBtn() {
|
|
509
|
+
this.lookAllBtn.emit();
|
|
510
|
+
}
|
|
511
|
+
/**递归-将列表转化为父子级结构 */
|
|
512
|
+
setTheValueOfTheNodeRecursively(array, parentId = null, root) {
|
|
513
|
+
const rootList = root || array;
|
|
514
|
+
const result = array.filter(item => item.parentId === parentId);
|
|
515
|
+
result.sort((a, b) => a.order - b.order);
|
|
516
|
+
result.map((el) => {
|
|
517
|
+
el.title = el.name;
|
|
518
|
+
el.key = el.id;
|
|
519
|
+
el.entity = el.id; /** 节点值 */
|
|
520
|
+
el.expanded = this.anExpandedNode.includes(el.key);
|
|
521
|
+
el.children.sort((a, b) => a.order - b.order);
|
|
522
|
+
if (el.children.length > 0) {
|
|
523
|
+
this.setTheValueOfTheNodeRecursively(el.children, el.id, rootList);
|
|
524
|
+
}
|
|
510
525
|
});
|
|
526
|
+
return result;
|
|
511
527
|
}
|
|
512
528
|
/**tree-拖拽 */
|
|
513
|
-
nzEvent(event) {
|
|
514
|
-
}
|
|
529
|
+
nzEvent(event) { }
|
|
515
530
|
/**tree-拖拽 -验证*/
|
|
516
531
|
beforeDrop(arg) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
532
|
+
const { pos, dragNode, node } = arg;
|
|
533
|
+
// 只处理有效的拖拽位置
|
|
534
|
+
if (pos === 0 || pos === 1 || pos === -1) {
|
|
535
|
+
// 根据不同的拖拽位置计算参数
|
|
536
|
+
const parentId = pos === 0 ? node.key : node.parentNode?.key || '';
|
|
537
|
+
let order;
|
|
538
|
+
if (pos === 1) {
|
|
539
|
+
order = node.origin.order + 1;
|
|
540
|
+
}
|
|
541
|
+
else if (pos === 0) {
|
|
542
|
+
order = node.origin.children.length + 1;
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
// pos === -1
|
|
546
|
+
order = Math.max(0, node.origin.order - 1);
|
|
547
|
+
}
|
|
548
|
+
// 统一处理移动逻辑
|
|
549
|
+
return that._DescriptorService.move(dragNode.key, { parentId, order }).pipe(tap(() => that.getFileGroupList()), map(() => true));
|
|
528
550
|
}
|
|
551
|
+
return of(false);
|
|
529
552
|
}
|
|
530
553
|
/**tree--选择节点 */
|
|
531
|
-
activeNode(
|
|
532
|
-
|
|
533
|
-
|
|
554
|
+
activeNode(node) {
|
|
555
|
+
if (event?.target?.localName == 'i')
|
|
556
|
+
return;
|
|
557
|
+
if (this._theSelectedTreeNode?.key == node.key)
|
|
558
|
+
return;
|
|
559
|
+
this.selectedNode = [node];
|
|
560
|
+
this._theSelectedTreeNode = node;
|
|
561
|
+
this.nodeClick.emit(node);
|
|
534
562
|
}
|
|
535
563
|
/**点击展开树节点图标触发 */
|
|
536
564
|
nzExpandChange(event) {
|
|
@@ -549,23 +577,32 @@ class FileModalTreeComponent {
|
|
|
549
577
|
this.ModalDescriptorForm = this.fb.group({
|
|
550
578
|
containerName: [this._fileContainerName || '', Validators.required],
|
|
551
579
|
name: ['', Validators.required],
|
|
552
|
-
parentId: [items?.key || ''
|
|
580
|
+
parentId: [items?.key || ''],
|
|
553
581
|
});
|
|
554
582
|
/**编辑 */
|
|
555
583
|
if (edit) {
|
|
556
584
|
this.theNodeBeingEdited = items.origin;
|
|
557
585
|
this.ModalDescriptorForm.patchValue({
|
|
558
|
-
name: items.origin.name
|
|
586
|
+
name: items.origin.name,
|
|
559
587
|
});
|
|
560
588
|
}
|
|
561
589
|
}
|
|
562
590
|
/**删除分组 */
|
|
563
591
|
deleteDescriptorBtn(node) {
|
|
564
|
-
this.
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
592
|
+
this.confirmation
|
|
593
|
+
.warn('', {
|
|
594
|
+
key: '',
|
|
595
|
+
defaultValue: this._LocalizationService.instant(`FileExplorer::DeletionConfirmationMessage`, node.title),
|
|
596
|
+
})
|
|
597
|
+
.subscribe((status) => {
|
|
598
|
+
if (status == 'confirm') {
|
|
599
|
+
this._DescriptorService.delete(node.key).subscribe(res => {
|
|
600
|
+
this.ModalDescriptorOpen = false;
|
|
601
|
+
if (this.theNodeBeingEdited.key == node.key)
|
|
602
|
+
this.theNodeBeingEdited = '';
|
|
603
|
+
this.getFileGroupList();
|
|
604
|
+
});
|
|
605
|
+
}
|
|
569
606
|
});
|
|
570
607
|
}
|
|
571
608
|
/**模态框-descriptor-状态改变回调 */
|
|
@@ -578,29 +615,53 @@ class FileModalTreeComponent {
|
|
|
578
615
|
}
|
|
579
616
|
/**f分组模态框保存 */
|
|
580
617
|
createOrEditSave() {
|
|
581
|
-
|
|
618
|
+
const input = this.ModalDescriptorForm.value;
|
|
619
|
+
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.ModalDescriptorForm);
|
|
620
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'FileExplorer'))
|
|
621
|
+
return;
|
|
622
|
+
if (!this.ModalDescriptorForm.valid)
|
|
623
|
+
return;
|
|
624
|
+
if (this.ModalDescriptorBusy)
|
|
625
|
+
return;
|
|
626
|
+
this.ModalDescriptorBusy = true;
|
|
582
627
|
if (this.theNodeBeingEdited) {
|
|
583
|
-
this._DescriptorService
|
|
628
|
+
this._DescriptorService
|
|
629
|
+
.update(this.theNodeBeingEdited.key, input)
|
|
630
|
+
.pipe(finalize(() => {
|
|
631
|
+
this.ModalDescriptorBusy = false;
|
|
632
|
+
}))
|
|
633
|
+
.subscribe(res => {
|
|
584
634
|
this.ModalDescriptorOpen = false;
|
|
635
|
+
this.ModalDescriptorVisibleChange(false);
|
|
585
636
|
this.getFileGroupList();
|
|
586
637
|
});
|
|
587
638
|
return;
|
|
588
639
|
}
|
|
589
|
-
this._DescriptorService
|
|
640
|
+
this._DescriptorService
|
|
641
|
+
.create(input)
|
|
642
|
+
.pipe(finalize(() => {
|
|
643
|
+
this.ModalDescriptorBusy = false;
|
|
644
|
+
}))
|
|
645
|
+
.subscribe(res => {
|
|
590
646
|
this.ModalDescriptorOpen = false;
|
|
647
|
+
this.ModalDescriptorVisibleChange(false);
|
|
591
648
|
this.getFileGroupList();
|
|
592
649
|
});
|
|
593
650
|
}
|
|
594
|
-
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:
|
|
595
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
651
|
+
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: i3.LocalizationService }, { token: i2$1.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
652
|
+
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: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.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: i8.ExpandedIconTemplateDirective, selector: "[abpTreeExpandedIconTemplate],[abp-tree-expanded-icon-template]" }, { kind: "component", type: i8.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" }] }); }
|
|
596
653
|
}
|
|
597
654
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalTreeComponent, decorators: [{
|
|
598
655
|
type: Component,
|
|
599
|
-
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<
|
|
600
|
-
}], ctorParameters: () => [{ type: FileDescriptorService }, { type: i1.FormBuilder }, { type: i2$1.ToasterService }, { type:
|
|
656
|
+
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>" }]
|
|
657
|
+
}], ctorParameters: () => [{ type: FileDescriptorService }, { type: i1$1.FormBuilder }, { type: i2$1.ToasterService }, { type: i3.LocalizationService }, { type: i2$1.ConfirmationService }], propDecorators: { theSelectedTreeNode: [{
|
|
601
658
|
type: Input
|
|
602
659
|
}], nodeClick: [{
|
|
603
660
|
type: Output
|
|
661
|
+
}], treeNodeData: [{
|
|
662
|
+
type: Output
|
|
663
|
+
}], lookAllBtn: [{
|
|
664
|
+
type: Output
|
|
604
665
|
}], fileContainerName: [{
|
|
605
666
|
type: Input
|
|
606
667
|
}], ModalFormDescriptorSubmit: [{
|
|
@@ -608,13 +669,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
608
669
|
args: ['ModalFormDescriptorSubmit', { static: false }]
|
|
609
670
|
}] } });
|
|
610
671
|
|
|
611
|
-
|
|
672
|
+
class GetDirectoryNamePipe {
|
|
673
|
+
transform(value, ...args) {
|
|
674
|
+
if (value) {
|
|
675
|
+
return args[0].find(el => el.id == value)?.name;
|
|
676
|
+
}
|
|
677
|
+
return '';
|
|
678
|
+
}
|
|
679
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetDirectoryNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
680
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: GetDirectoryNamePipe, isStandalone: true, name: "getDirectoryName" }); }
|
|
681
|
+
}
|
|
682
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: GetDirectoryNamePipe, decorators: [{
|
|
683
|
+
type: Pipe,
|
|
684
|
+
args: [{
|
|
685
|
+
name: 'getDirectoryName',
|
|
686
|
+
standalone: true
|
|
687
|
+
}]
|
|
688
|
+
}] });
|
|
689
|
+
|
|
690
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
691
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
612
692
|
class FileModalComponent {
|
|
613
|
-
constructor(_FileService, toaster, list,
|
|
693
|
+
constructor(_FileService, toaster, list, restService, confirmation, _LocalizationService) {
|
|
614
694
|
this._FileService = _FileService;
|
|
615
695
|
this.toaster = toaster;
|
|
616
696
|
this.list = list;
|
|
617
|
-
this._FileApiService = _FileApiService;
|
|
618
697
|
this.restService = restService;
|
|
619
698
|
this.confirmation = confirmation;
|
|
620
699
|
this._LocalizationService = _LocalizationService;
|
|
@@ -624,8 +703,8 @@ class FileModalComponent {
|
|
|
624
703
|
/**是否多选 */
|
|
625
704
|
this._multiple = false;
|
|
626
705
|
/**文件大小限制
|
|
627
|
-
|
|
628
|
-
|
|
706
|
+
* @param 1mb
|
|
707
|
+
*/
|
|
629
708
|
this.sizeLimit = 1048576;
|
|
630
709
|
/**模态框状态回调 */
|
|
631
710
|
this.visibleChange = new EventEmitter();
|
|
@@ -636,6 +715,9 @@ class FileModalComponent {
|
|
|
636
715
|
/**dignite-file-modal-tree */
|
|
637
716
|
/**选择的tree节点 */
|
|
638
717
|
this._theSelectedTreeNode = '';
|
|
718
|
+
this.isCreateList = false;
|
|
719
|
+
/** 从tree获取来的数据 */
|
|
720
|
+
this.fileGroupList = [];
|
|
639
721
|
/**图片上传-要上传图片的状态文件列表 */
|
|
640
722
|
this.uploadPictureStatusList = [];
|
|
641
723
|
/**文件表格-数据*/
|
|
@@ -647,45 +729,54 @@ class FileModalComponent {
|
|
|
647
729
|
this.filters = {};
|
|
648
730
|
/**文件表格-表格自带选择类型 */
|
|
649
731
|
this.SelectionType = SelectionType;
|
|
650
|
-
/**文件表格-选择的表格数据项 */
|
|
651
|
-
this.selectedTable = [];
|
|
652
|
-
/**当前选择的table项 id */
|
|
653
|
-
this.nowSelectId = '';
|
|
654
732
|
/**选择文件回调 */
|
|
655
733
|
this.selectFilefn = new EventEmitter();
|
|
656
|
-
/**一个布尔or函数,可用于检查是否要根据条件选择特定行。 */
|
|
657
|
-
this.selectCheck = (row, column, value) => {
|
|
658
|
-
this.nowSelectId = row.id;
|
|
659
|
-
return true;
|
|
660
|
-
};
|
|
661
|
-
/**判断row是否选中 */
|
|
662
|
-
this.selectedcheckbox = (id) => {
|
|
663
|
-
return this.selectedTable.some(el => el.id == id);
|
|
664
|
-
};
|
|
665
734
|
/**创建图片的接口,代理中的file类型不匹配,切换为any类型 */
|
|
666
735
|
this.createFile = (input, config) => this.restService.request({
|
|
667
736
|
method: 'POST',
|
|
668
737
|
url: '/api/file-explorer/files',
|
|
669
|
-
params: {
|
|
738
|
+
params: {
|
|
739
|
+
containerName: input.containerName,
|
|
740
|
+
cellName: input.cellName,
|
|
741
|
+
directoryId: input.directoryId,
|
|
742
|
+
entityId: input.entityId,
|
|
743
|
+
},
|
|
670
744
|
body: input.file,
|
|
671
745
|
}, { apiName: 'FileExplorer', ...config });
|
|
672
|
-
|
|
746
|
+
/**文件表格-选择的表格数据项 */
|
|
747
|
+
this.selectedTable = [];
|
|
748
|
+
/**当前选择的table项 id */
|
|
749
|
+
this.nowSelectId = '';
|
|
750
|
+
/**是否全选 */
|
|
751
|
+
this.isAllSelected = false;
|
|
752
|
+
/**判断row是否选中 */
|
|
753
|
+
this.selectedcheckbox = id => {
|
|
754
|
+
return this.selectedTable.some(el => el.id === id);
|
|
755
|
+
};
|
|
756
|
+
/**当前编辑的row */
|
|
757
|
+
this.newEditRow = '';
|
|
758
|
+
/**是否正在加载 */
|
|
759
|
+
this.isloading = false;
|
|
673
760
|
}
|
|
674
761
|
/**获取目录配置 */
|
|
675
762
|
getFilesConfiguration() {
|
|
676
|
-
|
|
677
|
-
this.
|
|
763
|
+
return new Promise((resolve, reject) => {
|
|
764
|
+
this._FileDescriptorService
|
|
765
|
+
.getFileContainerConfiguration(this._fileContainerName)
|
|
766
|
+
.subscribe(res => {
|
|
767
|
+
this.createDirectoryPermissionName = res?.createDirectoryPermissionName;
|
|
768
|
+
resolve(res);
|
|
769
|
+
});
|
|
678
770
|
});
|
|
679
771
|
}
|
|
680
772
|
set fileContainerName(v) {
|
|
681
773
|
if (v) {
|
|
682
774
|
this._fileContainerName = v;
|
|
683
|
-
this.loadData()
|
|
775
|
+
// this.loadData()
|
|
684
776
|
}
|
|
685
777
|
}
|
|
686
778
|
set multiple(v) {
|
|
687
779
|
this._multiple = v;
|
|
688
|
-
if (v) { }
|
|
689
780
|
}
|
|
690
781
|
set limit(v) {
|
|
691
782
|
this.sizeLimit = v;
|
|
@@ -700,52 +791,98 @@ class FileModalComponent {
|
|
|
700
791
|
/**模态框-状态改变回调 */
|
|
701
792
|
ModalVisibleChange(event) {
|
|
702
793
|
if (!event) {
|
|
794
|
+
this.ModalOpen = false;
|
|
795
|
+
this.ModalBusy = false;
|
|
703
796
|
this.visibleChange.emit(event);
|
|
797
|
+
this.createDirectoryPermissionName = '';
|
|
798
|
+
this._theSelectedTreeNode = '';
|
|
799
|
+
this.selectedTable = [];
|
|
800
|
+
this.uploadPictureStatusList = [];
|
|
704
801
|
return;
|
|
705
802
|
}
|
|
706
803
|
}
|
|
707
804
|
/**模态框保存 */
|
|
708
805
|
modalSave() {
|
|
709
|
-
|
|
806
|
+
const selectedTablearr = structuredClone(this.selectedTable);
|
|
710
807
|
this.selectFilefn.emit(selectedTablearr);
|
|
711
808
|
this.ModalVisibleChange(false);
|
|
712
809
|
}
|
|
713
810
|
/**初始化数据 */
|
|
714
811
|
loadData() {
|
|
715
812
|
if (this.ModalOpen && this._fileContainerName) {
|
|
716
|
-
this.
|
|
813
|
+
this.list.maxResultCount = 100;
|
|
814
|
+
// this.filters.skipCount = 0;
|
|
717
815
|
this.getFilesConfiguration();
|
|
816
|
+
if (!this.isCreateList) {
|
|
817
|
+
this.hookToQuery();
|
|
818
|
+
this.isCreateList = true;
|
|
819
|
+
}
|
|
820
|
+
else {
|
|
821
|
+
this.list.get();
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
/** 从tree获取数据 */
|
|
826
|
+
treeNodeData(event) {
|
|
827
|
+
this.fileGroupList = this.flattenNestedArray(event);
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* 将嵌套数组扁平化
|
|
831
|
+
* @param {Array} nestedArray - 包含嵌套children的数组
|
|
832
|
+
* @returns {Array} - 扁平化后的数组
|
|
833
|
+
*/
|
|
834
|
+
flattenNestedArray(nestedArray) {
|
|
835
|
+
const result = [];
|
|
836
|
+
function flatten(items) {
|
|
837
|
+
if (!items)
|
|
838
|
+
return;
|
|
839
|
+
for (const item of items) {
|
|
840
|
+
// 将当前项添加到结果数组
|
|
841
|
+
result.push({ ...item });
|
|
842
|
+
// 如果有children属性且是数组,递归处理
|
|
843
|
+
if (item.children && Array.isArray(item.children)) {
|
|
844
|
+
flatten(item.children);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
718
847
|
}
|
|
848
|
+
flatten(nestedArray);
|
|
849
|
+
return result;
|
|
719
850
|
}
|
|
720
851
|
/**tree-节点选择 */
|
|
721
852
|
_nodeClick(event) {
|
|
853
|
+
this.filters.skipCount = 0;
|
|
722
854
|
this._theSelectedTreeNode = event;
|
|
723
855
|
this.list.get();
|
|
724
856
|
}
|
|
725
857
|
/**图片上传-获取文件信息改变 */
|
|
726
858
|
async getFileChange(event) {
|
|
727
|
-
|
|
859
|
+
const _that = this;
|
|
860
|
+
const files = new Array(...event.target.files);
|
|
728
861
|
this.uploadPictureStatusList = files;
|
|
862
|
+
const uploadPromises = [];
|
|
729
863
|
for (const file of files) {
|
|
730
864
|
if (file.size > this.sizeLimit) {
|
|
731
865
|
this.setuploadPictureStatus(file, 2);
|
|
732
866
|
continue;
|
|
733
867
|
}
|
|
734
|
-
|
|
868
|
+
uploadPromises.push(this.uploadingFile(file)
|
|
869
|
+
.then(res => {
|
|
735
870
|
this.setuploadPictureStatus(file, 1);
|
|
736
|
-
|
|
737
|
-
|
|
871
|
+
})
|
|
872
|
+
.catch(function (err) {
|
|
738
873
|
this.setuploadPictureStatus(file, 2);
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
this.list.get();
|
|
742
|
-
let isSubmit = !this.uploadPictureStatusList.some(el => el.status == 2);
|
|
743
|
-
if (isSubmit) {
|
|
744
|
-
// this.toaster.success("上传完成");
|
|
745
|
-
setTimeout(() => {
|
|
746
|
-
this.uploadPictureStatusList = [];
|
|
747
|
-
}, 6000);
|
|
874
|
+
return err;
|
|
875
|
+
}));
|
|
748
876
|
}
|
|
877
|
+
Promise.all(uploadPromises).then((results) => {
|
|
878
|
+
_that.list.get();
|
|
879
|
+
const isSubmit = !_that.uploadPictureStatusList.some(el => el.status == 2);
|
|
880
|
+
if (isSubmit) {
|
|
881
|
+
setTimeout(() => {
|
|
882
|
+
_that.uploadPictureStatusList = [];
|
|
883
|
+
}, 4000);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
749
886
|
}
|
|
750
887
|
/**图片上传-设置uploadPictureStatusList的状态 */
|
|
751
888
|
setuploadPictureStatus(file, type) {
|
|
@@ -757,49 +894,163 @@ class FileModalComponent {
|
|
|
757
894
|
/**图片上传-递归按顺序上传 */
|
|
758
895
|
uploadingFile(file) {
|
|
759
896
|
return new Promise((resolve, rejects) => {
|
|
760
|
-
|
|
897
|
+
const formData = new FormData();
|
|
761
898
|
formData.append('file', file, file.name);
|
|
762
899
|
this.createFile({
|
|
763
900
|
file: formData,
|
|
764
901
|
containerName: this._fileContainerName,
|
|
765
902
|
directoryId: this._theSelectedTreeNode?.key || '',
|
|
766
|
-
entityId: ''
|
|
903
|
+
entityId: '',
|
|
767
904
|
}).subscribe(res => {
|
|
768
|
-
resolve(
|
|
769
|
-
},
|
|
770
|
-
rejects(
|
|
905
|
+
resolve({ file: file.name, status: 'success', response: res });
|
|
906
|
+
}, err => {
|
|
907
|
+
rejects({ file: file.name, status: 'fail', error: err });
|
|
771
908
|
});
|
|
772
909
|
});
|
|
773
910
|
}
|
|
774
|
-
ngOnChanges(changes) {
|
|
775
|
-
//Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
|
|
776
|
-
//Add '${implements OnChanges}' to the class.
|
|
777
|
-
this.selectedTable = this._FileApiService.deepClone(this.selectPickerFile);
|
|
778
|
-
}
|
|
779
911
|
/**文件表格-获取表格数据 */
|
|
780
912
|
hookToQuery() {
|
|
781
913
|
const getData = (query) => this._FileService.getList({
|
|
782
914
|
...query,
|
|
783
915
|
...this.filters,
|
|
784
916
|
containerName: this._fileContainerName,
|
|
785
|
-
directoryId: this._theSelectedTreeNode.key
|
|
917
|
+
directoryId: this._theSelectedTreeNode.key,
|
|
786
918
|
});
|
|
787
|
-
const setData = (list) =>
|
|
919
|
+
const setData = (list) => {
|
|
920
|
+
this.data = list;
|
|
921
|
+
this.onPageChange(list.items);
|
|
922
|
+
};
|
|
788
923
|
this.list.hookToQuery(getData).subscribe(setData);
|
|
789
924
|
}
|
|
790
925
|
/**文件表格-查看所有分组的文件数据 */
|
|
791
926
|
lookAllFile() {
|
|
927
|
+
this.filters.skipCount = 0;
|
|
792
928
|
this._theSelectedTreeNode = '';
|
|
793
929
|
this.list.get();
|
|
794
930
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
this.
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
931
|
+
/**删除图片 */
|
|
932
|
+
deleteFile(file) {
|
|
933
|
+
this._FileService.delete(file.id).subscribe(res => {
|
|
934
|
+
this.toaster.success(this._LocalizationService.instant(`FileExplorer::DeletedSuccessfully`));
|
|
935
|
+
this.list.get();
|
|
936
|
+
const selectedTables = this.selectedTable;
|
|
937
|
+
this.selectedTable = selectedTables.filter(el => el.id != file.id);
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
/**删除所有选中图片 */
|
|
941
|
+
onDeleteAllSelectFile() {
|
|
942
|
+
this.confirmation
|
|
943
|
+
.warn('', {
|
|
944
|
+
key: '',
|
|
945
|
+
defaultValue: this._LocalizationService.instant(`FileExplorer::AreYouSure`),
|
|
946
|
+
})
|
|
947
|
+
.subscribe(async (status) => {
|
|
948
|
+
if (status == 'confirm') {
|
|
949
|
+
const selectedTable = this.selectedTable;
|
|
950
|
+
try {
|
|
951
|
+
const result = await this.batchDeleteItems(selectedTable);
|
|
952
|
+
console.log(result, 'resultresultresult');
|
|
953
|
+
if (result.success) {
|
|
954
|
+
this.toaster.success(result.message);
|
|
955
|
+
this.list.get();
|
|
956
|
+
this.selectedTable = [];
|
|
957
|
+
// 可能需要刷新表格或更新UI
|
|
958
|
+
}
|
|
959
|
+
else {
|
|
960
|
+
//删除失败的项
|
|
961
|
+
this.list.get();
|
|
962
|
+
// 可以选择展示失败项或重试
|
|
963
|
+
this.selectedTable = result.failedItems;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
catch (error) {
|
|
967
|
+
//批量删除过程中发生错误
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* 批量删除表格项
|
|
974
|
+
* @param selectedTable 需要删除的表格项数组
|
|
975
|
+
* @returns 包含成功状态和失败项的结果对象
|
|
976
|
+
*/
|
|
977
|
+
async batchDeleteItems(selectedTable) {
|
|
978
|
+
// 存储所有删除请求的Promise
|
|
979
|
+
const deletePromises = selectedTable.map(item => {
|
|
980
|
+
return new Promise((resolve, reject) => {
|
|
981
|
+
this._FileService.delete(item.id).subscribe(() => {
|
|
982
|
+
resolve(null);
|
|
983
|
+
}, () => {
|
|
984
|
+
reject(item);
|
|
985
|
+
});
|
|
986
|
+
});
|
|
987
|
+
});
|
|
988
|
+
// 等待所有请求完成
|
|
989
|
+
const results = await Promise.allSettled(deletePromises);
|
|
990
|
+
// 收集失败的项
|
|
991
|
+
const failedItems = [];
|
|
992
|
+
results.forEach(result => {
|
|
993
|
+
if (result.status === 'rejected') {
|
|
994
|
+
failedItems.push(result.reason);
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
return {
|
|
998
|
+
success: failedItems.length === 0,
|
|
999
|
+
failedItems,
|
|
1000
|
+
message: failedItems.length === 0
|
|
1001
|
+
? this._LocalizationService.instant(`FileExplorer::DeletedSuccessfully`)
|
|
1002
|
+
: `${failedItems.length}个项删除失败`,
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
/**关闭文件状态弹窗 */
|
|
1006
|
+
closeFileStatusModal() {
|
|
1007
|
+
this.uploadPictureStatusList = [];
|
|
1008
|
+
}
|
|
1009
|
+
ngOnChanges(changes) {
|
|
1010
|
+
//Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
|
|
1011
|
+
//Add '${implements OnChanges}' to the class.
|
|
1012
|
+
this.selectedTable = structuredClone(this.selectPickerFile);
|
|
1013
|
+
}
|
|
1014
|
+
/**表格分页切换 */
|
|
1015
|
+
onPageChange(newArray) {
|
|
1016
|
+
this.isAllSelected = this.isAllSelectedFn(newArray, this.selectedTable);
|
|
1017
|
+
}
|
|
1018
|
+
/**行选择框改变 */
|
|
1019
|
+
onCheckboxChangeFn(event, row, array) {
|
|
1020
|
+
const { checked } = event.target;
|
|
1021
|
+
let selectedTableArray = [...this.selectedTable];
|
|
1022
|
+
if (this._multiple) {
|
|
1023
|
+
if (checked) {
|
|
1024
|
+
selectedTableArray.push(row);
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
selectedTableArray = selectedTableArray.filter(el => el.id != row.id);
|
|
1028
|
+
}
|
|
1029
|
+
this.isAllSelected = this.isAllSelectedFn(array, selectedTableArray);
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
selectedTableArray.length = 0;
|
|
1033
|
+
selectedTableArray = checked ? [row] : [];
|
|
801
1034
|
}
|
|
802
|
-
this.selectedTable =
|
|
1035
|
+
this.selectedTable = this.removeDuplicatesById(selectedTableArray);
|
|
1036
|
+
}
|
|
1037
|
+
/**如果selectedTableArray不含array中的所有项,则将isAllSelected设为true,否则设为false */
|
|
1038
|
+
isAllSelectedFn(tolalArray, selectedArray = []) {
|
|
1039
|
+
if (tolalArray.length == 0)
|
|
1040
|
+
return false;
|
|
1041
|
+
return tolalArray.every(item => selectedArray.some(el => el.id === item.id));
|
|
1042
|
+
}
|
|
1043
|
+
/**选择当前页全部 */
|
|
1044
|
+
onSelectAllFn(event, array) {
|
|
1045
|
+
let selectedTableArray = this.selectedTable;
|
|
1046
|
+
if (event.target.checked) {
|
|
1047
|
+
selectedTableArray = this.removeDuplicatesById([...selectedTableArray, ...array]);
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
selectedTableArray = selectedTableArray.filter(el => !array.some(item => item.id === el.id));
|
|
1051
|
+
}
|
|
1052
|
+
this.isAllSelected = event.target.checked;
|
|
1053
|
+
this.selectedTable = selectedTableArray;
|
|
803
1054
|
}
|
|
804
1055
|
/**删除数组中重复的项 */
|
|
805
1056
|
removeDuplicatesById(array) {
|
|
@@ -812,32 +1063,61 @@ class FileModalComponent {
|
|
|
812
1063
|
return false;
|
|
813
1064
|
});
|
|
814
1065
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
this.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1066
|
+
/**提交FileName编辑 */
|
|
1067
|
+
onSubmitFileName(event) {
|
|
1068
|
+
const input = this.FileNameForm.value;
|
|
1069
|
+
if (!this.FileNameForm.valid)
|
|
1070
|
+
return;
|
|
1071
|
+
if (this.isloading)
|
|
1072
|
+
return;
|
|
1073
|
+
this.isloading = true;
|
|
1074
|
+
this._FileService
|
|
1075
|
+
.update(input.id, {
|
|
1076
|
+
name: input.fileName,
|
|
1077
|
+
})
|
|
1078
|
+
.pipe(finalize(() => {
|
|
1079
|
+
this.isloading = false;
|
|
1080
|
+
}))
|
|
1081
|
+
.subscribe(res => {
|
|
1082
|
+
//通过当前newEditRow的id,修改data.items中对应项的name
|
|
1083
|
+
for (const element of this.data.items) {
|
|
1084
|
+
if (element.id == this.newEditRow.id) {
|
|
1085
|
+
element.name = input.fileName;
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
825
1088
|
}
|
|
1089
|
+
this.FileNameForm = undefined;
|
|
1090
|
+
this.newEditRow = '';
|
|
1091
|
+
this.toaster.success(this._LocalizationService.instant(`FileExplorer::SavedSuccessfully`));
|
|
1092
|
+
// this.list.get();
|
|
826
1093
|
});
|
|
827
1094
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
this.
|
|
1095
|
+
/**打开编辑 */
|
|
1096
|
+
onEditFileName(row) {
|
|
1097
|
+
this.FileNameForm = new FormGroup({
|
|
1098
|
+
fileName: new FormControl('', [Validators.required]),
|
|
1099
|
+
id: new FormControl('', [Validators.required]),
|
|
1100
|
+
});
|
|
1101
|
+
this.FileNameForm.patchValue({
|
|
1102
|
+
fileName: row.name,
|
|
1103
|
+
id: row.id,
|
|
1104
|
+
});
|
|
1105
|
+
this.newEditRow = row;
|
|
1106
|
+
}
|
|
1107
|
+
/**关闭编辑 */
|
|
1108
|
+
onCancelFileName(row) {
|
|
1109
|
+
this.newEditRow = '';
|
|
1110
|
+
this.FileNameForm = undefined;
|
|
831
1111
|
}
|
|
832
|
-
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:
|
|
833
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1112
|
+
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: i3.RestService }, { token: i2$1.ConfirmationService }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1113
|
+
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: [
|
|
834
1114
|
// [Required]
|
|
835
1115
|
ListService,
|
|
836
1116
|
// [Optional]
|
|
837
1117
|
// Provide this token if you want a different debounce time.
|
|
838
1118
|
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
839
1119
|
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
840
|
-
], 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"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
1120
|
+
], 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 {{(value|formatFileSize) }}\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:(sizeLimit|formatFileSize)}}\n </div>\n </th>\n <td>{{ item.size | formatFileSize }}</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: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.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: 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: 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: i5.DatePipe, name: "date" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: GetDirectoryNamePipe, name: "getDirectoryName" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }] }); }
|
|
841
1121
|
}
|
|
842
1122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileModalComponent, decorators: [{
|
|
843
1123
|
type: Component,
|
|
@@ -848,8 +1128,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
848
1128
|
// Provide this token if you want a different debounce time.
|
|
849
1129
|
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
850
1130
|
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
851
|
-
], 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"] }]
|
|
852
|
-
}], ctorParameters: () => [{ type: FileDescriptorService$1 }, { type: i2$1.ToasterService }, { type: i3.ListService }, { type:
|
|
1131
|
+
], 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 {{(value|formatFileSize) }}\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:(sizeLimit|formatFileSize)}}\n </div>\n </th>\n <td>{{ item.size | formatFileSize }}</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"] }]
|
|
1132
|
+
}], ctorParameters: () => [{ type: FileDescriptorService$1 }, { type: i2$1.ToasterService }, { type: i3.ListService }, { type: i3.RestService }, { type: i2$1.ConfirmationService }, { type: i3.LocalizationService }], propDecorators: { fileContainerName: [{
|
|
853
1133
|
type: Input
|
|
854
1134
|
}], multiple: [{
|
|
855
1135
|
type: Input
|
|
@@ -859,16 +1139,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
859
1139
|
type: Input
|
|
860
1140
|
}], visibleChange: [{
|
|
861
1141
|
type: Output
|
|
862
|
-
}], selectPickerFile: [{
|
|
863
|
-
type: Input
|
|
864
1142
|
}], selectFilefn: [{
|
|
865
1143
|
type: Output
|
|
1144
|
+
}], selectPickerFile: [{
|
|
1145
|
+
type: Input
|
|
866
1146
|
}] } });
|
|
867
1147
|
|
|
868
1148
|
/* eslint-disable @angular-eslint/component-selector */
|
|
869
1149
|
class FilePickerComponent {
|
|
870
|
-
constructor(
|
|
871
|
-
this._FileApiService = _FileApiService;
|
|
1150
|
+
constructor() {
|
|
872
1151
|
/**是否多选 */
|
|
873
1152
|
this._multiple = false;
|
|
874
1153
|
/**图片容器 */
|
|
@@ -885,14 +1164,14 @@ class FilePickerComponent {
|
|
|
885
1164
|
this._fileContainerName = v;
|
|
886
1165
|
}
|
|
887
1166
|
ngOnChanges(changes) {
|
|
888
|
-
|
|
1167
|
+
const selectFormFilengOnChanges = changes.selectFormFile['currentValue'];
|
|
889
1168
|
if (selectFormFilengOnChanges.length > 0) {
|
|
890
1169
|
this._fileShowTable = selectFormFilengOnChanges;
|
|
891
1170
|
}
|
|
892
1171
|
}
|
|
893
1172
|
/**表格选择的文件回调 */
|
|
894
1173
|
_selectFilefn(event) {
|
|
895
|
-
|
|
1174
|
+
const _fileShowTable = structuredClone(event);
|
|
896
1175
|
this._fileShowTable = _fileShowTable;
|
|
897
1176
|
this.selectFormFile = _fileShowTable;
|
|
898
1177
|
this.selectedFileChange.emit(_fileShowTable);
|
|
@@ -904,13 +1183,20 @@ class FilePickerComponent {
|
|
|
904
1183
|
this.selectedFileChange.emit([]);
|
|
905
1184
|
this.selectedFileChange.emit(this.selectFormFile);
|
|
906
1185
|
}
|
|
907
|
-
|
|
908
|
-
|
|
1186
|
+
/**调整表格位置 */
|
|
1187
|
+
drop(event) {
|
|
1188
|
+
moveItemInArray(this._fileShowTable, event.previousIndex, event.currentIndex);
|
|
1189
|
+
this.selectFormFile = this._fileShowTable;
|
|
1190
|
+
this.selectedFileChange.emit(this.selectFormFile);
|
|
1191
|
+
// this._fileShowTable.updateValueAndValidity()
|
|
1192
|
+
}
|
|
1193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1194
|
+
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-dark soft 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>{{(item.Size||item.size)|formatFileSize}}</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: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i3$2.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: i3$2.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: i3$2.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" }, { kind: "pipe", type: FormatFileSizePipe, name: "formatFileSize" }] }); }
|
|
909
1195
|
}
|
|
910
1196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FilePickerComponent, decorators: [{
|
|
911
1197
|
type: Component,
|
|
912
|
-
args: [{ selector: 'fe-file-picker', template: "<button class=\"btn btn-sm btn-
|
|
913
|
-
}],
|
|
1198
|
+
args: [{ selector: 'fe-file-picker', template: "<button class=\"btn btn-sm btn-dark soft 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>{{(item.Size||item.size)|formatFileSize}}</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"] }]
|
|
1199
|
+
}], propDecorators: { multiple: [{
|
|
914
1200
|
type: Input
|
|
915
1201
|
}], fileContainerName: [{
|
|
916
1202
|
type: Input
|
|
@@ -924,7 +1210,6 @@ class FileDomeComponent {
|
|
|
924
1210
|
constructor() {
|
|
925
1211
|
/**跟随表单提交--已提交的数据,或选择的数据源 */
|
|
926
1212
|
this.fileSubmittedData = [];
|
|
927
|
-
this.FileApiService = inject(FileApiService);
|
|
928
1213
|
/**选择文件-弹窗的-已选定的文件 */
|
|
929
1214
|
this.selectedFileGroup = [];
|
|
930
1215
|
}
|
|
@@ -952,7 +1237,7 @@ const routes = [
|
|
|
952
1237
|
];
|
|
953
1238
|
class FileExplorerRoutingModule {
|
|
954
1239
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
955
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, imports: [i1$
|
|
1240
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, imports: [i1$2.RouterModule], exports: [RouterModule] }); }
|
|
956
1241
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
|
|
957
1242
|
}
|
|
958
1243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerRoutingModule, decorators: [{
|
|
@@ -1017,13 +1302,13 @@ class FileExplorerConfigComponent {
|
|
|
1017
1302
|
resolve(true);
|
|
1018
1303
|
});
|
|
1019
1304
|
}
|
|
1020
|
-
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 }); }
|
|
1021
|
-
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" }] }); }
|
|
1305
|
+
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 }); }
|
|
1306
|
+
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" }] }); }
|
|
1022
1307
|
}
|
|
1023
1308
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerConfigComponent, decorators: [{
|
|
1024
1309
|
type: Component,
|
|
1025
1310
|
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>" }]
|
|
1026
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { type: [{
|
|
1311
|
+
}], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { type: [{
|
|
1027
1312
|
type: Input
|
|
1028
1313
|
}], Entity: [{
|
|
1029
1314
|
type: Input
|
|
@@ -1115,13 +1400,13 @@ class FileExplorerControlComponent {
|
|
|
1115
1400
|
obj[fieldName] = event;
|
|
1116
1401
|
this.extraProperties.patchValue(obj);
|
|
1117
1402
|
}
|
|
1118
|
-
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 }); }
|
|
1119
|
-
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:
|
|
1403
|
+
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 }); }
|
|
1404
|
+
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: i5.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"] }] }); }
|
|
1120
1405
|
}
|
|
1121
1406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerControlComponent, decorators: [{
|
|
1122
1407
|
type: Component,
|
|
1123
1408
|
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>" }]
|
|
1124
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { entity: [{
|
|
1409
|
+
}], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { entity: [{
|
|
1125
1410
|
type: Input
|
|
1126
1411
|
}], fields: [{
|
|
1127
1412
|
type: Input
|
|
@@ -1134,6 +1419,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1134
1419
|
args: ['submitclick', { static: true }]
|
|
1135
1420
|
}] } });
|
|
1136
1421
|
|
|
1422
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1423
|
+
class FileExplorerViewComponent {
|
|
1424
|
+
constructor() {
|
|
1425
|
+
/**展示则内容 */
|
|
1426
|
+
this.showValue = '';
|
|
1427
|
+
/**是否显示再列表 */
|
|
1428
|
+
this.showInList = false;
|
|
1429
|
+
/**表单控件Value */
|
|
1430
|
+
this._value = '';
|
|
1431
|
+
}
|
|
1432
|
+
set value(v) {
|
|
1433
|
+
this._value = v;
|
|
1434
|
+
}
|
|
1435
|
+
async ngAfterContentInit() {
|
|
1436
|
+
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
1437
|
+
//Add 'implements AfterContentInit' to the class.
|
|
1438
|
+
let valueOptions = this._value;
|
|
1439
|
+
if (this.type && valueOptions) {
|
|
1440
|
+
this.showValue = valueOptions;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1444
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: FileExplorerViewComponent, selector: "fe-file-explorer-view", inputs: { showInList: "showInList", fields: "fields", type: "type", value: "value" }, ngImport: i0, template: "@if(showInList){\r\n@if(showValue.length>=1){\r\n<div class=\"d-flex align-items-center \">\r\n <fe-file-preview [width]=\"'60px'\" [className]=\"'overflow-hidden me-1'\" [src]=\"showValue[0].url\"\r\n [name]=\"showValue[0].name\" [type]=\"showValue[0].mimeType\" [preview]=\"true\"></fe-file-preview>\r\n @if(showValue.length-1>0){\r\n +{{showValue.length-1}}\r\n }\r\n</div>\r\n}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FilePreviewComponent, selector: "fe-file-preview", inputs: ["width", "src", "preview", "type", "name", "className"] }] }); }
|
|
1445
|
+
}
|
|
1446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerViewComponent, decorators: [{
|
|
1447
|
+
type: Component,
|
|
1448
|
+
args: [{ selector: 'fe-file-explorer-view', template: "@if(showInList){\r\n@if(showValue.length>=1){\r\n<div class=\"d-flex align-items-center \">\r\n <fe-file-preview [width]=\"'60px'\" [className]=\"'overflow-hidden me-1'\" [src]=\"showValue[0].url\"\r\n [name]=\"showValue[0].name\" [type]=\"showValue[0].mimeType\" [preview]=\"true\"></fe-file-preview>\r\n @if(showValue.length-1>0){\r\n +{{showValue.length-1}}\r\n }\r\n</div>\r\n}\r\n} @else{\r\n<div class=\"mb-3\">\r\n <label class=\"form-label\" *ngIf=\"fields.displayName\">{{ fields.displayName }}</label>\r\n</div>\r\n}" }]
|
|
1449
|
+
}], propDecorators: { showInList: [{
|
|
1450
|
+
type: Input
|
|
1451
|
+
}], fields: [{
|
|
1452
|
+
type: Input
|
|
1453
|
+
}], type: [{
|
|
1454
|
+
type: Input
|
|
1455
|
+
}], value: [{
|
|
1456
|
+
type: Input
|
|
1457
|
+
}] } });
|
|
1458
|
+
|
|
1137
1459
|
/**
|
|
1138
1460
|
* 表单控件分组-包含配置,控件,显示的数组
|
|
1139
1461
|
*/
|
|
@@ -1143,7 +1465,7 @@ const fielFieldControlGroup = [
|
|
|
1143
1465
|
name: 'FileExplorer',
|
|
1144
1466
|
fieldConfigComponent: FileExplorerConfigComponent,
|
|
1145
1467
|
fieldComponent: FileExplorerControlComponent,
|
|
1146
|
-
|
|
1468
|
+
fieldViewComponent: FileExplorerViewComponent,
|
|
1147
1469
|
}
|
|
1148
1470
|
];
|
|
1149
1471
|
function getExcludeAssignControl(typeName) {
|
|
@@ -1163,27 +1485,43 @@ class FileExplorerModule {
|
|
|
1163
1485
|
FileDomeComponent,
|
|
1164
1486
|
FilePreviewComponent,
|
|
1165
1487
|
FileExplorerConfigComponent,
|
|
1166
|
-
FileExplorerControlComponent
|
|
1488
|
+
FileExplorerControlComponent,
|
|
1489
|
+
FileExplorerViewComponent], imports: [FormsModule,
|
|
1167
1490
|
CoreModule,
|
|
1168
1491
|
ThemeSharedModule,
|
|
1169
1492
|
ReactiveFormsModule,
|
|
1170
1493
|
NgbDropdownModule,
|
|
1171
1494
|
NzTreeModule,
|
|
1172
1495
|
NgxValidateCoreModule,
|
|
1173
|
-
FileExplorerRoutingModule
|
|
1496
|
+
FileExplorerRoutingModule,
|
|
1497
|
+
TreeModule,
|
|
1498
|
+
GetDirectoryNamePipe,
|
|
1499
|
+
DragDropModule,
|
|
1500
|
+
FormatFileSizePipe], exports: [FileEditComponent,
|
|
1174
1501
|
FilePickerComponent,
|
|
1175
1502
|
FileModalComponent,
|
|
1176
1503
|
FileModalTreeComponent,
|
|
1177
1504
|
FileDomeComponent,
|
|
1178
1505
|
FilePreviewComponent] }); }
|
|
1179
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerModule,
|
|
1506
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerModule, providers: [
|
|
1507
|
+
FormatFileSizePipe,
|
|
1508
|
+
// GetImageUrlPipe
|
|
1509
|
+
// // [Required]
|
|
1510
|
+
// ListService,
|
|
1511
|
+
// // [Optional]
|
|
1512
|
+
// // Provide this token if you want a different debounce time.
|
|
1513
|
+
// // Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
1514
|
+
// { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
1515
|
+
], imports: [FormsModule,
|
|
1180
1516
|
CoreModule,
|
|
1181
1517
|
ThemeSharedModule,
|
|
1182
1518
|
ReactiveFormsModule,
|
|
1183
1519
|
NgbDropdownModule,
|
|
1184
1520
|
NzTreeModule,
|
|
1185
1521
|
NgxValidateCoreModule,
|
|
1186
|
-
FileExplorerRoutingModule
|
|
1522
|
+
FileExplorerRoutingModule,
|
|
1523
|
+
TreeModule,
|
|
1524
|
+
DragDropModule] }); }
|
|
1187
1525
|
}
|
|
1188
1526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FileExplorerModule, decorators: [{
|
|
1189
1527
|
type: NgModule,
|
|
@@ -1197,6 +1535,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1197
1535
|
FilePreviewComponent,
|
|
1198
1536
|
FileExplorerConfigComponent,
|
|
1199
1537
|
FileExplorerControlComponent,
|
|
1538
|
+
FileExplorerViewComponent,
|
|
1200
1539
|
],
|
|
1201
1540
|
imports: [
|
|
1202
1541
|
FormsModule,
|
|
@@ -1207,6 +1546,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1207
1546
|
NzTreeModule,
|
|
1208
1547
|
NgxValidateCoreModule,
|
|
1209
1548
|
FileExplorerRoutingModule,
|
|
1549
|
+
TreeModule,
|
|
1550
|
+
GetDirectoryNamePipe,
|
|
1551
|
+
DragDropModule,
|
|
1552
|
+
FormatFileSizePipe,
|
|
1210
1553
|
],
|
|
1211
1554
|
exports: [
|
|
1212
1555
|
FileEditComponent,
|
|
@@ -1215,17 +1558,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
1215
1558
|
FileModalTreeComponent,
|
|
1216
1559
|
FileDomeComponent,
|
|
1217
1560
|
FilePreviewComponent,
|
|
1561
|
+
// FormatFileSizePipe
|
|
1218
1562
|
// FileExplorerConfigComponent,
|
|
1219
1563
|
// FileExplorerControlComponent,
|
|
1220
1564
|
],
|
|
1221
1565
|
providers: [
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1566
|
+
FormatFileSizePipe,
|
|
1567
|
+
// GetImageUrlPipe
|
|
1568
|
+
// // [Required]
|
|
1569
|
+
// ListService,
|
|
1570
|
+
// // [Optional]
|
|
1571
|
+
// // Provide this token if you want a different debounce time.
|
|
1572
|
+
// // Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
1573
|
+
// { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
1229
1574
|
],
|
|
1230
1575
|
}]
|
|
1231
1576
|
}] });
|