diff --git a/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index 78c4d47b4a..0716e5355f 100644 --- a/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -294,7 +294,7 @@ public class ChartViewService { if (ObjectUtils.isNotEmpty(datasetTable)) { result.setDatasetMode(datasetTable.getMode()); Datasource datasource = datasourceService.get(datasetTable.getDataSourceId()); - result.setDatasourceType(datasource != null ? datasource.getType() : null); + buildDsType(datasource, result); } return result; } catch (Exception e) { @@ -322,7 +322,7 @@ public class ChartViewService { if (ObjectUtils.isNotEmpty(datasetTable)) { view.setDatasetMode(datasetTable.getMode()); Datasource datasource = datasourceService.get(datasetTable.getDataSourceId()); - view.setDatasourceType(datasource != null ? datasource.getType() : null); + buildDsType(datasource, view); } // 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性 if (CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) { @@ -2349,4 +2349,24 @@ public class ChartViewService { view.setCustomFilter(gson.toJson(tree)); } } + + public void buildDsType(Datasource datasource, ChartViewDTO result) { + if (datasource != null) { + if (StringUtils.equalsIgnoreCase(datasource.getType(), "sqlServer")) { + if (datasource.getVersion() == null) { + result.setDatasourceType(datasource.getType()); + } else { + if (Integer.parseInt(datasource.getVersion()) < 11) { + result.setDatasourceType(datasource.getType() + "_all"); + } else { + result.setDatasourceType(datasource.getType()); + } + } + } else { + result.setDatasourceType(datasource.getType()); + } + } else { + result.setDatasourceType(null); + } + } } diff --git a/core/frontend/src/views/chart/chart/chart.js b/core/frontend/src/views/chart/chart/chart.js index 91c3451899..d790f5510d 100644 --- a/core/frontend/src/views/chart/chart/chart.js +++ b/core/frontend/src/views/chart/chart/chart.js @@ -1216,7 +1216,7 @@ export const CHART_FONT_LETTER_SPACE = [ { name: '10px', value: '10' } ] -export const NOT_SUPPORT_PAGE_DATASET = ['kylin', 'es', 'presto', 'StarRocks'] +export const NOT_SUPPORT_PAGE_DATASET = ['kylin', 'sqlServer_all', 'es', 'presto', 'StarRocks'] export const SUPPORT_Y_M = ['y', 'y_M', 'y_M_d']