Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-08-10 10:20:22 +08:00
commit f2afd11a84
2 changed files with 19 additions and 13 deletions

View file

@ -3480,8 +3480,6 @@ func sortAttributeViewRow(operation *Operation) (err error) {
}
targetGroupView.GroupItemIDs = util.InsertElem(targetGroupView.GroupItemIDs, previousIndex, itemID)
}
regenAttrViewGroups(attrView, "force")
} else { // 同分组内排序
for i, r := range groupView.GroupItemIDs {
if r == operation.PreviousID {
@ -4310,20 +4308,24 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
// val.IsDetached 只有更新主键的时候才会传入,所以下面需要结合 isUpdatingBlockKey 来判断
if isUpdatingBlockKey {
if oldIsDetached {
// 之前是游离行
if !val.IsDetached { // 现在绑定了块
// 将游离行绑定到新建的块上
bindBlockAv(tx, avID, blockID)
if nil != val.Block {
val.BlockID = val.Block.ID
if val.Block.ID != blockID {
// 从其他库拷贝主键值后会出现该情况
blockID = val.Block.ID
val.BlockID = blockID
}
bindBlockAv(tx, avID, blockID)
}
} else {
// 之前绑定了块
if isUpdatingBlockKey { // 正在更新主键
if val.IsDetached { // 现在是游离行
// 将绑定的块从属性视图中移除
unbindBlockAv(tx, avID, blockID)

View file

@ -3390,6 +3390,10 @@ func exportRefTrees(tree *parse.Tree, defBlockIDs *[]string, retTrees, treeCache
}
for _, val := range blockKeyValues.Values {
if val.IsDetached {
continue
}
defBlock := treenode.GetBlockTree(val.BlockID)
if nil == defBlock {
continue