新增打开新课件,优化PDF插件查看器
This commit is contained in:
parent
8eff515fd8
commit
6911a92ecb
File diff suppressed because one or more lines are too long
|
@ -2782,7 +2782,8 @@
|
||||||
--editor-toolbar-base-offset:105px;
|
--editor-toolbar-base-offset:105px;
|
||||||
|
|
||||||
--main-color:rgb(12 12 13);
|
--main-color:rgb(12 12 13);
|
||||||
--body-bg-color:rgb(255, 255, 255);
|
/* --body-bg-color:rgb(255, 255, 255); */
|
||||||
|
--body-bg-color:rgb(241, 241, 252);
|
||||||
--progressBar-color:rgb(10 132 255);
|
--progressBar-color:rgb(10 132 255);
|
||||||
--progressBar-bg-color:rgb(221 221 222);
|
--progressBar-bg-color:rgb(221 221 222);
|
||||||
--progressBar-blend-color:rgb(116 177 239);
|
--progressBar-blend-color:rgb(116 177 239);
|
||||||
|
@ -3148,12 +3149,12 @@ body{
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolbarViewer{
|
#toolbarViewer{
|
||||||
width: 300px;
|
width: auto;
|
||||||
height: 32px;
|
height: 60px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
bottom: 15px;
|
bottom: 15px;
|
||||||
left: 50%;
|
right: 2%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
@ -3477,8 +3478,9 @@ body{
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolbarViewerLeft{
|
#toolbarViewerLeft{
|
||||||
padding-inline-start:1px;
|
/* padding-inline-start:1px; 修改样式*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolbarViewerRight{
|
#toolbarViewerRight{
|
||||||
padding-inline-end:1px;
|
padding-inline-end:1px;
|
||||||
}
|
}
|
||||||
|
@ -3693,7 +3695,7 @@ body{
|
||||||
mask-image:var(--findbarButton-next-icon);
|
mask-image:var(--findbarButton-next-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
#previous::before{
|
/* #previous::before{
|
||||||
-webkit-mask-image:var(--toolbarButton-pageUp-icon);
|
-webkit-mask-image:var(--toolbarButton-pageUp-icon);
|
||||||
mask-image:var(--toolbarButton-pageUp-icon);
|
mask-image:var(--toolbarButton-pageUp-icon);
|
||||||
}
|
}
|
||||||
|
@ -3701,8 +3703,27 @@ body{
|
||||||
#next::before{
|
#next::before{
|
||||||
-webkit-mask-image:var(--toolbarButton-pageDown-icon);
|
-webkit-mask-image:var(--toolbarButton-pageDown-icon);
|
||||||
mask-image:var(--toolbarButton-pageDown-icon);
|
mask-image:var(--toolbarButton-pageDown-icon);
|
||||||
|
} */
|
||||||
|
/* 修改样式 */
|
||||||
|
#toolbarViewerLeft .toolbarButton{
|
||||||
|
width: 80px;
|
||||||
|
height: 60px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#toolbarViewerLeft .toolbarButton::before{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
#toolbarViewerLeft .toolbarButton span{
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.toolpageBtn{
|
||||||
|
height: 60px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#zoomOut::before{
|
#zoomOut::before{
|
||||||
-webkit-mask-image:var(--toolbarButton-zoomOut-icon);
|
-webkit-mask-image:var(--toolbarButton-zoomOut-icon);
|
||||||
mask-image:var(--toolbarButton-zoomOut-icon);
|
mask-image:var(--toolbarButton-zoomOut-icon);
|
||||||
|
|
|
@ -44,11 +44,11 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||||
<div id="toolbarSidebar">
|
<div id="toolbarSidebar">
|
||||||
<div id="toolbarSidebarLeft">
|
<div id="toolbarSidebarLeft">
|
||||||
<div id="sidebarViewButtons" class="splitToolbarButton toggled" role="radiogroup">
|
<div id="sidebarViewButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||||
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
|
|
||||||
<span data-l10n-id="pdfjs-thumbs-button-label">Thumbnails</span>
|
|
||||||
</button>
|
|
||||||
<button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="pdfjs-document-outline-button" role="radio" aria-checked="false" aria-controls="outlineView">
|
<button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="pdfjs-document-outline-button" role="radio" aria-checked="false" aria-controls="outlineView">
|
||||||
<span data-l10n-id="pdfjs-document-outline-button-label">Document Outline</span>
|
<span data-l10n-id="pdfjs-document-outline-button-label">Document Outline</span>
|
||||||
|
</button>
|
||||||
|
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
|
||||||
|
<span data-l10n-id="pdfjs-thumbs-button-label">Thumbnails</span>
|
||||||
</button>
|
</button>
|
||||||
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="pdfjs-attachments-button" role="radio" aria-checked="false" aria-controls="attachmentsView">
|
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="pdfjs-attachments-button" role="radio" aria-checked="false" aria-controls="attachmentsView">
|
||||||
<span data-l10n-id="pdfjs-attachments-button-label">Attachments</span>
|
<span data-l10n-id="pdfjs-attachments-button-label">Attachments</span>
|
||||||
|
@ -273,14 +273,17 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||||
<div id="toolbarContainer">
|
<div id="toolbarContainer">
|
||||||
<div id="toolbarViewer">
|
<div id="toolbarViewer">
|
||||||
<div id="toolbarViewerLeft">
|
<div id="toolbarViewerLeft">
|
||||||
<button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
|
<button id="sidebarToggle" class="toolbarButton" tabindex="11" aria-expanded="false" aria-controls="sidebarContainer">
|
||||||
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
|
<span>目录</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="toolbarButtonSpacer"></div>
|
<!-- <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
|
||||||
<button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
|
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
|
||||||
|
</button> -->
|
||||||
|
<!-- <div class="toolbarButtonSpacer"></div> -->
|
||||||
|
<button style="display: none;" id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
|
||||||
<span data-l10n-id="pdfjs-findbar-button-label">Find</span>
|
<span data-l10n-id="pdfjs-findbar-button-label">Find</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="splitToolbarButton hiddenSmallView">
|
<div class="splitToolbarButton toolpageBtn">
|
||||||
<button class="toolbarButton" title="Previous Page" id="previous" tabindex="13" data-l10n-id="pdfjs-previous-button">
|
<button class="toolbarButton" title="Previous Page" id="previous" tabindex="13" data-l10n-id="pdfjs-previous-button">
|
||||||
<span data-l10n-id="pdfjs-previous-button-label">Previous</span>
|
<span data-l10n-id="pdfjs-previous-button-label">Previous</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -289,12 +292,12 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||||
<span data-l10n-id="pdfjs-next-button-label">Next</span>
|
<span data-l10n-id="pdfjs-next-button-label">Next</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<span class="loadingInput start">
|
<span class="loadingInput start" style="display: none;">
|
||||||
<input type="number" id="pageNumber" class="toolbarField" title="Page" value="1" min="1" tabindex="15" data-l10n-id="pdfjs-page-input" autocomplete="off">
|
<input type="number" id="pageNumber" class="toolbarField" title="Page" value="1" min="1" tabindex="15" data-l10n-id="pdfjs-page-input" autocomplete="off">
|
||||||
</span>
|
</span>
|
||||||
<span id="numPages" class="toolbarLabel"></span>
|
<span id="numPages" class="toolbarLabel" style="display: none;"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="toolbarViewerRight">
|
<div id="toolbarViewerRight" style="display: none;">
|
||||||
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||||
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
<button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
|
||||||
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
|
||||||
|
|
|
@ -7407,7 +7407,8 @@ class PDFSidebar {
|
||||||
this.isInitialViewSet = false;
|
this.isInitialViewSet = false;
|
||||||
this.isInitialEventDispatched = false;
|
this.isInitialEventDispatched = false;
|
||||||
this.#hideUINotification(true);
|
this.#hideUINotification(true);
|
||||||
this.switchView(SidebarView.THUMBS);
|
// this.switchView(SidebarView.THUMBS);默认开启书签模式
|
||||||
|
this.switchView(SidebarView.OUTLINE);
|
||||||
this.outlineButton.disabled = false;
|
this.outlineButton.disabled = false;
|
||||||
this.attachmentsButton.disabled = false;
|
this.attachmentsButton.disabled = false;
|
||||||
this.layersButton.disabled = false;
|
this.layersButton.disabled = false;
|
||||||
|
@ -13095,12 +13096,16 @@ const PDFViewerApplication = {
|
||||||
this.pdfViewer.scrollMode = scroll;
|
this.pdfViewer.scrollMode = scroll;
|
||||||
}
|
}
|
||||||
if (isValidSpreadMode(spread)) {
|
if (isValidSpreadMode(spread)) {
|
||||||
this.pdfViewer.spreadMode = spread;
|
//默认双页
|
||||||
|
// this.pdfViewer.spreadMode = spread;
|
||||||
|
this.pdfViewer.spreadMode = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.isInitialViewSet = true;
|
this.isInitialViewSet = true;
|
||||||
this.pdfSidebar?.setInitialView(sidebarView);
|
this.pdfSidebar?.setInitialView(sidebarView);
|
||||||
setViewerModes(scrollMode, spreadMode);
|
//默认双页
|
||||||
|
// setViewerModes(scrollMode, spreadMode);
|
||||||
|
setViewerModes(scrollMode, 1);
|
||||||
if (this.initialBookmark) {
|
if (this.initialBookmark) {
|
||||||
setRotation(this.initialRotation);
|
setRotation(this.initialRotation);
|
||||||
delete this.initialRotation;
|
delete this.initialRotation;
|
||||||
|
|
|
@ -12,15 +12,20 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
isWin: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
/**pdf文件地址 */
|
/**pdf文件地址 */
|
||||||
const pdfUrl = ref('');
|
const pdfUrl = ref('');
|
||||||
/**pdfjs文件地址 */
|
/**pdfjs文件地址 */
|
||||||
const fileUrl = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //本地
|
const fileUrl = props.isWin ? props.url : getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file=" //本地
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
/** 将传入的pdf地址进行编码,防止中文识别错误 */
|
||||||
pdfUrl.value = fileUrl + encodeURIComponent(props.url)
|
if(props.isWin) pdfUrl.value = fileUrl
|
||||||
|
else pdfUrl.value = fileUrl + encodeURIComponent(props.url) + '#pageMode=outline'
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,12 @@ export const constantRoutes = [
|
||||||
// component: ()=> import('../login/index.vue'),
|
// component: ()=> import('../login/index.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/fullscreenpdf',
|
||||||
|
component: () => import('@/views/fullScreenPdf/index.vue'),
|
||||||
|
name: 'fullscreenpdf',
|
||||||
|
meta: {title: '全屏显示PDF'}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
@ -74,6 +80,7 @@ export const constantRoutes = [
|
||||||
name: 'testpdf',
|
name: 'testpdf',
|
||||||
meta: {title: '测试PDF'}
|
meta: {title: '测试PDF'}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/classReserv',
|
path: '/classReserv',
|
||||||
component: () => import('@/views/classManage/classReserv.vue'),
|
component: () => import('@/views/classManage/classReserv.vue'),
|
||||||
|
|
|
@ -325,7 +325,22 @@ export const toLinkWeb = (path) => {
|
||||||
cookieData: { ...config }
|
cookieData: { ...config }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description 外部跳转-web网页
|
||||||
|
* @param {*} path
|
||||||
|
* @param {*} params
|
||||||
|
*/
|
||||||
|
export const toRoter = (path) => {
|
||||||
|
const config = baseConfig()
|
||||||
|
// console.log(config)
|
||||||
|
// const fullPath = config.url + path
|
||||||
|
// 通知主进程
|
||||||
|
ipcRenderer.send('openWindow', {
|
||||||
|
key: `win-${Date.now()}`,
|
||||||
|
fullPath: path,
|
||||||
|
cookieData: { ...config }
|
||||||
|
})
|
||||||
|
}
|
||||||
// const taskHandles = () => {
|
// const taskHandles = () => {
|
||||||
// // 设置任务栏上下文菜单
|
// // 设置任务栏上下文菜单
|
||||||
// const contextMenu = new Remote.Menu()
|
// const contextMenu = new Remote.Menu()
|
||||||
|
|
|
@ -187,7 +187,7 @@ import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
||||||
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
||||||
import SetHomework from '@/components/set-homework/index.vue'
|
import SetHomework from '@/components/set-homework/index.vue'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
import { createWindow, sessionStore } from '@/utils/tool'
|
import { createWindow, sessionStore, getAppInstallUrl } from '@/utils/tool'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
|
import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
|
||||||
import { getClassInfo, getSelfReserv } from '@/api/classManage'
|
import { getClassInfo, getSelfReserv } from '@/api/classManage'
|
||||||
|
@ -330,8 +330,8 @@ export default {
|
||||||
this.openLesson(res.data.id);
|
this.openLesson(res.data.id);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getBookPathFromServer() {
|
getBookPathFromServer(path) {
|
||||||
let fileName = this.curBookPath
|
let fileName = path ? path : this.curBookPath
|
||||||
if (!fileName) return
|
if (!fileName) return
|
||||||
fileName = fileName.replace('.txt', '.pdf')
|
fileName = fileName.replace('.txt', '.pdf')
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -575,6 +575,9 @@ export default {
|
||||||
if (this.currentNode.id === data.node.id) return
|
if (this.currentNode.id === data.node.id) return
|
||||||
this.curBookImg = data.textBook.curBookImg
|
this.curBookImg = data.textBook.curBookImg
|
||||||
this.curBookPath = data.textBook.curBookPath
|
this.curBookPath = data.textBook.curBookPath
|
||||||
|
const path = await this.getBookPathFromServer(data.textBook.curBookPath)
|
||||||
|
const localpath = getAppInstallUrl('pdfjs-dist/web/viewer.html', 'user', '\\out\\renderer', true) + "?file="
|
||||||
|
localStorage.setItem('PDF-LOCAL-PATH',localpath + encodeURIComponent(import.meta.env.VITE_APP_RES_FILE_PATH + path))
|
||||||
this.checkFileList = []
|
this.checkFileList = []
|
||||||
this.currentWorkList = []
|
this.currentWorkList = []
|
||||||
let cata = parseCataByNode(data.node)
|
let cata = parseCataByNode(data.node)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
|
||||||
</div>
|
</div>
|
||||||
<div class="stand-head-right">
|
<div class="stand-head-right">
|
||||||
<div class="stand-head-right-tit">{{booktitle}}</div>
|
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName: ''}}</div>
|
||||||
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
|
||||||
<div class="stand-head-right-row">
|
<div class="stand-head-right-row">
|
||||||
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
<div class="stand-head-right-row-time">更新2024.9.10</div>
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
<div class="booklist">
|
<div class="booklist">
|
||||||
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
|
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
|
||||||
<el-image class="bookimg" :src="item.avartar" />
|
<el-image class="bookimg" :src="item.avartar" />
|
||||||
<div class="bookname">{{item.fileurl.replace('.txt', '')}}</div>
|
<div class="bookname">{{item.bookName}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -84,11 +84,13 @@ import PDF from '@/components/PdfJs/index.vue'
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import useResoureStore from '../resource/store'
|
import useResoureStore from '../resource/store'
|
||||||
import { listEvaluationclue } from '@/api/teaching/classwork'
|
import { listEvaluationclue } from '@/api/teaching/classwork'
|
||||||
import { uploadServer, getJSONFile } from '@/utils/common'
|
// import { uploadServer, getJSONFile } from '@/utils/common'
|
||||||
import { ElNotification } from 'element-plus'
|
import { ElNotification } from 'element-plus'
|
||||||
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
import ChooseTextbook from "@/components/choose-textbook/index.vue";
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
import { listEvaluation } from '@/api/classManage/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
|
import { useGetSubject } from '@/hooks/useGetSubject'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const sourceStore = useResoureStore()
|
const sourceStore = useResoureStore()
|
||||||
// import { getStaticUrl } from '@/utils/tool'
|
// import { getStaticUrl } from '@/utils/tool'
|
||||||
|
@ -105,7 +107,6 @@ const headref = ref(null);
|
||||||
const searchref = ref(null);
|
const searchref = ref(null);
|
||||||
const listHeight = ref(0);
|
const listHeight = ref(0);
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const booktitle = ref('');
|
|
||||||
const bookInfo = ref(null);
|
const bookInfo = ref(null);
|
||||||
const booksel = ref(0);
|
const booksel = ref(0);
|
||||||
const bookList = ref([])
|
const bookList = ref([])
|
||||||
|
@ -248,31 +249,43 @@ const getAllSubject = async () => {
|
||||||
const dataList = [];
|
const dataList = [];
|
||||||
rows && rows.map((item,idx) => {
|
rows && rows.map((item,idx) => {
|
||||||
if(item.fileurl !== ''){
|
if(item.fileurl !== ''){
|
||||||
dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar})
|
dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: item.fileurl.replace('.txt','')})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
bookList.value = dataList
|
bookList.value = dataList
|
||||||
bookInfo.value = {...dataList[0],avartar: dataList[0].avartar}
|
const { id, rootid } = sessionStore.get('subject.curNode')
|
||||||
booktitle.value = dataList[0].fileurl.replace('.txt','')
|
if(id && rootid){
|
||||||
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + dataList[0].fileurl.replace('.txt','.pdf')
|
const idx = dataList.findIndex(item => item.id === id && item.rootid === rootid)
|
||||||
|
let filePath = import.meta.env.VITE_APP_RES_FILE_PATH;
|
||||||
|
if(idx > -1){
|
||||||
|
bookInfo.value = {...dataList[idx]}
|
||||||
|
filePath += dataList[idx].fileurl.replace('.txt','.pdf')
|
||||||
|
}else{
|
||||||
|
bookInfo.value = {...dataList[0]}
|
||||||
|
filePath += dataList[0].fileurl.replace('.txt','.pdf')
|
||||||
|
}
|
||||||
await loadPdfAnimation(filePath)
|
await loadPdfAnimation(filePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
const bookChange = async (item, idx) => {
|
const bookChange = async (item, idx) => {
|
||||||
booksel.value = idx
|
booksel.value = idx
|
||||||
bookInfo.value = {...item}
|
bookInfo.value = {...item}
|
||||||
booktitle.value = item.fileurl.replace('.txt','')
|
|
||||||
pdfUrl.value = '';
|
pdfUrl.value = '';
|
||||||
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + item.fileurl.replace('.txt','.pdf')
|
||||||
await loadPdfAnimation(filepath)
|
await loadPdfAnimation(filepath)
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
}
|
}
|
||||||
const loadPdfAnimation = (path) => {
|
const loadPdfAnimation = (path) => {
|
||||||
|
console.log('书本地址====',path);
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
pdfUrl.value = path
|
pdfUrl.value = path
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
},2000)
|
},2000)
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
await useGetSubject();
|
||||||
await getAllSubject();
|
await getAllSubject();
|
||||||
if(cardref.value && headref.value){
|
if(cardref.value && headref.value){
|
||||||
const cardH = cardref.value.offsetHeight;
|
const cardH = cardref.value.offsetHeight;
|
||||||
|
@ -423,13 +436,18 @@ onMounted(async () => {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
&-tit{
|
&-tit{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 44px;
|
||||||
|
line-height: 22px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
white-space: nowrap;
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
color: #3b3b3b;
|
color: #3b3b3b;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
padding-right: 30px;
|
||||||
}
|
}
|
||||||
&-icon{
|
&-icon{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -443,7 +461,6 @@ onMounted(async () => {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 12px;
|
|
||||||
&-time{
|
&-time{
|
||||||
font-size: var(--el-font-size-extra-small);
|
font-size: var(--el-font-size-extra-small);
|
||||||
color: var(--el-color-info-rgb);
|
color: var(--el-color-info-rgb);
|
||||||
|
@ -537,9 +554,10 @@ onMounted(async () => {
|
||||||
width: 130px;
|
width: 130px;
|
||||||
height: 180px;
|
height: 180px;
|
||||||
}
|
}
|
||||||
.name{
|
.bookname{
|
||||||
|
height: 60px;
|
||||||
|
line-height: 20px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #3b3b3b;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item:hover{
|
.item:hover{
|
||||||
|
|
|
@ -38,7 +38,7 @@ import { computed, defineProps, ref, reactive, watchEffect, onMounted } from 'vu
|
||||||
import homework from './homework.vue';
|
import homework from './homework.vue';
|
||||||
|
|
||||||
// 功能说明:侧边-工具栏
|
// 功能说明:侧边-工具栏
|
||||||
const colors = ['#00f389', '#ff7f00', '#ffff00', '#409EFF', '#00baff', '#13b189', '#F56C6C']
|
const colors = ['#409EFF','#00f389', '#ff7f00', '#ffff00', '#00baff', '#13b189', '#F56C6C']
|
||||||
const emit = defineEmits(['update:modelValue','change'])
|
const emit = defineEmits(['update:modelValue','change'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: { // 是否显示
|
modelValue: { // 是否显示
|
||||||
|
@ -48,6 +48,7 @@ const props = defineProps({
|
||||||
data: { // 数据
|
data: { // 数据
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [
|
default: () => [
|
||||||
|
{ label: '课件', prop: 'book', isExtra: true, icon: 'icon--kejian' },
|
||||||
{ label: '资源', prop: 'resource', icon: 'icon-kechengziyuan1' },
|
{ label: '资源', prop: 'resource', icon: 'icon-kechengziyuan1' },
|
||||||
{ label: '互动', prop: 'interact', icon: 'icon-hudong' },
|
{ label: '互动', prop: 'interact', icon: 'icon-hudong' },
|
||||||
{ label: '窗口', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' },
|
{ label: '窗口', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' },
|
||||||
|
|
|
@ -52,7 +52,7 @@ import imChat from './components/imChat.vue' // im-chat-子组件
|
||||||
import vDrag from './directive/drag' // 自定义指令-拖拽
|
import vDrag from './directive/drag' // 自定义指令-拖拽
|
||||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||||
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
||||||
import { ipcMsgSend, ipcMain, sessionStore } from '@/utils/tool' // 相关工具
|
import { ipcMsgSend, ipcMain, sessionStore, toRoter } from '@/utils/tool' // 相关工具
|
||||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息头-相关定义(nuem)
|
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息头-相关定义(nuem)
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -62,6 +62,7 @@ const isDrag = ref(false) // 开始拖拽
|
||||||
const dragtime = ref(0) // 拖拽时间-计算点击还是拖动
|
const dragtime = ref(0) // 拖拽时间-计算点击还是拖动
|
||||||
const isShow = ref(false) // 是否显示-画板
|
const isShow = ref(false) // 是否显示-画板
|
||||||
const isOver = ref(false) // 是否下课
|
const isOver = ref(false) // 是否下课
|
||||||
|
const isOpenBook = ref(false)
|
||||||
const toolStore = useToolState() // 状态管理
|
const toolStore = useToolState() // 状态管理
|
||||||
const boardVueRef=ref(null) // 画板ref
|
const boardVueRef=ref(null) // 画板ref
|
||||||
const upvoteRef = ref(null) // 点赞 ref
|
const upvoteRef = ref(null) // 点赞 ref
|
||||||
|
@ -70,6 +71,7 @@ const classObj = reactive({ // 课程相关
|
||||||
id: route.query.reservId, // 课程id
|
id: route.query.reservId, // 课程id
|
||||||
data: {} // 课程信息
|
data: {} // 课程信息
|
||||||
})
|
})
|
||||||
|
const bookInfo = ref(null)
|
||||||
const msgIds = [] // 消息id
|
const msgIds = [] // 消息id
|
||||||
const electron = window.electron // electron
|
const electron = window.electron // electron
|
||||||
const btnList = [ // 工具栏按钮列表
|
const btnList = [ // 工具栏按钮列表
|
||||||
|
@ -88,6 +90,7 @@ onMounted(async() => {
|
||||||
window.test1 = toolStore
|
window.test1 = toolStore
|
||||||
getClassInfo() // 获取课堂详情 ex3
|
getClassInfo() // 获取课堂详情 ex3
|
||||||
resetStatus() // 开启重置状态-监听
|
resetStatus() // 开启重置状态-监听
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// ==== 方法 ===
|
// ==== 方法 ===
|
||||||
|
@ -204,6 +207,16 @@ const sideMouse = e => {
|
||||||
const sideChange = async o => {
|
const sideChange = async o => {
|
||||||
// console.log(o)
|
// console.log(o)
|
||||||
switch(o.prop) {
|
switch(o.prop) {
|
||||||
|
case 'book':
|
||||||
|
if(isOpenBook.value) {
|
||||||
|
isOpenBook.value = false
|
||||||
|
ElMessage.info('已经打开课本了哦')
|
||||||
|
}else {
|
||||||
|
// createWindow('fullScreen-PDF',{url: '/fullscreenpdf'})
|
||||||
|
toRoter(`${process.env['ELECTRON_RENDERER_URL']}/#/fullscreenpdf`)
|
||||||
|
isOpenBook.value = true
|
||||||
|
}
|
||||||
|
break
|
||||||
case 'resource': // 资源
|
case 'resource': // 资源
|
||||||
break
|
break
|
||||||
case 'interact': // 互动
|
case 'interact': // 互动
|
||||||
|
|
Loading…
Reference in New Issue