From 1d69923e0675bca7e658e36c6ba029486adb1df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 16 Jul 2026 21:25:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor(shop-dashboard):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E5=90=8E=E5=8F=B0Dashboard=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=8F=8A=E9=9D=A2=E6=9D=BF=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 基本信息面板改为左右两列并排显示,响应式列数调整为2列 - 今日数据概况与基本信息合并至同一行,分别占用半宽空间 - 今日数据概况面板栅格调整为2列,样式和间距优化 - 删除快捷操作面板及相关图标导入和缓存清理功能 - 快速入口功能调整为动态渲染卡片布局取代原按键列表 - 优化部分样式,如待办任务列表的内边距和字体大小调整 - 头像显示增加默认图片占位,避免空白显示 --- .workbuddy/memory/2026-07-16.md | 17 +++ src/views/shop/dashboard/index.vue | 228 +++++++++++------------------ 2 files changed, 103 insertions(+), 142 deletions(-) diff --git a/.workbuddy/memory/2026-07-16.md b/.workbuddy/memory/2026-07-16.md index f042e97..cc1254a 100644 --- a/.workbuddy/memory/2026-07-16.md +++ b/.workbuddy/memory/2026-07-16.md @@ -29,3 +29,20 @@ 1. 后端:`cd /Users/gxwebsoft/JAVA/websopy-java && git push`,然后远程服务器 `git pull && mvn clean package -DskipTests && docker-compose up -d --build cms-api`(或对应重启方式)。 2. 小程序端:`websopy-taro` 重新编译上传体验版/正式版。 3. 联调验证:admin 点"立即续费" → 弹码 → 微信扫码 → 进小程序应显示"确认支付"页(不再误显成功)→ 点"立即支付" → 微信支付 → 显示"支付成功" → 跳转 `/user/apps/index`。 + +## 商城后台 Dashboard 布局调整 + +- 文件:`src/views/shop/dashboard/index.vue` +- 需求:今日数据概况页,「基本信息」改为左右两列并排;删除「快捷操作」面板。 +- 改动: + - `a-descriptions` 由 `:column="1"` 改为 `:column="{ xs: 1, sm: 2 }"`(响应式两列并排)。 + - 基本信息 `a-col` 由 `:span="12"` 改为 `:span="24"`(占满整行)。 + - 删除「快捷操作」`a-col` 整块,并清理其专属的图标导入(ShoppingCartOutlined/ShopOutlined/AppstoreOutlined/GiftOutlined/TeamOutlined/SettingOutlined/ClearOutlined)、`removeSiteInfoCache` 导入及 `handleClearCache` 函数。 + +### 今日数据概况 + 基本信息改为左右两栏布局 + +- 需求:参考「待处理事项 + 快速入口」的左右结构,将「今日数据概况」和「基本信息」也并排为左右各半。 +- 改动: + - 原来各自独占整行的两个 panel,合并到一个 `` 中,各占 `:md="12"`。 + - 今日数据概况栅格从 4 列改为 2 列(`grid-template-columns: repeat(2, 1fr)`),适配半宽空间。 + - 基本信息 `a-descriptions` 列数改为 `:column="1"`,半宽下单列更不拥挤。 diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue index 9f876c0..c6289ee 100644 --- a/src/views/shop/dashboard/index.vue +++ b/src/views/shop/dashboard/index.vue @@ -4,7 +4,7 @@
- {{ siteStore.statusText || '正常' }} 刷新数据 @@ -64,11 +63,11 @@
@@ -80,82 +79,63 @@
-
- 🎉 暂无待处理事项,一切正常! -
+ + +
- +
- ⚡ 快速入口 + 📊 今日数据概况
-
-
-
- {{ item.icon }} - +
+
+
💰
+
+
{{ formatMoney(todayStats.salesAmount) }}
+
今日销售额(元)
+
-
{{ item.label }}
+
+
📦
+
+
{{ todayStats.orderCount || 0 }}
+
今日订单数
+
+
+
+
👥
+
+
{{ todayStats.newUsers || 0 }}
+
新增用户
+
+
+
+
🎁
+
+
{{ todayStats.couponUsed || 0 }}
+
使用优惠券
+
- -
-
- 📊 今日数据概况 -
-
-
-
💰
-
-
{{ formatMoney(todayStats.salesAmount) }}
-
今日销售额(元)
-
-
-
-
📦
-
-
{{ todayStats.orderCount || 0 }}
-
今日订单数
-
-
-
-
👥
-
-
{{ todayStats.newUsers || 0 }}
-
新增用户
-
-
-
-
🎁
-
-
{{ todayStats.couponUsed || 0 }}
-
使用优惠券
-
-
-
-
+ + - - - + +
📋 基本信息
-
+
- + - - {{ productStatusText.text }} + + {{ currentSubscription?.subscriptionNo || '-' }} - + @@ -184,7 +164,7 @@ - - - - + + + + + + + + + + + + + + + +
- - - -
+ + +
- ⚡ 快捷操作 + ⚡ 快速入口
-
- - - - 订单管理 - - - - 商品管理 - - - - 商品分类 - - - - 优惠券管理 - - - - 会员管理 - - - - 商城设置 - - - - 清除缓存 - - +
+
+
+ {{ item.icon }} + +
+
{{ item.label }}
+
@@ -350,13 +313,6 @@ import { useOrderNotify } from '@/views/shop/shopOrder/useOrderNotify'; import { ReloadOutlined, RightOutlined, - ShoppingCartOutlined, - ShopOutlined, - AppstoreOutlined, - GiftOutlined, - TeamOutlined, - SettingOutlined, - ClearOutlined, InfoCircleOutlined, QrcodeOutlined } from '@ant-design/icons-vue'; @@ -370,7 +326,6 @@ import { pageShopOrder } from '@/api/shop/shopOrder'; import { getShopSettingCategoryValues } from '@/api/shop/shopSetting'; import { getCompressedImageUrl } from '@/utils/image'; import { storeToRefs } from 'pinia'; -import { removeSiteInfoCache } from '@/api/cms/cmsWebsite'; import { getProductDetail } from '@/api/app/appProduct'; import type { AppProduct } from '@/api/app/appProduct/model'; import type { AppSubscription } from '@/api/app/appSubscription/model'; @@ -769,17 +724,6 @@ const formatMoney = (value?: number | string) => { return Number.isFinite(num) ? num.toFixed(2) : '0.00'; }; -// 清除缓存 -const handleClearCache = () => { - removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId')).then( - (msg) => { - if (msg) { - message.success(msg); - } - } - ); -}; - // 新订单声音提醒(全局单例:轮询由 layout 启动,此处仅消费状态 + UI) const { enabled: notifyEnabled, hasNewOrder, toggle: onNotifyToggle, testNotify: onTestNotify } = useOrderNotify({ onNewOrder: () => loadData() @@ -971,7 +915,7 @@ onUnmounted(() => { .panel-title { font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.85); } /* 待办 */ -.todo-list { padding: 8px 0; } +.todo-list { padding: 2px 0; } .todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; transition: background 0.15s; @@ -1029,9 +973,9 @@ onUnmounted(() => { /* 今日数据 */ .today-stats { display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 16px; - padding: 20px; + grid-template-columns: repeat(2, 1fr); + gap: 12px; + padding: 16px; } .today-stat { display: flex;