Merge pull request #118 from dderbentsov/UC-52
Сделала запрет на одновременное открытие форм
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
<template lang="pug">
|
||||
.flex.flex-col.w-full.h-full.gap-y-2
|
||||
the-header
|
||||
the-header(
|
||||
:is-open-page-form="isOpenPageForm",
|
||||
@is-open-header-form="changeHeaderFormState"
|
||||
)
|
||||
.flex.flex-auto
|
||||
the-sidebar
|
||||
router-view
|
||||
router-view(
|
||||
:is-open-header-form="isOpenHeaderForm",
|
||||
@is-open-page-form="changePageFormState",
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -13,5 +19,19 @@ import TheSidebar from "@/components/TheSidebar";
|
||||
export default {
|
||||
name: "LoggedInLayout",
|
||||
components: { TheHeader, TheSidebar },
|
||||
data() {
|
||||
return {
|
||||
isOpenPageForm: false,
|
||||
isOpenHeaderForm: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changePageFormState(value) {
|
||||
this.isOpenPageForm = value;
|
||||
},
|
||||
changeHeaderFormState(value) {
|
||||
this.isOpenHeaderForm = value;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template lang="pug">
|
||||
.header-wrapper.relative.flex.justify-center.box-border.py-2.pl-4_75px.pr-6
|
||||
base-client-form-create.right-6(v-if="isOpenCreate", @blure="isOpenCreate=false", :close-form="closeFormCreate")
|
||||
base-client-form-create.right-0.top-16(v-if="isOpenCreate", @blure="isOpenCreate=false", :close-form="closeFormCreate")
|
||||
.flex.items-center.box-border.cursor-pointer.mr-auto
|
||||
img.logo-img.mr-29_25px(src="@/assets/images/logo.svg", alt="Logo")
|
||||
header-inputs
|
||||
@@ -13,7 +13,7 @@
|
||||
:size="40",
|
||||
right-icon="icon-person",
|
||||
:icon-right-size="18",
|
||||
@click="isOpenCreate=true"
|
||||
@click="changeFormState"
|
||||
)
|
||||
button.header-buttons.flex.justify-center.items-center.mr-8.p-0(@click="logout")
|
||||
.icon-bell.text-xxl
|
||||
@@ -34,6 +34,12 @@ import BaseClientFormCreate from "@/components/base/BaseClientFormCreate";
|
||||
export default {
|
||||
name: "TheHeader",
|
||||
components: { HeaderInputs, BaseAvatar, BaseButton, BaseClientFormCreate },
|
||||
props: {
|
||||
isOpenPageForm: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
avatarSrc: img,
|
||||
@@ -47,11 +53,16 @@ export default {
|
||||
methods: {
|
||||
closeFormCreate() {
|
||||
this.isOpenCreate = false;
|
||||
this.$emit("is-open-header-form", this.isOpenCreate);
|
||||
},
|
||||
logout() {
|
||||
localStorage.clear();
|
||||
this.$router.push("/login");
|
||||
},
|
||||
changeFormState() {
|
||||
this.isOpenCreate = !this.isOpenPageForm;
|
||||
this.$emit("is-open-header-form", this.isOpenCreate);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -36,6 +36,12 @@ export default {
|
||||
CalendarSidebar,
|
||||
CalendarFormAddEvent,
|
||||
},
|
||||
props: {
|
||||
isOpenHeaderForm: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sidebarWidth: "72px",
|
||||
@@ -93,16 +99,21 @@ export default {
|
||||
this.sidebarWidth = value;
|
||||
},
|
||||
openFormCreateEvent() {
|
||||
this.isOpenForm = true;
|
||||
this.isOpenForm = !this.isOpenHeaderForm;
|
||||
this.$emit("is-open-page-form", this.isOpenForm);
|
||||
},
|
||||
closeFormCreateEvent() {
|
||||
this.isOpenForm = false;
|
||||
this.$emit("is-open-page-form", this.isOpenForm);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.fetchPersonsData();
|
||||
this.fetchEventsData();
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.closeFormCreateEvent();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
.flex.flex-col.gap-y-6.pt-6.pb-7.px-8.event-form.absolute.right-2.bottom-14
|
||||
.flex.flex-col.gap-y-6.pt-6.pb-7.px-8.event-form.absolute.right-0.bottom-14
|
||||
.flex.justify-between
|
||||
span.title.text-xl.font-bold Назначение события
|
||||
.flex.pt-2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
clients-wrapper
|
||||
clients-wrapper(@is-open-client-add-form="transmitPageFormState")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -7,5 +7,10 @@ import ClientsWrapper from "@/pages/clients/components/ClientsWrapper";
|
||||
export default {
|
||||
name: "TheClients",
|
||||
components: { ClientsWrapper },
|
||||
methods: {
|
||||
transmitPageFormState(value) {
|
||||
this.$emit("is-open-page-form", value);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -43,9 +43,11 @@ export default {
|
||||
methods: {
|
||||
openFormCreateClient() {
|
||||
this.isOpenFormCreate = true;
|
||||
this.$emit("is-open-client-add-form", this.isOpenFormCreate);
|
||||
},
|
||||
closeFormCreateClient() {
|
||||
this.isOpenFormCreate = false;
|
||||
this.$emit("is-open-client-add-form", this.isOpenFormCreate);
|
||||
this.fetchDataClients();
|
||||
},
|
||||
saveDataClients(data) {
|
||||
@@ -79,6 +81,9 @@ export default {
|
||||
mounted() {
|
||||
this.fetchDataClients();
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.closeFormCreateClient();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template lang="pug">
|
||||
.wrapper.flex.w-full.relative.mx-6
|
||||
clients-table(:open-form-create="openFormCreateClient")
|
||||
clients-table(@is-open-client-add-form="transmitPageFormState")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -14,11 +14,8 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
openFormCreateClient() {
|
||||
this.isOpenForm = true;
|
||||
},
|
||||
closeFormCreateClient() {
|
||||
this.isOpenForm = false;
|
||||
transmitPageFormState(value) {
|
||||
this.$emit("is-open-client-add-form", value);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user