mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-08 17:58:50 +01:00
✨ Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964
This commit is contained in:
parent
b77f3907f7
commit
276ea42188
5 changed files with 27 additions and 13 deletions
|
|
@ -178,18 +178,18 @@ type SelectOption struct {
|
|||
|
||||
// View 描述了视图的结构。
|
||||
type View struct {
|
||||
ID string `json:"id"` // 视图 ID
|
||||
Icon string `json:"icon"` // 视图图标
|
||||
Name string `json:"name"` // 视图名称
|
||||
HideAttrViewName bool `json:"hideAttrViewName"` // 是否隐藏属性视图名称
|
||||
Desc string `json:"desc"` // 视图描述
|
||||
Filters []*ViewFilter `json:"filters,omitempty"` // 过滤规则
|
||||
Sorts []*ViewSort `json:"sorts,omitempty"` // 排序规则
|
||||
PageSize int `json:"pageSize"` // 每页条目数
|
||||
|
||||
LayoutType LayoutType `json:"type"` // 当前布局类型
|
||||
Table *LayoutTable `json:"table,omitempty"` // 表格布局
|
||||
Gallery *LayoutGallery `json:"gallery,omitempty"` // 画廊布局
|
||||
ID string `json:"id"` // 视图 ID
|
||||
Icon string `json:"icon"` // 视图图标
|
||||
Name string `json:"name"` // 视图名称
|
||||
HideAttrViewName bool `json:"hideAttrViewName"` // 是否隐藏属性视图名称
|
||||
Desc string `json:"desc"` // 视图描述
|
||||
Filters []*ViewFilter `json:"filters,omitempty"` // 过滤规则
|
||||
Sorts []*ViewSort `json:"sorts,omitempty"` // 排序规则
|
||||
Group *ViewGroup `json:"group,omitempty"` // 分组规则
|
||||
PageSize int `json:"pageSize"` // 每页条目数
|
||||
LayoutType LayoutType `json:"type"` // 当前布局类型
|
||||
Table *LayoutTable `json:"table,omitempty"` // 表格布局
|
||||
Gallery *LayoutGallery `json:"gallery,omitempty"` // 画廊布局
|
||||
}
|
||||
|
||||
// LayoutType 描述了视图布局类型。
|
||||
|
|
@ -585,6 +585,10 @@ func (av *AttributeView) Clone() (ret *AttributeView) {
|
|||
s.Column = keyIDMap[s.Column]
|
||||
}
|
||||
|
||||
if nil != view.Group {
|
||||
view.Group.Field = keyIDMap[view.Group.Field]
|
||||
}
|
||||
|
||||
switch view.LayoutType {
|
||||
case LayoutTypeTable:
|
||||
for _, column := range view.Table.Columns {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue