forked from github/dataease
fix(数据源): 校验数据源重复
This commit is contained in:
parent
834cab55e8
commit
8b38303a08
@ -340,54 +340,85 @@ export default {
|
|||||||
}
|
}
|
||||||
let repeat = false
|
let repeat = false
|
||||||
const repeatDsName = []
|
const repeatDsName = []
|
||||||
this.tData.forEach(item => {
|
if(!this.datasourceType.isPlugin){
|
||||||
if (item.id === this.form.type) {
|
this.tData.forEach(item => {
|
||||||
item.children.forEach(child => {
|
if (item.id === this.form.type) {
|
||||||
if (this.formType === 'modify' && child.id === this.form.id) {
|
item.children.forEach(child => {
|
||||||
return
|
if (this.formType === 'modify' && child.id === this.form.id) {
|
||||||
}
|
return
|
||||||
const configuration = JSON.parse(child.configuration)
|
}
|
||||||
if (!configuration) {
|
const configuration = JSON.parse(child.configuration)
|
||||||
return
|
if (!configuration) {
|
||||||
}
|
return
|
||||||
switch (this.form.type) {
|
}
|
||||||
case 'mysql':
|
switch (this.form.type) {
|
||||||
case 'TiDB':
|
case 'mysql':
|
||||||
case 'StarRocks':
|
case 'TiDB':
|
||||||
case 'hive':
|
case 'StarRocks':
|
||||||
case 'mariadb':
|
case 'hive':
|
||||||
case 'ds_doris':
|
case 'mariadb':
|
||||||
case 'ck':
|
case 'ds_doris':
|
||||||
case 'mongo':
|
case 'ck':
|
||||||
case 'mariadb':
|
case 'mongo':
|
||||||
case 'impala':
|
case 'mariadb':
|
||||||
if (configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port) {
|
case 'impala':
|
||||||
repeat = true
|
if (configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port) {
|
||||||
repeatDsName.push(child.name)
|
repeat = true
|
||||||
}
|
repeatDsName.push(child.name)
|
||||||
break
|
}
|
||||||
case 'pg':
|
break
|
||||||
case 'sqlServer':
|
case 'pg':
|
||||||
case 'redshift':
|
case 'sqlServer':
|
||||||
case 'oracle':
|
case 'redshift':
|
||||||
case 'db2':
|
case 'oracle':
|
||||||
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) {
|
case 'db2':
|
||||||
repeatDsName.push(child.name)
|
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) {
|
||||||
repeat = true
|
repeatDsName.push(child.name)
|
||||||
}
|
repeat = true
|
||||||
break
|
}
|
||||||
case 'es':
|
break
|
||||||
if (configuration.url == this.form.configuration.url) {
|
case 'es':
|
||||||
repeatDsName.push(child.name)
|
if (configuration.url == this.form.configuration.url) {
|
||||||
repeat = true
|
repeatDsName.push(child.name)
|
||||||
}
|
repeat = true
|
||||||
break
|
}
|
||||||
default:
|
break
|
||||||
break
|
default:
|
||||||
}
|
break
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
if( this.datasourceType.isJdbc){
|
||||||
|
this.tData.forEach(item => {
|
||||||
|
if (item.id === this.form.type) {
|
||||||
|
item.children.forEach(child => {
|
||||||
|
if (this.formType === 'modify' && child.id === this.form.id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const configuration = JSON.parse(child.configuration)
|
||||||
|
if (!configuration) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(configuration.schema != null){
|
||||||
|
if (configuration.schema == this.form.configuration.schema && configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port) {
|
||||||
|
repeat = true
|
||||||
|
repeatDsName.push(child.name)
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if (configuration.host == this.form.configuration.host && configuration.dataBase == this.form.configuration.dataBase && configuration.port == this.form.configuration.port) {
|
||||||
|
repeat = true
|
||||||
|
repeatDsName.push(child.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let status = null
|
let status = null
|
||||||
if (this.datasourceType.isPlugin) {
|
if (this.datasourceType.isPlugin) {
|
||||||
|
Loading…
Reference in New Issue
Block a user