diff --git a/packages/core/client/src/block-provider/TableFieldProvider.tsx b/packages/core/client/src/block-provider/TableFieldProvider.tsx index 42d98445d6..410fbb71ad 100644 --- a/packages/core/client/src/block-provider/TableFieldProvider.tsx +++ b/packages/core/client/src/block-provider/TableFieldProvider.tsx @@ -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); } diff --git a/packages/core/client/src/collection-manager/ResourceActionProvider.tsx b/packages/core/client/src/collection-manager/ResourceActionProvider.tsx index 5c590676b2..079364e0b1 100644 --- a/packages/core/client/src/collection-manager/ResourceActionProvider.tsx +++ b/packages/core/client/src/collection-manager/ResourceActionProvider.tsx @@ -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 }, diff --git a/packages/plugins/export/src/client/useExportAction.ts b/packages/plugins/export/src/client/useExportAction.ts index e6293ebf98..5f675f8fa0 100644 --- a/packages/plugins/export/src/client/useExportAction.ts +++ b/packages/plugins/export/src/client/useExportAction.ts @@ -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', diff --git a/packages/plugins/export/src/server/actions/export-xlsx.ts b/packages/plugins/export/src/server/actions/export-xlsx.ts index 59b5e2f4a3..0e5ac882ec 100644 --- a/packages/plugins/export/src/server/actions/export-xlsx.ts +++ b/packages/plugins/export/src/server/actions/export-xlsx.ts @@ -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]));