diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 078a5c4294..1b908c0752 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1377,7 +1377,7 @@ export default { priority: 'Advanced setting', extra_params: 'Extra JDBC connection string', please_input_dataPath: 'Please enter the JsonPath data path', - warning: 'Contains invalid datasets', + warning: 'Contains invalid table', data_table: 'Dataset Table', data_table_name: 'Dataset Table name', method: 'Request mode', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index fd2574e195..420d0effdd 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1378,7 +1378,7 @@ export default { priority: '高級設置', extra_params: '額外的JDBC連接字符串', please_input_dataPath: '請輸入 JsonPath 數據路徑', - warning: '包含無效數據機', + warning: '包含無效數據表', data_table: '數據表', data_table_name: '數據表名稱', method: '請求方式', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index f518fe3735..759e36a20c 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1386,7 +1386,7 @@ export default { all_compute_mode: '直连、抽取模式', extra_params: '额外的JDBC连接字符串', please_input_dataPath: '请输入 JsonPath 数据路径', - warning: '包含无效数据集', + warning: '包含无效数据表', data_table: '数据表', data_table_name: '数据表名称', method: '请求方式', diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index c96ffd6b7a..4ad92c5e2c 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -43,7 +43,7 @@ - @@ -204,10 +204,14 @@ import i18n from "@/lang"; import {checkApiDatasource} from "@/api/system/datasource"; +import ApiHttpRequestForm from '@/views/system/datasource/ApiHttpRequestForm' +import LayoutContent from '@/components/business/LayoutContent' export default { name: "DsConfiguration", components: { + ApiHttpRequestForm, + LayoutContent }, props: { disabled: { @@ -219,12 +223,6 @@ export default { method: String, request: {}, response: {}, - editApiItem: { - type: Boolean, - default() { - return false; - } - }, showScript: { type: Boolean, default: true, diff --git a/frontend/src/views/system/datasource/form.vue b/frontend/src/views/system/datasource/form.vue index fa7be7ddf0..ccc186aa0c 100644 --- a/frontend/src/views/system/datasource/form.vue +++ b/frontend/src/views/system/datasource/form.vue @@ -41,7 +41,7 @@ - + @@ -239,6 +239,7 @@ export default { } else { this.create() if (this.params && this.params.type) { + this.setType() this.changeType() } } @@ -347,6 +348,18 @@ export default { } }) + let status = null; + if(this.datasourceType.isPlugin){ + status = this.$refs['pluginDsConfig'].callPluginInner({methodName: 'validate'}) + }else { + status = this.$refs['dsConfig'].$refs['DsConfig'].validate(valid => { + status = valid + }) + } + if(!status){ + return; + } + this.$refs.dsForm.validate(valid => { if (!valid) { return false @@ -411,6 +424,7 @@ export default { }) }, validaDatasource() { + console.log(this.$refs) if (!this.form.configuration.schema && this.form.type === 'oracle') { this.$message.error(i18n.t('datasource.please_choose_schema')) return @@ -423,7 +437,12 @@ export default { if(this.datasourceType.isPlugin){ status = this.$refs['pluginDsConfig'].callPluginInner({methodName: 'validate'}) }else { - status = this.$refs['dsConfig'].$refs['DsConfig'].validate + this.$refs['dsConfig'].$refs['DsConfig'].validate(valid => { + status = valid + if(!valid){ + return + } + }) } if(!status){ return;