mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
🎨 Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964
This commit is contained in:
parent
917a5125af
commit
9ae527c9a5
15 changed files with 34 additions and 23 deletions
|
|
@ -63,8 +63,6 @@ type BaseInstance struct {
|
|||
PageSize int `json:"pageSize"` // 每页项目数
|
||||
ShowIcon bool `json:"showIcon"` // 是否显示字段图标
|
||||
WrapField bool `json:"wrapField"` // 是否换行字段内容
|
||||
Folded bool `json:"folded,omitempty"` // 是否折叠
|
||||
Hidden bool `json:"hidden,omitempty"` // 是否隐藏
|
||||
|
||||
Groups []Viewable `json:"groups,omitempty"` // 分组实例列表
|
||||
GroupCalc *GroupCalc `json:"groupCalc,omitempty"` // 分组计算规则和结果
|
||||
|
|
|
|||
|
|
@ -1373,13 +1373,11 @@ func renderAttributeView(attrView *av.AttributeView, blockID, viewID, query stri
|
|||
}
|
||||
|
||||
if "" == viewID && "" != blockID {
|
||||
if "" != blockID {
|
||||
node, _, getErr := getNodeByBlockID(nil, blockID)
|
||||
if nil != getErr {
|
||||
logging.LogWarnf("get node by block ID [%s] failed: %s", blockID, getErr)
|
||||
} else {
|
||||
viewID = node.IALAttr(av.NodeAttrView)
|
||||
}
|
||||
node, _, getErr := getNodeByBlockID(nil, blockID)
|
||||
if nil != getErr {
|
||||
logging.LogWarnf("get node by block ID [%s] failed: %s", blockID, getErr)
|
||||
} else {
|
||||
viewID = node.IALAttr(av.NodeAttrView)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1438,7 +1436,7 @@ func renderAttributeView(attrView *av.AttributeView, blockID, viewID, query stri
|
|||
}
|
||||
}
|
||||
|
||||
// 如果存在分组的话渲染分组视图视图
|
||||
// 如果存在分组的话渲染分组视图
|
||||
var groups []av.Viewable
|
||||
for _, groupView := range view.Groups {
|
||||
switch groupView.LayoutType {
|
||||
|
|
@ -1619,6 +1617,8 @@ func genAttrViewViewGroups(view *av.View, attrView *av.AttributeView) {
|
|||
|
||||
if defaultGroupName == name {
|
||||
name = fmt.Sprintf(Conf.language(264), groupKey.Name)
|
||||
} else if notInRange == name {
|
||||
name = fmt.Sprintf(Conf.language(265))
|
||||
}
|
||||
v.Name = name
|
||||
view.Groups = append(view.Groups, v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue