feat: 添加商品总金额字段并调整统计展示
在 `StatsDTO` 接口中添加 `goodsTotalAmount` 字段以支持商品总金额的统计。同时,调整 `welcome/index.vue` 中的统计展示逻辑,将待办事项改为数据统计,并新增未还统计展示。移除 `qyUser` 中未使用的 `sysUser` 字段,并添加 `roleId` 和 `roleName` 字段以支持角色信息的展示。
This commit is contained in:
parent
e1888f55d4
commit
44381780a7
|
@ -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 {
|
||||
|
|
|
@ -46,6 +46,8 @@ export interface StatsDTO {
|
|||
shopCount: number;
|
||||
/** 商品数量 */
|
||||
goodsCount: number;
|
||||
/** 商品总金额 */
|
||||
goodsTotalAmount: number;
|
||||
/** 订单数量 */
|
||||
orderCount: number;
|
||||
/** 总订单金额 */
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 () => {
|
|||
<div class="section-container todo-container">
|
||||
<div class="section-title">
|
||||
<div class="title-bar"></div>
|
||||
<div class="title-text">待办事项</div>
|
||||
<div class="title-text">数据统计</div>
|
||||
</div>
|
||||
<el-row :gutter="12" class="todo-section">
|
||||
<el-col :span="4" v-for="item in todoItems" :key="item.name">
|
||||
<el-col :span="4" 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">
|
||||
<component :is="item.icon" />
|
||||
</el-icon>
|
||||
<div class="todo-count">{{ item.count }}</div>
|
||||
<div class="todo-count">{{ item.value }}</div>
|
||||
<div class="todo-name">{{ item.name }}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -90,11 +88,11 @@ onMounted(async () => {
|
|||
<div class="section-container shop-container">
|
||||
<div class="section-title">
|
||||
<div class="title-bar"></div>
|
||||
<div class="title-text">数据统计</div>
|
||||
<div class="title-text">未还统计</div>
|
||||
</div>
|
||||
<el-row :gutter="12" class="data-section">
|
||||
<!-- 商店数据 -->
|
||||
<el-col :span="5" v-for="item in shopData" :key="item.name">
|
||||
<el-col :span="5" 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