forked from github/dataease
feat(图表): 支持在视图侧导出视图原始明细数据 #5894
This commit is contained in:
parent
73c5a8c371
commit
80e0a1099b
@ -166,15 +166,19 @@ public class PanelGroupController {
|
|||||||
@ApiOperation("公共连接导出仪表板视图明细")
|
@ApiOperation("公共连接导出仪表板视图明细")
|
||||||
@PostMapping("/exportDetails")
|
@PostMapping("/exportDetails")
|
||||||
@I18n
|
@I18n
|
||||||
public void exportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
public void exportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws Exception {
|
||||||
HttpServletRequest httpServletRequest = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
HttpServletRequest httpServletRequest = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||||
.getRequest();
|
.getRequest();
|
||||||
String linkToken = httpServletRequest.getHeader(F2CLinkFilter.LINK_TOKEN_KEY);
|
String linkToken = httpServletRequest.getHeader(F2CLinkFilter.LINK_TOKEN_KEY);
|
||||||
DecodedJWT jwt = JWT.decode(linkToken);
|
DecodedJWT jwt = JWT.decode(linkToken);
|
||||||
Long userId = jwt.getClaim("userId").asLong();
|
Long userId = jwt.getClaim("userId").asLong();
|
||||||
request.setUserId(userId);
|
request.setUserId(userId);
|
||||||
|
if("dataset".equals(request.getDownloadType())){
|
||||||
|
panelGroupService.exportDatasetDetails(request, response);
|
||||||
|
}else {
|
||||||
panelGroupService.exportPanelViewDetails(request, response);
|
panelGroupService.exportPanelViewDetails(request, response);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("站内导出仪表板视图明细")
|
@ApiOperation("站内导出仪表板视图明细")
|
||||||
@PostMapping("/innerExportDetails")
|
@PostMapping("/innerExportDetails")
|
||||||
|
@ -212,7 +212,7 @@
|
|||||||
<svg-icon
|
<svg-icon
|
||||||
icon-class="ds-excel"
|
icon-class="ds-excel"
|
||||||
class="ds-icon-excel"
|
class="ds-icon-excel"
|
||||||
/>{{ $t('chart.導出原始明細') }}
|
/>{{ $t('chart.export_source') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
<user-view-dialog
|
<user-view-dialog
|
||||||
@ -1059,9 +1059,7 @@ 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.$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)
|
||||||
|
Loading…
Reference in New Issue
Block a user