fix(consignment): 待匹配看板同分按系列/钻石/璀璨优先排序

- 同分时按 系列 → 钻石 → 璀璨 的字段命中状态分层,避免枪型冲突的组合压过枪型相同的高配组合
- 前端不再按 score 二次重排,保留后端的优先级顺序
- 补充同分排序单元测试,分数口径保持不变
This commit is contained in:
2026-11-15 13:50:09 +08:00
parent 2f03b96634
commit a3462605c7
4 changed files with 161 additions and 6 deletions
@@ -72,11 +72,9 @@ export default function ConsignmentPendingMatchModal({
retry: false,
})
const data = query.data?.data
// 后端已按分数降序;这里再按打分排一次,保证调整排序口径时界面始终一致。
const pairs = useMemo(
() => [...(data?.pairs || [])].sort((left, right) => right.score - left.score),
[data?.pairs],
)
// 后端已按「分数 + 系列/钻石/璀璨优先级」排好序;这里必须保持原顺序,
// 否则同分项会被重排回默认序,枪型匹配的候选反而沉底。
const pairs = useMemo(() => data?.pairs || [], [data?.pairs])
const columns: TableColumnsType<PendingPistolMatchPair> = [
{
@@ -47,7 +47,10 @@ test('一键查询待匹配订单:默认展示全部配对并按打分降序',
assert.ok(source.includes('includeConflicts: true'), '默认必须包含冲突(0 分)配对')
assert.ok(!source.includes('显示 0 分不匹配项'), '旧的勾选框必须删除')
assert.ok(source.includes('right.score - left.score'), '配对必须按打分从高到低排列')
assert.ok(
!source.includes('right.score - left.score'),
'不得在前端只按分数重排,否则会覆盖后端的「系列/钻石/璀璨」优先级',
)
assert.ok(source.includes('不匹配 {data?.conflictCount ?? 0}'), '必须展示不匹配数量')
assert.ok(source.includes('默认展示全部配对(含不匹配项)'), '界面必须说明默认口径')
})