From 902849153a87eb75b200ab37b9ff674e8ba382d0 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 9 Oct 2023 17:17:40 +0800 Subject: [PATCH] :art: Add created and updated type column to database https://github.com/siyuan-note/siyuan/issues/9371 --- kernel/model/attribute_view.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 405571222c7..a3919c2177e 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -229,6 +229,23 @@ func RenderAttributeView(avID string) (viewable av.Viewable, attrView *av.Attrib switch view.LayoutType { case av.LayoutTypeTable: + // 列删除以后需要删除设置的过滤和排序 + tmpFilters := []*av.ViewFilter{} + for _, f := range view.Table.Filters { + if k, _ := attrView.GetKey(f.Column); nil != k { + tmpFilters = append(tmpFilters, f) + } + } + view.Table.Filters = tmpFilters + + tmpSorts := []*av.ViewSort{} + for _, s := range view.Table.Sorts { + if k, _ := attrView.GetKey(s.Column); nil != k { + tmpSorts = append(tmpSorts, s) + } + } + view.Table.Sorts = tmpSorts + viewable, err = renderAttributeViewTable(attrView, view) }