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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@steedos/plugin-jsreport

v2.1.39

Published

Steedos Jsreport报表插件

Downloads

297

Readme

Steedos Jsreport报表插件

WEB界面及接口路由

yml配置的报表相关路由

  • /plugins/jsreport/web/ #报表浏览界面,显示yml配置的报表列表,点击查看报表明细
  • /plugins/jsreport/web/viewer/:id #查看yml配置中的报表详细
  • /plugins/jsreport/api/report/:report_id/pdf #导出yml配置中的报表为PDF
  • /plugins/jsreport/api/report/:report_id/excel #导出yml配置中的报表为Excel

数据库中的报表相关路由

  • /plugins/jsreport/web/viewer_db/:id #查看db中的报表详细
  • /plugins/jsreport/api/report_db/:report_id/pdf #导出db中的报表为PDF
  • /plugins/jsreport/api/report_db/:report_id/excel #导出db中的报表为Excel

开发说明

安装依赖包

$ yarn

运行

$ yarn start

访问地址: http://localhost:3600/plugins/jsreport/web/

插件使用

...
let app = express();
...
plugin.init(app);
...

参考:https://github.com/steedos/steedos-plugin-jsreport/blob/master/server.js

Example:https://github.com/steedos/steedos-contracts-app/blob/master/server.js

插件配置

  • 插件会自动加载src文件夹中以report.yml后缀且其内容中report_type为'jsreport'的报表文件
  • 识别到的报表会自动生成对应的以report.html后缀的文件
  • 识别到的报表会自动生成对应的以report.js后缀的文件
  • 可以在xxx.report.html文件中编写报表界面效果,模板语法见:http://handlebarsjs.com
  • 可以在xxx.report.helper.js文件中编写html对应的模板脚本,参考:https://jsreport.net/learn/handlebars
  • 可以在xxx.report.script.js文件中编写报表加载相关脚本,参考:https://jsreport.net/learn/scripts
  • 可以在项目根目录下新建jsreport.config.json文件来配置jsreport相关行为,参考:https://jsreport.net/learn/configuration

xxx.report.script.js文件中如果想使用require引用第三方包,比如想require('request'),则需要在jsreport.config.json文件中配置以下参数。

也可以直接配置参数允许所有本地包:extensions.scripts.allowedModules="*" or using config allowLocalFilesAccess=true

{
  "extensions": {
    "scripts": {
      "allowedModules": ["request"]
    }
  }
}

参考:https://github.com/steedos/steedos-plugin-jsreport/blob/master/src/contracts.report.yml

Example:https://github.com/steedos/steedos-contracts-app/blob/master/src/contracts-jsr.report.yml