mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 23:20:12 +08:00
Bugfix/validate filled fields before saving (#444)
* Validate filled fields before saving * remove console
This commit is contained in:
parent
7fcf5bb9a5
commit
1ac405ef53
@ -654,6 +654,10 @@ const panel = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isSendToServer) {
|
if (isSendToServer) {
|
||||||
|
const fieldsEmpty = getters.getFieldListEmptyMandatory({
|
||||||
|
containerUuid,
|
||||||
|
fieldsList
|
||||||
|
})
|
||||||
if (panelType === 'table' || isAdvancedQuery) {
|
if (panelType === 'table' || isAdvancedQuery) {
|
||||||
if (field.isShowedFromUser && (field.oldValue !== field.value ||
|
if (field.isShowedFromUser && (field.oldValue !== field.value ||
|
||||||
['NULL', 'NOT_NULL'].includes(field.operator) ||
|
['NULL', 'NOT_NULL'].includes(field.operator) ||
|
||||||
@ -703,7 +707,7 @@ const panel = {
|
|||||||
console.warn(`Error getting Advanced Query (notifyFieldChange): ${error.message}. Code: ${error.code}.`)
|
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
|
// TODO: refactory for it and change for a standard method
|
||||||
if (field.panelType === 'browser' && fieldIsDisplayed(field)) {
|
if (field.panelType === 'browser' && fieldIsDisplayed(field)) {
|
||||||
let isReadyForQuery = true
|
let isReadyForQuery = true
|
||||||
@ -788,10 +792,6 @@ const panel = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const fieldsEmpty = getters.getFieldListEmptyMandatory({
|
|
||||||
containerUuid,
|
|
||||||
fieldsList
|
|
||||||
})
|
|
||||||
showMessage({
|
showMessage({
|
||||||
message: language.t('notifications.mandatoryFieldMissing') + fieldsEmpty,
|
message: language.t('notifications.mandatoryFieldMissing') + fieldsEmpty,
|
||||||
type: 'info'
|
type: 'info'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user