feat(图表): 支持在视图侧导出视图原始明细数据 #5894

This commit is contained in:
wangjiahao 2024-04-25 15:33:17 +08:00
parent 73c5a8c371
commit 80e0a1099b
2 changed files with 8 additions and 6 deletions

View File

@ -166,14 +166,18 @@ public class PanelGroupController {
@ApiOperation("公共连接导出仪表板视图明细")
@PostMapping("/exportDetails")
@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())
.getRequest();
String linkToken = httpServletRequest.getHeader(F2CLinkFilter.LINK_TOKEN_KEY);
DecodedJWT jwt = JWT.decode(linkToken);
Long userId = jwt.getClaim("userId").asLong();
request.setUserId(userId);
panelGroupService.exportPanelViewDetails(request, response);
if("dataset".equals(request.getDownloadType())){
panelGroupService.exportDatasetDetails(request, response);
}else {
panelGroupService.exportPanelViewDetails(request, response);
}
}
@ApiOperation("站内导出仪表板视图明细")

View File

@ -212,7 +212,7 @@
<svg-icon
icon-class="ds-excel"
class="ds-icon-excel"
/>{{ $t('chart.') }}
/>{{ $t('chart.export_source') }}
</el-button>
</span>
<user-view-dialog
@ -1059,9 +1059,7 @@ 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.$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)