🎨 Candidate values of the database relation fields are no longer subject to view filtering https://github.com/siyuan-note/siyuan/issues/10411

This commit is contained in:
Daniel 2024-02-23 23:32:23 +08:00
parent bc6d6b17f7
commit 0dc8f1752d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 28 additions and 1 deletions

View file

@ -49,12 +49,18 @@ func GetAttributeViewPrimaryKeyValues(avID string, page, pageSize int) (attribut
attributeViewName = attrView.Name
keyValues = attrView.GetBlockKeyValues()
// 不在视图中的值要过滤掉
// 过滤掉不在视图中的值
tmp := map[string]*av.Value{}
for _, kv := range keyValues.Values {
for _, view := range attrView.Views {
switch view.LayoutType {
case av.LayoutTypeTable:
if !kv.IsDetached {
if nil == treenode.GetBlockTree(kv.BlockID) {
break
}
}
if gulu.Str.Contains(kv.Block.ID, view.Table.RowIDs) {
tmp[kv.Block.ID] = kv
}