Compare commits

...

2 commits

Author SHA1 Message Date
Daniel
de19d69f99
Improve database group view performance https://github.com/siyuan-note/siyuan/issues/15811
Signed-off-by: Daniel <845765@qq.com>
2025-09-10 16:50:11 +08:00
Vanessa
9a15b466f3 🎨 https://github.com/siyuan-note/siyuan/issues/15819 2025-09-10 16:47:12 +08:00
3 changed files with 645 additions and 558 deletions

View file

@ -14,7 +14,7 @@ export const mermaidRender = (element: Element, cdn = Constants.PROTYLE_CDN) =>
if (mermaidElements.length === 0) { if (mermaidElements.length === 0) {
return; return;
} }
addScript(`${cdn}/js/mermaid/mermaid.min.js?v=11.6.0`, "protyleMermaidScript").then(() => { addScript(`${cdn}/js/mermaid/mermaid.min.js?v=11.11.0`, "protyleMermaidScript").then(() => {
const config: any = { const config: any = {
securityLevel: "loose", // 升级后无 https://github.com/siyuan-note/siyuan/issues/3587可使用该选项 securityLevel: "loose", // 升级后无 https://github.com/siyuan-note/siyuan/issues/3587可使用该选项
altFontFamily: "sans-serif", altFontFamily: "sans-serif",

File diff suppressed because one or more lines are too long

View file

@ -97,14 +97,14 @@ func renderAttributeViewGroups(viewable av.Viewable, attrView *av.AttributeView,
if isGroupByDate(view) { if isGroupByDate(view) {
createdDate := time.UnixMilli(view.GroupCreated).Format("2006-01-02") createdDate := time.UnixMilli(view.GroupCreated).Format("2006-01-02")
if time.Now().Format("2006-01-02") != createdDate { if time.Now().Format("2006-01-02") != createdDate {
regenAttrViewGroups(attrView) genAttrViewGroups(view, attrView) // 仅重新生成一个视图的分组以提升性能
av.SaveAttributeView(attrView) av.SaveAttributeView(attrView)
} }
} }
// 如果是按模板分组则需要重新生成分组 // 如果是按模板分组则需要重新生成分组
if isGroupByTemplate(attrView, view) { if isGroupByTemplate(attrView, view) {
regenAttrViewGroups(attrView) genAttrViewGroups(view, attrView) // 仅重新生成一个视图的分组以提升性能
av.SaveAttributeView(attrView) av.SaveAttributeView(attrView)
} }