feat(仪表盘): 添加未还商品、订单和金额统计功能
在仪表盘页面中新增了未还商品数量、未还订单数量和未还金额的统计显示,并更新了相关图标以提升用户体验。同时调整了布局以适应新增的数据展示。
This commit is contained in:
parent
44381780a7
commit
53efdc88b7
|
@ -62,6 +62,12 @@ export interface StatsDTO {
|
|||
unmanagedCellCount: number;
|
||||
/** 网关数量 */
|
||||
gatewayCount: number;
|
||||
/** 未还商品数量 */
|
||||
unReturnedGoodsCount: number;
|
||||
/** 未还订单数量 */
|
||||
unReturnedOrderCount: number;
|
||||
/** 未还金额 */
|
||||
unReturnedAmount: number;
|
||||
/** 热门商品列表 */
|
||||
topGoods: TopGoodsDTO[];
|
||||
/** 今日最新订单商品列表 */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { Clock, House, Lightning, Connection } from '@element-plus/icons-vue';
|
||||
import { Goods, Shop, Document, Money } from '@element-plus/icons-vue';
|
||||
import { getStats, TodayLatestOrderGoodsDTO, TopGoodsDTO } from '@/api/shop/stats';
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
|
@ -36,10 +36,15 @@ onMounted(async () => {
|
|||
try {
|
||||
const { data } = await getStats();
|
||||
shopData.value = [
|
||||
{ name: '商店', icon: Clock, value: data.shopCount },
|
||||
{ name: '商品', icon: House, value: data.goodsCount },
|
||||
{ name: '订单', icon: Lightning, value: data.orderCount },
|
||||
{ name: '总金额', icon: Connection, value: data.orderAmountSum }
|
||||
{ name: '商店', icon: Shop, value: data.shopCount },
|
||||
{ name: '商品总数量', icon: Goods, value: data.goodsCount },
|
||||
{ name: '商品总订单', icon: Document, value: data.orderCount },
|
||||
{ name: '商品总金额', icon: Money, value: data.goodsTotalAmount }
|
||||
];
|
||||
unReturnedData.value = [
|
||||
{ name: '未还商品', value: data.unReturnedGoodsCount },
|
||||
{ name: '未还订单', value: data.unReturnedOrderCount },
|
||||
{ name: '未还金额', value: data.unReturnedAmount }
|
||||
];
|
||||
deviceData.value = [
|
||||
{ name: '总柜子', value: data.cabinetCount },
|
||||
|
@ -68,7 +73,7 @@ onMounted(async () => {
|
|||
<div class="title-text">数据统计</div>
|
||||
</div>
|
||||
<el-row :gutter="12" class="todo-section">
|
||||
<el-col :span="4" v-for="item in shopData" :key="item.name">
|
||||
<el-col :span="6" v-for="item in shopData" :key="item.name">
|
||||
<el-card shadow="never" class="todo-card">
|
||||
<div class="todo-content">
|
||||
<el-icon :size="30" class="todo-icon">
|
||||
|
@ -92,7 +97,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
<el-row :gutter="12" class="data-section">
|
||||
<!-- 商店数据 -->
|
||||
<el-col :span="5" v-for="item in unReturnedData" :key="item.name">
|
||||
<el-col :span="8" v-for="item in unReturnedData" :key="item.name">
|
||||
<el-card shadow="never" :body-style="{ padding: ' 20px 0' }" class="todo-card">
|
||||
<div class="todo-content">
|
||||
<div class="todo-count">{{ item.value }}</div>
|
||||
|
|
Loading…
Reference in New Issue