fix login spaces
This commit is contained in:
@@ -98,6 +98,24 @@ const spaceStore = useSpaceStore()
|
||||
const spaces = computed(() => spaceStore.spaces);
|
||||
const selectedSpace = computed(() => spaceStore.space)
|
||||
|
||||
watch(
|
||||
selectedSpace,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue) {
|
||||
items.value.push({
|
||||
label: 'Запись',
|
||||
icon: 'pi pi-plus',
|
||||
url:'',
|
||||
command: () => {
|
||||
drawerStore.setCategoryType('EXPENSE');
|
||||
drawerStore.setTransactionType('INSTANT');
|
||||
drawerStore.visible = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
const selectSpace = (space: Space) => {
|
||||
spaceStore.setSpace(space.value);
|
||||
@@ -158,16 +176,7 @@ const items = ref([
|
||||
icon: 'pi pi-envelope',
|
||||
url: '/settings',
|
||||
},
|
||||
{
|
||||
label: 'Запись',
|
||||
icon: 'pi pi-plus',
|
||||
url:'',
|
||||
command: () => {
|
||||
drawerStore.setCategoryType('EXPENSE');
|
||||
drawerStore.setTransactionType('INSTANT');
|
||||
drawerStore.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
]);
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<!-- Заголовок -->
|
||||
<div class="flex flex-row gap-4 items-center">
|
||||
<h2 class="text-4xl font-bold">Бюджеты</h2>
|
||||
<Button label="+ Создать" @click="creationOpened=true" size="small"/>
|
||||
<Button v-if="selectedSpace" label="+ Создать" @click="creationOpened=true" size="small"/>
|
||||
<BudgetCreationView :opened="creationOpened" @budget-created="fetchBudgets"
|
||||
@close-modal="creationOpened=false"/>
|
||||
<StatusView :show="creationSuccessModal" :is-error="false" :message="'Бюджет создан!'"/>
|
||||
|
||||
@@ -142,7 +142,7 @@ onUnmounted(async () => {
|
||||
<div class="flex flex-col gap-4 p-4 bg-gray-100 h-full ">
|
||||
<div class="flex flex-row gap-4 items-center">
|
||||
<h2 class="text-4xl font-bold">Список транзакций </h2>
|
||||
<Button label="+ Создать" @click="{
|
||||
<Button v-if="selectedSpace" label="+ Создать" @click="{
|
||||
drawerStore.setCategoryType('EXPENSE');
|
||||
drawerStore.setTransactionType('INSTANT');
|
||||
drawerStore.visible = true
|
||||
|
||||
@@ -113,7 +113,7 @@ onMounted(async () => {
|
||||
<!-- Заголовок -->
|
||||
<div class="flex flex-row gap-4 items-center">
|
||||
<h2 class="text-4xl font-bold">Вишлисты</h2>
|
||||
<Button label="+ Создать" @click="creationOpened=true" size="small"/>
|
||||
<Button v-if="selectedSpace" label="+ Создать" @click="creationOpened=true" size="small"/>
|
||||
<!-- <StatusView :show="creationSuccessModal" :is-error="false" :message="'Бюджет создан!'"/>-->
|
||||
</div>
|
||||
<!-- Плитка с бюджетами -->
|
||||
|
||||
Reference in New Issue
Block a user