npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@farris/extend-fileupload-adapt-unifile

v0.3.1

Published

Farris附件上传组件适配统一附件

Downloads

66

Readme

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 统一附件配置(接口)

  • 定义统一附件上传到服务器端的参数

| 属性 | 类型 | 含义 | | :----- | :----- | :-------------------------------- | | rootId | string | 按照目录上传或预览,目录 id | | formId | string | 按照表单上传或预览,表单 id | | mode | number | 上传模式:正式上传(1),临时上传(0) |

FFileUploadAdaptUnifileConfigService 统一附件配置服务

  • 处理模块级别的默认参数设置

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

FfileuploadAdaptUnifileService 附件上传服务

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

FfilepreviewAdaptUnifileService 附件预览服务

  • 内部用统一附件的预览附件接口处理

| 方法 | 参数 | 返回 | 含义 | | :-------------- | :-------------------------- | :---------- | :--------------- | | previewFile | info:UploadFile 附件信息 | Promise<{}> | 预览单个附件 | | previewFileList | infos:UploadFile[] 附件信息 | Promise<{}> | 预览多个附件 | | downloadFile | infos: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.