mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 23:08:49 +01:00
This commit is contained in:
parent
aeb09cb0f6
commit
aa01e99b0d
1 changed files with 15 additions and 4 deletions
|
|
@ -2012,9 +2012,20 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string,
|
|||
viewable.FilterRows(attrView)
|
||||
viewable.SortRows()
|
||||
|
||||
var lastRow *av.TableRow
|
||||
var nearRow *av.TableRow
|
||||
if 0 < len(viewable.Rows) {
|
||||
lastRow = viewable.Rows[len(viewable.Rows)-1]
|
||||
if "" != previousBlockID {
|
||||
for _, row := range viewable.Rows {
|
||||
if row.ID == previousBlockID {
|
||||
nearRow = row
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if 0 < len(viewable.Rows) {
|
||||
nearRow = viewable.Rows[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sameKeyFilterSort := false // 是否在同一个字段上同时存在过滤和排序
|
||||
|
|
@ -2041,8 +2052,8 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string,
|
|||
for _, keyValues := range attrView.KeyValues {
|
||||
if keyValues.Key.ID == filter.Column {
|
||||
var defaultVal *av.Value
|
||||
if nil != lastRow {
|
||||
defaultVal = lastRow.GetValue(filter.Column)
|
||||
if nil != nearRow {
|
||||
defaultVal = nearRow.GetValue(filter.Column)
|
||||
}
|
||||
|
||||
newValue := filter.GetAffectValue(keyValues.Key, defaultVal)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue