New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ts-bi

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-bi

bi组件库

latest
npmnpm
Version
0.1.13
Version published
Weekly downloads
17
-22.73%
Maintainers
1
Weekly downloads
 
Created
Source

vue

环境准备

vue2.0

第三方引用

npm install ts-bi

main.js中注册

import tsBi from 'ts-bi';
import 'ts-bi/lib/style/index.css'
Vue.use(tsBi, { store });

引入编辑设计区

  • 引入设计列表模块
<template>
   <biEditor></biEditor>
</template>
  • 预览右上角显示设计按钮:引入预览时,传biOutDesign参数,点击设计可直达设计区

引入渲染功能

新建一个biPreview.vue文件,页面路径为:views/bi/biPreview.vue,路径必须严格遵守,不然将无法渲染 页面内容如下:

<template>
  <div
    class="height100"
  >
      <!--页面设计器 -->
      <biPreviewForm
        :params="params"
        :key="'page'+ new Date()"
        :isFromPreview="true"
      ></biPreviewForm>
  </div>
</template>
<script>
export default {
  name: 'biPreview',
  components: {
  },
  data: function() {
    return {
      show: true,
      params: {}
    }
  },
  created() {
    this.params = this.paramsFn()
  },
  mounted() {
  },
  methods: {
    // 地址参数获取
    paramsFn() {
      if (this.$route.query && this.$route.query.mid) {
        // 门户或者自定义报表或物理单表
        return {
          id: this.$route.path.substring(14),
          type: this.$route.query.type
        }
      }
      return { id: '' }
    }
  },
  watch: {
    $route(to, from) {
      let fromId =
        from.path &&
        from.path.indexOf('/bi/biPreview_') == 0 ?from.path.substring(14)
          : ''
      if (fromId) {
        // 删除跳转走后的页面内容
        let biPreviewMap = { ...this.$store.state.biPreviewMap }
        delete biPreviewMap[fromId]
        this.$store.commit('setAllBiPreviewMap', { ...biPreviewMap })
      }
      this.params = this.paramsFn()
    }
  }
}
</script>

引入报表中心

<template>
   <formCenterGrid></formCenterGrid>
</template>

FAQs

Package last updated on 02 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts