mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-07 09:18:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
5e95593f51
5 changed files with 35 additions and 5 deletions
|
|
@ -523,6 +523,22 @@ func (av *AttributeView) GetCurrentView(viewID string) (ret *View, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) ExistBlock(blockID string) bool {
|
||||
for _, kv := range av.KeyValues {
|
||||
if KeyTypeBlock != kv.Key.Type {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, v := range kv.Values {
|
||||
if v.BlockID == blockID {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (av *AttributeView) GetValue(keyID, blockID string) (ret *Value) {
|
||||
for _, kv := range av.KeyValues {
|
||||
if kv.Key.ID == keyID {
|
||||
|
|
|
|||
|
|
@ -340,9 +340,13 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
|
|||
for _, bID := range relVal.Relation.BlockIDs {
|
||||
destVal := destAv.GetValue(kv.Key.Rollup.KeyID, bID)
|
||||
if nil == destVal {
|
||||
destVal = treenode.GetAttributeViewDefaultValue(ast.NewNodeID(), kv.Key.Rollup.KeyID, blockID, destKey.Type)
|
||||
if destAv.ExistBlock(bID) { // 数据库中存在行但是列值不存在是数据未初始化,这里补一个默认值
|
||||
destVal = treenode.GetAttributeViewDefaultValue(ast.NewNodeID(), kv.Key.Rollup.KeyID, bID, destKey.Type)
|
||||
}
|
||||
if nil == destVal {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if av.KeyTypeNumber == destKey.Type {
|
||||
destVal.Number.Format = destKey.NumberFormat
|
||||
destVal.Number.FormatNumber()
|
||||
|
|
@ -1001,7 +1005,12 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
|
|||
for _, blockID := range relVal.Relation.BlockIDs {
|
||||
destVal := destAv.GetValue(rollupKey.Rollup.KeyID, blockID)
|
||||
if nil == destVal {
|
||||
continue
|
||||
if destAv.ExistBlock(blockID) { // 数据库中存在行但是列值不存在是数据未初始化,这里补一个默认值
|
||||
destVal = treenode.GetAttributeViewDefaultValue(ast.NewNodeID(), rollupKey.Rollup.KeyID, blockID, destKey.Type)
|
||||
}
|
||||
if nil == destVal {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if av.KeyTypeNumber == destKey.Type {
|
||||
destVal.Number.Format = destKey.NumberFormat
|
||||
|
|
|
|||
|
|
@ -1057,6 +1057,7 @@ func processPDFWatermark(pdfCtx *pdfcpu.Context, watermark bool) {
|
|||
return
|
||||
}
|
||||
|
||||
wm.OnTop = true // Export PDF and add watermarks no longer covered by images https://github.com/siyuan-note/siyuan/issues/10818
|
||||
err = pdfCtx.AddWatermarks(nil, wm)
|
||||
if nil != err {
|
||||
logging.LogErrorf("add watermark failed: %s", err)
|
||||
|
|
|
|||
|
|
@ -263,7 +263,6 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
util.ReloadUI()
|
||||
FullReindex()
|
||||
IncSync()
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -805,7 +805,12 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
for _, blockID := range relVal.Relation.BlockIDs {
|
||||
destVal := destAv.GetValue(rollupKey.Rollup.KeyID, blockID)
|
||||
if nil == destVal {
|
||||
continue
|
||||
if destAv.ExistBlock(blockID) { // 数据库中存在行但是列值不存在是数据未初始化,这里补一个默认值
|
||||
destVal = GetAttributeViewDefaultValue(ast.NewNodeID(), rollupKey.Rollup.KeyID, blockID, destKey.Type)
|
||||
}
|
||||
if nil == destVal {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if av.KeyTypeNumber == destKey.Type {
|
||||
destVal.Number.Format = destKey.NumberFormat
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue