mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 22:52:34 +01:00
🎨 Automatically fill in the filter result value when adding rows in the database table view https://github.com/siyuan-note/siyuan/issues/9905
This commit is contained in:
parent
a379e24b3b
commit
7ff4356316
5 changed files with 49 additions and 4 deletions
|
|
@ -313,6 +313,17 @@ func (av *AttributeView) GetBlockKeyValues() (ret *KeyValues) {
|
|||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) GetKeyValues(keyID string) (ret *KeyValues, err error) {
|
||||
for _, kv := range av.KeyValues {
|
||||
if kv.Key.ID == keyID {
|
||||
ret = kv
|
||||
return
|
||||
}
|
||||
}
|
||||
err = ErrKeyNotFound
|
||||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) GetBlockKey() (ret *Key) {
|
||||
for _, kv := range av.KeyValues {
|
||||
if KeyTypeBlock == kv.Key.Type {
|
||||
|
|
|
|||
|
|
@ -160,6 +160,18 @@ func (value *Value) ToJSONString() string {
|
|||
return string(data)
|
||||
}
|
||||
|
||||
func (value *Value) Clone() (ret *Value) {
|
||||
data, err := gulu.JSON.MarshalJSON(value)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
err = gulu.JSON.UnmarshalJSON(data, &ret)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ValueBlock struct {
|
||||
ID string `json:"id"`
|
||||
Content string `json:"content"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue