mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c767e532df
4 changed files with 18 additions and 12 deletions
|
|
@ -76,7 +76,8 @@ type Key struct {
|
|||
|
||||
// 以下是某些列类型的特有属性
|
||||
|
||||
Options []*KeySelectOption `json:"options,omitempty"` // 选项列表
|
||||
Options []*KeySelectOption `json:"options,omitempty"` // 选项列表
|
||||
NumberFormat NumberFormat `json:"numberFormat"` // 列数字格式化
|
||||
}
|
||||
|
||||
func NewKey(id, name string, keyType KeyType) *Key {
|
||||
|
|
|
|||
|
|
@ -353,7 +353,8 @@ type TableColumn struct {
|
|||
|
||||
// 以下是某些列类型的特有属性
|
||||
|
||||
Options []*KeySelectOption `json:"options,omitempty"` // 选项列表
|
||||
Options []*KeySelectOption `json:"options,omitempty"` // 选项列表
|
||||
NumberFormat NumberFormat `json:"numberFormat"` // 列数字格式化
|
||||
}
|
||||
|
||||
type TableRow struct {
|
||||
|
|
|
|||
|
|
@ -158,15 +158,16 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
}
|
||||
|
||||
ret.Columns = append(ret.Columns, &av.TableColumn{
|
||||
ID: key.ID,
|
||||
Name: key.Name,
|
||||
Type: key.Type,
|
||||
Icon: key.Icon,
|
||||
Options: key.Options,
|
||||
Wrap: col.Wrap,
|
||||
Hidden: col.Hidden,
|
||||
Width: col.Width,
|
||||
Calc: col.Calc,
|
||||
ID: key.ID,
|
||||
Name: key.Name,
|
||||
Type: key.Type,
|
||||
Icon: key.Icon,
|
||||
Options: key.Options,
|
||||
NumberFormat: key.NumberFormat,
|
||||
Wrap: col.Wrap,
|
||||
Hidden: col.Hidden,
|
||||
Width: col.Width,
|
||||
Calc: col.Calc,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -213,7 +214,8 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
tableRow.ID = rowID
|
||||
|
||||
// 格式化数字
|
||||
if av.KeyTypeNumber == tableCell.ValueType && nil != tableCell.Value && nil != tableCell.Value.Number {
|
||||
if av.KeyTypeNumber == tableCell.ValueType && nil != tableCell.Value && nil != tableCell.Value.Number && av.NumberFormatNone != col.NumberFormat {
|
||||
tableCell.Value.Number.Format = col.NumberFormat
|
||||
tableCell.Value.Number.FormatNumber()
|
||||
}
|
||||
|
||||
|
|
@ -773,6 +775,7 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
|
|||
if keyValues.Key.ID == operation.ID {
|
||||
keyValues.Key.Name = operation.Name
|
||||
keyValues.Key.Type = colType
|
||||
keyValues.Key.NumberFormat = av.NumberFormat(operation.Format)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1091,6 +1091,7 @@ type Operation struct {
|
|||
SrcIDs []string `json:"srcIDs"` // 用于将块拖拽到属性视图中
|
||||
Name string `json:"name"` // 属性视图列名
|
||||
Typ string `json:"type"` // 属性视图列类型
|
||||
Format string `json:"format"` // 属性视图列格式化
|
||||
KeyID string `json:"keyID"` // 属性视列 ID
|
||||
RowID string `json:"rowID"` // 属性视图行 ID
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue