zdg #111
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue