report-export

    1.0.1 • Public • Published

    用于报表下载的koa中间件

    Installation

    $ npm install --save report-export

    Usage:

    // router
    const downloadMiddleware = require('report-export')
     
    router.get('/download', downloadMiddleware.reportDownload(), downloadController)
     
    // Controller
    const filename = 'filename'
    const tableHeader = ['title1', "title2"]
    const rowList = [['data', "data"], ['data', "data"]]
    const format = 'xlsx' // or 'csv' or 'json'
    ctx.state.$reportConfig = {filename, tableHeader, rowList, format}

    License

    MIT

    Keywords

    Install

    npm i report-export

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    28.8 kB

    Total Files

    12

    Last publish

    Collaborators

    • backcj