Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
6d6172290a
3 changed files with 13 additions and 3 deletions
|
@ -78,7 +78,15 @@ const (
|
|||
)
|
||||
|
||||
func (filter *ViewFilter) GetAffectValue(key *Key) (ret *Value) {
|
||||
// Improve adding rows of the filtered database table view https://github.com/siyuan-note/siyuan/issues/10025
|
||||
if nil != filter.Value && filter.Value.IsGenerated() {
|
||||
// 自动生成类型的过滤条件不设置默认值
|
||||
return nil
|
||||
}
|
||||
|
||||
if nil == filter.Value && nil != filter.RelativeDate {
|
||||
// 相对日期今天的动态日期不设置默认值
|
||||
return nil
|
||||
}
|
||||
|
||||
ret = filter.Value.Clone()
|
||||
switch filter.Value.Type {
|
||||
|
|
|
@ -294,7 +294,7 @@ func (value *Value) CompareOperator(filter *ViewFilter, attrView *AttributeView,
|
|||
}
|
||||
|
||||
func (value *Value) compareOperator(filter *ViewFilter) bool {
|
||||
if nil == filter || nil == filter.Value {
|
||||
if nil == filter || (nil == filter.Value && nil == filter.RelativeDate) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,6 @@ func (value *Value) compareOperator(filter *ViewFilter) bool {
|
|||
// 计算今天的起始时间
|
||||
relativeTime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
|
||||
}
|
||||
|
||||
case RelativeDateUnitWeek:
|
||||
relativeTime = now.AddDate(0, 0, count*7*int(direction))
|
||||
if FilterOperatorIsBetween == operator && RelativeDateDirectionThis == direction {
|
||||
|
|
|
@ -1738,6 +1738,9 @@ func addAttributeViewBlock(avID, previousBlockID, blockID string, isDetached boo
|
|||
for _, keyValues := range attrView.KeyValues {
|
||||
if keyValues.Key.ID == filter.Column {
|
||||
newValue := filter.GetAffectValue(keyValues.Key)
|
||||
if nil == newValue {
|
||||
continue
|
||||
}
|
||||
newValue.ID = ast.NewNodeID()
|
||||
newValue.KeyID = keyValues.Key.ID
|
||||
newValue.BlockID = blockID
|
||||
|
|
Loading…
Add table
Reference in a new issue