mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🐛 Database filtering does not work after change the field type https://github.com/siyuan-note/siyuan/issues/10519
This commit is contained in:
parent
d97105e970
commit
fed412cc2f
2 changed files with 28 additions and 0 deletions
|
|
@ -321,6 +321,21 @@ func SaveAttributeView(av *AttributeView) (err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 补全过滤器 Value
|
||||||
|
for _, view := range av.Views {
|
||||||
|
if nil == view.Table {
|
||||||
|
for _, f := range view.Table.Filters {
|
||||||
|
if nil != f.Value {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if k, _ := av.GetKey(f.Column); nil != k {
|
||||||
|
f.Value = &Value{Type: k.Type}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 值去重
|
// 值去重
|
||||||
blockValues := av.GetBlockKeyValues()
|
blockValues := av.GetBlockKeyValues()
|
||||||
blockIDs := map[string]bool{}
|
blockIDs := map[string]bool{}
|
||||||
|
|
|
||||||
|
|
@ -695,6 +695,19 @@ func renderAttributeView(attrView *av.AttributeView, viewID string, page, pageSi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 补全过滤器 Value
|
||||||
|
if nil != view.Table {
|
||||||
|
for _, f := range view.Table.Filters {
|
||||||
|
if nil != f.Value {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if k, _ := attrView.GetKey(f.Column); nil != k {
|
||||||
|
f.Value = &av.Value{Type: k.Type}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch view.LayoutType {
|
switch view.LayoutType {
|
||||||
case av.LayoutTypeTable:
|
case av.LayoutTypeTable:
|
||||||
// 列删除以后需要删除设置的过滤和排序
|
// 列删除以后需要删除设置的过滤和排序
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue