Compare commits

...

12 Commits
yangws ... main

8 changed files with 39 additions and 15 deletions

View File

@ -114,6 +114,7 @@ const emitChangeBook = async () => {
*/ */
let levelFirstId = null let levelFirstId = null
let levelSecondId = null let levelSecondId = null
let bookeId = curBook.data.id
if (curData.parentNode) { if (curData.parentNode) {
levelFirstId = curData.parentNode.id levelFirstId = curData.parentNode.id
levelSecondId = curData.id levelSecondId = curData.id
@ -121,7 +122,7 @@ const emitChangeBook = async () => {
levelFirstId = curData.id levelFirstId = curData.id
levelSecondId = '' levelSecondId = ''
} }
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId})) localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
emit('changeBook', data) emit('changeBook', data)
} }
@ -206,6 +207,7 @@ const handleNodeClick = (data, node) => {
*/ */
let levelFirstId = null let levelFirstId = null
let levelSecondId = null let levelSecondId = null
let bookeId = curBook.data.id
if (nodeData.parentNode) { if (nodeData.parentNode) {
levelFirstId = nodeData.parentNode.id levelFirstId = nodeData.parentNode.id
levelSecondId = nodeData.id levelSecondId = nodeData.id
@ -213,7 +215,7 @@ const handleNodeClick = (data, node) => {
levelFirstId = nodeData.id levelFirstId = nodeData.id
levelSecondId = '' levelSecondId = ''
} }
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId})) localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
emit('nodeClick', curData) emit('nodeClick', curData)
@ -233,6 +235,7 @@ onMounted( async () => {
} }
else{ else{
curBook.data = useSubject.subjectList[0] curBook.data = useSubject.subjectList[0]
localStorage.setItem('curBook', JSON.stringify(curBook.data))
treeData.value = useSubject.treeData treeData.value = useSubject.treeData
} }
// //

View File

@ -102,8 +102,9 @@ const getTreeData = () => {
levelFirstId = curNode.id levelFirstId = curNode.id
levelSecondId = '' levelSecondId = ''
} }
let bookeId = curBookId
// 头部 教材分析、作业设计打开外部链接需要当前章节ID // 头部 教材分析、作业设计打开外部链接需要当前章节ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId})) localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
// const data = { // const data = {
// textBook: { // textBook: {

View File

@ -65,7 +65,7 @@
<script setup> <script setup>
import { ref, watch, onMounted } from 'vue' import { ref, watch, onMounted } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { ElMessageBox } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { ArrowDown } from '@element-plus/icons-vue' import { ArrowDown } from '@element-plus/icons-vue'
import WindowTools from '@/components/window-tools/index.vue' import WindowTools from '@/components/window-tools/index.vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
@ -74,6 +74,10 @@ import outLink from '@/utils/linkConfig'
import logoIco from '@/assets/images/logo.png' import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index' import { listEvaluation } from '@/api/classManage/index'
import { clearBookInfo } from '@/utils/ruoyi' import { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store'
import { useToolState } from '@/store/modules/tool'
const toolState = useToolState();
let homeTitle = ref(import.meta.env.VITE_APP_TITLE) let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const userStore = useUserStore() const userStore = useUserStore()
@ -166,6 +170,8 @@ function handleCommand(command) {
} }
function logout() { function logout() {
const hasClass = sessionStore.has('activeClass.id')
if (hasClass || toolState.isToolWin) return ElMessage.warning('当前正在上课,请先结结束上课')
ElMessageBox.confirm('确认退出系统吗?', '提示', { ElMessageBox.confirm('确认退出系统吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',

View File

@ -23,11 +23,12 @@ export const useToolState = defineStore('tool', {
}), }),
actions: { actions: {
async resetDef() { // 重置数据-下课 async resetDef() { // 重置数据-下课
this.model = 'select' // 悬浮球-当前模式 // this.model = 'select' // 悬浮球-当前模式
await sleep(20) // 休眠20ms await sleep(50) // 休眠50ms
this.showBoardAll = false // 全屏画板-是否显示 this.showBoardAll = false // 全屏画板-是否显示
await sleep(20) // 休眠20ms await sleep(50) // 休眠50ms
this.isToolWin = false // 工具窗口是否打开 this.isToolWin = false // 工具窗口是否打开
await sleep(50) // 休眠50ms
} }
} }
}) })

View File

@ -168,10 +168,11 @@ const clickMenu = ({isOuter, path, disabled}) =>{
let fullPath = configObj.fullPath + path let fullPath = configObj.fullPath + path
if(path == '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask' || path == '/teaching/classtaskassign?titleName=作业布置'){ if(path == '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask' || path == '/teaching/classtaskassign?titleName=作业布置'){
// ID // ID
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId')) const { levelFirstId, levelSecondId, bookeId } = JSON.parse(localStorage.getItem('unitId'))
let unitId = levelSecondId ? levelSecondId : levelFirstId let unitId = levelSecondId ? levelSecondId : levelFirstId
fullPath = fullPath + `&unitId=${unitId}`
fullPath = fullPath + `&unitId=${unitId}&bookeId=${bookeId}`
console.log(fullPath) console.log(fullPath)
} }

View File

@ -208,7 +208,8 @@ export default {
openFileWin(items) { openFileWin(items) {
if (items.fileFlag === 'apt') { if (items.fileFlag === 'apt') {
console.log(this.curNode); console.log(this.curNode);
const path="/teaching/aptindex?id="+items.fileId + "&cataId=" + this.curNode.id; let curBook = JSON.parse(localStorage.getItem('curBook'))
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id;
let configObj = outLink().getBaseData() let configObj = outLink().getBaseData()
let fullPath = configObj.fullPath + path let fullPath = configObj.fullPath + path
fullPath = fullPath.replaceAll('//', '/') fullPath = fullPath.replaceAll('//', '/')

View File

@ -243,6 +243,7 @@ const sideChange = async o => {
// === === // === ===
watchEffect(() => { watchEffect(() => {
if (isOver.value) return // ,
// , : - // , : -
const show = !toolStore.isPdfWin && toolStore.showBoardAll const show = !toolStore.isPdfWin && toolStore.showBoardAll
if (show != isShow.value) isShow.value = show if (show != isShow.value) isShow.value = show

View File

@ -1,9 +1,15 @@
<template> <template>
<canvas ref="canvasRef" /> <canvas ref="canvasRef" style="pointer-events: none;" />
<button @click="eraseTo">橡皮擦 <div style="position: absolute;top: 0;" @click="test('click')"
<i class="iconfont icon-xiangpica"></i> @mouseenter="test('mouseenter')" @mousemove="test('mousemove')" @mouseleave="test('mouseleave')"
</button> @touchstart="test('touchstart')" @touchmove="test('touchmove')" @touchend="test('touchend')"
<button @click="close">销毁</button> @touchcancel="test('touchcancel')" @mousedown="test('mousedown')" @mouseup="test('mouseup')"
@mouseout="test('mouseout')" @mouseover="test('mouseover')" @mousewheel="test('mousewheel')">
<!-- <button @click="eraseTo">橡皮擦</button> -->
<!-- <i class="iconfont icon-xiangpica"></i> -->
<!-- <button @click="close">销毁</button> -->
<div style="width: 100px;height: 100px;background: #ffbcbc;">小星星</div>
</div>
</template> </template>
<script setup> <script setup>
@ -43,6 +49,10 @@ const eraseTo = () => { // 橡皮擦
// canvas.dispose() // canvas.dispose()
} }
const close = () => { FabricVue.removeCanvas() } const close = () => { FabricVue.removeCanvas() }
const test = (key, e) => {
console.log('event: ', key)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>