Compare commits
6 Commits
eb17167feb
...
3fcd0cdb21
Author | SHA1 | Date |
---|---|---|
lyc | 3fcd0cdb21 | |
lyc | 815b2b15cb | |
zhangxuelin | c11b9765e6 | |
zhangxuelin | 964e99c186 | |
zhangxuelin | e1e9f171e0 | |
zhangxuelin | a8f9c828d7 |
|
@ -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 = []
|
||||||
|
|
|
@ -50,7 +50,8 @@ const isOnLoadShow = ref(false) //加载完毕显示
|
||||||
// 传过去的参数
|
// 传过去的参数
|
||||||
const pdfObj = reactive({
|
const pdfObj = reactive({
|
||||||
numberOfPdf: 2, //显示几页
|
numberOfPdf: 2, //显示几页
|
||||||
pdfUrl: getStaticUrl('aaa.pdf', 'user', 'selfFile', true),
|
// pdfUrl: getStaticUrl('aaa.pdf', 'user', 'selfFile', true),//本地
|
||||||
|
pdfUrl: null,
|
||||||
allPageData:[],
|
allPageData:[],
|
||||||
bookId:null,
|
bookId:null,
|
||||||
numPages: 1 //当前页数
|
numPages: 1 //当前页数
|
||||||
|
@ -107,7 +108,7 @@ const switchPageMode = () => {
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
toolState.isPdfWin=true
|
toolState.isPdfWin=true
|
||||||
console.log(toolState.showBoardAll,"c初始")
|
pdfObj.pdfUrl = getStaticUrl(route.query.path, 'user', 'selfFile', true)
|
||||||
textbookId.value = route.query.textbookId
|
textbookId.value = route.query.textbookId
|
||||||
pdfObj.bookId=textbookId.value
|
pdfObj.bookId=textbookId.value
|
||||||
getBookMarkById(textbookId.value).then(res=>{
|
getBookMarkById(textbookId.value).then(res=>{
|
||||||
|
|
|
@ -494,10 +494,10 @@ export default {
|
||||||
async navtoPdf() {
|
async navtoPdf() {
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
||||||
// let path = await this.getBookPathFromServer()
|
let path = await this.getBookPathFromServer()
|
||||||
// console.log(path)
|
path=path.replace(/^.*[\\\/]/, '');
|
||||||
// console.log(this.uploadData.textbookId)
|
// console.log(this.uploadData.textbookId)
|
||||||
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId })
|
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
||||||
},
|
},
|
||||||
// 上课-工具类悬浮
|
// 上课-工具类悬浮
|
||||||
openLesson() {
|
openLesson() {
|
||||||
|
|
Loading…
Reference in New Issue