fixes
This commit is contained in:
@@ -2,14 +2,8 @@
|
||||
<div
|
||||
class=" items-center toolbar-example justify-between bg-white outline rounded-xl outline-gray-300 shadow-lg h-fit fixed"
|
||||
style="width: 90%; left:5%; bottom: 1.5rem;">
|
||||
<TransactionEditDrawer v-if="drawerOpened" :visible="drawerOpened"
|
||||
|
||||
|
||||
:transaction-type="transactionType"
|
||||
:category-type="categoryType"
|
||||
|
||||
@close-drawer="closeDrawer()"
|
||||
/>
|
||||
<!-- <TransactionForm v-if="drawerOpened" :visible="drawerOpened" :transaction-type="'INSTANT'"-->
|
||||
<!-- :category-type="'EXPENSE'" @close-drawer="closeDrawer"/>-->
|
||||
<div class="flex flex-row rounded-full px-2 justify-between overflow-x">
|
||||
<div class="flex flex-col gap-2 p-2">
|
||||
<router-link to="/budgets" class="items-center flex flex-col gap-2">
|
||||
@@ -66,10 +60,10 @@
|
||||
<button @click="openDrawer('INSTANT')" class="hover:bg-gray-100 p-2 rounded-lg">
|
||||
<p>Создать текущую</p>
|
||||
</button>
|
||||
<button @click="openDrawer('PLANNED', 'INCOME')" class="hover:bg-gray-100 p-2 rounded-lg">
|
||||
<button @click="openDrawer('PLANNED', 'EXPENSE')" class="hover:bg-gray-100 p-2 rounded-lg">
|
||||
<p class="text-left"> Создать плановый расход</p>
|
||||
</button>
|
||||
<button @click=" openDrawer('PLANNED', 'EXPENSE')" class="hover:bg-gray-100 p-2 rounded-lg">
|
||||
<button @click=" openDrawer('PLANNED', 'INCOME')" class="hover:bg-gray-100 p-2 rounded-lg">
|
||||
<p class="text-left">Создать плановое поступление</p>
|
||||
</button>
|
||||
<router-link to="/settings" class="items-center flex flex-col gap-2 p-2">
|
||||
@@ -89,32 +83,38 @@
|
||||
<script setup lang="ts">
|
||||
import {onMounted, ref} from 'vue';
|
||||
import Button from 'primevue/button';
|
||||
import TransactionEditDrawer from "@/components/budgets/TransactionEditDrawer.vue";
|
||||
import {TransactionType} from "@/models/Transaction";
|
||||
import {CategoryType} from "@/models/Category";
|
||||
import {useRoute} from "vue-router";
|
||||
import {useDrawerStore} from "@/stores/drawerStore";
|
||||
|
||||
const showSubmenu = ref(false);
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const transactionType = ref<TransactionType>()
|
||||
const categoryType = ref<CategoryType>()
|
||||
const drawerOpened = ref(false);
|
||||
|
||||
const drawerStore = useDrawerStore()
|
||||
|
||||
|
||||
const refreshPage = () => {
|
||||
window.location.reload(true)
|
||||
}
|
||||
const openDrawer = (selectedTransactionType = null, selectedCategoryType = null) => {
|
||||
if (selectedTransactionType && selectedCategoryType) {
|
||||
transactionType.value = selectedTransactionType;
|
||||
categoryType.value = selectedCategoryType;
|
||||
// transactionType.value = selectedTransactionType;
|
||||
// categoryType.value = selectedCategoryType;
|
||||
drawerStore.setTransactionType(selectedTransactionType)
|
||||
drawerStore.setCategoryType(selectedTransactionType)
|
||||
} else if (selectedTransactionType) {
|
||||
transactionType.value = selectedTransactionType;
|
||||
categoryType.value = 'EXPENSE'
|
||||
// transactionType.value = selectedTransactionType;
|
||||
// categoryType.value = 'EXPENSE'
|
||||
drawerStore.setTransactionType(selectedTransactionType)
|
||||
drawerStore.setCategoryType('EXPENSE')
|
||||
}
|
||||
|
||||
drawerOpened.value = true;
|
||||
console.log(selectedTransactionType)
|
||||
console.log(selectedCategoryType)
|
||||
drawerStore.setVisible( true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user