1.3.0-1.7 • Published 1 month ago

@aezocn/report-table v1.3.0-1.7

Weekly downloads
-
License
AGPL
Repository
github
Last release
1 month ago

report-table 前端组件库

编辑报表(ReportTable):基于SpringBoot + Vue现实的报表模块,可进行数据增删查改等功能。

特点:

  • 简洁至上:一个SQL即可实现列表显示、导出、打印
  • 丰富功能:基于 Mybatis 语法动态配置SQL语句,支持动态按钮、动态编辑表格
  • 易扩展:支持报表邮件发送、查询条件组件自定义

详细文档更新中...

前端组件使用

  • 安装
# 安装vxe-table相关依赖
npm install vxe-table@3.6.11 xe-utils@3.1.12 -S

# 安装report-table
npm install @aezocn/report-table -S
  • 使用
// ===> 在 main.js 中引入组件库
// 全部引入
import ReportTable from '@aezocn/report-table'
import 'report-table/lib/report-table.css'

Vue.use(ReportTable, {
  VXETable: VXETable,
  XEUtils: XEUtils,
  Store: store
}, {
  // API地址,需要配合report-table后端,
  apiUrl: 'http://localhost:8080/api/report-table/',
  // 登录token名称
  accessTokenKey: 'accessToken',
  roleKey: {
    // 报表权限前缀
    prefix: 'rt.',
    // 报表管理员权限
    manager: 'rt.*'
  }
})

// ===> routers.js中增加路由
import { ReportMgr, Report } from '@aezocn/report-table'
export default [
    {
        path: '/system',
        name: 'system',
        component: Main,
        meta: {
            icon: 'md-menu',
            title: '系统管理'
        },
        children: [{
            path: 'repor-table-mgr',
            name: 'repor-table-mgr',
            meta: {
                icon: 'md-funnel',
                title: '报表管理'
            },
            component: ReportMgr
        },
        {
            path: 'report-view-preview',
            name: 'ReportViewPreview',
            meta: {
                hideInMenu: true,
                notCache: true,
                title: '动态报表预览'
            },
            component: Report
        }]
    }
]

贡献指南

# 安装环境. node: v10.24.1 (npm v6.14.12)
# 由于使用 .npmrc 指定了镜像,必须通过命令行指定镜像优先级才会高于 .npmrc
npm --registry https://registry.npm.taobao.org install
# npm --registry https://registry.npm.taobao.org install jsonlint --save
# 启动项目(实时编译)
npm run start
# ----- 实时渲染 -----
# 关联到主应用(修改此模块后,主应用实时刷新)
# 本模块执行link,将模块加入到全局
npm link
# 相关主应用执行,link此模块,unlink解除
npm link report-table
# 相关主应用发布之前需要重新安装(防止打包到link的代码)
npm i
# ----- 实时渲染 -----

# 修改版本
# 前端和后端打包的主版本尽量保持一致,如果某一端修复了bug或优化,则可发不成 x.x.x-fix.1 x.x.x-beta.1 x.x.x-release.1

# 打包
npm run build

# 基于Tag进行代码提交
git commit -am 'func|opt|fix ...'
git tag 1.0.0
git push origin 1.0.0

# 基于npm进行代码发布
npm publish --registry https://registry.npmjs.org/
# 基于github发布
./npm-publish-github.sh

# 或者直击启动测试案例
cd examples
npm run dev