Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve av

Danieldb59bdf562c4
diff --git a/kernel/av/av.go b/kernel/av/av.go
index 2cd073775e..c4e939e73b 100644
--- a/kernel/av/av.go
+++ b/kernel/av/av.go
@@ -197,6 +197,7 @@ type View struct {
Groups []*View `json:"groups,omitempty"` // 分组视图列表
GroupItemIDs []string `json:"groupItemIds"` // 分组项目 ID 列表,用于维护分组中的所有项目
GroupCalc *GroupCalc `json:"groupCalc,omitempty"` // 分组计算规则
+ GroupKey *Key `json:"groupKey,omitempty"` // 分组字段
GroupVal *Value `json:"groupVal,omitempty"` // 分组值
GroupFolded bool `json:"groupFolded"` // 分组是否折叠
GroupHidden int `json:"groupHidden"` // 分组是否隐藏,0:显示,1:空白隐藏,2:手动隐藏
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 76d8e1a25a..2fa4741b5d 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1808,6 +1808,7 @@ func genAttrViewGroups(view *av.View, attrView *av.AttributeView) {
}
v.Name = "" // 分组视图的名称在渲染时才填充
+ v.GroupKey = groupKey
v.GroupVal = &av.Value{Type: av.KeyTypeText, Text: &av.ValueText{Content: groupValue}}
if av.KeyTypeSelect == groupKey.Type || av.KeyTypeMSelect == groupKey.Type {
if opt := groupKey.GetOption(groupValue); nil != opt {