From 59722ef7a3d956304342ce56b8220f1a9b5ebdc7 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 20 May 2024 17:57:37 +0800 Subject: [PATCH 01/23] =?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 | 26 ++++++++++++++++--- core/core-frontend/src/locales/zh-CN.ts | 4 +-- .../visualized/data/datasource/index.vue | 4 +-- 3 files changed, 27 insertions(+), 7 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 3dad5cc9bd..bae30ca71d 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,7 @@ public class CalciteProvider { tableDesc.setDatasourceId(datasourceRequest.getDatasource().getId()); tableDesc.setType("db"); tableDesc.setTableName(resultSet.getString(1)); - tableDesc.setName(resultSet.getString(1)); + tableDesc.setName(resultSet.getString(2)); return tableDesc; } @@ -315,6 +315,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: @@ -324,7 +325,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 (configuration.getUrlType().equalsIgnoreCase("")) { + 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); @@ -396,6 +406,16 @@ public class CalciteProvider { break; case ck: configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), CK.class); + + if (configuration.getUrlType().equalsIgnoreCase("")) { + 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" + @@ -404,7 +424,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()); diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 8fbb691753..f9441f04f9 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -249,7 +249,7 @@ export default { remark: '备注', column_name: '字段名', field_type: '字段类型', - field_description: '字段描述', + field_description: '字段备注', dl: '数据湖', other: '其他', local_file: '本地文件', @@ -393,7 +393,7 @@ export default { no_data_table: '暂无数据表', on_the_left: '请在左侧选择数据源', create_dataset: '创建数据集', - table_description: '表描述', + table_description: '表备注', relational_database: '关系型数据库', data_warehouse_lake: '数仓/数据湖', non_relational_database: '非关系型数据库', 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 9d3b907904..501e0d0cba 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -91,7 +91,7 @@ const { width, node } = useMoveLine('DATASOURCE') const dsTableDetail = reactive({ tableName: '', - remark: '' + name: '' }) const rootManage = ref(false) const nickName = ref('') @@ -1356,7 +1356,7 @@ const getMenuList = (val: boolean) => { {{ t('datasource.table_description') }}

- {{ dsTableDetail.remark || '-' }} + {{ dsTableDetail.name || '-' }}

From b630421901a95f08658f1f527e880656c0d6d888 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 20 May 2024 18:20:32 +0800 Subject: [PATCH 02/23] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E9=85=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E5=99=A8=E9=85=8D=E8=89=B2=E7=AD=89=20#8443?= =?UTF-8?q?=20#8435?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dashboard/DbCanvasAttr.vue | 7 ------ .../ComponentColorSelector.vue | 25 +++++++++++++++++++ .../dashboard-style/SeniorStyleSetting.vue | 23 ++++++++--------- .../chart/components/editor/util/chart.ts | 3 ++- .../views/components/ChartComponentS2.vue | 15 +++++++---- .../components/views/components/DrillPath.vue | 24 +++++++++++------- .../views/chart/components/views/index.vue | 10 ++++---- 7 files changed, 67 insertions(+), 40 deletions(-) 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..4f65267c48 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 @@ -5,22 +5,22 @@ @@ -35,15 +35,13 @@ 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 state = reactive({ @@ -55,14 +53,13 @@ const state = reactive({ const initForm = () => { // do } -const themeChange = styleKey => { - dvMainStore.canvasStyleData.component.filterStyle = cloneDeep(filterStyle.value) - adaptCurThemeFilterStyleAll(styleKey) - snapshotStore.recordSnapshotCache('filterStyleSimpleSelector-themeChange') +const themeChange = () => { + dvMainStore.canvasStyleData.component.seniorStyleSetting = cloneDeep(seniorStyleSetting.value) + snapshotStore.recordSnapshotCache('seniorStyleSettingSimpleSelector-themeChange') } const handleHorizontalChange = (type, horizontal = 'titleLayout') => { - filterStyle.value[horizontal] = type + seniorStyleSetting.value[horizontal] = type themeChange(horizontal) } diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index 4650afe6c9..ac8affe189 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -158,7 +158,8 @@ export const SENIOR_STYLE_SETTING_LIGHT = { export const SENIOR_STYLE_SETTING_DARK = { linkageIconColor: '#ffffff', - drillLayerColor: '#ffffff' + drillLayerColor: '#ffffff', + pagerColor: '#ffffff' } export const FILTER_COMMON_STYLE_BASE = { diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index a3513e3f6b..6fc89da2db 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -29,7 +29,8 @@ import { useEmitt } from '@/hooks/web/useEmitt' import { trackBarStyleCheck } from '@/utils/canvasUtils' const dvMainStore = dvMainStoreWithOut() -const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc } = storeToRefs(dvMainStore) +const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, canvasStyleData } = + storeToRefs(dvMainStore) const { emitter } = useEmitt() const props = defineProps({ @@ -420,6 +421,10 @@ const autoHeightStyle = computed(() => { height: 20 * scale.value + 8 + 'px' } }) + +const tabStyle = computed(() => [ + { '--de-pager-color': canvasStyleData.value.component.seniorStyleSetting.pagerColor } +])