From 981765e4bba0176440ae13beb97351d8a4dab7fc Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Mon, 13 Apr 2026 23:12:37 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A5=97=E8=A3=85=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=A0=87=E7=AD=BE=E5=88=97=EF=BC=8C=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E5=AF=B9=E6=AF=94=E6=8C=89=E5=8F=AF=E5=81=9A=E5=A5=97?= =?UTF-8?q?=E8=A3=85=E6=95=B0=E4=BB=8E=E5=B0=91=E5=88=B0=E5=A4=9A=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/composables/useKitCost.js | 8 +++++++- frontend/src/views/KitExport.vue | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) 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) }}