fix(數據源): 校驗 oracle schema
This commit is contained in:
parent
66760cdf9a
commit
5721088ec3
@ -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',
|
||||
|
||||
@ -129,6 +129,7 @@ export default {
|
||||
password_error: '密碼不小於 8 位'
|
||||
},
|
||||
commons: {
|
||||
success: '成功',
|
||||
switch_lang: '切換語言成功',
|
||||
close: '關閉',
|
||||
icon: '圖標',
|
||||
|
||||
@ -129,6 +129,7 @@ export default {
|
||||
password_error: '密码不小于 8 位'
|
||||
},
|
||||
commons: {
|
||||
success: '成功',
|
||||
switch_lang: '切换语言成功',
|
||||
close: '关闭',
|
||||
icon: '图标',
|
||||
|
||||
@ -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))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user