参考:

https://help.jeecg.com/jimureport/projectJoin/ruoyivue.html

2、执行初始化脚本积木报表sql

jimureport.sql

3、pom中引入积木报表最新依赖

springboot2

<dependency>
  <groupId>org.jeecgframework.jimureport</groupId>
  <artifactId>jimureport-spring-boot-starter</artifactId>
  <version>${version}</version>
</dependency>

springboot3

<dependency>
    <groupId>org.jeecgframework.jimureport</groupId>
    <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>
    <version>${version}</version>
</dependency>

最新版本可以从 http://jimureport.com/doc/log 中查询到

4、RuoYiApplication添加积木扫描目录

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

5、SecurityConfig拦截排除

目录在ruoyi-framework

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

7、启动项目访问

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

注意:需要通过后台接口地址访问

注意

  1. dev环境:由于走的是后端接口,所以假如是开发端,也可以通过localhost/dev-api/jmreport/list访问,后端是localhost:8080/jmreport/list
  2. prod环境:此时和dev环境类似,只是把dev-api换成prod-api,但是可能产生js访问404的情况,因为理论上要通过prod-api/js/xxx,但是他默认的js路径就是/js/xxx,所以导致会被vue拦截,从而访问不到真正的js,所以需要采用nginx进行配置:

img

    location /jmreport/{

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://127.0.0.1:8089/prod-api/jmreport/;
        proxy_set_header Host $host;
        proxy_read_timeout 300s;
   }

详见issue:

https://github.com/jeecgboot/JimuReport/issues/1327

https://github.com/jeecgboot/JimuReport/issues/242

https://github.com/jeecgboot/JimuReport/issues/2808