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配置
-
菜单配置:常规的页面路由配置
-
添加的页面
<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;
}