mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
f46a1b203c
@ -113,12 +113,8 @@ export const useTableBlockProps = () => {
|
||||
dataBlocks.forEach((block) => {
|
||||
const target = targets.find((target) => target.uid === block.uid);
|
||||
if (!target) return;
|
||||
|
||||
const isForeignKey = block.foreignKeyFields?.some((field) => field.name === target.field);
|
||||
const sourceKey = getSourceKey(currentBlock, target.field);
|
||||
const recordKey = isForeignKey ? sourceKey : ctx.rowKey;
|
||||
const value = [record[recordKey]];
|
||||
|
||||
const sourceKey = getSourceKey(currentBlock, target.field) || ctx.rowKey || 'id';
|
||||
const value = [record[sourceKey]];
|
||||
const param = block.service.params?.[0] || {};
|
||||
// 保留原有的 filter
|
||||
const storedFilter = block.service.params?.[1]?.filters || {};
|
||||
@ -168,5 +164,5 @@ export const useTableBlockProps = () => {
|
||||
|
||||
function getSourceKey(currentBlock: DataBlock, field: string) {
|
||||
const associationField = currentBlock?.associatedFields?.find((item) => item.foreignKey === field);
|
||||
return associationField?.sourceKey || 'id';
|
||||
return associationField?.sourceKey || field?.split?.('.')?.[1];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user