fix: reset page when setting block data scope (#4081)

This commit is contained in:
katherinehhh 2024-04-18 09:06:12 +08:00 committed by GitHub
parent 57242c1ce6
commit a88b32bc7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,8 @@ const commonItems: SchemaSettingsItemType[] = [
const { form } = useFormBlockContext();
const field = useField();
const { dn } = useDesignable();
const { service } = useDetailsBlockContext();
return {
collectionName: name,
defaultFilter: fieldSchema?.['x-decorator-props']?.params?.filter || {},
@ -43,6 +45,7 @@ const commonItems: SchemaSettingsItemType[] = [
'x-decorator-props': fieldSchema['x-decorator-props'],
},
});
service.params[0].page = 1;
},
};
},

View File

@ -146,7 +146,6 @@ export const tableBlockSettings = new SchemaSettings({
params.filter = filter;
field.decoratorProps.params = params;
fieldSchema['x-decorator-props']['params'] = params;
const filters = service.params?.[1]?.filters || {};
dn.emit('patch', {
schema: {
@ -154,6 +153,7 @@ export const tableBlockSettings = new SchemaSettings({
'x-decorator-props': fieldSchema['x-decorator-props'],
},
});
service.params[0].page = 1;
},
[dn, field.decoratorProps, fieldSchema, service],
);