mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 08:30:42 +08:00
⚡ Improve performance of loading database table view
This commit is contained in:
parent
2dd558b609
commit
238609f25f
@ -413,7 +413,11 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||||||
switch cell.ValueType {
|
switch cell.ValueType {
|
||||||
case av.KeyTypeTemplate: // 渲染模板列
|
case av.KeyTypeTemplate: // 渲染模板列
|
||||||
keyValues := rows[row.ID]
|
keyValues := rows[row.ID]
|
||||||
ial := GetBlockAttrs(row.ID)
|
ial := map[string]string{}
|
||||||
|
block := row.GetBlockValue()
|
||||||
|
if !block.IsDetached {
|
||||||
|
ial = GetBlockAttrs(row.ID)
|
||||||
|
}
|
||||||
content := renderTemplateCol(ial, cell.Value.Template.Content, keyValues)
|
content := renderTemplateCol(ial, cell.Value.Template.Content, keyValues)
|
||||||
cell.Value.Template.Content = content
|
cell.Value.Template.Content = content
|
||||||
case av.KeyTypeCreated: // 渲染创建时间
|
case av.KeyTypeCreated: // 渲染创建时间
|
||||||
@ -426,7 +430,11 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||||||
cell.Value.Created = av.NewFormattedValueCreated(time.Now().UnixMilli(), 0, av.CreatedFormatNone)
|
cell.Value.Created = av.NewFormattedValueCreated(time.Now().UnixMilli(), 0, av.CreatedFormatNone)
|
||||||
}
|
}
|
||||||
case av.KeyTypeUpdated: // 渲染更新时间
|
case av.KeyTypeUpdated: // 渲染更新时间
|
||||||
ial := GetBlockAttrs(row.ID)
|
ial := map[string]string{}
|
||||||
|
block := row.GetBlockValue()
|
||||||
|
if !block.IsDetached {
|
||||||
|
ial = GetBlockAttrs(row.ID)
|
||||||
|
}
|
||||||
updatedStr := ial["updated"]
|
updatedStr := ial["updated"]
|
||||||
if "" == updatedStr {
|
if "" == updatedStr {
|
||||||
block := row.GetBlockValue()
|
block := row.GetBlockValue()
|
||||||
|
Loading…
Reference in New Issue
Block a user