mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
✨ Database kanban view https://github.com/siyuan-note/siyuan/issues/8873
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
c72f2b0167
commit
d4c46ebaa2
3 changed files with 36 additions and 0 deletions
|
|
@ -31,6 +31,8 @@ type LayoutKanban struct {
|
|||
FitImage bool `json:"fitImage"` // 是否适应封面图片大小
|
||||
DisplayFieldName bool `json:"displayFieldName"` // 是否显示字段名称
|
||||
|
||||
FillColBackgroundColor bool `json:"fillColBackgroundColor"` // 是否填充列背景颜色
|
||||
|
||||
Fields []*ViewKanbanField `json:"fields"` // 字段
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue