Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c19236f3
authored
Aug 17, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs: 记录精品订单低价筛选参数规则
1 parent
8aaf4739
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
docs/superpowers/specs/2026-08-17-order-low-price-filter-param-design.md
docs/superpowers/specs/2026-08-17-order-low-price-filter-param-design.md
0 → 100644
View file @
c19236f
# 精品订单低价筛选参数设计
## 目标
修正订单管理“精品订单”列表中“仅查看低价订单”筛选字段的请求参数:开关开启时传
`lowPriceFlag: 1`
,关闭或重置时不传
`lowPriceFlag`
。
## 现状与根因
精品订单页面的
`searchForm.lowPriceFlag`
默认值和重置值为数字
`0`
,Element UI 开关关闭时也可能写入字符串
`"0"`
。
页面
`getParams()`
当前只清理
`null`
、空字符串和空数组,不会清理数字
`0`
或字符串
`"0"`
,所以关闭开关后仍会向后端发送
`lowPriceFlag: 0`
。
## 范围
仅修改:
-
`src/views/orderManage/order.vue`
中精品订单的低价筛选参数处理。
精品订单列表查询、累计订单金额统计和订单导出均复用
`getParams()`
,因此三类请求统一遵循本规则。
不修改:
-
权益订单页面。
-
开关展示、默认关闭状态和重置行为。
-
其他筛选字段的空值清理规则。
-
API、导出字段、审批流程和订单详情。
## 参数规则
| 表单值 | 请求参数 |
| --- | --- |
| 数字
`1`
|
`lowPriceFlag: 1`
|
| 字符串
`"1"`
|
`lowPriceFlag: 1`
|
| 数字
`0`
| 不传
`lowPriceFlag`
|
| 字符串
`"0"`
| 不传
`lowPriceFlag`
|
| 空值或其他值 | 不传
`lowPriceFlag`
|
## 实现方案
在精品订单
`getParams()`
克隆表单后,对
`lowPriceFlag`
做字段级显式处理:
-
`Number(params.lowPriceFlag) === 1`
时规范为数字
`1`
。
-
其他情况删除
`params.lowPriceFlag`
。
不修改通用空值清理循环,避免误删其他业务上有意义的数字
`0`
。
## 测试与验收
-
直接测试精品订单组件真实的
`getParams()`
。
-
覆盖数字/字符串的开启和关闭值,以及默认关闭、重置后的典型值。
-
确认开启结果固定为数字
`1`
,关闭结果不存在
`lowPriceFlag`
属性。
-
运行订单管理相关单元测试、全量单元测试和修改文件 ESLint。
## 风险
本次只改变请求参数是否包含
`lowPriceFlag`
,不改变页面状态。由于列表、统计和导出共用
`getParams()`
,三者会同时修正;如果后端曾依赖关闭时显式接收
`0`
,行为会改变,但这正是本次确认的接口契约。
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment