eladmin集成JimuBI大屏
1、eladmin项目目录
2、执行初始化脚本积木报表sql
3、pom中引入积木BI大屏最新依赖
支持SpringBoot2脚手架项目,需要springboot3依赖的请查看文档。
注意:使用积木BI大屏需要引入积木报表,集成积木报表
<!-- 积木报表 -->
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId>
<version>1.9.3</version>
</dependency>
<!-- 积木BI大屏 -->
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimubi-spring-boot-starter</artifactId>
<version>1.9.3</version>
<exclusions>
<!--排除swagger-->
<exclusion>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
最新版本可以从 http://jimureport.com/doc/log 中查询到
4、AppRun添加积木依赖扫描
@SpringBootApplication(scanBasePackages = {"me.zhengjie","org.jeecg"})
5、实现扩展接口
@Service
public class OnlDragExternalServiceImpl implements IOnlDragExternalService {
}
此处很重要,请参考JeecgBoot集成扩展实现:
6、RedisConfig配置类注入jmRedisTemplate
1.9.0及1.9.0以后版本不需要添加此配置类,1.9.0以前版本需要添加此配置类,否则会影响项目正常启动
@Bean("jmRedisTemplate")
public RedisTemplate<String, Object> stringRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
//序列化
FastJsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class);
// value值的序列化采用fastJsonRedisSerializer
template.setValueSerializer(fastJsonRedisSerializer);
template.setHashValueSerializer(fastJsonRedisSerializer);
// fastjson 升级到 1.2.83 后需要指定序列化白名单
ParserConfig.getGlobalInstance().addAccept("org.jeecg.modules.drag");
// key的序列化采用StringRedisSerializer
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());
template.setConnectionFactory(connectionFactory);
return template;
}
7、SpringSecurityConfig权限控制放开
1)需要把/jimureport和/drag请求放开
//过滤掉积木报表和仪表盘请求路径
.antMatchers("/jmreport/**","/drag/**","/jimubi/**").permitAll()
2)在
ConfigurerAdapter
配置类中添加仪表盘的静态资源访问路径
registry.addResourceHandler("/drag/**").addResourceLocations("classpath:/static/drag/").setCachePeriod(0);
8、dev.yml添加minidao配置(可忽略)
#持久层框架
minidao:
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
9、集成积木权限(操作角色、操作权限)
为了安全积木针对敏感接口,加了角色注解和权限注解,你需要显示的配置角色和权限,才能访问某些功能。
具体对接请仔细阅读文档 集成积木权限
10、项目启动访问
eladmin默认端口8000
http://localhost:8000/drag/list