🎨 Database table view cell value adds createdAt and updatedAt fields https://github.com/siyuan-note/siyuan/issues/10492

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:
Daniel 2024-03-03 16:12:44 +08:00
parent 49031aaca7
commit 01744ae69e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 71 additions and 72 deletions

View file

@ -37,6 +37,9 @@ type Value struct {
Type KeyType `json:"type,omitempty"`
IsDetached bool `json:"isDetached,omitempty"`
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
Block *ValueBlock `json:"block,omitempty"`
Text *ValueText `json:"text,omitempty"`
Number *ValueNumber `json:"number,omitempty"`
@ -180,6 +183,14 @@ func (value *Value) Clone() (ret *Value) {
return
}
func (value *Value) IsEdited() bool {
if value.CreatedAt == value.UpdatedAt {
// 说明是刚刚创建的块
return false
}
return true
}
type ValueBlock struct {
ID string `json:"id"`
Content string `json:"content"`