mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 导出 PDF 和 Word 时支持覆盖已有文件 https://github.com/siyuan-note/siyuan/issues/5309
This commit is contained in:
parent
c48e04fc16
commit
c819b63fa7
2 changed files with 36 additions and 3 deletions
|
|
@ -121,8 +121,30 @@ const getExportPath = (option: { type: string, id: string }, pdfOption?: PrintTo
|
|||
lockFile(response.data);
|
||||
return;
|
||||
}
|
||||
|
||||
let exportType = "HTML (SiYuan)"
|
||||
let extension = "html"
|
||||
switch (option.type) {
|
||||
case "htmlmd":
|
||||
exportType = "HTML (Markdown)";
|
||||
break;
|
||||
case "word":
|
||||
exportType = "Word .docx";
|
||||
extension = "docx";
|
||||
break;
|
||||
case "pdf":
|
||||
exportType = "PDF";
|
||||
extension = "pdf";
|
||||
break;
|
||||
}
|
||||
|
||||
dialog.showSaveDialog({
|
||||
defaultPath: response.data.rootTitle,
|
||||
title: window.siyuan.languages.export + " " + exportType,
|
||||
defaultPath: response.data.rootTitle + "." + extension,
|
||||
filters: [{
|
||||
name: "Word",
|
||||
extensions: [extension]
|
||||
}],
|
||||
properties: ["showOverwriteConfirmation"],
|
||||
}).then((result: SaveDialogReturnValue) => {
|
||||
if (!result.canceled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue