若依集成积木报表

若依集成积木报表

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>

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

1.4 RuoYiApplication添加积木扫描目录

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

在这里插入图片描述

1.5 SecurityConfig拦截排除

目录在ruoyi-framework

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

在这里插入图片描述

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>
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>
  

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

  • 10
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值