diff --git a/frontend/src/composables/useKitCost.js b/frontend/src/composables/useKitCost.js index cab8061..cd63ef0 100644 --- a/frontend/src/composables/useKitCost.js +++ b/frontend/src/composables/useKitCost.js @@ -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 }) diff --git a/frontend/src/views/KitExport.vue b/frontend/src/views/KitExport.vue index aaa7702..1dc89dc 100644 --- a/frontend/src/views/KitExport.vue +++ b/frontend/src/views/KitExport.vue @@ -39,7 +39,6 @@ 配方名 - 标签 套装成本 原价成本 售价 @@ -49,7 +48,6 @@ {{ r.name }} - {{ (r.tags || []).join('/') }} {{ fmtPrice(r.kitCost) }} {{ fmtPrice(r.originalCost) }}