zdg #111

Merged
zhangxuelin merged 3 commits from zdg into main 2024-08-08 17:37:43 +08:00
1 changed files with 9 additions and 2 deletions
Showing only changes of commit 964e99c186 - Show all commits

View File

@ -120,6 +120,13 @@ const renderPage = async (canvasobj) => {
} }
// //
const savaDataStore = () => { const savaDataStore = () => {
if(!toolState.isToolWin){
toolState.isPdfWin=false
toolState.showBoardAll=true //
ipcRenderer.invoke('tool-sphere:reset') //tool
ipcRenderer.send('open-PDF:minimize')
return
}
imgarr.value.forEach((a) => { imgarr.value.forEach((a) => {
if (a.index == 0) { if (a.index == 0) {
a.JSONdata = canvasFabricVue.value.canvas.toJSON() a.JSONdata = canvasFabricVue.value.canvas.toJSON()
@ -170,7 +177,8 @@ const initPdf = async (type = 'default') => {
a.JSONdata = canvas1FabricVue.value.canvas.toJSON() a.JSONdata = canvas1FabricVue.value.canvas.toJSON()
} }
}) })
if (type != 'default') { // +
if (type != 'default' && toolState.isToolWin) {
const nameMap = new Map(canvsStore.pageArr.map((item) => [item.page, item.id])) const nameMap = new Map(canvsStore.pageArr.map((item) => [item.page, item.id]))
// //
let promises = [] let promises = []
@ -274,7 +282,6 @@ const initPdfone = async () => {
} }
onMounted(async () => { onMounted(async () => {
try { try {
console.log(props.pdfObj.pdfUrl)
// canvas // canvas
const pdf = await pdfjsLib.getDocument(props.pdfObj.pdfUrl).promise const pdf = await pdfjsLib.getDocument(props.pdfObj.pdfUrl).promise
numPagesTotal.value = pdf.numPages numPagesTotal.value = pdf.numPages