1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-12 22:29:59 +08:00

Validate if the field has a callout before updating or creating (#684)

* Validate if the field has a callout before updating or creating

* rename vairable
This commit is contained in:
Elsio Sanchez 2021-03-23 11:55:16 -04:00 committed by GitHub
parent 99525aa05a
commit 56716e0647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -199,7 +199,8 @@ export default {
} }
this.$store.dispatch('notifyFieldChange', { this.$store.dispatch('notifyFieldChange', {
containerUuid: this.metadata.containerUuid, containerUuid: this.metadata.containerUuid,
field: this.metadata field: this.metadata,
columnName: this.metadata.columnName
}) })
} }
} }

View File

@ -33,7 +33,21 @@ const callOutControl = {
oldValue, oldValue,
valueType valueType
}) { }) {
if (isEmptyValue(value) || isEmptyValue(callout)) { // Validate callout
if (isEmptyValue(callout)) {
const notifyChange = inTable ? 'notifyRowTableChange' : 'notifyPanelChange'
dispatch(notifyChange, {
parentUuid,
containerUuid,
row: value,
isEdit: true,
panelType: 'window',
newValues: value,
isSendToServer: false,
withOutColumnNames,
isSendCallout: false,
isChangeFromCallout: true
})
return undefined return undefined
} }
// Else // Else

View File

@ -598,6 +598,10 @@ const actions = {
fieldsList fieldsList
}) })
} }
showMessage({
message: language.t('notifications.updateFields') + ' ' + field.name,
type: 'success'
})
}) })
.catch(error => { .catch(error => {
showMessage({ showMessage({