Merge pull request #194 from dderbentsov/UC-161

[WIP] Скрыл окно функций, фикс отображения окошка сетей и самого отображения
This commit is contained in:
frontgavrilin
2022-12-13 14:49:28 +03:00
committed by GitHub
5 changed files with 18 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.button.relative.w-8.h-8.flex.justify-center.items-center.cursor-pointer .button.relative.w-8.h-8.flex.justify-center.items-center.cursor-pointer
.prompt.absolute.w-fit.left-1.px-2.py-3.bottom-10.bg-amber-600 .prompt.fixed.w-fit.left-1.px-2.py-3.bottom-10.bg-amber-600
span.text-sm {{prompt}} span.text-sm {{prompt}}
img(:src="img" :alt="prompt") img(:src="img" :alt="prompt")
</template> </template>

View File

@@ -20,7 +20,7 @@
@click="resetLastName", @click="resetLastName",
:size=40 :size=40
) Сбросить ) Сбросить
clients-table-header-actions(v-if="!!isOpenActions", :is-selected-one="isOpenActions===1") //- clients-table-header-actions(v-if="!!isOpenActions", :is-selected-one="isOpenActions===1")
.flex.w-fit.h-fit.gap-x-2 .flex.w-fit.h-fit.gap-x-2
base-button(left-icon="icon-download", :icon-left-size="16", :size="40", :outlined="true") base-button(left-icon="icon-download", :icon-left-size="16", :size="40", :outlined="true")
base-button(left-icon="icon-plus", :icon-left-size="13", :size="40", @click="openForm") base-button(left-icon="icon-plus", :icon-left-size="13", :size="40", @click="openForm")

View File

@@ -20,7 +20,7 @@ export default {
dataBtn: [ dataBtn: [
{ {
img: group, img: group,
prompt: "сгрупировать", prompt: "сгруппировать",
}, },
{ {
img: edit, img: edit,

View File

@@ -272,8 +272,10 @@ export default {
contacts.push(this.dataClient.phone); contacts.push(this.dataClient.phone);
let mapCreateContacts = this.client.contacts.map((el) => el.kind); let mapCreateContacts = this.client.contacts.map((el) => el.kind);
let mapDeleteContacts = contacts.map((el) => el.kind); let mapDeleteContacts = contacts.map((el) => el.kind);
let createContacts = contacts.filter( let createContacts = contacts.filter((el) =>
(el) => !mapCreateContacts.includes(el.kind) el.kind === "EMAIL" || el.kind === "PHONE"
? !mapCreateContacts.includes(el.kind)
: el.kind
); );
let deleteContacts = this.client.contacts.filter( let deleteContacts = this.client.contacts.filter(
(el) => !mapDeleteContacts.includes(el.kind) (el) => !mapDeleteContacts.includes(el.kind)
@@ -316,7 +318,9 @@ export default {
.then(() => this.fetchDataClients()); .then(() => this.fetchDataClients());
}, },
postDeleteContact(contact) { postDeleteContact(contact) {
fetchWrapper.del(`general/contact/${contact.id}/delete/`); fetchWrapper
.del(`general/contact/${contact.id}/delete/`)
.then(() => this.fetchDataClients());
}, },
addNetwork(network) { addNetwork(network) {
this.dataClient.contacts.push(network); this.dataClient.contacts.push(network);
@@ -602,7 +606,10 @@ export default {
this.client.contacts.find((el) => el.kind === "EMAIL") this.client.contacts.find((el) => el.kind === "EMAIL")
?.username || "", ?.username || "",
}, },
contacts: [...this.client.contacts], contacts: this.client.contacts.filter(
(el) =>
!el.deleted_flg && el.kind !== "EMAIL" && el.kind !== "PHONE"
),
avatar: this.client.first_name avatar: this.client.first_name
? this.client.last_name[0] + this.client.first_name[0] ? this.client.last_name[0] + this.client.first_name[0]
: this.client.last_name.substr(0, 2), : this.client.last_name.substr(0, 2),

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.network-cell.flex.box-border.px-4.items-center.w-full(:style="{ minWidth : width + 'px', maxWidth : width + 'px' }") .network-cell.flex.box-border.px-4.items-center.w-full(:style="{ minWidth: width + 'px', maxWidth: width + 'px' }")
.flex.gap-x-1 .flex.gap-x-1
.text-xl.icon.relative( .text-xl.icon.relative(
v-for="network in getNetworks", v-for="network in getNetworks",
@@ -20,10 +20,10 @@
:size="24" :size="24"
) )
.icon-plus(class="pt-[2px]") .icon-plus(class="pt-[2px]")
base-popup.right-3.top-6( base-popup.right-3.top-6.z-20(
v-if="isOpenPopupAdding", v-if="isOpenPopupAdding",
@click.stop, @click.stop,
v-click-outside.stop="closePopup", v-click-outside="closePopup",
:width="485" :width="485"
) )
base-adding-network( base-adding-network(
@@ -76,8 +76,7 @@ export default {
computed: { computed: {
getNetworks() { getNetworks() {
return this.networks.filter( return this.networks.filter(
(el) => (el) => el.kind !== "EMAIL" && el.kind !== "PHONE"
el.kind !== "EMAIL" && el.kind !== "PHONE" && el.deleted_flg !== true
); );
}, },
getSelectedIcon() { getSelectedIcon() {