Merge branch 'ASTRA-51' into 'master'
WIP Поправил валидации на инпутах и баг с обновлением формы See merge request andrusyakka/urban-couscous!328
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template lang="pug">
|
||||
button.base-button.text-base(
|
||||
type="button"
|
||||
:disabled="disabled",
|
||||
:class="{'rounded': rounded, 'outlined': outlined, 'outlined-red': outlinedRed, 'secondary': secondary, 'confirm': confirm, 'added': added, 'added-border-none': addedBorderNone}"
|
||||
:style="{height: size + 'px', minWidth: size + 'px'}"
|
||||
@@ -80,6 +81,8 @@ export default {
|
||||
&:disabled, &[disabled]
|
||||
background-color: var(--btn-blue-color-disabled)
|
||||
border: 1px solid var(--btn-blue-color-disabled)
|
||||
&:focus
|
||||
outline: 0
|
||||
.rounded
|
||||
padding: 0
|
||||
border-radius: 50%
|
||||
|
||||
@@ -66,10 +66,12 @@ export default {
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.avatar-wrapper
|
||||
width: 400px
|
||||
height: 400px
|
||||
min-width: 400px
|
||||
min-height: 400px
|
||||
border-radius: 50%
|
||||
.avatar
|
||||
min-width: 400px
|
||||
min-height: 400px
|
||||
height: 100%
|
||||
border-radius: 50%
|
||||
</style>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
v-if="isEdit"
|
||||
left-icon="icon-plus"
|
||||
added-border-none
|
||||
@click="addNewAllergy"
|
||||
@click="(e) => addNewAllergy(e)"
|
||||
:icon-left-size="12"
|
||||
)
|
||||
span.font-medium.text-base Добавить
|
||||
@@ -142,11 +142,13 @@ export default {
|
||||
checkChangeInput() {
|
||||
this.isCheckChange = checkChangeData(this.initAllergies, this.allergies);
|
||||
},
|
||||
addNewAllergy() {
|
||||
this.allergies.push({
|
||||
name: null,
|
||||
title: null,
|
||||
});
|
||||
addNewAllergy(e) {
|
||||
if (e.pointerType) {
|
||||
this.allergies.push({
|
||||
name: null,
|
||||
title: null,
|
||||
});
|
||||
}
|
||||
this.checkChangeInput();
|
||||
},
|
||||
deleteAllergy(index) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
)
|
||||
q-icon.icon(:name="mapNetworks[data.kind].icon" :class="{old: data.id, new: data.filled}")
|
||||
span.text-sm.font-medium {{ mapNetworks[data.kind].title || data.username }}
|
||||
.flex.gap-10px(v-else v-click-outside="() => checkNetworksField(index)")
|
||||
.flex.gap-10px(v-else v-click-outside="() => checkNetworksField(index)" :key="key+index")
|
||||
base-select-networks(
|
||||
:list-data="Object.values(mapNetworks)"
|
||||
:option-data="data.kind"
|
||||
@@ -33,8 +33,8 @@
|
||||
base-input.w-full(
|
||||
v-model="data.username"
|
||||
type="text"
|
||||
:name="key"
|
||||
no-error-icon
|
||||
:name="key"
|
||||
:rule="configData[key].rules"
|
||||
:standout="!isEdit"
|
||||
:outlined="isEdit"
|
||||
@@ -63,7 +63,7 @@
|
||||
left-icon="icon-plus"
|
||||
added-border-none
|
||||
:icon-left-size="12"
|
||||
@click="() => addNewContact(key)"
|
||||
@click="(e) => addNewContact(e, key)"
|
||||
)
|
||||
span.font-medium.text-base Добавить
|
||||
</template>
|
||||
@@ -181,18 +181,20 @@ export default {
|
||||
chooseNetwork(e, index) {
|
||||
this.contacts.networks[index].kind = e.currentTarget.id;
|
||||
},
|
||||
addNewContact(key) {
|
||||
if (key === "networks") {
|
||||
this.contacts[key].push({
|
||||
filled: false,
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
} else {
|
||||
this.contacts[key].push({
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
addNewContact(e, key) {
|
||||
if (e.pointerType) {
|
||||
if (key === "networks") {
|
||||
this.contacts[key].push({
|
||||
filled: false,
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
} else {
|
||||
this.contacts[key].push({
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
}
|
||||
}
|
||||
this.checkChangeInput();
|
||||
},
|
||||
|
||||
@@ -12,15 +12,8 @@ export function ruleOptionalFields(val, minLength, text) {
|
||||
}
|
||||
|
||||
export function ruleEmailValue(val, text) {
|
||||
return (
|
||||
(val &&
|
||||
val.length < 100 &&
|
||||
val.includes("@") &&
|
||||
val.match(/@(?=\S+)/) &&
|
||||
val.match(/(?<=\S+)@/)) ||
|
||||
text ||
|
||||
false
|
||||
);
|
||||
const regExp = new RegExp(/^[^\s()<>@,;:/]+@\w[\w.-]+\.[a-z]{2,}$/i);
|
||||
return (val && val.length < 100 && regExp.test(val)) || text || false;
|
||||
}
|
||||
|
||||
export function ruleMaxLength(val, maxLength, text) {
|
||||
|
||||
@@ -70,15 +70,14 @@ const getters = {
|
||||
let DMS = person?.insurance_policy?.find((e) => e.title === "DMS");
|
||||
return {
|
||||
personalData: {
|
||||
last_name: person?.last_name,
|
||||
first_name: person?.first_name,
|
||||
patronymic: person?.patronymic,
|
||||
last_name: person?.last_name || "",
|
||||
first_name: person?.first_name || "",
|
||||
patronymic: person?.patronymic || "",
|
||||
gender:
|
||||
person?.gender &&
|
||||
genderOptions.find((el) => el.id === person?.gender),
|
||||
birth_date: person?.birth_date
|
||||
? new Date(person?.birth_date)
|
||||
: new Date(),
|
||||
(person?.gender &&
|
||||
genderOptions.find((el) => el.id === person?.gender)) ||
|
||||
"",
|
||||
birth_date: person?.birth_date ? new Date(person?.birth_date) : "",
|
||||
photo: person?.photo
|
||||
? {
|
||||
photo: rootState.getUrl + person.photo,
|
||||
@@ -88,20 +87,20 @@ const getters = {
|
||||
id: person?.id,
|
||||
},
|
||||
registrationAddress: {
|
||||
region: registrationAddress?.region,
|
||||
city: registrationAddress?.city,
|
||||
street: registrationAddress?.street,
|
||||
house_number: registrationAddress?.house_number,
|
||||
apartment_number: registrationAddress?.apartment_number,
|
||||
id: registrationAddress?.id,
|
||||
region: registrationAddress?.region || "",
|
||||
city: registrationAddress?.city || "",
|
||||
street: registrationAddress?.street || "",
|
||||
house_number: registrationAddress?.house_number || "",
|
||||
apartment_number: registrationAddress?.apartment_number || "",
|
||||
id: registrationAddress?.id || "",
|
||||
},
|
||||
residenceAddress: {
|
||||
region: residenceAddress?.region,
|
||||
city: residenceAddress?.city,
|
||||
street: residenceAddress?.street,
|
||||
house_number: residenceAddress?.house_number,
|
||||
apartment_number: residenceAddress?.apartment_number,
|
||||
id: residenceAddress?.id,
|
||||
region: residenceAddress?.region || "",
|
||||
city: residenceAddress?.city || "",
|
||||
street: residenceAddress?.street || "",
|
||||
house_number: residenceAddress?.house_number || "",
|
||||
apartment_number: residenceAddress?.apartment_number || "",
|
||||
id: residenceAddress?.id || "",
|
||||
},
|
||||
insuranceDMS: {
|
||||
series: DMS?.series,
|
||||
|
||||
Reference in New Issue
Block a user