From 29ad3ca3d8cae15b2805a5948d130672534ad8af Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 30 Sep 2022 11:18:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20API=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/datasource/DsConfiguration.vue | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) 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) {