Files
guilixu-admin/.workbuddy/memory/2026-07-08.md
赵忠林 4154260331 fix(shop): 修正路由路径和修复弹窗关闭按钮错位
- 将所有 '/shopOrder' 路径修正为 '/shop/shopOrder' 以保持路由一致性
- 将优惠券使用路径从 '/shopGoodsCoupon' 改为 '/market/coupon'
- 修改今日统计数据 salesAmount 类型从字符串改为数字
- 在用户状态管理中添加额外菜单项 '/shop/shopExpressTemplateDetail',仅注册路由不显示侧边栏
- 修复 ant-modal 关闭按钮内部 span 尺寸,解决图标偏移和缩小问题
- 在样式文件末尾添加 .ant-modal-close-x 的宽高和行高样式并加 !important 覆盖默认样式
2026-07-09 12:20:19 +08:00

57 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2026-07-08 工作日志
## 完善运费模板配送区域功能
### 改造内容
1. **模板列表页** (`shopExpressTemplate/index.vue`)
- 操作列增加"配送区域"链接,点击跳转到 `shopExpressTemplateDetail?templateId=xxx&title=xxx&type=xxx`
- 操作列宽度从 140 调整为 200
2. **配送区域页面** (`shopExpressTemplateDetail/index.vue`)
- 读取路由参数 `templateId`/`title`/`type`,页面标题显示"模板名称 - 配送区域"
- 数据源自动按 `templateId` 过滤
- 移除"所属模板ID"和"计费方式"列
- 省份/城市列合并为"配送地区"列,显示地区名称(通过 regions-data.json 建立 ID→名称映射
-`templateId``templateType` 给编辑组件
3. **搜索组件** (`shopExpressTemplateDetail/components/search.vue`)
- 移除模板ID搜索框仅保留添加/批量删除按钮
4. **编辑表单** (`shopExpressTemplateDetail/components/shopExpressTemplateDetailEdit.vue`)
-`RegionsSelect` 级联选择器provinceCity 模式)替换省份/城市的 `a-input-number`
- 移除"所属模板"下拉选择(由路由参数确定)
- 移除"计费方式"radio从父模板继承
- 标签根据 `templateType` 动态显示"首件数量"或"首重重量"
- 保存时自动填充 `templateId``type`
- 编辑回显时将 provinceId/cityId 数字转回字符串数组给级联选择器
### 技术要点
- `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 iconwidth/height 决定其容器大小