WIP Добавил форму для Основных данных
This commit is contained in:
@@ -3,14 +3,14 @@
|
|||||||
q-input(
|
q-input(
|
||||||
v-model="value",
|
v-model="value",
|
||||||
:class="{'circle': circle, 'font-input': true}",
|
:class="{'circle': circle, 'font-input': true}",
|
||||||
:input-style="{ color: textColor, width: width + 'px' }",
|
:input-style="{ color: textColor, width: width + 'px' , borderColor: borderColor}",
|
||||||
:borderless="borderless",
|
:borderless="borderless",
|
||||||
:placeholder="placeholder",
|
:placeholder="placeholder",
|
||||||
:outlined="outlined",
|
:outlined="outlined",
|
||||||
:dense="dense",
|
:dense="dense",
|
||||||
:type="type",
|
:type="type",
|
||||||
:filled="filled",
|
:filled="filled",
|
||||||
:bg-color="filled ? '' : 'white'",
|
:bg-color="filled || standout ? '' : 'white'",
|
||||||
:disable="disabled",
|
:disable="disabled",
|
||||||
:rules="rule",
|
:rules="rule",
|
||||||
:lazy-rules="lazyRule",
|
:lazy-rules="lazyRule",
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
:maxlength="maxLength",
|
:maxlength="maxLength",
|
||||||
:autogrow="autogrow",
|
:autogrow="autogrow",
|
||||||
:square="square",
|
:square="square",
|
||||||
|
:standout="standout"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
)
|
)
|
||||||
slot.cursor-pointer
|
slot.cursor-pointer
|
||||||
@@ -60,10 +61,15 @@ export default {
|
|||||||
type: {
|
type: {
|
||||||
default: "text",
|
default: "text",
|
||||||
},
|
},
|
||||||
|
standout: {
|
||||||
|
type: [Boolean, String],
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
mask: String,
|
mask: String,
|
||||||
width: Number,
|
width: Number,
|
||||||
maxLength: Number,
|
maxLength: Number,
|
||||||
textColor: String,
|
textColor: String,
|
||||||
|
borderColor: String,
|
||||||
rule: Array,
|
rule: Array,
|
||||||
lazyRule: [Boolean, String],
|
lazyRule: [Boolean, String],
|
||||||
noErrorIcon: Boolean,
|
noErrorIcon: Boolean,
|
||||||
|
|||||||
@@ -1,8 +1,69 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
|
medical-form-wrapper(title="Основная информация")
|
||||||
|
.form-wrap.form.flex.gap-24.w-full
|
||||||
|
.data-section.flex.flex-col.gap-4(v-for="data in configData")
|
||||||
|
.font-semibold.text-sm.whitespace-nowrap {{data.dataLabel}}
|
||||||
|
.flex.justify-between.items-center.gap-4(v-for="field in data.fields")
|
||||||
|
.label-field.font-sm.text-sm.whitespace-nowrap {{`${field.label} :`}}
|
||||||
|
.avatar-field.justify-start(v-if="field.type === 'avatar'")
|
||||||
|
base-avatar(:size="40")
|
||||||
|
base-input(v-else v-model="initData[data.dataKey][field.key]" :type="field.type" :width="300" standout="bg-white" text-color="black")
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import BaseInput from "@/components/base/BaseInput.vue";
|
||||||
|
import BaseAvatar from "@/components/base/BaseAvatar.vue";
|
||||||
|
import MedicalFormWrapper from "@/pages/newMedicalCard/components/MedicalFormWrapper.vue";
|
||||||
|
import { baseDataForm } from "@/pages/newMedicalCard/utils/configMedical";
|
||||||
export default {
|
export default {
|
||||||
name: "BasicDataForm",
|
name: "BasicDataForm",
|
||||||
|
components: { MedicalFormWrapper, BaseInput, BaseAvatar },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
configData: baseDataForm,
|
||||||
|
initData: {
|
||||||
|
basicData: {
|
||||||
|
last_name: "",
|
||||||
|
first_name: "",
|
||||||
|
patronymic: "",
|
||||||
|
gender: "",
|
||||||
|
birth_date: new Date(),
|
||||||
|
photo: "",
|
||||||
|
},
|
||||||
|
registrationAddress: {
|
||||||
|
region: "",
|
||||||
|
city: "",
|
||||||
|
street: "",
|
||||||
|
house_number: "",
|
||||||
|
apartment_number: "",
|
||||||
|
},
|
||||||
|
residenceAddress: {
|
||||||
|
region: "",
|
||||||
|
city: "",
|
||||||
|
street: "",
|
||||||
|
house_number: "",
|
||||||
|
apartment_number: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.avatar-field
|
||||||
|
min-width: 310px
|
||||||
|
.input
|
||||||
|
color: purple
|
||||||
|
.data-section
|
||||||
|
width: 30%
|
||||||
|
@media(max-width: 1900px)
|
||||||
|
width: 28%
|
||||||
|
@media(max-width: 1700px)
|
||||||
|
width: 100%
|
||||||
|
.form-wrap
|
||||||
|
@media(max-width: 1700px)
|
||||||
|
flex-direction: column
|
||||||
|
.label-field
|
||||||
|
color: var(--font-grey-color)
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.form-wrapper.relative.h-fit.rounded
|
.form-wrapper.relative.h-fit.rounded
|
||||||
transition(name="medical-form", mode="out-in")
|
transition(name="medical-form", mode="out-in")
|
||||||
.loader.absolute.flex.items-center.justify-center.w-full.h-full.rounded(v-if="isLoadingData")
|
.loader.absolute.z-10.flex.items-center.justify-center.w-full.h-full.rounded(v-if="isLoadingData")
|
||||||
base-loader
|
base-loader
|
||||||
.flex.flex-col.h-full.gap-25px.p-6
|
.flex.flex-col.h-full.gap-25px.p-6
|
||||||
.flex.w-fit.gap-11px.items-center
|
.flex.w-fit.gap-11px.items-center
|
||||||
@@ -48,8 +48,10 @@ export default {
|
|||||||
|
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
.form-wrapper
|
.form-wrapper
|
||||||
width: 1532px
|
width: 83.2%
|
||||||
background-color: var(--default-white)
|
background-color: var(--default-white)
|
||||||
|
@media (max-width: 600px)
|
||||||
|
width: fit-content
|
||||||
.edit-button
|
.edit-button
|
||||||
color: var(--btn-blue-color)
|
color: var(--btn-blue-color)
|
||||||
.loader
|
.loader
|
||||||
|
|||||||
@@ -1,34 +1,99 @@
|
|||||||
export const baseDataForm = [
|
export const baseDataForm = [
|
||||||
{
|
{
|
||||||
fieldName: "Личные данные",
|
dataLabel: "Личные данные",
|
||||||
|
dataKey: "basicData",
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
key: "last_name",
|
key: "last_name",
|
||||||
label: "Фамилия",
|
label: "Фамилия",
|
||||||
|
type: "text",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "first_name",
|
key: "first_name",
|
||||||
label: "Имя",
|
label: "Имя",
|
||||||
|
type: "text",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "patronymic",
|
key: "patronymic",
|
||||||
label: "Отчество",
|
label: "Отчество",
|
||||||
},
|
type: "text",
|
||||||
{
|
|
||||||
key: "patronymic",
|
|
||||||
label: "Отчество",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "gender",
|
key: "gender",
|
||||||
label: "Пол",
|
label: "Пол",
|
||||||
|
type: "text",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "birth_date",
|
key: "birth_date",
|
||||||
label: "Дата рождения",
|
label: "Дата рождения",
|
||||||
|
type: "date",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "photo",
|
key: "photo",
|
||||||
label: "Фото",
|
label: "Фото",
|
||||||
|
type: "avatar",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataLabel: "Адрес регистрации",
|
||||||
|
dataKey: "registrationAddress",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
key: "region",
|
||||||
|
label: "Регион",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "city",
|
||||||
|
label: "Город",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "street",
|
||||||
|
label: "Улица",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "house_number",
|
||||||
|
label: "Дом",
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "apartment_number",
|
||||||
|
label: "Квартира",
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataLabel: "Адрес проживания",
|
||||||
|
dataKey: "residenceAddress",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
key: "region",
|
||||||
|
label: "Регион",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "city",
|
||||||
|
label: "Город",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "street",
|
||||||
|
label: "Улица",
|
||||||
|
type: "text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "house_number",
|
||||||
|
label: "Дом",
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "apartment_number",
|
||||||
|
label: "Квартира",
|
||||||
|
type: "number",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user