Фикс стилей карточек клиента

This commit is contained in:
megavrilinvv
2022-11-24 16:31:19 +03:00
parent bb4f56f54e
commit c805198b44
2 changed files with 15 additions and 13 deletions

View File

@@ -32,7 +32,7 @@ export default {
pageSettings: [ pageSettings: [
{ {
id: "calendar", id: "calendar",
path: "#/calendar", path: "#/",
active: true, active: true,
icon: "icon-calendar-2", icon: "icon-calendar-2",
}, },

View File

@@ -1,5 +1,7 @@
<template lang="pug"> <template lang="pug">
.section-wrapper.flex.flex-col.h-fit.cursor-pointer( .section-wrapper.flex.flex-col.h-fit.cursor-pointer(
@click="changeOpenCard",
v-click-outside="clickOutside"
:style="{flexDirection:settings[section].rowFlex && 'row', width: settings[section].width + 'px', height: settings[section].height + 'px', background: changeBackground}" :style="{flexDirection:settings[section].rowFlex && 'row', width: settings[section].width + 'px', height: settings[section].height + 'px', background: changeBackground}"
) )
.section-header.flex.items-center.justify-between.pl-4.pr-3(:class="{small:settings[section].rowFlex}") .section-header.flex.items-center.justify-between.pl-4.pr-3(:class="{small:settings[section].rowFlex}")
@@ -7,7 +9,7 @@
.flex.items-center.gap-x-8 .flex.items-center.gap-x-8
base-button( base-button(
v-if="isChange", v-if="isChange",
@click="changeDoc", @click.stop="changeDoc",
confirm, confirm,
rounded, rounded,
outlined, outlined,
@@ -15,12 +17,12 @@
) )
.icon-ok.text-xsm(class="pt-[3px]") .icon-ok.text-xsm(class="pt-[3px]")
.edit.icon-edit.cursor-pointer.text-sm( .edit.icon-edit.cursor-pointer.text-sm(
v-if="!isChange", v-if="openCard && !isChange",
@click="changeClientData" @click="changeClientData"
) )
.flex.relative .flex.relative
base-button( base-button(
v-if="settings[section].addFile", v-if="settings[section].addFile && openCard",
@click="openAddingWrap", @click="openAddingWrap",
:rounded="true", :rounded="true",
:outlined="true", :outlined="true",
@@ -192,11 +194,12 @@ export default {
isOpenPackage: false, isOpenPackage: false,
isOpenAddDoc: false, isOpenAddDoc: false,
showModal: false, showModal: false,
openCard: false,
}; };
}, },
computed: { computed: {
changeBackground() { changeBackground() {
return this.isChange return this.openCard || this.isChange
? "var(--light-grey-bg-color)" ? "var(--light-grey-bg-color)"
: "var(--default-white)"; : "var(--default-white)";
}, },
@@ -232,8 +235,15 @@ export default {
this.showModal = false; this.showModal = false;
this.saveDocs(); this.saveDocs();
}, },
changeOpenCard() {
this.openCard = true;
},
clickOutside() {
this.openCard = false;
},
changeDoc() { changeDoc() {
this.isChange = false; this.isChange = false;
this.openCard = false;
if (this.section === "pass") { if (this.section === "pass") {
this.docId ? this.updateDocument() : this.createDocument(); this.docId ? this.updateDocument() : this.createDocument();
} }
@@ -249,14 +259,6 @@ export default {
this.isChange = true; this.isChange = true;
} }
}, },
saveChange() {
this.isChange = false;
if (this.section === "pass") {
this.updateDocument();
} else if (this.section === "addresses") {
this.updateAddress();
}
},
openAddingWrap() { openAddingWrap() {
if (!this.isChange) { if (!this.isChange) {
this.isOpenAddingWrap = !this.isOpenAddingWrap; this.isOpenAddingWrap = !this.isOpenAddingWrap;