New eveal #32
@@ -17,7 +17,7 @@ const open = ref(false);
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
const quartiles = computedAsync<HistoryQuartiles | null>(
|
const quartiles = computedAsync<HistoryQuartiles | null>(
|
||||||
() => open.value && props.id ? getQuartiles(props.id) : null,
|
() => props.id ? getQuartiles(props.id) : null,
|
||||||
null,
|
null,
|
||||||
loading,
|
loading,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,3 +14,12 @@ defineProps<Props>();
|
|||||||
<ArrowTrendingDownIcon v-else-if="trend === MarketTrends.Down" />
|
<ArrowTrendingDownIcon v-else-if="trend === MarketTrends.Down" />
|
||||||
<ArrowLongRightIcon v-else />
|
<ArrowLongRightIcon v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
@reference "@/style.css";
|
||||||
|
|
||||||
|
svg {
|
||||||
|
@apply w-6 h-6;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import {SliderCheckbox} from '@/components';
|
import {SliderCheckbox} from '@/components';
|
||||||
import {SortableHeader, useSort, VirtualScrollTable} from '@/components/table';
|
import {SortableHeader, useSort, VirtualScrollTable} from '@/components/table';
|
||||||
import {formatIsk, percentFormater} from "@/formaters";
|
import {formatIsk, percentFormater} from "@/formaters";
|
||||||
import {MarketType, MarketTypeLabel} from "@/market";
|
import {MarketTrend, MarketTrendIcon, MarketType, MarketTypeLabel} from "@/market";
|
||||||
import {ShoppingCartIcon} from '@heroicons/vue/24/outline';
|
import {ShoppingCartIcon} from '@heroicons/vue/24/outline';
|
||||||
import {useStorage} from '@vueuse/core';
|
import {useStorage} from '@vueuse/core';
|
||||||
import {computed, ref} from 'vue';
|
import {computed, ref} from 'vue';
|
||||||
@@ -22,6 +22,7 @@ type Result = {
|
|||||||
acquisitions: number;
|
acquisitions: number;
|
||||||
profit: number;
|
profit: number;
|
||||||
score: number;
|
score: number;
|
||||||
|
trend: MarketTrend;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -80,7 +81,8 @@ const { sortedArray, headerProps, showColumn } = useSort<Result>(computed(() =>
|
|||||||
totalVolume: r.totalVolume,
|
totalVolume: r.totalVolume,
|
||||||
acquisitions,
|
acquisitions,
|
||||||
profit: r.profit,
|
profit: r.profit,
|
||||||
score: r.score
|
score: r.score,
|
||||||
|
trend: r.trend,
|
||||||
};
|
};
|
||||||
}).filter(r => !onlyCheap.value || (r.buy <= r.q1 && r.profit >= (threshold.value / 100)))), {
|
}).filter(r => !onlyCheap.value || (r.buy <= r.q1 && r.profit >= (threshold.value / 100)))), {
|
||||||
defaultSortKey: 'score',
|
defaultSortKey: 'score',
|
||||||
@@ -137,7 +139,10 @@ const getLineColor = (result: Result) => {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="r in list" :key="r.data.typeID" :class="getLineColor(r.data)">
|
<tr v-for="r in list" :key="r.data.typeID" :class="getLineColor(r.data)">
|
||||||
<td v-if="showColumn('name')">
|
<td v-if="showColumn('name')">
|
||||||
|
<div class="flex">
|
||||||
<MarketTypeLabel :id="r.data.typeID" :name="r.data.name" />
|
<MarketTypeLabel :id="r.data.typeID" :name="r.data.name" />
|
||||||
|
<MarketTrendIcon class="ms-auto" :trend="r.data.trend" />
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td v-if="showColumn('buy')" class="text-right">{{ formatIsk(r.data.buy) }}</td>
|
<td v-if="showColumn('buy')" class="text-right">{{ formatIsk(r.data.buy) }}</td>
|
||||||
<td v-if="showColumn('sell')" class="text-right">{{ formatIsk(r.data.sell) }}</td>
|
<td v-if="showColumn('sell')" class="text-right">{{ formatIsk(r.data.sell) }}</td>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { MarketType } from "@/market";
|
import {MarketTrend, MarketType} from "@/market";
|
||||||
import { MarketScanResponse } from "@/generated/mammon";
|
import {MarketScanResponse} from "@/generated/mammon";
|
||||||
|
|
||||||
export type ScanResult = {
|
export type ScanResult = {
|
||||||
type: MarketType;
|
type: MarketType;
|
||||||
@@ -11,6 +11,7 @@ export type ScanResult = {
|
|||||||
totalVolume: number;
|
totalVolume: number;
|
||||||
profit: number;
|
profit: number;
|
||||||
score: number;
|
score: number;
|
||||||
|
trend: MarketTrend;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const toScanResult = (res: MarketScanResponse, type: MarketType): ScanResult => ({
|
export const toScanResult = (res: MarketScanResponse, type: MarketType): ScanResult => ({
|
||||||
@@ -23,4 +24,5 @@ export const toScanResult = (res: MarketScanResponse, type: MarketType): ScanRes
|
|||||||
totalVolume: res.totalVolume,
|
totalVolume: res.totalVolume,
|
||||||
profit: res.profit,
|
profit: res.profit,
|
||||||
score: res.score,
|
score: res.score,
|
||||||
|
trend: res.trend,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user