mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 05:40:10 +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 {
|
||||
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 {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
@ -94,8 +94,9 @@ func getAttributeViewPrimaryKeyValues(c *gin.Context) {
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"name": attributeViewName,
|
||||
"rows": rows,
|
||||
"name": attributeViewName,
|
||||
"blockIDs": databaseBlockIDs,
|
||||
"rows": rows,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ func SetDatabaseBlockView(blockID, viewID string) (err error) {
|
||||
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()
|
||||
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
@ -65,6 +65,8 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
|
||||
}
|
||||
attributeViewName = attrView.Name
|
||||
|
||||
databaseBlockIDs = treenode.GetMirrorAttrViewBlockIDs(avID)
|
||||
|
||||
keyValues = attrView.GetBlockKeyValues()
|
||||
// 过滤掉不在视图中的值
|
||||
tmp := map[string]*av.Value{}
|
||||
|
Loading…
Reference in New Issue
Block a user