From ba09b4ebe14c197e9cce05cd0f1fd0f3c94cac9a Mon Sep 17 00:00:00 2001 From: junjie Date: Thu, 23 Dec 2021 18:50:58 +0800 Subject: [PATCH 01/10] =?UTF-8?q?feat:=20=E8=A7=86=E5=9B=BEtab=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/view/ChartEdit.vue | 24 +++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 14b77ff68e..f7eb46fcbb 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -22,7 +22,7 @@ - + @@ -116,6 +116,7 @@
@@ -2158,12 +2159,10 @@ export default { } .blackTheme .item-quota { - border: solid 1px; border-color: var(--TableBorderColor); color: var(--TextPrimary); background-color: var(--MainBG); - } .item-quota + .item-quota { @@ -2189,25 +2188,20 @@ export default { font-size: 12px; } + .tab-header > > > .el-tabs__header { + border-top: solid 1px #eee; + border-right: solid 1px #eee; + } + .tab-header > > > .el-tabs__item { font-size: 12px; - background-color: #E8EAED; + padding: 0 60px!important; } .blackTheme .tab-header > > > .el-tabs__item { background-color: var(--MainBG); } - .tab-header > > > .is-active { - background-color: #f7f8fa; - border-bottom-color: #f7f8fa !important; - } - - .blackTheme .tab-header > > > .is-active { - background-color: var(--ContentBG); - border-bottom-color: var(--ContentBG) !important; - } - .tab-header > > > .el-tabs__nav-scroll { padding-left: 0 !important; } @@ -2244,7 +2238,6 @@ export default { } .blackTheme .attr-style { - border-color: var(--TableBorderColor) !important; color: var(--TextPrimary); } @@ -2370,7 +2363,6 @@ export default { } .blackTheme .theme-border-class { - border-color: var(--TableBorderColor) !important; color: var(--TextPrimary) !important; background-color: var(--ContentBG); } From 1ff6f1352578663d66b6b0b3b0dfafa6e25d5713 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 24 Dec 2021 12:13:33 +0800 Subject: [PATCH 02/10] =?UTF-8?q?fxi:=20=E5=85=AC=E5=85=B1=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E8=A1=8C=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index 6b4b6b36c7..1837e62f56 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import io.dataease.auth.api.dto.CurrentRoleDto; import io.dataease.auth.api.dto.CurrentUserDto; +import io.dataease.auth.service.AuthUserService; import io.dataease.base.domain.*; import io.dataease.base.mapper.*; import io.dataease.base.mapper.ext.ExtDataSetGroupMapper; @@ -103,6 +104,8 @@ public class DataSetTableService { private ExtDataSetGroupMapper extDataSetGroupMapper; @Resource private DatasetTableFieldMapper datasetTableFieldMapper; + @Resource + private AuthUserService authUserService; private static final String lastUpdateTime = "${__last_update_time__}"; private static final String currentUpdateTime = "${__current_update_time__}"; @@ -450,10 +453,19 @@ public class DataSetTableService { } RowPermissionService rowPermissionService = SpringContextUtil.getBean(RowPermissionService.class); CurrentUserDto user = AuthUtils.getUser(); - userId = user != null? user.getUserId() : userId; - datasetRowPermissions.addAll(rowPermissionService.listDatasetRowPermissions(datasetId, Collections.singletonList(user.getUserId()), "user")); - datasetRowPermissions.addAll(rowPermissionService.listDatasetRowPermissions(datasetId, user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList()), "role")); - datasetRowPermissions.addAll(rowPermissionService.listDatasetRowPermissions(datasetId, Collections.singletonList(user.getDeptId()), "dept")); + userId = user != null ? user.getUserId() : userId; + List roleIds ; + Long deptId ; + if(user != null){ + deptId = user.getDeptId(); + roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList()); + }else { + deptId = authUserService.getUserById(userId).getDeptId(); + roleIds = authUserService.roles(userId).stream().map(r -> Long.valueOf(r)).collect(Collectors.toList()); + } + datasetRowPermissions.addAll(rowPermissionService.listDatasetRowPermissions(datasetId, Collections.singletonList(userId), "user")); + datasetRowPermissions.addAll(rowPermissionService.listDatasetRowPermissions(datasetId, roleIds, "role")); + datasetRowPermissions.addAll(rowPermissionService.listDatasetRowPermissions(datasetId, Collections.singletonList(deptId), "dept")); return datasetRowPermissions; } From 4527e02448d3b59eb9733c2c85255f825688295a Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 13:27:59 +0800 Subject: [PATCH 03/10] =?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 04/10] =?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 05/10] =?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 06/10] =?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 07/10] =?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 08/10] =?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 09/10] =?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 10/10] =?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 @@