mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve av
This commit is contained in:
parent
3afaa2551e
commit
037619368a
2 changed files with 14 additions and 14 deletions
|
@ -192,21 +192,21 @@ type View struct {
|
|||
Gallery *LayoutGallery `json:"gallery,omitempty"` // 卡片布局
|
||||
ItemIDs []string `json:"itemIds,omitempty"` // 项目 ID 列表,用于维护所有项目
|
||||
|
||||
Group *ViewGroup `json:"group,omitempty"` // 分组规则
|
||||
GroupUpdated int64 `json:"groupUpdated"` // 分组规则更新时间戳
|
||||
Groups []*View `json:"groups,omitempty"` // 分组视图列表
|
||||
GroupItemIDs []string `json:"groupItemIds"` // 分组项目 ID 列表,用于维护分组中的所有项目
|
||||
GroupCalc *GroupCalc `json:"groupCalc,omitempty"` // 分组计算规则
|
||||
GroupValue *Value `json:"groupValue,omitempty"` // 分组值
|
||||
GroupFolded bool `json:"groupFolded"` // 分组是否折叠
|
||||
GroupHidden int `json:"groupHidden"` // 分组是否隐藏,0:显示,1:空白隐藏,2:手动隐藏
|
||||
Group *ViewGroup `json:"group,omitempty"` // 分组规则
|
||||
GroupUpdated int64 `json:"groupUpdated"` // 分组规则更新时间戳
|
||||
Groups []*View `json:"groups,omitempty"` // 分组视图列表
|
||||
GroupItemIDs []string `json:"groupItemIds"` // 分组项目 ID 列表,用于维护分组中的所有项目
|
||||
GroupCalc *GroupCalc `json:"groupCalc,omitempty"` // 分组计算规则
|
||||
GroupVal *Value `json:"groupVal,omitempty"` // 分组值
|
||||
GroupFolded bool `json:"groupFolded"` // 分组是否折叠
|
||||
GroupHidden int `json:"groupHidden"` // 分组是否隐藏,0:显示,1:空白隐藏,2:手动隐藏
|
||||
}
|
||||
|
||||
func (view *View) GetGroupValue() string {
|
||||
if nil == view.GroupValue {
|
||||
if nil == view.GroupVal {
|
||||
return ""
|
||||
}
|
||||
return view.GroupValue.String(false)
|
||||
return view.GroupVal.String(false)
|
||||
}
|
||||
|
||||
// GetGroup 获取指定分组 ID 的分组视图。
|
||||
|
|
|
@ -1851,13 +1851,13 @@ func genAttrViewViewGroups(view *av.View, attrView *av.AttributeView) {
|
|||
}
|
||||
|
||||
v.Name = "" // 分组视图的名称在渲染时才填充
|
||||
v.GroupValue = &av.Value{Type: av.KeyTypeText, Text: &av.ValueText{Content: groupValue}}
|
||||
v.GroupVal = &av.Value{Type: av.KeyTypeText, Text: &av.ValueText{Content: groupValue}}
|
||||
if av.KeyTypeSelect == groupKey.Type || av.KeyTypeMSelect == groupKey.Type {
|
||||
v.GroupValue.Text = nil
|
||||
v.GroupValue.Type = av.KeyTypeSelect
|
||||
v.GroupVal.Text = nil
|
||||
v.GroupVal.Type = av.KeyTypeSelect
|
||||
|
||||
opt := groupKey.GetOption(groupVal)
|
||||
v.GroupValue.MSelect = []*av.ValueSelect{{Content: opt.Name, Color: opt.Color}}
|
||||
v.GroupVal.MSelect = []*av.ValueSelect{{Content: opt.Name, Color: opt.Color}}
|
||||
}
|
||||
view.Groups = append(view.Groups, v)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue