From ef5e9206d5c63bd76058ab3417332ecf6421167b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 May 2024 09:53:41 +0800 Subject: [PATCH 01/36] =?UTF-8?q?feat(X-Pack):=20=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=B9=B3=E5=8F=B0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=85=8D?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=BF=9B=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/permission.ts | 4 ++-- core/core-frontend/src/views/login/index.vue | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/permission.ts b/core/core-frontend/src/permission.ts index bee8270353..cc00868bab 100644 --- a/core/core-frontend/src/permission.ts +++ b/core/core-frontend/src/permission.ts @@ -7,7 +7,7 @@ import { usePermissionStoreWithOut, pathValid, getFirstAuthMenu } from '@/store/ import { usePageLoading } from '@/hooks/web/usePageLoading' import { getRoleRouters } from '@/api/common' import { useCache } from '@/hooks/web/useCache' -import { isMobile, checkPlatform } from '@/utils/utils' +import { isMobile, checkPlatform, isLarkPlatform, isPlatformClient } from '@/utils/utils' import { interactiveStoreWithOut } from '@/store/modules/interactive' import { useAppearanceStoreWithOut } from '@/store/modules/appearance' import { useEmbedded } from '@/store/modules/embedded' @@ -34,7 +34,7 @@ router.beforeEach(async (to, from, next) => { loadDone() if (to.name === 'link') { window.location.href = window.origin + '/mobile.html#' + to.path - } else { + } else if (!isPlatformClient() && !isLarkPlatform()) { window.location.href = window.origin + '/mobile.html#/index' } } diff --git a/core/core-frontend/src/views/login/index.vue b/core/core-frontend/src/views/login/index.vue index d1309ecba0..530c31ec21 100644 --- a/core/core-frontend/src/views/login/index.vue +++ b/core/core-frontend/src/views/login/index.vue @@ -256,7 +256,13 @@ onMounted(() => {
{ return arr }) +const splitLineStyle = [ + { label: t('chart.line_type_solid'), value: 'solid' }, + { label: t('chart.line_type_dashed'), value: 'dashed' }, + { label: t('chart.line_type_dotted'), value: 'dotted' } +] + const changeAxisStyle = prop => { if ( state.axisForm.axisValue.splitCount && @@ -303,6 +309,22 @@ onMounted(() => { />
+ + + + + Date: Mon, 20 May 2024 16:20:55 +0800 Subject: [PATCH 03/36] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E7=BB=84=E4=BB=B6=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/canvas/CanvasCore.vue | 1 + .../src/custom-component/component-list.ts | 1 + .../independent-hang/ComponentHang.vue | 45 ++++++++++++++ .../independent-hang/ComponentHangPopver.vue | 58 +++++++++++++++++++ .../editor/editor-style/VQueryChartStyle.vue | 11 +++- .../views/chart/components/editor/index.vue | 3 +- .../dataease/cache/impl/DefaultCacheImpl.java | 4 +- 7 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 core/core-frontend/src/custom-component/independent-hang/ComponentHang.vue create mode 100644 core/core-frontend/src/custom-component/independent-hang/ComponentHangPopver.vue 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/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/independent-hang/ComponentHang.vue b/core/core-frontend/src/custom-component/independent-hang/ComponentHang.vue new file mode 100644 index 0000000000..e1fe70db71 --- /dev/null +++ b/core/core-frontend/src/custom-component/independent-hang/ComponentHang.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/core/core-frontend/src/custom-component/independent-hang/ComponentHangPopver.vue b/core/core-frontend/src/custom-component/independent-hang/ComponentHangPopver.vue new file mode 100644 index 0000000000..f42f75a95f --- /dev/null +++ b/core/core-frontend/src/custom-component/independent-hang/ComponentHangPopver.vue @@ -0,0 +1,58 @@ + + + + diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue index 08dcd0a708..5934c734f3 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue @@ -9,6 +9,10 @@ const state = { } const props = defineProps({ + element: { + type: Object, + required: true + }, chart: { type: Object, required: true @@ -24,7 +28,7 @@ const props = defineProps({ }) const predefineColors = COLOR_PANEL -const { chart, commonBackgroundPop } = toRefs(props) +const { element, chart, commonBackgroundPop } = toRefs(props) From 6ed07df6176bb3e91558aec85a36b9074d054883 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 20 May 2024 18:58:06 +0800 Subject: [PATCH 15/36] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8F=98=E9=87=8F=E7=9B=B8=E5=85=B3=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index d92e14e286..59ce09783d 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit d92e14e286e9fed723b501323766bf8f2858ca42 +Subproject commit 59ce09783daf8fa19176179de63d35cded1ea1f2 From 7945ae25d5d2f421f4a2cf699e01e0c57ebcd723 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 21 May 2024 09:18:15 +0800 Subject: [PATCH 16/36] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8F=98=E9=87=8F=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 59ce09783d..1b0dc5aa81 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 59ce09783daf8fa19176179de63d35cded1ea1f2 +Subproject commit 1b0dc5aa81d419a90bd8bf33b1717f536b9d1e11 From b82750f80fc6c8ac0396e7238020a7cb8860c613 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 21 May 2024 09:18:53 +0800 Subject: [PATCH 17/36] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8F=98=E9=87=8F=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index 1b0dc5aa81..ecdf3b19b0 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 1b0dc5aa81d419a90bd8bf33b1717f536b9d1e11 +Subproject commit ecdf3b19b0f5d2d893460cca978ecf549cf86192 From e86ba79b2a0b6a9996d470cd7540c07846ba1e84 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 21 May 2024 10:32:45 +0800 Subject: [PATCH 18/36] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E8=A1=A8=E5=A4=87=E6=B3=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/datasource/provider/CalciteProvider.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 bae30ca71d..78e2fa9625 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 @@ -325,7 +325,7 @@ public class CalciteProvider { case StarRocks: case doris: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Mysql.class); - if (configuration.getUrlType().equalsIgnoreCase("")) { + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { database = configuration.getDataBase(); } else { Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)"); @@ -407,7 +407,7 @@ public class CalciteProvider { case ck: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), CK.class); - if (configuration.getUrlType().equalsIgnoreCase("")) { + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { database = configuration.getDataBase(); } else { Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:clickhouse://(.*):(\\d+)/(.*)"); @@ -762,7 +762,7 @@ public class CalciteProvider { case StarRocks: case doris: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Mysql.class); - if (configuration.getUrlType().equalsIgnoreCase("")) { + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { database = configuration.getDataBase(); } else { Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)"); @@ -813,7 +813,7 @@ public class CalciteProvider { break; case ck: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), CK.class); - if (configuration.getUrlType().equalsIgnoreCase("")) { + if (StringUtils.isEmpty(configuration.getUrlType()) || configuration.getUrlType().equalsIgnoreCase("hostName")) { database = configuration.getDataBase(); } else { Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:clickhouse://(.*):(\\d+)/(.*)"); From e79d696615c9a17fcde4aa602d43ab199a6b18fe Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 21 May 2024 12:16:17 +0800 Subject: [PATCH 19/36] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E8=A1=A8=E5=A4=87=E6=B3=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/provider/CalciteProvider.java | 62 +++++++++++++++---- core/core-frontend/src/locales/zh-CN.ts | 1 + .../visualized/data/datasource/index.vue | 10 +-- 3 files changed, 56 insertions(+), 17 deletions(-) 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 78e2fa9625..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 @@ -117,7 +117,11 @@ public class CalciteProvider { tableDesc.setDatasourceId(datasourceRequest.getDatasource().getId()); tableDesc.setType("db"); tableDesc.setTableName(resultSet.getString(1)); - tableDesc.setName(resultSet.getString(2)); + if(resultSet.getMetaData().getColumnCount() > 1){ + tableDesc.setName(resultSet.getString(2)); + }else { + tableDesc.setName(resultSet.getString(1)); + } return tableDesc; } @@ -778,38 +782,72 @@ public class CalciteProvider { 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); @@ -822,7 +860,7 @@ public class CalciteProvider { String[] databasePrams = matcher.group(3).split("\\?"); database = databasePrams[0]; } - tableSqls.add("SELECT name FROM system.tables where database='DATABASE';".replace("DATABASE", database)); + tableSqls.add("SELECT name, comment FROM system.tables where database='DATABASE';".replace("DATABASE", database)); break; default: diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 9646d060cb..902b0cf0d1 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -338,6 +338,7 @@ export default { extract: '抽取模式', all_compute_mode: '直连、抽取模式', extra_params: '额外的JDBC连接字符串', + jdbcUrl: 'JDBC 连接', please_input_dataPath: '请输入 JsonPath 数据路径', show_api_data: '查看API数据结构', warning: '包含无效数据表', diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index 501e0d0cba..c62f2110a1 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -1122,14 +1122,14 @@ const getMenuList = (val: boolean) => {