Merge branch 'ASTRA-122' into 'master'

Resolve ASTRA-122

See merge request andrusyakka/urban-couscous!453
This commit is contained in:
Vasiliy Gavrilin
2023-06-29 14:14:44 +00:00
3 changed files with 138 additions and 28 deletions

View File

@@ -61,8 +61,9 @@
) )
.name.flex.items-center.font-medium.text-smm {{ name }} .name.flex.items-center.font-medium.text-smm {{ name }}
.flex.h-10.w-10.absolute.right-4.bottom-4 .flex.h-10.w-10.absolute.right-4.bottom-4
q-btn(color="primary", dense, padding="4px 12px") q-btn(@click="showModal = true", color="primary", dense, padding="4px 12px")
q-icon(name="app:icon-plus", size="17px") q-icon(name="app:icon-plus", size="17px")
tag-creation-form(:show-modal="showModal", :close-modal="closeModal", :create-tag="createTag")
.flex.gap-x-20.w-full(v-if="change || fillInspection") .flex.gap-x-20.w-full(v-if="change || fillInspection")
.flex.flex-col.gap-y-3.w-full(v-for="file in protocolData[data.state].files") .flex.flex-col.gap-y-3.w-full(v-for="file in protocolData[data.state].files")
.title.text-smm.font-semibold {{file.name}} .title.text-smm.font-semibold {{file.name}}
@@ -97,13 +98,14 @@
<script> <script>
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue"; import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import TagCreationForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/TagCreationForm.vue";
import BaseButton from "@/components/base/BaseButton.vue"; import BaseButton from "@/components/base/BaseButton.vue";
import BaseInput from "@/components/base/BaseInput.vue"; import BaseInput from "@/components/base/BaseInput.vue";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
name: "DataForm", name: "DataForm",
components: { MedicalFormWrapper, BaseButton, BaseInput }, components: { MedicalFormWrapper, BaseButton, BaseInput, TagCreationForm },
props: { props: {
abc: Array, abc: Array,
data: Object, data: Object,
@@ -113,6 +115,7 @@ export default {
data() { data() {
return { return {
change: false, change: false,
showModal: false,
}; };
}, },
computed: { computed: {
@@ -183,6 +186,13 @@ export default {
reader.readAsDataURL(file); reader.readAsDataURL(file);
}); });
}, },
closeModal() {
this.showModal = false;
},
createTag(model) {
this.showModal = false;
this.protocolData[this.data.state].complaints.push(model.tag);
},
}, },
watch: { watch: {
fillInspection: { fillInspection: {

View File

@@ -50,8 +50,7 @@
.flex.h-10.w-10.absolute.right-4.bottom-4 .flex.h-10.w-10.absolute.right-4.bottom-4
q-btn(@click="showModal = true", color="primary", dense, padding="4px 12px") q-btn(@click="showModal = true", color="primary", dense, padding="4px 12px")
q-icon(name="app:icon-plus", size="17px") q-icon(name="app:icon-plus", size="17px")
base-modal(v-model="showModal", title="Создание тега") tag-creation-form(:show-modal="showModal", :close-modal="closeModal", :create-tag="createTag")
tag-creation-form
.flex(v-if="data.title === 'Осмотр полости рта' && (fillInspection || change)", :style="{color: 'var(--btn-blue-color)'}") .flex(v-if="data.title === 'Осмотр полости рта' && (fillInspection || change)", :style="{color: 'var(--btn-blue-color)'}")
q-btn(no-caps, flat padding="2px 4px") q-btn(no-caps, flat padding="2px 4px")
q-icon(left, name="app:plus", size="11px") q-icon(left, name="app:plus", size="11px")
@@ -64,7 +63,6 @@ import BaseInput from "@/components/base/BaseInput.vue";
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue"; import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
import TagCreationForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/TagCreationForm.vue"; import TagCreationForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/TagCreationForm.vue";
import { mapState } from "vuex"; import { mapState } from "vuex";
import BaseModal from "@/components/base/BaseModal.vue";
export default { export default {
name: "MedicalFormTag", name: "MedicalFormTag",
@@ -73,7 +71,6 @@ export default {
BaseInput, BaseInput,
MedicalFormWrapper, MedicalFormWrapper,
TagCreationForm, TagCreationForm,
BaseModal,
}, },
props: { data: Object, abc: Array, fillInspection: Boolean }, props: { data: Object, abc: Array, fillInspection: Boolean },
data() { data() {
@@ -111,6 +108,13 @@ export default {
closeCard() { closeCard() {
this.change = false; this.change = false;
}, },
closeModal() {
this.showModal = false;
},
createTag(model) {
this.showModal = false;
this.protocolData[this.data.state].push(model.tag);
},
}, },
watch: { watch: {
fillInspection: { fillInspection: {

View File

@@ -1,17 +1,49 @@
<template lang="pug"> <template lang="pug">
.wrapper.flex.flex-col base-modal(v-model="showModal", title="Создание тега", modal-padding)
.flex.flex-col .flex.flex-col
.flex.flex-col.justify-between.py-6(:style="{height: '194px'}")
.flex.flex-col(class="gap-y-1.5")
.label.font-semibold.text-smm Категория
.select.flex.items-center.justify-between.cursor-pointer.py-2.px-4.rounded(
:class="{'open-select': isOpen}",
@click="openMenu",
v-click-outside="closeMenu"
) {{model.category ? model.category : "Выберите категорию"}}
.flex.duration-100(:class="{'open-menu': isOpen}")
q-icon(name="app:down-arrow")
q-menu(
v-if="isOpen",
:style="{rowGap: '6px'}",
style="margin-top: 4px !important",
fit,
anchor="bottom left",
self="top left"
)
.menu-wrapper.flex.flex-col.h-40.overflow-y-auto
.options.flex(v-for="item in options")
.item.flex.py-2.px-4.items-center.cursor-pointer(
@click="selected(item.label)"
) {{item.label}}
.tag.item.flex.py-2.px-4.items-center.cursor-pointer.w-full.gap-x-2(
@click="addCategory"
)
q-icon(name="app:icon-plus", size="10px",)
span Добавить категорию
.flex.flex-col(class="gap-x-1.5")
base-input(v-model="model.tag", label="Текст тега", placeholder="Введите тэг", outlined)
.buttons-group.flex .buttons-group.flex
q-btn( q-btn(
@click="closeModal",
color="primary", color="primary",
outline, outline,
size="16px", size="16px",
no-caps, no-caps,
label="Отмена", label="Отменить",
:style="{width: '100%', height: '40px'}", :style="{width: '100%', height: '40px'}",
padding="10px 24px" padding="10px 24px"
) )
q-btn( q-btn(
@click="createTag(model)",
color="primary", color="primary",
size="16px", size="16px",
no-caps, no-caps,
@@ -22,27 +54,91 @@
</template> </template>
<script> <script>
import BaseInput from "@/components/base/BaseInput.vue";
import BaseModal from "@/components/base/BaseModal.vue";
export default { export default {
name: "TagCreationForm", name: "TagCreationForm",
components: { BaseInput, BaseModal },
props: {
closeModal: Function,
createTag: Function,
showModal: Boolean,
},
data() { data() {
return { return {
model: null, model: { category: null, tag: "" },
options: [ options: [
{ label: "Какая-то категория 1" }, { label: "Какая-то категория 1" },
{ label: "Какая-то категория 2" }, { label: "Какая-то категория 2" },
{ label: "Какая-то категория 3" }, { label: "Какая-то категория 3" },
{ label: "Какая-то категория 4" }, { label: "Какая-то категория 4" },
{ label: "Какая-то категория 5" },
{ label: "Какая-то категория 6" },
], ],
isOpen: false,
}; };
}, },
methods: {
closeMenu() {
this.isOpen = false;
},
addCategory() {
this.options.push({
label: `Какая-то категория ${this.options.length + 1}`,
});
},
openMenu() {
this.isOpen = !this.isOpen;
},
selected(label) {
this.model.category = label;
this.isOpen = false;
},
},
}; };
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>
.label
color: var(--font-grey-color)
.select
border: 1px solid var(--border-light-grey-color)
width: 436px
.open-menu
transform: rotate(180deg)
.open-select
border: 1.5px solid var(--btn-blue-color)
.menu-wrapper
margin-right: 5px
&::-webkit-scrollbar
width: 4px
&::-webkit-scrollbar-track:vertical
margin-top: 23px
.options
border-bottom: 1px solid var(--border-light-grey-color)
width: 419px
&:last-child
border-bottom: none
.item
width: 419px
&:hover
background: var(--bg-hover-row-table)
.tag
border-top: 1px solid var(--border-light-grey-color)
color: var(--btn-blue-color)
.buttons-group .buttons-group
padding: 16px 168px 0px 32px padding: 16px 168px 0px 32px
border-top: 1px solid var(--border-light-grey-color) border-top: 1px solid var(--border-light-grey-color)
margin-left: -40px margin-left: -32px
margin-right: -40px margin-right: -32px
column-gap: 7px column-gap: 7px
</style> </style>