Compare commits

...

4 Commits

Author SHA1 Message Date
zhangxuelin c11b9765e6 Merge pull request 'zdg' (#111) from zdg into main
Reviewed-on: #111
2024-08-08 17:37:41 +08:00
zhangxuelin 964e99c186 不打开工具栏不允许操作数据 2024-08-08 17:02:18 +08:00
zhangxuelin e1e9f171e0 读取本地pdf文件 2024-08-08 16:50:21 +08:00
zhangxuelin a8f9c828d7 更改地址 2024-08-08 14:27:22 +08:00
3 changed files with 15 additions and 6 deletions

View File

@ -120,6 +120,13 @@ const renderPage = async (canvasobj) => {
}
//
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) => {
if (a.index == 0) {
a.JSONdata = canvasFabricVue.value.canvas.toJSON()
@ -170,7 +177,8 @@ const initPdf = async (type = 'default') => {
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]))
//
let promises = []

View File

@ -50,7 +50,8 @@ const isOnLoadShow = ref(false) //加载完毕显示
//
const pdfObj = reactive({
numberOfPdf: 2, //
pdfUrl: getStaticUrl('aaa.pdf', 'user', 'selfFile', true),
// pdfUrl: getStaticUrl('aaa.pdf', 'user', 'selfFile', true),//
pdfUrl: null,
allPageData:[],
bookId:null,
numPages: 1 //
@ -107,7 +108,7 @@ const switchPageMode = () => {
}
onMounted(async () => {
toolState.isPdfWin=true
console.log(toolState.showBoardAll,"c初始")
pdfObj.pdfUrl = getStaticUrl(route.query.path, 'user', 'selfFile', true)
textbookId.value = route.query.textbookId
pdfObj.bookId=textbookId.value
getBookMarkById(textbookId.value).then(res=>{

View File

@ -537,10 +537,10 @@ export default {
async navtoPdf() {
const toolStore = useToolState()
if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
// let path = await this.getBookPathFromServer()
// console.log(path)
let path = await this.getBookPathFromServer()
path=path.replace(/^.*[\\\/]/, '');
// 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() {