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..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,51 +599,81 @@ public class ChartViewService { return false; } - 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"); + 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()); } - 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) { 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; } 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; } 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/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index 51a7da97ef..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.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.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 } 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 @@
- + @@ -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); } 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 a8b2f605ab..e0e79c5635 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') }}
+
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) { 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;