Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-11-24 11:03:11 +08:00
parent 8429a1df0b
commit 712092d49e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -4848,14 +4848,10 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
if av.KeyTypeRelation == val.Type { if av.KeyTypeRelation == val.Type {
// 关联字段得 content 是自动渲染的,所以不需要保存 // 关联字段得 content 是自动渲染的,所以不需要保存
val.Relation.Contents = nil val.Relation.Contents = nil
// 去重
val.Relation.BlockIDs = gulu.Str.RemoveDuplicatedElem(val.Relation.BlockIDs) val.Relation.BlockIDs = gulu.Str.RemoveDuplicatedElem(val.Relation.BlockIDs)
// 计算关联变更模式 // 计算关联变更模式
if len(oldRelationBlockIDs) == len(val.Relation.BlockIDs) { if !slices.Equal(oldRelationBlockIDs, val.Relation.BlockIDs) {
relationChangeMode = 0
} else {
if len(oldRelationBlockIDs) > len(val.Relation.BlockIDs) { if len(oldRelationBlockIDs) > len(val.Relation.BlockIDs) {
relationChangeMode = 2 relationChangeMode = 2
} else { } else {