feat:【mall 商城】商品统计【ele】100%:迁移完成

This commit is contained in:
YunaiV
2025-10-20 09:51:31 +08:00
parent 12075acefa
commit faa4a9140d
6 changed files with 32 additions and 28 deletions

View File

@@ -23,7 +23,6 @@ export namespace SystemUserApi {
/** 查询用户管理列表 */ /** 查询用户管理列表 */
export function getUserPage(params: PageParam) { export function getUserPage(params: PageParam) {
debugger
return requestClient.get<PageResult<SystemUserApi.User>>( return requestClient.get<PageResult<SystemUserApi.User>>(
'/system/user/page', '/system/user/page',
{ params }, { params },

View File

@@ -41,14 +41,14 @@ export namespace MallProductStatisticsApi {
} }
/** 获得商品统计分析 */ /** 获得商品统计分析 */
export function getProductStatisticsAnalyse(params: PageParam) { export function getProductStatisticsAnalyse(params: any) {
return requestClient.get< return requestClient.get<
DataComparisonRespVO<MallProductStatisticsApi.ProductStatistics> DataComparisonRespVO<MallProductStatisticsApi.ProductStatistics>
>('/statistics/product/analyse', { params }); >('/statistics/product/analyse', { params });
} }
/** 获得商品状况明细 */ /** 获得商品状况明细 */
export function getProductStatisticsList(params: PageParam) { export function getProductStatisticsList(params: any) {
return requestClient.get<MallProductStatisticsApi.ProductStatistics[]>( return requestClient.get<MallProductStatisticsApi.ProductStatistics[]>(
'/statistics/product/list', '/statistics/product/list',
{ params }, { params },
@@ -56,7 +56,7 @@ export function getProductStatisticsList(params: PageParam) {
} }
/** 导出获得商品状况明细 Excel */ /** 导出获得商品状况明细 Excel */
export function exportProductStatisticsExcel(params: PageParam) { export function exportProductStatisticsExcel(params: any) {
return requestClient.download('/statistics/product/export-excel', { params }); return requestClient.download('/statistics/product/export-excel', { params });
} }

View File

@@ -39,7 +39,8 @@ async function getMemberSexStatisticsList() {
value: userCount || 0, value: userCount || 0,
}; };
}); });
// 更新 Echarts 数据
// 渲染图表
await renderEcharts(getSexChartOptions(chartData)); await renderEcharts(getSexChartOptions(chartData));
} finally { } finally {
loading.value = false; loading.value = false;

View File

@@ -8,6 +8,8 @@ import { ref } from 'vue';
import { buildSortingField } from '@vben/request'; import { buildSortingField } from '@vben/request';
import { formatDateTime } from '@vben/utils'; import { formatDateTime } from '@vben/utils';
import { ElCard } from 'element-plus';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { useVbenVxeGrid } from '#/adapter/vxe-table';
import * as ProductStatisticsApi from '#/api/mall/statistics/product'; import * as ProductStatisticsApi from '#/api/mall/statistics/product';
import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue'; import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue';
@@ -124,7 +126,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
</script> </script>
<template> <template>
<el-card shadow="never"> <ElCard shadow="never">
<template #header> <template #header>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<span>商品排行</span> <span>商品排行</span>
@@ -132,6 +134,5 @@ const [Grid, gridApi] = useVbenVxeGrid({
</div> </div>
</template> </template>
<Grid /> <Grid />
</el-card> </ElCard>
</template> </template>

View File

@@ -19,6 +19,7 @@ import {
} from '@vben/utils'; } from '@vben/utils';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { ElButton, ElCard, ElCol, ElRow } from 'element-plus';
import * as ProductStatisticsApi from '#/api/mall/statistics/product'; import * as ProductStatisticsApi from '#/api/mall/statistics/product';
import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue'; import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue';
@@ -117,27 +118,31 @@ async function handleExport() {
</script> </script>
<template> <template>
<el-card shadow="never" class="h-full"> <ElCard shadow="never" class="h-full">
<template #header> <template #header>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<span>商品概况</span> <span>商品概况</span>
<!-- 查询条件 --> <!-- 查询条件 -->
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<ShortcutDateRangePicker @change="handleDateRangeChange"> <ShortcutDateRangePicker @change="handleDateRangeChange">
<el-button class="ml-4" @click="handleExport" :loading="exportLoading"> <ElButton
class="ml-4"
@click="handleExport"
:loading="exportLoading"
>
<template #icon> <template #icon>
<IconifyIcon icon="lucide:download" /> <IconifyIcon icon="lucide:download" />
</template> </template>
导出 导出
</el-button> </ElButton>
</ShortcutDateRangePicker> </ShortcutDateRangePicker>
</div> </div>
</div> </div>
</template> </template>
<!-- 统计值 --> <!-- 统计值 -->
<el-row :gutter="16" class="mb-4"> <ElRow :gutter="16" class="mb-4">
<el-col :xl="8" :md="8" :sm="24" class="mb-4"> <ElCol :xl="8" :md="8" :sm="24" class="mb-4">
<SummaryCard <SummaryCard
title="商品浏览量" title="商品浏览量"
tooltip="在选定条件下,所有商品详情页被访问的次数,一个人在统计时间内访问多次记为多次" tooltip="在选定条件下,所有商品详情页被访问的次数,一个人在统计时间内访问多次记为多次"
@@ -153,8 +158,8 @@ async function handleExport() {
) )
" "
/> />
</el-col> </ElCol>
<el-col :xl="8" :md="8" :sm="24" class="mb-4"> <ElCol :xl="8" :md="8" :sm="24" class="mb-4">
<SummaryCard <SummaryCard
title="商品访客数" title="商品访客数"
tooltip="在选定条件下,访问任何商品详情页的人数,一个人在统计时间范围内访问多次只记为一个" tooltip="在选定条件下,访问任何商品详情页的人数,一个人在统计时间范围内访问多次只记为一个"
@@ -170,8 +175,8 @@ async function handleExport() {
) )
" "
/> />
</el-col> </ElCol>
<el-col :xl="8" :md="8" :sm="24" class="mb-4"> <ElCol :xl="8" :md="8" :sm="24" class="mb-4">
<SummaryCard <SummaryCard
title="支付件数" title="支付件数"
tooltip="在选定条件下,成功付款订单的商品件数之和" tooltip="在选定条件下,成功付款订单的商品件数之和"
@@ -187,8 +192,8 @@ async function handleExport() {
) )
" "
/> />
</el-col> </ElCol>
<el-col :xl="8" :md="8" :sm="24" class="mb-4"> <ElCol :xl="8" :md="8" :sm="24" class="mb-4">
<SummaryCard <SummaryCard
title="支付金额" title="支付金额"
tooltip="在选定条件下,成功付款订单的商品金额之和" tooltip="在选定条件下,成功付款订单的商品金额之和"
@@ -205,8 +210,8 @@ async function handleExport() {
) )
" "
/> />
</el-col> </ElCol>
<el-col :xl="8" :md="8" :sm="24" class="mb-4"> <ElCol :xl="8" :md="8" :sm="24" class="mb-4">
<SummaryCard <SummaryCard
title="退款件数" title="退款件数"
tooltip="在选定条件下,成功退款的商品件数之和" tooltip="在选定条件下,成功退款的商品件数之和"
@@ -222,9 +227,9 @@ async function handleExport() {
) )
" "
/> />
</el-col> </ElCol>
<el-col :xl="8" :md="8" :sm="24" class="mb-4"> <ElCol :xl="8" :md="8" :sm="24" class="mb-4">
<SummaryCard <SummaryCard
title="退款金额" title="退款金额"
tooltip="在选定条件下,成功退款的商品金额之和" tooltip="在选定条件下,成功退款的商品金额之和"
@@ -243,13 +248,12 @@ async function handleExport() {
) )
" "
/> />
</el-col> </ElCol>
</el-row> </ElRow>
<!-- 折线图 --> <!-- 折线图 -->
<div v-loading="trendLoading"> <div v-loading="trendLoading">
<EchartsUI ref="chartRef" /> <EchartsUI ref="chartRef" />
</div> </div>
</el-card> </ElCard>
</template> </template>

View File

@@ -127,4 +127,3 @@ export function getProductSummaryChartOptions(data: any[]): any {
], ],
}; };
} }