提交 71ae9292 authored 作者: wangjiahao's avatar wangjiahao

Merge remote-tracking branch 'origin/dev' into dev

......@@ -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");
}
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");
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.MONTH, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
return lastTime;
} catch (Exception e) {
return cTime;
}
return lastTime;
}
private boolean checkDrillExist(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> extStack, ChartViewFieldDTO dto, ChartViewWithBLOBs view) {
......
......@@ -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<Long> 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;
}
......
......@@ -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;
}
......
......@@ -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()
}
}
}
......
......@@ -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
}
......
......@@ -3,6 +3,7 @@
<div style="display: inline-block;">
<el-button icon="el-icon-plus" circle size="mini" style="margin-bottom: 10px;" @click="addFilter" />
<el-radio-group
v-show="item.filter && item.filter.length > 1"
v-model="logic"
size="mini"
style="margin-left: 10px;"
......
......@@ -22,7 +22,7 @@
</span>
</el-row>
<el-row class="view-panel">
<el-tabs type="card" :stretch="true" class="tab-header">
<el-tabs :stretch="true" class="tab-header">
<el-tab-pane :label="$t('chart.chart_data')" class="padding-tab" style="width: 360px">
<el-row class="view-panel">
<el-col class="theme-border-class" style="width: 180px;border-right: 1px solid #E6E6E6;">
......@@ -116,6 +116,7 @@
<el-col
style="height: 100%;width: 180px;border-right: 1px solid #E6E6E6;"
class="theme-border-class"
>
<div style="height: 60px;overflow:auto" class="padding-lr theme-border-class">
<span class="theme-border-class">
......@@ -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);
}
......
......@@ -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;
......
......@@ -37,35 +37,31 @@
</div>
<!-- 视图图表 end -->
<!-- 过滤组件 start -->
<div tabindex="-1" style="position: relative; margin: 16px auto">
<div style="height: 60px; position: relative">
<div class="button-div-class" style=" text-align: center;line-height: 1;position: absolute;inset: 0px 0px 45px; ">
<el-button circle :class="show&&showIndex===1? 'button-show':'button-closed'" class="el-icon-s-tools" size="mini" @click="showPanel(1)" />
</div>
<div class="button-text" style=" position: absolute;left: 0px;right: 0px;bottom: 10px; height: 16px;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
{{ $t('panel.module') }}
</div>
</div>
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; ">
<el-button circle :class="show&&showIndex===1? 'button-show':'button-closed'" class="el-icon-s-tools" size="mini" @click="showPanel(1)" />
</div>
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
{{ $t('panel.module') }}
</div>
</div>
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div>
<!-- 过滤组件 end -->
<!-- 其他组件 start -->
<div tabindex="-1" style="position: relative; margin: 16px auto">
<div style="height: 60px; position: relative">
<div class="button-div-class" style=" text-align: center;line-height: 1;position: absolute;inset: 0px 0px 45px; ">
<el-button circle :class="show&&showIndex===3? 'button-show':'button-closed'" class="el-icon-brush" size="mini" @click="showPanel(3)" />
</div>
<div class="button-text" style=" position: absolute;left: 0px;right: 0px;bottom: 10px; height: 16px;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
{{ $t('panel.other_module') }}
</div>
</div>
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; ">
<el-button circle :class="show&&showIndex===3? 'button-show':'button-closed'" class="el-icon-brush" size="mini" @click="showPanel(3)" />
</div>
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
{{ $t('panel.other_module') }}
</div>
</div>
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div>
......
......@@ -98,6 +98,10 @@ export default {
},
dynamicPrefixChange(value) {
if (value < 1) {
value = 1
this.element.options.attrs.default.dynamicPrefix = 1
}
this.setDval()
},
dynamicInfillChange(value) {
......
......@@ -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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论