From 990c6778df512ee8fb856082fa943283c3ca7b5c Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 28 Jul 2021 11:32:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=88=87=E6=8D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddCustom.vue | 16 ++++++++++++++-- frontend/src/views/dataset/add/AddSQL.vue | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/dataset/add/AddCustom.vue b/frontend/src/views/dataset/add/AddCustom.vue index a5b058a2aa..64031a1c50 100644 --- a/frontend/src/views/dataset/add/AddCustom.vue +++ b/frontend/src/views/dataset/add/AddCustom.vue @@ -88,6 +88,11 @@ export default { } }, watch: { + 'param.tableId': { + handler: function() { + this.resetComponent() + } + }, 'checkedList': function() { // console.log(this.checkedList) this.getUnionData() @@ -239,8 +244,15 @@ export default { } }, - dataReset() { - + resetComponent() { + this.name = '自定义数据集' + this.table = {} + this.checkedList = [] + this.unionData = [] + this.height = 500 + this.data = [] + this.fields = [] + this.customType = ['db', 'sql', 'excel'] } } diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 759c5f6ccd..cb8873deb4 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -163,6 +163,7 @@ export default { watch: { 'param.tableId': { handler: function() { + this.resetComponent() this.initTableInfo() } } @@ -302,6 +303,20 @@ export default { // console.log(newCode) this.sql = newCode this.$emit('codeChange', this.sql) + }, + + resetComponent() { + this.dataSource = '' + this.options = [] + this.name = '' + this.sql = '' + this.data = [] + this.fields = [] + this.mode = '0' + this.syncType = 'sync_now' + this.height = 500 + this.kettleRunning = false + this.$refs.plxTable.reloadData(this.data) } } } From 89a7d4b311d4f8ea46e986e89a0cd8cebc4c2795 Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 28 Jul 2021 11:41:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E5=99=A8=E5=A4=9A?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=95=B0=E6=8D=AE=E9=9B=86=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E9=9B=86=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/service/chart/ChartViewService.java | 14 ++++++++------ frontend/src/views/dataset/add/AddSQL.vue | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index fe8f3a5a4e..23716d853b 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -138,14 +138,16 @@ public class ChartViewService { }.getType()); List fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken>() { }.getType()); - List customFilter = fieldCustomFilter.stream().map(ele -> { - ChartCustomFilterDTO dto = new ChartCustomFilterDTO(); - ele.getFilter().forEach(f -> { + List customFilter = new ArrayList<>(); + for (ChartFieldCustomFilterDTO ele : fieldCustomFilter) { + List collect = ele.getFilter().stream().map(f -> { + ChartCustomFilterDTO dto = new ChartCustomFilterDTO(); BeanUtils.copyBean(dto, f); dto.setField(dataSetTableFieldsService.get(f.getFieldId())); - }); - return dto; - }).collect(Collectors.toList()); + return dto; + }).collect(Collectors.toList()); + customFilter.addAll(collect); + } if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) { xAxis = new ArrayList<>(); diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index cb8873deb4..4cb93f2393 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -284,7 +284,7 @@ export default { cancel() { // this.dataReset() if (this.param.tableId) { - this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table}) + this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table }) } else { this.$emit('switchComponent', { name: '' }) }