From e8833b458d05a30c51fbf3d6a87e81781d417df4 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Thu, 25 Jun 2026 15:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/report-engine/report/index.ts | 53 ++ src/views/report-engine/query/index.vue | 627 ++++++++++++++++++++++++ 2 files changed, 680 insertions(+) create mode 100644 src/views/report-engine/query/index.vue diff --git a/src/api/report-engine/report/index.ts b/src/api/report-engine/report/index.ts index 57c4d03..ab7ad34 100644 --- a/src/api/report-engine/report/index.ts +++ b/src/api/report-engine/report/index.ts @@ -145,6 +145,59 @@ export function deleteReport(id: number) { }); } +/** 获取某业务下所有报表(不分页,供下拉选择) */ +export function listAllReports(businessCode: string) { + return request({ + url: '/data-engine/report/reports', + method: 'get', + params: { businessCode, pageNum: 1, pageSize: 9999 }, + }); +} + +// --- 查询相关类型 --- + +export interface ReportFilter { + fieldCode: string; + operator: string; + value: string; +} + +export interface ReportIndicator { + fieldCode: string; + aggregate: string; + alias: string; +} + +export interface ReportOrderBy { + fieldCode: string; + direction: 'ASC' | 'DESC'; +} + +export interface ReportQueryParams { + businessCode: string; + reportCode: string; + dimensions: string[]; + indicators: ReportIndicator[]; + filters: ReportFilter[]; + timeRange: { + startDate: string; + endDate: string; + }; + timeGroup: string; + orderBy: ReportOrderBy[]; + page: number; + pageSize: number; +} + +/** 数据查询 */ +export function reportQuery(data: ReportQueryParams) { + return request({ + url: '/data-engine/report/query', + method: 'post', + data, + }); +} + /** 按天回刷(支持单天或日期范围) */ export function execDailyBackfill(data: { businessCode: string; reportCode: string; startDate: string; endDate: string }) { return request({ diff --git a/src/views/report-engine/query/index.vue b/src/views/report-engine/query/index.vue new file mode 100644 index 0000000..e1ffb9f --- /dev/null +++ b/src/views/report-engine/query/index.vue @@ -0,0 +1,627 @@ + + + + + + + + + + + + + + + + + + + + + + 查询配置 + + + + + + + + + + + + + + + + + + + + + + + {{ f.fieldName || f.fieldCode }} + + + 该报表无可用的维度字段 + + + + + + + onIndicatorCheck(f.fieldCode, val)" + style="min-width: 120px" + /> + + + + + + + + + 该报表无可用的指标字段 + + + + + + + + + + + + + + + + + 添加筛选 + + + + + + + + + + + + + + + + + + 添加排序 + + + + + + 查询 + + 重置 + + + + + + + + + 查询结果(共 {{ queryResult.total }} 条) + + 数据列表 + 图表展示 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +