feat(admin): full integration of order, product, and finance modules with real RPC data streams

This commit is contained in:
comlibmb
2026-02-11 16:59:38 +08:00
parent cd7b92d496
commit 7e2246fec5
33 changed files with 2535 additions and 2093 deletions

View File

@@ -149,3 +149,18 @@ export async function fetchUserBillList(
items: (data.items as Array<UserBillRecord>) ?? ([] as Array<UserBillRecord>)
} as PagedResult<UserBillRecord>
}
/**
* 获取账单汇总统计
*/
export async function fetchFinanceBillSummary(
startTime : string,
endTime : string,
interval : string = 'day'
) : Promise<Array<any>> {
return (await rpcOrEmptyArray('rpc_admin_finance_bill_summary', {
p_start_time: startTime,
p_end_time: endTime,
p_interval: interval
} as any)) as any
}

View File

@@ -50,6 +50,47 @@ export async function fetchAdminProductPage(
}
}
/**
* 获取商品状态汇总统计
*/
export async function fetchAdminProductCountStats() : Promise<UTSJSONObject | null> {
return await rpcOrNull('rpc_admin_product_count_stats', {} as UTSJSONObject)
}
/**
* 获取商品概况统计指标
*/
export async function fetchAdminProductStats(startTime : string, endTime : string) : Promise<UTSJSONObject | null> {
return await rpcOrNull('rpc_admin_product_stats', {
p_start_time: startTime,
p_end_time: endTime
} as UTSJSONObject)
}
/**
* 获取商品营业趋势数据
*/
export async function fetchAdminProductTrend(startTime : string, endTime : string) : Promise<Array<UTSJSONObject>> {
const res = await rpcOrValue('rpc_admin_product_trend', {
p_start_time: startTime,
p_end_time: endTime
} as UTSJSONObject)
return Array.isArray(res) ? (res as Array<UTSJSONObject>) : [] as Array<UTSJSONObject>
}
/**
* 获取商品排行
*/
export async function fetchAdminProductRanking(startTime : string, endTime : string, sortBy : string = 'sales', limit : number = 10) : Promise<Array<UTSJSONObject>> {
const res = await rpcOrValue('rpc_admin_product_ranking', {
p_start_time: startTime,
p_end_time: endTime,
p_sort_by: sortBy,
p_limit: limit
} as UTSJSONObject)
return Array.isArray(res) ? (res as Array<UTSJSONObject>) : [] as Array<UTSJSONObject>
}
/**
* 更新商品状态 (上架/下架/回收站)
* @param status 1:上架 2:下架 3:草稿 4:删除