diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index 079116b137..f746574444 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -246,7 +246,7 @@ " :label="$t('datasource.extra_params')" > - + - - - - - - - + + + + + + + @@ -728,7 +728,8 @@ export default { { required: true, validator: this.nameRepeat, - trigger: 'blur' + trigger: 'blur', + message: i18n.t('commons.input_name') } ], desc: [ @@ -971,20 +972,24 @@ export default { }) }, nameRepeat(rule, value, callback) { + if (!value) { + callback(new Error(i18n.t('commons.input_name'))) + return + } let hasRepeatName = false - this.form.apiConfiguration.forEach((item) => { - if ( - item.name === this.apiItem.name && + this.form.apiConfiguration.forEach((item) => { + if ( + item.name === this.apiItem.name && item.serialNumber !== this.apiItem.serialNumber - ) { - hasRepeatName = true - } - }) - if (hasRepeatName) { - callback(new Error(i18n.t('theme.name_repeat'))); - return + ) { + hasRepeatName = true } - callback(); + }) + if (hasRepeatName) { + callback(new Error(i18n.t('theme.name_repeat'))) + return + } + callback() }, next() { if (this.active === 1) {