rework buttons
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { ArrowPathIcon } from '@heroicons/vue/24/outline';
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { MarketOrderHistory, MarketResult, getHistory, jitaId } from ".";
|
||||
@@ -44,16 +43,15 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-2 mb-2 mt-4">
|
||||
<div class="grid mb-2 mt-4">
|
||||
<div class="w-auto">
|
||||
<span>Item: </span>
|
||||
<input type="text" class="w-96" v-model="item" @keyup.enter="addItem" />
|
||||
<button class="justify-self-end ms-2" @click="addItem">Add</button>
|
||||
</div>
|
||||
<button class="justify-self-end flex" @click="reloadAll"><ArrowPathIcon class="h-6 w-6 me-2" />Reload all</button>
|
||||
</div>
|
||||
<template v-if="items.length > 0">
|
||||
<hr />
|
||||
<MarketReultTable :items="items" @relaod="type => addOrRelaod(type)" />
|
||||
<MarketReultTable :items="items" @relaod="type => addOrRelaod(type)" @relaodAll="reloadAll" />
|
||||
</template>
|
||||
</template>
|
||||
@@ -14,6 +14,7 @@ interface Props {
|
||||
|
||||
interface Emits {
|
||||
(e: 'relaod', type: MarketType): void;
|
||||
(e: 'relaodAll'): void;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -44,13 +45,20 @@ const { sortedArray, headerProps } = useSort(computed(() => props.items
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-1 mb-2 mt-4 ms-auto">
|
||||
<div class="flex">
|
||||
<div class="flex justify-self-end mb-2 mt-4 ms-auto">
|
||||
<div class="justify-self-end ms-2">
|
||||
<span>Days: </span>
|
||||
<input type="number" min="1" max="365" step="1" v-model="days" />
|
||||
<span class="ms-2">Filter: </span>
|
||||
</div>
|
||||
<div class="justify-self-end ms-2">
|
||||
<span>Filter: </span>
|
||||
<input type="text" class="w-96" v-model="filter" >
|
||||
</div>
|
||||
<div class="justify-self-end ms-2">
|
||||
<button class="flex" @click="$emit('relaodAll')"><ArrowPathIcon class="h-6 w-6 me-2" />Reload all</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
@@ -13,7 +13,7 @@ export type MarketType = {
|
||||
portionSize: number;
|
||||
}
|
||||
|
||||
export const getMarketType = async (type: string | number): Promise<MarketType> => (await getMarketTypes(type))[0];
|
||||
export const getMarketType = async (type: string | number): Promise<MarketType> => (await getMarketTypes([type]))[0];
|
||||
export const getMarketTypes = async (types: (string | number)[]): Promise<MarketType[]> => {
|
||||
if (types.length === 0) {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user