mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Add Rollup column to database table view https://github.com/siyuan-note/siyuan/issues/9958
This commit is contained in:
parent
5c8bab48ed
commit
b296771340
3 changed files with 22 additions and 30 deletions
|
|
@ -774,18 +774,14 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
break
|
||||
}
|
||||
|
||||
for _, blockID := range relVal.Relation.BlockIDs {
|
||||
destKey, _ := destAv.GetKey(rollupKey.Rollup.KeyID)
|
||||
if nil == destKey {
|
||||
continue
|
||||
}
|
||||
destKey, _ := destAv.GetKey(rollupKey.Rollup.KeyID)
|
||||
if nil == destKey {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, blockID := range relVal.Relation.BlockIDs {
|
||||
destVal := destAv.GetValue(rollupKey.Rollup.KeyID, blockID)
|
||||
if nil == destVal {
|
||||
if nil == destKey {
|
||||
continue
|
||||
}
|
||||
|
||||
destVal = GetAttributeViewDefaultValue(ast.NewNodeID(), rollupKey.Rollup.KeyID, blockID, destKey.Type)
|
||||
}
|
||||
if av.KeyTypeNumber == destKey.Type {
|
||||
|
|
@ -796,7 +792,7 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
cell.Value.Rollup.Contents = append(cell.Value.Rollup.Contents, destVal.Clone())
|
||||
}
|
||||
|
||||
cell.Value.Rollup.RenderContents(rollupKey.Rollup.Calc)
|
||||
cell.Value.Rollup.RenderContents(rollupKey.Rollup.Calc, destKey)
|
||||
case av.KeyTypeRelation: // 渲染关联列
|
||||
relKey, _ := attrView.GetKey(cell.Value.KeyID)
|
||||
if nil != relKey && nil != relKey.Relation {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue