mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:46:00 +00:00
fix: export action missing data scope filter (#4476)
This commit is contained in:
parent
bbbb409565
commit
bdde49ee84
@ -9,27 +9,27 @@
|
||||
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import {
|
||||
useAPIClient,
|
||||
useBlockRequestContext,
|
||||
useCollection_deprecated,
|
||||
useCollectionManager_deprecated,
|
||||
useCompile,
|
||||
mergeFilter,
|
||||
} from '@nocobase/client';
|
||||
import lodash from 'lodash';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { App } from 'antd';
|
||||
import { useExportTranslation } from './locale';
|
||||
import React from 'react';
|
||||
|
||||
export const useExportAction = () => {
|
||||
const { service, resource } = useBlockRequestContext();
|
||||
const apiClient = useAPIClient();
|
||||
const { service, resource, props } = useBlockRequestContext();
|
||||
const defaultFilter = props?.params.filter;
|
||||
const actionSchema = useFieldSchema();
|
||||
const compile = useCompile();
|
||||
const { getCollectionJoinField } = useCollectionManager_deprecated();
|
||||
const { name, title, getField } = useCollection_deprecated();
|
||||
const { name, title } = useCollection_deprecated();
|
||||
const { t } = useExportTranslation();
|
||||
const { modal } = App.useApp();
|
||||
const filters = service.params?.[1]?.filters || {};
|
||||
return {
|
||||
async onClick() {
|
||||
const confirmed = await modal.confirm({
|
||||
@ -61,7 +61,7 @@ export const useExportAction = () => {
|
||||
{
|
||||
title: compile(title),
|
||||
appends: service.params[0]?.appends?.join(),
|
||||
filter: JSON.stringify(service.params[0]?.filter),
|
||||
filter: mergeFilter([...Object.values(filters), defaultFilter]),
|
||||
sort: service.params[0]?.sort,
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user