diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 3f03154af..dc8f11472 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -1104,18 +1104,26 @@ func addAttributeViewBlock(blockID string, operation *Operation, tree *parse.Tre content = getNodeRefText(node) } now := time.Now().UnixMilli() - value := &av.Value{ID: ast.NewNodeID(), KeyID: blockValues.Key.ID, BlockID: blockID, Type: av.KeyTypeBlock, IsDetached: operation.IsDetached, IsInitialized: false, Block: &av.ValueBlock{ID: blockID, Content: content, Created: now, Updated: now}} - blockValues.Values = append(blockValues.Values, value) + blockValue := &av.Value{ID: ast.NewNodeID(), KeyID: blockValues.Key.ID, BlockID: blockID, Type: av.KeyTypeBlock, IsDetached: operation.IsDetached, IsInitialized: false, Block: &av.ValueBlock{ID: blockID, Content: content, Created: now, Updated: now}} + blockValues.Values = append(blockValues.Values, blockValue) // 如果存在过滤条件,则将过滤条件应用到新添加的块上 view, _ := attrView.GetCurrentView() if nil != view && 0 < len(view.Table.Filters) { viewable, _ := renderAttributeViewTable(attrView, view) + viewable.FilterRows() + viewable.SortRows() + if 0 < len(viewable.Rows) { row := viewable.Rows[len(viewable.Rows)-1] for _, filter := range view.Table.Filters { for _, cell := range row.Cells { if nil != cell.Value && cell.Value.KeyID == filter.Column { + if av.KeyTypeBlock == cell.ValueType { + blockValue.Block.Content = cell.Value.Block.Content + continue + } + newValue := cell.Value.Clone() newValue.ID = ast.NewNodeID() newValue.BlockID = blockID