feat: 套装方案对比与导出功能 #32
@@ -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
|
||||
})
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user