initila commit

This commit is contained in:
2023-07-26 09:26:55 +02:00
commit 1b208b2ff6
21 changed files with 2524 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<script setup lang="ts">
import { iskFormat } from '@/utils';
import { ref } from 'vue';
import ReprocessInput from './ReprocessInput.vue';
import { ReprocessItemValues, reprocess } from './reprocess';
const items = ref("");
const minerals = ref("");
const efficiency = ref(0.55);
const result = ref<ReprocessItemValues[]>([]);
const send = async () => result.value = await reprocess(items.value, minerals.value, efficiency.value);
</script>
<template>
<div class="grid mb-2 mt-4 px-4">
<div class="justify-self-end">
<span>Reprocess efficiency: </span>
<input type="number" min="0" max="1" step="0.05" class="border rounded" v-model="efficiency" />
</div>
</div>
<div class="flex items-stretch px-4">
<ReprocessInput name="Item JSON" v-model="items" />
<ReprocessInput name="Mineral JSON" v-model="minerals" />
</div>
<div class="grid mt-2 px-4">
<button class="py-0.5 px-2 justify-self-end border rounded bg-slate-200" @click="send">Send</button>
</div>
<div class="grid mt-2 px-4">
<table v-if="result.length > 0" class="table-auto border-collapse border w-full">
<thead>
<tr>
<th class="border bg-slate-200">Item</th>
<th class="border bg-slate-200">buy</th>
<th class="border bg-slate-200">buy reprocess</th>
<th class="border bg-slate-200">sell</th>
<th class="border bg-slate-200">sell reprocess</th>
</tr>
</thead>
<tbody>
<tr v-for="r in result" :key="r.typeID">
<td class="border px-1">{{ r.typeID }}</td>
<td class="border text-right px-1">{{ iskFormat(r.buy) }}</td>
<td class="border text-right px-1">{{ iskFormat(r.buy_reprocess) }}</td>
<td class="border text-right px-1">{{ iskFormat(r.sell) }}</td>
<td class="border text-right px-1">{{ iskFormat(r.sell_reprocess) }}</td>
</tr>
</tbody>
</table>
</div>
</template>