mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
b46100b29c
commit
f575036b6e
5 changed files with 5 additions and 3 deletions
|
|
@ -50,6 +50,7 @@ type BaseInstanceField struct {
|
||||||
Name string `json:"name"` // 字段名
|
Name string `json:"name"` // 字段名
|
||||||
Type KeyType `json:"type"` // 字段类型
|
Type KeyType `json:"type"` // 字段类型
|
||||||
Icon string `json:"icon"` // 字段图标
|
Icon string `json:"icon"` // 字段图标
|
||||||
|
Wrap bool `json:"wrap"` // 是否换行
|
||||||
Hidden bool `json:"hidden"` // 是否隐藏
|
Hidden bool `json:"hidden"` // 是否隐藏
|
||||||
Desc string `json:"desc"` // 字段描述
|
Desc string `json:"desc"` // 字段描述
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ const (
|
||||||
type ViewGalleryCardField struct {
|
type ViewGalleryCardField struct {
|
||||||
ID string `json:"id"` // 字段 ID
|
ID string `json:"id"` // 字段 ID
|
||||||
|
|
||||||
|
Wrap bool `json:"wrap"` // 是否换行
|
||||||
Hidden bool `json:"hidden"` // 是否隐藏
|
Hidden bool `json:"hidden"` // 是否隐藏
|
||||||
Desc string `json:"desc,omitempty"` // 字段描述
|
Desc string `json:"desc,omitempty"` // 字段描述
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ type Table struct {
|
||||||
type TableColumn struct {
|
type TableColumn struct {
|
||||||
*BaseInstanceField
|
*BaseInstanceField
|
||||||
|
|
||||||
Wrap bool `json:"wrap"` // 是否换行
|
|
||||||
Pin bool `json:"pin"` // 是否固定
|
Pin bool `json:"pin"` // 是否固定
|
||||||
Width string `json:"width"` // 列宽度
|
Width string `json:"width"` // 列宽度
|
||||||
Calc *ColumnCalc `json:"calc"` // 计算
|
Calc *ColumnCalc `json:"calc"` // 计算
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ func changeAttrViewLayout(operation *Operation) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
view.LayoutType = newLayout
|
|
||||||
switch newLayout {
|
switch newLayout {
|
||||||
case av.LayoutTypeTable:
|
case av.LayoutTypeTable:
|
||||||
if nil != view.Table {
|
if nil != view.Table {
|
||||||
|
|
@ -102,6 +101,7 @@ func changeAttrViewLayout(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view.LayoutType = newLayout
|
||||||
err = av.SaveAttributeView(attrView)
|
err = av.SaveAttributeView(attrView)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -1859,6 +1859,7 @@ func (tx *Transaction) doDuplicateAttrViewView(operation *Operation) (ret *TxErr
|
||||||
for _, field := range masterView.Gallery.CardFields {
|
for _, field := range masterView.Gallery.CardFields {
|
||||||
view.Gallery.CardFields = append(view.Gallery.CardFields, &av.ViewGalleryCardField{
|
view.Gallery.CardFields = append(view.Gallery.CardFields, &av.ViewGalleryCardField{
|
||||||
ID: field.ID,
|
ID: field.ID,
|
||||||
|
Wrap: field.Wrap,
|
||||||
Hidden: field.Hidden,
|
Hidden: field.Hidden,
|
||||||
Desc: field.Desc,
|
Desc: field.Desc,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
|
||||||
Name: key.Name,
|
Name: key.Name,
|
||||||
Type: key.Type,
|
Type: key.Type,
|
||||||
Icon: key.Icon,
|
Icon: key.Icon,
|
||||||
|
Wrap: col.Wrap,
|
||||||
Hidden: col.Hidden,
|
Hidden: col.Hidden,
|
||||||
Desc: key.Desc,
|
Desc: key.Desc,
|
||||||
Options: key.Options,
|
Options: key.Options,
|
||||||
|
|
@ -64,7 +65,6 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
|
||||||
Rollup: key.Rollup,
|
Rollup: key.Rollup,
|
||||||
Date: key.Date,
|
Date: key.Date,
|
||||||
},
|
},
|
||||||
Wrap: col.Wrap,
|
|
||||||
Width: col.Width,
|
Width: col.Width,
|
||||||
Pin: col.Pin,
|
Pin: col.Pin,
|
||||||
Calc: col.Calc,
|
Calc: col.Calc,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue