Acquisitions in typeinfo

This commit is contained in:
2024-05-18 00:15:02 +02:00
parent 78c96f8bce
commit 5887ecb638
2 changed files with 28 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ type Result = {
interface Props {
items?: AcquiredType[];
infoOnly?: boolean;
}
interface Emits {
@@ -30,7 +31,8 @@ interface Emits {
}
const props = withDefaults(defineProps<Props>(), {
items: () => []
items: () => [],
infoOnly: false
});
defineEmits<Emits>();
@@ -69,7 +71,7 @@ const getLineColor = (result: Result) => {
</script>
<template>
<div class="flex">
<div class="flex" v-if="!infoOnly">
<div class="flex justify-self-end mb-2 mt-4 ms-auto">
<TaxInput />
<div class="end">
@@ -92,7 +94,7 @@ const getLineColor = (result: Result) => {
<SortableHeader v-bind="headerProps" sortKey="count">Bought Amount</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="precentProfit">Profit (%)</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="iskProfit">Profit (ISK)</SortableHeader>
<th></th>
<th v-if="!infoOnly"></th>
</tr>
</thead>
<tbody>
@@ -109,7 +111,7 @@ const getLineColor = (result: Result) => {
<td class="text-right">{{ r.count }}</td>
<td class="text-right">{{ percentFormater.format(r.precentProfit) }}</td>
<td class="text-right">{{ formatIsk(r.iskProfit) }}</td>
<td class="text-right">
<td class="text-right" v-if="!infoOnly">
<button class="btn-icon me-1" @click="$emit('buy', r.type, r.price, r.buy, r.sell)"><PlusIcon /></button>
<button class="btn-icon me-1" @click="$emit('sell', r.type)"><MinusIcon /></button>
</td>