mirror of
https://github.com/dataease/dataease.git
synced 2026-06-11 07:17:01 +08:00
fix: 嵌入式下数据集异步导出
This commit is contained in:
@@ -8,6 +8,7 @@ import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
||||
import io.dataease.api.dataset.vo.DataSetBarVO;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
import io.dataease.constant.XpackSettingConstants;
|
||||
import io.dataease.dataset.manage.DatasetGroupManage;
|
||||
import io.dataease.exportCenter.manage.ExportCenterDownLoadManage;
|
||||
import io.dataease.exportCenter.manage.ExportCenterManage;
|
||||
@@ -18,6 +19,7 @@ import io.dataease.model.BusiNodeRequest;
|
||||
import io.dataease.model.BusiNodeVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -108,7 +110,8 @@ public class DatasetTreeServer implements DatasetTreeApi {
|
||||
|
||||
@Override
|
||||
public void exportDataset(DataSetExportRequest request, HttpServletResponse response) throws Exception {
|
||||
if (request.isDataEaseBi()) {
|
||||
boolean embeddedSyncExport = !StringUtils.equalsIgnoreCase(exportCenterManage.singleValue(XpackSettingConstants.EMBEDDED_EXPORT_MODE), "async");
|
||||
if (request.isDataEaseBi() && embeddedSyncExport) {
|
||||
exportCenterDownLoadManage.downloadDataset(request, response);
|
||||
} else {
|
||||
exportCenterManage.addTask(request.getId(), "dataset", request);
|
||||
|
||||
@@ -3,7 +3,7 @@ import dvPreviewDownload from '@/assets/svg/icon_download_outlined.svg'
|
||||
import deDelete from '@/assets/svg/de-delete.svg'
|
||||
import icon_fileExcel_colorful from '@/assets/svg/icon_file-excel_colorful.svg'
|
||||
import icon_refresh_outlined from '@/assets/svg/icon_refresh_outlined.svg'
|
||||
import { ref, onUnmounted, computed, reactive } from 'vue'
|
||||
import { ref, onMounted, onUnmounted, computed, reactive } from 'vue'
|
||||
import { EmptyBackground } from '@/components/empty-background'
|
||||
import { ElMessage, ElMessageBox, ElTabPane, ElTabs } from 'element-plus-secondary'
|
||||
import {
|
||||
@@ -157,6 +157,12 @@ const init = params => {
|
||||
const appStore = useAppStoreWithOut()
|
||||
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
|
||||
onMounted(() => {
|
||||
if (isDataEaseBi.value || appStore.getIsIframe) {
|
||||
handleClick()
|
||||
}
|
||||
})
|
||||
|
||||
const downLoadAll = () => {
|
||||
if (multipleSelection.value.length === 0) {
|
||||
tableData.value.forEach(item => {
|
||||
|
||||
@@ -402,9 +402,10 @@ const save = ({ logic, items, errorMessage }) => {
|
||||
}
|
||||
table.value.expressionTree = JSON.stringify({ items, logic })
|
||||
exportDatasetLoading.value = true
|
||||
const embeddedSyncExport = wsCache.get('embeddedExportMode-backend') !== 'async'
|
||||
exportDatasetData(table.value)
|
||||
.then(res => {
|
||||
if (isDataEaseBi.value || appStore.getIsIframe) {
|
||||
if ((isDataEaseBi.value || appStore.getIsIframe) && embeddedSyncExport) {
|
||||
const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
|
||||
Reference in New Issue
Block a user