Merge pull request 'qinqing_dev' (#312) from qinqing_dev into main

Reviewed-on: #312
This commit is contained in:
qinqing 2024-10-11 16:39:10 +08:00
commit eca1a927c0
12 changed files with 170 additions and 44 deletions

File diff suppressed because one or more lines are too long

View File

@ -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);

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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: '/teachClassTask', path: '/teachClassTask',
component: () => import('@/views/classTask/teachClassTask.vue'), component: () => import('@/views/classTask/teachClassTask.vue'),
@ -79,6 +85,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'),

View File

@ -378,7 +378,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()

View File

@ -0,0 +1,35 @@
<template>
<PDF :url="pdfUrl" :isWin="true" v-if="pdfUrl" />
</template>
<script setup>
import { onMounted, ref } from 'vue'
import PDF from '@/components/PdfJs/index.vue'
import { useRoute } from 'vue-router';
import { getStaticUrl } from '@/utils/tool'
const route = useRoute();
const pdfUrl = ref('');
const loadPdfAnimation = (path) => {
console.log('书本地址====',path);
const timer = setTimeout(() => {
pdfUrl.value = path
clearTimeout(timer);
},2000)
}
onMounted(() => {
const bookpath = localStorage.getItem('PDF-LOCAL-PATH')
// const filepath = import.meta.env.VITE_APP_RES_FILE_PATH + bookpath
// const isDev = process.env.NODE_ENV == 'development'
// if (isDev)
// pdfUrl.value = getStaticUrl(bookpath, 'user', 'selfFile', true) //
// else
// pdfUrl.value = getStaticUrl(bookpath, 'user', 'selfFile', true) //线
// const newpath = getStaticUrl(bookpath, 'user', 'selfFile', true)
loadPdfAnimation(bookpath)
// pdfUrl.value = filepath
// console.log('',newpath);
})
</script>
<style>
</style>

View File

@ -155,7 +155,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'
@ -298,8 +298,8 @@ export default {
this.$refs['kjItemRef'+this.activeClass.id][0].openFileWin(this.activeClass); this.$refs['kjItemRef'+this.activeClass.id][0].openFileWin(this.activeClass);
}) })
}, },
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) => {
@ -549,6 +549,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)

View File

@ -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{

View File

@ -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-' },

View File

@ -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': //