fix(导出中心): 嵌入式导出数据失败

This commit is contained in:
taojinlong 2024-07-19 17:24:29 +08:00
parent aef7e8f3dc
commit 5557f01c1f
4 changed files with 12 additions and 2 deletions

View File

@ -89,7 +89,7 @@ public class ChartDataServer implements ChartDataApi {
public void innerExportDetails(ChartExcelRequest request, HttpServletResponse response) throws Exception {
HttpServletRequest httpServletRequest = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String linkToken = httpServletRequest.getHeader(AuthConstant.LINK_TOKEN_KEY);
if (StringUtils.isEmpty(linkToken)) {
if (StringUtils.isEmpty(linkToken) || !request.isDataEaseBi()) {
exportCenterManage.addTask(request.getViewId(), "chart", request);
return;
}

View File

@ -513,6 +513,9 @@ export const exportExcelDownload = (chart, callBack?) => {
const linkStore = useLinkStoreWithOut()
if (isDataEaseBi.value || appStore.getIsIframe) {
request.isDataEaseBi = true
}
innerExportDetails(request)
.then(res => {
if (linkStore.getLinkToken || isDataEaseBi.value || appStore.getIsIframe) {

View File

@ -46,6 +46,11 @@ onBeforeMount(() => {
if (!items.value.length || items.value[items.value.length - 1].name) {
items.value.push(new KeyValue({ enable: true, name: '', value: '' }))
}
for (let i = 0; i < items.value.length; i++) {
if (!items.value[i].hasOwnProperty('nameType')) {
items.value[i].nameType = 'fixed'
}
}
})
const activeName = inject('api-active-name')
@ -56,7 +61,7 @@ const remove = (index: number) => {
items.value.splice(index, 1)
}
const change = () => {
items.value.push(new KeyValue({ enable: true }))
items.value.push(new KeyValue({ enable: true, nameType: 'fixed' }))
}
const isDisable = () => {
return items.value.length === 1

View File

@ -22,4 +22,6 @@ public class ChartExcelRequest extends ChartExcelRequestInner {
private List<ChartExcelRequestInner> multiInfo;
private boolean isDataEaseBi = false;
}