WIP Исправил баги ASTRA-53, ASTRA-54, добавил валибацию
This commit is contained in:
@@ -31,10 +31,11 @@
|
||||
:size-input="50"
|
||||
)
|
||||
base-input.w-full(
|
||||
:disabled="!isEdit"
|
||||
v-model="data.username"
|
||||
:mask="configData[key].inputMask"
|
||||
type="text"
|
||||
type="text"
|
||||
:name="key"
|
||||
no-error-icon
|
||||
:rule="configData[key].rules"
|
||||
:standout="!isEdit"
|
||||
:outlined="isEdit"
|
||||
text-color="black"
|
||||
@@ -43,8 +44,10 @@
|
||||
v-else
|
||||
:disabled="!isEdit"
|
||||
v-model="data.username"
|
||||
:name="key"
|
||||
:mask="configData[key].inputMask"
|
||||
:rule="configData[key].rules"
|
||||
no-error-icon
|
||||
@update:model-value="checkChangeInput"
|
||||
type="text"
|
||||
:standout="!isEdit"
|
||||
@@ -71,14 +74,25 @@ import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseButton from "@/components/base/BaseButton.vue";
|
||||
import BaseSelectNetworks from "@/components/base/BaseSelectNetworks.vue";
|
||||
import { mapNetworks } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||
import { checkChangeData } from "@/shared/utils/changesObjects";
|
||||
import TheNotificationProvider from "@/components/Notifications/TheNotificationProvider.vue";
|
||||
import { addNotification } from "@/components/Notifications/notificationContext";
|
||||
import {
|
||||
checkChangeData,
|
||||
getFieldsNameUnvalidated,
|
||||
} from "@/shared/utils/changesObjects";
|
||||
import { contactsDataForm } from "@/pages/newMedicalCard/utils/medicalConfig";
|
||||
import { getRequestArrayData } from "@/shared/utils/wrapperRequestChangeData";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ContactsForm",
|
||||
components: { MedicalFormWrapper, BaseInput, BaseSelectNetworks, BaseButton },
|
||||
components: {
|
||||
MedicalFormWrapper,
|
||||
BaseInput,
|
||||
BaseSelectNetworks,
|
||||
BaseButton,
|
||||
TheNotificationProvider,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isEdit: false,
|
||||
@@ -145,6 +159,16 @@ export default {
|
||||
this.isEdit = false;
|
||||
this.isCheckChange = false;
|
||||
});
|
||||
} else {
|
||||
getFieldsNameUnvalidated(form).forEach((errorKey) => {
|
||||
addNotification(
|
||||
this.configData[errorKey].title,
|
||||
this.configData[errorKey].title,
|
||||
this.configData[errorKey].error,
|
||||
"error",
|
||||
5000
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -161,12 +185,12 @@ export default {
|
||||
if (key === "networks") {
|
||||
this.contacts[key].push({
|
||||
filled: false,
|
||||
kind: null,
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
} else {
|
||||
this.contacts[key].push({
|
||||
kind: this.configData[key].kind,
|
||||
kind: this.configData[key]?.kind,
|
||||
username: null,
|
||||
});
|
||||
}
|
||||
@@ -190,7 +214,7 @@ export default {
|
||||
&.new
|
||||
color: var(--icon-violet-color)
|
||||
.input-wrapper
|
||||
width: 324px
|
||||
width: 302px
|
||||
.form-wrap
|
||||
display: grid
|
||||
grid-template-columns: repeat(3, auto)
|
||||
|
||||
Reference in New Issue
Block a user