feat(#14): Wire manual buy/sell to the mammon acquire/consume endpoints
This commit is contained in:
@@ -3,7 +3,6 @@ import {SliderCheckbox} from '@/components';
|
||||
import {SortableHeader, useSort, VirtualScrollTable} from '@/components/table';
|
||||
import {formatIsk, percentFormater} from "@/formaters";
|
||||
import {MarketTrend, MarketTrendIcon, MarketTrends, MarketType, MarketTypeLabel, TrendFilter} from "@/market";
|
||||
import {ShoppingCartIcon} from '@heroicons/vue/24/outline';
|
||||
import {useStorage} from '@vueuse/core';
|
||||
import {computed, ref} from 'vue';
|
||||
import {useAcquiredTypesStore} from '../acquisition';
|
||||
@@ -31,10 +30,6 @@ interface Props {
|
||||
ignoredColums?: string[] | string;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'buy', type: MarketType, buy: number, sell: number): void;
|
||||
}
|
||||
|
||||
const scoreFormater = new Intl.NumberFormat("en-US", {
|
||||
maximumFractionDigits: 0
|
||||
});
|
||||
@@ -47,7 +42,6 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
infoOnly: false,
|
||||
ignoredColums: () => []
|
||||
});
|
||||
defineEmits<Emits>();
|
||||
|
||||
const acquiredTypesStore = useAcquiredTypesStore();
|
||||
|
||||
@@ -59,14 +53,9 @@ const trackedTrends = useStorage<MarketTrend[]>('market-scan-trends', [
|
||||
MarketTrends.Flat,
|
||||
MarketTrends.Down,
|
||||
]);
|
||||
const columnsToIgnore = computed(() => {
|
||||
const ic = typeof props.ignoredColums === 'string' ? [props.ignoredColums] : props.ignoredColums;
|
||||
|
||||
if (props.infoOnly && !ic.includes('buttons')) {
|
||||
return [...ic, 'buttons'];
|
||||
}
|
||||
return ic;
|
||||
});
|
||||
const columnsToIgnore = computed(() =>
|
||||
typeof props.ignoredColums === 'string' ? [props.ignoredColums] : props.ignoredColums
|
||||
);
|
||||
const { sortedArray, headerProps, showColumn } = useSort<Result>(computed(() => props.items
|
||||
.filter(r => r.type.name.toLowerCase().includes(filter.value.toLowerCase()))
|
||||
.filter(r => trackedTrends.value.includes(r.trend))
|
||||
@@ -142,7 +131,6 @@ const getLineColor = (result: Result) => {
|
||||
<SortableHeader v-bind="headerProps" sortKey="profit">Profit</SortableHeader>
|
||||
<SortableHeader v-bind="headerProps" sortKey="score">Score</SortableHeader>
|
||||
<SortableHeader v-bind="headerProps" sortKey="acquisitions">Acquisitions</SortableHeader>
|
||||
<SortableHeader v-bind="headerProps" sortKey="buttons" unsortable />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -162,9 +150,6 @@ const getLineColor = (result: Result) => {
|
||||
<td v-if="showColumn('profit')" class="text-right">{{ percentFormater.format(r.data.profit) }}</td>
|
||||
<td v-if="showColumn('score')" class="text-right">{{ scoreFormater.format(r.data.score) }}</td>
|
||||
<td v-if="showColumn('acquisitions')" class="text-right">{{ r.data.acquisitions }}</td>
|
||||
<td v-if="showColumn('buttons')" class="text-right">
|
||||
<button class="btn-icon me-1" title="Add acquisitions" @click="$emit('buy', r.data.type, r.data.buy, r.data.sell)"><ShoppingCartIcon /></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user