diff --git a/src/views/pages/framework/datawarehouse/datawarehouse-edit.vue b/src/views/pages/framework/datawarehouse/datawarehouse-edit.vue index 998ba7a45b9c0a8f75864b9693abb275814430de..3249deb1cd8c351e34325b4e4049f26fbfb43772 100644 --- a/src/views/pages/framework/datawarehouse/datawarehouse-edit.vue +++ b/src/views/pages/framework/datawarehouse/datawarehouse-edit.vue @@ -251,15 +251,7 @@ export default { ], validateList: [{ name: 'required' }], onChange: dbType => { - if (dbType == 'mysql' || dbType == 'mongodb') { - this.reportDataSourceData.dbType = dbType; - } else { - let index = dbType.lastIndexOf('-'); - let type = dbType.substring(0, index); - let databaseId = dbType.substring(index + 1, dbType.length); - this.reportDataSourceData.dbType = type; - this.reportDataSourceData.databaseId = databaseId; - } + this.reportDataSourceData.dbType = dbType; } }, { @@ -437,6 +429,13 @@ export default { if (this.id) { this.reportDataSourceData.id = this.id; } + if (this.reportDataSourceData.dbType != 'mysql' && this.reportDataSourceData.dbType != 'mongodb') { + let index = this.reportDataSourceData.dbType.lastIndexOf('-'); + let type = this.reportDataSourceData.dbType.substring(0, index); + let databaseId = this.reportDataSourceData.dbType.substring(index + 1, this.reportDataSourceData.dbType.length); + this.reportDataSourceData.dbType = type; + this.reportDataSourceData.databaseId = databaseId; + } this.$api.framework.datawarehouse.saveDataSource(this.reportDataSourceData).then(res => { if (res.Status == 'OK') { this.$Message.success(this.$t('message.savesuccess'));