当前位置:   article > 正文

若依集成积木报表

若依集成积木报表

若依集成积木报表

1、后端配置

1.1 项目结构

在这里插入图片描述

1.2 引入sql文件

1.3 pom中引入积木报表依赖

<dependency>
  <groupId>org.jeecgframework.jimureport</groupId>
  <artifactId>jimureport-spring-boot-starter</artifactId>
  <version>${version}</version>
</dependency>
  • 1
  • 2
  • 3
  • 4
  • 5

最新版本可以从 http://jimureport.com/doc/log 中查询到
备注:在admin的pom文件中引入

1.4 RuoYiApplication添加积木扫描目录

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class },scanBasePackages = {"org.jeecg.modules.jmreport","com.ruoyi"})
  • 1

在这里插入图片描述

1.5 SecurityConfig拦截排除

目录在ruoyi-framework

.antMatchers("/jmreport/**").anonymous()
  • 1

在这里插入图片描述

1.6 启动项目访问

若依默认端口是8080,可以根据自己的需求集成到若依系统里面(如集成到菜单)
积木报表访问地址:http://localhost:8080/jmreport/list
在这里插入图片描述

2、前端配置

2.1 前端代码

在这里插入图片描述

2.1.1 jimu.vue

用于展示积木报表的在线设计器

<template>
    <i-frame :src="openUrl" id="jimuReportFrame"></i-frame>
  </template>
  <script>
    import iFrame from '@/components/iFrame/index'
    export default {
      name: "Jimu",
      components: {iFrame},
      data() {
        return {
        //   openUrl: process.env.VUE_APP_BASE_API + "/jmreport/list" //(部署到服务器上用这个地址)
          openUrl:  "http://localhost:8080/jmreport/list" //(部署到服务器上用这个地址)
        };
      },
      mounted: function() {
  
      }
    };
  </script>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
2.1.2 view.vue

用于显示制作的报表

<template>
    <i-frame :src="openUrl" />
  </template>
   
  <script>
  import iFrame from "@/components/iFrame/index";
   
  export default {
    name: 'jimuview',
    components: { iFrame },
    props: {
      reportID: {
        type: [String],
        required: false,
        default: ''
      },
    },
    data() {
      return {
        openUrl: '',
      }
    },
    created() {
    //   if(this.reportID.length != 0){
    //     this.openUrl = process.env.VUE_APP_BASE_API + '/jove-report/jmreport/view/' + this.reportID
    //   }else{
    //     this.openUrl = process.env.VUE_APP_BASE_API + '/jove-report/jmreport/view/' + this.$route.path.substring(this.$route.path.lastIndexOf("/")+1)
    //   }

    if(this.reportID.length != 0){
        this.openUrl = "http://localhost:8080" + '/jmreport/view/' + this.reportID
      }else{
        this.openUrl = "http://localhost:8080" + '/jmreport/view/' + this.$route.path.substring(this.$route.path.lastIndexOf("/")+1)
      }
      
    }
  }
  </script>
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

2.2 前端菜单配置

2.2.1 设计器

在这里插入图片描述

2.2.2 报表页面

在这里插入图片描述
注意:红框为报表预览时的id
在这里插入图片描述

参考链接:
https://blog.csdn.net/athwang/article/details/127218202
https://help.jeecg.com/jimureport/projectJoin/ruoyivue.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/735115
推荐阅读
相关标签
  

闽ICP备14008679号