若依集成积木报表
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