fix(subTable): fix sorting rule setting (#3795)

This commit is contained in:
Zeke Zhang 2024-03-22 16:42:34 +08:00 committed by GitHub
parent 428bf79298
commit cef18eb979
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,13 +108,17 @@ export const SchemaSettingsSortingRule = function SortRuleConfigure(props) {
const sortArr = sort.map((item) => {
return item.direction === 'desc' ? `-${item.field}` : item.field;
});
_.set(field.componentProps, 'service.params.sort', sortArr);
// 把列中的所有 field 实例找出来,进行更新
field.query(new RegExp(`[0-9]+\\.${fieldSchema.name}$`)).forEach((item) => {
_.set(item, 'componentProps.service.params.sort', sortArr);
});
_.set(fieldSchema, 'x-component-props.service.params.sort', sortArr);
props?.onSubmitCallBack?.(sortArr);
fieldSchema['x-component-props'] = field.componentProps;
dn.emit('patch', {
schema: {
['x-uid']: fieldSchema['x-uid'],
'x-component-props': field.componentProps,
'x-component-props': fieldSchema['x-component-props'],
},
});
}}