diff --git a/src/features/fio/components/FIOBurnPlanTable.vue b/src/features/fio/components/FIOBurnPlanTable.vue index c1c7b541b..22100e5cd 100644 --- a/src/features/fio/components/FIOBurnPlanTable.vue +++ b/src/features/fio/components/FIOBurnPlanTable.vue @@ -5,14 +5,17 @@ const { t } = useI18n(); // Composables - import { usePlanetData } from "@/database/services/usePlanetData"; import { usePreferences } from "@/features/preferences/usePreferences"; - const { getBurnDisplayClass } = usePreferences(); - const { planetName } = usePlanetData(); + const { getBurnDisplayClass, burnDaysRed, burnDaysYellow } = + usePreferences(); + + // Components + import MaterialTile from "@/features/material_tile/components/MaterialTile.vue"; // Util import { formatNumber } from "@/util/numbers"; + import { burnAxisMax, burnSummary } from "@/features/fio/fioBurn.util"; // Types & Interfaces import type { IFIOBurnPlanetTableElement } from "@/features/fio/useFIOBurn.types"; @@ -20,6 +23,7 @@ // UI import { PDataTable } from "@/ui"; + import PStripPlot from "@/ui/charts/PStripPlot.vue"; defineProps({ planTable: { @@ -28,6 +32,8 @@ }, }); + const axis = computed(() => burnAxisMax(burnDaysYellow.value)); + const columns = computed[]>( () => [ { @@ -35,10 +41,12 @@ title: t("fio.burn.components.overview.table.plan"), // by the name shown, not the id sorter: (a, b) => a.planName.localeCompare(b.planName), + minWidth: 120, }, { - key: "planetId", - title: t("fio.burn.components.overview.table.planet"), + key: "strip", + title: t("fio.burn.components.overview.table.strip"), + minWidth: 180, }, { key: "minDays", @@ -47,28 +55,96 @@ }, ] ); + + // "1 red · 2 yellow · 10 materials", zero counts left out + function summary(row: IFIOBurnPlanetTableElement): string[] { + const s = burnSummary( + row.burnMaterials, + burnDaysRed.value, + burnDaysYellow.value + ); + const prefix = "fio.burn.components.overview.summary"; + return [ + s.red ? t(`${prefix}.red`, { n: s.red }) : "", + s.yellow ? t(`${prefix}.yellow`, { n: s.yellow }) : "", + t(`${prefix}.materials`, s.consumed), + ].filter(Boolean); + } + + const stripItems = (row: IFIOBurnPlanetTableElement) => + row.burnMaterials.map((m) => ({ key: m.ticker, value: m.exhaustion }));