Skip to content

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

:sparkles: Database kanban view https://github.com/siyuan-note/siyuan/issues/8873

Danield4c46ebaa2ae
diff --git a/kernel/av/layout_kanban.go b/kernel/av/layout_kanban.go
index 6fae105c65..c50302a770 100644
--- a/kernel/av/layout_kanban.go
+++ b/kernel/av/layout_kanban.go
@@ -31,6 +31,8 @@ type LayoutKanban struct {
FitImage bool `json:"fitImage"` // 是否适应封面图片大小
DisplayFieldName bool `json:"displayFieldName"` // 是否显示字段名称
+ FillColBackgroundColor bool `json:"fillColBackgroundColor"` // 是否填充列背景颜色
+
Fields []*ViewKanbanField `json:"fields"` // 字段
}
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 09615ab099..deb5520dc1 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -947,6 +947,14 @@ func (tx *Transaction) doSetAttrViewDisplayFieldName(operation *Operation) (ret
return
}
+func (tx *Transaction) doSetAttrViewFillColBackgroundColor(operation *Operation) (ret *TxErr) {
+ err := setAttrViewFillColBackgroundColor(operation)
+ if err != nil {
+ return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}
+ }
+ return
+}
+
func setAttrViewDisplayFieldName(operation *Operation) (err error) {
attrView, err := av.ParseAttributeView(operation.AvID)
if err != nil {
@@ -971,6 +979,30 @@ func setAttrViewDisplayFieldName(operation *Operation) (err error) {
return
}
+func setAttrViewFillColBackgroundColor(operation *Operation) (err error) {
+ attrView, err := av.ParseAttributeView(operation.AvID)
+ if err != nil {
+ return
+ }
+
+ view, err := getAttrViewViewByBlockID(attrView, operation.BlockID)
+ if err != nil {
+ return
+ }
+
+ switch view.LayoutType {
+ case av.LayoutTypeTable:
+ return
+ case av.LayoutTypeGallery:
+ return
+ case av.LayoutTypeKanban:
+ view.Kanban.FillColBackgroundColor = operation.Data.(bool)
+ }
+
+ err = av.SaveAttributeView(attrView)
+ return
+}
+
func (tx *Transaction) doSetAttrViewCardSize(operation *Operation) (ret *TxErr) {
err := setAttrViewCardSize(operation)
if err != nil {
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 6ce2374505..9ffe57e019 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -293,6 +293,8 @@ func performTx(tx *Transaction) (ret *TxErr) {
ret = tx.doSetAttrViewFitImage(op)
case "setAttrViewDisplayFieldName":
ret = tx.doSetAttrViewDisplayFieldName(op)
+ case "setAttrViewFillColBackgroundColor":
+ ret = tx.doSetAttrViewFillColBackgroundColor(op)
case "setAttrViewShowIcon":
ret = tx.doSetAttrViewShowIcon(op)
case "setAttrViewWrapField":