fix: 套装对比去掉标签列,横向对比按可做套装数从少到多排序
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 16s
Test / e2e-test (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 23:12:37 +00:00
parent 8600f16cea
commit 981765e4bb
2 changed files with 7 additions and 3 deletions

View File

@@ -119,7 +119,13 @@ export function useKitCost() {
costs, // { aroma: 12.3, family: null, home3988: 10.8, full: 9.5 }
})
}
rows.sort((a, b) => a.name.localeCompare(b.name, 'zh'))
// Sort by number of kits that can make the recipe (fewest first), then by name
rows.sort((a, b) => {
const aCount = Object.values(a.costs).filter(v => v != null).length
const bCount = Object.values(b.costs).filter(v => v != null).length
if (aCount !== bCount) return aCount - bCount
return a.name.localeCompare(b.name, 'zh')
})
return rows
})

View File

@@ -39,7 +39,6 @@
<thead>
<tr>
<th class="th-name">配方名</th>
<th class="th-tags">标签</th>
<th class="th-cost">套装成本</th>
<th class="th-cost">原价成本</th>
<th class="th-price">售价</th>
@@ -49,7 +48,6 @@
<tbody>
<tr v-for="r in activeKitData.recipes" :key="r._id">
<td class="td-name">{{ r.name }}</td>
<td class="td-tags">{{ (r.tags || []).join('/') }}</td>
<td class="td-cost">{{ fmtPrice(r.kitCost) }}</td>
<td class="td-cost original">{{ fmtPrice(r.originalCost) }}</td>
<td class="td-price">