From 41542603315a036998863299e913d014c4b4a8f8 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, 9 Jul 2026 12:20:19 +0800
Subject: [PATCH] =?UTF-8?q?fix(shop):=20=E4=BF=AE=E6=AD=A3=E8=B7=AF?=
=?UTF-8?q?=E7=94=B1=E8=B7=AF=E5=BE=84=E5=92=8C=E4=BF=AE=E5=A4=8D=E5=BC=B9?=
=?UTF-8?q?=E7=AA=97=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E9=94=99=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将所有 '/shopOrder' 路径修正为 '/shop/shopOrder' 以保持路由一致性
- 将优惠券使用路径从 '/shopGoodsCoupon' 改为 '/market/coupon'
- 修改今日统计数据 salesAmount 类型从字符串改为数字
- 在用户状态管理中添加额外菜单项 '/shop/shopExpressTemplateDetail',仅注册路由不显示侧边栏
- 修复 ant-modal 关闭按钮内部 span 尺寸,解决图标偏移和缩小问题
- 在样式文件末尾添加 .ant-modal-close-x 的宽高和行高样式并加 !important 覆盖默认样式
---
.workbuddy/memory/2026-07-08.md | 25 +++++++++++++++++++++++++
src/store/modules/user.ts | 10 +++++++++-
src/styles/component.less | 7 +++++++
src/views/shop/dashboard/index.vue | 22 +++++++++++-----------
4 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/.workbuddy/memory/2026-07-08.md b/.workbuddy/memory/2026-07-08.md
index 9a89a20..a103047 100644
--- a/.workbuddy/memory/2026-07-08.md
+++ b/.workbuddy/memory/2026-07-08.md
@@ -29,3 +29,28 @@
- `RegionsSelect` 组件位于 `src/components/RegionsSelect/`,数据源为 `public/json/regions-data.json`
- 级联选择器 value 是字符串数组(如 `["110000", "110100"]`),需与 model 的 number 类型互转
- 路由路径 `/shop/shopExpressTemplateDetail` 依赖后端菜单配置,如不一致需调整
+
+## 修复 ant-modal 关闭按钮错位
+
+### 问题
+弹窗的 X 关闭按钮 X 图标位置偏移/缩小,看起来像悬空在弹窗头部外。
+
+### 根因
+- `src/styles/component.less` 之前覆盖了 `.ant-modal-close` 为 30x30px
+- 但 `ele-admin-pro/es/style/common.less` 第 468 行设置内部 span `.ant-modal-close-x` 为 54x54px
+- 按钮 30x30 装着 54x54 的内容 + 22px lineHeight,导致 X 图标向上溢出
+
+### 修复
+在 `src/styles/component.less` 末尾添加:
+```less
+.ant-modal-close-x {
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 30px !important;
+}
+```
+让内部 span 尺寸与按钮一致,X 图标正常居中。
+
+### 技术要点
+- antd CSS-in-JS 用 `:where(...)` 包裹,特异性为 0/2/0,需用 `!important` 覆盖
+- `.ant-modal-close-x` 内部包含 CloseOutlined icon,width/height 决定其容器大小
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 18055c7..deaa774 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -12,7 +12,15 @@ import { clone } from '@/api/system/menu';
import { message } from 'ant-design-vue/es';
import { logout } from '@/utils/page-tab-util';
// import { isExternalLink } from 'ele-admin-pro';
-const EXTRA_MENUS: any = [];
+// 额外菜单:仅注册路由,不在侧边栏显示
+const EXTRA_MENUS: any = [
+ {
+ path: '/shop/shopExpressTemplateDetail',
+ component: 'shop/shopExpressTemplateDetail',
+ title: '配送区域',
+ hide: 1
+ }
+];
export interface UserState {
info: User | null;
diff --git a/src/styles/component.less b/src/styles/component.less
index 893d1ca..1881a4c 100644
--- a/src/styles/component.less
+++ b/src/styles/component.less
@@ -118,3 +118,10 @@
align-items: center;
justify-content: center;
}
+
+/* 修复关闭按钮内部 span 尺寸与按钮不一致导致的图标错位 */
+.ant-modal-close-x {
+ width: 30px !important;
+ height: 30px !important;
+ line-height: 30px !important;
+}
diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue
index c90cc44..ff6c7d9 100644
--- a/src/views/shop/dashboard/index.vue
+++ b/src/views/shop/dashboard/index.vue
@@ -176,7 +176,7 @@
参数配置
-
+
订单管理
@@ -205,7 +205,7 @@