Merge pull request #179 from dataease/pr@dev@oracle

fix(數據源): 校驗 oracle schema
This commit is contained in:
taojinlong 2021-07-08 09:55:24 +08:00 committed by GitHub
commit 27d2f50bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -129,6 +129,7 @@ export default {
password_error: 'The password can not be less than 8 digits'
},
commons: {
success: 'Success',
switch_lang: 'Switch Language Success',
close: 'Close',
icon: 'Icon',

View File

@ -129,6 +129,7 @@ export default {
password_error: '密碼不小於 8 位'
},
commons: {
success: '成功',
switch_lang: '切換語言成功',
close: '關閉',
icon: '圖標',

View File

@ -129,6 +129,7 @@ export default {
password_error: '密码不小于 8 位'
},
commons: {
success: '成功',
switch_lang: '切换语言成功',
close: '关闭',
icon: '图标',

View File

@ -101,8 +101,7 @@ export default {
'configuration.username': [{ required: true, message: this.$t('datasource.please_input_user_name'), trigger: 'blur' }],
'configuration.password': [{ required: true, message: this.$t('datasource.please_input_password'), trigger: 'change' }],
'configuration.host': [{ required: true, message: this.$t('datasource.please_input_host'), trigger: 'change' }],
'configuration.port': [{ required: true, message: this.$t('datasource.please_input_port'), trigger: 'change' }],
'configuration.schema': [{ required: true, message: this.$t('datasource.please_choose_schema'), trigger: 'change' }]
'configuration.port': [{ required: true, message: this.$t('datasource.please_input_port'), trigger: 'change' }]
},
allTypes: [{ name: 'mysql', label: 'MySQL', type: 'jdbc' }, { name: 'oracle', label: 'Oracle', type: 'jdbc' }],
schemas: [],
@ -148,7 +147,7 @@ export default {
this.$refs.dsForm.resetFields()
},
save() {
if (!this.form.configuration.schema) {
if (!this.form.configuration.schema && this.form.type === 'oracle') {
this.$message.error(this.$t('datasource.please_choose_schema'))
return
}
@ -174,7 +173,7 @@ export default {
data.configuration = JSON.stringify(data.configuration)
getSchema(data).then(res => {
this.schemas = res.data
this.$success(this.$t('datasource.validate_success'))
this.$success(this.$t('commons.success'))
})
} else {
return false
@ -182,6 +181,10 @@ export default {
})
},
validaDatasource() {
if (!this.form.configuration.schema && this.form.type === 'oracle') {
this.$message.error(this.$t('datasource.please_choose_schema'))
return
}
this.$refs.dsForm.validate(valid => {
if (valid) {
const data = JSON.parse(JSON.stringify(this.form))