🎨 Improve av

This commit is contained in:
Daniel 2025-08-13 23:35:16 +08:00
parent cd10072554
commit b78e2edfb8
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 22 additions and 17 deletions

View file

@ -22,7 +22,8 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query string, depth *int) (ret *av.Table) {
func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query string,
depth *int, renderedAttrViews map[string]*av.AttributeView) (ret *av.Table) {
ret = &av.Table{
BaseInstance: av.NewViewBaseInstance(view),
Columns: []*av.TableColumn{},
@ -107,7 +108,7 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
ials := BatchGetBlockAttrs(ialIDs)
// 渲染自动生成的字段值,比如关联、汇总、创建时间和更新时间
fillAttributeViewAutoGeneratedValues(attrView, ret, ials, rowsValues, depth)
fillAttributeViewAutoGeneratedValues(attrView, ret, ials, rowsValues, depth, renderedAttrViews)
// 最后单独渲染模板字段,这样模板就可以使用汇总、关联、创建时间和更新时间的值了
renderTemplateErr := fillAttributeViewTemplateValues(attrView, ret, ials, rowsValues)