mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🎨 Adding rows after setting the sort field in the database table view no longer fills in the default value https://github.com/siyuan-note/siyuan/issues/10486
This commit is contained in:
parent
13c0bccecd
commit
afcdb37326
1 changed files with 18 additions and 21 deletions
|
|
@ -113,20 +113,19 @@ func (value *Value) Compare(other *Value) int {
|
|||
if !other.Number.IsNotEmpty {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
|
||||
if value.Number.Content > other.Number.Content {
|
||||
return 1
|
||||
} else if value.Number.Content < other.Number.Content {
|
||||
return -1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
} else {
|
||||
if other.Number.IsNotEmpty {
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
if value.Number.Content > other.Number.Content {
|
||||
return 1
|
||||
} else if value.Number.Content < other.Number.Content {
|
||||
return -1
|
||||
} else {
|
||||
return 0
|
||||
return int(value.CreatedAt - other.CreatedAt)
|
||||
}
|
||||
}
|
||||
case KeyTypeDate:
|
||||
|
|
@ -135,20 +134,18 @@ func (value *Value) Compare(other *Value) int {
|
|||
if !other.Date.IsNotEmpty {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
if value.Date.Content > other.Date.Content {
|
||||
return 1
|
||||
} else if value.Date.Content < other.Date.Content {
|
||||
return -1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
} else {
|
||||
if other.Date.IsNotEmpty {
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
if value.Date.Content > other.Date.Content {
|
||||
return 1
|
||||
} else if value.Date.Content < other.Date.Content {
|
||||
return -1
|
||||
} else {
|
||||
return 0
|
||||
return int(value.CreatedAt - other.CreatedAt)
|
||||
}
|
||||
}
|
||||
case KeyTypeCreated:
|
||||
|
|
@ -271,7 +268,7 @@ func (value *Value) Compare(other *Value) int {
|
|||
return strings.Compare(vContent, oContent)
|
||||
}
|
||||
}
|
||||
return 0
|
||||
return int(value.CreatedAt - other.CreatedAt)
|
||||
}
|
||||
|
||||
func (value *Value) CompareOperator(filter *ViewFilter, attrView *AttributeView, rowID string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue