mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-30 04:05:16 +01:00
✨ Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964
This commit is contained in:
parent
46290706b5
commit
a5b3e95926
2 changed files with 9 additions and 5 deletions
|
|
@ -196,6 +196,7 @@ type View struct {
|
|||
GroupName string `json:"groupName,omitempty"` // 分组名称
|
||||
GroupFolded bool `json:"groupFolded,omitempty"` // 分组是否折叠
|
||||
GroupHidden bool `json:"groupHidden,omitempty"` // 分组是否隐藏
|
||||
GroupDefault bool `json:"groupDefault,omitempty"` // 是否为默认分组
|
||||
}
|
||||
|
||||
// LayoutType 描述了视图布局类型。
|
||||
|
|
|
|||
|
|
@ -27,31 +27,34 @@ type ViewGroup struct {
|
|||
Field string `json:"field"` // 分组字段 ID
|
||||
Method GroupMethod `json:"method"` // 分组方式
|
||||
Range *GroupRange `json:"range,omitempty"` // 分组范围
|
||||
Order GroupOrder `json:"order"` // 分组顺序
|
||||
Order GroupOrder `json:"order"` // 分组排序规则
|
||||
}
|
||||
|
||||
// GroupMethod 描述了分组方式。
|
||||
type GroupMethod int
|
||||
|
||||
const (
|
||||
GroupMethodValue GroupMethod = iota // 按值分组
|
||||
GroupMethodRangeNum // 按数字范围分组
|
||||
GroupMethodDateRelative // 按相对日期日期分组
|
||||
GroupMethodDateRelative // 按相对日期分组
|
||||
GroupMethodDateDay // 按天日期分组
|
||||
GroupMethodDateWeek // 按周日期分组
|
||||
GroupMethodDateMonth // 按月日期分组
|
||||
GroupMethodDateYear // 按年日期分组
|
||||
)
|
||||
|
||||
// GroupRange 定义了分组范围的结构。
|
||||
// GroupRange 描述了分组范围的结构。
|
||||
type GroupRange struct {
|
||||
NumStart float64 `json:"numStart"` // 数字范围起始值
|
||||
NumEnd float64 `json:"numEnd"` // 数字范围结束值
|
||||
NumStep float64 `json:"numStep"` // 数字范围步长
|
||||
}
|
||||
|
||||
// GroupOrder 描述了分组排序规则。
|
||||
type GroupOrder string
|
||||
|
||||
const (
|
||||
GroupOrderAsc GroupOrder = "ASC"
|
||||
GroupOrderDesc GroupOrder = "DESC"
|
||||
GroupOrderAsc GroupOrder = "ASC" // 升序
|
||||
GroupOrderDesc GroupOrder = "DESC" // 降序
|
||||
GroupOrderMan GroupOrder = "Man" // 手动排序
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue