parent
07b9ac0873
commit
c95889aec2
@ -76,6 +76,7 @@ export const Action: ComposedAction = observer((props: any) => {
|
|||||||
className,
|
className,
|
||||||
disabled,
|
disabled,
|
||||||
icon,
|
icon,
|
||||||
|
title,
|
||||||
...others
|
...others
|
||||||
} = props;
|
} = props;
|
||||||
const { onClick } = useProps(props);
|
const { onClick } = useProps(props);
|
||||||
@ -113,7 +114,7 @@ export const Action: ComposedAction = observer((props: any) => {
|
|||||||
component={component || Button}
|
component={component || Button}
|
||||||
className={classnames(className, actionDesignerCss)}
|
className={classnames(className, actionDesignerCss)}
|
||||||
>
|
>
|
||||||
{compile(fieldSchema.title)}
|
{title || compile(fieldSchema.title)}
|
||||||
<Designer {...designerProps} />
|
<Designer {...designerProps} />
|
||||||
</SortableItem>
|
</SortableItem>
|
||||||
);
|
);
|
||||||
|
@ -83,7 +83,7 @@ export const FilterAction = observer((props: any) => {
|
|||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Action {...others} />
|
<Action {...others} title={field.title} />
|
||||||
</Popover>
|
</Popover>
|
||||||
</FilterActionContext.Provider>
|
</FilterActionContext.Provider>
|
||||||
);
|
);
|
||||||
|
@ -103,7 +103,7 @@ export const useFilterActionProps = () => {
|
|||||||
const defaultFilter = removeNullCondition(props.params.filter);
|
const defaultFilter = removeNullCondition(props.params.filter);
|
||||||
// filter parameter for the filter action
|
// filter parameter for the filter action
|
||||||
const filter = removeNullCondition(values?.filter);
|
const filter = removeNullCondition(values?.filter);
|
||||||
service.run({ ...service.params?.[0], filter: mergeFilter(defaultFilter, filter) });
|
service.run({ ...service.params?.[0], page: 1, filter: mergeFilter(defaultFilter, filter) });
|
||||||
const items = filter?.$and || filter?.$or;
|
const items = filter?.$and || filter?.$or;
|
||||||
if (items?.length) {
|
if (items?.length) {
|
||||||
field.title = t('{{count}} filter items', { count: items?.length || 0 });
|
field.title = t('{{count}} filter items', { count: items?.length || 0 });
|
||||||
@ -113,7 +113,7 @@ export const useFilterActionProps = () => {
|
|||||||
},
|
},
|
||||||
onReset() {
|
onReset() {
|
||||||
const filter = removeNullCondition(props.params.filter);
|
const filter = removeNullCondition(props.params.filter);
|
||||||
service.run({ ...service.params?.[0], filter });
|
service.run({ ...service.params?.[0], filter, page: 1 });
|
||||||
field.title = t('Filter');
|
field.title = t('Filter');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -72,7 +72,7 @@ export const TableBlockDesigner = () => {
|
|||||||
params.filter = filter;
|
params.filter = filter;
|
||||||
field.decoratorProps.params = params;
|
field.decoratorProps.params = params;
|
||||||
fieldSchema['x-decorator-props']['params'] = params;
|
fieldSchema['x-decorator-props']['params'] = params;
|
||||||
service.run({ ...service.params?.[0], filter });
|
service.run({ ...service.params?.[0], filter, page: 1 });
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
@ -190,7 +190,7 @@ export const TableBlockDesigner = () => {
|
|||||||
params.pageSize = pageSize;
|
params.pageSize = pageSize;
|
||||||
field.decoratorProps.params = params;
|
field.decoratorProps.params = params;
|
||||||
fieldSchema['x-decorator-props']['params'] = params;
|
fieldSchema['x-decorator-props']['params'] = params;
|
||||||
service.run({ ...service.params?.[0], pageSize });
|
service.run({ ...service.params?.[0], pageSize, page: 1 });
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
|
@ -57,7 +57,7 @@ export const TableSelectorDesigner = () => {
|
|||||||
params.filter = filter;
|
params.filter = filter;
|
||||||
field.decoratorProps.params = params;
|
field.decoratorProps.params = params;
|
||||||
fieldSchema['x-decorator-props']['params'] = params;
|
fieldSchema['x-decorator-props']['params'] = params;
|
||||||
service.run({ ...service.params?.[0], filter });
|
service.run({ ...service.params?.[0], filter, page: 1 });
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
@ -175,7 +175,7 @@ export const TableSelectorDesigner = () => {
|
|||||||
params.pageSize = pageSize;
|
params.pageSize = pageSize;
|
||||||
field.decoratorProps.params = params;
|
field.decoratorProps.params = params;
|
||||||
fieldSchema['x-decorator-props']['params'] = params;
|
fieldSchema['x-decorator-props']['params'] = params;
|
||||||
service.run({ ...service.params?.[0], pageSize });
|
service.run({ ...service.params?.[0], pageSize, page: 1 });
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema: {
|
schema: {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
|
Loading…
Reference in New Issue
Block a user