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