mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
fix: sub-table-appends
This commit is contained in:
parent
222135dc5f
commit
e4bf8ee644
@ -1136,8 +1136,12 @@ export const useAssociationNames = (collection) => {
|
|||||||
if (Array.isArray(list[i])) {
|
if (Array.isArray(list[i])) {
|
||||||
`${prefix}` !== `${list[i][0]}` && flattenHelper(list[i], `${prefix}.${list[i][0]}`);
|
`${prefix}` !== `${list[i][0]}` && flattenHelper(list[i], `${prefix}.${list[i][0]}`);
|
||||||
} else {
|
} else {
|
||||||
const str = prefix.replaceAll(`${list[i]}`, '').replace('..', '.').trim();
|
const str = prefix.replaceAll(`.${list[i]}`, '').trim();
|
||||||
!list.includes(str) && flattenedList.push(`${str}${list[i]}`);
|
if (!str) {
|
||||||
|
!list.includes(str) && flattenedList.push(`${list[i]}`);
|
||||||
|
} else {
|
||||||
|
!list.includes(str) ? flattenedList.push(`${str}.${list[i]}`) : flattenedList.push(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1153,9 +1157,7 @@ export const useAssociationNames = (collection) => {
|
|||||||
}, data);
|
}, data);
|
||||||
return data.filter((g) => g.length);
|
return data.filter((g) => g.length);
|
||||||
};
|
};
|
||||||
const data = getAssociationAppends(formSchema);
|
const associations = getAssociationAppends(formSchema);
|
||||||
const associations = data.filter((g) => g.length);
|
|
||||||
const appends = flattenNestedList(associations);
|
const appends = flattenNestedList(associations);
|
||||||
|
|
||||||
return { appends, updateAssociationValues: appends.filter((v) => associationValues.includes(v)) };
|
return { appends, updateAssociationValues: appends.filter((v) => associationValues.includes(v)) };
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user