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