当前位置:网站首页>ruoyi集成积木报表(nice)
ruoyi集成积木报表(nice)
2022-06-28 10:02:00 【周周写不完的代码】
介绍
项目中经常有报表,可视化大屏,打印这块的需求,这些手动处理会很麻烦,这次尝试用 积木报表这个组件解决
集成到若依
引入依赖,我们首先在 主Pom中做版本声明,后面我们把这个依赖放到 common 中
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId>
<version>1.5.0</version>
</dependency>
<repository>
<id>jeecg</id>
<name>jeecg Repository</name>
<url>https://maven.jeecg.org/nexus/content/repositories/jeecg</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
需要把 admin 模块中的 spring-boot-devtools 注释掉,可能会出现 aop 报错
security 中排除
.antMatchers("/jmreport/**").anonymous()
RuoYiApplication添加积木扫描目录
@SpringBootApplication(scanBasePackages = {
"org.jeecg.modules.jmreport","com.ruoyi"})
前端控制器
# 项目相关配置
ruoyi:
# 积木报表访问地址
reporturl: http://x.x.x.x:8090
配置
@RestController
@RequestMapping("/report/jimu")
public class JimuController {
@Autowired
Environment environment;
@GetMapping("/index")
@PreAuthorize("@ss.hasPermi('report:jimu:index')")
public String index(){
// String hostIp = IpUtils.getHostIp();
return environment.getProperty("ruoyi.reporturl")+"/jmreport/list";
}
@GetMapping("/view")
@PreAuthorize("@ss.hasPermi('report:jimu:view')")
public String view(){
return environment.getProperty("ruoyi.reporturl")+"/jmreport/view";
}
}
前端配置
import request from "@/utils/request";
// api 配置
// 首页
export function indexUrl(query) {
return request({
url: "/report/jimu/index",
method: "get"
});
}
// 预览
export function view(query) {
return request({
url: "/report/jimu/view",
method: "get"
});
}
// 报表设计页面 jimu.vue
<template>
</template>
<script>
// import { getToken } from '@/utils/auth'
import { indexUrl } from '@/api/tool/jimu'
export default {
name: "Jimu",
created() {
indexUrl().then(res => {
var open = window.open();
// open.location = res + "?token=" + getToken();
open.location = res
})
}
}
</script>
<style scoped>
</style>
我们这边不需要 token 校验,后续再加上
添加菜单

点击后会跳转到一个新的页面,就是我们的积木报表主页了

边栏推荐
- 第三章 栈和队列
- Sqlcmd database connection error
- 如图 用sql行转列 图一原表,图二希望转换后
- 引入 flink-sql-mysql-cdc-2.2.1 好多依赖冲突,有解决的吗?
- Day 6 script and animation system
- 2022吴恩达机器学习specialization Week 2 practice lab: Linear regression
- 适配器模式(Adapter)
- Adapter mode
- Unity AssetBundle资源打包与资源加载
- Starting from full power to accelerate brand renewal, Chang'an electric and electrification products sound the "assembly number"
猜你喜欢
Ribbon核心源码解析

如何查看谷歌浏览器保存的网页密码

Decorator

Global exception handlers and unified return results

适配器模式(Adapter)

Understand 12 convolution methods (including 1x1 convolution, transpose convolution and deep separable convolution)

组合模式(Composite Pattern)

Interface automation framework scaffolding - Implementation of parametric tools

如图 用sql行转列 图一原表,图二希望转换后

Fastposter v2.8.4 release e-commerce poster generator
随机推荐
Naming rules and specifications for identifiers
代理模式(Proxy)
云服务器MYSQL查询速度慢
【NLP】今年高考英语AI得分134,复旦武大校友这项研究有点意思
An error is reported when uninstalling Oracle
一文读懂 12种卷积方法(含1x1卷积、转置卷积和深度可分离卷积等)
用 Compose 实现个空调,为你的夏日带去清凉
Sqlcmd database connection error
HDI blind hole design, have you noticed this detail?
六月集训(第28天) —— 动态规划
Threads and processes
Function sub file writing
Restful style
纵观jBPM从jBPM3到jBPM5以及Activiti
Instant messaging and BS architecture simulation of TCP practical cases
【云驻共创】DWS告警服务DMS详细介绍和集群连接方式简介
Matplotlib属性及注解
一种跳板机的实现思路
[Unity]EBUSY: resource busy or locked
Composite pattern