mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-22 15:04:07 +01:00
🎨 Database supports setting display field icons https://github.com/siyuan-note/siyuan/issues/15089
This commit is contained in:
parent
921cddd2fa
commit
1991e2b76f
6 changed files with 60 additions and 51 deletions
|
|
@ -223,10 +223,10 @@ func NewTableViewWithBlockKey(blockKeyID string) (view *View, blockKey, selectKe
|
|||
Table: NewLayoutTable(),
|
||||
}
|
||||
blockKey = NewKey(blockKeyID, GetAttributeViewI18n("key"), "", KeyTypeBlock)
|
||||
view.Table.Columns = []*ViewTableColumn{{ID: blockKeyID}}
|
||||
view.Table.Columns = []*ViewTableColumn{{BaseField: &BaseField{ID: blockKeyID}}}
|
||||
|
||||
selectKey = NewKey(ast.NewNodeID(), GetAttributeViewI18n("select"), "", KeyTypeSelect)
|
||||
view.Table.Columns = append(view.Table.Columns, &ViewTableColumn{ID: selectKey.ID})
|
||||
view.Table.Columns = append(view.Table.Columns, &ViewTableColumn{BaseField: &BaseField{ID: selectKey.ID}})
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,14 @@ type BaseLayout struct {
|
|||
PageSize int `json:"pageSize,omitempty"` // 每页条目数
|
||||
}
|
||||
|
||||
// BaseField 描述了字段的基础结构。
|
||||
type BaseField struct {
|
||||
ID string `json:"id"` // 字段 ID
|
||||
Wrap bool `json:"wrap"` // 是否换行
|
||||
Hidden bool `json:"hidden"` // 是否隐藏
|
||||
Desc string `json:"desc,omitempty"` // 字段描述
|
||||
}
|
||||
|
||||
// BaseValue 描述了字段值的基础结构。
|
||||
type BaseValue struct {
|
||||
ID string `json:"id"` // 字段值 ID
|
||||
|
|
|
|||
|
|
@ -82,11 +82,7 @@ const (
|
|||
|
||||
// ViewGalleryCardField 描述了画廊卡片字段的结构。
|
||||
type ViewGalleryCardField struct {
|
||||
ID string `json:"id"` // 字段 ID
|
||||
|
||||
Wrap bool `json:"wrap"` // 是否换行
|
||||
Hidden bool `json:"hidden"` // 是否隐藏
|
||||
Desc string `json:"desc,omitempty"` // 字段描述
|
||||
*BaseField
|
||||
}
|
||||
|
||||
// Gallery 描述了画廊实例的结构。
|
||||
|
|
|
|||
|
|
@ -44,14 +44,11 @@ func NewLayoutTable() *LayoutTable {
|
|||
|
||||
// ViewTableColumn 描述了表格列的结构。
|
||||
type ViewTableColumn struct {
|
||||
ID string `json:"id"` // 列 ID
|
||||
*BaseField
|
||||
|
||||
Wrap bool `json:"wrap"` // 是否换行
|
||||
Hidden bool `json:"hidden"` // 是否隐藏
|
||||
Pin bool `json:"pin"` // 是否固定
|
||||
Width string `json:"width"` // 列宽度
|
||||
Desc string `json:"desc,omitempty"` // 列描述
|
||||
Calc *ColumnCalc `json:"calc,omitempty"` // 计算
|
||||
Pin bool `json:"pin"` // 是否固定
|
||||
Width string `json:"width"` // 列宽度
|
||||
Calc *ColumnCalc `json:"calc,omitempty"` // 计算
|
||||
}
|
||||
|
||||
// Table 描述了表格实例的结构。
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue