Compare commits
16 Commits
33e84ca006
...
12da4ac2c0
Author | SHA1 | Date |
---|---|---|
zhengdegang | 12da4ac2c0 | |
zdg | 5ecba3fb62 | |
zdg | f5f33eaa63 | |
zhengdegang | 090bc5997c | |
zdg | 1c69d10263 | |
zdg | b794d55cd7 | |
zdg | 28b5a131fd | |
zdg | e740cb0c7e | |
zdg | 3a83a31970 | |
zhangxuelin | 30f7b9d5b3 | |
zhangxuelin | 37810586b7 | |
zhangxuelin | e31858a3fe | |
zdg | 3a6b78bc76 | |
zhengdegang | 10a1342b95 | |
zdg | 70e99e69ba | |
lyc | 3171c0b3f9 |
|
@ -110,7 +110,7 @@ const savaDataStore = () => {
|
||||||
if(!toolState.isToolWin){
|
if(!toolState.isToolWin){
|
||||||
toolState.isPdfWin=false
|
toolState.isPdfWin=false
|
||||||
toolState.showBoardAll=true //恢复默认值
|
toolState.showBoardAll=true //恢复默认值
|
||||||
ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
// ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
||||||
ipcRenderer.send('open-PDF:minimize')
|
ipcRenderer.send('open-PDF:minimize')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ const savaDataStore = () => {
|
||||||
Promise.all(promises).then(res=>{
|
Promise.all(promises).then(res=>{
|
||||||
toolState.isPdfWin=false
|
toolState.isPdfWin=false
|
||||||
toolState.showBoardAll=true //恢复默认值
|
toolState.showBoardAll=true //恢复默认值
|
||||||
ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
// ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
||||||
ipcRenderer.send('open-PDF:minimize')
|
ipcRenderer.send('open-PDF:minimize')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,12 +100,14 @@ const renderPage = async (canvasobj) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 保存数据
|
// 保存数据
|
||||||
const savaDataStore = (type) => {
|
const savaDataStore = async (type) => {
|
||||||
if(!toolState.isToolWin){
|
if(!toolState.isToolWin){
|
||||||
toolState.isPdfWin = false
|
toolState.isPdfWin = false
|
||||||
|
await sleep(20) // 延时
|
||||||
toolState.showBoardAll = true //恢复默认值
|
toolState.showBoardAll = true //恢复默认值
|
||||||
|
await sleep(50) // 延时
|
||||||
if(type=='rest'){
|
if(type=='rest'){
|
||||||
ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
// ipcRenderer.invoke('tool-sphere:reset') //重置tool状态-废弃
|
||||||
ipcRenderer.send('open-PDF:close')
|
ipcRenderer.send('open-PDF:close')
|
||||||
}else{
|
}else{
|
||||||
ipcRenderer.invoke('open-PDF:minimize')
|
ipcRenderer.invoke('open-PDF:minimize')
|
||||||
|
@ -141,20 +143,24 @@ const savaDataStore = (type) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Promise.all(promises).then(res=>{
|
Promise.all(promises).then(async res=>{
|
||||||
toolState.isPdfWin=false
|
toolState.isPdfWin=false
|
||||||
|
await sleep(20) // 延时
|
||||||
toolState.showBoardAll=true //恢复默认值
|
toolState.showBoardAll=true //恢复默认值
|
||||||
|
await sleep(50) // 延时
|
||||||
// ipcRenderer.send('open-PDF:minimize')
|
// ipcRenderer.send('open-PDF:minimize')
|
||||||
if(type=='rest'){
|
if(type=='rest'){
|
||||||
ipcRenderer.invoke('tool-sphere:reset') //重置tool状态
|
// ipcRenderer.invoke('tool-sphere:reset') //重置tool状态-废弃
|
||||||
ipcRenderer.send('open-PDF:close')
|
ipcRenderer.send('open-PDF:close')
|
||||||
}else{
|
}else{
|
||||||
ipcRenderer.send('open-PDF:minimize')
|
ipcRenderer.invoke('open-PDF:minimize')
|
||||||
}
|
}
|
||||||
// ipcRenderer.send('open-PDF:close')
|
// ipcRenderer.send('open-PDF:close')
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 延时
|
||||||
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
const updatePage = (canvasobj) => {
|
const updatePage = (canvasobj) => {
|
||||||
renderPage(canvasobj)
|
renderPage(canvasobj)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import IMListeners from './imLiseners' // im消息-监听器
|
||||||
const API = window.api
|
const API = window.api
|
||||||
// TIM生成签名
|
// TIM生成签名
|
||||||
// import * as GenerateUserSig from './userSig' // 引入签名生成器
|
// import * as GenerateUserSig from './userSig' // 引入签名生成器
|
||||||
|
const isDev = process.env.NODE_ENV == 'development' // 环境
|
||||||
export class ImChat {
|
export class ImChat {
|
||||||
timChat // imChat对象
|
timChat // imChat对象
|
||||||
SDKAppID // sdkID
|
SDKAppID // sdkID
|
||||||
|
@ -48,10 +49,11 @@ export class ImChat {
|
||||||
}
|
}
|
||||||
// 设置配置
|
// 设置配置
|
||||||
async setConfig() {
|
async setConfig() {
|
||||||
|
const log_level = TYPES.TIMLogLevel.kTIMLog_Error
|
||||||
await this.timChat.TIMSetConfig({ // TIMSetConfigParam
|
await this.timChat.TIMSetConfig({ // TIMSetConfigParam
|
||||||
json_config: { // JSONCongfig
|
json_config: { // JSONCongfig
|
||||||
set_config_log_level: TYPES.TIMLogLevel.kTIMLog_Test,
|
set_config_log_level: log_level,
|
||||||
set_config_callback_log_level: TYPES.TIMLogLevel.kTIMLog_Error,
|
set_config_callback_log_level: log_level,
|
||||||
set_config_is_log_output_console: true,
|
set_config_is_log_output_console: true,
|
||||||
// set_config_user_config: { // 用户配置
|
// set_config_user_config: { // 用户配置
|
||||||
// user_config_is_read_receipt: true, // true表示要收已读回执事件
|
// user_config_is_read_receipt: true, // true表示要收已读回执事件
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
const isNode = typeof require !== 'undefined' // 是否支持node函数
|
const isNode = typeof require !== 'undefined' // 是否支持node函数
|
||||||
const { ipcRenderer } = isNode?require('electron'):{} // app使用
|
const { ipcRenderer } = isNode?require('electron'):{} // app使用
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
|
// import { diff } from 'jsondiffpatch'
|
||||||
// const Remote = isNode?require('@electron/remote'):{} // 远程模块
|
// const Remote = isNode?require('@electron/remote'):{} // 远程模块
|
||||||
|
|
||||||
export function shareStorePlugin({store}) {
|
export function shareStorePlugin({store}) {
|
||||||
store.$subscribe((mutation, state) => { // 自动同步
|
store.$subscribe((mutation, state) => { // 自动同步
|
||||||
// mutation 变量包含了变化前后的状态
|
// mutation 变量包含了变化前后的状态
|
||||||
|
@ -19,8 +21,8 @@ export function shareStorePlugin({store}) {
|
||||||
if (names.includes(storeName)) {
|
if (names.includes(storeName)) {
|
||||||
const { storeId: storeName, payload, events, type } = mutation // direct
|
const { storeId: storeName, payload, events, type } = mutation // direct
|
||||||
// if (!Object.keys(payload).length) return
|
// if (!Object.keys(payload).length) return
|
||||||
if (type != 'direct' || !events || Array.isArray(events) || !events.key) return
|
// if (type != 'direct' || !events || Array.isArray(events) || !events.key) return
|
||||||
stateSync(storeName, events.key, events.newValue, state) // 需要同步
|
stateSyncWatch(storeName, state) // 需要同步
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -51,6 +53,28 @@ function stateSync(storeName, key, value, state) {
|
||||||
console.log('state-change-error', error)
|
console.log('state-change-error', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 同步数据-发送给主线程-单独($subscribe-监听使用)
|
||||||
|
function stateSyncWatch(storeName, newState) {
|
||||||
|
const oldState = sessionStore.store // 旧数据
|
||||||
|
const diffData = findDifferences(oldState, newState)
|
||||||
|
// console.log('state-change-diffData', diffData)
|
||||||
|
try {
|
||||||
|
for(const key in diffData) {
|
||||||
|
const value = diffData[key]
|
||||||
|
const newValue = {} // 重新组装pinia需要的数据 {a:{b:1}} 这种
|
||||||
|
const keyArr = key.split('.') || []
|
||||||
|
keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue)
|
||||||
|
const jsonStr = JSON.stringify(newValue) // 从新组装-json数据
|
||||||
|
// // 更新本地数据-session
|
||||||
|
sessionStore.set(key, value)
|
||||||
|
// // 通知主线程更新
|
||||||
|
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||||
|
// console.log('======',key, value, jsonStr )
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('state-change-error', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 同步数据-发送给主线程-全量更新
|
// 同步数据-发送给主线程-全量更新
|
||||||
function stateSyncAll(store) {
|
function stateSyncAll(store) {
|
||||||
|
@ -85,7 +109,7 @@ function stateChange(store) {
|
||||||
const storeName = store.$id
|
const storeName = store.$id
|
||||||
ipcRenderer?.on('pinia-state-set', (e, sName, jsonStr) => {
|
ipcRenderer?.on('pinia-state-set', (e, sName, jsonStr) => {
|
||||||
if (sName == storeName) { // 更新对应数据
|
if (sName == storeName) { // 更新对应数据
|
||||||
// console.log('state-set', jsonStr, sName)
|
console.log('state-set', jsonStr, sName)
|
||||||
const curJson = circularSafeStringify(store.$state) // 当前数据
|
const curJson = circularSafeStringify(store.$state) // 当前数据
|
||||||
const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环
|
const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环
|
||||||
if (!isUp) return
|
if (!isUp) return
|
||||||
|
@ -141,5 +165,43 @@ const filterByKey = (obj, key, value) => {
|
||||||
const getObjValue = (obj, key) => {
|
const getObjValue = (obj, key) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 找出两个对象之间的差异
|
||||||
|
const findDifferences = (obj1, obj2) => {
|
||||||
|
const differences = {};
|
||||||
|
function compareObjects(o1, o2, path = '') {
|
||||||
|
for (const key in o1) {
|
||||||
|
if (o1.hasOwnProperty(key)) {
|
||||||
|
const newPath = path ? `${path}.${key}` : key;
|
||||||
|
if (o2.hasOwnProperty(key)) {
|
||||||
|
const v1 = toJsonStr(o1[key])
|
||||||
|
const v2 = toJsonStr(o2[key])
|
||||||
|
if (typeof o1[key] === 'object' && typeof o2[key] === 'object' && !Array.isArray(o1[key])) {
|
||||||
|
compareObjects(o1[key], o2[key], newPath);
|
||||||
|
} else if (v1 !== v2) {
|
||||||
|
differences[newPath] = o2[key];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
differences[newPath] = o2[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const key in o2) {
|
||||||
|
if (o2.hasOwnProperty(key) && !o1.hasOwnProperty(key)) {
|
||||||
|
const newPath = path ? `${path}.${key}` : key;
|
||||||
|
differences[newPath] = o2[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compareObjects(objClone(obj1), objClone(obj2));
|
||||||
|
// 特殊处理
|
||||||
|
|
||||||
|
|
||||||
|
return differences;
|
||||||
|
}
|
||||||
// 对象克隆
|
// 对象克隆
|
||||||
const objClone = (obj) => JSON.parse(JSON.stringify(obj))
|
const objClone = (obj) => JSON.parse(JSON.stringify(obj))
|
||||||
|
// 转换为json
|
||||||
|
const toJsonStr = (obj) => JSON.stringify(obj)
|
||||||
|
|
|
@ -6,6 +6,8 @@ import { sessionStore } from '@/utils/tool'
|
||||||
|
|
||||||
// 默认数据
|
// 默认数据
|
||||||
const defData = sessionStore.store || {}
|
const defData = sessionStore.store || {}
|
||||||
|
// 延时
|
||||||
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
|
|
||||||
export const useToolState = defineStore('tool', {
|
export const useToolState = defineStore('tool', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
|
@ -20,5 +22,12 @@ export const useToolState = defineStore('tool', {
|
||||||
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
...defData // 默认数据-覆盖上面的配置(不要删除, 会导致新窗口-获取状态失败)
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
async resetDef() { // 重置数据-下课
|
||||||
|
this.model = 'select' // 悬浮球-当前模式
|
||||||
|
await sleep(20) // 休眠20ms
|
||||||
|
this.showBoardAll = false // 全屏画板-是否显示
|
||||||
|
await sleep(20) // 休眠20ms
|
||||||
|
this.isToolWin = false // 工具窗口是否打开
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -31,7 +31,8 @@ export const localStore = store.localStore
|
||||||
|
|
||||||
// 暴露Store存储对象
|
// 暴露Store存储对象
|
||||||
export const Store = store
|
export const Store = store
|
||||||
|
// 延时
|
||||||
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
/**
|
/**
|
||||||
* 获取静态资源,开发和生产环境
|
* 获取静态资源,开发和生产环境
|
||||||
* @param {*} url
|
* @param {*} url
|
||||||
|
@ -186,6 +187,7 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
|
||||||
sandbox: false,
|
sandbox: false,
|
||||||
nodeIntegration: true, // nodeApi调用
|
nodeIntegration: true, // nodeApi调用
|
||||||
contextIsolation: false, // 沙箱取消
|
contextIsolation: false, // 沙箱取消
|
||||||
|
devTools: true
|
||||||
},
|
},
|
||||||
...option
|
...option
|
||||||
}
|
}
|
||||||
|
@ -249,7 +251,7 @@ const eventHandles = (type, win) => {
|
||||||
const on = {
|
const on = {
|
||||||
onClosed: () => {
|
onClosed: () => {
|
||||||
Remote.ipcMain.removeHandler('tool-sphere:set:ignore', setIgnore)
|
Remote.ipcMain.removeHandler('tool-sphere:set:ignore', setIgnore)
|
||||||
Remote.ipcMain.removeHandler('tool-sphere:reset')
|
// Remote.ipcMain.removeHandler('tool-sphere:reset')
|
||||||
// Remote.ipcMain.removeAllListeners() // 移除所有监听事件
|
// Remote.ipcMain.removeAllListeners() // 移除所有监听事件
|
||||||
// 设置状态(再次设置-防止未设置到)
|
// 设置状态(再次设置-防止未设置到)
|
||||||
if(toolState.isToolWin) toolState.isToolWin = false
|
if(toolState.isToolWin) toolState.isToolWin = false
|
||||||
|
@ -270,6 +272,17 @@ const eventHandles = (type, win) => {
|
||||||
winPdf=null
|
winPdf=null
|
||||||
win&&win.destroy()
|
win&&win.destroy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 监听窗口的激活事件
|
||||||
|
win.on('focus', async () => {
|
||||||
|
console.log('激活窗口')
|
||||||
|
toolState.isPdfWin=true
|
||||||
|
await sleep(20) // 延时
|
||||||
|
toolState.showBoardAll=false //恢复默认值
|
||||||
|
// await sleep(50) // 延时
|
||||||
|
// 穿透开启
|
||||||
|
if (toolState.isToolWin) ipcRenderer.invoke('tool-sphere:set:ignore', true)
|
||||||
|
});
|
||||||
const on = {
|
const on = {
|
||||||
onClosed: () => {
|
onClosed: () => {
|
||||||
Remote.ipcMain.removeHandler('open-PDF:minimize')
|
Remote.ipcMain.removeHandler('open-PDF:minimize')
|
||||||
|
|
|
@ -105,6 +105,7 @@ const switchPageMode = () => {
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const isDev = process.env.NODE_ENV == 'development'
|
const isDev = process.env.NODE_ENV == 'development'
|
||||||
|
// toolState.showBoardAll = false // 隐藏画板
|
||||||
toolState.isPdfWin=true //设置打开pdf窗口
|
toolState.isPdfWin=true //设置打开pdf窗口
|
||||||
if (isDev)
|
if (isDev)
|
||||||
pdfObj.pdfUrl = getStaticUrl('aaa.pdf', 'user', 'selfFile', true) //本地
|
pdfObj.pdfUrl = getStaticUrl('aaa.pdf', 'user', 'selfFile', true) //本地
|
||||||
|
|
|
@ -145,7 +145,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, ipcMsgSend } from '@/utils/tool'
|
import { createWindow, ipcMsgSend, sessionStore } from '@/utils/tool'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { delClasswork } from '@/api/teaching/classwork'
|
import { delClasswork } from '@/api/teaching/classwork'
|
||||||
import { getSelfReserv, startClass } from '@/api/classManage'
|
import { getSelfReserv, startClass } from '@/api/classManage'
|
||||||
|
@ -220,6 +220,8 @@ export default {
|
||||||
this.initReserv()
|
this.initReserv()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
window.test = sessionStore
|
||||||
|
window.test1 = toolStore
|
||||||
this.$watch(
|
this.$watch(
|
||||||
() => toolStore.isToolWin,
|
() => toolStore.isToolWin,
|
||||||
(newD, oldD) => {
|
(newD, oldD) => {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// 功能说明:electron 悬浮球
|
// 功能说明:electron 悬浮球
|
||||||
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
import { onMounted, ref, reactive, watchEffect, nextTick } from 'vue'
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus'
|
import { ElMessageBox, ElMessage, ElLoading } from 'element-plus'
|
||||||
import * as classManageApi from '@/api/classManage'
|
import * as classManageApi from '@/api/classManage'
|
||||||
|
@ -83,6 +83,8 @@ const btnList = [ // 工具栏按钮列表
|
||||||
// === 页面加载完毕 ===
|
// === 页面加载完毕 ===
|
||||||
onMounted(async() => {
|
onMounted(async() => {
|
||||||
if (!electron) return // 浏览器端
|
if (!electron) return // 浏览器端
|
||||||
|
window.test = sessionStore
|
||||||
|
window.test1 = toolStore
|
||||||
getClassInfo() // 获取课堂详情 ex3
|
getClassInfo() // 获取课堂详情 ex3
|
||||||
resetStatus() // 开启重置状态-监听
|
resetStatus() // 开启重置状态-监听
|
||||||
})
|
})
|
||||||
|
@ -93,7 +95,7 @@ const getClassInfo = async () => {
|
||||||
const { data } = await classManageApi.getClassInfo(classObj.id)
|
const { data } = await classManageApi.getClassInfo(classObj.id)
|
||||||
classObj.data = data
|
classObj.data = data
|
||||||
// 群id
|
// 群id
|
||||||
let timGroupId = data?.ex3 || '@TGS#36AICW6O6'
|
let timGroupId = data?.ex3 || ''
|
||||||
console.log('获取群ID:', timGroupId)
|
console.log('获取群ID:', timGroupId)
|
||||||
const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat
|
const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat
|
||||||
if (!timGroupId) timGroupId = chat?.timGroupId
|
if (!timGroupId) timGroupId = chat?.timGroupId
|
||||||
|
@ -104,6 +106,7 @@ const getClassInfo = async () => {
|
||||||
const tabChange = (val) => {
|
const tabChange = (val) => {
|
||||||
const bool = !toolStore.isPdfWin && !toolStore.showBoardAll
|
const bool = !toolStore.isPdfWin && !toolStore.showBoardAll
|
||||||
if(bool) toolStore.showBoardAll = true
|
if(bool) toolStore.showBoardAll = true
|
||||||
|
console.log('tabChange:', val, bool)
|
||||||
toolStore.model = val // 存储当前tab
|
toolStore.model = val // 存储当前tab
|
||||||
}
|
}
|
||||||
// logo 点击-事件 折叠|展开
|
// logo 点击-事件 折叠|展开
|
||||||
|
@ -132,8 +135,15 @@ const logoHandle = (e,t) => {
|
||||||
// 底部工具栏:移入移出-是否穿透
|
// 底部工具栏:移入移出-是否穿透
|
||||||
const mouseChange = (bool) => {
|
const mouseChange = (bool) => {
|
||||||
let resBool = false
|
let resBool = false
|
||||||
|
if (bool == 0) return setIgnore(resBool) // 移入不穿透
|
||||||
if (tabActive.value == 'select') resBool = !!bool
|
if (tabActive.value == 'select') resBool = !!bool
|
||||||
|
else {
|
||||||
if (!isShow.value) resBool = !!bool
|
if (!isShow.value) resBool = !!bool
|
||||||
|
// pdf强行穿透
|
||||||
|
const isPdf = !resBool && toolStore.isPdfWin
|
||||||
|
if (isPdf) resBool = true
|
||||||
|
}
|
||||||
|
// console.log('mouseChange:', bool, resBool)
|
||||||
setIgnore(resBool)
|
setIgnore(resBool)
|
||||||
}
|
}
|
||||||
// im-chat: 聊天事件 {type, data}
|
// im-chat: 聊天事件 {type, data}
|
||||||
|
@ -167,15 +177,15 @@ const setIgnore = (bool) => {ipcMsgSend('tool-sphere:set:ignore', bool)}
|
||||||
// 重置状态: 鼠标|画板
|
// 重置状态: 鼠标|画板
|
||||||
const resetStatus = () => {
|
const resetStatus = () => {
|
||||||
if (toolStore.isToolWin) return // 已经打开过-忽略
|
if (toolStore.isToolWin) return // 已经打开过-忽略
|
||||||
ipcMain?.removeHandler('tool-sphere:reset') // 避免已绑定,先移除在绑定
|
// 以下代码废弃-暂时无用
|
||||||
ipcMain?.handle?.('tool-sphere:reset', () => {
|
// ipcMain?.removeHandler('tool-sphere:reset') // 避免已绑定,先移除在绑定
|
||||||
setTimeout(() => {
|
// ipcMain?.handle?.('tool-sphere:reset', () => {
|
||||||
boardVueRef.value.handleMode(tabActive.value)
|
// setTimeout(() => {
|
||||||
mouseChange(1)
|
// boardVueRef.value.handleMode(tabActive.value)
|
||||||
}, 500)
|
// mouseChange(1)
|
||||||
})
|
// }, 500)
|
||||||
|
// })
|
||||||
toolStore.isToolWin = true // 标记状态
|
toolStore.isToolWin = true // 标记状态
|
||||||
|
|
||||||
}
|
}
|
||||||
// 侧边工具栏: 移入移出
|
// 侧边工具栏: 移入移出
|
||||||
const sideMouse = e => {
|
const sideMouse = e => {
|
||||||
|
@ -209,7 +219,8 @@ const sideChange = async o => {
|
||||||
// 延迟2秒后关闭窗口,如果马上解散群,会导致群组不存在
|
// 延迟2秒后关闭窗口,如果马上解散群,会导致群组不存在
|
||||||
setTimeout(async() => {
|
setTimeout(async() => {
|
||||||
// elMsg.close()
|
// elMsg.close()
|
||||||
toolStore.isToolWin = false
|
// toolStore.isToolWin = false
|
||||||
|
toolStore.resetDef() // 重置状态
|
||||||
await imChatRef.value?.deleteGroup() // 解散群
|
await imChatRef.value?.deleteGroup() // 解散群
|
||||||
await imChatRef.value?.logout() // 退出im
|
await imChatRef.value?.logout() // 退出im
|
||||||
await classManageApi.endClass(route.query.reservId)
|
await classManageApi.endClass(route.query.reservId)
|
||||||
|
@ -231,6 +242,12 @@ watchEffect(() => {
|
||||||
// 不同的时候, 更新值: 是否显示-画板
|
// 不同的时候, 更新值: 是否显示-画板
|
||||||
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
|
||||||
|
if (isShow.value) {
|
||||||
|
nextTick(() => {
|
||||||
|
mouseChange(1) // 移除工具栏
|
||||||
|
boardVueRef.value.handleMode(tabActive.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue