fix
This commit is contained in:
@@ -15,9 +15,6 @@
|
||||
<script setup lang="ts">
|
||||
import MenuBar from "./components/MenuBar.vue";
|
||||
import OverlayView from "@/components/OverlayView.vue";
|
||||
import axios from "@/plugins/axios";
|
||||
|
||||
console.log(axios)
|
||||
|
||||
// @Options({
|
||||
// components: {
|
||||
|
||||
@@ -85,11 +85,11 @@ onMounted(() => {
|
||||
/>
|
||||
|
||||
<SpeedDial :model="items" :radius="120" type="quarter" direction="up"
|
||||
class=" mb-10 h-fit" :style="{ position: 'fixed', right: 0, bottom: 0 }"
|
||||
class=" mb-10 h-fit !items-end me-10" :style="{ position: 'fixed', right: 0, bottom: 0 }"
|
||||
pt:menuitem="m-2">
|
||||
<template #item="{ item, toggleCallback }" >
|
||||
<div
|
||||
class="flex flex-row items-center justify-between p-2 border w-56 bg-white rounded border-surface-200 dark:border-surface-700 cursor-pointer"
|
||||
class="flex flex-row items-start gap-2 justify-between right-10 p-2 border bg-white rounded border-surface-200 dark:border-surface-700 cursor-pointer"
|
||||
@click="toggleCallback"> <!-- Установлена минимальная ширина -->
|
||||
|
||||
<span>{{ item.label }}</span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="p-4">
|
||||
<!-- Заголовок -->
|
||||
<h2 class="text-4xl mb-6 mt-14 font-bold">Monthly Budgets</h2>
|
||||
<h2 class="text-4xl mb-6 font-bold">Monthly Budgets</h2>
|
||||
|
||||
<!-- Плитка с бюджетами -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
|
||||
@@ -9,6 +9,7 @@ import {ref, onMounted, computed} from 'vue';
|
||||
import {Transaction, TransactionType} from "@/models/Transaction";
|
||||
import {CategoryType} from "@/models/Category";
|
||||
import SelectButton from "primevue/selectbutton";
|
||||
import Select from "primevue/select";
|
||||
import {
|
||||
createTransactionRequest,
|
||||
getTransactionTypes,
|
||||
@@ -166,8 +167,7 @@ const dateErrorMessage = computed(() => {
|
||||
} else if (editedTransaction.value.transactionType.code == 'PLANNED' && editedTransaction.value.date < new Date()) {
|
||||
console.log('tu3')
|
||||
return 'При плановых тратах дата должна быть больше текущей!'
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
console.log('tu4')
|
||||
return ''
|
||||
}
|
||||
@@ -187,7 +187,7 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
|
||||
<div class="card flex justify-center">
|
||||
<div class="card flex justify-center h-dvh">
|
||||
|
||||
<Drawer :visible="visible" :header="isEditing ? 'Edit Transaction' : 'Create Transaction'" :showCloseIcon="false"
|
||||
position="right" @hide="closeDrawer"
|
||||
@@ -195,13 +195,13 @@ onMounted(async () => {
|
||||
<div v-if="loading">
|
||||
Loading...
|
||||
</div>
|
||||
<div v-else class="p-fluid grid formgrid p-4 w-full gap-5">
|
||||
<div v-else class=" grid gap-4 w-full ">
|
||||
|
||||
<div class="relative w-full justify-center justify-items-center ">
|
||||
<div class="flex flex-col justify-items-center gap-2">
|
||||
|
||||
<div class="flex flex-row gap-2">
|
||||
<!-- {{editedTransaction.value.transactionType}}-->
|
||||
<SelectButton v-if="!isEditing" v-model="editedTransaction.transactionType" :allow-empty="false"
|
||||
<Select v-if="!isEditing" v-model="editedTransaction.transactionType" :allow-empty="false"
|
||||
:options="transactionTypes"
|
||||
optionLabel="name"
|
||||
aria-labelledby="basic"
|
||||
@@ -210,6 +210,7 @@ onMounted(async () => {
|
||||
optionLabel="name"
|
||||
aria-labelledby="basic"
|
||||
@change="categoryTypeChanged" class="justify-center"/>
|
||||
</div>
|
||||
<button class="border border-gray-300 rounded-lg w-full z-50"
|
||||
@click="isCategorySelectorOpened = !isCategorySelectorOpened">
|
||||
<div class="flex flex-row items-center pe-4 py-2 ">
|
||||
@@ -252,9 +253,26 @@ onMounted(async () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-4">
|
||||
<div class=" ">
|
||||
|
||||
<FloatLabel variant="on" class="w-10">
|
||||
<InputNumber class="!w-10"
|
||||
:invalid="!editedTransaction.amount"
|
||||
:minFractionDigits="0"
|
||||
id="amount"
|
||||
v-model="editedTransaction.amount"
|
||||
mode="currency"
|
||||
currency="RUB"
|
||||
locale="ru-RU"
|
||||
|
||||
/>
|
||||
<label for="amount" class="!w-10">Amount</label>
|
||||
</FloatLabel>
|
||||
</div>
|
||||
<!-- Comment Input -->
|
||||
<div class="field col-12 w-full">
|
||||
<FloatLabel variant="on" class="w-full">
|
||||
<div class="field col-12 col-span-3">
|
||||
<FloatLabel variant="on" class="l">
|
||||
<label for="comment">Comment</label>
|
||||
<InputText class="w-full"
|
||||
:invalid="!editedTransaction.comment"
|
||||
@@ -264,6 +282,7 @@ onMounted(async () => {
|
||||
/>
|
||||
</FloatLabel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Date Picker -->
|
||||
<div class="field col-12 gap-0">
|
||||
@@ -277,6 +296,7 @@ onMounted(async () => {
|
||||
v-model="editedTransaction.date"
|
||||
dateFormat="yy-mm-dd"
|
||||
showIcon
|
||||
|
||||
/>
|
||||
<p :class="dateErrorMessage != '' ? 'visible' : 'invisible'"
|
||||
class="text-red-400">{{ dateErrorMessage }}</p>
|
||||
@@ -286,21 +306,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
|
||||
<!-- Amount Input -->
|
||||
<div class="field col-12">
|
||||
<FloatLabel variant="on">
|
||||
<InputNumber class="w-full"
|
||||
:invalid="!editedTransaction.amount"
|
||||
:minFractionDigits="0"
|
||||
id="amount"
|
||||
v-model="editedTransaction.amount"
|
||||
mode="currency"
|
||||
currency="RUB"
|
||||
locale="ru-RU"
|
||||
|
||||
/>
|
||||
<label for="amount">Amount</label>
|
||||
</FloatLabel>
|
||||
</div>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div class="field col-12 flex justify-content-end gap-4">
|
||||
@@ -318,7 +324,5 @@ onMounted(async () => {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.formgrid .field {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@ import axios from 'axios';
|
||||
|
||||
// Создание экземпляра axios с базовым URL
|
||||
const apiClient = axios.create({
|
||||
baseURL: 'https://luminic.space/api/v1',
|
||||
baseURL: 'http://localhost:8000/api/v1',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user