[WIP] Изменил ширину столбцов клиентов, добавил ограничение на поле email

This commit is contained in:
megavrilinvv
2022-12-12 13:27:21 +03:00
parent 1d78f05934
commit 8c2ded8758
9 changed files with 50 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
span.text-sm.font-semibold.whitespace-nowrap {{settings[section].title}} span.text-sm.font-semibold.whitespace-nowrap {{settings[section].title}}
.flex.items-center.gap-x-8 .flex.items-center.gap-x-8
base-button( base-button(
v-if="isChange", v-if="isChange && (this.isData || this.isAddress || this.isAttachments)",
@click.stop="changeDoc", @click.stop="changeDoc",
confirm, confirm,
rounded, rounded,
@@ -15,7 +15,7 @@
) )
.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="!isChange && (this.isData || this.isAddress || this.isAttachments)",
@click="changeClientData" @click="changeClientData"
) )
.flex.relative .flex.relative
@@ -28,7 +28,11 @@
:size="24" :size="24"
) )
.icon-plus(class="pt-[2px]") .icon-plus(class="pt-[2px]")
base-popup.right-3.top-5(v-if="section === 'docs' && isOpenAddingWrap", :width="244") base-popup.right-3.top-5(
v-if="section === 'docs' && isOpenAddingWrap",
v-click-outside="closePopup",
:width="244"
)
table-choice-adding-doc( table-choice-adding-doc(
:add-new-doc="addNewDoc", :add-new-doc="addNewDoc",
:save-docs="saveDocs", :save-docs="saveDocs",
@@ -46,6 +50,7 @@
:add-new-doc="addNewDoc", :add-new-doc="addNewDoc",
:new-docs="docData", :new-docs="docData",
:close-modal="changeShowModal", :close-modal="changeShowModal",
v-click-outside="closeAddDocs"
) )
table-create-package-doc(v-if="isOpenPackage") table-create-package-doc(v-if="isOpenPackage")
table-adding-new-additional( table-adding-new-additional(
@@ -226,6 +231,12 @@ export default {
this.showModal = false; this.showModal = false;
this.saveDocs(); this.saveDocs();
}, },
closePopup() {
this.isOpenAddingWrap = false;
},
closeAddDocs() {
this.isAttachments = false;
},
checkDataPresence(data) { checkDataPresence(data) {
let postData = JSON.parse(JSON.stringify(data)); let postData = JSON.parse(JSON.stringify(data));
let keys = Object.keys(postData); let keys = Object.keys(postData);

View File

@@ -1,5 +1,8 @@
<template lang="pug"> <template lang="pug">
.flex.box-border.justify-between.px-4.items-center(:style="{ minWidth : width + 'px' }" :class="{width:generateWidth}") .flex.box-border.justify-between.items-center(
:style="{ minWidth : width + 'px', maxWidth: width + 'px', padding: generateWidth ? '0px 16px' : '0px 10px' }",
:class="{width:generateWidth}"
)
span.text-sm(v-if="title") {{title}} span.text-sm(v-if="title") {{title}}
slot slot
</template> </template>

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.flex.box-border.px-4.items-center.w-full.text-sm(:style="{ minWidth : width + 'px' }") .flex.box-border.px-4.items-center.w-full.text-sm(:style="{ minWidth : width + 'px', maxWidth : width + 'px' }")
span(v-if="!isOpenChange") {{value.age ? value.age.split("-").reverse().join(".") : ""}} span(v-if="!isOpenChange") {{value.age ? value.age.split("-").reverse().join(".") : ""}}
base-input-date.input.max-h-10( base-input-date.input.max-h-10(
v-if="isOpenChange", v-if="isOpenChange",

View File

@@ -1,6 +1,12 @@
<template lang="pug"> <template lang="pug">
.flex.box-border.px-4.items-center.w-full.text-sm(:style="{ minWidth : width + 'px' }") .flex.box-border.px-4.items-center.w-full.text-sm(
span(v-if="!isOpenChange") {{value.email.username}} :style="{ minWidth: width + 'px', maxWidth: isHover && this.value.email.username.length >= 25 ? width + 30 + 'px' : width + 'px' }"
)
span.z-10(
v-if="!isOpenChange",
@mouseover="changeHover",
@mouseleave="changeHover"
) {{maxValue}}
base-input( base-input(
v-if="isOpenChange", v-if="isOpenChange",
:width-input="234", :width-input="234",
@@ -20,5 +26,22 @@ export default {
width: Number, width: Number,
isOpenChange: Boolean, isOpenChange: Boolean,
}, },
data() {
return {
isHover: false,
};
},
computed: {
maxValue() {
return this.value.email.username.length >= 25 && !this.isHover
? this.value.email.username.substr(0, 25) + "..."
: this.value.email.username;
},
},
methods: {
changeHover() {
this.isHover = !this.isHover;
},
},
}; };
</script> </script>

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.flex.box-border.px-4.items-center.gap-x-3.w-full.text-sm( .flex.box-border.px-4.items-center.gap-x-3.w-full.text-sm(
:style="{ minWidth : width + 'px' }", :style="{ minWidth : width + 'px', maxWidth : width + 'px' }",
:class="{'open-change': isOpenChange}" :class="{'open-change': isOpenChange}"
) )
base-avatar(:size="36", :color="avatarColor", v-if="!photo") {{avatar}} base-avatar(:size="36", :color="avatarColor", v-if="!photo") {{avatar}}

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' }") .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",

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.flex.box-border.px-4.items-center.w-full.text-sm(:style="{ minWidth : width + 'px' }") .flex.box-border.px-4.items-center.w-full.text-sm(:style="{ minWidth : width + 'px', maxWidth : width + 'px' }")
span.text-sm( span.text-sm(
v-if="!isOpenChange" v-if="!isOpenChange"
) {{value.phone.username.replace(/\+7(\d{3})(\d{3})(\d{2})(\d{2})/, '+7 ($1) $2-$3-$4')}} ) {{value.phone.username.replace(/\+7(\d{3})(\d{3})(\d{2})(\d{2})/, '+7 ($1) $2-$3-$4')}}

View File

@@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
.flex.box-border.px-4.items-center.w-full.gap-x-2(:style="{ minWidth : width + 'px' }") .flex.box-border.px-4.items-center.w-full.gap-x-2(:style="{ minWidth : width + 'px', maxWidth : width + 'px' }")
.flex.gap-x-2.items-center(v-if="!isOpenChange") .flex.gap-x-2.items-center(v-if="!isOpenChange")
.dot.w-2.h-2(:style="{ backgroundColor: prioritySettings.settings.find((el) => el.text == value.priority).color }") .dot.w-2.h-2(:style="{ backgroundColor: prioritySettings.settings.find((el) => el.text == value.priority).color }")
span.text-sm(:style="{ color: prioritySettings.settings.find((el) => el.text == value.priority).color }") {{value.priority}} span.text-sm(:style="{ color: prioritySettings.settings.find((el) => el.text == value.priority).color }") {{value.priority}}

View File

@@ -15,7 +15,7 @@ export const column = [
name: "age", name: "age",
title: "Дата рождения", title: "Дата рождения",
iconHead: true, iconHead: true,
width: 140, width: 180,
}, },
{ {
name: "priority", name: "priority",
@@ -47,7 +47,7 @@ export const column = [
}, },
], ],
iconHead: true, iconHead: true,
width: 124, width: 180,
}, },
{ {
name: "phone", name: "phone",