diff --git a/.env.development b/.env.development index 422cd04..b20e6ac 100644 --- a/.env.development +++ b/.env.development @@ -17,6 +17,7 @@ VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktx VITE_APP_BUILD_BASE_PATH = 'https://file.ysaix.com:7868/' # websocket 地址 +# VITE_APP_WS_URL = 'wss://prev.ysaix.com:7868' VITE_APP_WS_URL = 'wss://file.ysaix.com:7868' # VITE_APP_WS_URL = 'ws://192.168.2.16:7865' diff --git a/src/renderer/src/AixPPTist/src/api/chat.ts b/src/renderer/src/AixPPTist/src/api/chat.ts index 70574e2..9987c7d 100644 --- a/src/renderer/src/AixPPTist/src/api/chat.ts +++ b/src/renderer/src/AixPPTist/src/api/chat.ts @@ -14,7 +14,8 @@ export default () => { const courseId = classcourse?.id // 课堂id const timgroupid = classcourse?.timgroupid // 群组id const classcourseStore = useClasscourseStore() // 课堂信息-状态管理 - if (!ChatWs.ws) ChatWs.init() + // 上课状态才-初始化socket + if (!ChatWs.ws && !!courseId) ChatWs.init() // 开课消息 const startCourse = async() => { // await API_classcourse.updateClasscourse({ id: classcourse.id, status: 'open' }) diff --git a/src/renderer/src/AixPPTist/src/hooks/useScreening.ts b/src/renderer/src/AixPPTist/src/hooks/useScreening.ts index 979b8c4..4a35762 100644 --- a/src/renderer/src/AixPPTist/src/hooks/useScreening.ts +++ b/src/renderer/src/AixPPTist/src/hooks/useScreening.ts @@ -1,5 +1,6 @@ import { useScreenStore, useSlidesStore, useClasscourseStore } from '../store' import { enterFullscreen, exitFullscreen, isFullscreen } from '../utils/fullscreen' +import { sessionStore } from '@/utils/store' // electron-store 状态管理 import ChatWs from '@/plugins/socket' // 聊天socket export default () => { @@ -25,6 +26,9 @@ export default () => { if (!!classcourse) { //DOTO 有课堂,执行退相关操作 console.log('退出放映状态') ChatWs?.close() // 关闭ws + sessionStore.delete('curr.classcourse') // 清除课堂信息 + sessionStore.delete('curr.resource') // 清除课件信息 + sessionStore.delete('curr.isPublic') // 清除公屏状态 setTimeout(() => { window.close() // 关闭窗口 }, 1000) diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue index 26c852e..7402fe8 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue @@ -21,6 +21,7 @@ import { sessionStore } from '@/utils/store' import { getSmarttalkPage } from '@/api/file' import * as commUtils from '@/utils/comm.js' import { getFileSuffix } from '@/utils/ruoyi.js' +import { PPTApi } from '../../../api' const emit = defineEmits(['insertMaterial', 'close']) @@ -60,73 +61,31 @@ const fileUrl = computed(() => (item) =>{ } }) - // 插入 const onInsert = async (item) =>{ + loading.value = true const res = await fetch(item.fileFullPath) const bolb = await res.blob() const file = commUtils.blobToFile(bolb, item.fileShowName) - if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){ - emit('insertMaterial',{ type: 'video', file }) - } - else{ - emit('insertMaterial',{ type: 'img', file }) - } -} - - - -const GetUrlParameters = (parameters) => { - let resData = ""; - - let url = document.location.toString(); - let arrUrl = url.split("?"); - // 判断是否有参数 - if (arrUrl.length > 1) { - // 拆分参数字符串 - let parametersArr = arrUrl[1].split("&"); - // 循环查找参数 - for (let i = 0; i <= parametersArr.length; i++) { - if (parametersArr[i]) { - // 拆分参数的键和值 - let parameterStr = parametersArr[i].split("="); - if (parameters == parameterStr[0]) { - resData = parameterStr[1]; - break; - } - } + try { + const data = await PPTApi.toRousrceUrl(file) + if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){ + emit('insertMaterial',{ type: 'video', data }) } + else{ + emit('insertMaterial',{ type: 'img', data }) + } + } finally { + loading.value = false } - return resData; } -const proxyToBase64 = (url)=> { - const dourl = GetUrlParameters(url) - console.log(dourl,'dourl') - return - axios({ - url: "/api/logo.png", - method: "get", - responseType: "blob", - }).then((res) => { - const reader = new FileReader(); - reader.readAsDataURL(res.data); - reader.onload = () => { - console.log(reader.result); - }; - }); -} - - - - // 关闭 const onClose = () =>{ emit('close') } - onMounted(() => { let data = sessionStore.get('subject.curNode') Object.assign(curNode, data); diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue index ad51dd9..64da59a 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue @@ -281,20 +281,17 @@ const toggleNotesPanel = () => { // 插入素材 interface MaterialParams { type: string, - file: any + data: string } -const insertMaterial = (item: MaterialParams) =>{ - const { type, file } = item - PPTApi.toRousrceUrl(file).then(data=>{ - if(type == 'video'){ - createVideoElement(data) - } - else{ - createImageElement(data) - } - materiaVisible.value = false - }) - +const insertMaterial = async (item: MaterialParams) =>{ + const { type, data } = item + if(type == 'video'){ + createVideoElement(data) + } + else{ + createImageElement(data) + } + materiaVisible.value = false } // 文生图 diff --git a/src/renderer/src/AixPPTist/src/views/Editor/EditorHeader/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/EditorHeader/index.vue index 29d7ca5..8b5365a 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/EditorHeader/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/EditorHeader/index.vue @@ -3,7 +3,7 @@