1.0.6 • Published 3 years ago

visual-report v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

本地locastorage需要存储

- Authorization: "Bearer"+登录时的token值
- user_info: 
    {
      id: "admin",// 必须有的,该id会在后续报告发布分析时会借助此处的id作为userId参数发起请求来获取发布报告的信息
      token: 登录时的token值,
      userCode: "admin",
      username: "admin"
    }

Install

安装方法:

npm install visual-report

开始使用

    <visual-report :shareAddress="shareAddress" :editAddress="editAddress"/>
    export default {
        data(){
          return {
            shareAddress:"http://localhost:8080/dataVisualization/reportShare.html",//分享地址
            editAddress:"http://localhost:8080/dataVisualization/dashboard.html"//编辑跳转地址
          }
        },
    }

    <!-- props参数 -->
    shareAddress:报告发布的地址
    editAddress:点击编辑跳转的页面

    <!-- main.js -->
    import VisualReport from "visual-report"
    Vue.use(VisualReport)
    <!-- 此外需要额外引入elementUI -->
    import ElementUI from 'element-ui';
    import 'element-ui/lib/theme-chalk/index.css';
    Vue.use(ElementUI);

    <!-- 配置文件中加入代理 -->
    proxy: {
          '/dashboard': {
            target: 'http://sso-davin.pbe.5ireport.com:10082/dashboard',
            changeOrigin: true, 
            pathRewrite: {
              '^/dashboard': '/'
            },
            timeout: 10*1000
          },
          '/widget': {
            target: 'http://sso-davin.pbe.5ireport.com:10082/widget',
            changeOrigin: true,
            pathRewrite: {
              '^/widget': '/'
            },
            timeout: 10*1000
          },
          '/share': {
            target: 'http://sso-davin.pbe.5ireport.com:10082/share',
            changeOrigin: true,
            pathRewrite: {
              '^/share': '/'
            },
            timeout: 10*1000
          },
        }