mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 20:12:56 +08:00
🎨 Support floating window to open related database when filling in the database relation field https://github.com/siyuan-note/siyuan/issues/10915
This commit is contained in:
parent
49e62ebff5
commit
62db617f91
@ -86,7 +86,7 @@ func getAttributeViewPrimaryKeyValues(c *gin.Context) {
|
|||||||
if keywordArg := arg["keyword"]; nil != keywordArg {
|
if keywordArg := arg["keyword"]; nil != keywordArg {
|
||||||
keyword = keywordArg.(string)
|
keyword = keywordArg.(string)
|
||||||
}
|
}
|
||||||
attributeViewName, rows, err := model.GetAttributeViewPrimaryKeyValues(id, keyword, page, pageSize)
|
attributeViewName, databaseBlockIDs, rows, err := model.GetAttributeViewPrimaryKeyValues(id, keyword, page, pageSize)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
ret.Code = -1
|
ret.Code = -1
|
||||||
ret.Msg = err.Error()
|
ret.Msg = err.Error()
|
||||||
@ -94,8 +94,9 @@ func getAttributeViewPrimaryKeyValues(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"name": attributeViewName,
|
"name": attributeViewName,
|
||||||
"rows": rows,
|
"blockIDs": databaseBlockIDs,
|
||||||
|
"rows": rows,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ func SetDatabaseBlockView(blockID, viewID string) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int) (attributeViewName string, keyValues *av.KeyValues, err error) {
|
func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int) (attributeViewName string, databaseBlockIDs []string, keyValues *av.KeyValues, err error) {
|
||||||
waitForSyncingStorages()
|
waitForSyncingStorages()
|
||||||
|
|
||||||
attrView, err := av.ParseAttributeView(avID)
|
attrView, err := av.ParseAttributeView(avID)
|
||||||
@ -65,6 +65,8 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
|
|||||||
}
|
}
|
||||||
attributeViewName = attrView.Name
|
attributeViewName = attrView.Name
|
||||||
|
|
||||||
|
databaseBlockIDs = treenode.GetMirrorAttrViewBlockIDs(avID)
|
||||||
|
|
||||||
keyValues = attrView.GetBlockKeyValues()
|
keyValues = attrView.GetBlockKeyValues()
|
||||||
// 过滤掉不在视图中的值
|
// 过滤掉不在视图中的值
|
||||||
tmp := map[string]*av.Value{}
|
tmp := map[string]*av.Value{}
|
||||||
|
Loading…
Reference in New Issue
Block a user