diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java index 87a7361254..97b9343ee9 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java @@ -115,7 +115,9 @@ public class ChartDataManage { if (StringUtils.equalsIgnoreCase(view.getType(), "table-pivot") || StringUtils.containsIgnoreCase(view.getType(), "group") || ("antv".equalsIgnoreCase(view.getRender()) && "line".equalsIgnoreCase(view.getType())) - || StringUtils.equalsIgnoreCase(view.getType(), "flow-map")) { + || StringUtils.equalsIgnoreCase(view.getType(), "flow-map") + || StringUtils.equalsIgnoreCase(view.getType(), "sankey") + ) { xAxis.addAll(xAxisExt); } List yAxis = new ArrayList<>(view.getYAxis()); diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/ApiUtils.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/ApiUtils.java index 381b53db65..d6317d83cc 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/ApiUtils.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/ApiUtils.java @@ -59,7 +59,7 @@ public class ApiUtils { if (apiDefinition == null) { DEException.throwException("未找到"); } - String response = execHttpRequest(apiDefinition, 10); + String response = execHttpRequest(apiDefinition, apiDefinition.getApiQueryTimeout() == null || apiDefinition.getApiQueryTimeout() <= 0 ? 10 : apiDefinition.getApiQueryTimeout()); fieldList = getTableFields(apiDefinition); result.put("fieldList", fieldList); dataList = fetchResult(response, apiDefinition); @@ -116,7 +116,7 @@ public class ApiUtils { if (apiDefinition == null) { DEException.throwException("未找到"); } - String response = execHttpRequest(apiDefinition, 10); + String response = execHttpRequest(apiDefinition, apiDefinition.getApiQueryTimeout() == null || apiDefinition.getApiQueryTimeout() <= 0 ? 10 : apiDefinition.getApiQueryTimeout()); return fetchResult(response, apiDefinition); } @@ -194,6 +194,26 @@ public class ApiUtils { return response; } + private static void previewNum(List> field){ + for (Map stringObjectMap : field) { + JSONArray newArray = new JSONArray(); + if (stringObjectMap.get("value") != null) { + try { + TypeReference listTypeReference = new TypeReference() { + }; + JSONArray array = objectMapper.readValue(stringObjectMap.get("value").toString(), listTypeReference); + if(array.size() > 100){ + for (int i = 0; i < Math.min(100, array.size()); i++) { + newArray.add(array.get(i)); + } + stringObjectMap.put("value", newArray); + } + } catch (Exception e) { + + } + } + } + } public static ApiDefinition checkApiDefinition(ApiDefinition apiDefinition, String response) throws DEException { if (StringUtils.isEmpty(response)) { @@ -217,6 +237,7 @@ public class ApiUtils { rootPath = "$"; handleStr(apiDefinition, response, fields, rootPath); } + previewNum(fields); apiDefinition.setJsonFields(fields); return apiDefinition; } else { diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java index d470419222..0964609d9e 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java @@ -39,6 +39,8 @@ import java.math.BigDecimal; import java.net.URL; import java.sql.*; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -115,7 +117,11 @@ public class CalciteProvider { tableDesc.setDatasourceId(datasourceRequest.getDatasource().getId()); tableDesc.setType("db"); tableDesc.setTableName(resultSet.getString(1)); - tableDesc.setName(resultSet.getString(1)); + if(resultSet.getMetaData().getColumnCount() > 1){ + tableDesc.setName(resultSet.getString(2)); + }else { + tableDesc.setName(resultSet.getString(1)); + } return tableDesc; } @@ -313,6 +319,7 @@ public class CalciteProvider { private String getTableFiledSql(DatasourceRequest datasourceRequest) { String sql = ""; DatasourceConfiguration configuration = null; + String database=""; DatasourceType datasourceType = DatasourceType.valueOf(datasourceRequest.getDatasource().getType()); switch (datasourceType) { case mysql: @@ -322,7 +329,16 @@ public class CalciteProvider { case StarRocks: case doris: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Mysql.class); - sql = String.format("SELECT COLUMN_NAME,DATA_TYPE,COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", configuration.getDataBase(), datasourceRequest.getTable()); + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { + database = configuration.getDataBase(); + } else { + Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)"); + Matcher matcher = WITH_SQL_FRAGMENT.matcher(configuration.getJdbcUrl()); + matcher.find(); + String[] databasePrams = matcher.group(3).split("\\?"); + database = databasePrams[0]; + } + sql = String.format("SELECT COLUMN_NAME,DATA_TYPE,COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", database, datasourceRequest.getTable()); break; case oracle: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Oracle.class); @@ -394,6 +410,16 @@ public class CalciteProvider { break; case ck: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), CK.class); + + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { + database = configuration.getDataBase(); + } else { + Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:clickhouse://(.*):(\\d+)/(.*)"); + Matcher matcher = WITH_SQL_FRAGMENT.matcher(configuration.getJdbcUrl()); + matcher.find(); + String[] databasePrams = matcher.group(3).split("\\?"); + database = databasePrams[0]; + } sql = String.format(" SELECT\n" + " name,\n" + " type,\n" + @@ -402,7 +428,7 @@ public class CalciteProvider { " system.columns\n" + "WHERE\n" + " database = '%s' \n" + - " AND table = '%s' ", configuration.getDataBase(), datasourceRequest.getTable()); + " AND table = '%s' ", database, datasourceRequest.getTable()); break; case impala: sql = String.format("DESCRIBE `%s`", datasourceRequest.getTable()); @@ -731,6 +757,7 @@ public class CalciteProvider { List tableSqls = new ArrayList<>(); DatasourceConfiguration.DatasourceType datasourceType = DatasourceConfiguration.DatasourceType.valueOf(datasourceRequest.getDatasource().getType()); DatasourceConfiguration configuration = null; + String database = ""; switch (datasourceType) { case mysql: case mongo: @@ -739,49 +766,102 @@ public class CalciteProvider { case StarRocks: case doris: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Mysql.class); - tableSqls.add(String.format("SELECT TABLE_NAME,TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s' ;", configuration.getDataBase())); + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { + database = configuration.getDataBase(); + } else { + Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)"); + Matcher matcher = WITH_SQL_FRAGMENT.matcher(configuration.getJdbcUrl()); + matcher.find(); + String[] databasePrams = matcher.group(3).split("\\?"); + database = databasePrams[0]; + } + tableSqls.add(String.format("SELECT TABLE_NAME,TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s' ;", database)); break; case oracle: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Oracle.class); if (StringUtils.isEmpty(configuration.getSchema())) { DEException.throwException(Translator.get("i18n_schema_is_empty")); } - tableSqls.add("select table_name, owner, comments from all_tab_comments where owner='" + configuration.getSchema() + "' AND table_type = 'TABLE'"); - tableSqls.add("select table_name, owner, comments from all_tab_comments where owner='" + configuration.getSchema() + "' AND table_type = 'VIEW'"); + tableSqls.add("select table_name, comments, owner from all_tab_comments where owner='" + configuration.getSchema() + "' AND table_type = 'TABLE'"); + tableSqls.add("select table_name, comments, owner from all_tab_comments where owner='" + configuration.getSchema() + "' AND table_type = 'VIEW'"); break; case db2: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Db2.class); if (StringUtils.isEmpty(configuration.getSchema())) { DEException.throwException(Translator.get("i18n_schema_is_empty")); } - tableSqls.add("select TABNAME from syscat.tables WHERE TABSCHEMA ='DE_SCHEMA' AND \"TYPE\" = 'T'".replace("DE_SCHEMA", configuration.getSchema())); + tableSqls.add("select TABNAME, REMARKS from syscat.tables WHERE TABSCHEMA ='DE_SCHEMA' AND \"TYPE\" = 'T'".replace("DE_SCHEMA", configuration.getSchema())); break; case sqlServer: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Sqlserver.class); if (StringUtils.isEmpty(configuration.getSchema())) { DEException.throwException(Translator.get("i18n_schema_is_empty")); } - tableSqls.add("SELECT TABLE_NAME FROM \"DATABASE\".INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = 'DS_SCHEMA' ;" - .replace("DATABASE", configuration.getDataBase()) - .replace("DS_SCHEMA", configuration.getSchema())); - tableSqls.add("SELECT TABLE_NAME FROM \"DATABASE\".INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = 'DS_SCHEMA' ;" - .replace("DATABASE", configuration.getDataBase()) + tableSqls.add("SELECT \n" + + " t.name AS TableName, \n" + + " ep.value AS TableDescription \n" + + "FROM \n" + + " sys.tables t \n" + + "LEFT OUTER JOIN sys.schemas sc ON sc.schema_id =t.schema_id \n" + + "LEFT OUTER JOIN \n" + + " sys.extended_properties ep ON t.object_id = ep.major_id \n" + + " AND ep.minor_id = 0 \n" + + " AND ep.class = 1 \n" + + " AND ep.name = 'MS_Description'\n" + + "where sc.name ='DS_SCHEMA'" .replace("DS_SCHEMA", configuration.getSchema())); + tableSqls.add("SELECT \n" + + " t.name AS TableName, \n" + + " ep.value AS TableDescription \n" + + "FROM \n" + + " sys.views t \n" + + "LEFT OUTER JOIN sys.schemas sc ON sc.schema_id =t.schema_id \n" + + "LEFT OUTER JOIN \n" + + " sys.extended_properties ep ON t.object_id = ep.major_id \n" + + " AND ep.minor_id = 0 \n" + + " AND ep.class = 1 \n" + + " AND ep.name = 'MS_Description'\n" + + "where sc.name ='DS_SCHEMA'" + .replace("DS_SCHEMA", configuration.getSchema())); break; case pg: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Pg.class); if (StringUtils.isEmpty(configuration.getSchema())) { DEException.throwException(Translator.get("i18n_schema_is_empty")); } - tableSqls.add("SELECT tablename FROM pg_tables WHERE schemaname='SCHEMA' ;".replace("SCHEMA", configuration.getSchema())); + tableSqls.add("SELECT \n" + + " relname AS TableName, \n" + + " obj_description(relfilenode::regclass, 'pg_class') AS TableDescription \n" + + "FROM \n" + + " pg_class \n" + + "WHERE \n" + + " relkind = 'r' \n" + + " AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'SCHEMA') ".replace("SCHEMA", configuration.getSchema())); break; case redshift: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), CK.class); - tableSqls.add("SELECT tablename FROM pg_tables WHERE schemaname='SCHEMA' ;".replace("SCHEMA", configuration.getSchema())); + tableSqls.add("SELECT \n" + + " relname AS TableName, \n" + + " obj_description(relfilenode::regclass, 'pg_class') AS TableDescription \n" + + "FROM \n" + + " pg_class \n" + + "WHERE \n" + + " relkind = 'r' \n" + + " AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'SCHEMA') ".replace("SCHEMA", configuration.getSchema())); break; case ck: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), CK.class); - tableSqls.add("SELECT name FROM system.tables where database='DATABASE';".replace("DATABASE", configuration.getDataBase())); + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { + database = configuration.getDataBase(); + } else { + Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:clickhouse://(.*):(\\d+)/(.*)"); + Matcher matcher = WITH_SQL_FRAGMENT.matcher(configuration.getJdbcUrl()); + matcher.find(); + String[] databasePrams = matcher.group(3).split("\\?"); + database = databasePrams[0]; + } + tableSqls.add("SELECT name, comment FROM system.tables where database='DATABASE';".replace("DATABASE", database)); + break; default: tableSqls.add("show tables"); diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index eb7b13104c..bd37f22672 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -493,6 +493,9 @@ public class DatasourceServer implements DatasourceApi { public DatasourceDTO get(Long datasourceId) throws DEException { DatasourceDTO datasourceDTO = new DatasourceDTO(); CoreDatasource datasource = datasourceMapper.selectById(datasourceId); + if(datasource == null){ + DEException.throwException("不存在的数据源!"); + } BeanUtils.copyBean(datasourceDTO, datasource); TypeReference> listTypeReference = new TypeReference>() { }; @@ -834,10 +837,11 @@ public class DatasourceServer implements DatasourceApi { public ApiDefinition checkApiDatasource(Map request) throws DEException { ApiDefinition apiDefinition = JsonUtil.parseObject(new String(java.util.Base64.getDecoder().decode(request.get("data"))), ApiDefinition.class); - String response = ApiUtils.execHttpRequest(apiDefinition, 10); + String response = ApiUtils.execHttpRequest(apiDefinition, apiDefinition.getApiQueryTimeout() == null || apiDefinition.getApiQueryTimeout() <= 0 ? 10 : apiDefinition.getApiQueryTimeout()); if (request.keySet().contains("type") && request.get("type").equals("apiStructure")) { apiDefinition.setShowApiStructure(true); } + ApiUtils.checkApiDefinition(apiDefinition, response); if (apiDefinition.getRequest().getAuthManager() != null && StringUtils.isNotBlank(apiDefinition.getRequest().getAuthManager().getUsername()) && StringUtils.isNotBlank(apiDefinition.getRequest().getAuthManager().getPassword()) && apiDefinition.getRequest().getAuthManager().getVerification().equals("Basic Auth")) { apiDefinition.getRequest().getAuthManager().setUsername(new String(Base64.getEncoder().encode(apiDefinition.getRequest().getAuthManager().getUsername().getBytes()))); diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java b/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java index bff89b8014..9604c48d36 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java @@ -12,6 +12,9 @@ public class CK extends DatasourceConfiguration { private String extraParams = ""; public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if(StringUtils.isEmpty(extraParams.trim())){ return "jdbc:clickhouse://HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Db2.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Db2.java index 44ba37706d..3b1a9e9b30 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Db2.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Db2.java @@ -12,6 +12,9 @@ public class Db2 extends DatasourceConfiguration { private String extraParams = ""; public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if(StringUtils.isEmpty(extraParams.trim())){ if (StringUtils.isEmpty(getSchema())) { return "jdbc:db2://HOSTNAME:PORT/DATABASE" diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Impala.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Impala.java index 27b4cb9187..a362724b7f 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Impala.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Impala.java @@ -17,6 +17,9 @@ public class Impala extends DatasourceConfiguration { private List showTableSqls = Arrays.asList("show tables"); public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if(StringUtils.isEmpty(extraParams.trim())){ return "jdbc:impala://HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Mongo.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Mongo.java index 49a0887a4c..a602f761bf 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Mongo.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Mongo.java @@ -17,6 +17,9 @@ public class Mongo extends DatasourceConfiguration { private List showTableSqls = Arrays.asList("show tables"); public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if (StringUtils.isEmpty(extraParams.trim())) { return "jdbc:mysql://HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java index b6e0e8e6e4..3429d20980 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Mysql.java @@ -19,6 +19,9 @@ public class Mysql extends DatasourceConfiguration { private List showTableSqls = Arrays.asList("show tables"); public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if (StringUtils.isEmpty(extraParams.trim())) { return "jdbc:mysql://HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Oracle.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Oracle.java index 13041c9d76..8058e0f37d 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Oracle.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Oracle.java @@ -12,6 +12,9 @@ public class Oracle extends DatasourceConfiguration { private String extraParams = ""; public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if (StringUtils.isNotEmpty(getConnectionType()) && getConnectionType().equalsIgnoreCase("serviceName")) { return "jdbc:oracle:thin:@HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Pg.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Pg.java index 7c3e690fc1..9b66bd3a4d 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Pg.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Pg.java @@ -12,6 +12,9 @@ public class Pg extends DatasourceConfiguration { private String extraParams = ""; public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if(StringUtils.isEmpty(extraParams.trim())){ if (StringUtils.isEmpty(getSchema())) { return "jdbc:postgresql://HOSTNAME:PORT/DATABASE" diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Redshift.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Redshift.java index 8c2a37f39e..6d81242106 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Redshift.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Redshift.java @@ -12,6 +12,9 @@ public class Redshift extends DatasourceConfiguration { private String extraParams = ""; public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } return "jdbc:redshift://HOSTNAME:PORT/DATABASE" .replace("HOSTNAME", getHost().trim()) .replace("PORT", getPort().toString().trim()) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java index f14ac32c19..24e5327514 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java @@ -17,6 +17,9 @@ public class Sqlserver extends DatasourceConfiguration { private List showTableSqls = Arrays.asList("show tables"); public String getJdbc() { + if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + return getJdbcUrl(); + } if (StringUtils.isEmpty(extraParams.trim())) { return "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE" .replace("HOSTNAME", getHost().trim()) diff --git a/core/core-backend/src/main/resources/application.yml b/core/core-backend/src/main/resources/application.yml index 87a0091da2..f76ceef9e1 100644 --- a/core/core-backend/src/main/resources/application.yml +++ b/core/core-backend/src/main/resources/application.yml @@ -48,7 +48,7 @@ dataease: version: '@project.version@' origin-list: http://192.168.2.70:9080 apisix-api: - domain: http://192.168.0.121:9180 + domain: http://192.168.2.70:9180 key: edd1c9f034335f136f87ad84b625c8f1 # springdoc-openapi项目配置 diff --git a/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql index 81f0a52efc..303e400b80 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql @@ -11,5 +11,14 @@ CREATE TABLE `core_sys_startup_job` ) COMMENT ='项目启动任务'; BEGIN; -INSERT INTO `core_sys_startup_job` VALUES ('chartFilterMerge', 'chartFilterMerge', 'ready'); +INSERT INTO `core_sys_startup_job` +VALUES ('chartFilterMerge', 'chartFilterMerge', 'ready'); COMMIT; + + +ALTER TABLE `xpack_setting_authentication` + ADD COLUMN `plugin_json` longtext NULL COMMENT '插件配置' AFTER `relational_ids`; +ALTER TABLE `xpack_setting_authentication` + ADD COLUMN `synced` tinyint(1) NOT NULL DEFAULT 0 COMMENT '已同步' AFTER `plugin_json`; +ALTER TABLE `xpack_setting_authentication` + ADD COLUMN `valid` tinyint(1) NOT NULL DEFAULT 0 COMMENT '有效' AFTER `synced`; \ No newline at end of file diff --git a/core/core-frontend/src/api/datasource.ts b/core/core-frontend/src/api/datasource.ts index 8d85bf637e..ef14354ba6 100644 --- a/core/core-frontend/src/api/datasource.ts +++ b/core/core-frontend/src/api/datasource.ts @@ -152,6 +152,7 @@ export const uploadFile = async (data): Promise => { .post({ url: '/datasource/uploadFile', data, + loading: true, headersType: 'multipart/form-data;' }) .then(res => { diff --git a/core/core-frontend/src/assets/svg/sankey.svg b/core/core-frontend/src/assets/svg/sankey.svg new file mode 100644 index 0000000000..5645f5ded6 --- /dev/null +++ b/core/core-frontend/src/assets/svg/sankey.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue b/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue index 99eb836e99..426e707421 100644 --- a/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue +++ b/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue @@ -146,13 +146,6 @@ const saveSelfSubject = () => { > - - - + + + + + @@ -174,7 +189,10 @@ import eventBus from '@/utils/eventBus' import { storeToRefs } from 'pinia' import CustomColorStyleSelect from '@/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue' import elementResizeDetectorMaker from 'element-resize-detector' +import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' const { t } = useI18n() +const snapshotStore = snapshotStoreWithOut() + const props = defineProps({ themes: { type: String as PropType, @@ -191,6 +209,9 @@ const colorFormRef = ref(null) const colorForm = computed( () => canvasStyleData.value.component.chartColor as DeepPartial ) + +const seniorForm = computed(() => canvasStyleData.value.component.seniorStyleSetting) + const predefineColors = COLOR_PANEL const state = reactive({ @@ -215,6 +236,10 @@ const changeColorOption = (modifyName = 'value') => { changeColorCase(modifyName) } +const changePagerColorChange = () => { + snapshotStore.recordSnapshotCache() +} + const changeColorCase = modifyName => { colorForm.value['modifyName'] = modifyName emits('onColorChange', colorForm.value) diff --git a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue index 58c51044c6..30ffe42673 100644 --- a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue +++ b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue @@ -2,25 +2,37 @@
- - + + - - + + @@ -35,17 +47,21 @@ import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { useI18n } from '@/hooks/web/useI18n' import { cloneDeep } from 'lodash-es' -import { adaptCurThemeFilterStyleAll } from '@/utils/canvasStyle' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import eventBus from '@/utils/eventBus' -import { ElIcon } from 'element-plus-secondary' const { t } = useI18n() const dvMainStore = dvMainStoreWithOut() const snapshotStore = snapshotStoreWithOut() -const filterStyle = computed(() => { - return dvMainStore.canvasStyleData.component.filterStyle +const seniorStyleSetting = computed(() => { + return dvMainStore.canvasStyleData.component.seniorStyleSetting }) +const props = defineProps({ + themes: { + type: String, + default: 'light' + } +}) const state = reactive({ fontSize: [], isSetting: false, @@ -55,15 +71,9 @@ const state = reactive({ const initForm = () => { // do } -const themeChange = styleKey => { - dvMainStore.canvasStyleData.component.filterStyle = cloneDeep(filterStyle.value) - adaptCurThemeFilterStyleAll(styleKey) - snapshotStore.recordSnapshotCache('filterStyleSimpleSelector-themeChange') -} - -const handleHorizontalChange = (type, horizontal = 'titleLayout') => { - filterStyle.value[horizontal] = type - themeChange(horizontal) +const themeChange = () => { + dvMainStore.canvasStyleData.component.seniorStyleSetting = cloneDeep(seniorStyleSetting.value) + snapshotStore.recordSnapshotCache('seniorStyleSettingSimpleSelector-themeChange') } onMounted(() => { @@ -106,4 +116,12 @@ onMounted(() => { line-height: 20px; } } +.form-item-dark { + :deep(.ed-form-item__label) { + color: #6a6a6a; + font-size: 12px; + font-weight: 400; + line-height: 20px; + } +} diff --git a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue index f321fddf5b..fb0c2c3cfd 100644 --- a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue +++ b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue @@ -10,6 +10,7 @@ import { useEmitt } from '@/hooks/web/useEmitt' import ComponentColorSelector from '@/components/dashboard/subject-setting/dashboard-style/ComponentColorSelector.vue' import OverallSetting from '@/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue' import CanvasBackground from '@/components/visualization/component-background/CanvasBackground.vue' +import SeniorStyleSetting from '@/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue' const dvMainStore = dvMainStoreWithOut() const snapshotStore = snapshotStoreWithOut() const { canvasStyleData, canvasViewInfo } = storeToRefs(dvMainStore) @@ -102,6 +103,14 @@ onMounted(() => { + + +
diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 2e924cb860..ac6d7162b1 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -42,6 +42,7 @@ import PointShadow from '@/components/data-visualization/canvas/PointShadow.vue' import DragInfo from '@/components/visualization/common/DragInfo.vue' import { activeWatermark } from '@/components/watermark/watermark' import { personInfoApi } from '@/api/user' +import ComponentHangPopver from '@/custom-component/independent-hang/ComponentHangPopver.vue' const snapshotStore = snapshotStoreWithOut() const dvMainStore = dvMainStoreWithOut() const composeStore = composeStoreWithOut() diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index 67dc784914..d9deec239b 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -236,6 +236,23 @@ const initWatermark = (waterDomId = 'preview-canvas-main') => { } } +// 目标校验: 需要校验targetSourceId 是否是当前可视化资源ID +const winMsgHandle = event => { + console.info('PostMessage Params Received') + const msgInfo = event.data + // 校验targetSourceId + if ( + msgInfo && + msgInfo.type === 'attachParams' && + msgInfo.targetSourceId === dvInfo.value.id + '' + ) { + const attachParam = msgInfo.params + if (attachParam) { + dvMainStore.addOuterParamsFilter(attachParam, componentData.value, 'outer') + } + } +} + onMounted(() => { initRefreshTimer() resetLayout() @@ -245,10 +262,12 @@ onMounted(() => { restore() initWatermark() }) + window.addEventListener('message', winMsgHandle) }) onBeforeUnmount(() => { clearInterval(refreshTimer.value) + window.removeEventListener('message', winMsgHandle) }) const userViewEnlargeOpen = (opt, item) => { diff --git a/core/core-frontend/src/config/axios/service.ts b/core/core-frontend/src/config/axios/service.ts index 5e63f9c618..fc68c6859a 100644 --- a/core/core-frontend/src/config/axios/service.ts +++ b/core/core-frontend/src/config/axios/service.ts @@ -210,7 +210,7 @@ service.interceptors.response.use( ) { ElMessage({ type: 'error', - message: error.message, + message: error.response?.data?.msg ? error.response?.data?.msg : error.message, showClose: true }) } else if (error?.config?.url.startsWith('/xpackComponent/content')) { diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts index 277b7b0fbe..33af3555eb 100644 --- a/core/core-frontend/src/custom-component/component-list.ts +++ b/core/core-frontend/src/custom-component/component-list.ts @@ -211,6 +211,7 @@ const list = [ propValue: '', icon: 'other_text', innerType: 'VQuery', + isHang: false, x: 1, y: 1, sizeX: 72, diff --git a/core/core-frontend/src/custom-component/de-frame/ComponentFrame.vue b/core/core-frontend/src/custom-component/de-frame/ComponentFrame.vue index 8b464bee89..65980cbeb7 100644 --- a/core/core-frontend/src/custom-component/de-frame/ComponentFrame.vue +++ b/core/core-frontend/src/custom-component/de-frame/ComponentFrame.vue @@ -3,7 +3,7 @@