1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

Bugfix/validate filled fields before saving (#444)

* Validate filled fields before saving

* remove console
This commit is contained in:
elsiosanchez 2020-04-14 00:09:53 -04:00 committed by GitHub
parent 7fcf5bb9a5
commit 1ac405ef53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -654,6 +654,10 @@ const panel = {
}
if (isSendToServer) {
const fieldsEmpty = getters.getFieldListEmptyMandatory({
containerUuid,
fieldsList
})
if (panelType === 'table' || isAdvancedQuery) {
if (field.isShowedFromUser && (field.oldValue !== field.value ||
['NULL', 'NOT_NULL'].includes(field.operator) ||
@ -703,7 +707,7 @@ const panel = {
console.warn(`Error getting Advanced Query (notifyFieldChange): ${error.message}. Code: ${error.code}.`)
})
}
} else if (!getters.isNotReadyForSubmit(containerUuid)) {
} else if (isEmptyValue(fieldsEmpty)) {
// TODO: refactory for it and change for a standard method
if (field.panelType === 'browser' && fieldIsDisplayed(field)) {
let isReadyForQuery = true
@ -788,10 +792,6 @@ const panel = {
}
}
} else {
const fieldsEmpty = getters.getFieldListEmptyMandatory({
containerUuid,
fieldsList
})
showMessage({
message: language.t('notifications.mandatoryFieldMissing') + fieldsEmpty,
type: 'info'