mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 Add number type column to Attribute View https://github.com/siyuan-note/siyuan/issues/8690
This commit is contained in:
parent
ae881f0e4b
commit
b0bf3e568c
2 changed files with 6 additions and 6 deletions
|
|
@ -22,13 +22,13 @@ type ColumnType string
|
|||
|
||||
const (
|
||||
ColumnTypeBlock ColumnType = "block"
|
||||
ColumnTypeDate ColumnType = "date"
|
||||
ColumnTypeText ColumnType = "text"
|
||||
ColumnTypeNumber ColumnType = "number"
|
||||
ColumnTypeRelation ColumnType = "relation"
|
||||
ColumnTypeRollup ColumnType = "rollup"
|
||||
ColumnTypeDate ColumnType = "date"
|
||||
ColumnTypeSelect ColumnType = "select"
|
||||
ColumnTypeMSelect ColumnType = "mSelect"
|
||||
ColumnTypeText ColumnType = "text"
|
||||
ColumnTypeRelation ColumnType = "relation"
|
||||
ColumnTypeRollup ColumnType = "rollup"
|
||||
)
|
||||
|
||||
// Column 描述了属性视图的基础结构。
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ func addAttributeViewColumn(name string, typ string, avID string) (err error) {
|
|||
|
||||
colType := av.ColumnType(typ)
|
||||
switch colType {
|
||||
case av.ColumnTypeText:
|
||||
case av.ColumnTypeText, av.ColumnTypeNumber, av.ColumnTypeDate, av.ColumnTypeSelect, av.ColumnTypeMSelect:
|
||||
col := &av.Column{ID: ast.NewNodeID(), Name: name, Type: colType}
|
||||
attrView.Columns = append(attrView.Columns, col)
|
||||
for _, row := range attrView.Rows {
|
||||
|
|
@ -271,7 +271,7 @@ func updateAttributeViewColumn(id, name string, typ string, avID string) (err er
|
|||
|
||||
colType := av.ColumnType(typ)
|
||||
switch colType {
|
||||
case av.ColumnTypeText:
|
||||
case av.ColumnTypeText, av.ColumnTypeNumber, av.ColumnTypeDate, av.ColumnTypeSelect, av.ColumnTypeMSelect:
|
||||
for _, col := range attrView.Columns {
|
||||
if col.ID == id {
|
||||
col.Name = name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue