cache history

This commit is contained in:
2023-09-15 18:32:47 +02:00
parent 018e59a492
commit 5c84af12ea
7 changed files with 74 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
import { formatIsk, percentFormater } from '@/formaters';
import { SortableHeader, useSort } from '@/table';
import { copyToClipboard } from '@/utils';
import { ArrowPathIcon } from '@heroicons/vue/24/outline';
import { computed } from 'vue';
import { MarketResult } from ".";
import { MarketTypeLabel } from "./type";
@@ -10,9 +11,15 @@ interface Props {
result?: MarketResult[];
}
interface Emits {
(e: 'relaod', typeID: number): void;
}
const props = withDefaults(defineProps<Props>(), {
result: () => []
});
defineEmits<Emits>();
const { sortedArray, headerProps } = useSort(computed(() => props.result.map(r => ({
typeID: r.type.id,
name: r.type.name,
@@ -24,7 +31,6 @@ const { sortedArray, headerProps } = useSort(computed(() => props.result.map(r =
defaultSortKey: 'name',
defaultSortDirection: 'asc'
})
</script>
<template>
@@ -37,6 +43,7 @@ const { sortedArray, headerProps } = useSort(computed(() => props.result.map(r =
<SortableHeader v-bind="headerProps" sortKey="median">Median</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="q3">Q3</SortableHeader>
<SortableHeader v-bind="headerProps" sortKey="percent">Percent</SortableHeader>
<th></th>
</tr>
</thead>
<tbody>
@@ -48,6 +55,9 @@ const { sortedArray, headerProps } = useSort(computed(() => props.result.map(r =
<td class="text-right">{{ formatIsk(r.mmedian) }}</td>
<td class="text-right">{{ formatIsk(r.q3) }}</td>
<td class="text-right">{{ percentFormater.format(r.percent) }}</td>
<td class="text-right">
<button class="p-0 border-none bg-transparent" @click="$emit('relaod', r.typeID)"><ArrowPathIcon class="h-6 w-6" /></button>
</td>
</tr>
</tbody>
</table>