mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 19:09:19 +08:00
feat: 完成工作台页的后端接口实现和前端对接
This commit is contained in:
@@ -244,4 +244,12 @@ export namespace CompanyOverviewVO {
|
||||
/** 各品类汇总列表 */
|
||||
categories: CategorySummary[];
|
||||
}
|
||||
|
||||
/** 工作台底部四张汇总表(与全店概览同源字段) */
|
||||
export interface WorkbenchTableBundle {
|
||||
shopTable?: ShopOverview | null;
|
||||
platformTable?: PlatformOverview | null;
|
||||
categoryTable?: CategoryOverview | null;
|
||||
productTable?: CategoryOverview | null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { WorkbenchDTO, WorkbenchVO } from './types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 工作台一次聚合:经营概览 + 多维 + 排行 */
|
||||
export async function getWorkbenchSummaryApi(data: WorkbenchDTO.Query) {
|
||||
return requestClient.post<WorkbenchVO.Info>('/ec/workbench/summary', data);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './apis';
|
||||
export * from './types';
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './types.dto';
|
||||
export * from './types.vo';
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 工作台查询 DTO(与后端 WorkbenchQueryDTO 对齐)
|
||||
*/
|
||||
export namespace WorkbenchDTO {
|
||||
export interface Query {
|
||||
/** 日期范围 [开始, 结束],单元素表示当天 */
|
||||
dateRange: string[];
|
||||
/** 税率,默认 0.04 */
|
||||
taxRate?: number;
|
||||
/** 平台 ID,不传表示全平台 */
|
||||
platformId?: number;
|
||||
/** 店铺 ID,不传表示当前筛选下全部门店 */
|
||||
shopId?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* 工作台聚合 VO(与后端 Workbench*VO 对齐)
|
||||
*/
|
||||
import type { CompanyOverviewVO } from '#/api/ecommerce/store-overview/types';
|
||||
|
||||
export namespace WorkbenchVO {
|
||||
export interface DimRow {
|
||||
key: string;
|
||||
name: string;
|
||||
gmvWan?: number;
|
||||
grossProfitWan?: number;
|
||||
netProfitWan?: number;
|
||||
refundWan?: number;
|
||||
grossMarginPct?: number;
|
||||
netMarginPct?: number;
|
||||
}
|
||||
|
||||
export interface KpiItem {
|
||||
label: string;
|
||||
value: string;
|
||||
unit: string;
|
||||
changePct?: number;
|
||||
up?: boolean;
|
||||
sub?: string;
|
||||
}
|
||||
|
||||
export interface TrendPoint {
|
||||
date: string;
|
||||
gmv?: number;
|
||||
profit?: number;
|
||||
refund?: number;
|
||||
}
|
||||
|
||||
export interface CostSlice {
|
||||
name: string;
|
||||
value?: number;
|
||||
pct?: number;
|
||||
}
|
||||
|
||||
export interface FinancePanel {
|
||||
kpis: KpiItem[];
|
||||
gmvTrend: TrendPoint[];
|
||||
costStructure: CostSlice[];
|
||||
}
|
||||
|
||||
export interface MultiPanel {
|
||||
platform: DimRow[];
|
||||
shop: DimRow[];
|
||||
category: DimRow[];
|
||||
product: DimRow[];
|
||||
}
|
||||
|
||||
export interface Info {
|
||||
finance: FinancePanel;
|
||||
multiAnalysis: MultiPanel;
|
||||
salesRank: MultiPanel;
|
||||
/** 底部四表:与全店概览同源(税额、ROI、推广/刷单、目标等) */
|
||||
summaryTables?: CompanyOverviewVO.WorkbenchTableBundle | null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user