fix: 切换插件类型数据源不生效

This commit is contained in:
taojinlong 2022-05-31 22:17:29 +08:00
parent 5608e576cd
commit 2f8beea85b
2 changed files with 11 additions and 6 deletions

View File

@ -419,24 +419,18 @@ public class ChartViewService {
}
datasourceRequest.setQuery(sql);
data = datasourceProvider.getData(datasourceRequest);
Map<String, Object> mapChart = pluginViewResult(pluginViewParam, view, data, isDrill);
Map<String, Object> mapTableNormal = ChartDataBuild.transTableNormal(xAxis, yAxis, view, data, extStack, desensitizationList);
return data;
// 如果是插件到此结束
}
//如果不是插件视图 走原生逻辑
if (table.getMode() == 0) {// 直连
// Datasource ds = datasourceService.get(table.getDataSourceId());
if (ObjectUtils.isEmpty(ds)) {
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
}
if (StringUtils.isNotEmpty(ds.getStatus()) && ds.getStatus().equalsIgnoreCase("Error")) {
throw new Exception(Translator.get("i18n_invalid_ds"));
}
// DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
datasourceRequest.setDatasource(ds);
DataTableInfoDTO dataTableInfoDTO = gson.fromJson(table.getInfo(), DataTableInfoDTO.class);
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());

View File

@ -56,6 +56,17 @@ export default {
this.showAsync = false
}
},
watch: {
'componentName': function () {
this.refId = uuid.v1
if (this.componentName) {
this.showAsync = true
this.url = this.baseUrl + this.componentName
} else {
this.showAsync = false
}
}
},
methods: {
// hasLicense
executeAxios(options) {