tg app fix sizes
This commit is contained in:
@@ -3,16 +3,17 @@
|
||||
|
||||
import {RecurrentOperation} from "@/models/recurrent-operation";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {recurrentsService} from "@/services/recurrents-service";
|
||||
import {useSpaceStore} from "@/stores/spaceStore";
|
||||
import {useToast} from "primevue/usetoast";
|
||||
import {Divider} from "primevue";
|
||||
import {Category} from "@/models/category";
|
||||
import {useRouter} from "vue-router";
|
||||
import {useToolbarStore} from "@/stores/toolbar-store";
|
||||
import {useRecurrentsStore} from "@/stores/recurrent-store";
|
||||
|
||||
const toolbar = useToolbarStore()
|
||||
const spaceStore = useSpaceStore();
|
||||
const recurrentsStore = useRecurrentsStore();
|
||||
const toast = useToast();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -23,10 +24,8 @@ const recurrents = ref<RecurrentOperation[]>([])
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
if (spaceStore.selectedSpaceId) {
|
||||
console.log('hereeee')
|
||||
let recurrentsResponse = await recurrentsService.fetchRecurrents(spaceStore.selectedSpaceId)
|
||||
recurrents.value = recurrentsResponse
|
||||
console.log(recurrentsResponse)
|
||||
await recurrentsStore.fetchRecurrents(spaceStore.selectedSpaceId)
|
||||
recurrents.value = recurrentsStore.recurrents
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -34,7 +33,7 @@ const fetchData = async () => {
|
||||
toast.add({
|
||||
severity: 'error',
|
||||
summary: 'Failed to fetch recurrents.',
|
||||
detail: error.message
|
||||
detail: e.message
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -53,19 +52,22 @@ onMounted(async () => {
|
||||
<div class="card">
|
||||
<div v-for="key in recurrents.keys()" :key="recurrents[key].id"
|
||||
@click="router.push(`/recurrents/${recurrents[key].id}/edit`)"
|
||||
class="flex flex-col w-full gap-0 pl-5 items-start justify-items-center font-bold ">
|
||||
<div class="flex-row w-full items-center justify-between">
|
||||
<div class="flex-row items-center gap-2">
|
||||
<span class="text-4xl">{{ recurrents[key].category.icon }}</span>
|
||||
<div class="flex-col items-start">
|
||||
<div class="flex-row"> {{ recurrents[key].name }}</div>
|
||||
<div class="flex flex-row text-sm">{{ recurrents[key].category.name }}</div>
|
||||
</div>
|
||||
class="flex flex-col w-full gap- pl-5 items-start justify-items-center font-bold ">
|
||||
<div class="flex-row gap-2 w-full items-center justify-between">
|
||||
<div class="w-full flex items-center justify-between">
|
||||
<div class="flex-row items-center gap-2 ">
|
||||
<span class="text-4xl">{{ recurrents[key].category.icon }}</span>
|
||||
<div class="flex-col items-start">
|
||||
<div class="flex-row !font-bold "> {{ recurrents[key].name }}</div>
|
||||
<div class="flex flex-row text-sm">{{ recurrents[key].category.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="items-center flex-col">
|
||||
<span class="text-lg !font-semibold">{{recurrents[key].amount}}₽ </span>
|
||||
<span class="text-sm">каждое {{ recurrents[key].date }} число </span>
|
||||
|
||||
<div class="items-end flex-col">
|
||||
<span class="text-lg !font-semibold">{{ recurrents[key].amount }}₽ </span>
|
||||
<span class="text-sm">каждое {{ recurrents[key].date }} число </span>
|
||||
</div>
|
||||
</div>
|
||||
<i class="pi pi-angle-right !font-extralight"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user