tracking progress bar

This commit is contained in:
2024-06-02 16:51:06 +02:00
parent 12ad7d36ff
commit 9aa37b355e
3 changed files with 26 additions and 4 deletions
+6 -4
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Modal, ProgressBar } from "@/components";
import { MarketType, MarketTypeInput, MarketTypePrice, getHistory, getMarketTypes, useApraisalStore } from "@/market";
import { BuyModal } from '@/market/acquisition';
import { TrackingResult, TrackingResultTable, createResult, useMarketTrackingStore } from '@/market/tracking';
@@ -56,10 +57,6 @@ watch(() => marketTrackingStore.types, async t => {
const prices = await apraisalStore.getPrices(await getMarketTypes(typesToLoad));
items.value = [
...items.value
];
typesToLoad.forEach(async i => items.value.push(await createResult(i, prices.find(p => p.type.id === i) as MarketTypePrice)));
}, { immediate: true });
</script>
@@ -76,5 +73,10 @@ watch(() => marketTrackingStore.types, async t => {
<hr />
<TrackingResultTable :items="items" @buy="(type, buy, sell) => buyModal?.open(type, { 'Buy': buy, 'Sell': sell })" @remove="removeItem" />
<BuyModal ref="buyModal" />
<Modal :open="items.length > 0 && items.length < marketTrackingStore.types.length">
<div class="ms-auto me-auto mb-2 w-96">
<ProgressBar :value="items.length" :total="marketTrackingStore.types.length" />
</div>
</Modal>
</template>
</template>