1.导入 sql
下载地址:
https://github.com/jeecgboot/JimuReport/tree/master/db
2.引入依赖
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId>
<version>${version}</version>
</dependency>ruoyi-common/pom.xml
3.启动类添加 扫描
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class },scanBasePackages = {"org.jeecg.modules.jmreport","com.ruoyi"})
4.SecurityConfig拦截排除 和 配置minidao(可忽略)
.antMatchers("/jmreport/**").anonymous()
# 配置minidao(可忽略) minidao: base-package: org.jeecg.modules.jmreport.desreport.dao*
6.前端配置
添加目录
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>
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 = "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>
菜单配置
7.问题