mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:55:33 +00:00
fix: export using post request
This commit is contained in:
parent
1b0946bb8a
commit
ff10e588bb
@ -4,7 +4,7 @@ import {
|
||||
useBlockRequestContext,
|
||||
useCollection,
|
||||
useCollectionManager,
|
||||
useCompile,
|
||||
useCompile
|
||||
} from '@nocobase/client';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { cloneDeep } from 'lodash';
|
||||
@ -39,13 +39,15 @@ export const useExportAction = () => {
|
||||
const { data } = await resource.export(
|
||||
{
|
||||
title: compile(title),
|
||||
columns: JSON.stringify(compile(exportSettings)),
|
||||
appends: service.params[0]?.appends?.join(),
|
||||
filter: JSON.stringify(service.params[0]?.filter),
|
||||
sort: service.params[0]?.sort,
|
||||
},
|
||||
{
|
||||
method: 'get',
|
||||
method: 'post',
|
||||
data: {
|
||||
columns: compile(exportSettings),
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
|
@ -5,8 +5,9 @@ import render from '../renders';
|
||||
import { columns2Appends } from '../utils';
|
||||
|
||||
export async function exportXlsx(ctx: Context, next: Next) {
|
||||
let { title, columns, filter, sort, fields, except } = ctx.action.params;
|
||||
let { title, filter, sort, fields, except } = ctx.action.params;
|
||||
const { resourceName, resourceOf } = ctx.action;
|
||||
let columns = ctx.action.params.values?.columns || ctx.action.params?.columns;
|
||||
if (typeof columns === 'string') {
|
||||
columns = JSON.parse(columns);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user