Merge pull request #193 from dderbentsov/UC-157

WIP Сделана анимация загрузки и отображения details, карточек и переключателя календаря
This commit is contained in:
Daria Golova
2022-12-12 18:29:48 +03:00
committed by GitHub
5 changed files with 158 additions and 72 deletions

View File

@@ -13,19 +13,20 @@
img.icon-wrapper.cursor-pointer(src="@/assets/icons/lock.svg") img.icon-wrapper.cursor-pointer(src="@/assets/icons/lock.svg")
column-header-checkbox column-header-checkbox
.body.pl-1 .body.pl-1
calendar-event-card( transition-group(name="card", tag="div")
v-for="event in dayEvents", calendar-event-card(
:key="event.id", v-for="event in dayEvents",
:id="event.id", :key="event.id",
:ownerEvent="event", :id="event.id",
:event-types="eventTypes", :ownerEvent="event",
:style="eventCardPosition(event.start, event.end)", :event-types="eventTypes",
:change-form-was-closed="changeFormWasClosed", :style="eventCardPosition(event.start, event.end)",
@selected-event="transmitEventData", :change-form-was-closed="changeFormWasClosed",
@reset-change-form="transmitResetChangeForm", @selected-event="transmitEventData",
@delete-event="transmitDeleteEvent", @reset-change-form="transmitResetChangeForm",
:schedule-body-ref="scheduleBodyRef" @delete-event="transmitDeleteEvent",
) :schedule-body-ref="scheduleBodyRef"
)
</template> </template>
<script> <script>
@@ -132,4 +133,21 @@ export default {
.owner-name .owner-name
color: var(--font-dark-blue-color) color: var(--font-dark-blue-color)
.card-enter-from
opacity: 0
pointer-events: none
.card-enter-active
transition: 0.3s ease
.card-leave-to
opacity: 0
pointer-events: none
.card-leave-active
transition: 0.3s ease
.card-move
transition: 0.3s ease
</style> </style>

View File

@@ -1,10 +1,10 @@
<template lang="pug"> <template lang="pug">
.layout-switch-wrapper.inline-block .layout-switch-wrapper.inline-block
button#day.py-2.px-3( button#day.py-2.px-3.transition.duration-200.ease-linear(
:class="dayLayoutState", :class="dayLayoutState",
@click="changeSelectedLayout" @click="changeSelectedLayout"
) День ) День
button#week.py-2.px-3( button#week.py-2.px-3.transition.duration-200.ease-linear(
:class="weekLayoutState", :class="weekLayoutState",
@click="changeSelectedLayout" @click="changeSelectedLayout"
) Неделя ) Неделя

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.section-wrapper.flex.flex-col.h-fit.cursor-pointer( .section-wrapper.flex.flex-col.h-fit.cursor-pointer(
:style="{flexDirection:settings[section].rowFlex && 'row', width: settings[section].width + 'px', height: settings[section].height + 'px', background: changeBackground}" :style="{width: settings[section].width + 'px', 'min-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}")
span.text-sm.font-semibold.whitespace-nowrap {{settings[section].title}} span.text-sm.font-semibold.whitespace-nowrap {{settings[section].title}}
@@ -14,10 +14,11 @@
:size="20" :size="20"
) )
.icon-ok.text-xsm(class="pt-[3px]") .icon-ok.text-xsm(class="pt-[3px]")
.edit.icon-edit.cursor-pointer.text-sm( .edit.cursor-pointer(
v-if="!isChange && (this.isData || this.isAddress || this.isAttachments)", v-if="!isChange && (this.isData || this.isAddress || this.isAttachments)",
@click="changeClientData" @click="changeClientData"
) )
.icon-edit.text-base.mt-2px
.flex.relative .flex.relative
base-button( base-button(
v-if="settings[section].addFile", v-if="settings[section].addFile",
@@ -25,9 +26,9 @@
:rounded="true", :rounded="true",
:outlined="true", :outlined="true",
:added="true", :added="true",
:size="24" :size="20"
) )
.icon-plus(class="pt-[2px]") .icon-plus.text-sm(class="pt-[2px]")
base-popup.right-3.top-5( base-popup.right-3.top-5(
v-if="section === 'docs' && isOpenAddingWrap", v-if="section === 'docs' && isOpenAddingWrap",
v-click-outside="closePopup", v-click-outside="closePopup",
@@ -59,60 +60,86 @@
:add-new-additional="addDocAdditional", :add-new-additional="addDocAdditional",
:save-additional="saveDocs" :save-additional="saveDocs"
) )
.section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4( transition(name="section", mode="out-in")
v-if="this.isData || this.isAddress || this.isAttachments" .flex.justify-center.items-center(
) v-if="sectionDataPresence",
.flex.flex-col.gap-y-4 :style="{height: settings[section].voidHeight + 'px'}",
.flex.flex-col(v-for="(item, key) in sectionInfo", class="gap-y-1.5") )
span.title-section.font-semibold.text-xs( base-loader(
v-if="settings[section].options") {{settings[section].options[key]}} :width="60",
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}} :height="60"
client-detail-input.text-sm.w-max-fit( )
v-if="section!=='docs' && isChange && settings[section].options[key] !== 'Дата выдачи'", .section-body.flex.flex-col.gap-y-4.px-4(
:style="{fontWeight:key === 'numba'&&600}", v-else-if="(this.isData || this.isAddress || this.isAttachments) && !isChange",
v-model:value="sectionInfo[key]", :class="{'pt-3 pb-4': isData || isAddress || isAttachments}",
:rows="section ==='pass' ? 2 : 1", :style="{height: settings[section].voidHeight + 'px'}"
:placeholder="settings[section].placeholder[key]" )
:sharp="settings[section].sharps[key] && section === 'pass' ? settings[section].sharps[key] : ''" .flex.flex-col.gap-y-4
) .flex.flex-col(v-for="(item, key) in sectionInfo", class="gap-y-1.5")
base-input-date.input.text-sm( span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}}
v-else-if="isChange && section !== 'docs'", span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
v-model:value="sectionInfo.issued_by_date" .flex(v-if="settings[section].options && !isChange")
) span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{key === 'issued_by_date' ? formattedDate : item}}
.copy.icon-copy.cursor-pointer( .copy.icon-copy.cursor-pointer.pl-4(
v-if="item.copy", v-if="key === 'numba'",
@click="() => copyValue(item)" @click="() => copyValue(item)"
)
.flex(v-if="item.name && !isChange")
span.text-sm.w-fit {{item.title}}
.flex.items-center(v-if="item.title")
.flex.gap-x-2.items-center
img(:src="iconDictionary[item?.document?.substr(item.document.lastIndexOf('.') + 1)]")
span.text-sm {{item.title}}
span.text-sm(v-if="item.document") {{`.${item?.document?.substr(item.document.lastIndexOf(".") + 1)}`}}
.section-body.flex.flex-col.gap-y-4.px-4(
v-else-if="(this.isData || this.isAddress || this.isAttachments) && isChange",
:class="{'pt-3 pb-4': isData || isAddress || isAttachments}",
)
.flex.flex-col.gap-y-4
.flex.flex-col(v-for="(item, key) in sectionInfo", class="gap-y-1.5")
span.title-section.font-semibold.text-xs(
v-if="settings[section].options",
) {{settings[section].options[key]}}
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
client-detail-input.text-sm.w-max-fit(
v-if="section!=='docs' && isChange && settings[section].options[key] !== 'Дата выдачи'",
:style="{fontWeight:key === 'numba'&&600}",
v-model:value="sectionInfo[key]",
:rows="section ==='pass' ? 2 : 1",
:placeholder="settings[section].placeholder[key]"
:sharp="settings[section].sharps[key] && section === 'pass' ? settings[section].sharps[key] : ''"
) )
.flex(v-if="settings[section].options && !isChange") base-input-date.input.text-sm(
span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{key === 'issued_by_date' ? formattedDate : item}} v-else-if="isChange && section !== 'docs'",
.copy.icon-copy.cursor-pointer.pl-4( v-model:value="sectionInfo.issued_by_date"
v-if="key === 'numba'",
@click="() => copyValue(item)"
) )
.separation.flex.items-center.justify-center.relative.mt-10px.mb( .copy.icon-copy.cursor-pointer(
v-if="section === 'addresses' && isChange", v-if="item.copy",
class="gap-y-1.5" @click="() => copyValue(item)"
) )
.line.absolute .separation.flex.items-center.justify-center.relative.mt-10px.mb(
.text-separation.span.text-sm.separator.px-2 или v-if="section === 'addresses' && isChange",
.flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange") class="gap-y-1.5"
client-detail-section-address(:dope-address="dopeAddress")
.flex(v-if="item.name && !isChange")
span.text-sm.w-fit {{item.title}}
.flex.items-center(v-if="item.title")
.icon-cancel.cancel.cursor-pointer.pr-3.text-xsm(
v-if="isChange",
:id="item.id",
@click="deleteDoc(item.id)"
) )
.flex.gap-x-2.items-center .line.absolute
img(:src="iconDictionary[item?.document?.substr(item.document.lastIndexOf('.') + 1)]") .text-separation.span.text-sm.separator.px-2 или
span.text-sm {{item.title}} .flex.flex-col.gap-y-4(v-if="section === 'addresses' && isChange")
span.text-sm(v-if="item.document") {{`.${item?.document?.substr(item.document.lastIndexOf(".") + 1)}`}} client-detail-section-address(:dope-address="dopeAddress")
.section-add.flex.justify-center.items-center.cursor-pointer( .flex.items-center(v-if="item.title")
v-else, .icon-cancel.cancel.cursor-pointer.pr-3.text-xsm(
@click="openAddDoc" v-if="isChange",
) Добавить данные :id="item.id",
@click="deleteDoc(item.id)"
)
.flex.gap-x-2.items-center
img(:src="iconDictionary[item?.document?.substr(item.document.lastIndexOf('.') + 1)]")
span.text-sm {{item.title}}
span.text-sm(v-if="item.document") {{`.${item?.document?.substr(item.document.lastIndexOf(".") + 1)}`}}
.section-add.flex.justify-center.items-center.cursor-pointer(
v-else
:style="{height: settings[section].voidHeight + 'px'}"
@click="openAddDoc"
) Добавить данные
</template> </template>
<script> <script>
@@ -131,6 +158,7 @@ import pdfIcon from "@/assets/icons/pdf.svg";
import wordIcon from "@/assets/icons/word.svg"; import wordIcon from "@/assets/icons/word.svg";
import exelIcon from "@/assets/icons/exel.svg"; import exelIcon from "@/assets/icons/exel.svg";
import * as moment from "moment"; import * as moment from "moment";
import BaseLoader from "@/components/Loader/BaseLoader.vue";
export default { export default {
name: "ClientDetailInfoSection", name: "ClientDetailInfoSection",
components: { components: {
@@ -144,6 +172,7 @@ export default {
TableCreatePackageDoc, TableCreatePackageDoc,
TableAddingNewDoc, TableAddingNewDoc,
TableChoiceAddingDoc, TableChoiceAddingDoc,
BaseLoader,
}, },
props: { props: {
saveNewDoc: Function, saveNewDoc: Function,
@@ -199,6 +228,12 @@ export default {
? this.sectionInfo.issued_by_date.split("-").reverse().join(".") ? this.sectionInfo.issued_by_date.split("-").reverse().join(".")
: ""; : "";
}, },
sectionDataPresence() {
if (this.section === "docs") {
return this.sectionInfo[0]?.initialization;
}
return Object.keys(this.sectionInfo).length === 0;
},
}, },
methods: { methods: {
openAddDoc() { openAddDoc() {
@@ -375,6 +410,8 @@ export default {
background-color: var(--btn-blue-color) background-color: var(--btn-blue-color)
.edit .edit
width: 20px
height: 20px
color: var(--btn-blue-color) color: var(--btn-blue-color)
&:hover &:hover
opacity: 0.6 opacity: 0.6
@@ -386,9 +423,33 @@ export default {
.section-add .section-add
height: 100% height: 100%
min-height: 64px
color: var(--btn-blue-color) color: var(--btn-blue-color)
.closed-add .section-add
max-height: 0
.closed-body .section-body
max-height: 0
.section-enter-from
opacity: 0
transform: translateY(0px)
pointer-events: none
.section-enter-active
transition: 0.3s ease
.section-leave-to
opacity: 0
transform: translateY(0px)
pointer-events: none
.section-leave-active
transition: 0.3s ease
.section-move
transition: 0.3s ease
.line .line
width: 100% width: 100%
height: 1px height: 1px

View File

@@ -146,7 +146,11 @@ export default {
return { return {
dataIdentityDocument: {}, dataIdentityDocument: {},
dataAddress: {}, dataAddress: {},
dataAttachments: [], dataAttachments: [
{
initialization: true,
},
],
dataDetail: {}, dataDetail: {},
isOpenDetailInfo: false, isOpenDetailInfo: false,
isOpenPopup: false, isOpenPopup: false,

View File

@@ -126,6 +126,7 @@ export const detail = {
issued_by_date: "Дата", issued_by_date: "Дата",
}, },
width: 280, width: 280,
voidHeight: 244,
}, },
snils: { snils: {
title: "СНИЛС", title: "СНИЛС",
@@ -162,12 +163,14 @@ export const detail = {
join_adress: "Введите адрес целиком", join_adress: "Введите адрес целиком",
}, },
width: 292, width: 292,
voidHeight: 86,
}, },
docs: { docs: {
title: "Документы", title: "Документы",
height: 280, height: 280,
width: 360, width: 360,
addFile: true, addFile: true,
voidHeight: 236,
}, },
additional: { additional: {
title: "Дополнительные данные", title: "Дополнительные данные",