From ef35d48a7b118f5e2f9c5d36846cd8b63198bee9 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 11 Dec 2022 10:22:13 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=AF=E6=8C=81=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=AD=90=E6=96=87=E6=A1=A3=E5=AF=BC=E5=87=BA=20Word/PDF=20http?= =?UTF-8?q?s://github.com/siyuan-note/siyuan/issues/3219?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/export/index.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index c71145ba7..d2969c9e8 100644 --- a/app/src/protyle/export/index.ts +++ b/app/src/protyle/export/index.ts @@ -37,6 +37,13 @@ export const saveExport = (option: { type: string, id: string }) => { +
@@ -50,8 +57,9 @@ export const saveExport = (option: { type: string, id: string }) => { }); btnsElement[1].addEventListener("click", () => { const removeAssets = (wordDialog.element.querySelector("#removeAssets") as HTMLInputElement).checked; - localStorage.setItem(Constants.LOCAL_EXPORTWORD, removeAssets.toString()); - getExportPath(option, removeAssets); + const mergeSubdocs = (wordDialog.element.querySelector("#mergeSubdocs") as HTMLInputElement).checked; + localStorage.setItem(Constants.LOCAL_EXPORTWORD, JSON.stringify({removeAssets, mergeSubdocs})); + getExportPath(option, removeAssets, mergeSubdocs); wordDialog.destroy(); }); } else { @@ -473,7 +481,7 @@ export const destroyPrintWindow = () => { window.siyuan.printWin.destroy(); }; -const getExportPath = (option: { type: string, id: string }, removeAssets?: boolean) => { +const getExportPath = (option: { type: string, id: string }, removeAssets?: boolean, mergeSubdocs?: boolean) => { fetchPost("/api/block/getBlockInfo", { id: option.id }, (response) => { @@ -516,7 +524,8 @@ const getExportPath = (option: { type: string, id: string }, removeAssets?: bool fetchPost(url, { id: option.id, pdf: option.type === "pdf", - removeAssets, + removeAssets: removeAssets, + merge: mergeSubdocs, savePath }, exportResponse => { if (option.type === "word") {