From ce88e8ce80b8373b39de95cd35bdd4a2b2516789 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 13:33:49 +0800 Subject: [PATCH 01/25] =?UTF-8?q?fix:=20PG=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=95=B0=E5=AD=97=E4=B8=8B=E6=8B=89=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=90=9C=E7=B4=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/provider/query/pg/PgQueryProvider.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/backend/src/main/java/io/dataease/provider/query/pg/PgQueryProvider.java b/core/backend/src/main/java/io/dataease/provider/query/pg/PgQueryProvider.java index a384fb7076..5ff7192e0b 100644 --- a/core/backend/src/main/java/io/dataease/provider/query/pg/PgQueryProvider.java +++ b/core/backend/src/main/java/io/dataease/provider/query/pg/PgQueryProvider.java @@ -183,8 +183,13 @@ public class PgQueryProvider extends QueryProvider { String whereTrees = transFilterTrees(tableObj, rowPermissionsTree); List wheres = new ArrayList<>(); if (customWheres != null) wheres.add(customWheres); - if (StringUtils.isNotBlank(keyword)) { - String keyWhere = "(" + transKeywordFilterList(tableObj, xFields, keyword) + ")"; + if (StringUtils.isNotBlank(keyword) && CollectionUtils.isNotEmpty(xFields)) { + List formatFields = xFields.stream().peek(f -> { + String fieldOriginName = f.getFieldOriginName(); + String format = String.format(PgConstants.CAST, fieldOriginName, "VARCHAR"); + f.setFieldOriginName(format); + }).collect(Collectors.toList()); + String keyWhere = "(" + transKeywordFilterList(tableObj, formatFields, keyword) + ")"; wheres.add(keyWhere); } if (whereTrees != null) wheres.add(whereTrees); From 6d1ee388e9f524540013a3af8a1f2a62b4e9a14a Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 14:01:36 +0800 Subject: [PATCH 02/25] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=8E=92=E5=BA=8F=E5=87=BA=E7=8E=B0=E7=A9=BA?= =?UTF-8?q?=E9=A1=B9=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/service/dataset/impl/direct/DirectFieldService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java b/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java index a5bed73343..2358fda047 100644 --- a/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java +++ b/core/backend/src/main/java/io/dataease/service/dataset/impl/direct/DirectFieldService.java @@ -91,6 +91,7 @@ public class DirectFieldService implements DataSetFieldService { return CollectionUtil.sort(list, (v1, v2) -> { Collator instance = Collator.getInstance(Locale.CHINESE); + if (ObjectUtils.isEmpty(v1) || ObjectUtils.isEmpty(v2)) return 0; if (StringUtils.equals("desc", sortStr)) { return instance.compare(v2, v1); } From 8f2a61bc768bda23fdc081ed87013f004d02aeef Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 14:20:47 +0800 Subject: [PATCH 03/25] =?UTF-8?q?fix:=20=E5=A4=9A=E9=80=89=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=BF=87=E6=BB=A4=E5=99=A8=E5=BF=85=E5=A1=AB=E6=97=B6?= =?UTF-8?q?=E7=A9=BA=E5=80=BC=E6=B2=A1=E6=9C=89=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/components/widget/deWidget/DeSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index 8ead79adde..5972332399 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -145,7 +145,7 @@ export default { return this.element.serviceName === 'textSelectWidget' && this.element.options.attrs.selectFirst }, showRequiredTips() { - return this.inDraw && this.element.options.attrs.required && !this.value + return this.inDraw && this.element.options.attrs.required && (!this.value || this.value.length === 0) } }, From 178476016aac1114a75404e354c4e1b3b30b0e3d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 15:01:37 +0800 Subject: [PATCH 04/25] =?UTF-8?q?Revert=20"fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?):=20=E4=BF=AE=E5=A4=8D=E7=94=BB=E5=B8=83=E4=B8=AD=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=9F=A5=E8=AF=A2=E6=8C=89=E9=92=AE=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=81=94=E5=8A=A8=E5=88=9D=E6=AC=A1=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=97=B6=E6=B2=A1=E6=9C=89=E5=B8=A6=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E9=97=AE=E9=A2=98=20#7061"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 363a31dcfc44076c839f294fde9900a773b320be. --- .../canvas/customComponent/UserView.vue | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index f556741480..860fb9d68d 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -367,9 +367,7 @@ export default { show: 0 }, view: {}, - cancelTime: null, - // 外部查询按钮是否已经触发 用来检查画布中如果存在查询按钮 是否被首次点击过 默认true - searchButtonReady: true + cancelTime: null } }, @@ -424,7 +422,7 @@ export default { }, filter() { const filter = {} - filter.filter = (this.initLoad && this.cfilters?.length === 0) || !this.searchButtonReady ? this.filters : this.cfilters + filter.filter = this.initLoad && this.cfilters?.length === 0 ? this.filters : this.cfilters filter.linkageFilters = this.element.linkageFilters filter.outerParamsFilters = this.element.outerParamsFilters filter.drill = this.drillClickDimensionList @@ -587,13 +585,7 @@ export default { }, mounted() { bus.$on('tab-canvas-change', this.tabSwitch) - bus.$on('trigger-search-button', this.triggerSearchButton) this.bindPluginEvent() - this.$nextTick(() => { - if (this.filters && this.filters.length > 0) { - this.searchButtonReady = false - } - }) }, beforeDestroy() { @@ -632,9 +624,6 @@ export default { } }, methods: { - triggerSearchButton() { - this.searchButtonReady = true - }, groupFilter(filters) { const result = { ready: [], From 002cb841691c39ebef8e9f721cd6778800c3a42e Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 25 Dec 2023 15:06:06 +0800 Subject: [PATCH 05/25] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?):=20=E8=A1=A8=E6=A0=BC=E5=86=BB=E7=BB=93=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/lang/en.js | 3 ++- core/frontend/src/lang/tw.js | 3 ++- core/frontend/src/lang/zh.js | 3 ++- .../frontend/src/views/chart/chart/table/table-info.js | 8 ++------ .../views/chart/components/shapeAttr/SizeSelector.vue | 5 +++++ .../chart/components/shapeAttr/SizeSelectorAntV.vue | 5 +++++ .../src/views/chart/components/table/TableNormal.vue | 10 ---------- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index e39f519e66..daa404f697 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -1594,7 +1594,8 @@ export default { gauge_axis_label: 'Axis Label', word_size_range: 'Word Size Range', word_spacing: 'Word Spacing', - axis_multi_select_tip: 'Hold down the Ctrl/Cmd or Shift key and click to select more than one' + axis_multi_select_tip: 'Hold down the Ctrl/Cmd or Shift key and click to select more than one', + needs_to_be_integer: 'Needs ti be an integer' }, dataset: { scope_edit: 'Effective only when editing', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index 25111c4c8e..e3826ff7ea 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -1586,7 +1586,8 @@ export default { gauge_axis_label: '刻度標籤', word_size_range: '字號區間', word_spacing: '文字間隔', - axis_multi_select_tip: '按住 Ctrl/Cmd 鍵或者 Shift 鍵再點擊可多選' + axis_multi_select_tip: '按住 Ctrl/Cmd 鍵或者 Shift 鍵再點擊可多選', + needs_to_be_integer: '需要為整數' }, dataset: { scope_edit: '僅編輯時生效', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index de6840c424..aa34dd927d 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -1586,7 +1586,8 @@ export default { gauge_axis_label: '刻度标签', word_size_range: '字号区间', word_spacing: '文字间隔', - axis_multi_select_tip: '按住 Ctrl/Cmd 键或者 Shift 键再点击可多选' + axis_multi_select_tip: '按住 Ctrl/Cmd 键或者 Shift 键再点击可多选', + needs_to_be_integer: '需要为整数' }, dataset: { scope_edit: '仅编辑时生效', diff --git a/core/frontend/src/views/chart/chart/table/table-info.js b/core/frontend/src/views/chart/chart/table/table-info.js index 960e8c9aff..40955fb143 100644 --- a/core/frontend/src/views/chart/chart/table/table-info.js +++ b/core/frontend/src/views/chart/chart/table/table-info.js @@ -121,9 +121,7 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo) } } s2Options.colCell = (node) => { - if (node.colIndex === 0) { - node.label = ' ' - } + node.label = ' ' } } @@ -312,9 +310,7 @@ export function baseTableNormal(s2, container, chart, action, tableData) { } } s2Options.colCell = (node) => { - if (node.colIndex === 0) { - node.label = ' ' - } + node.label = ' ' } } diff --git a/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue b/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue index d5e3742bda..2c98735ff0 100644 --- a/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue +++ b/core/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue @@ -1307,6 +1307,11 @@ export default { this.$message.error(this.$t('chart.max_more_than_mix')) return } + const reg = /^\d+$/m + if (!reg.test(this.sizeForm.tableColumnFreezeHead)) { + this.$message.error(this.$t('chart.table_freeze') + this.$t('chart.needs_to_be_integer')) + return + } this.$emit('onSizeChange', this.sizeForm) }, showProperty(property) { diff --git a/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue b/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue index 027c07b6cc..7d841773c8 100644 --- a/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue @@ -1782,6 +1782,11 @@ export default { this.$message.error(this.$t('chart.max_more_than_mix')) return } + const reg = /^\d+$/m + if (!reg.test(this.sizeForm.tableRowFreezeHead) || !reg.test(this.sizeForm.tableColumnFreezeHead)) { + this.$message.error(this.$t('chart.table_freeze') + this.$t('chart.needs_to_be_integer')) + return + } this.$emit('onSizeChange', this.sizeForm) }, showProperty(property) { diff --git a/core/frontend/src/views/chart/components/table/TableNormal.vue b/core/frontend/src/views/chart/components/table/TableNormal.vue index 7b3859a247..260bf2a107 100644 --- a/core/frontend/src/views/chart/components/table/TableNormal.vue +++ b/core/frontend/src/views/chart/components/table/TableNormal.vue @@ -478,16 +478,6 @@ export default { } } this.table_item_class_stripe = JSON.parse(JSON.stringify(this.table_item_class)) - // 暂不支持斑马纹 - // if (customAttr.color.tableStripe) { - // // this.table_item_class_stripe.background = hexColorToRGBA(customAttr.color.tableItemBgColor, customAttr.color.alpha - 40) - // if (this.chart.customStyle) { - // const customStyle = JSON.parse(this.chart.customStyle) - // if (customStyle.background) { - // this.table_item_class_stripe.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha) - // } - // } - // } if (customAttr.color.enableTableCrossBG) { this.table_item_class_stripe.background = hexColorToRGBA(customAttr.color.tableItemSubBgColor, customAttr.color.alpha) } From cb308fc89aa2fdcad6a146defc81486f27285943 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 25 Dec 2023 16:12:19 +0800 Subject: [PATCH 06/25] =?UTF-8?q?fix:=20sqlserver=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../query/sqlserver/SqlserverQueryProvider.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java b/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java index f7d5a41811..33aff59416 100644 --- a/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java +++ b/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java @@ -533,9 +533,11 @@ public class SqlserverQueryProvider extends QueryProvider { public String getSQLWithPage(boolean isTable, String sql, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) { String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + " ROW FETCH NEXT " + pageInfo.getPageSize() + " ROW ONLY " : ""); if (isTable) { - return getSQLTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; + String s = getSQLTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view); + return "SELECT * FROM (" + s + ") tmp " + limit; } else { - return getSQLTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit; + String s = getSQLTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view); + return "SELECT * FROM (" + s + ") tmp " + limit; } } @@ -1477,7 +1479,7 @@ public class SqlserverQueryProvider extends QueryProvider { String whereValue = ""; if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) { - if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) { + if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) { whereValue = "(" + value.stream().map(str -> { return "N" + "'" + str + "'"; }).collect(Collectors.joining(",")) + ")"; @@ -1499,7 +1501,7 @@ public class SqlserverQueryProvider extends QueryProvider { } } else { - if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) { + if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) { whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE_CH, value.get(0)); } else { whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE, value.get(0)); From 727c66353abaabbe7c732f5948b0c7aa0b631c4a Mon Sep 17 00:00:00 2001 From: ulleo Date: Mon, 25 Dec 2023 16:16:30 +0800 Subject: [PATCH 07/25] =?UTF-8?q?fix:=20=E7=BB=84=E5=90=88=E5=9B=BE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=B8=90=E5=8F=98=E5=90=8E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=89=B2=E4=B8=BA=E6=B7=B1=E8=89=B2=E6=B8=90?= =?UTF-8?q?=E5=8F=98=E6=B2=A1=E6=9C=89=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/dataease-extensions-view/view-chartmix/build.sh | 6 +++--- .../src/components/selector/ColorSelector.vue | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/dataease-extensions-view/view-chartmix/build.sh b/extensions/dataease-extensions-view/view-chartmix/build.sh index d272e61077..ea5f6e1870 100644 --- a/extensions/dataease-extensions-view/view-chartmix/build.sh +++ b/extensions/dataease-extensions-view/view-chartmix/build.sh @@ -1,8 +1,8 @@ #!/bin/sh mvn clean package -cp view-chartmix-backend/target/view-chartmix-backend-1.18.13.jar . +cp view-chartmix-backend/target/view-chartmix-backend-1.18.14.jar . -zip -r chartmix.zip ./view-chartmix-backend-1.18.13.jar ./plugin.json +zip -r chartmix.zip ./view-chartmix-backend-1.18.14.jar ./plugin.json -rm -f ./view-chartmix-backend-1.18.13.jar +rm -f ./view-chartmix-backend-1.18.14.jar diff --git a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/selector/ColorSelector.vue b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/selector/ColorSelector.vue index b452a8077b..da37490c00 100644 --- a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/selector/ColorSelector.vue +++ b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/selector/ColorSelector.vue @@ -235,6 +235,9 @@ export default { this.customColor = this.colorForm.colors[0] this.colorIndex = 0 } + if(this.colorForm.gradient === undefined){ + this.colorForm.gradient = false + } } } From fb956acacf3aebd9b87782a44991c7842031d47b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 16:18:16 +0800 Subject: [PATCH 08/25] =?UTF-8?q?fix:=20=E4=B8=8B=E6=8B=89=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E9=A6=96=E9=A1=B9=E4=BC=9A=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E4=BB=AA=E8=A1=A8=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/components/widget/deWidget/DeSelect.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index f25d14ec86..7bb1b44c11 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -98,7 +98,8 @@ export default { separator: ',', timeMachine: null, changeIndex: 0, - flag: uuid.v1() + flag: uuid.v1(), + hasDestroy: false } }, computed: { @@ -274,6 +275,7 @@ export default { beforeDestroy() { bus.$off('onScroll', this.onScroll) bus.$off('reset-default-value', this.resetDefaultValue) + this.hasDestroy = true }, methods: { selectOnScroll() { @@ -384,6 +386,9 @@ export default { } }, fillFirstSelected() { + if (this.hasDestroy) { + return + } if (this.selectFirst && this.data?.length) { this.fillFirstValue() this.$emit('filter-loaded', { From 2de2398d87924f0411494d3efc40b037aeb5c3ee Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 16:39:56 +0800 Subject: [PATCH 09/25] =?UTF-8?q?style:=20=E4=B8=8B=E6=8B=89=E6=A0=91?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E7=A9=BA=E6=95=B0=E6=8D=AE=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F=E4=BF=AE=E5=A4=8D#7165?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/widget/deWidget/DeSelectTree.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/components/widget/deWidget/DeSelectTree.vue b/core/frontend/src/components/widget/deWidget/DeSelectTree.vue index df0b441902..3b02170d82 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelectTree.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelectTree.vue @@ -433,7 +433,9 @@ export default { .test-class-wrap { background: var(--BgSelectTreeColor, #FFFFFF) !important; border-color: var(--BrSelectTreeColor, #E4E7ED) !important; - + .el-tree__empty-text { + position: relative !important; + } .popper__arrow, .popper__arrow::after { display: none !important; @@ -471,5 +473,6 @@ export default { border-left: none; } } + } From bbf3a5d6061523e9297dc72c409366c7148f3d95 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 25 Dec 2023 16:43:58 +0800 Subject: [PATCH 10/25] =?UTF-8?q?fix:=20sqlserver=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sqlserver/SqlserverQueryProvider.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java b/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java index 33aff59416..57d428638c 100644 --- a/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java +++ b/core/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java @@ -436,10 +436,10 @@ public class SqlserverQueryProvider extends QueryProvider { @Override public String getSQLTableInfo(String table, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) { - return originTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true); + return originTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, true); } - public String originTableInfo(String table, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder) { + public String originTableInfo(String table, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder, boolean needResultCount) { SQLObj tableObj = SQLObj.builder() .tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table)) .tableAlias(String.format(TABLE_ALIAS_PREFIX, 0)) @@ -518,7 +518,7 @@ public class SqlserverQueryProvider extends QueryProvider { .build(); if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders); if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL); - if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom") && needResultCount) { SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build(); st.add("limitFiled", limitFiled); } @@ -526,18 +526,17 @@ public class SqlserverQueryProvider extends QueryProvider { } public String originSQLAsTmpTableInfo(String sql, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder) { - return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, null, view, needOrder); + return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, null, view, needOrder, true); } @Override public String getSQLWithPage(boolean isTable, String sql, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) { - String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + " ROW FETCH NEXT " + pageInfo.getPageSize() + " ROW ONLY " : ""); + boolean isPage = (pageInfo.getGoPage() != null && pageInfo.getPageSize() != null); + String limit = (isPage ? " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + " ROW FETCH NEXT " + pageInfo.getPageSize() + " ROW ONLY " : ""); if (isTable) { - String s = getSQLTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view); - return "SELECT * FROM (" + s + ") tmp " + limit; + return originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage) + limit; } else { - String s = getSQLTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view); - return "SELECT * FROM (" + s + ") tmp " + limit; + return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage) + limit; } } @@ -1767,7 +1766,7 @@ public class SqlserverQueryProvider extends QueryProvider { @Override public String getResultCount(boolean isTable, String sql, List xAxis, FilterTreeObj fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) { if (isTable) { - return "SELECT COUNT(*) AS count from (" + originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false) + ") COUNT_TEMP"; + return "SELECT COUNT(*) AS count from (" + originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false, true) + ") COUNT_TEMP"; } else { return "SELECT COUNT(*) AS count from (" + originSQLAsTmpTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false) + ") COUNT_TEMP"; } From 8691e9b223abdd61105b9bc8be4eb5f01e12b4e4 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 25 Dec 2023 17:13:42 +0800 Subject: [PATCH 11/25] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=88=87=E6=8D=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/views/chart/view/ChartEdit.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/views/chart/view/ChartEdit.vue b/core/frontend/src/views/chart/view/ChartEdit.vue index e364ca5eed..a3fddc4be1 100644 --- a/core/frontend/src/views/chart/view/ChartEdit.vue +++ b/core/frontend/src/views/chart/view/ChartEdit.vue @@ -2436,6 +2436,7 @@ export default { } }, resetChangeTable() { + this.view.customFilter = {} const compareData = {} this.dimensionData.forEach(deimension => { compareData[deimension.originName] = deimension @@ -2443,7 +2444,7 @@ export default { this.quotaData.forEach(quota => { compareData[quota.originName] = quota }) - const compareCols = ['xaxis', 'xaxisExt', 'yaxis', 'yaxisExt', 'customFilter', 'extStack', 'extBubble', 'drillFields'] + const compareCols = ['xaxis', 'xaxisExt', 'yaxis', 'yaxisExt', 'extStack', 'extBubble', 'drillFields'] this.viewFieldChange(compareData, compareCols) }, viewFieldChange(compareData, compareCols) { From 4dec1cd597b4cfb909aad91ac111aedf6f9aeec8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Dec 2023 17:21:20 +0800 Subject: [PATCH 12/25] =?UTF-8?q?perf:=20=E5=AE=9A=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=A2=9D=E5=A4=96=E7=AD=89=E5=BE=85=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/lang/en.js | 2 +- core/frontend/src/lang/tw.js | 2 +- core/frontend/src/lang/zh.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index daa404f697..19a0247f15 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -2786,7 +2786,7 @@ export default { fire_now_success: 'Task executing', larkgroups: 'Lark group', ext_wait_time: 'Additional waiting time for dashboard loading (unit: seconds)', - wat_time_limit: 'The additional waiting time must be between [0 - 30]' + wat_time_limit: 'The additional waiting time must be an integer between [0 - 30]' }, dynamic_time: { set_default: 'Set Default', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index e3826ff7ea..7c07f95526 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -2778,7 +2778,7 @@ export default { fire_now_success: '任務發起成功', larkgroups: '飛書群', ext_wait_time: '加載儀表板額外等待時間(單位:秒)', - wat_time_limit: '額外等待時間必須在[0 - 30]' + wat_time_limit: '額外等待時間必須是[0 - 30]之間整數' }, dynamic_time: { set_default: '設置默認值', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index aa34dd927d..2c3915f3c0 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -2781,7 +2781,7 @@ export default { fire_now_success: '任务发起成功', larkgroups: '飞书群', ext_wait_time: '加载仪表板额外等待时间(单位:秒)', - wat_time_limit: '额外等待时间必须在[0 - 30]' + wat_time_limit: '额外等待时间必须是[0 - 30]之间整数' }, dynamic_time: { set_default: '设置默认值', From bd1243372c7729fc78c98c5d67c7c9dd8c3bb0c3 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 25 Dec 2023 20:12:43 +0800 Subject: [PATCH 13/25] fix(i18n): typo --- core/frontend/src/lang/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index 19a0247f15..5a561a72cf 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -1595,7 +1595,7 @@ export default { word_size_range: 'Word Size Range', word_spacing: 'Word Spacing', axis_multi_select_tip: 'Hold down the Ctrl/Cmd or Shift key and click to select more than one', - needs_to_be_integer: 'Needs ti be an integer' + needs_to_be_integer: 'Needs to be an integer' }, dataset: { scope_edit: 'Effective only when editing', From c38724102c60a23298e1ff185eba6e25ca380e14 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Mon, 25 Dec 2023 20:15:18 +0800 Subject: [PATCH 14/25] =?UTF-8?q?perf(=E8=A7=86=E5=9B=BE):=20=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E7=BB=98=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/customComponent/UserView.vue | 28 +++--- .../views/chart/components/ChartComponent.vue | 16 +++- .../chart/components/ChartComponentG2.vue | 45 ++++------ .../chart/components/ChartComponentS2.vue | 86 +++++++++---------- .../chart/components/table/TableNormal.vue | 19 ++-- 5 files changed, 90 insertions(+), 104 deletions(-) diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index 860fb9d68d..ea961a8db9 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -542,18 +542,17 @@ export default { }, // 监听外部的样式变化 (非实时性要求) 'hw': { - handler(newVal, oldVla) { - if (newVal !== oldVla && this.$refs[this.element.propValue.id]) { + handler(newVal, oldVal) { + if (!newVal) { + return + } + if (this.requestStatus === 'waiting') { + return + } + if (newVal !== oldVal && this.$refs[this.element.propValue.id]) { this.resizeChart() } - }, - deep: true - }, - // 监听外部的样式变化 (非实时性要求) - outStyle: { - handler(newVal, oldVla) { - }, - deep: true + } }, // 监听外部计时器变化 searchCount: function(val1) { @@ -655,7 +654,7 @@ export default { equalsAny, tabSwitch(tabCanvasId) { if (this.charViewS2ShowFlag && tabCanvasId === this.canvasId && this.$refs[this.element.propValue.id]) { - this.$refs[this.element.propValue.id].chartResize() + // do nothing } }, // 编辑状态下 不启动刷新 @@ -786,9 +785,10 @@ export default { param.viewId && param.viewId === this.element.propValue.viewId && this.getDataEdit(param) }, clearPanelLinkage(param) { + console.log('clear linkage') if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) { try { - this.$refs[this.element.propValue.id]?.reDrawView?.() + // do nothing } catch (e) { console.error('reDrawView-error:', this.element.propValue.id) } @@ -842,9 +842,7 @@ export default { this.getDataLoading = false this.getData(id, cache, dataBroadcast) clearTimeout(this.cancelTime) - this.cancelTime = setTimeout(() => { - this.requestStatus = 'waiting' - }, 0) + this.requestStatus = 'waiting' return } this.requestStatus = 'waiting' diff --git a/core/frontend/src/views/chart/components/ChartComponent.vue b/core/frontend/src/views/chart/components/ChartComponent.vue index d58cbb2888..d8ad02c827 100644 --- a/core/frontend/src/views/chart/components/ChartComponent.vue +++ b/core/frontend/src/views/chart/components/ChartComponent.vue @@ -144,7 +144,8 @@ export default { 'line', 'line-stack', 'scatter' - ] + ], + resizeTimer: null } }, @@ -511,9 +512,16 @@ export default { }, chartResize() { // 指定图表的配置项和数据 - const chart = this.myChart - chart.resize() - this.reDrawMap() + this.resizeTimer && clearTimeout(this.resizeTimer) + this.resizeTimer = setTimeout(() => { + const { offsetWidth, offsetHeight } = document.getElementById(this.chartId) + const chartWidth = this.myChart.getWidth() + const chartHeight = this.myChart.getHeight() + if (offsetWidth !== chartWidth || offsetHeight !== chartHeight) { + this.myChart.resize() + this.reDrawMap() + } + }, 100) }, reDrawMap() { const chart = this.chart diff --git a/core/frontend/src/views/chart/components/ChartComponentG2.vue b/core/frontend/src/views/chart/components/ChartComponentG2.vue index 23f8ae5569..666387efff 100644 --- a/core/frontend/src/views/chart/components/ChartComponentG2.vue +++ b/core/frontend/src/views/chart/components/ChartComponentG2.vue @@ -127,8 +127,8 @@ export default { remarkCfg: { show: false, content: '' - } - + }, + resizeTimer: null } }, @@ -156,17 +156,9 @@ export default { chart: { handler(newVal, oldVla) { this.initTitle() - this.calcHeightDelay() - new Promise((resolve) => { - resolve() - }).then(() => { - this.drawView() - }) + this.calcHeightRightNow(this.drawView) }, deep: true - }, - resize() { - this.drawEcharts() } }, beforeDestroy() { @@ -192,7 +184,7 @@ export default { for (const key in this.pointParam) { this.$delete(this.pointParam, key) } - window.removeEventListener('resize', this.calcHeightDelay) + window.removeEventListener('resize', this.chartResize) this.myChart = null }, mounted() { @@ -238,13 +230,8 @@ export default { }, preDraw() { this.initTitle() - this.calcHeightDelay() - new Promise((resolve) => { - resolve() - }).then(() => { - this.drawView() - }) - window.addEventListener('resize', this.calcHeightDelay) + this.calcHeightRightNow(this.drawView) + window.addEventListener('resize', this.chartResize) }, async drawView() { const chart = JSON.parse(JSON.stringify(this.chart)) @@ -380,7 +367,10 @@ export default { } }, chartResize() { - this.calcHeightDelay() + this.resizeTimer && clearTimeout(this.resizeTimer) + this.resizeTimer = setTimeout(() => { + this.calcHeightRightNow() + }, 100) }, trackClick(trackAction) { const param = this.pointParam @@ -470,22 +460,19 @@ export default { this.initRemark() }, - calcHeightRightNow() { + calcHeightRightNow(callback) { this.$nextTick(() => { if (this.$refs.chartContainer) { - const currentHeight = this.$refs.chartContainer.offsetHeight + const { offsetHeight } = this.$refs.chartContainer + let titleHeight = 0 if (this.$refs.title) { - const titleHeight = this.$refs.title.offsetHeight - this.chartHeight = (currentHeight - titleHeight) + 'px' + titleHeight = this.$refs.title.offsetHeight } + this.chartHeight = (offsetHeight - titleHeight) + 'px' + this.$nextTick(() => callback?.()) } }) }, - calcHeightDelay() { - setTimeout(() => { - this.calcHeightRightNow() - }, 100) - }, initRemark() { this.remarkCfg = getRemark(this.chart) } diff --git a/core/frontend/src/views/chart/components/ChartComponentS2.vue b/core/frontend/src/views/chart/components/ChartComponentS2.vue index 5f6e389496..ae96b11a25 100644 --- a/core/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/core/frontend/src/views/chart/components/ChartComponentS2.vue @@ -34,7 +34,7 @@
{ - resolve() - }).then(() => { - this.drawView() - }) + this.calcHeightRightNow(this.drawView) }, deep: true - }, - resize() { - this.drawEcharts() } }, mounted() { @@ -243,7 +236,7 @@ export default { }, beforeDestroy() { clearInterval(this.scrollTimer) - window.removeEventListener('resize', this.onResize) + window.removeEventListener('resize', this.chartResize) this.myChart?.destroy?.() this.myChart = null }, @@ -282,18 +275,10 @@ export default { this.tableData = data }, preDraw() { - this.onResize() - window.addEventListener('resize', this.onResize) - }, - onResize() { this.initData() this.initTitle() - this.calcHeightDelay() - new Promise((resolve) => { - resolve() - }).then(() => { - this.drawView() - }) + this.calcHeightRightNow(this.drawView) + window.addEventListener('resize', this.chartResize) }, drawView() { const chart = this.chart @@ -403,14 +388,21 @@ export default { } }, chartResize() { - this.initData() - this.initTitle() - this.calcHeightDelay() - new Promise((resolve) => { - resolve() - }).then(() => { - this.drawView() - }) + this.resizeTimer && clearTimeout(this.resizeTimer) + this.resizeTimer = setTimeout(() => { + this.initData() + this.initTitle() + this.calcHeightRightNow((width, height) => { + const { width: chartWidth, height: chartHeight } = this.myChart.options + if (width !== chartWidth || height !== chartHeight) { + this.myChart?.changeSheetSize(width, height) + if (chartWidth || chartHeight) { + this.myChart.render() + } + this.initScroll() + } + }) + }, 100) }, trackClick(trackAction) { const param = this.pointParam @@ -483,24 +475,19 @@ export default { this.initRemark() }, - calcHeightRightNow() { + calcHeightRightNow(callback) { this.$nextTick(() => { if (this.$refs.chartContainer) { - const currentHeight = this.$refs.chartContainer.offsetHeight + const { offsetWidth, offsetHeight } = this.$refs.chartContainer + let titleHeight = 0 if (this.$refs.title) { - const titleHeight = this.$refs.title.offsetHeight - this.chartHeight = (currentHeight - titleHeight) + 'px' - this.$refs.tableContainer.style.height = this.chartHeight + titleHeight = this.$refs.title.offsetHeight } + this.chartHeight = (offsetHeight - titleHeight) + 'px' + this.$nextTick(() => callback?.(offsetWidth, offsetHeight - titleHeight)) } }) }, - calcHeightDelay() { - this.calcHeightRightNow() - setTimeout(() => { - this.calcHeightRightNow() - }, 100) - }, pageChange(val) { this.currentPage.pageSize = val if (this.chart.datasetMode === 0 && !NOT_SUPPORT_PAGE_DATASET.includes(this.chart.datasourceType)) { @@ -536,23 +523,28 @@ export default { const senior = JSON.parse(this.chart.senior) this.scrollTop = 0 - this.myChart.store.set('scrollY', this.scrollTop) - this.myChart.render() if (senior && senior.scrollCfg && senior.scrollCfg.open && (this.chart.type === 'table-normal' || (this.chart.type === 'table-info' && !this.showPage))) { const rowHeight = customAttr.size.tableItemHeight const headerHeight = customAttr.size.tableTitleHeight this.scrollTimer = setInterval(() => { + const offsetHeight = document.getElementById(this.chartId).offsetHeight const top = rowHeight * senior.scrollCfg.row - const dom = document.getElementById(this.chartId) - if ((dom.offsetHeight - headerHeight + this.scrollTop) < rowHeight * this.chart.data.tableRow.length) { + if ((offsetHeight - headerHeight + this.scrollTop) < rowHeight * this.chart.data.tableRow.length) { this.scrollTop += top } else { this.scrollTop = 0 } - this.myChart.store.set('scrollY', this.scrollTop) - this.myChart.render() + if (!offsetHeight) { + return + } + this.myChart.facet.scrollWithAnimation({ + offsetY: { + value: this.scrollTop, + animate: false + } + }) }, senior.scrollCfg.interval) } }, diff --git a/core/frontend/src/views/chart/components/table/TableNormal.vue b/core/frontend/src/views/chart/components/table/TableNormal.vue index 260bf2a107..e5948321f5 100644 --- a/core/frontend/src/views/chart/components/table/TableNormal.vue +++ b/core/frontend/src/views/chart/components/table/TableNormal.vue @@ -214,7 +214,8 @@ export default { top: '0px' }, pointParam: null, - showSummary: true + showSummary: true, + resizeTimer: null } }, computed: { @@ -425,7 +426,8 @@ export default { }) }, calcHeightDelay() { - setTimeout(() => { + this.resizeTimer && clearTimeout(this.resizeTimer) + this.resizeTimer = setTimeout(() => { this.calcHeightRightNow() }, 100) }, @@ -597,12 +599,6 @@ export default { const scrollContainer = document.getElementsByClassName(this.chart.id)[0].getElementsByClassName('elx-table--body-wrapper')[0] this.scrollTop = 0 - setTimeout(() => { - scrollContainer.scrollTo({ - top: this.scrollTop, - behavior: this.scrollTop === 0 ? 'instant' : 'smooth' - }) - }, 0) if (senior && senior.scrollCfg && senior.scrollCfg.open && (this.chart.type === 'table-normal' || (this.chart.type === 'table-info' && !this.showPage))) { let rowHeight = customAttr.size.tableItemHeight @@ -621,11 +617,16 @@ export default { top = rowHeight * senior.scrollCfg.row } - if (scrollContainer.clientHeight + scrollContainer.scrollTop < scrollContainer.scrollHeight) { + const { clientHeight, scrollTop, scrollHeight } = scrollContainer + + if (clientHeight + scrollTop < scrollHeight) { this.scrollTop += top } else { this.scrollTop = 0 } + if (!clientHeight) { + return + } scrollContainer.scrollTo({ top: this.scrollTop, behavior: this.scrollTop === 0 ? 'instant' : 'smooth' From 2f0cb4d6e4ce71aaaa95875eebea3e01d793a35a Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 26 Dec 2023 12:48:17 +0800 Subject: [PATCH 15/25] =?UTF-8?q?fix:=20=E7=AC=A6=E5=8F=B7=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=AD=BE=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/view/official/handler/SymbolMapRSHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/dataease-extensions-view/view-symbolmap/view-symbolmap-backend/src/main/java/io/dataease/plugins/view/official/handler/SymbolMapRSHandler.java b/extensions/dataease-extensions-view/view-symbolmap/view-symbolmap-backend/src/main/java/io/dataease/plugins/view/official/handler/SymbolMapRSHandler.java index 018efca7a9..cf0f335db4 100644 --- a/extensions/dataease-extensions-view/view-symbolmap/view-symbolmap-backend/src/main/java/io/dataease/plugins/view/official/handler/SymbolMapRSHandler.java +++ b/extensions/dataease-extensions-view/view-symbolmap/view-symbolmap-backend/src/main/java/io/dataease/plugins/view/official/handler/SymbolMapRSHandler.java @@ -142,7 +142,7 @@ public class SymbolMapRSHandler implements PluginViewRSHandler { if (StringUtils.isBlank(val)) return val; String typeField = field.getTypeField(); if (StringUtils.isNotBlank(typeField) && trans2Ykeys.contains(typeField)) { - return Arrays.stream(val.split(",")).distinct().collect(Collectors.joining(",")); + return Arrays.stream(val.split(",")).map(StringUtils::trim).distinct().collect(Collectors.joining(",")); } return val; } From aade0f63f68d9743ffa53b9c847728c0ef843fe0 Mon Sep 17 00:00:00 2001 From: xuwei-fit2cloud Date: Tue, 26 Dec 2023 14:59:17 +0800 Subject: [PATCH 16/25] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E7=89=88=E6=9C=AC=E6=97=B6=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=AF=86=E7=A0=81=E8=A2=AB=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer/dataease/install.conf | 2 ++ installer/dataease/install.sh | 2 ++ installer/dataease/templates/dataease.properties | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/installer/dataease/install.conf b/installer/dataease/install.conf index 43c0f467f6..52e9d28955 100644 --- a/installer/dataease/install.conf +++ b/installer/dataease/install.conf @@ -15,6 +15,8 @@ DE_DORIS_FE_IP=172.19.0.198 DE_DORIS_BE_IP=172.19.0.199 ## 登录超时时间,单位min。如果不设置则默认8小时,也就是480 DE_LOGIN_TIMEOUT=480 +## 新建用户初始密码 +DE_INIT_PASSWORD=DataEase123456 # 数据库配置 ## 是否使用外部数据库 diff --git a/installer/dataease/install.sh b/installer/dataease/install.sh index 53147d0d39..6560f67d28 100755 --- a/installer/dataease/install.sh +++ b/installer/dataease/install.sh @@ -75,10 +75,12 @@ echo -e "*******************************************************\n" 2>&1 | tee - if [[ -f $dataease_conf ]]; then DE_LOGIN_TIMEOUT=$(prop $dataease_conf dataease.login_timeout) + DE_INIT_PASSWORD=$(prop $dataease_conf dataease.init_password) DE_MYSQL_PARAMS=$(grep -P "^\s*[^#]?spring.datasource.url=.*$" $dataease_conf | cut -d'=' --complement -f1 | awk -F'?' '{print $2}') fi export DE_MYSQL_PARAMS export DE_LOGIN_TIMEOUT=$([[ -z $DE_LOGIN_TIMEOUT ]] && echo -n 480 || echo -n $DE_LOGIN_TIMEOUT) +export DE_INIT_PASSWORD=$([[ -z $DE_INIT_PASSWORD ]] && echo -n DataEase123456 || echo -n $DE_INIT_PASSWORD) if [[ -f $dataease_conf ]] && [[ ! ${DE_EXTERNAL_DORIS} ]]; then export DE_DORIS_DB=$(prop $dataease_conf doris.db) diff --git a/installer/dataease/templates/dataease.properties b/installer/dataease/templates/dataease.properties index 64c1a3db5e..78df8f2a1c 100644 --- a/installer/dataease/templates/dataease.properties +++ b/installer/dataease/templates/dataease.properties @@ -16,7 +16,7 @@ doris.port=${DE_DORIS_PORT} doris.httpPort=${DE_DORIS_HTTPPORT} #新建用户初始密码 -dataease.init_password=DataEase123456 +dataease.init_password=${DE_INIT_PASSWORD} #登录超时时间单位min 如果不设置 默认8小时也就是480 dataease.login_timeout=${DE_LOGIN_TIMEOUT} From cad49b4915a8ac5970956de8c19aadddc3f89a9d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 26 Dec 2023 15:01:55 +0800 Subject: [PATCH 17/25] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E5=AF=BC=E5=87=BA=E6=97=B6=E9=97=B4=E6=9D=A1=E5=BD=A2?= =?UTF-8?q?=E5=9B=BE=E6=8A=A5=E9=94=99NPE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/service/chart/ChartViewService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8b18ea90be..d3c8a7f4a5 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 @@ -1503,7 +1503,7 @@ public class ChartViewService { if (CollectionUtils.isNotEmpty(detailData)) { mapTableNormal = ChartDataBuild.transTableNormalWithDetail(xAxis, yAxis, data, detailFieldList, detailData, desensitizationList); } else { - if (StringUtils.equalsIgnoreCase(view.getType(), "bar-time-range") && !drillRequestList.isEmpty() && !xAxisExt.isEmpty()) { // 针对区间条形图,还需要给xAxis排个序, 把xAxisExt放到最后 + if (StringUtils.equalsIgnoreCase(view.getType(), "bar-time-range") && CollectionUtils.isNotEmpty(drillRequestList) && CollectionUtils.isNotEmpty(xAxisExt)) { // 针对区间条形图,还需要给xAxis排个序, 把xAxisExt放到最后 int count = 0; for (int i = xAxis.size() - drillRequestList.size() - 1; i >= 0; i--) { xAxis.remove(i); From 79f98896926b1568778b8bf8a40d8d6f313272aa Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Tue, 26 Dec 2023 15:09:45 +0800 Subject: [PATCH 18/25] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20Tab=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=97=B6=E9=87=8D=E6=96=B0=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/customComponent/UserView.vue | 1 + core/frontend/src/views/chart/components/ChartComponentS2.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index ea961a8db9..eb90163773 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -655,6 +655,7 @@ export default { tabSwitch(tabCanvasId) { if (this.charViewS2ShowFlag && tabCanvasId === this.canvasId && this.$refs[this.element.propValue.id]) { // do nothing + this.$refs[this.element.propValue.id].chartResize() } }, // 编辑状态下 不启动刷新 diff --git a/core/frontend/src/views/chart/components/ChartComponentS2.vue b/core/frontend/src/views/chart/components/ChartComponentS2.vue index ae96b11a25..4b4243c187 100644 --- a/core/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/core/frontend/src/views/chart/components/ChartComponentS2.vue @@ -396,7 +396,8 @@ export default { const { width: chartWidth, height: chartHeight } = this.myChart.options if (width !== chartWidth || height !== chartHeight) { this.myChart?.changeSheetSize(width, height) - if (chartWidth || chartHeight) { + // 大小变化或者tab变化重新渲染 + if (chartWidth || chartHeight || !(chartHeight || chartWidth)) { this.myChart.render() } this.initScroll() From 517d7fcaac8fd25469d42fa35e2d3c0713a130d8 Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 26 Dec 2023 16:23:47 +0800 Subject: [PATCH 19/25] =?UTF-8?q?fix:=20antv=E7=BB=84=E5=90=88=E5=9B=BE?= =?UTF-8?q?=E5=90=8C=E6=AF=94=E7=8E=AF=E6=AF=94=E5=8D=A0=E6=AF=94=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/official/impl/ChartConstants.java | 14 ++ .../view/official/impl/ChartMixService.java | 211 +++++++++++++++++- .../plugins/view/entity/PluginViewField.java | 3 + 3 files changed, 220 insertions(+), 8 deletions(-) create mode 100644 extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartConstants.java diff --git a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartConstants.java b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartConstants.java new file mode 100644 index 0000000000..a9e207f60c --- /dev/null +++ b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartConstants.java @@ -0,0 +1,14 @@ +package io.dataease.plugins.view.official.impl; + +/** + * @Author gin + * @Date 2021/12/9 3:58 下午 + */ +public class ChartConstants { + public static final String YEAR_MOM = "year_mom"; + public static final String MONTH_MOM = "month_mom"; + public static final String YEAR_YOY = "year_yoy"; + public static final String DAY_MOM = "day_mom"; + public static final String MONTH_YOY = "month_yoy"; + public static final String[] M_Y = {YEAR_MOM, MONTH_MOM, YEAR_YOY, DAY_MOM, MONTH_YOY}; +} diff --git a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartMixService.java b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartMixService.java index a3d91c6fb0..22a60d2a62 100644 --- a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartMixService.java +++ b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-backend/src/main/java/io/dataease/plugins/view/official/impl/ChartMixService.java @@ -1,20 +1,20 @@ package io.dataease.plugins.view.official.impl; -import com.google.gson.Gson; import io.dataease.plugins.common.dto.StaticResource; +import io.dataease.plugins.common.dto.chart.ChartFieldCompareDTO; import io.dataease.plugins.view.entity.*; import io.dataease.plugins.view.official.handler.ChartMixViewStatHandler; import io.dataease.plugins.view.service.ViewPluginService; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.io.InputStream; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.*; @Service public class ChartMixService extends ViewPluginService { @@ -114,7 +114,6 @@ public class ChartMixService extends ViewPluginService { return null; } String sql = new ChartMixViewStatHandler().build(param, this); - System.out.println(sql); return sql; } @@ -125,7 +124,6 @@ public class ChartMixService extends ViewPluginService { List xAxis = new ArrayList<>(); List yAxis = new ArrayList<>(); - System.out.println("pluginViewParam: " + new Gson().toJson(pluginViewParam)); pluginViewParam.getPluginViewFields().forEach(pluginViewField -> { if (StringUtils.equals(pluginViewField.getTypeField(), "xAxis")) { @@ -141,12 +139,117 @@ public class ChartMixService extends ViewPluginService { map.put("data", series); - System.out.println(new Gson().toJson(map)); return map; } private List format(String type, List data, List xAxis, List yAxis) { + // 同比/环比计算 + // 调整data数据 + for (int i = 0; i < yAxis.size(); i++) { + PluginViewField chartViewFieldDTO = yAxis.get(i); + ChartFieldCompareDTO compareCalc = chartViewFieldDTO.getCompareCalc(); + if (ObjectUtils.isEmpty(compareCalc)) { + continue; + } + if (StringUtils.isNotEmpty(compareCalc.getType()) + && !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none")) { + String compareFieldId = compareCalc.getField();// 选中字段 + // 计算指标对应的下标 + int dataIndex = 0;// 数据字段下标 + + dataIndex = xAxis.size() + i; + + if (Arrays.asList(ChartConstants.M_Y).contains(compareCalc.getType())) { + String resultData = compareCalc.getResultData();// 数据设置 + // 获取选中字段以及下标 + List checkedField = new ArrayList<>(xAxis); + + int timeIndex = 0;// 时间字段下标 + PluginViewField timeField = null; + for (int j = 0; j < checkedField.size(); j++) { + if (StringUtils.equalsIgnoreCase(checkedField.get(j).getId(), compareFieldId)) { + timeIndex = j; + timeField = checkedField.get(j); + } + } + // 无选中字段,或者选中字段已经不在维度list中,或者选中字段日期格式不符合对比类型的,直接将对应数据置为null + if (ObjectUtils.isEmpty(timeField) || !checkCalcType(timeField.getDateStyle(), compareCalc.getType())) { + // set null + for (String[] item : data) { + item[dataIndex] = null; + } + } else { + // 计算 同比/环比 + // 1,处理当期数据;2,根据type计算上一期数据;3,根据resultData计算结果 + Map currentMap = new LinkedHashMap<>(); + for (String[] item : data) { + String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size()); + currentMap.put(StringUtils.join(dimension, "-"), item[dataIndex]); + } + + for (int index = 0; index < data.size(); index++) { + String[] item = data.get(index); + String cTime = item[timeIndex]; + String cValue = item[dataIndex]; + + // 获取计算后的时间,并且与所有维度拼接 + String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle(), timeField.getDatePattern()); + String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size()); + dimension[timeIndex] = lastTime; + + String lastValue = currentMap.get(StringUtils.join(dimension, "-")); + if (StringUtils.isEmpty(cValue) || StringUtils.isEmpty(lastValue)) { + item[dataIndex] = null; + } else { + if (StringUtils.equalsIgnoreCase(resultData, "sub")) { + item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString(); + } else if (StringUtils.equalsIgnoreCase(resultData, "percent")) { + if (new BigDecimal(lastValue).compareTo(BigDecimal.ZERO) == 0) { + item[dataIndex] = null; + } else { + item[dataIndex] = new BigDecimal(cValue) + .divide(new BigDecimal(lastValue), 8, RoundingMode.HALF_UP) + .subtract(new BigDecimal(1)) + .setScale(8, RoundingMode.HALF_UP) + .toString(); + } + } + } + } + } + } else if (StringUtils.equalsIgnoreCase(compareCalc.getType(), "percent")) { + // 求和 + BigDecimal sum = new BigDecimal(0); + for (int index = 0; index < data.size(); index++) { + String[] item = data.get(index); + String cValue = item[dataIndex]; + if (StringUtils.isEmpty(cValue)) { + continue; + } + sum = sum.add(new BigDecimal(cValue)); + } + // 计算占比 + for (int index = 0; index < data.size(); index++) { + String[] item = data.get(index); + String cValue = item[dataIndex]; + if (StringUtils.isEmpty(cValue)) { + continue; + } + if (sum.equals(new BigDecimal(0))) { + continue; + } + item[dataIndex] = new BigDecimal(cValue) + .divide(sum, 8, RoundingMode.HALF_UP) + .toString(); + } + } + } + } + + + // 同比/环比计算 over + List series = new ArrayList<>(); for (PluginViewField y : yAxis) { PluginSeries series1 = new PluginSeries(); @@ -188,4 +291,96 @@ public class ChartMixService extends ViewPluginService { return series; } + private boolean checkCalcType(String dateStyle, String calcType) { + switch (dateStyle) { + case "y": + return StringUtils.equalsIgnoreCase(calcType, "year_mom"); + case "y_M": + return StringUtils.equalsIgnoreCase(calcType, "month_mom") + || StringUtils.equalsIgnoreCase(calcType, "year_yoy"); + case "y_M_d": + return StringUtils.equalsIgnoreCase(calcType, "day_mom") + || StringUtils.equalsIgnoreCase(calcType, "month_yoy") + || StringUtils.equalsIgnoreCase(calcType, "year_yoy"); + } + return false; + } + + private String calcLastTime(String cTime, String type, String dateStyle, String datePattern) { + try { + String lastTime = null; + Calendar calendar = Calendar.getInstance(); + if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_MOM)) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy"); + Date date = simpleDateFormat.parse(cTime); + calendar.setTime(date); + calendar.add(Calendar.YEAR, -1); + lastTime = simpleDateFormat.format(calendar.getTime()); + } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_MOM)) { + SimpleDateFormat simpleDateFormat = null; + if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) { + simpleDateFormat = new SimpleDateFormat("yyyy/MM"); + } else { + simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + } + Date date = simpleDateFormat.parse(cTime); + calendar.setTime(date); + calendar.add(Calendar.MONTH, -1); + lastTime = simpleDateFormat.format(calendar.getTime()); + } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_YOY)) { + SimpleDateFormat simpleDateFormat = null; + if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) { + if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) { + simpleDateFormat = new SimpleDateFormat("yyyy/MM"); + } else { + simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + } + } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { + if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) { + simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd"); + } else { + simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + } + } + Date date = simpleDateFormat.parse(cTime); + calendar.setTime(date); + calendar.add(Calendar.YEAR, -1); + lastTime = simpleDateFormat.format(calendar.getTime()); + } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.DAY_MOM)) { + SimpleDateFormat simpleDateFormat = null; + if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) { + simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd"); + } else { + simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + } + Date date = simpleDateFormat.parse(cTime); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_MONTH, -1); + lastTime = simpleDateFormat.format(calendar.getTime()); + } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_YOY)) { + SimpleDateFormat simpleDateFormat = null; + if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) { + if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) { + simpleDateFormat = new SimpleDateFormat("yyyy/MM"); + } else { + simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + } + } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { + if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) { + simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd"); + } else { + simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + } + } + Date date = simpleDateFormat.parse(cTime); + calendar.setTime(date); + calendar.add(Calendar.MONTH, -1); + lastTime = simpleDateFormat.format(calendar.getTime()); + } + return lastTime; + } catch (Exception e) { + return cTime; + } + } + } diff --git a/sdk/dataease-plugin-view/src/main/java/io/dataease/plugins/view/entity/PluginViewField.java b/sdk/dataease-plugin-view/src/main/java/io/dataease/plugins/view/entity/PluginViewField.java index 16ac231166..a75c36b3e8 100644 --- a/sdk/dataease-plugin-view/src/main/java/io/dataease/plugins/view/entity/PluginViewField.java +++ b/sdk/dataease-plugin-view/src/main/java/io/dataease/plugins/view/entity/PluginViewField.java @@ -1,5 +1,6 @@ package io.dataease.plugins.view.entity; +import io.dataease.plugins.common.dto.chart.ChartFieldCompareDTO; import lombok.Data; import java.util.List; @@ -11,5 +12,7 @@ public class PluginViewField extends PluginChartViewFieldBase { private List filter; + private ChartFieldCompareDTO compareCalc; + private String busiType; } From 28ffb0ee0823b07e3723cb5d1b3a5027cad47ec7 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 26 Dec 2023 17:56:12 +0800 Subject: [PATCH 20/25] =?UTF-8?q?fix:=20=E5=8F=8D=E5=A4=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=85=A8=E5=B1=8F=E6=A8=A1=E5=BC=8F=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/api/panel/panel.js | 1 + core/frontend/src/api/panel/shareProxy.js | 1 + .../components/widget/deWidget/DeSelect.vue | 22 +++++++++++++++++-- core/frontend/src/store/index.js | 17 +++++++++++++- core/frontend/src/utils/conditionUtil.js | 12 ++++++++-- 5 files changed, 48 insertions(+), 5 deletions(-) diff --git a/core/frontend/src/api/panel/panel.js b/core/frontend/src/api/panel/panel.js index 86b9057988..a1829cc0d2 100644 --- a/core/frontend/src/api/panel/panel.js +++ b/core/frontend/src/api/panel/panel.js @@ -166,6 +166,7 @@ export function delGroup(groupId) { } export function initPanelData(panelId, useCache = false, callback) { + store.commit('resetLastValidFilters') const queryMethod = useCache ? findUserCacheRequest : findOne // 加载视图数据 queryMethod(panelId).then(response => { diff --git a/core/frontend/src/api/panel/shareProxy.js b/core/frontend/src/api/panel/shareProxy.js index 10c5853dd7..ddf5646703 100644 --- a/core/frontend/src/api/panel/shareProxy.js +++ b/core/frontend/src/api/panel/shareProxy.js @@ -5,6 +5,7 @@ import { $error } from '@/utils/message' import i18n from '@/lang' export function proxyInitPanelData(panelId, proxy, callback) { + store.commit('resetLastValidFilters') // 加载视图数据 findOne(panelId, proxy).then(response => { if (response.data) { diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index 7bb1b44c11..156ac552f4 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -378,7 +378,6 @@ export default { }, 500) }, initLoad() { - // this.value = this.fillValueDerfault() this.initOptions(this.fillFirstSelected) if (this.element.options.value && !this.selectFirst) { this.value = this.fillValueDerfault() @@ -442,6 +441,12 @@ export default { this.element.options.manualModify = false } else { this.element.options.manualModify = true + if (!this.showRequiredTips) { + this.$store.commit('setLastValidFilters', { + componentId: this.element.id, + val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value + }) + } } this.setCondition() this.handleShowNumber() @@ -478,6 +483,9 @@ export default { return param }, setCondition() { + if (this.showRequiredTips) { + return + } const param = this.getCondition() !this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param) }, @@ -504,7 +512,17 @@ export default { this.firstChange(this.value) }, fillValueDerfault() { - const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } + if (this.element.options.attrs.multiple) { if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] return defaultV.split(this.separator) diff --git a/core/frontend/src/store/index.js b/core/frontend/src/store/index.js index 7c657ffda5..8445509308 100644 --- a/core/frontend/src/store/index.js +++ b/core/frontend/src/store/index.js @@ -156,7 +156,8 @@ const data = { previewComponentData: [], currentCanvasNewId: [], lastViewRequestInfo: {}, - multiplexingStyleAdapt: true // 复用样式跟随主题 + multiplexingStyleAdapt: true, // 复用样式跟随主题 + lastValidFilters: {} }, mutations: { ...animation.mutations, @@ -562,6 +563,9 @@ const data = { state.componentData.push(component) }, deleteComponentWithId(state, id) { + if (state.lastValidFilters && state.lastValidFilters[id]) { + delete state.lastValidFilters[id] + } for (let index = 0; index < state.componentData.length; index++) { const element = state.componentData[index] if (element.id && element.id === id) { @@ -819,6 +823,7 @@ const data = { state.changeProperties[propertyInfo.custom][propertyInfo.property] = propertyInfo.value }, initCanvasBase(state) { + this.commit('resetLastValidFilters') this.commit('setCurComponent', { component: null, index: null }) this.commit('clearLinkageSettingInfo', false) this.commit('resetViewEditInfo') @@ -889,6 +894,10 @@ const data = { for (let index = 0; index < state.componentData.length; index++) { const element = state.componentData[index] if (element.canvasId && element.canvasId.includes(canvasId)) { + const cid = state.componentData[index] + if (state.lastValidFilters && state.lastValidFilters[cid]) { + delete state.lastValidFilters[cid] + } state.componentData.splice(index, 1) } } @@ -913,6 +922,12 @@ const data = { }, setMultiplexingStyleAdapt(state, value) { state.multiplexingStyleAdapt = value + }, + setLastValidFilters(state, data) { + state.lastValidFilters[data.componentId] = data + }, + resetLastValidFilters(state) { + state.lastValidFilters = {} } }, modules: { diff --git a/core/frontend/src/utils/conditionUtil.js b/core/frontend/src/utils/conditionUtil.js index ac93c68890..2e36428102 100644 --- a/core/frontend/src/utils/conditionUtil.js +++ b/core/frontend/src/utils/conditionUtil.js @@ -96,6 +96,7 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => { return result } const buildItems = panelItems[0].canvasId === 'canvas-main' ? panelItems : store.state.componentData + const lastValidFilters = store.state.lastValidFilters const canvasIdMap = buildCanvasIdMap(buildItems) buildItems.forEach((element, index) => { if (element.type !== 'custom') { @@ -105,9 +106,16 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => { let param = null const widget = ApplicationContext.getService(element.serviceName) - param = widget.getParam(element) + let lastFilter = null + if (lastValidFilters) { + lastFilter = lastValidFilters[element.id] + } + param = widget.getParam(element, lastFilter?.val) const condition = formatCondition(param) - const vValid = valueValid(condition) + let vValid = valueValid(condition) + if (lastFilter && !lastFilter.val) { + vValid = false + } const filterComponentId = condition.componentId Object.keys(result).forEach(viewId => { // 进行过滤时 如果过滤组件在主画布 则条件适用于所有画布视图 否则需要过滤组件和视图在相同画布 From 0aecda198987578b53ad4be524cafc9a7688eed4 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Dec 2023 11:38:28 +0800 Subject: [PATCH 21/25] =?UTF-8?q?perf:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E5=9C=A8=E5=88=87=E6=8D=A2=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E5=9C=BA=E6=99=AF=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeDate.vue | 20 +++++++++++- .../widget/deWidget/DeInputSearch.vue | 19 ++++++++++- .../widget/deWidget/DeNumberRange.vue | 32 ++++++++++++++++--- .../widget/deWidget/DeSelectGrid.vue | 20 +++++++++++- .../widget/deWidget/DeSelectTree.vue | 20 +++++++++++- .../serviceImpl/NumberRangeServiceImpl.js | 11 +++++-- .../NumberSelectGridServiceImpl.js | 9 ++++-- .../serviceImpl/NumberSelectServiceImpl.js | 9 ++++-- .../serviceImpl/TextInputServiceImpl.js | 9 ++++-- .../serviceImpl/TextSelectGridServiceImpl.js | 9 ++++-- .../serviceImpl/TextSelectTreeServiceImpl.js | 9 ++++-- .../serviceImpl/TimeDateRangeServiceImpl.js | 8 +++-- .../widget/serviceImpl/TimeDateServiceImpl.js | 8 +++-- .../serviceImpl/TimeMonthServiceImpl.js | 8 +++-- .../widget/serviceImpl/TimeYearServiceImpl.js | 8 +++-- 15 files changed, 169 insertions(+), 30 deletions(-) diff --git a/core/frontend/src/components/widget/deWidget/DeDate.vue b/core/frontend/src/components/widget/deWidget/DeDate.vue index ff391cf5d9..86cc6fd680 100644 --- a/core/frontend/src/components/widget/deWidget/DeDate.vue +++ b/core/frontend/src/components/widget/deWidget/DeDate.vue @@ -459,6 +459,9 @@ export default { return param }, setCondition() { + if (this.showRequiredTips) { + return + } const param = this.getCondition() !this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param) }, @@ -472,6 +475,12 @@ export default { this.element.options.manualModify = false } else { this.element.options.manualModify = true + if (!this.showRequiredTips) { + this.$store.commit('setLastValidFilters', { + componentId: this.element.id, + val: (this.values && Array.isArray(this.values)) ? this.values.join(',') : this.values + }) + } } this.setCondition() }, @@ -501,7 +510,16 @@ export default { } }, fillValueDerfault() { - const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = (lastFilters.val === null || typeof lastFilters.val === 'undefined') ? '' : lastFilters.val.toString() + } + } + } if (this.element.options.attrs.type === 'daterange') { if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') { diff --git a/core/frontend/src/components/widget/deWidget/DeInputSearch.vue b/core/frontend/src/components/widget/deWidget/DeInputSearch.vue index 74b87f9b59..5447cc3212 100644 --- a/core/frontend/src/components/widget/deWidget/DeInputSearch.vue +++ b/core/frontend/src/components/widget/deWidget/DeInputSearch.vue @@ -114,6 +114,11 @@ export default { search() { if (!this.inDraw) { this.element.options.value = this.value + } else if (!this.showRequiredTips) { + this.$store.commit('setLastValidFilters', { + componentId: this.element.id, + val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value + }) } this.setCondition() }, @@ -127,6 +132,9 @@ export default { return param }, setCondition() { + if (this.showRequiredTips) { + return + } const param = this.getCondition() !this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param) }, @@ -142,7 +150,16 @@ export default { } }, fillValueDerfault() { - const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null return defaultV.split(',')[0] } diff --git a/core/frontend/src/components/widget/deWidget/DeNumberRange.vue b/core/frontend/src/components/widget/deWidget/DeNumberRange.vue index 55414ff536..c66186c86e 100644 --- a/core/frontend/src/components/widget/deWidget/DeNumberRange.vue +++ b/core/frontend/src/components/widget/deWidget/DeNumberRange.vue @@ -127,7 +127,7 @@ export default { }, 'defaultvalues': function(value, old) { if (value === old) return - const values = this.element.options.value + const values = this.fillValueDerfault() this.form.min = values[0] if (values.length > 1) { this.form.max = values[1] @@ -145,7 +145,7 @@ export default { }, created() { if (this.element.options.value && this.element.options.value.length > 0) { - const values = this.element.options.value + const values = this.fillValueDerfault() this.form.min = values[0] if (values.length > 1) { this.form.max = values[1] @@ -174,13 +174,12 @@ export default { this.form.min = null this.form.max = null } else { - const values = this.element.options.value + const values = this.fillValueDerfault() this.form.min = values[0] if (values.length > 1) { this.form.max = values[1] } } - this.search() } }, @@ -251,7 +250,13 @@ export default { if (!valid) { return false } - + if (!this.showRequiredTips) { + const values = [this.form.min, this.form.max] + this.$store.commit('setLastValidFilters', { + componentId: this.element.id, + val: (values && Array.isArray(values)) ? values.join(',') : values + }) + } this.setCondition() }) }) @@ -283,6 +288,9 @@ export default { return param }, setCondition() { + if (this.showRequiredTips) { + return + } const param = this.getCondition() if (this.form.min && this.form.max) { @@ -316,6 +324,20 @@ export default { } else { this.element.options.manualModify = true } + }, + fillValueDerfault() { + let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] + return defaultV.split(',') } } } diff --git a/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue b/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue index 2d488304f5..df937aa02b 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue @@ -381,6 +381,12 @@ export default { this.element.options.manualModify = false } else { this.element.options.manualModify = true + if (!this.showRequiredTips) { + this.$store.commit('setLastValidFilters', { + componentId: this.element.id, + val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value + }) + } } this.setCondition() }, @@ -394,6 +400,9 @@ export default { return param }, setCondition() { + if (this.showRequiredTips) { + return + } const param = this.getCondition() !this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param) }, @@ -403,7 +412,16 @@ export default { return this.value.split(',') }, fillValueDerfault() { - const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } if (this.element.options.attrs.multiple) { if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') { return [] diff --git a/core/frontend/src/components/widget/deWidget/DeSelectTree.vue b/core/frontend/src/components/widget/deWidget/DeSelectTree.vue index 3b02170d82..7bc39163b7 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelectTree.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelectTree.vue @@ -313,6 +313,12 @@ export default { this.element.options.manualModify = false } else { this.element.options.manualModify = true + if (!this.showRequiredTips) { + this.$store.commit('setLastValidFilters', { + componentId: this.element.id, + val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value + }) + } } this.setCondition() }, @@ -331,6 +337,9 @@ export default { }, setCondition() { + if (this.showRequiredTips) { + return + } const param = this.getCondition() !this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param) }, @@ -370,7 +379,16 @@ export default { }, fillValueDerfault() { - const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } if (this.element.options.attrs.multiple) { if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] return defaultV.split(',') diff --git a/core/frontend/src/components/widget/serviceImpl/NumberRangeServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/NumberRangeServiceImpl.js index 9b1c1dca25..341b4fb2ca 100644 --- a/core/frontend/src/components/widget/serviceImpl/NumberRangeServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/NumberRangeServiceImpl.js @@ -67,9 +67,14 @@ class NumberRangeServiceImpl extends WidgetService { }) } - getParam(element) { - if (element.options.value && element.options.value.length > 0) { - const values = element.options.value + getParam(element, val) { + let values = null + if (val === null || val === '' || typeof val === 'undefined') { + values = element.options.value + } else { + values = val.split(',') + } + if (values && values.length > 0) { const min = values[0] let max = null if (values.length > 1) { diff --git a/core/frontend/src/components/widget/serviceImpl/NumberSelectGridServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/NumberSelectGridServiceImpl.js index b3d2af607e..c34ffc01aa 100644 --- a/core/frontend/src/components/widget/serviceImpl/NumberSelectGridServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/NumberSelectGridServiceImpl.js @@ -82,8 +82,13 @@ class NumberSelectGridServiceImpl extends WidgetService { } }) } - getParam(element) { - const value = this.fillValueDerfault(element) + getParam(element, val) { + let value = null + if (val === null || val === '' || typeof val === 'undefined') { + value = this.fillValueDerfault(element) + } else { + value = [val] + } const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','), diff --git a/core/frontend/src/components/widget/serviceImpl/NumberSelectServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/NumberSelectServiceImpl.js index d18f91f69f..92efb280cb 100644 --- a/core/frontend/src/components/widget/serviceImpl/NumberSelectServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/NumberSelectServiceImpl.js @@ -84,8 +84,13 @@ class NumberSelectServiceImpl extends WidgetService { } }) } - getParam(element) { - const value = this.fillValueDerfault(element) + getParam(element, val) { + let value = null + if (val === null || val === '' || typeof val === 'undefined') { + value = this.fillValueDerfault(element) + } else { + value = [val] + } const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','), diff --git a/core/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js index 87090ebd17..207aea0188 100644 --- a/core/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js @@ -68,8 +68,13 @@ class TextInputServiceImpl extends WidgetService { return field['deType'] === 0 }) } - getParam(element) { - const value = this.fillValueDerfault(element) + getParam(element, val) { + let value = null + if (!val) { + value = this.fillValueDerfault(element) + } else { + value = [val] + } const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : [value], diff --git a/core/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js index d80dc1c4c0..75808bb1f0 100644 --- a/core/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js @@ -83,8 +83,13 @@ class TextSelectGridServiceImpl extends WidgetService { } }) } - getParam(element) { - const value = this.fillValueDerfault(element) + getParam(element, val) { + let value = null + if (!val) { + value = this.fillValueDerfault(element) + } else { + value = [val] + } const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','), diff --git a/core/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js index 4f6d02afac..01f7acfa13 100644 --- a/core/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js @@ -86,8 +86,13 @@ class TextSelectTreeServiceImpl extends WidgetService { }) } - getParam(element) { - const value = this.fillValueDerfault(element) + getParam(element, val) { + let value = null + if (!val) { + value = this.fillValueDerfault(element) + } else { + value = [val] + } const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','), diff --git a/core/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js index cd33146057..765b109a6c 100644 --- a/core/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js @@ -310,9 +310,13 @@ class TimeDateRangeServiceImpl extends WidgetService { return false } } - getParam(element) { + getParam(element, val) { let timeArr = [] - if (element.options.attrs.default && element.options.attrs.default.isDynamic) { + if (val) { + let value = [val] + value = this.formatFilterValue(value) + timeArr = this.formatValues(value, element) + } else if (element.options.attrs.default && element.options.attrs.default.isDynamic) { let value = this.dynamicDateFormNow(element) value = this.formatFilterValue(value) timeArr = this.formatValues(value, element) diff --git a/core/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js index a1646a5383..2d6d619d41 100644 --- a/core/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js @@ -167,9 +167,13 @@ class TimeDateServiceImpl extends WidgetService { } } } - getParam(element) { + getParam(element, val) { let timeArr = [] - if (element.options.attrs.default && element.options.attrs.default.isDynamic) { + if (val) { + let value = [val] + value = this.formatFilterValue(value) + timeArr = this.formatValues(value, element) + } else if (element.options.attrs.default && element.options.attrs.default.isDynamic) { let value = this.dynamicDateFormNow(element) value = this.formatFilterValue(value) timeArr = this.formatValues(value, element) diff --git a/core/frontend/src/components/widget/serviceImpl/TimeMonthServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TimeMonthServiceImpl.js index 1254999750..f8ba82b7f7 100644 --- a/core/frontend/src/components/widget/serviceImpl/TimeMonthServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TimeMonthServiceImpl.js @@ -128,9 +128,13 @@ class TimeMonthServiceImpl extends WidgetService { } } } - getParam(element) { + getParam(element, val) { let timeArr = [] - if (element.options.attrs.default && element.options.attrs.default.isDynamic) { + if (val) { + let value = [val] + value = this.formatFilterValue(value) + timeArr = this.formatValues(value, element) + } else if (element.options.attrs.default && element.options.attrs.default.isDynamic) { let value = this.dynamicDateFormNow(element) value = this.formatFilterValue(value) timeArr = this.formatValues(value, element) diff --git a/core/frontend/src/components/widget/serviceImpl/TimeYearServiceImpl.js b/core/frontend/src/components/widget/serviceImpl/TimeYearServiceImpl.js index 90d440cdf2..12169259fe 100644 --- a/core/frontend/src/components/widget/serviceImpl/TimeYearServiceImpl.js +++ b/core/frontend/src/components/widget/serviceImpl/TimeYearServiceImpl.js @@ -115,9 +115,13 @@ class TimeYearServiceImpl extends WidgetService { return new Date(dynamicSuffix === 'before' ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1).getTime() } } - getParam(element) { + getParam(element, val) { let timeArr = [] - if (element.options.attrs.default && element.options.attrs.default.isDynamic) { + if (val) { + let value = [val] + value = this.formatFilterValue(value) + timeArr = this.formatValues(value, element) + } else if (element.options.attrs.default && element.options.attrs.default.isDynamic) { let value = this.dynamicDateFormNow(element) value = this.formatFilterValue(value) timeArr = this.formatValues(value, element) From d3e7780a8f2d219a0f73c21074da8762c62b732a Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Dec 2023 12:05:21 +0800 Subject: [PATCH 22/25] =?UTF-8?q?fix:=20=E6=96=87=E6=9C=AC=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=AE=BE=E7=BD=AE=E9=A6=96=E9=A1=B9=E5=9C=A8=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=A8=A1=E5=BC=8F=E5=8F=AF=E8=83=BD=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeSelect.vue | 11 ++++++++++- core/frontend/src/utils/conditionUtil.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index 156ac552f4..6a3ea05449 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -501,7 +501,16 @@ export default { if (!this.selectFirst) { return } - const defaultV = this.data[0].id + let defaultV = this.data[0].id + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } if (this.element.options.attrs.multiple) { if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] this.value = defaultV.split(this.separator) diff --git a/core/frontend/src/utils/conditionUtil.js b/core/frontend/src/utils/conditionUtil.js index 2e36428102..177d4a7933 100644 --- a/core/frontend/src/utils/conditionUtil.js +++ b/core/frontend/src/utils/conditionUtil.js @@ -121,7 +121,7 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => { // 进行过滤时 如果过滤组件在主画布 则条件适用于所有画布视图 否则需要过滤组件和视图在相同画布 if (element.canvasId === 'canvas-main' || element.canvasId === canvasIdMap[viewId]) { const vidMatch = viewIdMatch(condition.viewIds, viewId) - if (vidMatch && selectFirst && !element.options.loaded) { + if (vidMatch && selectFirst && !element.options.loaded && !lastFilter) { const obj = {} const promise = new Promise(resolve => { cacheCondition(cbParam => { From 41b9ec253791b0468d6bca5669ffdc609e31d446 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Dec 2023 12:20:39 +0800 Subject: [PATCH 23/25] =?UTF-8?q?fix:=20=E6=96=87=E6=9C=AC=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=AE=BE=E7=BD=AE=E5=BF=85=E5=A1=AB=E5=90=8E=E5=8F=8D?= =?UTF-8?q?=E5=A4=8D=E7=BC=96=E8=BE=91=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/components/canvas/DeCanvas.vue | 1 + core/frontend/src/store/index.js | 5 +++++ core/frontend/src/views/panel/edit/index.vue | 1 + 3 files changed, 7 insertions(+) diff --git a/core/frontend/src/components/canvas/DeCanvas.vue b/core/frontend/src/components/canvas/DeCanvas.vue index d97346a6d1..4c206ddadf 100644 --- a/core/frontend/src/components/canvas/DeCanvas.vue +++ b/core/frontend/src/components/canvas/DeCanvas.vue @@ -509,6 +509,7 @@ export default { this.$store.commit('setComponentWithId', this.currentFilterCom) this.$store.commit('recordSnapshot', 'sureFilter') this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex }) + this.$store.commit('delLastValidFilterWithId', this.currentFilterCom.id) bus.$emit('reset-default-value', this.currentFilterCom) this.closeFilter() }, diff --git a/core/frontend/src/store/index.js b/core/frontend/src/store/index.js index 8445509308..bc3cc351e0 100644 --- a/core/frontend/src/store/index.js +++ b/core/frontend/src/store/index.js @@ -928,6 +928,11 @@ const data = { }, resetLastValidFilters(state) { state.lastValidFilters = {} + }, + delLastValidFilterWithId(state, id) { + if (state.lastValidFilters[id]) { + delete state.lastValidFilters[id] + } } }, modules: { diff --git a/core/frontend/src/views/panel/edit/index.vue b/core/frontend/src/views/panel/edit/index.vue index b86f0a3bf2..cb0a2f3624 100644 --- a/core/frontend/src/views/panel/edit/index.vue +++ b/core/frontend/src/views/panel/edit/index.vue @@ -1269,6 +1269,7 @@ export default { this.$store.commit('recordSnapshot', 'sureFilter') this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex }) this.$store.commit('setComponentFromList', this.currentFilterCom) + this.$store.commit('delLastValidFilterWithId', this.currentFilterCom.id) bus.$emit('reset-default-value', this.currentFilterCom) this.closeFilter() }, From e7ca2243fa4b854df829d14be65463ce370d4b1d Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 27 Dec 2023 14:13:27 +0800 Subject: [PATCH 24/25] =?UTF-8?q?fix:=20AntV=E7=BB=84=E5=90=88=E5=9B=BE?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E8=AE=A1=E7=AE=97=E5=AD=97=E6=AE=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=90=8E=E6=9C=AA=E6=8F=90=E7=A4=BA=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view-chartmix-frontend/src/components/views/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/views/utils.js b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/views/utils.js index 307c4f637e..81f3a0434a 100644 --- a/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/views/utils.js +++ b/extensions/dataease-extensions-view/view-chartmix/view-chartmix-frontend/src/components/views/utils.js @@ -11,12 +11,12 @@ export function getItemType(dimensionData, quotaData, item) { for (let i = 0; i < dimensionData.length; i++) { const ele = dimensionData[i] if (item.chartId) { - if (ele.dataeaseName === item.dataeaseName && ele.deType === item.deType && ele.groupType === item.groupType) { + if (ele.dataeaseName === item.dataeaseName && ele.deType === item.deType && ele.groupType === item.groupType && ele.originName === item.originName) { checked = true break } } else { - if (ele.id === item.id && ele.deType === item.deType && ele.groupType === item.groupType) { + if (ele.id === item.id && ele.deType === item.deType && ele.groupType === item.groupType && ele.originName === item.originName) { checked = true break } @@ -27,12 +27,12 @@ export function getItemType(dimensionData, quotaData, item) { for (let i = 0; i < quotaData.length; i++) { const ele = quotaData[i] if (item.chartId) { - if (ele.dataeaseName === item.dataeaseName && ele.deType === item.deType && ele.groupType === item.groupType) { + if (ele.dataeaseName === item.dataeaseName && ele.deType === item.deType && ele.groupType === item.groupType && ele.originName === item.originName) { checked = true break } } else { - if (ele.id === item.id && ele.deType === item.deType && ele.groupType === item.groupType) { + if (ele.id === item.id && ele.deType === item.deType && ele.groupType === item.groupType && ele.originName === item.originName) { checked = true break } From 6263075942713c216453b9e00e2ff04ab0cc5027 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 27 Dec 2023 14:53:08 +0800 Subject: [PATCH 25/25] =?UTF-8?q?refactor:=20=E5=8E=BB=E6=8E=89=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=8A=A0=E8=BD=BD=E9=9D=9E=E5=BF=85=E8=A6=81=E7=9A=84?= =?UTF-8?q?loading=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/api/system/dynamic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/frontend/src/api/system/dynamic.js b/core/frontend/src/api/system/dynamic.js index 6ca3f50daf..7c21455682 100644 --- a/core/frontend/src/api/system/dynamic.js +++ b/core/frontend/src/api/system/dynamic.js @@ -4,7 +4,7 @@ export function get(url) { return request({ url: url, method: 'get', - loading: true + loading: false }) }