重复开始上课

This commit is contained in:
zdg 2024-08-07 16:02:36 +08:00
parent 4e2512ed77
commit 6f890843ab
3 changed files with 15 additions and 9 deletions

View File

@ -5,9 +5,10 @@ import { defineStore } from 'pinia'
export const useToolState = defineStore('tool', {
state: () => ({
model: 'select', // 悬浮球-当前模式
showBoardAll: false, // 全屏画板-是否显示
isPdfWin: false, // pdf窗口是否打开
model: 'select', // 悬浮球-当前模式
showBoardAll: false, // 全屏画板-是否显示
isPdfWin: false, // pdf窗口是否打开
isToolWin: false, // 工具窗口是否打开
}),
actions: {
}

View File

@ -69,6 +69,7 @@ import uploadDialog from '@/components/upload-dialog/index.vue'
import { Refresh } from '@element-plus/icons-vue'
import uploaderState from '@/store/modules/uploader'
import useUserStore from '@/store/modules/user'
import { useToolState } from '@/store/modules/tool'
import MoveFile from '@/components/move-file/index.vue'
import FileListItem from '@/views/prepare/container/file-list-item.vue'
import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
@ -82,7 +83,6 @@ import outLink from '@/utils/linkConfig'
import { createWindow } from '@/utils/tool'
import { uniqBy, cloneDeep } from 'lodash'
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
const { ipcRenderer } = window.electron || {}
export default {
@ -454,12 +454,14 @@ export default {
},
// -
openLesson() {
const toolStore = useToolState()
if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作')
createWindow('tool-sphere', { url: '/tool/sphere' })
}
}
}
</script>
<style>
<style lang="scss">
.prepare-popper {
width: 80px !important;
min-width: 80px !important;

View File

@ -37,7 +37,6 @@ import vDrag from './directive/drag' // 自定义指令-拖拽
import vIgnore from './directive/ignore' // -穿
import { useToolState } from '@/store/modules/tool'
import { ipcMsgSend, ipcHandle, ipcMain } from '@/utils/tool' //
import {FabricVue, TYPES} from '@/plugins/fabric'
const tabActive = ref('select') //
const isFold = ref(false) //
const isDrag = ref(false) //
@ -81,10 +80,14 @@ const setIgnore = (bool) => { // 忽略鼠标穿透
ipcMsgSend('tool-sphere:set:ignore', bool)
}
const resetStatus = () => { //
ipcMain.handle('tool-sphere:reset', () => {
FabricVue.handleMode(tabActive.value)
setTimeout(() => { mouseChange(1) }, 500)
if (toolStore.isToolWin) return // -
ipcMain?.handle?.('tool-sphere:reset', () => {
setTimeout(() => {
boardVueRef.value.handleMode(tabActive.value)
mouseChange(1)
}, 500)
})
toolStore.isToolWin = true //
}
watchEffect(() => { //