mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:37:01 +00:00
fix: sync table sort to export (#723)
This commit is contained in:
parent
f11c0025c0
commit
538a28d0bd
@ -17,8 +17,8 @@ const InternalTableFieldProvider = (props) => {
|
||||
const formBlockCtx = useFormBlockContext();
|
||||
const formFieldCtx = useFormFieldContext();
|
||||
|
||||
const fullFieldName = formFieldCtx && formFieldCtx.fieldName ? `${formFieldCtx.fieldName}.${fieldName}` : fieldName;
|
||||
|
||||
const fullFieldName = formFieldCtx && formFieldCtx.fieldName ? `${formFieldCtx.fieldName}.${fieldName}` : fieldName;
|
||||
|
||||
if (!formBlockCtx?.updateAssociationValues?.includes(fullFieldName)) {
|
||||
formBlockCtx?.updateAssociationValues?.push(fullFieldName);
|
||||
}
|
||||
|
@ -35,10 +35,7 @@ const CollectionResourceActionProvider = (props) => {
|
||||
params: {
|
||||
...others,
|
||||
...request?.params,
|
||||
appends: [
|
||||
...collection?.fields?.filter?.((field) => field.target).map((field) => field.name),
|
||||
...appends,
|
||||
],
|
||||
appends: [...collection?.fields?.filter?.((field) => field.target).map((field) => field.name), ...appends],
|
||||
sort: dragSort ? [collection.sortable === true ? 'sort' : collection.sortable] : request?.params?.sort,
|
||||
},
|
||||
},
|
||||
@ -66,10 +63,7 @@ const AssociationResourceActionProvider = (props) => {
|
||||
...request,
|
||||
params: {
|
||||
...request?.params,
|
||||
appends: [
|
||||
...collection?.fields?.filter?.((field) => field.target).map((field) => field.name),
|
||||
...appends,
|
||||
],
|
||||
appends: [...collection?.fields?.filter?.((field) => field.target).map((field) => field.name), ...appends],
|
||||
},
|
||||
},
|
||||
{ uid },
|
||||
|
@ -41,6 +41,7 @@ export const useExportAction = () => {
|
||||
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',
|
||||
|
@ -5,7 +5,7 @@ import render from '../renders';
|
||||
import { columns2Appends } from '../utils';
|
||||
|
||||
export async function exportXlsx(ctx: Context, next: Next) {
|
||||
let { title, columns, filter, fields, except } = ctx.action.params;
|
||||
let { title, columns, filter, sort, fields, except } = ctx.action.params;
|
||||
const { resourceName, resourceOf } = ctx.action;
|
||||
if (typeof columns === 'string') {
|
||||
columns = JSON.parse(columns);
|
||||
@ -19,6 +19,7 @@ export async function exportXlsx(ctx: Context, next: Next) {
|
||||
fields,
|
||||
appends,
|
||||
except,
|
||||
sort,
|
||||
context: ctx,
|
||||
});
|
||||
const collectionFields = columns.map((col) => collection.fields.get(col.dataIndex[0]));
|
||||
|
Loading…
Reference in New Issue
Block a user