mirror of
https://github.com/dataease/dataease.git
synced 2026-05-16 05:50:45 +08:00
refactor(仪表板、数据大屏): 导出应用增加禁用api数据源提示
This commit is contained in:
@@ -232,7 +232,9 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
newDatasourceId.add(datasourceOld.getSystemDatasourceId());
|
||||
// Excel 数据表明映射
|
||||
if (StringUtils.isNotEmpty(datasourceOld.getConfiguration())) {
|
||||
if (datasourceOld.getType().equals(DatasourceConfiguration.DatasourceType.Excel.name())) {
|
||||
if (datasourceOld.getType().equals(DatasourceConfiguration.DatasourceType.API.name())) {
|
||||
DEException.throwException(Translator.get("i18n_app_error_no_api"));
|
||||
} else if (datasourceOld.getType().equals(DatasourceConfiguration.DatasourceType.Excel.name())) {
|
||||
dsTableNamesMap.put(datasourceOld.getId(), ExcelUtils.getTableNamesMap(datasourceOld.getType(), datasourceOld.getConfiguration()));
|
||||
} else if (datasourceOld.getType().contains(DatasourceConfiguration.DatasourceType.API.name())) {
|
||||
dsTableNamesMap.put(datasourceOld.getId(), (Map<String, String>) datasourceServer.invokeMethod(datasourceOld.getType(), "getTableNamesMap", String.class, datasourceOld.getConfiguration()));
|
||||
@@ -338,7 +340,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
appDsTableNamesMap.forEach((keyName, valueName) -> {
|
||||
if (!CollectionUtils.isEmpty(systemDsTableNamesMap) && StringUtils.isNotEmpty(systemDsTableNamesMap.get(keyName))) {
|
||||
dsGroup.setInfo(dsGroup.getInfo().replaceAll(valueName, systemDsTableNamesMap.get(keyName)));
|
||||
}else{
|
||||
} else {
|
||||
dsGroup.setInfo(dsGroup.getInfo().replaceAll(valueName, "excel_can_not_find"));
|
||||
}
|
||||
});
|
||||
@@ -813,6 +815,9 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
|
||||
if (CollectionUtils.isEmpty(datasourceVOInfo)) {
|
||||
DEException.throwException("当前不存在数据源无法导出");
|
||||
} else if(datasourceVOInfo.stream()
|
||||
.anyMatch(datasource -> DatasourceConfiguration.DatasourceType.API.name().equals(datasource.getType()))){
|
||||
DEException.throwException(Translator.get("i18n_app_error_no_api"));
|
||||
}
|
||||
|
||||
List<VisualizationLinkageVO> linkageVOInfo = appTemplateMapper.findAppLinkageInfo(dvId);
|
||||
|
||||
@@ -209,3 +209,4 @@ i18n_unsupported_file_format=Unsupported file format!
|
||||
i18n_invalid_address=Invalid address!
|
||||
i18n_unsupported_protocol=Unsupported protocol!
|
||||
i18n_excel_error_first_row=Empty cells are not allowed in the middle of the first row!
|
||||
i18n_app_error_no_api=Current API data source is not supported.
|
||||
|
||||
@@ -208,3 +208,4 @@ i18n_unsupported_file_format=\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u683c\u5f0f\uf
|
||||
i18n_invalid_address=\u65e0\u6548\u7684\u5730\u5740\uff01
|
||||
i18n_unsupported_protocol=\u4e0d\u652f\u6301\u7684\u534f\u8bae\uff01
|
||||
i18n_excel_error_first_row=\u9996\u884c\u884c\u4e2d\u4e0d\u5141\u8bb8\u6709\u7a7a\u5355\u5143\u683c\uff01
|
||||
i18n_app_error_no_api=\u5f53\u524d\u4e0d\u652f\u6301API\u6570\u636e\u6e90\u3002
|
||||
|
||||
@@ -208,3 +208,4 @@ i18n_unsupported_file_format=\u4e0d\u652f\u63f4\u7684\u6587\u4ef6\u683c\u5f0f\uf
|
||||
i18n_invalid_address=\u7121\u6548\u7684\u5730\u5740\uff01
|
||||
i18n_unsupported_protocol=\u4e0d\u652f\u63f4\u7684\u5354\u8b70\uff01
|
||||
i18n_excel_error_first_row=\u9996\u884c\u884c\u4e2d\u4e0d\u5141\u8a31\u6709\u7a7a\u5132\u5b58\u683c\uff01
|
||||
i18n_app_error_no_api=\u7576\u524d\u4e0d\u652f\u63f4API\u6578\u64da\u6e90\u3002
|
||||
|
||||
Reference in New Issue
Block a user