mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +01:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
67370745b2
commit
d05010a71f
5 changed files with 73 additions and 25 deletions
|
|
@ -189,6 +189,26 @@ type View struct {
|
|||
Gallery *LayoutGallery `json:"gallery,omitempty"` // 画廊布局
|
||||
}
|
||||
|
||||
func (view *View) GetFilters() (ret []*ViewFilter) {
|
||||
switch view.LayoutType {
|
||||
case LayoutTypeTable:
|
||||
return view.Table.Filters
|
||||
case LayoutTypeGallery:
|
||||
return view.Gallery.Filters
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (view *View) GetSorts() (ret []*ViewSort) {
|
||||
switch view.LayoutType {
|
||||
case LayoutTypeTable:
|
||||
return view.Table.Sorts
|
||||
case LayoutTypeGallery:
|
||||
return view.Gallery.Sorts
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// LayoutType 描述了视图布局类型。
|
||||
type LayoutType string
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue