🎨 Use filtering and sorting of current view settings when exporting database blocks Fix https://github.com/siyuan-note/siyuan/issues/10474

This commit is contained in:
Daniel 2024-02-29 22:49:02 +08:00
parent 2519b62875
commit 10e0061926
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -80,6 +80,10 @@ func ExportAv2CSV(avID string) (zipPath string, err error) {
return
}
// 遵循视图过滤和排序规则 Use filtering and sorting of current view settings when exporting database blocks https://github.com/siyuan-note/siyuan/issues/10474
table.FilterRows(attrView)
table.SortRows()
exportFolder := filepath.Join(util.TempDir, "export", "csv", name)
if err = os.MkdirAll(exportFolder, 0755); nil != err {
logging.LogErrorf("mkdir [%s] failed: %s", exportFolder, err)
@ -2250,6 +2254,10 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
return ast.WalkContinue
}
// 遵循视图过滤和排序规则 Use filtering and sorting of current view settings when exporting database blocks https://github.com/siyuan-note/siyuan/issues/10474
table.FilterRows(attrView)
table.SortRows()
var aligns []int
for range table.Columns {
aligns = append(aligns, 0)