From 4527e02448d3b59eb9733c2c85255f825688295a Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 13:27:59 +0800 Subject: [PATCH 01/23] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E5=80=BC=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/map/map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index 51a7da97ef..81baaae308 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -18,7 +18,7 @@ export function baseMapOption(chart_option, chart) { const a = params.seriesName const b = params.name const c = params.value ? params.value : '' - return text.replaceAll('{a}', a).replaceAll('{b}', b).replaceAll('{c}', c) + return text.replace('\{a}\g', a).replace('\{b}\g', b).replace('\{c}\g', c) } chart_option.tooltip = tooltip } @@ -36,7 +36,7 @@ export function baseMapOption(chart_option, chart) { const a = params.seriesName const b = params.name const c = params.value ? params.value : '' - return text.replaceAll('{a}', a).replaceAll('{b}', b).replaceAll('{c}', c) + return text.replace(new RegExp('{a}', 'g'), a).replace(new RegExp('{b}', 'g'), b).replace(new RegExp('{c}', 'g'), c) } chart_option.series[0].labelLine = customAttr.label.labelLine } From d714866f74cab9b4bdd357948ac2705b858a2767 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 13:29:23 +0800 Subject: [PATCH 02/23] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E5=80=BC=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/map/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index 81baaae308..eba14b830c 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -18,7 +18,7 @@ export function baseMapOption(chart_option, chart) { const a = params.seriesName const b = params.name const c = params.value ? params.value : '' - return text.replace('\{a}\g', a).replace('\{b}\g', b).replace('\{c}\g', c) + return text.replace(new RegExp('{a}', 'g'), a).replace(new RegExp('{b}', 'g'), b).replace(new RegExp('{c}', 'g'), c) } chart_option.tooltip = tooltip } From 7c37cccf79ddf252e2588e7e089af71f834a1002 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 13:29:24 +0800 Subject: [PATCH 03/23] =?UTF-8?q?style:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/Preview.vue | 2 +- .../src/views/panel/AssistComponent/index.vue | 3 +- frontend/src/views/panel/edit/index.vue | 40 +++++++++---------- frontend/src/views/panel/filter/index.vue | 3 +- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 9a57c62d50..959909cae3 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -311,7 +311,7 @@ export default { } }, handleMouseDown() { - this.$store.commit('setClickComponentStatus', fals) + this.$store.commit('setClickComponentStatus', false) }, initMobileCanvas() { this.$store.commit('openMobileLayout') diff --git a/frontend/src/views/panel/AssistComponent/index.vue b/frontend/src/views/panel/AssistComponent/index.vue index f36e3bd6bb..63f51a9d0f 100644 --- a/frontend/src/views/panel/AssistComponent/index.vue +++ b/frontend/src/views/panel/AssistComponent/index.vue @@ -339,7 +339,8 @@ export default { white-space: pre; text-overflow: ellipsis; position: absolute; - inset: 0px 0px 0px 40px; + /* inset: 0px 0px 0px 40px; */ + margin-left: 40px; box-sizing: border-box; overflow: hidden; overflow-x: hidden; diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index a29fc85b2c..b7cb1adb67 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -37,35 +37,31 @@ -
-
-
- -
-
-
- {{ $t('panel.module') }} -
-
+ +
+ +
+
+
+ {{ $t('panel.module') }}
+
-
-
-
- -
-
-
- {{ $t('panel.other_module') }} -
-
+ +
+ +
+
+
+ {{ $t('panel.other_module') }}
+
@@ -220,8 +216,8 @@ import ViewSelect from '../ViewSelect' import SubjectSetting from '../SubjectSetting' import bus from '@/utils/bus' import Editor from '@/components/canvas/components/Editor/index' -import {deepCopy, panelInit} from '@/components/canvas/utils/utils' -import componentList, { BASE_MOBILE_STYLE ,HYPERLINKS} from '@/components/canvas/custom-component/component-list' // 左侧列表数据 +import { deepCopy, panelInit } from '@/components/canvas/utils/utils' +import componentList, { BASE_MOBILE_STYLE, HYPERLINKS } from '@/components/canvas/custom-component/component-list' // 左侧列表数据 import { mapState } from 'vuex' import { uuid } from 'vue-uuid' import Toolbar from '@/components/canvas/components/Toolbar' diff --git a/frontend/src/views/panel/filter/index.vue b/frontend/src/views/panel/filter/index.vue index 16870d794e..6e722e55f6 100644 --- a/frontend/src/views/panel/filter/index.vue +++ b/frontend/src/views/panel/filter/index.vue @@ -272,7 +272,8 @@ export default { white-space: pre; text-overflow: ellipsis; position: absolute; - inset: 0px 0px 0px 40px; + /* inset: 0px 0px 0px 40px; */ + margin-left: 40px; box-sizing: border-box; overflow: hidden; overflow-x: hidden; From 2acecb67098e10110d1a59f175f1bf0ab6d9b659 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 14:37:22 +0800 Subject: [PATCH 04/23] =?UTF-8?q?style:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dataease/DeOutWidget.vue | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index a3bc506d92..a33d08eae0 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -106,10 +106,19 @@ export default { if (height < min) { // console.log(titleWidth) this.mainClass = 'condition-main-line' - deContentContainer && (deContentContainer.style.inset = '0 0 0 ' + (titleWidth + 15) + 'px') + /* deContentContainer && (deContentContainer.style.inset = '0 0 0 ' + (titleWidth + 15) + 'px') */ + + if (deContentContainer) { + deContentContainer.style.top = '0px' + deContentContainer.style.marginLeft = (titleWidth + 15) + 'px' + } } else { this.mainClass = '' - deContentContainer && (deContentContainer.style.inset = '33px 0px 0px') + /* deContentContainer && (deContentContainer.style.inset = '33px 0px 0px') */ + if (deContentContainer) { + deContentContainer.style.top = '33px' + deContentContainer.style.marginLeft = '0px' + } } }) }) @@ -122,15 +131,27 @@ export default { .my-container { position: absolute; overflow: auto; - inset: 0px; + /* inset: 0px; */ + top:0px; + right: 0px; + bottom: 0px; + left: 0px; } .ccondition-main { position: absolute; overflow: auto; - inset: 0px; + /* inset: 0px; */ + top:0px; + right: 0px; + bottom: 0px; + left: 0px; } .condition-title { - inset: 0; + /* inset: 0; */ + top:0px; + right: 0px; + bottom: 0px; + left: 0px; position: absolute; height: 35px; cursor: -webkit-grab; @@ -145,7 +166,9 @@ export default { } .condition-title-absolute { - inset: 0px 0px; + /* inset: 0px 0px; */ + right: 0px; + bottom: 0px; position: absolute; top: 15px; left: 4px; @@ -159,7 +182,11 @@ export default { .condition-content { overflow: auto hidden; - inset: 33px 0px 0px; + /* inset: 33px 0px 0px; */ + top: 33px; + left: 0px; + right: 0px; + bottom: 0px; position: absolute; letter-spacing: 0px!important; } From dc0a28036688eaa7edb3c0fc34cd6fc092336fee Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 14:48:16 +0800 Subject: [PATCH 05/23] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E5=90=8C?= =?UTF-8?q?=E6=AF=94=E7=8E=AF=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/chart/ChartViewService.java | 88 ++++++++++--------- 1 file changed, 46 insertions(+), 42 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 132bec8b4e..c0d6229740 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -600,50 +600,54 @@ public class ChartViewService { } private String calcLastTime(String cTime, String type, String dateStyle) throws Exception { - 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 = 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")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + 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 = 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")) { + simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { + 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 = 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")) { + simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { + simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + } + Date date = simpleDateFormat.parse(cTime); + calendar.setTime(date); + calendar.add(Calendar.MONTH, -1); + lastTime = simpleDateFormat.format(calendar.getTime()); } - 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 = 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")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM"); - } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { - 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; } - return lastTime; } private boolean checkDrillExist(List xAxis, List extStack, ChartViewFieldDTO dto, ChartViewWithBLOBs view) { From 383f8ef292f8ea89a5d377a6b3210cc9a1d42438 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 15:27:37 +0800 Subject: [PATCH 06/23] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E5=90=8C?= =?UTF-8?q?=E6=AF=94=E7=8E=AF=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/chart/ChartViewService.java | 42 +++++++++++++++---- 1 file changed, 34 insertions(+), 8 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 c0d6229740..217c8c8374 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -498,7 +498,7 @@ public class ChartViewService { String cValue = item[dataIndex]; // 获取计算后的时间,并且与所有维度拼接 - String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle()); + String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle(), timeField.getDatePattern()); String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size()); dimension[timeIndex] = lastTime; @@ -599,7 +599,7 @@ public class ChartViewService { return false; } - private String calcLastTime(String cTime, String type, String dateStyle) throws Exception { + private String calcLastTime(String cTime, String type, String dateStyle, String datePattern) { try { String lastTime = null; Calendar calendar = Calendar.getInstance(); @@ -610,7 +610,12 @@ public class ChartViewService { calendar.add(Calendar.YEAR, -1); lastTime = simpleDateFormat.format(calendar.getTime()); } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_MOM)) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + 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); @@ -618,16 +623,29 @@ public class ChartViewService { } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_YOY)) { SimpleDateFormat simpleDateFormat = null; if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + 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")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + 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 = new SimpleDateFormat("yyyy-MM-dd"); + 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); @@ -635,9 +653,17 @@ public class ChartViewService { } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_YOY)) { SimpleDateFormat simpleDateFormat = null; if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + 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")) { - simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + 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); From d5071d99bd58cb90ff2146d6653655fe12cd1a78 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 17:10:01 +0800 Subject: [PATCH 07/23] =?UTF-8?q?fix:=20=E5=8A=A8=E6=80=81=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/serviceImpl/TimeDateServiceImpl.js | 5 +++-- .../src/views/panel/filter/defaultValue/DeDateDefault.vue | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js b/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js index 3b2c7913be..98bfcc7af6 100644 --- a/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js +++ b/frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js @@ -91,7 +91,7 @@ class TimeDateServiceImpl extends WidgetService { } if (element.options.attrs.default.dkey === 3) { - const dynamicPrefix = element.options.attrs.default.dynamicPrefix + const dynamicPrefix = parseInt(element.options.attrs.default.dynamicPrefix) const dynamicInfill = element.options.attrs.default.dynamicInfill const dynamicSuffix = element.options.attrs.default.dynamicSuffix @@ -130,7 +130,8 @@ class TimeDateServiceImpl extends WidgetService { const nowMonth = now.getMonth() const nowYear = now.getFullYear() const nowDate = now.getDate() - return new Date(nowYear - 1, nowMonth, nowDate).getTime() + + return new Date(dynamicSuffix === 'before' ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), nowMonth, nowDate).getTime() } } } diff --git a/frontend/src/views/panel/filter/defaultValue/DeDateDefault.vue b/frontend/src/views/panel/filter/defaultValue/DeDateDefault.vue index dc4e970995..4c3765a331 100644 --- a/frontend/src/views/panel/filter/defaultValue/DeDateDefault.vue +++ b/frontend/src/views/panel/filter/defaultValue/DeDateDefault.vue @@ -98,6 +98,10 @@ export default { }, dynamicPrefixChange(value) { + if (value < 1) { + value = 1 + this.element.options.attrs.default.dynamicPrefix = 1 + } this.setDval() }, dynamicInfillChange(value) { From a5bc88859f31a4df35dcd55e26634bbaba8318c9 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 17:27:13 +0800 Subject: [PATCH 08/23] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E6=94=AF=E6=8C=81and=E3=80=81or=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/filter/QuotaFilterEditor.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/views/chart/components/filter/QuotaFilterEditor.vue b/frontend/src/views/chart/components/filter/QuotaFilterEditor.vue index 855b1ded0f..c3f81602d9 100644 --- a/frontend/src/views/chart/components/filter/QuotaFilterEditor.vue +++ b/frontend/src/views/chart/components/filter/QuotaFilterEditor.vue @@ -3,6 +3,7 @@
Date: Fri, 24 Dec 2021 17:29:08 +0800 Subject: [PATCH 09/23] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E6=96=87=E5=AD=97=E7=BB=84=E4=BB=B6=E7=BC=96=E8=BE=91=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=8F=AF=E8=83=BD=E4=BF=9D=E5=AD=98=E4=B8=8D=E4=B8=8A?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/Preview.vue | 3 +-- .../src/components/canvas/custom-component/VText.vue | 12 +++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 9a57c62d50..ea0b1fa68a 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -229,7 +229,6 @@ export default { }, methods: { _isMobile() { - console.log('navigator.userAgent:' + navigator.userAgent) const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) this.terminal = flag ? 'mobile' : 'pc' // this.terminal = 'mobile' @@ -311,7 +310,7 @@ export default { } }, handleMouseDown() { - this.$store.commit('setClickComponentStatus', fals) + this.$store.commit('setClickComponentStatus', false) }, initMobileCanvas() { this.$store.commit('openMobileLayout') diff --git a/frontend/src/components/canvas/custom-component/VText.vue b/frontend/src/components/canvas/custom-component/VText.vue index 596d88026b..b5847d6843 100644 --- a/frontend/src/components/canvas/custom-component/VText.vue +++ b/frontend/src/components/canvas/custom-component/VText.vue @@ -15,7 +15,16 @@ @input="handleInput" v-html="element.propValue" /> -
+
@@ -75,6 +84,7 @@ export default { }, methods: { handleInput(e) { + this.$store.state.styleChangeTimes++ this.$emit('input', this.element, e.target.innerHTML) this.$store.commit('recordStyleChange') }, From 58c9a2d8d548a0a67452c2d77c662b1b3b8e93bd Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 17:30:43 +0800 Subject: [PATCH 10/23] =?UTF-8?q?fix:=20=E4=B8=8B=E6=8B=89=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=80=89=E9=A1=B9=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/DataSetTableFieldController.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java index 60dec0698a..897dbe3354 100644 --- a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java +++ b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java @@ -7,12 +7,15 @@ import io.dataease.service.dataset.DataSetFieldService; import io.dataease.service.dataset.DataSetTableFieldsService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.TreeSet; import java.util.stream.Collectors; /** @@ -74,18 +77,27 @@ public class DataSetTableFieldController { @ApiOperation("值枚举") @PostMapping("fieldValues/{fieldId}") - public List fieldValues(@PathVariable String fieldId) throws Exception{ + public List fieldValues(@PathVariable String fieldId) throws Exception { return dataSetFieldService.fieldValues(fieldId); } @ApiOperation("多字段值枚举") @PostMapping("multFieldValues") - public List multFieldValues(@RequestBody List fieldIds) throws Exception{ + public List multFieldValues(@RequestBody List fieldIds) throws Exception { List results = new ArrayList<>(); for (String fieldId : fieldIds) { results.addAll(dataSetFieldService.fieldValues(fieldId)); } - results.stream().distinct().collect(Collectors.toList()); - return results; + ArrayList list = results.stream().collect( + Collectors.collectingAndThen( + Collectors.toCollection( + () -> new TreeSet<>(Comparator.comparing(t -> { + if (ObjectUtils.isEmpty(t)) return ""; + return t.toString(); + })) + ), ArrayList::new + ) + ); + return list; } } From 7fac43d63b88378e3b531ba72c156c15634cae77 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 24 Dec 2021 17:52:53 +0800 Subject: [PATCH 11/23] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96PC=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=B8=83=E5=B1=80=E5=88=87=E6=8D=A2=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Toolbar.vue | 1 + frontend/src/store/index.js | 1 + frontend/src/views/panel/list/PanelList.vue | 2 ++ frontend/src/views/panel/list/PanelViewShow.vue | 3 --- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 1bbdc16046..841b0350e5 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -376,6 +376,7 @@ export default { mobileDataObj[item.id] = item }) const sourceComponentData = JSON.parse(this.componentDataCache) + this.$store.commit('setComponentDataCache', null) sourceComponentData.forEach(item => { if (mobileDataObj[item.id]) { mobile2MainCanvas(item, mobileDataObj[item.id]) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 8d71afdb3f..2c97d20e39 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -348,6 +348,7 @@ const data = { }, // 启用移动端布局 openMobileLayout(state) { + state.componentDataCache = null state.componentDataCache = JSON.stringify(state.componentData) state.pcComponentData = state.componentData const mainComponentData = [] diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 016da5f01f..1af58c1307 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -645,6 +645,8 @@ export default { this.lastActiveNodeData = data this.activeTree = data.panelType if (data.nodeType === 'panel') { + // 清理pc布局缓存 + this.$store.commit('setComponentDataCache', null) // 加载视图数据 findOne(data.id).then(response => { const componentDatas = JSON.parse(response.data.panelData) diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 9f9672ee49..54d0643dd8 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -130,13 +130,11 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine' import bus from '@/utils/bus' import { queryAll } from '@/api/panel/pdfTemplate' import ShareHead from '@/views/panel/GrantAuth/ShareHead' -import JsPDF from 'jspdf' export default { name: 'PanelViewShow', components: { Preview, SaveToTemplate, PDFPreExport, ShareHead }, props: { - // eslint-disable-next-line vue/require-default-prop activeTab: { type: String, required: false @@ -208,7 +206,6 @@ export default { bus.$on('set-panel-show-type', type => { this.showType = type || 0 }) - this.initPdfTemplate() }, methods: { From 787ef75b06f214b19d057576ff1690220c59c5a4 Mon Sep 17 00:00:00 2001 From: fit2cloudrd Date: Fri, 24 Dec 2021 17:54:28 +0800 Subject: [PATCH 12/23] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96PC=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=B8=83=E5=B1=80=E5=88=87=E6=8D=A2=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=87=BA=E7=8E=B0=E9=94=99=E8=AF=AF=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wangjiahao <1522128093@qq.com> --- frontend/src/components/canvas/components/Toolbar.vue | 1 + frontend/src/store/index.js | 1 + frontend/src/views/panel/list/PanelList.vue | 2 ++ frontend/src/views/panel/list/PanelViewShow.vue | 3 --- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 1bbdc16046..841b0350e5 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -376,6 +376,7 @@ export default { mobileDataObj[item.id] = item }) const sourceComponentData = JSON.parse(this.componentDataCache) + this.$store.commit('setComponentDataCache', null) sourceComponentData.forEach(item => { if (mobileDataObj[item.id]) { mobile2MainCanvas(item, mobileDataObj[item.id]) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 8d71afdb3f..2c97d20e39 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -348,6 +348,7 @@ const data = { }, // 启用移动端布局 openMobileLayout(state) { + state.componentDataCache = null state.componentDataCache = JSON.stringify(state.componentData) state.pcComponentData = state.componentData const mainComponentData = [] diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 016da5f01f..1af58c1307 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -645,6 +645,8 @@ export default { this.lastActiveNodeData = data this.activeTree = data.panelType if (data.nodeType === 'panel') { + // 清理pc布局缓存 + this.$store.commit('setComponentDataCache', null) // 加载视图数据 findOne(data.id).then(response => { const componentDatas = JSON.parse(response.data.panelData) diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 9f9672ee49..54d0643dd8 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -130,13 +130,11 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine' import bus from '@/utils/bus' import { queryAll } from '@/api/panel/pdfTemplate' import ShareHead from '@/views/panel/GrantAuth/ShareHead' -import JsPDF from 'jspdf' export default { name: 'PanelViewShow', components: { Preview, SaveToTemplate, PDFPreExport, ShareHead }, props: { - // eslint-disable-next-line vue/require-default-prop activeTab: { type: String, required: false @@ -208,7 +206,6 @@ export default { bus.$on('set-panel-show-type', type => { this.showType = type || 0 }) - this.initPdfTemplate() }, methods: { From f6a82359a760b2ee921ccf99d4713ec2d883f09b Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 18:35:53 +0800 Subject: [PATCH 13/23] feat: doris field type --- .../provider/query/doris/DorisQueryProvider.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java index 4c25c8868b..c49c4eb381 100644 --- a/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java @@ -805,11 +805,13 @@ public class DorisQueryProvider extends QueryProvider { } else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) { whereValue = "'%" + value + "%'"; } else { - if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { + // Doris field type test + /*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value); } else { whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value); - } + }*/ + whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value); } list.add(SQLObj.builder() .whereField(whereName) @@ -881,11 +883,13 @@ public class DorisQueryProvider extends QueryProvider { whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1)); } } else { - if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { + // doris field type test + /*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value.get(0)); } else { whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0)); - } + }*/ + whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0)); } list.add(SQLObj.builder() .whereField(whereName) From 26047142eaea394ed62b8dc40eca7c133b4c317e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 18:43:29 +0800 Subject: [PATCH 14/23] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/PreviewEject.vue | 5 +- .../components/canvas/components/Toolbar.vue | 7 +- .../canvas/mobile/PreviewMobile.vue | 93 ------------------- frontend/src/components/canvas/utils/utils.js | 3 +- 4 files changed, 12 insertions(+), 96 deletions(-) delete mode 100644 frontend/src/components/canvas/mobile/PreviewMobile.vue diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index 493c6efbe0..c742272618 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -9,6 +9,7 @@ import { uuid } from 'vue-uuid' import { findOne } from '@/api/panel/panel' import { getPanelAllLinkageInfo } from '@/api/panel/linkage' import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump' +import { panelInit } from '@/components/canvas/utils/utils' export default { components: { Preview }, @@ -43,8 +44,10 @@ export default { } // 加载视图数据 findOne(this.panelId).then(response => { + const componentDatas = JSON.parse(response.data.panelData) + panelInit(componentDatas) this.dataLoading = false - this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) + this.$store.commit('setComponentData', this.resetID(componentDatas)) this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle)) const data = { id: response.data.id, diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 1bbdc16046..28e4fb0cd7 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -75,7 +75,6 @@ import { deepCopy, mobile2MainCanvas } from '@/components/canvas/utils/utils' import { panelSave } from '@/api/panel/panel' import { saveLinkage, getPanelAllLinkageInfo } from '@/api/panel/linkage' import bus from '@/utils/bus' - import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' @@ -266,6 +265,12 @@ export default { panelStyle: JSON.stringify(this.canvasStyleData), panelData: JSON.stringify(this.componentData) } + const components = deepCopy(this.componentData) + components.forEach(view => { + if (view.filters && view.filters.length > 0) { view.filters = [] } + }) + // 无需保存条件 + requestInfo.panelData = JSON.stringify(components) panelSave(requestInfo).then(response => { this.$store.commit('refreshSaveStatus') this.$message({ diff --git a/frontend/src/components/canvas/mobile/PreviewMobile.vue b/frontend/src/components/canvas/mobile/PreviewMobile.vue deleted file mode 100644 index 04805e2d47..0000000000 --- a/frontend/src/components/canvas/mobile/PreviewMobile.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index 6b39797de7..b93f77ba55 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -60,7 +60,8 @@ export function mobile2MainCanvas(mainSource, mobileSource) { export function panelInit(componentDatas) { componentDatas.forEach(item => { - item.filters = (item.filters || []) + /* item.filters = (item.filters || []) */ + item.filters = [] item.linkageFilters = (item.linkageFilters || []) item.auxiliaryMatrix = (item.auxiliaryMatrix || false) item.x = (item.x || 1) From 30564208cec8d825968e02a045ca4e6d1423ed9d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 19:04:05 +0800 Subject: [PATCH 15/23] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E8=80=81?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/utils/utils.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index b93f77ba55..5b5ddc7643 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -60,8 +60,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) { export function panelInit(componentDatas) { componentDatas.forEach(item => { - /* item.filters = (item.filters || []) */ - item.filters = [] + if (item.component && item.component === 'de-date') { + if (item.options.attrs && !item.options.attrs.default) { + item.options.attrs.default = { + isDynamic: false, + dkey: 0, + dynamicPrefix: 1, + dynamicInfill: 'day', + dynamicSuffix: 'before' + } + } + } + if (item.filters && item.filters.length > 0) { + item.filters = [] + } item.linkageFilters = (item.linkageFilters || []) item.auxiliaryMatrix = (item.auxiliaryMatrix || false) item.x = (item.x || 1) From 73ceca747744998286a8131f12aa45f229dbf5a0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 25 Dec 2021 14:42:07 +0800 Subject: [PATCH 16/23] =?UTF-8?q?feat:=20=E5=9C=B0=E5=9B=BE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BC=A9=E6=94=BE=E9=87=8D=E7=BD=AE=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/ChartComponent.vue | 151 ++++++++++++++---- 1 file changed, 116 insertions(+), 35 deletions(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 995784ef4e..c489fd602c 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -1,7 +1,27 @@ @@ -19,24 +39,55 @@ import { BASE_TREEMAP, BASE_MIX } from '../chart/chart' -import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar' -import { baseLineOption, stackLineOption } from '../chart/line/line' -import { basePieOption, rosePieOption } from '../chart/pie/pie' -import { baseMapOption } from '../chart/map/map' -import { baseFunnelOption } from '../chart/funnel/funnel' -import { baseRadarOption } from '../chart/radar/radar' -import { baseGaugeOption } from '../chart/gauge/gauge' -import { baseScatterOption } from '../chart/scatter/scatter' -import { baseTreemapOption } from '../chart/treemap/treemap' -import { baseMixOption } from '@/views/chart/chart/mix/mix' -// import eventBus from '@/components/canvas/utils/eventBus' -import { uuid } from 'vue-uuid' -import { geoJson } from '@/api/map/map' +import { + baseBarOption, + stackBarOption, + horizontalBarOption, + horizontalStackBarOption +} from '../chart/bar/bar' +import { + baseLineOption, + stackLineOption +} from '../chart/line/line' +import { + basePieOption, + rosePieOption +} from '../chart/pie/pie' +import { + baseMapOption +} from '../chart/map/map' +import { + baseFunnelOption +} from '../chart/funnel/funnel' +import { + baseRadarOption +} from '../chart/radar/radar' +import { + baseGaugeOption +} from '../chart/gauge/gauge' +import { + baseScatterOption +} from '../chart/scatter/scatter' +import { + baseTreemapOption +} from '../chart/treemap/treemap' +import { + baseMixOption +} from '@/views/chart/chart/mix/mix' + // import eventBus from '@/components/canvas/utils/eventBus' +import { + uuid +} from 'vue-uuid' +import { + geoJson +} from '@/api/map/map' import ViewTrackBar from '@/components/canvas/components/Editor/ViewTrackBar' export default { name: 'ChartComponent', - components: { ViewTrackBar }, + components: { + ViewTrackBar + }, props: { chart: { type: Object, @@ -110,7 +161,9 @@ export default { // 基于准备好的dom,初始化echarts实例 // 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表板有重复id情况 const that = this - new Promise((resolve) => { resolve() }).then(() => { + new Promise((resolve) => { + resolve() + }).then(() => { // 此dom为echarts图标展示dom this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) if (!this.myChart) { @@ -193,25 +246,25 @@ export default { }, registerDynamicMap(areaCode) { this.dynamicAreaCode = areaCode - // if (this.$store.getters.geoMap[areaCode]) { - // const json = this.$store.getters.geoMap[areaCode] - // this.myChart.dispose() - // this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) - // this.$echarts.registerMap('MAP', json) - // return - // } - // geoJson(areaCode).then(res => { - // this.$store.dispatch('map/setGeo', { - // key: areaCode, - // value: res - // }).then(() => { - // this.myChart.dispose() - // this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) - // this.$echarts.registerMap('MAP', res) - // }) - // }).catch(() => { - // this.downOrUp = true - // }) + // if (this.$store.getters.geoMap[areaCode]) { + // const json = this.$store.getters.geoMap[areaCode] + // this.myChart.dispose() + // this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) + // this.$echarts.registerMap('MAP', json) + // return + // } + // geoJson(areaCode).then(res => { + // this.$store.dispatch('map/setGeo', { + // key: areaCode, + // value: res + // }).then(() => { + // this.myChart.dispose() + // this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) + // this.$echarts.registerMap('MAP', res) + // }) + // }).catch(() => { + // this.downOrUp = true + // }) }, initMapChart(geoJson, chart) { @@ -284,11 +337,39 @@ export default { default: break } + }, + roamMap(flag) { + let targetZoom = 1 + const zoom = this.myChart.getOption().series[0].zoom + if (flag) { + targetZoom = zoom * 1.2 + } else { + targetZoom = zoom / 1.2 + } + const options = JSON.parse(JSON.stringify(this.myChart.getOption())) + options.series[0].zoom = targetZoom + this.myChart.setOption(options) + }, + resetZoom() { + const options = JSON.parse(JSON.stringify(this.myChart.getOption())) + options.series[0].zoom = 1 + this.myChart.setOption(options) } } } + From 8409f1dd65eab489cab638d3df32b19e1d696288 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 25 Dec 2021 14:54:46 +0800 Subject: [PATCH 17/23] =?UTF-8?q?style:=20=E8=A7=A3=E5=86=B3=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E4=B8=AD=E7=BC=A9=E6=94=BE=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=81=AE=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/ChartComponent.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index c489fd602c..905b80a0e3 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -9,11 +9,11 @@ />
-
+
-
+
@@ -364,8 +364,8 @@ export default { .map-zoom-box { position: absolute; z-index: 999; - right: 2%; - top: 5%; + left: 2%; + bottom: 3%; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); text-align: center; padding: 5px; From 55d8022b5bcc1dbb741e319b21a198bc284bd2c8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 27 Dec 2021 11:12:21 +0800 Subject: [PATCH 18/23] =?UTF-8?q?fix:=20=E7=A9=BA=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=AF=95=E5=9B=BE=E5=88=87=E6=8D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/ChartComponent.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 905b80a0e3..ec06a1d7d5 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -224,7 +224,10 @@ export default { if (chart.type === 'map') { const customAttr = JSON.parse(chart.customAttr) - if (!customAttr.areaCode) return + if (!customAttr.areaCode) { + this.myChart.clear() + return + } const cCode = this.dynamicAreaCode || customAttr.areaCode if (this.$store.getters.geoMap[cCode]) { const json = this.$store.getters.geoMap[cCode] From 9485610a771ab1663b93fc8e6ee45b81787547c4 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 27 Dec 2021 11:16:11 +0800 Subject: [PATCH 19/23] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E7=BB=84=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=9C=AA=E9=9D=A0=E5=B7=A6=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeSelectGrid.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index bad50f9d35..f7f4d4dd89 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -220,6 +220,7 @@ export default { position: absolute; top: 30px; bottom: 0; + text-align: left; } } From 0c8454323a461651c8f2c77bb9b034e4b09517a6 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 27 Dec 2021 12:06:42 +0800 Subject: [PATCH 20/23] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E7=BB=84=E4=BB=B6=E7=AD=89=E5=BE=85=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E9=9D=A0=E5=B7=A6=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/MobileCheckBar.vue | 1 + .../src/components/canvas/custom-component/UserView.vue | 2 +- frontend/src/components/widget/DeWidget/DeTabs.vue | 8 ++++++-- frontend/src/views/panel/edit/ComponentWait.vue | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue b/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue index 623f315283..cb511a2cbf 100644 --- a/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue +++ b/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue @@ -75,6 +75,7 @@ export default { padding-left: 1px; padding-right: 1px; cursor:pointer!important; + text-align: center; background-color: #0a7be0; } .bar-main i{ diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index d9b2216b9b..a0b1ad9fe7 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -156,7 +156,7 @@ export default { } }, editBarViewShowFlag() { - return this.active && this.inTab + return this.active && this.inTab && !this.mobileLayoutStatus }, charViewShowFlag() { return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.renderComponent() === 'echarts' diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index 65a84e3e67..98f1f3521e 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -10,7 +10,7 @@ {{ item.title }} - + @@ -135,8 +135,12 @@ export default { } }, computed: { + dropdownShow() { + return this.isEdit && !this.mobileLayoutStatus + }, ...mapState([ - 'curComponent' + 'curComponent', + 'mobileLayoutStatus' ]) }, watch: { diff --git a/frontend/src/views/panel/edit/ComponentWait.vue b/frontend/src/views/panel/edit/ComponentWait.vue index bff2b46bb7..9dd2301140 100644 --- a/frontend/src/views/panel/edit/ComponentWait.vue +++ b/frontend/src/views/panel/edit/ComponentWait.vue @@ -81,6 +81,7 @@ export default { .component-wait-main { width: 100%; height: calc(100% - 30px); + text-align: left; overflow-y: auto; } .component-custom { From 4f8ea205d3594be8ffd68288c1510fbb5ac2d161 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 27 Dec 2021 14:21:00 +0800 Subject: [PATCH 21/23] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E7=AD=89=E5=BE=85=E5=8C=BA=E5=9F=9F=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=9C=B0=E5=9B=BE=EF=BC=8C=E6=97=B6=E9=97=B4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=8E=92=E5=88=97=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/custom-component/VText.vue | 11 +++++++++-- .../src/views/chart/components/ChartComponent.vue | 4 ++-- frontend/src/views/panel/edit/ComponentWaitItem.vue | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/VText.vue b/frontend/src/components/canvas/custom-component/VText.vue index b5847d6843..1d3d903f5d 100644 --- a/frontend/src/components/canvas/custom-component/VText.vue +++ b/frontend/src/components/canvas/custom-component/VText.vue @@ -1,5 +1,5 @@