若依集成积木报表

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

        
        <dependency>
            <groupId>org.jeecgframework.jimureportgroupId>
            <artifactId>jimureport-spring-boot-starterartifactId>
            <version>1.4.4-betaversion>
        dependency>

2、RuoYiApplication添加积木扫描目录

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

3、SecurityConfig拦截排除

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

4、vue配置

  1. 菜单配置:常规的页面路由配置
    若依集成积木报表_第1张图片
    若依集成积木报表_第2张图片

  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>

若依集成积木报表_第3张图片

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

你可能感兴趣的:(若依,vue.js,前端,javascript)