mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 23:19:26 +08:00
feat: table block of the selector supports tree table
This commit is contained in:
parent
6126481b06
commit
b28b8ba536
@ -99,19 +99,21 @@ const useAssociationNames = (collection) => {
|
||||
|
||||
export const TableSelectorProvider = (props) => {
|
||||
const fieldSchema = useFieldSchema();
|
||||
const ctx = useFormBlockContext();
|
||||
const { getCollectionJoinField, getCollectionFields } = useCollectionManager();
|
||||
const record = useRecord();
|
||||
|
||||
const { getCollection } = useCollectionManager();
|
||||
const collection = getCollection(props.collection);
|
||||
const { treeTable } = fieldSchema['x-decorator-props'];
|
||||
const collectionFieldSchema = recursiveParent(fieldSchema, 'CollectionField');
|
||||
// const value = ctx.form.query(collectionFieldSchema?.name).value();
|
||||
const collectionField = getCollectionJoinField(collectionFieldSchema?.['x-collection-field']);
|
||||
|
||||
const params = { ...props.params };
|
||||
const appends = useAssociationNames(props.collection);
|
||||
if (props.dragSort) {
|
||||
params['sort'] = ['sort'];
|
||||
}
|
||||
if ((collection as any).template === 'tree' && treeTable !== false) {
|
||||
params['tree'] = true;
|
||||
}
|
||||
if (!Object.keys(params).includes('appends')) {
|
||||
params['appends'] = appends;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user