@dignite-ng/expand.file-explorer 0.0.3 → 0.0.4
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/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
- package/config/enums/route-names.d.ts +3 -0
- package/config/file-config.module.d.ts +8 -0
- package/config/index.d.ts +5 -0
- package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
- package/config/providers/route.provider.d.ts +8 -0
- package/config/{src/public-api.ts → public-api.d.ts} +3 -3
- package/esm2022/config/dignite-ng-expand.file-explorer-config.mjs +5 -0
- package/esm2022/config/enums/index.mjs +2 -0
- package/esm2022/config/enums/route-names.mjs +2 -0
- package/esm2022/config/file-config.module.mjs +19 -0
- package/esm2022/config/providers/index.mjs +2 -0
- package/esm2022/config/providers/route.provider.mjs +24 -0
- package/esm2022/config/public-api.mjs +4 -0
- package/esm2022/dignite-ng-expand.file-explorer.mjs +5 -0
- package/esm2022/lib/components/dome/file-dome.component.mjs +32 -0
- package/esm2022/lib/components/file-edit/file-edit.component.mjs +102 -0
- package/esm2022/lib/components/file-modal/file-modal.component.mjs +271 -0
- package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +195 -0
- package/esm2022/lib/components/file-picker/file-picker.component.mjs +57 -0
- package/esm2022/lib/components/index.mjs +6 -0
- package/esm2022/lib/file-explorer-routing.module.mjs +25 -0
- package/esm2022/lib/file-explorer.module.mjs +83 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +48 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +60 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +4 -0
- package/esm2022/lib/proxy/dignite/index.mjs +3 -0
- package/esm2022/lib/proxy/index.mjs +5 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/extensions/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/index.mjs +5 -0
- package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/net/http/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/net/index.mjs +3 -0
- package/esm2022/lib/proxy/volo/abp/content/index.mjs +2 -0
- package/esm2022/lib/proxy/volo/abp/content/models.mjs +2 -0
- package/esm2022/lib/proxy/volo/abp/index.mjs +3 -0
- package/esm2022/lib/proxy/volo/index.mjs +3 -0
- package/esm2022/lib/services/file-api.service.mjs +66 -0
- package/esm2022/lib/services/index.mjs +2 -0
- package/esm2022/public-api.mjs +8 -0
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs +47 -0
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs.map +1 -0
- package/fesm2022/dignite-ng-expand.file-explorer.mjs +972 -0
- package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dome/file-dome.component.d.ts +19 -0
- package/lib/components/file-edit/file-edit.component.d.ts +38 -0
- package/lib/components/file-modal/file-modal.component.d.ts +93 -0
- package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +66 -0
- package/lib/components/file-picker/file-picker.component.d.ts +23 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/file-explorer-routing.module.d.ts +7 -0
- package/lib/file-explorer.module.d.ts +18 -0
- package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +17 -0
- package/{src/lib/proxy/dignite/file-explorer/directories/models.ts → lib/proxy/dignite/file-explorer/directories/models.d.ts} +29 -35
- package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +20 -0
- package/lib/proxy/dignite/file-explorer/files/models.d.ts +50 -0
- package/{src/lib/proxy/microsoft/asp-net-core/mvc/models.ts → lib/proxy/microsoft/asp-net-core/mvc/models.d.ts} +10 -12
- package/lib/proxy/microsoft/extensions/primitives/models.d.ts +8 -0
- package/{src/lib/proxy/microsoft/net/http/headers/models.ts → lib/proxy/microsoft/net/http/headers/models.d.ts} +6 -7
- package/lib/proxy/volo/abp/content/models.d.ts +5 -0
- package/lib/services/file-api.service.d.ts +14 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +21 -2
- package/{src/public-api.ts → public-api.d.ts} +0 -5
- package/config/ng-package.json +0 -7
- package/config/src/enums/route-names.ts +0 -15
- package/config/src/file-config.module.ts +0 -12
- package/config/src/providers/route.provider.ts +0 -26
- package/ng-package.json +0 -7
- package/src/lib/components/dome/file-dome.component.html +0 -18
- package/src/lib/components/dome/file-dome.component.scss +0 -0
- package/src/lib/components/dome/file-dome.component.spec.ts +0 -21
- package/src/lib/components/dome/file-dome.component.ts +0 -33
- package/src/lib/components/file-edit/file-edit.component.html +0 -29
- package/src/lib/components/file-edit/file-edit.component.scss +0 -0
- package/src/lib/components/file-edit/file-edit.component.spec.ts +0 -21
- package/src/lib/components/file-edit/file-edit.component.ts +0 -98
- package/src/lib/components/file-modal/file-modal.component.html +0 -112
- package/src/lib/components/file-modal/file-modal.component.scss +0 -56
- package/src/lib/components/file-modal/file-modal.component.spec.ts +0 -21
- package/src/lib/components/file-modal/file-modal.component.ts +0 -284
- package/src/lib/components/file-modal-tree/file-modal-tree.component.html +0 -63
- package/src/lib/components/file-modal-tree/file-modal-tree.component.scss +0 -0
- package/src/lib/components/file-modal-tree/file-modal-tree.component.spec.ts +0 -21
- package/src/lib/components/file-modal-tree/file-modal-tree.component.ts +0 -207
- package/src/lib/components/file-picker/file-picker.component.html +0 -28
- package/src/lib/components/file-picker/file-picker.component.scss +0 -0
- package/src/lib/components/file-picker/file-picker.component.spec.ts +0 -21
- package/src/lib/components/file-picker/file-picker.component.ts +0 -58
- package/src/lib/components/index.ts +0 -5
- package/src/lib/file-explorer-routing.module.ts +0 -18
- package/src/lib/file-explorer.module.ts +0 -46
- package/src/lib/proxy/README.md +0 -17
- package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
- package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
- package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -58
- package/src/lib/proxy/generate-proxy.json +0 -11810
- package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
- package/src/lib/proxy/volo/abp/content/models.ts +0 -6
- package/src/lib/services/file-api.service.ts +0 -59
- package/src/lib/services/index.ts +0 -1
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
- /package/{src/lib/proxy/dignite/file-explorer/directories/index.ts → lib/proxy/dignite/file-explorer/directories/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/file-explorer/files/index.ts → lib/proxy/dignite/file-explorer/files/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/file-explorer/index.ts → lib/proxy/dignite/file-explorer/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/index.ts → lib/proxy/dignite/index.d.ts} +0 -0
- /package/{src/lib/proxy/index.ts → lib/proxy/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/asp-net-core/index.ts → lib/proxy/microsoft/asp-net-core/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/asp-net-core/mvc/index.ts → lib/proxy/microsoft/asp-net-core/mvc/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/extensions/index.ts → lib/proxy/microsoft/extensions/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/extensions/primitives/index.ts → lib/proxy/microsoft/extensions/primitives/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/index.ts → lib/proxy/microsoft/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/net/http/headers/index.ts → lib/proxy/microsoft/net/http/headers/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/net/http/index.ts → lib/proxy/microsoft/net/http/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/net/index.ts → lib/proxy/microsoft/net/index.d.ts} +0 -0
- /package/{src/lib/proxy/volo/abp/content/index.ts → lib/proxy/volo/abp/content/index.d.ts} +0 -0
- /package/{src/lib/proxy/volo/abp/index.ts → lib/proxy/volo/abp/index.d.ts} +0 -0
- /package/{src/lib/proxy/volo/index.ts → lib/proxy/volo/index.d.ts} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IRemoteStreamContent } from '../../../volo/abp/content/models';
|
|
2
|
+
import type { CreationAuditedEntityDto, PagedAndSortedResultRequestDto } from '@abp/ng.core';
|
|
3
|
+
export interface CreateFileInput {
|
|
4
|
+
containerName: string;
|
|
5
|
+
cellName?: string;
|
|
6
|
+
directoryId?: string;
|
|
7
|
+
entityId?: string;
|
|
8
|
+
file: IRemoteStreamContent;
|
|
9
|
+
}
|
|
10
|
+
export interface FileCellDto {
|
|
11
|
+
name?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FileContainerConfigurationDto {
|
|
15
|
+
maxBlobSize: number;
|
|
16
|
+
allowedFileTypeNames: string[];
|
|
17
|
+
fileCells: FileCellDto[];
|
|
18
|
+
createDirectoryPermissionName?: string;
|
|
19
|
+
createFilePermissionName?: string;
|
|
20
|
+
updateFilePermissionName?: string;
|
|
21
|
+
deleteFilePermissionName?: string;
|
|
22
|
+
getFilePermissionName?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FileDescriptorDto extends CreationAuditedEntityDto<string> {
|
|
25
|
+
entityId?: string;
|
|
26
|
+
containerName?: string;
|
|
27
|
+
blobName?: string;
|
|
28
|
+
cellName?: string;
|
|
29
|
+
directoryId?: string;
|
|
30
|
+
size: number;
|
|
31
|
+
name?: string;
|
|
32
|
+
mimeType?: string;
|
|
33
|
+
url?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GetFilesInput extends PagedAndSortedResultRequestDto {
|
|
36
|
+
containerName: string;
|
|
37
|
+
directoryId?: string;
|
|
38
|
+
creatorId?: string;
|
|
39
|
+
filter?: string;
|
|
40
|
+
entityId?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ImageResizeInput {
|
|
43
|
+
width?: number;
|
|
44
|
+
height?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface UpdateFileInput {
|
|
47
|
+
cellName?: string;
|
|
48
|
+
directoryId?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { EntityTagHeaderValue } from '../../net/http/headers/models';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
enableRangeProcessing: boolean;
|
|
12
|
-
}
|
|
1
|
+
import type { EntityTagHeaderValue } from '../../net/http/headers/models';
|
|
2
|
+
export interface ActionResult {
|
|
3
|
+
}
|
|
4
|
+
export interface FileResult extends ActionResult {
|
|
5
|
+
contentType?: string;
|
|
6
|
+
fileDownloadName?: string;
|
|
7
|
+
lastModified?: string;
|
|
8
|
+
entityTag: EntityTagHeaderValue;
|
|
9
|
+
enableRangeProcessing: boolean;
|
|
10
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { StringSegment } from '../../../extensions/primitives/models';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import type { StringSegment } from '../../../extensions/primitives/models';
|
|
2
|
+
export interface EntityTagHeaderValue {
|
|
3
|
+
any: EntityTagHeaderValue;
|
|
4
|
+
tag: StringSegment;
|
|
5
|
+
isWeak: boolean;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FileApiService {
|
|
3
|
+
constructor();
|
|
4
|
+
/**转换文件大小单位 输入k */
|
|
5
|
+
formatFileSize(bytes: any): string;
|
|
6
|
+
/**获取图片的本地连接 */
|
|
7
|
+
getImageLacolBase64Url(file: File): Promise<unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* 深拷贝--方法
|
|
10
|
+
* $api.deepClone() */
|
|
11
|
+
deepClone(obj: any): any;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileApiService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FileApiService>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './file-api.service';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dignite-ng/expand.file-explorer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^16.2.0",
|
|
6
6
|
"@angular/core": "^16.2.0"
|
|
@@ -12,5 +12,24 @@
|
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public",
|
|
14
14
|
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"module": "fesm2022/dignite-ng-expand.file-explorer.mjs",
|
|
17
|
+
"typings": "index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": {
|
|
20
|
+
"default": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"esm2022": "./esm2022/dignite-ng-expand.file-explorer.mjs",
|
|
25
|
+
"esm": "./esm2022/dignite-ng-expand.file-explorer.mjs",
|
|
26
|
+
"default": "./fesm2022/dignite-ng-expand.file-explorer.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./config": {
|
|
29
|
+
"types": "./config/index.d.ts",
|
|
30
|
+
"esm2022": "./esm2022/config/dignite-ng-expand.file-explorer-config.mjs",
|
|
31
|
+
"esm": "./esm2022/config/dignite-ng-expand.file-explorer-config.mjs",
|
|
32
|
+
"default": "./fesm2022/dignite-ng-expand.file-explorer-config.mjs"
|
|
33
|
+
}
|
|
15
34
|
}
|
|
16
|
-
}
|
|
35
|
+
}
|
package/config/ng-package.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const enum eFileRouteNames {
|
|
2
|
-
// Cms = 'Cms',
|
|
3
|
-
// Entries = 'Entries',
|
|
4
|
-
// Settings = "Settings",
|
|
5
|
-
// Fields = "Fields",
|
|
6
|
-
// Sites = "Sites",
|
|
7
|
-
// Sections = "Sections",
|
|
8
|
-
// Cms = '内容管理',
|
|
9
|
-
// Entries = '条目',
|
|
10
|
-
// Settings = "设置",
|
|
11
|
-
// Fields = "字段",
|
|
12
|
-
// Sites = "站点",
|
|
13
|
-
FileUploadDemo = "File Upload Demo",
|
|
14
|
-
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders, NgModule } from '@angular/core';
|
|
2
|
-
import { FILE_ROUTE_PROVIDERS } from './providers/route.provider';
|
|
3
|
-
|
|
4
|
-
@NgModule()
|
|
5
|
-
export class FileConfigModule {
|
|
6
|
-
static forRoot(): ModuleWithProviders<FileConfigModule> {
|
|
7
|
-
return {
|
|
8
|
-
ngModule: FileConfigModule,
|
|
9
|
-
providers: [FILE_ROUTE_PROVIDERS],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { eLayoutType, RoutesService } from '@abp/ng.core';
|
|
2
|
-
import { APP_INITIALIZER } from '@angular/core';
|
|
3
|
-
import { eFileRouteNames } from '../enums';
|
|
4
|
-
|
|
5
|
-
export const FILE_ROUTE_PROVIDERS = [
|
|
6
|
-
{
|
|
7
|
-
provide: APP_INITIALIZER,
|
|
8
|
-
useFactory: configureRoutes,
|
|
9
|
-
deps: [RoutesService],
|
|
10
|
-
multi: true,
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
export function configureRoutes(routesService: RoutesService) {
|
|
15
|
-
return () => {
|
|
16
|
-
routesService.add([
|
|
17
|
-
{
|
|
18
|
-
path: '/file/file-dome',
|
|
19
|
-
name:eFileRouteNames.FileUploadDemo,
|
|
20
|
-
iconClass: 'fas fa fa-file-archive-o',
|
|
21
|
-
layout: eLayoutType.application,
|
|
22
|
-
order: 9,
|
|
23
|
-
},
|
|
24
|
-
]);
|
|
25
|
-
};
|
|
26
|
-
}
|
package/ng-package.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<div class="row">
|
|
2
|
-
<div class="col">
|
|
3
|
-
<div class="card">
|
|
4
|
-
<div class="card-header py-2 border-bottom">Send file stream with form</div>
|
|
5
|
-
<div class="card-body">
|
|
6
|
-
<fe-file-edit [(fileData)]="fileSubmittedData" (fileDataChange)="fileDataChange($event)"></fe-file-edit>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="col">
|
|
11
|
-
<div class="card">
|
|
12
|
-
<div class="card-header py-2 border-bottom">Send file stream with form</div>
|
|
13
|
-
<div class="card-body">
|
|
14
|
-
<fe-file-picker [selectFormFile]="selectedFileGroup" (selectedFileChange)="_selectedFileChange($event)" ></fe-file-picker>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FileDomeComponent } from './file-dome.component';
|
|
4
|
-
|
|
5
|
-
describe('FileDomeComponent', () => {
|
|
6
|
-
let component: FileDomeComponent;
|
|
7
|
-
let fixture: ComponentFixture<FileDomeComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [FileDomeComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(FileDomeComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'fe-file-dome',
|
|
5
|
-
templateUrl: './file-dome.component.html',
|
|
6
|
-
styleUrls: ['./file-dome.component.scss']
|
|
7
|
-
})
|
|
8
|
-
export class FileDomeComponent {
|
|
9
|
-
|
|
10
|
-
/**跟随表单提交--已提交的数据,或选择的数据源 */
|
|
11
|
-
fileSubmittedData: any[] = []
|
|
12
|
-
|
|
13
|
-
/**跟随表单提交--待提交的数据
|
|
14
|
-
*
|
|
15
|
-
* @param 待上传的文件们
|
|
16
|
-
* @param 待删除已上传的文件们
|
|
17
|
-
*/
|
|
18
|
-
fileDataToBeSubmitted: any
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**跟随表单提交--数据发生改变回调 */
|
|
22
|
-
fileDataChange(event) {
|
|
23
|
-
this.fileDataToBeSubmitted = event
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**选择文件-弹窗的-已选定的文件 */
|
|
27
|
-
selectedFileGroup:any[]=[]
|
|
28
|
-
|
|
29
|
-
/**_selectedFile改变回调 */
|
|
30
|
-
_selectedFileChange(event) {
|
|
31
|
-
this.selectedFileGroup = event
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<div class="input-group mb-2">
|
|
2
|
-
<input type="file" class="form-control" #fileEdit [multiple]="_multiple" accept=".jpg,.jpeg,.png,.gif,.webp"(change)="getFileChange($event)">
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
<table class="table" *ngIf="filesTableData.length>0">
|
|
6
|
-
<thead>
|
|
7
|
-
<tr>
|
|
8
|
-
<th scope="col">{{'FileExplorer::FileName' | abpLocalization}}</th>
|
|
9
|
-
<th scope="col">{{'FileExplorer::FileSize' | abpLocalization}}</th>
|
|
10
|
-
<th scope="col"></th>
|
|
11
|
-
</tr>
|
|
12
|
-
</thead>
|
|
13
|
-
<tbody>
|
|
14
|
-
<ng-container *ngFor="let item of filesTableData;let i =index">
|
|
15
|
-
<tr>
|
|
16
|
-
<th scope="row">
|
|
17
|
-
<div>{{item.name}}</div>
|
|
18
|
-
<div class="form-text text-danger" *ngIf="item.size > sizeLimit">{{'FileExplorer::ExceedsMaximumSize' | abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}</div>
|
|
19
|
-
</th>
|
|
20
|
-
<td>{{item.fileSize}}</td>
|
|
21
|
-
<td>
|
|
22
|
-
<button class="btn btn-sm p-0 btn-light " (click.stop)="deleteFileTableItem(i,item)">
|
|
23
|
-
<i class="fas fa-trash p-2"></i>
|
|
24
|
-
</button>
|
|
25
|
-
</td>
|
|
26
|
-
</tr>
|
|
27
|
-
</ng-container>
|
|
28
|
-
</tbody>
|
|
29
|
-
</table>
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FileEditComponent } from './file-edit.component';
|
|
4
|
-
|
|
5
|
-
describe('FileEditComponent', () => {
|
|
6
|
-
let component: FileEditComponent;
|
|
7
|
-
let fixture: ComponentFixture<FileEditComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [FileEditComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(FileEditComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
2
|
-
import { FileApiService } from '../../services/file-api.service';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'fe-file-edit',
|
|
6
|
-
templateUrl: './file-edit.component.html',
|
|
7
|
-
styleUrls: ['./file-edit.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class FileEditComponent {
|
|
10
|
-
constructor(
|
|
11
|
-
public _FileApiService: FileApiService,
|
|
12
|
-
) { }
|
|
13
|
-
|
|
14
|
-
/**是否多选 */
|
|
15
|
-
_multiple: boolean = true
|
|
16
|
-
@Input()
|
|
17
|
-
public set multiple(v: boolean) {
|
|
18
|
-
this._multiple = v;
|
|
19
|
-
if (v) { }
|
|
20
|
-
}
|
|
21
|
-
/**文件数据--已上传的数据 */
|
|
22
|
-
_fileData: any[] = []
|
|
23
|
-
@Input()
|
|
24
|
-
public set fileData(v: any[]) {
|
|
25
|
-
this._fileData = v;
|
|
26
|
-
if (v.length > 0) {
|
|
27
|
-
this.getFileChange({ target: { files: v } })
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/** 跟随表单提交--已提交的数据,或选择的数据源--回调*/
|
|
31
|
-
@Output() fileDataChange = new EventEmitter()
|
|
32
|
-
|
|
33
|
-
/**文件大小限制
|
|
34
|
-
* @param 1mb
|
|
35
|
-
*/
|
|
36
|
-
sizeLimit: number = 1048576
|
|
37
|
-
@Input()
|
|
38
|
-
public set limit(v: number) {
|
|
39
|
-
this.sizeLimit = v;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**文件表格数据 */
|
|
43
|
-
filesTableData: any[] = []
|
|
44
|
-
/** 待删除已上传的文件们*/
|
|
45
|
-
deleteTheUploadedFiles: any[] = []
|
|
46
|
-
|
|
47
|
-
/**获取文件选择框的元素 */
|
|
48
|
-
@ViewChild('fileEdit', { static: true }) fileEdit: ElementRef;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**获取文件信息改变 */
|
|
52
|
-
async getFileChange(event) {
|
|
53
|
-
let files = new Array(...event.target.files)
|
|
54
|
-
/**需要等待setfileSizeUnits执行完后在执行其他方法--需要完善 */
|
|
55
|
-
await this.waitFileToAddTable(files)
|
|
56
|
-
this.fileHandling()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**等待将文件数据加入到文件表格数据中 */
|
|
60
|
-
waitFileToAddTable(files) {
|
|
61
|
-
return new Promise(async (resolve, rejects) => {
|
|
62
|
-
this.filesTableData.push(...await this.setfileSizeUnits(files))
|
|
63
|
-
resolve(true)
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**删除文件表格的项 */
|
|
68
|
-
deleteFileTableItem(index, item) {
|
|
69
|
-
this.filesTableData.splice(index, 1)
|
|
70
|
-
if (item.id) {
|
|
71
|
-
this.deleteTheUploadedFiles.push(item)
|
|
72
|
-
}
|
|
73
|
-
this.fileHandling()
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**文件处理-调用回调函数 */
|
|
77
|
-
fileHandling() {
|
|
78
|
-
let theFilesToBeUploaded = this.filesTableData.filter(el => !el.id)
|
|
79
|
-
//判断图片大小是否超过限制-用于判断表单是否允许提交
|
|
80
|
-
let isSubmit = !this.filesTableData.some(el => el.size > this.sizeLimit);
|
|
81
|
-
this.fileDataChange.emit({ theFilesToBeUploaded, deleteTheUploadedFiles: this.deleteTheUploadedFiles, isSubmit })
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**设置值文件大小单位/ */
|
|
85
|
-
async setfileSizeUnits(files: File[] | any[]): Promise<any> {
|
|
86
|
-
return new Promise((resolve, rejects) => {
|
|
87
|
-
let formattedFiles = []
|
|
88
|
-
files.forEach(async (file) => {
|
|
89
|
-
file.fileSize = this._FileApiService.formatFileSize(file.size)
|
|
90
|
-
formattedFiles.push(file)
|
|
91
|
-
//设置选择图片的本地url
|
|
92
|
-
if (!file.src) file.src = await this._FileApiService.getImageLacolBase64Url(file);
|
|
93
|
-
});
|
|
94
|
-
resolve(files)
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<abp-modal [(visible)]="ModalOpen" (visibleChange)="ModalVisibleChange($event)"
|
|
2
|
-
[options]="{ size: 'xl', scrollable: false }">
|
|
3
|
-
<ng-template #abpHeader>
|
|
4
|
-
<h3>{{'FileExplorer::FileExplorer' | abpLocalization}}</h3>
|
|
5
|
-
</ng-template>
|
|
6
|
-
<ng-template #abpBody>
|
|
7
|
-
<div class="row file-explorer-modal-body file-modal">
|
|
8
|
-
<div class="col-3" style="overflow: auto; height: calc(100vh - 240px)">
|
|
9
|
-
<fe-file-modal-tree [theSelectedTreeNode]="_theSelectedTreeNode" (nodeClick)="_nodeClick($event)"
|
|
10
|
-
[fileContainerName]="_fileContainerName"></fe-file-modal-tree>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="col-9" style="height: calc(100vh - 240px)">
|
|
13
|
-
<div class="mb-2 d-flex justify-content-between align-items-center">
|
|
14
|
-
<div class="btn-link" role=button style="flex: 2" (click)="lookAllFile()">{{'FileExplorer::AllFiles' | abpLocalization}}</div>
|
|
15
|
-
<div class="input-group form-file" style="flex: 2">
|
|
16
|
-
<input type="file" class="form-control" #fileEdit [multiple]="_multiple" accept=".jpg,.jpeg,.png,.gif,.webp"
|
|
17
|
-
(change)="getFileChange($event)" />
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
<div>
|
|
21
|
-
<ngx-datatable class="material container-height" [rows]="data.items" [list]="list" columnMode="flex"
|
|
22
|
-
[columns]="columns" [headerHeight]="50" [footerHeight]="50" rowHeight="auto" [scrollbarV]="true"
|
|
23
|
-
[virtualization]="false" [externalPaging]="true" [count]="data.totalCount" [selected]="selectedTable"
|
|
24
|
-
[selectCheck]="selectCheck" [selectionType]="SelectionType.multiClick" (select)="onSelectTableItem($event)">
|
|
25
|
-
<ngx-datatable-column [width]="50" prop="id" [sortable]="false" [canAutoResize]="false" [draggable]="false"
|
|
26
|
-
[resizeable]="false">
|
|
27
|
-
<ng-template ngx-datatable-header-template let-value="value" let-allRowsSelected="allRowsSelected"
|
|
28
|
-
let-selectFn="selectFn">
|
|
29
|
-
<input type="checkbox" class="form-check-input" [checked]="allRowsSelected"
|
|
30
|
-
(change)="selectFn(!allRowsSelected)" />
|
|
31
|
-
</ng-template>
|
|
32
|
-
<ng-template ngx-datatable-cell-template let-row="row" let-value="value" let-isSelected="isSelected"
|
|
33
|
-
let-onCheckboxChangeFn="onCheckboxChangeFn">
|
|
34
|
-
<input type="checkbox" class="form-check-input" [checked]="selectedcheckbox(value)"
|
|
35
|
-
(change)="onCheckboxChangeFn($event)" />
|
|
36
|
-
</ng-template>
|
|
37
|
-
</ngx-datatable-column>
|
|
38
|
-
<ngx-datatable-column [name]="'FileExplorer::FileName' | abpLocalization" prop="name" [flexGrow]="4">
|
|
39
|
-
<ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
|
|
40
|
-
{{ value }}
|
|
41
|
-
</ng-template>
|
|
42
|
-
</ngx-datatable-column>
|
|
43
|
-
<ngx-datatable-column [name]="'FileExplorer::FileSize' | abpLocalization" prop="size" [flexGrow]="1.5">
|
|
44
|
-
<ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
|
|
45
|
-
{{ _FileApiService.formatFileSize(value) }}
|
|
46
|
-
</ng-template>
|
|
47
|
-
</ngx-datatable-column>
|
|
48
|
-
<ngx-datatable-column [name]="'FileExplorer::Directory' | abpLocalization" prop="cellName" [flexGrow]="1">
|
|
49
|
-
<ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
|
|
50
|
-
{{ value }}
|
|
51
|
-
</ng-template>
|
|
52
|
-
</ngx-datatable-column>
|
|
53
|
-
<ngx-datatable-column [name]="'FileExplorer::CreationTime' | abpLocalization" prop="creationTime" [flexGrow]="2">
|
|
54
|
-
<ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
|
|
55
|
-
{{ value | date : 'YYYY/MM/dd HH:m:s' }}
|
|
56
|
-
</ng-template>
|
|
57
|
-
</ngx-datatable-column>
|
|
58
|
-
<ngx-datatable-column [flexGrow]="1">
|
|
59
|
-
<ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
|
|
60
|
-
<button class="btn btn-sm btn-light p-0" (click.stop)="deleteFile(row)">
|
|
61
|
-
<i class="fas fa-trash text-primary p-2"></i>
|
|
62
|
-
</button>
|
|
63
|
-
</ng-template>
|
|
64
|
-
</ngx-datatable-column>
|
|
65
|
-
</ngx-datatable>
|
|
66
|
-
</div>
|
|
67
|
-
<div *ngIf="uploadPictureStatusList.length > 0"
|
|
68
|
-
class="position-fixed bottom-0 end-0 shadow-lg file-status-modal border bg-white p-1 m-5"
|
|
69
|
-
style="border-radius: 10px">
|
|
70
|
-
<div class="card">
|
|
71
|
-
<div class="card-header d-flex align-items-center justify-content-between p-0 py-1 border-bottom">
|
|
72
|
-
<div>{{'FileExplorer::UploadFiles' | abpLocalization}}</div>
|
|
73
|
-
<button type="button" class="btn-close" aria-label="Close" (click.stop)="closeFileStatusModal()"></button>
|
|
74
|
-
</div>
|
|
75
|
-
<div class="card-body">
|
|
76
|
-
<table class="table">
|
|
77
|
-
<thead>
|
|
78
|
-
<tr>
|
|
79
|
-
<th scope="col">{{'FileExplorer::FileName' | abpLocalization}}</th>
|
|
80
|
-
<th scope="col">{{'FileExplorer::FileSize' | abpLocalization}}</th>
|
|
81
|
-
<th scope="col"></th>
|
|
82
|
-
</tr>
|
|
83
|
-
</thead>
|
|
84
|
-
<tbody>
|
|
85
|
-
<ng-container *ngFor="let item of uploadPictureStatusList; let i = index">
|
|
86
|
-
<tr>
|
|
87
|
-
<th scope="row">
|
|
88
|
-
<div>{{ item.name }}</div>
|
|
89
|
-
<div class="form-text text-danger" *ngIf="item.size > sizeLimit">
|
|
90
|
-
{{'FileExplorer::ExceedsMaximumSize' | abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}
|
|
91
|
-
</div>
|
|
92
|
-
</th>
|
|
93
|
-
<td>{{ item.fileSize }}</td>
|
|
94
|
-
<td>
|
|
95
|
-
<i *ngIf="item.status == 1" class="fas fa-check text-primary"></i>
|
|
96
|
-
<i *ngIf="item.status == 2" class="fas fa-times-circle text-danger"></i>
|
|
97
|
-
</td>
|
|
98
|
-
</tr>
|
|
99
|
-
</ng-container>
|
|
100
|
-
</tbody>
|
|
101
|
-
</table>
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</ng-template>
|
|
108
|
-
<ng-template #abpFooter>
|
|
109
|
-
<button type="button" class="btn btn-secondary" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>
|
|
110
|
-
<abp-button iconClass="fa fa-check" (click)="modalSave()">{{'AbpUi::Save' | abpLocalization}}</abp-button>
|
|
111
|
-
</ng-template>
|
|
112
|
-
</abp-modal>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
::ng-deep .file-modal {
|
|
2
|
-
.container-height {
|
|
3
|
-
height: calc(100vh - 240px - 44px);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.file-status-modal {
|
|
7
|
-
background: #fff;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.file-status-modal {
|
|
11
|
-
.card-body {
|
|
12
|
-
max-height: 300px;
|
|
13
|
-
overflow-y: auto;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.ngx-datatable.material.single-selection .datatable-body-row.active,
|
|
18
|
-
.ngx-datatable.material.single-selection .datatable-body-row.active .datatable-row-group,
|
|
19
|
-
.ngx-datatable.material.multi-selection .datatable-body-row.active,
|
|
20
|
-
.ngx-datatable.material.multi-selection .datatable-body-row.active .datatable-row-group,
|
|
21
|
-
.ngx-datatable.material.multi-click-selection .datatable-body-row.active,
|
|
22
|
-
.ngx-datatable.material.multi-click-selection .datatable-body-row.active .datatable-row-group {
|
|
23
|
-
background-color: transparent !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ant-tree {
|
|
27
|
-
.ant-tree-node-content-wrapper {
|
|
28
|
-
padding: 0;
|
|
29
|
-
|
|
30
|
-
.custom-node {
|
|
31
|
-
width: 100%;
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.selected {
|
|
36
|
-
background-color: var(--lpx-brand) !important;
|
|
37
|
-
|
|
38
|
-
.btn {
|
|
39
|
-
color: var(--lpx-navbar-color);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ant-tree-node-content-wrapper.ant-tree-node-selected {
|
|
45
|
-
background-color: transparent;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell,
|
|
51
|
-
.ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell {
|
|
52
|
-
// width: inherit !important;
|
|
53
|
-
overflow: initial;
|
|
54
|
-
line-break: anywhere;
|
|
55
|
-
}
|
|
56
|
-
}
|