add markup columns
This commit is contained in:
@@ -146,6 +146,7 @@
|
||||
<tr class="border-b border-gray-700 bg-gray-700/30">
|
||||
<th class="text-left px-4 py-2 text-gray-400 font-semibold uppercase tracking-wider">Journal</th>
|
||||
<th class="text-right px-4 py-2 text-gray-400 font-semibold uppercase tracking-wider">Qty</th>
|
||||
<th class="text-right px-4 py-2 text-gray-400 font-semibold uppercase tracking-wider">Total Fame</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -161,6 +162,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-1.5 text-right font-mono text-gray-200 font-medium">{{ row.journals.toLocaleString() }}</td>
|
||||
<td class="px-4 py-1.5 text-right font-mono text-gray-300">{{ row.totalFame.toLocaleString() }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -206,6 +208,7 @@ import { useProductionOrder } from '../composables/useProductionOrder'
|
||||
import { useAlbionPrices } from '../composables/useAlbionPrices'
|
||||
import { useFilters } from '../composables/useFilters'
|
||||
import { formatSilver, formatItemId, formatLastUpdated, tierStyle, itemImageUrl } from '../utils/formatting'
|
||||
import { fameTypeOf, craftsPerJournal } from '../data/constants'
|
||||
import type { Tier, JournalType } from '../types/crafting'
|
||||
|
||||
const vFocus = { mounted: (el: HTMLElement) => el.focus() }
|
||||
@@ -257,9 +260,6 @@ function priceTitle(itemId: string, currentPrice: number): string {
|
||||
return exact ? `${exact} — click to set price` : 'Click to set price'
|
||||
}
|
||||
|
||||
// Laborer journal fills ≈ 13 crafts per book (ratio is constant across tiers)
|
||||
const CRAFTS_PER_JOURNAL = 13
|
||||
|
||||
const JOURNAL_DISPLAY_NAME: Record<JournalType, string> = {
|
||||
warrior: "Blacksmith's",
|
||||
hunter: "Fletcher's",
|
||||
@@ -344,11 +344,12 @@ const totals = computed(() => {
|
||||
})
|
||||
|
||||
const journalRows = computed(() => {
|
||||
const map = new Map<string, { journalType: JournalType; tier: Tier; crafts: number }>()
|
||||
const map = new Map<string, { journalType: JournalType; tier: Tier; journalFills: number; totalFame: number }>()
|
||||
for (const { recipe, qty } of orderItems.value) {
|
||||
const key = `${recipe.journalType}::${recipe.tier}`
|
||||
const cur = map.get(key) ?? { journalType: recipe.journalType, tier: recipe.tier as Tier, crafts: 0 }
|
||||
map.set(key, { ...cur, crafts: cur.crafts + qty })
|
||||
const cur = map.get(key) ?? { journalType: recipe.journalType, tier: recipe.tier as Tier, journalFills: 0, totalFame: 0 }
|
||||
const fills = qty / craftsPerJournal(fameTypeOf(recipe.outputItemId), recipe.enchantment)
|
||||
map.set(key, { ...cur, journalFills: cur.journalFills + fills, totalFame: cur.totalFame + recipe.famePerCraft * qty })
|
||||
}
|
||||
|
||||
return [...map.values()]
|
||||
@@ -356,7 +357,7 @@ const journalRows = computed(() => {
|
||||
.map(row => ({
|
||||
...row,
|
||||
journalName: JOURNAL_DISPLAY_NAME[row.journalType],
|
||||
journals: Math.ceil(row.crafts / CRAFTS_PER_JOURNAL),
|
||||
journals: Math.ceil(row.journalFills),
|
||||
journalImgUrl: itemImageUrl(`T${row.tier}_${JOURNAL_ITEM_ID[row.journalType]}`),
|
||||
}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user