若依集成积木报表

本文档介绍了如何在项目中集成积木报表,包括在pom.xml中引入最新依赖,设置RuoYiApplication的扫描目录,配置SecurityConfig以允许匿名访问,以及在Vue前端中配置菜单和iframe来展示报表。此外,还提供了当遇到404错误或静态资源加载失败时,可能需要在nginx中进行的配置调整。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

        <!--积木报表依赖-->
        <dependency>
            <groupId>org.jeecgframework.jimureport</groupId>
            <artifactId>jimureport-spring-boot-starter</artifactId>
            <version>1.4.4-beta</version>
        </dependency>

2、RuoYiApplication添加积木扫描目录

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

3、SecurityConfig拦截排除

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

4、vue配置

  1. 菜单配置:常规的页面路由配置
    在这里插入图片描述
    在这里插入图片描述

  2. 添加的页面

<template>
  <div v-loading="loading" :style="'height:'+ height">
    <iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
  </div>
</template>
<script>
  export default {
    name: "Ureport",
    data() {
      return {
      	//src: "http://localhost:8088/jmreport/list", (本地测试用这个地址)
        src: process.env.VUE_APP_BASE_API + "/jmreport/list",//(部署到服务器上用这个地址)
        height: document.documentElement.clientHeight - 94.5 + "px;",
        loading: true
      };
    },
    mounted: function() {
      setTimeout(() => {
        this.loading = false;
      }, 230);
      const that = this;
      window.onresize = function temp() {
        that.height = document.documentElement.clientHeight - 94.5 + "px;";
      };
    }
  };
</script>

在这里插入图片描述

5、如果访问404 。或者静态页面加载失败

可能是nginx需要配置

#给静态资源(js、css等)请求配置实际路由
  location /jmreport {
    proxy_pass http://localhost:8088/jmreport;
    #proxy_redirect off;
    proxy_set_header Host $proxy_host;
    #proxy_set_header X-Real-IP $remote_addr;
    #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #proxy_set_header   Cookie $http_cookie;
  }
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

_____shen静冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值