mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
🎨 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:
parent
49031aaca7
commit
01744ae69e
4 changed files with 71 additions and 72 deletions
|
|
@ -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"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue