From 095a66f225ce66dbd5982c4f8fb35cab1b16dee9 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 27 Jan 2022 13:52:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=98=BE=E7=A4=BA=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=9A=84=E9=87=8D=E5=A4=8D=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/datasource/form.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/system/datasource/form.vue b/frontend/src/views/system/datasource/form.vue index 4491546ce5..5a4813f571 100644 --- a/frontend/src/views/system/datasource/form.vue +++ b/frontend/src/views/system/datasource/form.vue @@ -351,7 +351,7 @@ export default { return } let repeat = false - let repeatDsName = '' + let repeatDsName = [] this.tData.forEach(item => { if(item.id === this.form.type){ item.children.forEach(child => { @@ -369,7 +369,7 @@ export default { case 'mariadb': if(configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port){ repeat = true - repeatDsName = child.name + repeatDsName.push(child.name) } break case 'pg': @@ -378,13 +378,13 @@ export default { case 'oracle': case 'db2': if(configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port && configuration.schema == this.form.configuration.schema){ - repeatDsName = child.name + repeatDsName.push(child.name) repeat = true } break case 'es': if(configuration.url == this.form.configuration.url){ - repeatDsName = child.name + repeatDsName.push(child.name) repeat = true } break @@ -404,7 +404,7 @@ export default { form.configuration = JSON.stringify(form.configuration) if (this.formType === 'modify' && this.originConfiguration !== form.configuration) { if(repeat){ - $confirm(i18n.t('datasource.repeat_datasource_msg') + '[' + repeatDsName + '], ' + i18n.t('datasource.confirm_save'), () => { + $confirm(i18n.t('datasource.repeat_datasource_msg') + '[' + repeatDsName.join(',') + '], ' + i18n.t('datasource.confirm_save'), () => { $confirm(i18n.t('datasource.edit_datasource_msg'), () => { this.method(method, form) }) @@ -417,7 +417,7 @@ export default { return } if(repeat){ - $confirm(i18n.t('datasource.repeat_datasource_msg') + '[' + repeatDsName + '], ' + i18n.t('datasource.confirm_save'), () => { + $confirm(i18n.t('datasource.repeat_datasource_msg') + '[' + repeatDsName.join(',') + '], ' + i18n.t('datasource.confirm_save'), () => { this.method(method, form) }) }else {