@dignite-ng/expand.file-explorer 0.0.3 → 0.0.5

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.
Files changed (137) hide show
  1. package/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
  2. package/config/enums/route-names.d.ts +3 -0
  3. package/config/file-config.module.d.ts +8 -0
  4. package/config/index.d.ts +5 -0
  5. package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
  6. package/config/providers/route.provider.d.ts +8 -0
  7. package/config/{src/public-api.ts → public-api.d.ts} +3 -3
  8. package/esm2022/config/dignite-ng-expand.file-explorer-config.mjs +5 -0
  9. package/esm2022/config/enums/index.mjs +2 -0
  10. package/esm2022/config/enums/route-names.mjs +2 -0
  11. package/esm2022/config/file-config.module.mjs +19 -0
  12. package/esm2022/config/providers/index.mjs +2 -0
  13. package/esm2022/config/providers/route.provider.mjs +24 -0
  14. package/esm2022/config/public-api.mjs +4 -0
  15. package/esm2022/dignite-ng-expand.file-explorer.mjs +5 -0
  16. package/esm2022/lib/components/dome/file-dome.component.mjs +32 -0
  17. package/esm2022/lib/components/file-edit/file-edit.component.mjs +104 -0
  18. package/esm2022/lib/components/file-modal/file-modal.component.mjs +272 -0
  19. package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +195 -0
  20. package/esm2022/lib/components/file-picker/file-picker.component.mjs +65 -0
  21. package/esm2022/lib/components/index.mjs +6 -0
  22. package/esm2022/lib/file-explorer-routing.module.mjs +25 -0
  23. package/esm2022/lib/file-explorer.module.mjs +88 -0
  24. package/esm2022/lib/previews/file-preview.component.mjs +100 -0
  25. package/esm2022/lib/previews/index.mjs +3 -0
  26. package/esm2022/lib/previews/models.mjs +92 -0
  27. package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +48 -0
  28. package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +3 -0
  29. package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +2 -0
  30. package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +60 -0
  31. package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +3 -0
  32. package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +2 -0
  33. package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +4 -0
  34. package/esm2022/lib/proxy/dignite/index.mjs +3 -0
  35. package/esm2022/lib/proxy/index.mjs +5 -0
  36. package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +3 -0
  37. package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +2 -0
  38. package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +2 -0
  39. package/esm2022/lib/proxy/microsoft/extensions/index.mjs +3 -0
  40. package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +2 -0
  41. package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +2 -0
  42. package/esm2022/lib/proxy/microsoft/index.mjs +5 -0
  43. package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +2 -0
  44. package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +2 -0
  45. package/esm2022/lib/proxy/microsoft/net/http/index.mjs +3 -0
  46. package/esm2022/lib/proxy/microsoft/net/index.mjs +3 -0
  47. package/esm2022/lib/proxy/volo/abp/content/index.mjs +2 -0
  48. package/esm2022/lib/proxy/volo/abp/content/models.mjs +2 -0
  49. package/esm2022/lib/proxy/volo/abp/index.mjs +3 -0
  50. package/esm2022/lib/proxy/volo/index.mjs +3 -0
  51. package/esm2022/lib/services/file-api.service.mjs +66 -0
  52. package/esm2022/lib/services/index.mjs +2 -0
  53. package/esm2022/public-api.mjs +9 -0
  54. package/fesm2022/dignite-ng-expand.file-explorer-config.mjs +47 -0
  55. package/fesm2022/dignite-ng-expand.file-explorer-config.mjs.map +1 -0
  56. package/fesm2022/dignite-ng-expand.file-explorer.mjs +1169 -0
  57. package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +1 -0
  58. package/index.d.ts +5 -0
  59. package/lib/components/dome/file-dome.component.d.ts +19 -0
  60. package/lib/components/file-edit/file-edit.component.d.ts +38 -0
  61. package/lib/components/file-modal/file-modal.component.d.ts +93 -0
  62. package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +66 -0
  63. package/lib/components/file-picker/file-picker.component.d.ts +26 -0
  64. package/lib/components/index.d.ts +5 -0
  65. package/lib/file-explorer-routing.module.d.ts +7 -0
  66. package/lib/file-explorer.module.d.ts +19 -0
  67. package/lib/previews/file-preview.component.d.ts +47 -0
  68. package/lib/previews/index.d.ts +2 -0
  69. package/lib/previews/models.d.ts +5 -0
  70. package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +17 -0
  71. package/{src/lib/proxy/dignite/file-explorer/directories/models.ts → lib/proxy/dignite/file-explorer/directories/models.d.ts} +29 -35
  72. package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +20 -0
  73. package/lib/proxy/dignite/file-explorer/files/models.d.ts +50 -0
  74. package/{src/lib/proxy/microsoft/asp-net-core/mvc/models.ts → lib/proxy/microsoft/asp-net-core/mvc/models.d.ts} +10 -12
  75. package/lib/proxy/microsoft/extensions/primitives/models.d.ts +8 -0
  76. package/{src/lib/proxy/microsoft/net/http/headers/models.ts → lib/proxy/microsoft/net/http/headers/models.d.ts} +6 -7
  77. package/lib/proxy/volo/abp/content/models.d.ts +5 -0
  78. package/lib/services/file-api.service.d.ts +14 -0
  79. package/lib/services/index.d.ts +1 -0
  80. package/package.json +21 -2
  81. package/{src/public-api.ts → public-api.d.ts} +1 -5
  82. package/config/ng-package.json +0 -7
  83. package/config/src/enums/route-names.ts +0 -15
  84. package/config/src/file-config.module.ts +0 -12
  85. package/config/src/providers/route.provider.ts +0 -26
  86. package/ng-package.json +0 -7
  87. package/src/lib/components/dome/file-dome.component.html +0 -18
  88. package/src/lib/components/dome/file-dome.component.scss +0 -0
  89. package/src/lib/components/dome/file-dome.component.spec.ts +0 -21
  90. package/src/lib/components/dome/file-dome.component.ts +0 -33
  91. package/src/lib/components/file-edit/file-edit.component.html +0 -29
  92. package/src/lib/components/file-edit/file-edit.component.scss +0 -0
  93. package/src/lib/components/file-edit/file-edit.component.spec.ts +0 -21
  94. package/src/lib/components/file-edit/file-edit.component.ts +0 -98
  95. package/src/lib/components/file-modal/file-modal.component.html +0 -112
  96. package/src/lib/components/file-modal/file-modal.component.scss +0 -56
  97. package/src/lib/components/file-modal/file-modal.component.spec.ts +0 -21
  98. package/src/lib/components/file-modal/file-modal.component.ts +0 -284
  99. package/src/lib/components/file-modal-tree/file-modal-tree.component.html +0 -63
  100. package/src/lib/components/file-modal-tree/file-modal-tree.component.scss +0 -0
  101. package/src/lib/components/file-modal-tree/file-modal-tree.component.spec.ts +0 -21
  102. package/src/lib/components/file-modal-tree/file-modal-tree.component.ts +0 -207
  103. package/src/lib/components/file-picker/file-picker.component.html +0 -28
  104. package/src/lib/components/file-picker/file-picker.component.scss +0 -0
  105. package/src/lib/components/file-picker/file-picker.component.spec.ts +0 -21
  106. package/src/lib/components/file-picker/file-picker.component.ts +0 -58
  107. package/src/lib/components/index.ts +0 -5
  108. package/src/lib/file-explorer-routing.module.ts +0 -18
  109. package/src/lib/file-explorer.module.ts +0 -46
  110. package/src/lib/proxy/README.md +0 -17
  111. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  112. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
  113. package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -58
  114. package/src/lib/proxy/generate-proxy.json +0 -11810
  115. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
  116. package/src/lib/proxy/volo/abp/content/models.ts +0 -6
  117. package/src/lib/services/file-api.service.ts +0 -59
  118. package/src/lib/services/index.ts +0 -1
  119. package/tsconfig.lib.json +0 -14
  120. package/tsconfig.lib.prod.json +0 -10
  121. package/tsconfig.spec.json +0 -14
  122. /package/{src/lib/proxy/dignite/file-explorer/directories/index.ts → lib/proxy/dignite/file-explorer/directories/index.d.ts} +0 -0
  123. /package/{src/lib/proxy/dignite/file-explorer/files/index.ts → lib/proxy/dignite/file-explorer/files/index.d.ts} +0 -0
  124. /package/{src/lib/proxy/dignite/file-explorer/index.ts → lib/proxy/dignite/file-explorer/index.d.ts} +0 -0
  125. /package/{src/lib/proxy/dignite/index.ts → lib/proxy/dignite/index.d.ts} +0 -0
  126. /package/{src/lib/proxy/index.ts → lib/proxy/index.d.ts} +0 -0
  127. /package/{src/lib/proxy/microsoft/asp-net-core/index.ts → lib/proxy/microsoft/asp-net-core/index.d.ts} +0 -0
  128. /package/{src/lib/proxy/microsoft/asp-net-core/mvc/index.ts → lib/proxy/microsoft/asp-net-core/mvc/index.d.ts} +0 -0
  129. /package/{src/lib/proxy/microsoft/extensions/index.ts → lib/proxy/microsoft/extensions/index.d.ts} +0 -0
  130. /package/{src/lib/proxy/microsoft/extensions/primitives/index.ts → lib/proxy/microsoft/extensions/primitives/index.d.ts} +0 -0
  131. /package/{src/lib/proxy/microsoft/index.ts → lib/proxy/microsoft/index.d.ts} +0 -0
  132. /package/{src/lib/proxy/microsoft/net/http/headers/index.ts → lib/proxy/microsoft/net/http/headers/index.d.ts} +0 -0
  133. /package/{src/lib/proxy/microsoft/net/http/index.ts → lib/proxy/microsoft/net/http/index.d.ts} +0 -0
  134. /package/{src/lib/proxy/microsoft/net/index.ts → lib/proxy/microsoft/net/index.d.ts} +0 -0
  135. /package/{src/lib/proxy/volo/abp/content/index.ts → lib/proxy/volo/abp/content/index.d.ts} +0 -0
  136. /package/{src/lib/proxy/volo/abp/index.ts → lib/proxy/volo/abp/index.d.ts} +0 -0
  137. /package/{src/lib/proxy/volo/index.ts → lib/proxy/volo/index.d.ts} +0 -0
@@ -0,0 +1,1169 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, Input, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
3
+ import * as i3 from '@abp/ng.core';
4
+ import { ListService, LIST_QUERY_DEBOUNCE_TIME, CoreModule } from '@abp/ng.core';
5
+ import * as i2$2 from '@abp/ng.theme.shared';
6
+ import { ThemeSharedModule } from '@abp/ng.theme.shared';
7
+ import * as i2$1 from '@angular/forms';
8
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
+ import * as i8 from '@ng-bootstrap/ng-bootstrap';
10
+ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
11
+ import * as i9 from 'ng-zorro-antd/tree';
12
+ import { NzTreeModule } from 'ng-zorro-antd/tree';
13
+ import * as i7 from '@ngx-validate/core';
14
+ import { NgxValidateCoreModule } from '@ngx-validate/core';
15
+ import * as i1 from '@angular/router';
16
+ import { RouterModule } from '@angular/router';
17
+ import * as i2 from '@angular/common';
18
+ import * as i6 from '@swimlane/ngx-datatable';
19
+ import { SelectionType } from '@swimlane/ngx-datatable';
20
+ import { of } from 'rxjs';
21
+
22
+ class FileApiService {
23
+ constructor() { }
24
+ /**转换文件大小单位 输入k */
25
+ formatFileSize(bytes) {
26
+ const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
27
+ let size = bytes;
28
+ let unitIndex = 0;
29
+ while (size >= 1024 && unitIndex < units.length - 1) {
30
+ size /= 1024;
31
+ unitIndex++;
32
+ }
33
+ // 保留两位小数,四舍五入
34
+ size = size.toFixed(1);
35
+ return `${size} ${units[unitIndex]}`;
36
+ }
37
+ /**获取图片的本地连接 */
38
+ getImageLacolBase64Url(file) {
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 {
65
+ result[key] = this.deepClone(obj[key]);
66
+ }
67
+ }
68
+ else {
69
+ result[key] = obj[key];
70
+ }
71
+ }
72
+ }
73
+ return result;
74
+ }
75
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
76
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileApiService, providedIn: 'root' });
77
+ }
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileApiService, decorators: [{
79
+ type: Injectable,
80
+ args: [{
81
+ providedIn: 'root'
82
+ }]
83
+ }], ctorParameters: function () { return []; } });
84
+
85
+ // 'image/jpeg' ,
86
+ // 'image/webp',
87
+ // 'image/gif',
88
+ // 'image/png',
89
+ // 'image/bmp' = 'bmp',
90
+ // 'audio/mpeg'='mpeg',
91
+ // 'audio/ogg'='ogg',
92
+ // 'video/mp4'='mp4',
93
+ // 'application/pdf' = 'pdf',
94
+ // 'application/msword' = 'doc',
95
+ // 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' = 'docx',
96
+ // 'application/vnd.ms-powerpoint' = 'ppt',
97
+ // 'application/vnd.openxmlformats-officedocument.presentationml.presentation' = 'pptx',
98
+ // 'application/vnd.ms-excel' = 'xls',
99
+ // 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' = 'xlsx',
100
+ // 'application/x-zip-compressed' = 'zip',
101
+ // 'text/plain' = 'txt',
102
+ let ImageTypeOption = [{
103
+ label: '',
104
+ type: 'image/jpeg',
105
+ icon: '',
106
+ }, {
107
+ label: '',
108
+ type: 'image/webp',
109
+ icon: '',
110
+ }, {
111
+ label: '',
112
+ type: 'image/gif',
113
+ icon: '',
114
+ }, {
115
+ label: '',
116
+ type: 'image/png',
117
+ icon: '',
118
+ }, {
119
+ label: '',
120
+ type: 'image/bmp',
121
+ icon: '',
122
+ }, {
123
+ label: '',
124
+ type: 'audio/ogg',
125
+ icon: '',
126
+ }, {
127
+ label: '',
128
+ type: 'video/mp4',
129
+ icon: '',
130
+ }, {
131
+ label: '',
132
+ type: 'application/pdf',
133
+ icon: 'fa fa-file-pdf-o',
134
+ }, {
135
+ label: '',
136
+ type: 'application/msword',
137
+ icon: 'fa fa-file-word-o',
138
+ }, {
139
+ label: '',
140
+ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
141
+ icon: 'fa fa-file-word-o',
142
+ }, {
143
+ label: '',
144
+ type: 'application/vnd.ms-powerpoint',
145
+ icon: 'fa fa-file-powerpoint-o',
146
+ }, {
147
+ label: '',
148
+ type: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
149
+ icon: 'fa fa-file-powerpoint-o',
150
+ }, {
151
+ label: '',
152
+ type: 'application/vnd.ms-excel',
153
+ icon: 'fa fa-file-excel-o',
154
+ }, {
155
+ label: '',
156
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
157
+ icon: 'fa fa-file-excel-o',
158
+ }, {
159
+ label: '',
160
+ type: 'application/x-zip-compressed',
161
+ icon: 'fa fa-file-archive-o',
162
+ }, {
163
+ label: '',
164
+ type: '7z',
165
+ icon: 'fa fa-file-archive-o',
166
+ }, {
167
+ label: '',
168
+ type: 'text/plain',
169
+ icon: 'fa fa-file-text-o',
170
+ }, {
171
+ label: '',
172
+ type: '',
173
+ icon: 'fa fa-file-o',
174
+ }
175
+ ];
176
+
177
+ class FilePreviewComponent {
178
+ modalService;
179
+ /**文件宽度 */
180
+ width = '100px';
181
+ /*文件链接 */
182
+ src = '';
183
+ /**是否支持大图预览 */
184
+ preview = true;
185
+ /**文件类型 */
186
+ type = '';
187
+ /**文件名称 */
188
+ name = '';
189
+ /**是否是文件 */
190
+ isImage = true;
191
+ /**是否是视频 */
192
+ isAudio = false;
193
+ /**是否是音频 */
194
+ isVideo = false;
195
+ /**文件类型及图标 */
196
+ _ImageTypeOption = ImageTypeOption;
197
+ constructor(modalService) {
198
+ this.modalService = modalService;
199
+ }
200
+ ngAfterContentInit() {
201
+ //Called after ngOnInit when the component's or directive's content has been initialized.
202
+ //Add 'implements AfterContentInit' to the class.
203
+ if (!this.type) {
204
+ this.type = this.name.includes('.7z') ? '7z' : '';
205
+ }
206
+ this.isImage = this.type.includes('image/');
207
+ this.isAudio = this.type.includes('audio/');
208
+ this.isVideo = this.type.includes('video/');
209
+ }
210
+ /**预览图片 */
211
+ previewImage() {
212
+ }
213
+ /**模态框实例 */
214
+ modalRef;
215
+ /**放大倍数 */
216
+ zoom = 10;
217
+ /**旋转 */
218
+ rotate = 0;
219
+ /**打开预览弹窗 */
220
+ OpenPreviewImage(content) {
221
+ this.modalRef = this.modalService.open(content, {
222
+ fullscreen: true,
223
+ modalDialogClass: 'dignite-preview',
224
+ });
225
+ this.modalRef.result.then((result) => {
226
+ }, (reason) => {
227
+ this.zoom = 10;
228
+ });
229
+ }
230
+ /**放大图像 */
231
+ zoomIn() {
232
+ let zoom = this.zoom;
233
+ if (zoom == 20)
234
+ return;
235
+ zoom++;
236
+ this.zoom = zoom;
237
+ }
238
+ /**缩小图像 */
239
+ zoomOut() {
240
+ let zoom = this.zoom;
241
+ if (zoom == 3)
242
+ return;
243
+ zoom--;
244
+ this.zoom = zoom;
245
+ }
246
+ /**右旋转 */
247
+ RotateRight() {
248
+ if (this.rotate == 360)
249
+ return this.rotate = 0;
250
+ this.rotate += 90;
251
+ }
252
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilePreviewComponent, deps: [{ token: i8.NgbModal }], target: i0.ɵɵFactoryTarget.Component });
253
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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}\">\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: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }] });
254
+ }
255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilePreviewComponent, decorators: [{
256
+ type: Component,
257
+ args: [{ selector: 'fe-file-preview', template: "<div class=\"image_box\" [style]=\"{width:width}\">\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"] }]
258
+ }], ctorParameters: function () { return [{ type: i8.NgbModal }]; }, propDecorators: { width: [{
259
+ type: Input
260
+ }], src: [{
261
+ type: Input
262
+ }], preview: [{
263
+ type: Input
264
+ }], type: [{
265
+ type: Input
266
+ }], name: [{
267
+ type: Input
268
+ }] } });
269
+
270
+ class FileEditComponent {
271
+ _FileApiService;
272
+ constructor(_FileApiService) {
273
+ this._FileApiService = _FileApiService;
274
+ }
275
+ /**是否多选 */
276
+ _multiple = true;
277
+ set multiple(v) {
278
+ this._multiple = v;
279
+ if (v) { }
280
+ }
281
+ /**文件数据--已上传的数据 */
282
+ _fileData = [];
283
+ set fileData(v) {
284
+ this._fileData = v;
285
+ if (v.length > 0) {
286
+ this.getFileChange({ target: { files: v } });
287
+ }
288
+ }
289
+ /** 跟随表单提交--已提交的数据,或选择的数据源--回调*/
290
+ fileDataChange = new EventEmitter();
291
+ /**文件大小限制
292
+ * @param 1mb
293
+ */
294
+ sizeLimit = 1048576;
295
+ set limit(v) {
296
+ this.sizeLimit = v;
297
+ }
298
+ /**文件表格数据 */
299
+ filesTableData = [];
300
+ /** 待删除已上传的文件们*/
301
+ deleteTheUploadedFiles = [];
302
+ /**获取文件选择框的元素 */
303
+ fileEdit;
304
+ /**获取文件信息改变 */
305
+ async getFileChange(event) {
306
+ let files = new Array(...event.target.files);
307
+ console.log(files, '获取文件信息改变');
308
+ /**需要等待setfileSizeUnits执行完后在执行其他方法--需要完善 */
309
+ await this.waitFileToAddTable(files);
310
+ this.fileHandling();
311
+ }
312
+ /**等待将文件数据加入到文件表格数据中 */
313
+ waitFileToAddTable(files) {
314
+ return new Promise(async (resolve, rejects) => {
315
+ this.filesTableData.push(...await this.setfileSizeUnits(files));
316
+ resolve(true);
317
+ });
318
+ }
319
+ /**删除文件表格的项 */
320
+ deleteFileTableItem(index, item) {
321
+ this.filesTableData.splice(index, 1);
322
+ if (item.id) {
323
+ this.deleteTheUploadedFiles.push(item);
324
+ }
325
+ this.fileHandling();
326
+ }
327
+ /**文件处理-调用回调函数 */
328
+ fileHandling() {
329
+ let theFilesToBeUploaded = this.filesTableData.filter(el => !el.id);
330
+ //判断图片大小是否超过限制-用于判断表单是否允许提交
331
+ let isSubmit = !this.filesTableData.some(el => el.size > this.sizeLimit);
332
+ this.fileDataChange.emit({ theFilesToBeUploaded, deleteTheUploadedFiles: this.deleteTheUploadedFiles, isSubmit });
333
+ }
334
+ /**设置值文件大小单位/ */
335
+ async setfileSizeUnits(files) {
336
+ return new Promise((resolve, rejects) => {
337
+ let formattedFiles = [];
338
+ files.forEach(async (file) => {
339
+ file.fileSize = this._FileApiService.formatFileSize(file.size);
340
+ formattedFiles.push(file);
341
+ //设置选择图片的本地url
342
+ if (!file.src)
343
+ file.src = await this._FileApiService.getImageLacolBase64Url(file);
344
+ });
345
+ resolve(files);
346
+ });
347
+ }
348
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileEditComponent, deps: [{ token: FileApiService }], target: i0.ɵɵFactoryTarget.Component });
349
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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-2\">\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:_FileApiService.formatFileSize(sizeLimit)}}</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: 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: FilePreviewComponent, selector: "fe-file-preview", inputs: ["width", "src", "preview", "type", "name"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
350
+ }
351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileEditComponent, decorators: [{
352
+ type: Component,
353
+ args: [{ selector: 'fe-file-edit', template: "<div class=\"input-group mb-2\">\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:_FileApiService.formatFileSize(sizeLimit)}}</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>" }]
354
+ }], ctorParameters: function () { return [{ type: FileApiService }]; }, propDecorators: { multiple: [{
355
+ type: Input
356
+ }], fileData: [{
357
+ type: Input
358
+ }], fileDataChange: [{
359
+ type: Output
360
+ }], limit: [{
361
+ type: Input
362
+ }], fileEdit: [{
363
+ type: ViewChild,
364
+ args: ['fileEdit', { static: true }]
365
+ }] } });
366
+
367
+ let FileDescriptorService$1 = class FileDescriptorService {
368
+ restService;
369
+ apiName = 'FileExplorer';
370
+ create = (input, config) => this.restService.request({
371
+ method: 'POST',
372
+ url: '/api/file-explorer/files',
373
+ params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
374
+ body: input.file,
375
+ }, { apiName: this.apiName, ...config });
376
+ delete = (id, config) => this.restService.request({
377
+ method: 'DELETE',
378
+ url: `/api/file-explorer/files/${id}`,
379
+ }, { apiName: this.apiName, ...config });
380
+ download = (containerName, blobName, fileName, config) => this.restService.request({
381
+ method: 'GET',
382
+ url: `/api/file-explorer/files/download/${containerName}/${blobName}`,
383
+ params: { fileName },
384
+ }, { apiName: this.apiName, ...config });
385
+ get = (id, config) => this.restService.request({
386
+ method: 'GET',
387
+ url: `/api/file-explorer/files/${id}`,
388
+ }, { apiName: this.apiName, ...config });
389
+ getFileContainerConfiguration = (containerName, config) => this.restService.request({
390
+ method: 'GET',
391
+ url: '/api/file-explorer/files/configuration',
392
+ params: { containerName },
393
+ }, { apiName: this.apiName, ...config });
394
+ getList = (input, config) => this.restService.request({
395
+ method: 'GET',
396
+ url: '/api/file-explorer/files',
397
+ 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 },
398
+ }, { apiName: this.apiName, ...config });
399
+ getStream = (containerName, blobName, imageResize, config) => this.restService.request({
400
+ method: 'GET',
401
+ responseType: 'blob',
402
+ url: `/api/file-explorer/files/${containerName}/${blobName}`,
403
+ params: { width: imageResize.width, height: imageResize.height },
404
+ }, { apiName: this.apiName, ...config });
405
+ update = (id, input, config) => this.restService.request({
406
+ method: 'PUT',
407
+ url: `/api/file-explorer/files/${id}`,
408
+ body: input,
409
+ }, { apiName: this.apiName, ...config });
410
+ constructor(restService) {
411
+ this.restService = restService;
412
+ }
413
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
414
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, providedIn: 'root' });
415
+ };
416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService$1, decorators: [{
417
+ type: Injectable,
418
+ args: [{
419
+ providedIn: 'root',
420
+ }]
421
+ }], ctorParameters: function () { return [{ type: i3.RestService }]; } });
422
+
423
+ var index$e = /*#__PURE__*/Object.freeze({
424
+ __proto__: null,
425
+ FileDescriptorService: FileDescriptorService$1
426
+ });
427
+
428
+ class FileDescriptorService {
429
+ restService;
430
+ apiName = 'FileExplorer';
431
+ create = (input, config) => this.restService.request({
432
+ method: 'POST',
433
+ url: '/api/file-explorer/directories',
434
+ body: input,
435
+ }, { apiName: this.apiName, ...config });
436
+ delete = (id, config) => this.restService.request({
437
+ method: 'DELETE',
438
+ url: `/api/file-explorer/directories/${id}`,
439
+ }, { apiName: this.apiName, ...config });
440
+ get = (id, config) => this.restService.request({
441
+ method: 'GET',
442
+ url: `/api/file-explorer/directories/${id}`,
443
+ }, { apiName: this.apiName, ...config });
444
+ getList = (input, config) => this.restService.request({
445
+ method: 'GET',
446
+ url: '/api/file-explorer/directories',
447
+ params: { containerName: input.containerName },
448
+ }, { apiName: this.apiName, ...config });
449
+ move = (id, input, config) => this.restService.request({
450
+ method: 'PUT',
451
+ url: `/api/file-explorer/directories/${id}/move`,
452
+ body: input,
453
+ }, { apiName: this.apiName, ...config });
454
+ update = (id, input, config) => this.restService.request({
455
+ method: 'PUT',
456
+ url: `/api/file-explorer/directories/${id}`,
457
+ body: input,
458
+ }, { apiName: this.apiName, ...config });
459
+ constructor(restService) {
460
+ this.restService = restService;
461
+ }
462
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
463
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, providedIn: 'root' });
464
+ }
465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDescriptorService, decorators: [{
466
+ type: Injectable,
467
+ args: [{
468
+ providedIn: 'root',
469
+ }]
470
+ }], ctorParameters: function () { return [{ type: i3.RestService }]; } });
471
+
472
+ var index$d = /*#__PURE__*/Object.freeze({
473
+ __proto__: null,
474
+ FileDescriptorService: FileDescriptorService
475
+ });
476
+
477
+ var that$1;
478
+ class FileModalTreeComponent {
479
+ _DescriptorService;
480
+ fb;
481
+ toaster;
482
+ _FileApiService;
483
+ _LocalizationService;
484
+ constructor(_DescriptorService, fb, toaster, _FileApiService, _LocalizationService) {
485
+ this._DescriptorService = _DescriptorService;
486
+ this.fb = fb;
487
+ this.toaster = toaster;
488
+ this._FileApiService = _FileApiService;
489
+ this._LocalizationService = _LocalizationService;
490
+ that$1 = this;
491
+ }
492
+ /**文件分组列表 */
493
+ fileGroupList = [];
494
+ /**选择的tree节点 */
495
+ _theSelectedTreeNode = '';
496
+ set theSelectedTreeNode(v) {
497
+ this._theSelectedTreeNode = v;
498
+ if (v.length > 0) {
499
+ this.loadData();
500
+ }
501
+ }
502
+ /**正在编辑的节点 */
503
+ theNodeBeingEdited = '';
504
+ /**已展开的节点 */
505
+ anExpandedNode = [];
506
+ /**图片容器 */
507
+ _fileContainerName;
508
+ /**tree节点选择回调 */
509
+ nodeClick = new EventEmitter();
510
+ set fileContainerName(v) {
511
+ if (v) {
512
+ this._fileContainerName = v;
513
+ this.loadData();
514
+ }
515
+ }
516
+ handleClick = (event) => event.stopPropagation();
517
+ loadData() {
518
+ if (this._fileContainerName) {
519
+ this.getFileGroupList();
520
+ }
521
+ }
522
+ /**获取文件分组 */
523
+ getFileGroupList() {
524
+ this._DescriptorService.getList({
525
+ containerName: this._fileContainerName,
526
+ }).subscribe(async (res) => {
527
+ this.fileGroupList = await this.setTheValueOfTheNodeRecursively(res.items);
528
+ });
529
+ }
530
+ /**递归设置节点的值 */
531
+ setTheValueOfTheNodeRecursively(array) {
532
+ return new Promise((reslove, rejects) => {
533
+ array.forEach((el) => {
534
+ el.title = el.name;
535
+ el.key = el.id;
536
+ el.expanded = this.anExpandedNode.includes(el.key);
537
+ if (el.children.length > 0) {
538
+ this.setTheValueOfTheNodeRecursively(el.children);
539
+ }
540
+ });
541
+ reslove(array);
542
+ });
543
+ }
544
+ /**tree-拖拽 */
545
+ nzEvent(event) {
546
+ }
547
+ /**tree-拖拽 -验证*/
548
+ beforeDrop(arg) {
549
+ if (arg.pos === 0 || arg.pos === 1) {
550
+ that$1._DescriptorService.move(arg.dragNode.key, {
551
+ "parentId": arg.pos === 1 ? (arg.node.parentNode?.key || '') : arg.node.key,
552
+ "order": arg.pos === 1 ? arg.node.origin.order + 1 : arg.node.origin.children.length + 1
553
+ }).subscribe(res => {
554
+ // that.toaster.success("拖拽完成");
555
+ that$1.getFileGroupList();
556
+ });
557
+ return of(true);
558
+ }
559
+ else {
560
+ return of(false);
561
+ }
562
+ }
563
+ /**tree--选择节点 */
564
+ activeNode(event) {
565
+ this._theSelectedTreeNode = event.node;
566
+ this.nodeClick.emit(event.node);
567
+ }
568
+ /**判断节点是否选中 */
569
+ isNodeSelected = (el) => el.key === this._theSelectedTreeNode?.key;
570
+ /**点击展开树节点图标触发 */
571
+ nzExpandChange(event) {
572
+ let anExpandedNode = this.anExpandedNode;
573
+ if (anExpandedNode.includes(event.node.key)) {
574
+ anExpandedNode = anExpandedNode.filter(key => key !== event.node.key);
575
+ }
576
+ else {
577
+ anExpandedNode.push(event.node.key);
578
+ }
579
+ this.anExpandedNode = anExpandedNode;
580
+ }
581
+ /**增加分组 */
582
+ addDescriptorBtn(items = '', edit = false) {
583
+ this.ModalDescriptorOpen = true;
584
+ this.ModalDescriptorForm = this.fb.group({
585
+ containerName: [this._fileContainerName || '', Validators.required],
586
+ name: ['', Validators.required],
587
+ parentId: [items?.key || '', Validators.required],
588
+ });
589
+ /**编辑 */
590
+ if (edit) {
591
+ this.theNodeBeingEdited = items.origin;
592
+ this.ModalDescriptorForm.patchValue({
593
+ name: items.origin.name
594
+ });
595
+ }
596
+ }
597
+ /**删除分组 */
598
+ deleteDescriptorBtn(node) {
599
+ this._DescriptorService.delete(node.key).subscribe(res => {
600
+ // this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
601
+ this.ModalDescriptorOpen = false;
602
+ if (this.theNodeBeingEdited.key == node.key)
603
+ this.theNodeBeingEdited = '';
604
+ this.getFileGroupList();
605
+ });
606
+ }
607
+ /**分组 */
608
+ /**模态框-状态-是否打开 */
609
+ ModalDescriptorOpen = false;
610
+ /**模态框-descriptor-繁忙状态-用于确定模态的繁忙状态是否为真 */
611
+ ModalDescriptorBusy = false;
612
+ /**模态框-descriptor-表单 */
613
+ ModalDescriptorForm;
614
+ /**模态框-descriptor-表单--控件模板-动态赋值表单控件 */
615
+ ModalFormDescriptorSubmit;
616
+ /**模态框-descriptor-状态改变回调 */
617
+ ModalDescriptorVisibleChange(event) {
618
+ if (!event) {
619
+ this.ModalDescriptorForm = undefined;
620
+ this.theNodeBeingEdited = '';
621
+ return;
622
+ }
623
+ }
624
+ /**f分组模态框保存 */
625
+ createOrEditSave() {
626
+ let input = this.ModalDescriptorForm.value;
627
+ if (this.theNodeBeingEdited) {
628
+ this._DescriptorService.update(this.theNodeBeingEdited.key, input).subscribe(res => {
629
+ // this.toaster.success("保存成功");
630
+ this.ModalDescriptorOpen = false;
631
+ this.getFileGroupList();
632
+ });
633
+ return;
634
+ }
635
+ this._DescriptorService.create(input).subscribe(res => {
636
+ // this.toaster.success("保存成功");
637
+ this.ModalDescriptorOpen = false;
638
+ this.getFileGroupList();
639
+ });
640
+ }
641
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModalTreeComponent, deps: [{ token: FileDescriptorService }, { token: i2$1.FormBuilder }, { token: i2$2.ToasterService }, { token: FileApiService }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
642
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileModalTreeComponent, selector: "fe-file-modal-tree", inputs: { theSelectedTreeNode: "theSelectedTreeNode", fileContainerName: "fileContainerName" }, outputs: { nodeClick: "nodeClick" }, 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\">{{'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<nz-tree [nzData]=\"fileGroupList\" class=\"ng-zorro-antd-tree\" nzDraggable nzBlockNode nzShowIcon\n [nzExpandedIcon]=\"multiExpandedIconTpl\" (nzOnDrop)=\"nzEvent($event)\" [nzBeforeDrop]=\"beforeDrop\"\n (nzClick)=\"activeNode($event)\" (nzExpandChange)=\"nzExpandChange($event)\" [nzTreeTemplate]=\"nzTreeTemplate\">\n <ng-template #nzTreeTemplate let-node let-origin=\"origin\">\n <div class=\"custom-node d-inline-block ng-star-inserted dropdown\" [title]=\"node.title\">\n <div #dropdown=\"ngbDropdown\" class=\"d-inline-block\" ngbDropdown placement=\"bottom\" container=\"body\">\n <div class=\"btn-group\" [class.selected]=\"isNodeSelected(node)\">\n <button class=\"btn btn-sm p-0 px-1\">{{ node.title }}</button>\n <button class=\"btn btn-sm p-0\" (click)=\"handleClick($event)\" ngbDropdownToggle\n [class.dropdown-toggle]=\"false\" aria-hidden=\"true\">\n <i class=\"fas fa-caret-down text-muted p-1\"></i>\n </button>\n </div>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n (click.stop)=\"addDescriptorBtn(node)\">{{'FileExplorer::NewDirectory' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"addDescriptorBtn(node,true)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deleteDescriptorBtn(node)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #multiExpandedIconTpl let-node let-origin=\"origin\">\n <ng-container *ngIf=\"node.children.length > 0\">\n <i [class]=\"node.isExpanded ? 'fas fa-caret-down' : 'fas fa-caret-right'\"></i>\n </ng-container>\n </ng-template>\n</nz-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)}}</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 (ngSubmit)=\"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\"\n (click)=\"ModalFormDescriptorSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$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: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i7.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2$2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2$2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2$2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i8.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i8.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i8.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i8.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i9.NzTreeComponent, selector: "nz-tree", inputs: ["nzShowIcon", "nzHideUnMatched", "nzBlockNode", "nzExpandAll", "nzSelectMode", "nzCheckStrictly", "nzShowExpand", "nzShowLine", "nzCheckable", "nzAsyncData", "nzDraggable", "nzMultiple", "nzExpandedIcon", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualHeight", "nzTreeTemplate", "nzBeforeDrop", "nzData", "nzExpandedKeys", "nzSelectedKeys", "nzCheckedKeys", "nzSearchValue", "nzSearchFunc"], outputs: ["nzExpandedKeysChange", "nzSelectedKeysChange", "nzCheckedKeysChange", "nzSearchValueChange", "nzClick", "nzDblClick", "nzContextMenu", "nzCheckBoxChange", "nzExpandChange", "nzOnDragStart", "nzOnDragEnter", "nzOnDragOver", "nzOnDragLeave", "nzOnDrop", "nzOnDragEnd"], exportAs: ["nzTree"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
643
+ }
644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModalTreeComponent, decorators: [{
645
+ type: Component,
646
+ 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<nz-tree [nzData]=\"fileGroupList\" class=\"ng-zorro-antd-tree\" nzDraggable nzBlockNode nzShowIcon\n [nzExpandedIcon]=\"multiExpandedIconTpl\" (nzOnDrop)=\"nzEvent($event)\" [nzBeforeDrop]=\"beforeDrop\"\n (nzClick)=\"activeNode($event)\" (nzExpandChange)=\"nzExpandChange($event)\" [nzTreeTemplate]=\"nzTreeTemplate\">\n <ng-template #nzTreeTemplate let-node let-origin=\"origin\">\n <div class=\"custom-node d-inline-block ng-star-inserted dropdown\" [title]=\"node.title\">\n <div #dropdown=\"ngbDropdown\" class=\"d-inline-block\" ngbDropdown placement=\"bottom\" container=\"body\">\n <div class=\"btn-group\" [class.selected]=\"isNodeSelected(node)\">\n <button class=\"btn btn-sm p-0 px-1\">{{ node.title }}</button>\n <button class=\"btn btn-sm p-0\" (click)=\"handleClick($event)\" ngbDropdownToggle\n [class.dropdown-toggle]=\"false\" aria-hidden=\"true\">\n <i class=\"fas fa-caret-down text-muted p-1\"></i>\n </button>\n </div>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n (click.stop)=\"addDescriptorBtn(node)\">{{'FileExplorer::NewDirectory' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"addDescriptorBtn(node,true)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deleteDescriptorBtn(node)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #multiExpandedIconTpl let-node let-origin=\"origin\">\n <ng-container *ngIf=\"node.children.length > 0\">\n <i [class]=\"node.isExpanded ? 'fas fa-caret-down' : 'fas fa-caret-right'\"></i>\n </ng-container>\n </ng-template>\n</nz-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)}}</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 (ngSubmit)=\"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\"\n (click)=\"ModalFormDescriptorSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
647
+ }], ctorParameters: function () { return [{ type: FileDescriptorService }, { type: i2$1.FormBuilder }, { type: i2$2.ToasterService }, { type: FileApiService }, { type: i3.LocalizationService }]; }, propDecorators: { theSelectedTreeNode: [{
648
+ type: Input
649
+ }], nodeClick: [{
650
+ type: Output
651
+ }], fileContainerName: [{
652
+ type: Input
653
+ }], ModalFormDescriptorSubmit: [{
654
+ type: ViewChild,
655
+ args: ['ModalFormDescriptorSubmit', { static: false }]
656
+ }] } });
657
+
658
+ var that;
659
+ class FileModalComponent {
660
+ _FileService;
661
+ toaster;
662
+ list;
663
+ _FileApiService;
664
+ restService;
665
+ confirmation;
666
+ _LocalizationService;
667
+ constructor(_FileService, toaster, list, _FileApiService, restService, confirmation, _LocalizationService) {
668
+ this._FileService = _FileService;
669
+ this.toaster = toaster;
670
+ this.list = list;
671
+ this._FileApiService = _FileApiService;
672
+ this.restService = restService;
673
+ this.confirmation = confirmation;
674
+ this._LocalizationService = _LocalizationService;
675
+ that = this;
676
+ }
677
+ /**图片容器 */
678
+ _fileContainerName;
679
+ set fileContainerName(v) {
680
+ if (v) {
681
+ this._fileContainerName = v;
682
+ this.loadData();
683
+ }
684
+ }
685
+ /**是否多选 */
686
+ _multiple = false;
687
+ set multiple(v) {
688
+ this._multiple = v;
689
+ if (v) { }
690
+ }
691
+ /**文件大小限制
692
+ * @param 1mb
693
+ */
694
+ sizeLimit = 1048576;
695
+ set limit(v) {
696
+ this.sizeLimit = v;
697
+ }
698
+ /**父组件传递的模态框状态 */
699
+ set visible(v) {
700
+ this.ModalOpen = v;
701
+ if (v) {
702
+ this.loadData();
703
+ }
704
+ }
705
+ /**模态框状态回调 */
706
+ visibleChange = new EventEmitter();
707
+ /**模态框-状态-是否打开 */
708
+ ModalOpen = false;
709
+ /**模态框-繁忙状态-用于确定模态的繁忙状态是否为真 */
710
+ ModalBusy = false;
711
+ /**模态框-状态改变回调 */
712
+ ModalVisibleChange(event) {
713
+ if (!event) {
714
+ this.visibleChange.emit(event);
715
+ return;
716
+ }
717
+ }
718
+ /**模态框保存 */
719
+ modalSave() {
720
+ let selectedTablearr = this._FileApiService.deepClone(this.selectedTable);
721
+ this.selectFilefn.emit(selectedTablearr);
722
+ this.ModalVisibleChange(false);
723
+ }
724
+ /**dignite-file-modal-tree */
725
+ /**选择的tree节点 */
726
+ _theSelectedTreeNode = '';
727
+ /**初始化数据 */
728
+ loadData() {
729
+ if (this.ModalOpen && this._fileContainerName) {
730
+ this.hookToQuery();
731
+ }
732
+ }
733
+ /**tree-节点选择 */
734
+ _nodeClick(event) {
735
+ this._theSelectedTreeNode = event;
736
+ this.list.get();
737
+ }
738
+ /**图片上传-要上传图片的状态文件列表 */
739
+ uploadPictureStatusList = [];
740
+ /**图片上传-获取文件信息改变 */
741
+ async getFileChange(event) {
742
+ let files = new Array(...event.target.files);
743
+ this.uploadPictureStatusList = files;
744
+ for (const file of files) {
745
+ if (file.size > this.sizeLimit) {
746
+ this.setuploadPictureStatus(file, 2);
747
+ continue;
748
+ }
749
+ await this.uploadingFile(file).then(() => {
750
+ this.setuploadPictureStatus(file, 1);
751
+ this.list.get();
752
+ }).catch(() => {
753
+ this.setuploadPictureStatus(file, 2);
754
+ }); // 等待每个文件上传完成
755
+ }
756
+ this.list.get();
757
+ let isSubmit = !this.uploadPictureStatusList.some(el => el.status == 2);
758
+ if (isSubmit) {
759
+ // this.toaster.success("上传完成");
760
+ setTimeout(() => {
761
+ this.uploadPictureStatusList = [];
762
+ }, 6000);
763
+ }
764
+ }
765
+ /**图片上传-设置uploadPictureStatusList的状态 */
766
+ setuploadPictureStatus(file, type) {
767
+ this.uploadPictureStatusList.map(el => {
768
+ if (el == file)
769
+ el.status = type;
770
+ });
771
+ }
772
+ /**图片上传-递归按顺序上传 */
773
+ uploadingFile(file) {
774
+ return new Promise((resolve, rejects) => {
775
+ let formData = new FormData();
776
+ formData.append('file', file, file.name);
777
+ this.createFile({
778
+ file: formData,
779
+ containerName: this._fileContainerName,
780
+ directoryId: this._theSelectedTreeNode?.key || '',
781
+ entityId: ''
782
+ }).subscribe(res => {
783
+ resolve(true);
784
+ }, (err) => {
785
+ rejects(false);
786
+ });
787
+ });
788
+ }
789
+ /**文件表格-数据*/
790
+ data = {
791
+ items: [],
792
+ totalCount: 0,
793
+ };
794
+ /**文件表格-条件*/
795
+ filters = {};
796
+ /**文件表格-表格自带选择类型 */
797
+ SelectionType = SelectionType;
798
+ /**文件表格-选择的表格数据项 */
799
+ selectedTable = [];
800
+ /**已选定的文件 */
801
+ selectPickerFile;
802
+ ngOnChanges(changes) {
803
+ //Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
804
+ //Add '${implements OnChanges}' to the class.
805
+ this.selectedTable = this._FileApiService.deepClone(this.selectPickerFile);
806
+ }
807
+ /**当前选择的table项 id */
808
+ nowSelectId = '';
809
+ /**选择文件回调 */
810
+ // @Output() selectedFileChange = new EventEmitter<any[]>()
811
+ selectFilefn = new EventEmitter();
812
+ /**文件表格-获取表格数据 */
813
+ hookToQuery() {
814
+ const getData = (query) => this._FileService.getList({
815
+ ...query,
816
+ ...this.filters,
817
+ containerName: this._fileContainerName,
818
+ directoryId: this._theSelectedTreeNode.key
819
+ });
820
+ const setData = (list) => (this.data = list);
821
+ this.list.hookToQuery(getData).subscribe(setData);
822
+ }
823
+ /**文件表格-查看所有分组的文件数据 */
824
+ lookAllFile() {
825
+ this._theSelectedTreeNode = '';
826
+ this.list.get();
827
+ }
828
+ /**选择表格项 */
829
+ onSelectTableItem({ selected }) {
830
+ this.selectedTable = this._FileApiService.deepClone(selected);
831
+ let selectedTablearr = this.removeDuplicatesById(this.selectedTable);
832
+ if (selected.length > selectedTablearr.length) {
833
+ selectedTablearr = selectedTablearr.filter(el => el.id !== this.nowSelectId);
834
+ }
835
+ this.selectedTable = selectedTablearr;
836
+ }
837
+ /**删除数组中重复的项 */
838
+ removeDuplicatesById(array) {
839
+ const seenIds = {};
840
+ return array.filter(item => {
841
+ if (!seenIds[item.id]) {
842
+ seenIds[item.id] = true;
843
+ return true;
844
+ }
845
+ return false;
846
+ });
847
+ }
848
+ /**一个布尔or函数,可用于检查是否要根据条件选择特定行。 */
849
+ selectCheck = (row, column, value) => {
850
+ this.nowSelectId = row.id;
851
+ return true;
852
+ };
853
+ /**判断row是否选中 */
854
+ selectedcheckbox = (id) => {
855
+ return this.selectedTable.some(el => el.id == id);
856
+ };
857
+ /**删除图片 */
858
+ deleteFile(file) {
859
+ this.confirmation
860
+ .warn('', { key: '', defaultValue: this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`) })
861
+ .subscribe((status) => {
862
+ if (status == 'confirm') {
863
+ this._FileService.delete(file.id).subscribe(res => {
864
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
865
+ this.list.get();
866
+ });
867
+ }
868
+ });
869
+ }
870
+ /**关闭文件状态弹窗 */
871
+ closeFileStatusModal() {
872
+ this.uploadPictureStatusList = [];
873
+ }
874
+ /**创建图片的接口,代理中的file类型不匹配,切换为any类型 */
875
+ createFile = (input, config) => this.restService.request({
876
+ method: 'POST',
877
+ url: '/api/file-explorer/files',
878
+ params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
879
+ body: input.file,
880
+ }, { apiName: 'FileExplorer', ...config });
881
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModalComponent, deps: [{ token: FileDescriptorService$1 }, { token: i2$2.ToasterService }, { token: i3.ListService }, { token: FileApiService }, { token: i3.RestService }, { token: i2$2.ConfirmationService }, { token: i3.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
882
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileModalComponent, selector: "fe-file-modal", inputs: { fileContainerName: "fileContainerName", multiple: "multiple", limit: "limit", visible: "visible", selectPickerFile: "selectPickerFile" }, outputs: { visibleChange: "visibleChange", selectFilefn: "selectFilefn" }, providers: [
883
+ // [Required]
884
+ ListService,
885
+ // [Optional]
886
+ // Provide this token if you want a different debounce time.
887
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
888
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
889
+ ], 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\" 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=\"col-9\" style=\"height: calc(100vh - 240px)\">\n <div class=\"mb-2 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 <!-- accept=\".jpg,.jpeg,.png,.gif,.webp\" -->\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:m: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: "component", type: i2$2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2$2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2$2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i2$2.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" }] });
890
+ }
891
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileModalComponent, decorators: [{
892
+ type: Component,
893
+ args: [{ selector: 'fe-file-modal', providers: [
894
+ // [Required]
895
+ ListService,
896
+ // [Optional]
897
+ // Provide this token if you want a different debounce time.
898
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
899
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
900
+ ], 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\" 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=\"col-9\" style=\"height: calc(100vh - 240px)\">\n <div class=\"mb-2 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 <!-- accept=\".jpg,.jpeg,.png,.gif,.webp\" -->\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:m: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"] }]
901
+ }], ctorParameters: function () { return [{ type: FileDescriptorService$1 }, { type: i2$2.ToasterService }, { type: i3.ListService }, { type: FileApiService }, { type: i3.RestService }, { type: i2$2.ConfirmationService }, { type: i3.LocalizationService }]; }, propDecorators: { fileContainerName: [{
902
+ type: Input
903
+ }], multiple: [{
904
+ type: Input
905
+ }], limit: [{
906
+ type: Input
907
+ }], visible: [{
908
+ type: Input
909
+ }], visibleChange: [{
910
+ type: Output
911
+ }], selectPickerFile: [{
912
+ type: Input
913
+ }], selectFilefn: [{
914
+ type: Output
915
+ }] } });
916
+
917
+ class FilePickerComponent {
918
+ _FileApiService;
919
+ constructor(_FileApiService) {
920
+ this._FileApiService = _FileApiService;
921
+ }
922
+ /**是否多选 */
923
+ _multiple = false;
924
+ set multiple(v) {
925
+ this._multiple = v;
926
+ }
927
+ /**图片容器 */
928
+ _fileContainerName = 'images';
929
+ set fileContainerName(v) {
930
+ this._fileContainerName = v;
931
+ }
932
+ /**已选定的文件 */
933
+ selectFormFile;
934
+ ngOnChanges(changes) {
935
+ let selectFormFilengOnChanges = changes.selectFormFile['currentValue'];
936
+ if (selectFormFilengOnChanges.length > 0) {
937
+ this._fileShowTable = selectFormFilengOnChanges;
938
+ }
939
+ }
940
+ selectedFileChange = new EventEmitter();
941
+ _fileShowTable = [];
942
+ /**表格选择的文件回调 */
943
+ _selectFilefn(event) {
944
+ let _fileShowTable = this._FileApiService.deepClone(event);
945
+ this._fileShowTable = _fileShowTable;
946
+ this.selectFormFile = _fileShowTable;
947
+ this.selectedFileChange.emit(_fileShowTable);
948
+ }
949
+ /**模态框-状态-是否打开 */
950
+ ModalOpen = false;
951
+ /**删除文件表格项 */
952
+ deleteFileTableItem(i, file) {
953
+ this._fileShowTable.splice(i, 1);
954
+ this.selectFormFile = this._fileShowTable;
955
+ this.selectedFileChange.emit([]);
956
+ this.selectedFileChange.emit(this.selectFormFile);
957
+ }
958
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilePickerComponent, deps: [{ token: FileApiService }], target: i0.ɵɵFactoryTarget.Component });
959
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FilePickerComponent, selector: "fe-file-picker", inputs: { multiple: "multiple", fileContainerName: "fileContainerName", selectFormFile: "selectFormFile" }, outputs: { selectedFileChange: "selectedFileChange" }, usesOnChanges: true, ngImport: i0, template: "<button class=\"btn btn-sm btn-primary ms-2 float-end\" type=\"button\" (click.stop)=\"ModalOpen = true\">{{'FileExplorer::SelectFile' | abpLocalization}}</button>\n<fe-file-modal [(visible)]=\"ModalOpen\" [selectPickerFile]=\"selectFormFile\" [multiple]=\"_multiple\" (selectFilefn)=\"_selectFilefn($event)\" [fileContainerName]=\"_fileContainerName\"></fe-file-modal>\n<table class=\"table\" *ngIf=\"_fileShowTable.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 _fileShowTable;let i =index\">\n <tr>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.url\" [name]=\"item.name\" [type]=\"item.mimeType\" [preview]=\"true\"></fe-file-preview>\n </td>\n <th scope=\"row\">\n <div>{{item.name}}</div>\n </th>\n <td >{{_FileApiService.formatFileSize(item.size)}}</td>\n <td>\n <button class=\"btn btn-sm p-0 btn-light \" (click.stop)=\"deleteFileTableItem(i,item)\">\n <i class=\"fas fa-trash p-2\"></i>\n </button>\n </td>\n </tr>\n </ng-container>\n </tbody>\n</table>\n\n\n", styles: [""], 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: 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"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
960
+ }
961
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FilePickerComponent, decorators: [{
962
+ type: Component,
963
+ args: [{ selector: 'fe-file-picker', template: "<button class=\"btn btn-sm btn-primary ms-2 float-end\" type=\"button\" (click.stop)=\"ModalOpen = true\">{{'FileExplorer::SelectFile' | abpLocalization}}</button>\n<fe-file-modal [(visible)]=\"ModalOpen\" [selectPickerFile]=\"selectFormFile\" [multiple]=\"_multiple\" (selectFilefn)=\"_selectFilefn($event)\" [fileContainerName]=\"_fileContainerName\"></fe-file-modal>\n<table class=\"table\" *ngIf=\"_fileShowTable.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 _fileShowTable;let i =index\">\n <tr>\n <td>\n <fe-file-preview [width]=\"'80px'\" [src]=\"item.url\" [name]=\"item.name\" [type]=\"item.mimeType\" [preview]=\"true\"></fe-file-preview>\n </td>\n <th scope=\"row\">\n <div>{{item.name}}</div>\n </th>\n <td >{{_FileApiService.formatFileSize(item.size)}}</td>\n <td>\n <button class=\"btn btn-sm p-0 btn-light \" (click.stop)=\"deleteFileTableItem(i,item)\">\n <i class=\"fas fa-trash p-2\"></i>\n </button>\n </td>\n </tr>\n </ng-container>\n </tbody>\n</table>\n\n\n" }]
964
+ }], ctorParameters: function () { return [{ type: FileApiService }]; }, propDecorators: { multiple: [{
965
+ type: Input
966
+ }], fileContainerName: [{
967
+ type: Input
968
+ }], selectFormFile: [{
969
+ type: Input
970
+ }], selectedFileChange: [{
971
+ type: Output
972
+ }] } });
973
+
974
+ class FileDomeComponent {
975
+ /**跟随表单提交--已提交的数据,或选择的数据源 */
976
+ fileSubmittedData = [];
977
+ /**跟随表单提交--待提交的数据
978
+ *
979
+ * @param 待上传的文件们
980
+ * @param 待删除已上传的文件们
981
+ */
982
+ fileDataToBeSubmitted;
983
+ /**跟随表单提交--数据发生改变回调 */
984
+ fileDataChange(event) {
985
+ this.fileDataToBeSubmitted = event;
986
+ }
987
+ /**选择文件-弹窗的-已选定的文件 */
988
+ selectedFileGroup = [];
989
+ /**_selectedFile改变回调 */
990
+ _selectedFileChange(event) {
991
+ this.selectedFileGroup = event;
992
+ }
993
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDomeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
994
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileDomeComponent, selector: "fe-file-dome", ngImport: i0, template: "<div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"card\">\r\n <div class=\"card-header py-2 border-bottom\">Send file stream with form</div>\r\n <div class=\"card-body\">\r\n <fe-file-edit [(fileData)]=\"fileSubmittedData\" (fileDataChange)=\"fileDataChange($event)\"></fe-file-edit>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col\">\r\n <div class=\"card\">\r\n <div class=\"card-header py-2 border-bottom\">Send file stream with form</div>\r\n <div class=\"card-body\">\r\n <fe-file-picker [selectFormFile]=\"selectedFileGroup\" (selectedFileChange)=\"_selectedFileChange($event)\" ></fe-file-picker>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: FileEditComponent, selector: "fe-file-edit", inputs: ["multiple", "fileData", "limit"], outputs: ["fileDataChange"] }, { kind: "component", type: FilePickerComponent, selector: "fe-file-picker", inputs: ["multiple", "fileContainerName", "selectFormFile"], outputs: ["selectedFileChange"] }] });
995
+ }
996
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileDomeComponent, decorators: [{
997
+ type: Component,
998
+ args: [{ selector: 'fe-file-dome', template: "<div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"card\">\r\n <div class=\"card-header py-2 border-bottom\">Send file stream with form</div>\r\n <div class=\"card-body\">\r\n <fe-file-edit [(fileData)]=\"fileSubmittedData\" (fileDataChange)=\"fileDataChange($event)\"></fe-file-edit>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col\">\r\n <div class=\"card\">\r\n <div class=\"card-header py-2 border-bottom\">Send file stream with form</div>\r\n <div class=\"card-body\">\r\n <fe-file-picker [selectFormFile]=\"selectedFileGroup\" (selectedFileChange)=\"_selectedFileChange($event)\" ></fe-file-picker>\r\n </div>\r\n </div>\r\n </div>\r\n</div>" }]
999
+ }] });
1000
+
1001
+ const routes = [
1002
+ {
1003
+ path: 'file-dome',
1004
+ component: FileDomeComponent
1005
+ },
1006
+ ];
1007
+ class FileExplorerRoutingModule {
1008
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1009
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
1010
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
1011
+ }
1012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerRoutingModule, decorators: [{
1013
+ type: NgModule,
1014
+ args: [{
1015
+ imports: [RouterModule.forChild(routes)],
1016
+ exports: [RouterModule]
1017
+ }]
1018
+ }] });
1019
+
1020
+ class FileExplorerModule {
1021
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1022
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerModule, declarations: [FileEditComponent,
1023
+ FilePickerComponent,
1024
+ FileModalComponent,
1025
+ FileModalTreeComponent,
1026
+ FileDomeComponent,
1027
+ FilePreviewComponent], imports: [FormsModule,
1028
+ CoreModule,
1029
+ ThemeSharedModule,
1030
+ ReactiveFormsModule,
1031
+ NgbDropdownModule,
1032
+ NzTreeModule,
1033
+ NgxValidateCoreModule,
1034
+ FileExplorerRoutingModule], exports: [FileEditComponent,
1035
+ FilePickerComponent,
1036
+ FileModalComponent,
1037
+ FileModalTreeComponent,
1038
+ FileDomeComponent,
1039
+ FilePreviewComponent] });
1040
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerModule, providers: [
1041
+ // [Required]
1042
+ ListService,
1043
+ // [Optional]
1044
+ // Provide this token if you want a different debounce time.
1045
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1046
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1047
+ ], imports: [FormsModule,
1048
+ CoreModule,
1049
+ ThemeSharedModule,
1050
+ ReactiveFormsModule,
1051
+ NgbDropdownModule,
1052
+ NzTreeModule,
1053
+ NgxValidateCoreModule,
1054
+ FileExplorerRoutingModule] });
1055
+ }
1056
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileExplorerModule, decorators: [{
1057
+ type: NgModule,
1058
+ args: [{
1059
+ declarations: [
1060
+ FileEditComponent,
1061
+ FilePickerComponent,
1062
+ FileModalComponent,
1063
+ FileModalTreeComponent,
1064
+ FileDomeComponent,
1065
+ FilePreviewComponent,
1066
+ ],
1067
+ imports: [
1068
+ FormsModule,
1069
+ CoreModule,
1070
+ ThemeSharedModule,
1071
+ ReactiveFormsModule,
1072
+ NgbDropdownModule,
1073
+ NzTreeModule,
1074
+ NgxValidateCoreModule,
1075
+ FileExplorerRoutingModule,
1076
+ ],
1077
+ exports: [
1078
+ FileEditComponent,
1079
+ FilePickerComponent,
1080
+ FileModalComponent,
1081
+ FileModalTreeComponent,
1082
+ FileDomeComponent,
1083
+ FilePreviewComponent
1084
+ ],
1085
+ providers: [
1086
+ // [Required]
1087
+ ListService,
1088
+ // [Optional]
1089
+ // Provide this token if you want a different debounce time.
1090
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1091
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1092
+ ],
1093
+ }]
1094
+ }] });
1095
+
1096
+ var index$c = /*#__PURE__*/Object.freeze({
1097
+ __proto__: null,
1098
+ Directories: index$d,
1099
+ Files: index$e
1100
+ });
1101
+
1102
+ var index$b = /*#__PURE__*/Object.freeze({
1103
+ __proto__: null,
1104
+ FileExplorer: index$c
1105
+ });
1106
+
1107
+ var index$a = /*#__PURE__*/Object.freeze({
1108
+ __proto__: null
1109
+ });
1110
+
1111
+ var index$9 = /*#__PURE__*/Object.freeze({
1112
+ __proto__: null,
1113
+ Mvc: index$a
1114
+ });
1115
+
1116
+ var index$8 = /*#__PURE__*/Object.freeze({
1117
+ __proto__: null
1118
+ });
1119
+
1120
+ var index$7 = /*#__PURE__*/Object.freeze({
1121
+ __proto__: null,
1122
+ Primitives: index$8
1123
+ });
1124
+
1125
+ var index$6 = /*#__PURE__*/Object.freeze({
1126
+ __proto__: null
1127
+ });
1128
+
1129
+ var index$5 = /*#__PURE__*/Object.freeze({
1130
+ __proto__: null,
1131
+ Headers: index$6
1132
+ });
1133
+
1134
+ var index$4 = /*#__PURE__*/Object.freeze({
1135
+ __proto__: null,
1136
+ Http: index$5
1137
+ });
1138
+
1139
+ var index$3 = /*#__PURE__*/Object.freeze({
1140
+ __proto__: null,
1141
+ AspNetCore: index$9,
1142
+ Extensions: index$7,
1143
+ Net: index$4
1144
+ });
1145
+
1146
+ var index$2 = /*#__PURE__*/Object.freeze({
1147
+ __proto__: null
1148
+ });
1149
+
1150
+ var index$1 = /*#__PURE__*/Object.freeze({
1151
+ __proto__: null,
1152
+ Content: index$2
1153
+ });
1154
+
1155
+ var index = /*#__PURE__*/Object.freeze({
1156
+ __proto__: null,
1157
+ Abp: index$1
1158
+ });
1159
+
1160
+ /*
1161
+ * Public API Surface of file-explorer
1162
+ */
1163
+
1164
+ /**
1165
+ * Generated bundle index. Do not edit.
1166
+ */
1167
+
1168
+ export { index$b as Dignite, FileApiService, FileDomeComponent, FileEditComponent, FileExplorerModule, FileModalComponent, FileModalTreeComponent, FilePickerComponent, FilePreviewComponent, ImageTypeOption, index$3 as Microsoft, index as Volo };
1169
+ //# sourceMappingURL=dignite-ng-expand.file-explorer.mjs.map