提交 5721088e authored 作者: taojinlong's avatar taojinlong

fix(數據源): 校驗 oracle schema

上级 66760cdf
...@@ -129,6 +129,7 @@ export default { ...@@ -129,6 +129,7 @@ export default {
password_error: 'The password can not be less than 8 digits' password_error: 'The password can not be less than 8 digits'
}, },
commons: { commons: {
success: 'Success',
switch_lang: 'Switch Language Success', switch_lang: 'Switch Language Success',
close: 'Close', close: 'Close',
icon: 'Icon', icon: 'Icon',
......
...@@ -129,6 +129,7 @@ export default { ...@@ -129,6 +129,7 @@ export default {
password_error: '密碼不小於 8 位' password_error: '密碼不小於 8 位'
}, },
commons: { commons: {
success: '成功',
switch_lang: '切換語言成功', switch_lang: '切換語言成功',
close: '關閉', close: '關閉',
icon: '圖標', icon: '圖標',
......
...@@ -129,6 +129,7 @@ export default { ...@@ -129,6 +129,7 @@ export default {
password_error: '密码不小于 8 位' password_error: '密码不小于 8 位'
}, },
commons: { commons: {
success: '成功',
switch_lang: '切换语言成功', switch_lang: '切换语言成功',
close: '关闭', close: '关闭',
icon: '图标', icon: '图标',
......
...@@ -101,8 +101,7 @@ export default { ...@@ -101,8 +101,7 @@ export default {
'configuration.username': [{ required: true, message: this.$t('datasource.please_input_user_name'), trigger: 'blur' }], '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.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.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.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' }]
}, },
allTypes: [{ name: 'mysql', label: 'MySQL', type: 'jdbc' }, { name: 'oracle', label: 'Oracle', type: 'jdbc' }], allTypes: [{ name: 'mysql', label: 'MySQL', type: 'jdbc' }, { name: 'oracle', label: 'Oracle', type: 'jdbc' }],
schemas: [], schemas: [],
...@@ -148,7 +147,7 @@ export default { ...@@ -148,7 +147,7 @@ export default {
this.$refs.dsForm.resetFields() this.$refs.dsForm.resetFields()
}, },
save() { save() {
if (!this.form.configuration.schema) { if (!this.form.configuration.schema && this.form.type === 'oracle') {
this.$message.error(this.$t('datasource.please_choose_schema')) this.$message.error(this.$t('datasource.please_choose_schema'))
return return
} }
...@@ -174,7 +173,7 @@ export default { ...@@ -174,7 +173,7 @@ export default {
data.configuration = JSON.stringify(data.configuration) data.configuration = JSON.stringify(data.configuration)
getSchema(data).then(res => { getSchema(data).then(res => {
this.schemas = res.data this.schemas = res.data
this.$success(this.$t('datasource.validate_success')) this.$success(this.$t('commons.success'))
}) })
} else { } else {
return false return false
...@@ -182,6 +181,10 @@ export default { ...@@ -182,6 +181,10 @@ export default {
}) })
}, },
validaDatasource() { 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 => { this.$refs.dsForm.validate(valid => {
if (valid) { if (valid) {
const data = JSON.parse(JSON.stringify(this.form)) const data = JSON.parse(JSON.stringify(this.form))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论