mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 16:56:10 +01:00
🎨 Attribute View number column format https://github.com/siyuan-note/siyuan/issues/8764
This commit is contained in:
parent
2baa74fb39
commit
d5bceca2a4
4 changed files with 18 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue