forked from github/dataease
Merge pull request #10511 from dataease/pr@dev-v2@feat_report
feat(XPack): 定时报告支持自定义过滤组件值
This commit is contained in:
commit
fb34d1abc8
@ -117,16 +117,6 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>io.dataease</groupId>
|
|
||||||
<artifactId>xpack-permissions</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.dataease</groupId>
|
|
||||||
<artifactId>xpack-base</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
|
@ -34,3 +34,17 @@ CREATE TABLE `core_share_ticket`
|
|||||||
`access_time` bigint DEFAULT NULL COMMENT '首次访问时间',
|
`access_time` bigint DEFAULT NULL COMMENT '首次访问时间',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) COMMENT ='分享Ticket表';
|
) COMMENT ='分享Ticket表';
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `visualization_report_filter`;
|
||||||
|
CREATE TABLE `visualization_report_filter` (
|
||||||
|
`id` bigint NOT NULL COMMENT '报告ID',
|
||||||
|
`resource_id` bigint DEFAULT NULL COMMENT '资源id',
|
||||||
|
`dv_type` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '资源类型',
|
||||||
|
`component_id` bigint DEFAULT NULL COMMENT '组件id',
|
||||||
|
`filter_id` bigint DEFAULT NULL COMMENT '过滤项id',
|
||||||
|
`filter_info` longtext COLLATE utf8mb4_general_ci COMMENT '过滤组件内容',
|
||||||
|
`filter_version` int DEFAULT NULL COMMENT '过滤组件版本',
|
||||||
|
`create_time` bigint DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`create_user` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
27
core/core-frontend/src/utils/CanvasInfoTransUtils.ts
Normal file
27
core/core-frontend/src/utils/CanvasInfoTransUtils.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { deepCopy } from '@/utils/utils'
|
||||||
|
|
||||||
|
export default function defaultConditionTrans(canvasInfo) {
|
||||||
|
const { reportFilterInfo, componentData } = canvasInfo
|
||||||
|
const componentDataArray = JSON.parse(componentData)
|
||||||
|
const allFilter = []
|
||||||
|
// 获取所有查询条件
|
||||||
|
componentDataArray.forEach(item => {
|
||||||
|
if (item.component === 'VQuery') {
|
||||||
|
Array.prototype.push.apply(allFilter, item.propValue)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const allDefaultFilter = deepCopy(allFilter)
|
||||||
|
if (reportFilterInfo) {
|
||||||
|
allFilter.forEach((itemFilter, index) => {
|
||||||
|
if (reportFilterInfo[itemFilter.id]) {
|
||||||
|
allDefaultFilter.splice(index, 1, JSON.parse(reportFilterInfo[itemFilter.id]))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
sourceFilter: allFilter,
|
||||||
|
defaultFilter: allDefaultFilter
|
||||||
|
}
|
||||||
|
}
|
18
null/VisualizationReportFilterController.java
Normal file
18
null/VisualizationReportFilterController.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package io.dataease.visualization.dao.auto.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author fit2cloud
|
||||||
|
* @since 2024-06-25
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/visualizationReportFilter")
|
||||||
|
public class VisualizationReportFilterController {
|
||||||
|
|
||||||
|
}
|
5
null/VisualizationReportFilterMapper.xml
Normal file
5
null/VisualizationReportFilterMapper.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="io.dataease.visualization.dao.auto.mapper.VisualizationReportFilterMapper">
|
||||||
|
|
||||||
|
</mapper>
|
20
null/VisualizationReportFilterServiceImpl.java
Normal file
20
null/VisualizationReportFilterServiceImpl.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package io.dataease.visualization.dao.auto.service.impl;
|
||||||
|
|
||||||
|
import io.dataease.visualization.dao.auto.entity.VisualizationReportFilter;
|
||||||
|
import io.dataease.visualization.dao.auto.mapper.VisualizationReportFilterMapper;
|
||||||
|
import io.dataease.visualization.dao.auto.service.IVisualizationReportFilterService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author fit2cloud
|
||||||
|
* @since 2024-06-25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class VisualizationReportFilterServiceImpl extends ServiceImpl<VisualizationReportFilterMapper, VisualizationReportFilter> implements IVisualizationReportFilterService {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user