| | |
| | | @click="goPlay(item)" |
| | | size="20" |
| | | class="icon hover" |
| | | v-if="item.resourceType != '视频' && item.resourceType != '音频' && item.resourceType != '图片'" |
| | | v-if=" |
| | | item.resourceType != '视频' && |
| | | item.resourceType != '音频' && |
| | | item.resourceType != '图片' |
| | | " |
| | | > |
| | | <View /> |
| | | </el-icon> |
| | |
| | | <!-- 画笔画布 --> |
| | | <div class="canvas-box" v-show="canvasShow"> |
| | | <canvas id="canvasRef" :width="canvasWith" :height="canvasheight"></canvas> |
| | | </div> |
| | | <!-- 番茄闹钟组件 --> |
| | | <div |
| | | class="watch-box" |
| | | v-if="pomodoroRef && pomodoroRef.isShow" |
| | | :style="{ top:position.x + 'px', left:position.y + 'px'}" |
| | | > |
| | | <p @mousedown.native="mouseDown">{{ formatTime(pomodoroRef.pageData.currentTime) }}</p> |
| | | <span @click="()=> pomodoroRef.isRuning ? pomodoroRef.pauseFun() : pomodoroRef.startFun()">{{pomodoroRef.isRuning ? '暂停': '开始'}}</span> |
| | | <span @click="pomodoroRef.resetFun" >重置</span> |
| | | <span @click="pomodoroRef.handleRestFun(false)">长休息</span> |
| | | <span @click="pomodoroRef.handleRestFun(true)">短休息</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <div class="wordBox" v-if="resourType == 'PDF' || resourType == 'PPT' || resourType == 'WORD'"> |
| | | <div |
| | | v-for="(item, index) in showData" |
| | | :key="index" |
| | | class="pdfItem" |
| | | :page="index + 1" |
| | | > |
| | | <img :src="item.showSrc" alt="" style="min-height: 550px" loading="lazy" /> |
| | | <el-divider content-position="center"> 第 {{ index + 1 }} 页 </el-divider> |
| | | </div> |
| | | </div> |
| | | <div v-for="(item, index) in showData" :key="index" class="pdfItem" :page="index + 1"> |
| | | <img :src="item.showSrc" alt="" style="min-height: 550px" loading="lazy" /> |
| | | <el-divider content-position="center"> 第 {{ index + 1 }} 页 </el-divider> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <div class="audioBox" v-show="false"> |
| | | <!-- <video controls controlslist="nodownload" :src="testVideo"></video> --> |
| | |
| | | </el-dialog> |
| | | <el-dialog title="模型工具" align-center v-model="modelTool" width="80%" class="myDialogs"> |
| | | <div class="wendabox"> |
| | | <iframe src='https://adjam93.github.io/threejs-model-viewer/#' frameborder="0"></iframe> |
| | | <iframe src="https://adjam93.github.io/threejs-model-viewer/#" frameborder="0"></iframe> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog title="生词卡片" align-center v-model="shengciVisble" width="800" class="myDialogs"> |
| | |
| | | <wrongQuestion /> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="公式编辑" |
| | | align-center |
| | | v-model="formulaDialog" |
| | | class="myDialogs" |
| | | > |
| | | <el-dialog title="公式编辑" align-center v-model="formulaDialog" class="myDialogs"> |
| | | <div class="wendabox"> |
| | | <formula /> |
| | | </div> |
| | |
| | | <!-- <calculatorNew></calculatorNew> --> |
| | | <iframe src="https://www.geogebra.org/scientific" frameborder="0" class="iframe-box"></iframe> |
| | | </el-dialog> |
| | | <!-- 番茄闹钟 --> |
| | | <!-- <pomodoro ref="pomodoroRef" /> --> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import examination from '@/views/examination/index.vue' |
| | | import pomodoro from '@/views/components/pomodoro.vue' |
| | | import { ref, reactive, watch, onMounted, onBeforeMount, onBeforeUnmount, inject } from 'vue' |
| | | import { useRouter, useRoute } from 'vue-router' |
| | | import { ElMessage, ElMessageBox, valueEquals } from 'element-plus' |
| | | import { useFormatData } from '@/hooks/public' |
| | | import useClipboard from 'vue-clipboard3' |
| | | const { toClipboard } = useClipboard() |
| | | const { formatTime } = useFormatData() |
| | | const MG: any = inject('MG') |
| | | const toolClass = inject('toolClass') |
| | | //获取路由器 |
| | |
| | | window.qiankunState.initTestBook(localStorage.getItem('bookId') + '', tryPageCount.value) |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | // 定义父层方法 |
| | |
| | | // if (window.qiankunState && window.qiankunState.getAnswers){ |
| | | // window.qiankunState.getAnswers(localStorage.getItem("")) |
| | | // } |
| | | |
| | | }) |
| | | |
| | | onBeforeUnmount(() => { |
| | |
| | | } |
| | | MG.store.getProductList(obj).then((res) => { |
| | | console.log(res.datas, '图书信息') |
| | | if (!res.datas.length) return |
| | | bookInfo.value = res.datas[0] |
| | | if (res.datas[0].purchasedSaleMethodIdList.includes(res.datas[0].defaultSaleMethodId)) { |
| | | isBuy.value = true |
| | |
| | | icon: fanqiezhong, |
| | | isShow: bookConfig.value.textbookComponents.indexOf('E4DC9777') > -1 |
| | | } |
| | | // { |
| | | // name: '番茄闹钟', |
| | | // icon: fanqiezhong, |
| | | // isShow: true |
| | | // } |
| | | ] |
| | | floatingToolBox = [ |
| | | { |
| | |
| | | if (localStorage.getItem('chapter') && localStorage.getItem('startPage')) { |
| | | let chapter = Number(localStorage.getItem('chapter')) |
| | | let start = Number(localStorage.getItem('startPage')) |
| | | |
| | | |
| | | if (window.qiankunState && window.qiankunState.gotoPage) { |
| | | window.qiankunState.gotoPage(chapter,start) |
| | | window.qiankunState.gotoPage(chapter, start) |
| | | localStorage.removeItem('chapter') |
| | | localStorage.removeItem('startPage') |
| | | } |
| | |
| | | }) |
| | | .catch(function (error) { |
| | | listLoading.value = false |
| | | |
| | | }) |
| | | } |
| | | const defaultProps = { |
| | |
| | | if (resItem1.resourceType == classifySelectList.value[0].title) { |
| | | resourceDataList.value.push(resItem1) |
| | | } |
| | | if(activeClassify.value == 'other'){ |
| | | if (resItem1.resourceType != '图片' && resItem1.resourceType != '视频' && resItem1.resourceType != '音频') { |
| | | if (activeClassify.value == 'other') { |
| | | if ( |
| | | resItem1.resourceType != '图片' && |
| | | resItem1.resourceType != '视频' && |
| | | resItem1.resourceType != '音频' |
| | | ) { |
| | | resourceDataList.value.push(resItem1) |
| | | } |
| | | } |
| | |
| | | if (resItem1.resourceType == classifySelectList.value[0].title) { |
| | | resourceDataList.value.push(resItem1) |
| | | } |
| | | if(activeClassify.value == 'other'){ |
| | | if (resItem1.resourceType != '图片' && resItem1.resourceType != '视频' && resItem1.resourceType != '音频') { |
| | | if (activeClassify.value == 'other') { |
| | | if ( |
| | | resItem1.resourceType != '图片' && |
| | | resItem1.resourceType != '视频' && |
| | | resItem1.resourceType != '音频' |
| | | ) { |
| | | resourceDataList.value.push(resItem1) |
| | | } |
| | | } |
| | |
| | | const sceneUrl = ref() |
| | | const showData = ref() |
| | | const goPlay = (data, index) => { |
| | | console.log(data.resourceType,123) |
| | | console.log(data.resourceType, 123) |
| | | resourType.value = data.resourceType |
| | | if (data.resourceType == '视频') { |
| | | if (data.md5) { |
| | |
| | | } |
| | | autoPlay() |
| | | } else if (data.resourceType == '模型') { |
| | | console.log(data,222) |
| | | console.log(data, 222) |
| | | let file = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 |
| | | console.log(file.exd,777) |
| | | console.log(file.exd, 777) |
| | | const ctx = 'https://jsek.bnuic.com' |
| | | if (data.md5) { |
| | | sceneUrl.value = 'https://jsek.bnuic.com/books/book/civilAviation/static/modelView/index.html?md5=' + data.md5 + '&name=je' + '&domain=' + ctx + '&exd=obj' + '&target=iframe' |
| | | sceneUrl.value = |
| | | 'https://jsek.bnuic.com/books/book/civilAviation/static/modelView/index.html?md5=' + |
| | | data.md5 + |
| | | '&name=je' + |
| | | '&domain=' + |
| | | ctx + |
| | | '&exd=obj' + |
| | | '&target=iframe' |
| | | } else { |
| | | sceneUrl.value = bookConfig.value.resourceUrl + '/' + data.resourcePath |
| | | } |
| | |
| | | // } else if (data.resourcePath) { |
| | | // window.open(bookConfig.value.resourceUrl + '/' + data.resourcePath) |
| | | // } |
| | | }else if(data.resourceType == 'PPT' || data.resourceType == 'PDF'){ |
| | | } else if (data.resourceType == 'PPT' || data.resourceType == 'PDF') { |
| | | let md5 = data.md5 |
| | | let dataList = [] |
| | | MG.file |
| | | .getPdfInfo({ |
| | | md5 |
| | | }) |
| | | .then((res: any) => { |
| | | console.log() |
| | | if (res && res.totalPages) { |
| | | for (let i = 0; i < res.totalPages; i++) { |
| | | const src = |
| | | MG.file |
| | | .getPdfInfo({ |
| | | md5 |
| | | }) |
| | | .then((res: any) => { |
| | | console.log() |
| | | if (res && res.totalPages) { |
| | | for (let i = 0; i < res.totalPages; i++) { |
| | | const src = |
| | | bookConfig.value.requestCtx + |
| | | '/file/GetPdfPageImage?md5=' + |
| | | md5 + |
| | | '&index=' + |
| | | (i + 1) + |
| | | '&dpi=300' |
| | | dataList.push({ |
| | | showSrc: src |
| | | }) |
| | | } |
| | | console.log(dataList) |
| | | showData.value = dataList |
| | | // 启动页码观察 |
| | | setTimeout(() => { |
| | | resourVisble.value = true |
| | | }, 500) |
| | | '/file/GetPdfPageImage?md5=' + |
| | | md5 + |
| | | '&index=' + |
| | | (i + 1) + |
| | | '&dpi=300' |
| | | dataList.push({ |
| | | showSrc: src |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }else { |
| | | console.log(dataList) |
| | | showData.value = dataList |
| | | // 启动页码观察 |
| | | setTimeout(() => { |
| | | resourVisble.value = true |
| | | }, 500) |
| | | } |
| | | }) |
| | | } else { |
| | | if (data.md5) { |
| | | window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5) |
| | | } else if (data.resourcePath) { |
| | |
| | | // testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath |
| | | // } |
| | | } |
| | | const goDownload =(data) =>{ |
| | | const goDownload = (data) => { |
| | | if (data.md5) { |
| | | window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5) |
| | | } else if (data.resourcePath) { |
| | |
| | | if (resItem1.resourceType == classifySelectList.value[0].title) { |
| | | resourceDataList.value.push(resItem1) |
| | | } |
| | | if(activeClassify.value == 'other'){ |
| | | if (resItem1.resourceType != '图片' && resItem1.resourceType != '视频' && resItem1.resourceType != '音频') { |
| | | if (activeClassify.value == 'other') { |
| | | if ( |
| | | resItem1.resourceType != '图片' && |
| | | resItem1.resourceType != '视频' && |
| | | resItem1.resourceType != '音频' |
| | | ) { |
| | | resourceDataList.value.push(resItem1) |
| | | } |
| | | } |
| | |
| | | break |
| | | } |
| | | } |
| | | |
| | | type pomodoroType = InstanceType<typeof Pomodoro> |
| | | const baiduVisible = ref(false) |
| | | const wendaVisible = ref(false) |
| | | const cidianVisible = ref(false) |
| | |
| | | const modelTool = ref(false) |
| | | const shengciVisble = ref(false) |
| | | const calculatorVisble = ref(false) |
| | | const pomodoroRef = ref<pomodoroType>() |
| | | const activeTool = ref(0) |
| | | const toolState = reactive({ |
| | | open: true |
| | | }) |
| | | const resourceUrl = ref('') |
| | | |
| | | const selectTeachTools = (item) => { |
| | | const selectTeachTools = (item: any) => { |
| | | if (token) { |
| | | activeTool.value = item.name |
| | | switch (item.name) { |
| | |
| | | siweiVisble.value = true |
| | | break |
| | | case '模型工具': |
| | | modelTool.value = true |
| | | modelTool.value = true |
| | | break |
| | | case '词典': |
| | | cidianVisible.value = true |
| | |
| | | break |
| | | case '计算器': |
| | | calculatorVisble.value = true |
| | | case '番茄闹钟': |
| | | pomodoroRef.value.setDialogVisable(true) |
| | | break |
| | | } |
| | | } else { |
| | |
| | | const openFormulaDialog = () => { |
| | | formulaDialog.value = true |
| | | } |
| | | |
| | | // 番茄钟移动 |
| | | const isMove = ref<boolean>(false) |
| | | const position = reactive({x:100,y:100}) |
| | | const dragOffset = reactive({x:0,y:0}) |
| | | const mouseDown = (e: MouseEvent) => { |
| | | isMove.value = true |
| | | dragOffset.x = e.clientX - position.x |
| | | dragOffset.y = e.clientY - position.y |
| | | document.addEventListener('mousemove', mouseMove) |
| | | document.addEventListener('mouseup', mouseUp) |
| | | } |
| | | const mouseUp = (e: MouseEvent) => { |
| | | isMove.value = false |
| | | document.removeEventListener('mousemove', mouseMove) |
| | | document.removeEventListener('mouseup', mouseUp) |
| | | } |
| | | const mouseMove = (e: MouseEvent) => { |
| | | if (isMove.value) { |
| | | position.x = e.clientX - dragOffset.x |
| | | position.y = e.clientY - dragOffset.y |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | |
| | | z-index: 96; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | } |
| | | .watch-box { |
| | | display: flex; |
| | | align-items: center; |
| | | position: absolute; |
| | | background-color: #555; |
| | | color: #fff; |
| | | padding: 10px; |
| | | border-radius: 5px; |
| | | width: max-content; |
| | | p { |
| | | cursor: move; |
| | | padding: 0 8px; |
| | | font-size: 18px; |
| | | border-radius: 4px; |
| | | margin-right: 10px; |
| | | background-color: #666; |
| | | } |
| | | span { |
| | | cursor: pointer; |
| | | border-right: 1px solid #fff; |
| | | padding: 0 4px; |
| | | font-size: 14px; |
| | | &:last-child { |
| | | border-right: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | width: 100%; |
| | | overflow-y: scroll; |
| | | |
| | | img { |
| | | display: block; |
| | | margin: 0 auto; |
| | | width: 90%; |
| | | height: auto; |
| | | box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1); |
| | | object-fit: contain; |
| | | } |
| | | img { |
| | | display: block; |
| | | margin: 0 auto; |
| | | width: 90%; |
| | | height: auto; |
| | | box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1); |
| | | object-fit: contain; |
| | | } |
| | | } |
| | | |
| | | .imgUrlBox { |
| | |
| | | left: 50px; |
| | | } |
| | | .iframe-box { |
| | | width:100%; |
| | | width: 100%; |
| | | height: 800px; |
| | | } |
| | | </style> |