Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-12-30 21:46:03 +08:00
commit a5faf5c4e9
2 changed files with 15 additions and 1 deletions

View file

@ -198,6 +198,11 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
var keyValues []*av.KeyValues
for _, kv := range attrView.KeyValues {
if av.KeyTypeBlock == kv.Key.Type {
// The primary key are no longer shown in the attribute panel database https://github.com/siyuan-note/siyuan/issues/10027
continue
}
kValues := &av.KeyValues{Key: kv.Key}
for _, v := range kv.Values {
if v.BlockID == blockID {
@ -794,6 +799,11 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
if nil == destVal {
continue
}
if av.KeyTypeNumber == destVal.Type {
destVal.Number.Format = rollupKey.NumberFormat
destVal.Number.FormatNumber()
}
cell.Value.Rollup.Contents = append(cell.Value.Rollup.Contents, destVal.String())
}
case av.KeyTypeRelation: // 渲染关联列
@ -901,7 +911,7 @@ func updateAttributeViewColRollup(operation *Operation) (err error) {
KeyID: operation.KeyID,
}
if nil != operation.Data && "" != operation.Data.(string) {
if nil != operation.Data {
data := operation.Data.(map[string]interface{})
if nil != data["calc"] {
calcData, jsonErr := gulu.JSON.MarshalJSON(data["calc"])

View file

@ -753,6 +753,10 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
if nil == destVal {
continue
}
if av.KeyTypeNumber == destVal.Type {
destVal.Number.Format = rollupKey.NumberFormat
destVal.Number.FormatNumber()
}
cell.Value.Rollup.Contents = append(cell.Value.Rollup.Contents, destVal.String())
}
case av.KeyTypeRelation: // 渲染关联列