forked from github/dataease
Merge branch 'dev' into pr@dev_memory_component
This commit is contained in:
commit
a4c6c99460
@ -71,9 +71,11 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
||||
}
|
||||
// 当没有出现登录超时 且需要刷新token 则执行刷新token
|
||||
if (JWTUtils.loginExpire(authorization)) {
|
||||
TokenCacheUtils.remove(authorization);
|
||||
throw new AuthenticationException(expireMessage);
|
||||
}
|
||||
if (JWTUtils.needRefresh(authorization)) {
|
||||
TokenCacheUtils.remove(authorization);
|
||||
authorization = refreshToken(request, response);
|
||||
}
|
||||
JWTToken token = new JWTToken(authorization);
|
||||
|
@ -5,6 +5,7 @@ import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -48,4 +49,6 @@ public class ChartExtRequest {
|
||||
|
||||
private Long pageSize;
|
||||
|
||||
private Boolean excelExportFlag = false;
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.controller.request.panel;
|
||||
|
||||
import io.dataease.controller.request.chart.ChartExtRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@ -30,4 +31,8 @@ public class PanelViewDetailsRequest {
|
||||
|
||||
private ViewDetailField[] detailFields;
|
||||
|
||||
private ChartExtRequest componentFilterInfo;
|
||||
|
||||
private List<String> excelHeaderKeys;
|
||||
|
||||
}
|
||||
|
@ -526,7 +526,8 @@ public class ChartViewService {
|
||||
}
|
||||
}
|
||||
List<ChartViewFieldDTO> xAxisForRequest = new ArrayList<>();
|
||||
xAxisForRequest.addAll(xAxis); xAxisForRequest.addAll(extStack);
|
||||
xAxisForRequest.addAll(xAxis);
|
||||
xAxisForRequest.addAll(extStack);
|
||||
datasourceRequest.setXAxis(xAxisForRequest);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
} 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> mapSize = (Map<String, Object>) mapAttr.get("size");
|
||||
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) {
|
||||
chartExtRequest.setGoPage(1L);
|
||||
}
|
||||
@ -1043,7 +1044,8 @@ public class ChartViewService {
|
||||
|
||||
datasourceRequest.setQuery(querySql);
|
||||
List<ChartViewFieldDTO> xAxisForRequest = new ArrayList<>();
|
||||
xAxisForRequest.addAll(xAxis); xAxisForRequest.addAll(extStack);
|
||||
xAxisForRequest.addAll(xAxis);
|
||||
xAxisForRequest.addAll(extStack);
|
||||
datasourceRequest.setXAxis(xAxisForRequest);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
if (CollectionUtils.isNotEmpty(assistFields)) {
|
||||
|
@ -10,6 +10,7 @@ import io.dataease.auth.api.dto.CurrentUserDto;
|
||||
import io.dataease.commons.constants.*;
|
||||
import io.dataease.commons.utils.*;
|
||||
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.panel.*;
|
||||
import io.dataease.dto.DatasourceDTO;
|
||||
@ -652,6 +653,7 @@ public class PanelGroupService {
|
||||
public void exportPanelViewDetails(PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
try {
|
||||
findExcelData(request);
|
||||
String snapshot = request.getSnapshot();
|
||||
List<Object[]> details = request.getDetails();
|
||||
Integer[] excelTypes = request.getExcelTypes();
|
||||
@ -1089,6 +1091,32 @@ public class PanelGroupService {
|
||||
request.setUpdateTime(time);
|
||||
request.setUpdateBy(AuthUtils.getUser().getUsername());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -770,6 +770,9 @@ export default {
|
||||
if (response.success) {
|
||||
this.chart = 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.$emit('fill-chart-2-parent', this.chart)
|
||||
this.getDataOnly(response.data, dataBroadcast)
|
||||
@ -912,6 +915,7 @@ export default {
|
||||
tableChart.customAttr.color.tableHeaderFontColor = '#7c7e81'
|
||||
tableChart.customAttr.color.tableFontColor = '#7c7e81'
|
||||
tableChart.customAttr.color.tableStripe = true
|
||||
tableChart.customAttr.size.tablePageMode = 'pull'
|
||||
tableChart.customStyle.text.show = false
|
||||
tableChart.customAttr = JSON.stringify(tableChart.customAttr)
|
||||
tableChart.customStyle = JSON.stringify(tableChart.customStyle)
|
||||
|
@ -87,9 +87,20 @@ import html2canvas from 'html2canvasde'
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { deepCopy, exportImg, imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import { getLinkToken, getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: 'UserViewDialog',
|
||||
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, ChartComponent, TableNormal, LabelNormal, PluginCom },
|
||||
components: {
|
||||
LabelNormalText,
|
||||
ChartComponentS2,
|
||||
ChartComponentG2,
|
||||
DeMainContainer,
|
||||
DeContainer,
|
||||
ChartComponent,
|
||||
TableNormal,
|
||||
LabelNormal,
|
||||
PluginCom
|
||||
},
|
||||
props: {
|
||||
chart: {
|
||||
type: Object,
|
||||
@ -123,8 +134,7 @@ export default {
|
||||
return this.chart.type === 'table-normal' || this.chart.type === 'table-info'
|
||||
},
|
||||
customStyle() {
|
||||
let style = {
|
||||
}
|
||||
let style = {}
|
||||
if (this.canvasStyleData.openCommonStyle) {
|
||||
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
|
||||
style = {
|
||||
@ -186,7 +196,8 @@ export default {
|
||||
'isClickComponent',
|
||||
'curComponent',
|
||||
'componentData',
|
||||
'canvasStyleData'
|
||||
'canvasStyleData',
|
||||
'lastViewRequestInfo'
|
||||
]),
|
||||
mapChart() {
|
||||
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)
|
||||
return result
|
||||
}
|
||||
@ -285,6 +296,8 @@ export default {
|
||||
snapshot: snapshot,
|
||||
snapshotWidth: width,
|
||||
snapshotHeight: height,
|
||||
componentFilterInfo: this.lastViewRequestInfo[this.chart.id],
|
||||
excelHeaderKeys: excelHeaderKeys,
|
||||
detailFields
|
||||
}
|
||||
let method = innerExportDetails
|
||||
@ -313,43 +326,49 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.ms-aside-container {
|
||||
height: 70vh;
|
||||
min-width: 400px;
|
||||
max-width: 400px;
|
||||
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;
|
||||
}
|
||||
}
|
||||
.ms-aside-container {
|
||||
height: 70vh;
|
||||
min-width: 400px;
|
||||
max-width: 400px;
|
||||
padding: 0 0;
|
||||
}
|
||||
|
||||
.svg-background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.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 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -152,7 +152,8 @@ const data = {
|
||||
},
|
||||
previewVisible: false,
|
||||
previewComponentData: [],
|
||||
currentCanvasNewId: []
|
||||
currentCanvasNewId: [],
|
||||
lastViewRequestInfo: {}
|
||||
},
|
||||
mutations: {
|
||||
...animation.mutations,
|
||||
@ -610,6 +611,9 @@ const data = {
|
||||
resetViewEditInfo(state) {
|
||||
state.panelViewEditInfo = {}
|
||||
},
|
||||
setLastViewRequestInfo(state, viewRequestInfo) {
|
||||
state.lastViewRequestInfo[viewRequestInfo.viewId] = viewRequestInfo.requestInfo
|
||||
},
|
||||
removeCurBatchComponentWithId(state, id) {
|
||||
for (let index = 0; index < state.curBatchOptComponents.length; index++) {
|
||||
const element = state.curBatchOptComponents[index]
|
||||
|
@ -17,14 +17,14 @@
|
||||
v-if="table.mode === 0"
|
||||
class="de-tag primary"
|
||||
>{{
|
||||
$t('dataset.direct_connect')
|
||||
}}</span>
|
||||
$t('dataset.direct_connect')
|
||||
}}</span>
|
||||
<span
|
||||
v-if="table.mode === 1"
|
||||
class="de-tag warning"
|
||||
>{{
|
||||
$t('dataset.sync_data')
|
||||
}}</span>
|
||||
$t('dataset.sync_data')
|
||||
}}</span>
|
||||
</template>
|
||||
<span
|
||||
v-if="syncStatus === 'Underway'"
|
||||
@ -33,7 +33,7 @@
|
||||
>
|
||||
{{ $t('dataset.dataset_sync') }}
|
||||
</span>
|
||||
<el-divider direction="vertical" />
|
||||
<el-divider direction="vertical"/>
|
||||
<span class="create-by">{{ $t('dataset.create_by') }}</span>
|
||||
<span class="create-by">:{{ table.creatorName || 'N/A' }}</span>
|
||||
<el-popover
|
||||
@ -59,6 +59,7 @@
|
||||
:span="8"
|
||||
>
|
||||
<deBtn
|
||||
v-if="hasDataPermission('manage', param.privileges)"
|
||||
:disabled="!previewDataSuccess"
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@ -79,11 +80,11 @@
|
||||
</deBtn>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<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') }}
|
||||
</el-dropdown-item>
|
||||
<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') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -220,7 +221,7 @@
|
||||
>
|
||||
<div class="tree-cont">
|
||||
<div class="content">
|
||||
<rowAuth ref="rowAuth" />
|
||||
<rowAuth ref="rowAuth"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -233,7 +234,8 @@
|
||||
<deBtn
|
||||
secondary
|
||||
@click="closeExport"
|
||||
>{{ $t('dataset.cancel') }}</deBtn>
|
||||
>{{ $t('dataset.cancel') }}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
type="primary"
|
||||
@click="exportDatasetRequest"
|
||||
@ -520,12 +522,14 @@ export default {
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--deBorderBase, #DCDFE6);
|
||||
overflow: auto;
|
||||
|
||||
.content {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-class {
|
||||
color: #6c6c6c;
|
||||
}
|
||||
@ -546,6 +550,7 @@ export default {
|
||||
overflow-y: hidden;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.de-dataset-name {
|
||||
display: flex;
|
||||
font-family: PingFang SC;
|
||||
|
Loading…
Reference in New Issue
Block a user