Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2023-02-09 18:00:42 +08:00
commit a4c6c99460
9 changed files with 126 additions and 54 deletions

View File

@ -71,9 +71,11 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
} }
// 当没有出现登录超时 且需要刷新token 则执行刷新token // 当没有出现登录超时 且需要刷新token 则执行刷新token
if (JWTUtils.loginExpire(authorization)) { if (JWTUtils.loginExpire(authorization)) {
TokenCacheUtils.remove(authorization);
throw new AuthenticationException(expireMessage); throw new AuthenticationException(expireMessage);
} }
if (JWTUtils.needRefresh(authorization)) { if (JWTUtils.needRefresh(authorization)) {
TokenCacheUtils.remove(authorization);
authorization = refreshToken(request, response); authorization = refreshToken(request, response);
} }
JWTToken token = new JWTToken(authorization); JWTToken token = new JWTToken(authorization);

View File

@ -5,6 +5,7 @@ import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.List; import java.util.List;
/** /**
@ -48,4 +49,6 @@ public class ChartExtRequest {
private Long pageSize; private Long pageSize;
private Boolean excelExportFlag = false;
} }

View File

@ -1,5 +1,6 @@
package io.dataease.controller.request.panel; package io.dataease.controller.request.panel;
import io.dataease.controller.request.chart.ChartExtRequest;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
@ -30,4 +31,8 @@ public class PanelViewDetailsRequest {
private ViewDetailField[] detailFields; private ViewDetailField[] detailFields;
private ChartExtRequest componentFilterInfo;
private List<String> excelHeaderKeys;
} }

View File

@ -526,7 +526,8 @@ public class ChartViewService {
} }
} }
List<ChartViewFieldDTO> xAxisForRequest = new ArrayList<>(); List<ChartViewFieldDTO> xAxisForRequest = new ArrayList<>();
xAxisForRequest.addAll(xAxis); xAxisForRequest.addAll(extStack); xAxisForRequest.addAll(xAxis);
xAxisForRequest.addAll(extStack);
datasourceRequest.setXAxis(xAxisForRequest); datasourceRequest.setXAxis(xAxisForRequest);
data = datasourceProvider.getData(datasourceRequest); data = datasourceProvider.getData(datasourceRequest);
} else if (table.getMode() == 1) {// 抽取 } else if (table.getMode() == 1) {// 抽取
@ -655,7 +656,7 @@ public class ChartViewService {
Map<String, Object> mapAttr = gson.fromJson(view.getCustomAttr(), Map.class); Map<String, Object> mapAttr = gson.fromJson(view.getCustomAttr(), Map.class);
Map<String, Object> mapSize = (Map<String, Object>) mapAttr.get("size"); Map<String, Object> mapSize = (Map<String, Object>) mapAttr.get("size");
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) { if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
if (StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) { if (StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page") && !chartExtRequest.getExcelExportFlag()) {
if (chartExtRequest.getGoPage() == null) { if (chartExtRequest.getGoPage() == null) {
chartExtRequest.setGoPage(1L); chartExtRequest.setGoPage(1L);
} }
@ -1043,7 +1044,8 @@ public class ChartViewService {
datasourceRequest.setQuery(querySql); datasourceRequest.setQuery(querySql);
List<ChartViewFieldDTO> xAxisForRequest = new ArrayList<>(); List<ChartViewFieldDTO> xAxisForRequest = new ArrayList<>();
xAxisForRequest.addAll(xAxis); xAxisForRequest.addAll(extStack); xAxisForRequest.addAll(xAxis);
xAxisForRequest.addAll(extStack);
datasourceRequest.setXAxis(xAxisForRequest); datasourceRequest.setXAxis(xAxisForRequest);
data = datasourceProvider.getData(datasourceRequest); data = datasourceProvider.getData(datasourceRequest);
if (CollectionUtils.isNotEmpty(assistFields)) { if (CollectionUtils.isNotEmpty(assistFields)) {

View File

@ -10,6 +10,7 @@ import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.commons.constants.*; import io.dataease.commons.constants.*;
import io.dataease.commons.utils.*; import io.dataease.commons.utils.*;
import io.dataease.controller.request.authModel.VAuthModelRequest; import io.dataease.controller.request.authModel.VAuthModelRequest;
import io.dataease.controller.request.chart.ChartExtRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.controller.request.panel.*; import io.dataease.controller.request.panel.*;
import io.dataease.dto.DatasourceDTO; import io.dataease.dto.DatasourceDTO;
@ -652,6 +653,7 @@ public class PanelGroupService {
public void exportPanelViewDetails(PanelViewDetailsRequest request, HttpServletResponse response) throws IOException { public void exportPanelViewDetails(PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
try { try {
findExcelData(request);
String snapshot = request.getSnapshot(); String snapshot = request.getSnapshot();
List<Object[]> details = request.getDetails(); List<Object[]> details = request.getDetails();
Integer[] excelTypes = request.getExcelTypes(); Integer[] excelTypes = request.getExcelTypes();
@ -1089,6 +1091,32 @@ public class PanelGroupService {
request.setUpdateTime(time); request.setUpdateTime(time);
request.setUpdateBy(AuthUtils.getUser().getUsername()); request.setUpdateBy(AuthUtils.getUser().getUsername());
panelGroupMapper.updateByPrimaryKeySelective(request); panelGroupMapper.updateByPrimaryKeySelective(request);
}
public void findExcelData(PanelViewDetailsRequest request) {
ChartViewWithBLOBs viewInfo = chartViewService.get(request.getViewId());
if ("table-info".equals(viewInfo.getType())) {
try {
List<String> excelHeaderKeys = request.getExcelHeaderKeys();
ChartExtRequest componentFilterInfo = request.getComponentFilterInfo();
componentFilterInfo.setGoPage(1l);
componentFilterInfo.setPageSize(1000000l);
componentFilterInfo.setExcelExportFlag(true);
ChartViewDTO chartViewInfo = chartViewService.getData(request.getViewId(), componentFilterInfo);
List<Map> tableRow = (List) chartViewInfo.getData().get("tableRow");
List<Object[]> result = new ArrayList<>();
for (Map detailMap : tableRow) {
List<Object> detailObj = new ArrayList<>();
for (String key : excelHeaderKeys) {
detailObj.add(detailMap.get(key));
}
result.add(detailObj.toArray());
}
request.setDetails(result);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} }
} }

View File

@ -770,6 +770,9 @@ export default {
if (response.success) { if (response.success) {
this.chart = response.data this.chart = response.data
this.view = response.data this.view = response.data
if (this.chart.type.includes('table')) {
this.$store.commit('setLastViewRequestInfo', { viewId: id, requestInfo: requestInfo })
}
this.buildInnerRefreshTimer(this.chart.refreshViewEnable, this.chart.refreshUnit, this.chart.refreshTime) this.buildInnerRefreshTimer(this.chart.refreshViewEnable, this.chart.refreshUnit, this.chart.refreshTime)
this.$emit('fill-chart-2-parent', this.chart) this.$emit('fill-chart-2-parent', this.chart)
this.getDataOnly(response.data, dataBroadcast) this.getDataOnly(response.data, dataBroadcast)
@ -912,6 +915,7 @@ export default {
tableChart.customAttr.color.tableHeaderFontColor = '#7c7e81' tableChart.customAttr.color.tableHeaderFontColor = '#7c7e81'
tableChart.customAttr.color.tableFontColor = '#7c7e81' tableChart.customAttr.color.tableFontColor = '#7c7e81'
tableChart.customAttr.color.tableStripe = true tableChart.customAttr.color.tableStripe = true
tableChart.customAttr.size.tablePageMode = 'pull'
tableChart.customStyle.text.show = false tableChart.customStyle.text.show = false
tableChart.customAttr = JSON.stringify(tableChart.customAttr) tableChart.customAttr = JSON.stringify(tableChart.customAttr)
tableChart.customStyle = JSON.stringify(tableChart.customStyle) tableChart.customStyle = JSON.stringify(tableChart.customStyle)

View File

@ -87,9 +87,20 @@ import html2canvas from 'html2canvasde'
import { hexColorToRGBA } from '@/views/chart/chart/util' import { hexColorToRGBA } from '@/views/chart/chart/util'
import { deepCopy, exportImg, imgUrlTrans } from '@/components/canvas/utils/utils' import { deepCopy, exportImg, imgUrlTrans } from '@/components/canvas/utils/utils'
import { getLinkToken, getToken } from '@/utils/auth' import { getLinkToken, getToken } from '@/utils/auth'
export default { export default {
name: 'UserViewDialog', name: 'UserViewDialog',
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, ChartComponent, TableNormal, LabelNormal, PluginCom }, components: {
LabelNormalText,
ChartComponentS2,
ChartComponentG2,
DeMainContainer,
DeContainer,
ChartComponent,
TableNormal,
LabelNormal,
PluginCom
},
props: { props: {
chart: { chart: {
type: Object, type: Object,
@ -123,8 +134,7 @@ export default {
return this.chart.type === 'table-normal' || this.chart.type === 'table-info' return this.chart.type === 'table-normal' || this.chart.type === 'table-info'
}, },
customStyle() { customStyle() {
let style = { let style = {}
}
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
@ -186,7 +196,8 @@ export default {
'isClickComponent', 'isClickComponent',
'curComponent', 'curComponent',
'componentData', 'componentData',
'canvasStyleData' 'canvasStyleData',
'lastViewRequestInfo'
]), ]),
mapChart() { mapChart() {
if (this.chart.type && (this.chart.type === 'map' || this.chart.type === 'buddle-map')) { if (this.chart.type && (this.chart.type === 'map' || this.chart.type === 'buddle-map')) {
@ -211,7 +222,7 @@ export default {
} }
}) })
} }
const result = { ...temp, ...{ DetailAreaCode: DetailAreaCode }} const result = { ...temp, ...{ DetailAreaCode: DetailAreaCode } }
this.setLastMapChart(result) this.setLastMapChart(result)
return result return result
} }
@ -285,6 +296,8 @@ export default {
snapshot: snapshot, snapshot: snapshot,
snapshotWidth: width, snapshotWidth: width,
snapshotHeight: height, snapshotHeight: height,
componentFilterInfo: this.lastViewRequestInfo[this.chart.id],
excelHeaderKeys: excelHeaderKeys,
detailFields detailFields
} }
let method = innerExportDetails let method = innerExportDetails
@ -313,43 +326,49 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ms-aside-container { .ms-aside-container {
height: 70vh; height: 70vh;
min-width: 400px; min-width: 400px;
max-width: 400px; max-width: 400px;
padding: 0 0; padding: 0 0;
} }
.ms-main-container {
height: 70vh;
border: 1px solid #E6E6E6;
}
.chart-class{
height: 100%;
}
.table-class{
height: 100%;
}
.canvas-class{
position: relative;
width: 100%;
height: 100%;
background-size: 100% 100% !important;
}
.abs-container {
position: absolute;
width: 100%;
margin-left: -20px;
.ms-main-container {
padding: 0px !important;
}
}
.svg-background { .ms-main-container {
position: absolute; height: 70vh;
top: 0; border: 1px solid #E6E6E6;
left: 0; }
width: 100%;
height: 100%; .chart-class {
height: 100%;
}
.table-class {
height: 100%;
}
.canvas-class {
position: relative;
width: 100%;
height: 100%;
background-size: 100% 100% !important;
}
.abs-container {
position: absolute;
width: 100%;
margin-left: -20px;
.ms-main-container {
padding: 0px !important;
} }
}
.svg-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style> </style>

View File

@ -152,7 +152,8 @@ const data = {
}, },
previewVisible: false, previewVisible: false,
previewComponentData: [], previewComponentData: [],
currentCanvasNewId: [] currentCanvasNewId: [],
lastViewRequestInfo: {}
}, },
mutations: { mutations: {
...animation.mutations, ...animation.mutations,
@ -610,6 +611,9 @@ const data = {
resetViewEditInfo(state) { resetViewEditInfo(state) {
state.panelViewEditInfo = {} state.panelViewEditInfo = {}
}, },
setLastViewRequestInfo(state, viewRequestInfo) {
state.lastViewRequestInfo[viewRequestInfo.viewId] = viewRequestInfo.requestInfo
},
removeCurBatchComponentWithId(state, id) { removeCurBatchComponentWithId(state, id) {
for (let index = 0; index < state.curBatchOptComponents.length; index++) { for (let index = 0; index < state.curBatchOptComponents.length; index++) {
const element = state.curBatchOptComponents[index] const element = state.curBatchOptComponents[index]

View File

@ -17,14 +17,14 @@
v-if="table.mode === 0" v-if="table.mode === 0"
class="de-tag primary" class="de-tag primary"
>{{ >{{
$t('dataset.direct_connect') $t('dataset.direct_connect')
}}</span> }}</span>
<span <span
v-if="table.mode === 1" v-if="table.mode === 1"
class="de-tag warning" class="de-tag warning"
>{{ >{{
$t('dataset.sync_data') $t('dataset.sync_data')
}}</span> }}</span>
</template> </template>
<span <span
v-if="syncStatus === 'Underway'" v-if="syncStatus === 'Underway'"
@ -33,7 +33,7 @@
> >
{{ $t('dataset.dataset_sync') }} {{ $t('dataset.dataset_sync') }}
</span> </span>
<el-divider direction="vertical" /> <el-divider direction="vertical"/>
<span class="create-by">{{ $t('dataset.create_by') }}</span> <span class="create-by">{{ $t('dataset.create_by') }}</span>
<span class="create-by">:{{ table.creatorName || 'N/A' }}</span> <span class="create-by">:{{ table.creatorName || 'N/A' }}</span>
<el-popover <el-popover
@ -59,6 +59,7 @@
:span="8" :span="8"
> >
<deBtn <deBtn
v-if="hasDataPermission('manage', param.privileges)"
:disabled="!previewDataSuccess" :disabled="!previewDataSuccess"
type="primary" type="primary"
icon="el-icon-download" icon="el-icon-download"
@ -79,11 +80,11 @@
</deBtn> </deBtn>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="0"> <el-dropdown-item command="0">
<svg-icon icon-class="icon_add-entry_outlined" /> <svg-icon icon-class="icon_add-entry_outlined"/>
{{ $t('dataset.excel_replace') + $t('chart.chart_data') }} {{ $t('dataset.excel_replace') + $t('chart.chart_data') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="1"> <el-dropdown-item command="1">
<svg-icon icon-class="icon_doc-replace_outlined" /> <svg-icon icon-class="icon_doc-replace_outlined"/>
{{ $t('dataset.excel_add') + $t('chart.chart_data') }} {{ $t('dataset.excel_add') + $t('chart.chart_data') }}
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@ -220,7 +221,7 @@
> >
<div class="tree-cont"> <div class="tree-cont">
<div class="content"> <div class="content">
<rowAuth ref="rowAuth" /> <rowAuth ref="rowAuth"/>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
@ -233,7 +234,8 @@
<deBtn <deBtn
secondary secondary
@click="closeExport" @click="closeExport"
>{{ $t('dataset.cancel') }}</deBtn> >{{ $t('dataset.cancel') }}
</deBtn>
<deBtn <deBtn
type="primary" type="primary"
@click="exportDatasetRequest" @click="exportDatasetRequest"
@ -520,12 +522,14 @@ export default {
border-radius: 4px; border-radius: 4px;
border: 1px solid var(--deBorderBase, #DCDFE6); border: 1px solid var(--deBorderBase, #DCDFE6);
overflow: auto; overflow: auto;
.content { .content {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
} }
} }
.icon-class { .icon-class {
color: #6c6c6c; color: #6c6c6c;
} }
@ -546,6 +550,7 @@ export default {
overflow-y: hidden; overflow-y: hidden;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
.de-dataset-name { .de-dataset-name {
display: flex; display: flex;
font-family: PingFang SC; font-family: PingFang SC;