From 44381780a70096cd2b4211d0af20234350975f6d Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 21 May 2025 08:07:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=80=BB=E9=87=91=E9=A2=9D=E5=AD=97=E6=AE=B5=E5=B9=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=BB=9F=E8=AE=A1=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 `StatsDTO` 接口中添加 `goodsTotalAmount` 字段以支持商品总金额的统计。同时,调整 `welcome/index.vue` 中的统计展示逻辑,将待办事项改为数据统计,并新增未还统计展示。移除 `qyUser` 中未使用的 `sysUser` 字段,并添加 `roleId` 和 `roleName` 字段以支持角色信息的展示。 --- src/api/qy/qyUser.ts | 6 +++++- src/api/shop/stats.ts | 2 ++ src/views/user/qy/hook.tsx | 3 +-- src/views/welcome/index.vue | 40 ++++++++++++++++++------------------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/api/qy/qyUser.ts b/src/api/qy/qyUser.ts index 3079462..22b68b7 100644 --- a/src/api/qy/qyUser.ts +++ b/src/api/qy/qyUser.ts @@ -5,7 +5,6 @@ import { UserDTO } from "../system/user"; * 企业微信用户信息 */ export interface QyUserDTO { - sysUser?: UserDTO; /** 用户ID(导出列:用户ID) */ id?: number; /** 全局唯一ID(导出列:全局唯一ID) */ @@ -55,6 +54,10 @@ export interface QyUserDTO { appid?: string; /** 用户余额 */ balance?: number; + /** 角色id */ + roleId?: number; + /** 角色 */ + roleName?: string; } export interface QyUserQuery extends BasePageQuery { @@ -73,6 +76,7 @@ export interface AddQyUserCommand { corpid?: string; /** 用户余额 */ balance?: number; + roleId?: number; } export interface UpdateQyUserCommand extends AddQyUserCommand { diff --git a/src/api/shop/stats.ts b/src/api/shop/stats.ts index 01659b1..e45a637 100644 --- a/src/api/shop/stats.ts +++ b/src/api/shop/stats.ts @@ -46,6 +46,8 @@ export interface StatsDTO { shopCount: number; /** 商品数量 */ goodsCount: number; + /** 商品总金额 */ + goodsTotalAmount: number; /** 订单数量 */ orderCount: number; /** 总订单金额 */ diff --git a/src/views/user/qy/hook.tsx b/src/views/user/qy/hook.tsx index 5987a8c..059e9d5 100644 --- a/src/views/user/qy/hook.tsx +++ b/src/views/user/qy/hook.tsx @@ -1,8 +1,7 @@ import { QyUserDTO, QyUserQuery, - getQyUserListApi, - updateQyUserApi + getQyUserListApi } from "@/api/qy/qyUser"; import { ElMessage } from "element-plus"; import { type PaginationProps } from "@pureadmin/table"; diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index ce603f7..8769cfc 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -7,19 +7,17 @@ defineOptions({ name: "Welcome" }); -const todoItems = [ - { name: '即将到期', icon: Clock, count: 5 }, - { name: '空房管理', icon: House, count: 3 }, - { name: '低电量锁', icon: Lightning, count: 2 }, - { name: '电表离线', icon: Connection, count: 1 }, - { name: '水表离线', icon: Connection, count: 4 } -]; +const shopData = ref<{ + name: string; + icon: any; // 假设这里是 Element Plus 的图标组件 + value: number; +}[]>([ +]); -const shopData = ref([ - { name: '商店', value: 0 }, - { name: '商品', value: 0 }, - { name: '订单', value: 0 }, - { name: '总金额', value: 0 } +const unReturnedData = ref([ + { name: '未还商品', value: 0 }, + { name: '未还订单', value: 0 }, + { name: '未还金额', value: 0 } ]); const deviceData = ref([ @@ -38,10 +36,10 @@ onMounted(async () => { try { const { data } = await getStats(); shopData.value = [ - { name: '商店', value: data.shopCount }, - { name: '商品', value: data.goodsCount }, - { name: '订单', value: data.orderCount }, - { name: '总金额', value: data.orderAmountSum } + { name: '商店', icon: Clock, value: data.shopCount }, + { name: '商品', icon: House, value: data.goodsCount }, + { name: '订单', icon: Lightning, value: data.orderCount }, + { name: '总金额', icon: Connection, value: data.orderAmountSum } ]; deviceData.value = [ { name: '总柜子', value: data.cabinetCount }, @@ -67,16 +65,16 @@ onMounted(async () => {
-
待办事项
+
数据统计
- +
-
{{ item.count }}
+
{{ item.value }}
{{ item.name }}
@@ -90,11 +88,11 @@ onMounted(async () => {
-
数据统计
+
未还统计
- +
{{ item.value }}