0.2.9 • Published 3 months ago

@farris/extend-fileupload-adapt-unifile v0.2.9

Weekly downloads
9
License
MIT
Repository
-
Last release
3 months ago

FfileuploadAdaptUnifile

修改记录

修改日期修改要点
2020 年 1 月 17 日支持预览
2020 年 1 月 9 日支持通过后缀过滤
2020 年 1 月 8 日初版
2020 年 1 月 20 日补充说明文档
2020 年 3 月 2 日依赖接口的变动进行修改

FfileuploadAdaptUnifileModule

  • 适配统一附件管理附件上传和删除的接口
  • 提供扩展,可以配置根目录,表单 ID 和模式
  • 内部依赖的模块
    import { FFileUploadModule } from "@farris/extend-file-upload";
    import { UploadDialogMoudle } from "@gsp-svc/formdoc-upload";
    import { FileListModule, FileViewerService } from "@gsp-svc/file-viewer";
  • 外部使用的方式
    // 附件上传组件与统一附件管理适配模块
    import { FfileuploadAdaptUnifileModule } from '@farris/extend-fileupload-adapt-unifile';
    import { CacheService, HttpService, SessionService } from '@ecp-caf/caf-common';
    ....
    // 设置
    FfileuploadAdaptUnifileModule.forRoot({
      rootId:'test-dir',//对应 附件统一管理:文件夹Id
      formId:'parent-form', //对应 附件统一管理:表单ID
      mode: 0
    })
方法参数含义
forRoot非必填参数,config: FFileUploadAdaptUnifileConfig配置统一附件参数

FFileUploadAdaptUnifileConfig 统一附件配置(接口)

  • 定义统一附件上传到服务器端的参数
属性类型含义
rootIdstring按照目录上传或预览,目录 id
formIdstring按照表单上传或预览,表单 id
modenumber上传模式:正式上传(1),临时上传(0)

FFileUploadAdaptUnifileConfigService 统一附件配置服务

  • 处理模块级别的默认参数设置
方法参数返回含义
getConfig返回预置的统一附件配置,类型是 FFileUploadAdaptUnifileConfig,默认 rootId: 'root-dir',formId: 'parent', mode: 1获取默认配置
formIdstring按照表单上传或预览,表单 id
modenumber上传模式:正式上传(1),临时上传(0)

FfileuploadAdaptUnifileService 附件上传服务

  • 实现 UploadServerService,内部用统一附件的上传附件接口处理

FfilepreviewAdaptUnifileService 附件预览服务

  • 内部用统一附件的预览附件接口处理
方法参数返回含义
previewFileinfo:UploadFile 附件信息Promise<{}>预览单个附件
previewFileListinfos:UploadFile[] 附件信息Promise<{}>预览多个附件
downloadFileinfos:UploadFile 附件信息void打开窗口下载附件

FFilePreviewAdaptUnifileDirective 附件预览指令

  • 指令 fFilePreviewAdaptUnifile
  • 监听事件 filePreviewEvent,绑定预览服务中预览接口
  • 监听事件 fileDownloadEvent,绑定预览服务中下载接口
  • 配合预览组件
    <f-file-preview [fileInfos]="fileInfos" fFilePreviewAdaptUnifile></f-file-preview>

This library was generated with Angular CLI version 7.2.0.

Code scaffolding

Run ng generate component component-name --project ffileupload-adapt-unifile to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ffileupload-adapt-unifile.

Note: Don't forget to add --project ffileupload-adapt-unifile or else it will be added to the default project in your angular.json file.

Build

Run ng build ffileupload-adapt-unifile to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build ffileupload-adapt-unifile, go to the dist folder cd dist/ffileupload-adapt-unifile and run npm publish.

Running unit tests

Run ng test ffileupload-adapt-unifile to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

0.2.9

3 months ago

0.2.8

5 months ago

0.2.7

8 months ago

0.2.6

9 months ago

0.2.5

10 months ago

0.2.3

1 year ago

0.2.4

12 months ago

0.2.1

1 year ago

0.2.0

2 years ago

0.2.2

1 year ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago