From 8f501745958ec547be1ce3d18c03e24da3064168 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Tue, 13 Aug 2024 16:46:47 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9ABUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/renderer/src/plugins/shareStore.js | 1 - src/renderer/src/views/prepare/index.vue | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.env.development b/.env.development index b10b50c..d4989df 100644 --- a/.env.development +++ b/.env.development @@ -9,7 +9,7 @@ VITE_APP_BASE_API = '/dev-api' VITE_APP_DOMAIN = 'file.ysaix.com' -VITE_APP_UPLOAD_API = 'http://192.168.2.52:7863' +VITE_APP_UPLOAD_API = 'https://file.ysaix.com:7868/prod-api' VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktxt/' diff --git a/src/renderer/src/plugins/shareStore.js b/src/renderer/src/plugins/shareStore.js index 3db1486..4857cc4 100644 --- a/src/renderer/src/plugins/shareStore.js +++ b/src/renderer/src/plugins/shareStore.js @@ -20,7 +20,6 @@ export function shareStorePlugin({store}) { function stateSync(store) { const storeName = store.$id const jsonStr = circularSafeStringify(store.$state) - console.log('state-change', jsonStr, storeName) // 通知主线程更新 ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr) } diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 489c993..13933d5 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -232,7 +232,7 @@ export default { this.isOpenHomework = false }) - + }, // activated() { // if (this.uploadData.textbookId !== null) { @@ -427,7 +427,7 @@ export default { await this.asyncAllFile() }, async initHomeWork() { - + if (this.uploadData.levelSecondId) { // 获取作业列表所需ID 可能存在没有 let { rows } = await this.getChapterId() @@ -552,7 +552,7 @@ export default { } } // 去重 - let ary = uniqBy([...this.currentFileList, ...list], 'id') + let ary = uniqBy([...list], 'id') // 深度克隆 this.currentWorkList = cloneDeep(ary) }) From 7fc04faad1533d57dfac0d0d13fb9d655362c988 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Tue, 13 Aug 2024 17:43:34 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9ABUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/utils/tool.js | 21 +++++++++++-------- .../src/views/classManage/reserv-item.vue | 8 +++---- src/renderer/src/views/prepare/index.vue | 1 - 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index c9c91f1..28c7902 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -82,7 +82,9 @@ export function ipcHandle(fn,key, cb) { * @param {*} data 参数 * @returns */ +let wins_tool = null export const createWindow = async (type, data) => { + if (wins_tool) return console.error('createWindow: win is have') if (!type) return console.error('createWindow: type is null') switch(type) { case 'tool-sphere': { // 创建-悬浮球 @@ -97,16 +99,16 @@ export const createWindow = async (type, data) => { } data.isConsole = true // 是否开启控制台 data.option = {...defOption, ...option} - const win = await toolWindow(data) - win.type = type // 唯一标识 - win.show() - win.setFullScreen(true) // 设置窗口为全屏 - win.setIgnoreMouseEvents(true, {forward: true}) // 忽略鼠标事件但是事件继续传递给窗口 - win.setAlwaysOnTop(true,'screen-saver') // 将窗口设置为顶层窗口 - win.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见 + wins_tool = await toolWindow(data) + wins_tool.type = type // 唯一标识 + wins_tool.show() + wins_tool.setFullScreen(true) // 设置窗口为全屏 + wins_tool.setIgnoreMouseEvents(true, {forward: true}) // 忽略鼠标事件但是事件继续传递给窗口 + wins_tool.setAlwaysOnTop(true,'screen-saver') // 将窗口设置为顶层窗口 + wins_tool.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见 // win.webContents.openDevTools() // 打开调试工具 - eventHandles(type, win) // 事件监听处理 - return win + eventHandles(type, wins_tool) // 事件监听处理 + return wins_tool } case 'open-PDF': { //课本展示-pdf const option = data.option||{} @@ -193,6 +195,7 @@ const eventHandles = (type, win) => { win.on('closed', () => { if(onClosed) onClosed() // 自定义关闭事件 win = null + wins_tool = null }) // 新窗口-创建事件(如:主进程加载远程服务) ipcRenderer.send('new-window', {id:win.id, type}) diff --git a/src/renderer/src/views/classManage/reserv-item.vue b/src/renderer/src/views/classManage/reserv-item.vue index 685d03a..76d2726 100644 --- a/src/renderer/src/views/classManage/reserv-item.vue +++ b/src/renderer/src/views/classManage/reserv-item.vue @@ -68,18 +68,18 @@ const startClassR = (item) => { } }) } -const toolStore = useToolState() +// const toolStore = useToolState() +let wins = null; // 上课-工具类悬浮 const openLesson = () => { - if (toolStore.isToolWin) return ElMessage.error('您当前已开始上课,请勿重复操作') startClass(props.item.id) listEntpcourse({ evalid: props.item.ex2, edituserid: useUserStore().user.userId, pageSize: 500 - }).then(res=>{ + }).then(async res=>{ if (res.rows[0].id) { - createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id }) + wins = await createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id }) } }) } diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 13933d5..b8a21f8 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -596,7 +596,6 @@ export default { // 上课-工具类悬浮 openLesson() { const toolStore = useToolState() - if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作') startClass(this.curClassReserv.id) createWindow('tool-sphere', { url: From 79055dc1c26c90d87936be683d880807e3dcbe59 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Wed, 14 Aug 2024 09:58:14 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9ABUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/tool/sphere.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index 982b5e6..766f276 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -109,7 +109,7 @@ const sideMouse = e => { mouseChange(type == 'mouseleave') } // 侧边工具栏: 操作变化 -const sideChange = o => { +const sideChange = async o => { // console.log(o) switch(o.prop) { case 'resource': // 资源 @@ -120,7 +120,7 @@ const sideChange = o => { break case 'over': // 下课 toolStore.isToolWin = false - endClass(route.query.reservId) + await endClass(route.query.reservId) ipcMsgSend('tool-sphere:close') break } From c3709bf0c7497d7a708b278f4858af28cde81aa1 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Wed, 14 Aug 2024 11:00:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9ABUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/renderer/src/api/classManage/index.js | 4 ++-- src/renderer/src/views/prepare/index.vue | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5c5797a..1bdad80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win", - "version": "1.0.7", + "version": "1.1.0", "description": "An Electron application with Vue", "main": "./out/main/index.js", "author": "example.com", diff --git a/src/renderer/src/api/classManage/index.js b/src/renderer/src/api/classManage/index.js index 6db5913..923c722 100644 --- a/src/renderer/src/api/classManage/index.js +++ b/src/renderer/src/api/classManage/index.js @@ -159,11 +159,11 @@ export function deleteSmartReserv(id) { method: 'delete' }) } -export function startClass(id) { +export function startClass(id, ex3) { return request({ url: '/smarttalk/classReserv/startClass', method: 'get', - params: {id} + params: {id, ex3} }) } export function endClass(id) { diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index b8a21f8..ea7cbcc 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -594,9 +594,8 @@ export default { }) }, // 上课-工具类悬浮 - openLesson() { - const toolStore = useToolState() - startClass(this.curClassReserv.id) + async openLesson() { + await startClass(this.curClassReserv.id) createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + From 41b0660559047298582707b6b77f311fe72aca62 Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 14 Aug 2024 14:03:06 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=89=93=E5=BC=80=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=20url=20=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prepare/container/file-list-item.vue | 7 +++++-- src/renderer/src/views/prepare/index.vue | 21 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/views/prepare/container/file-list-item.vue b/src/renderer/src/views/prepare/container/file-list-item.vue index 92bc0af..96302ab 100644 --- a/src/renderer/src/views/prepare/container/file-list-item.vue +++ b/src/renderer/src/views/prepare/container/file-list-item.vue @@ -168,7 +168,7 @@ export default { } } }, - emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null }, + emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null,'on-filearg': null }, data() { return { listenList: [], @@ -266,15 +266,18 @@ export default { }, // 文件资源打开web AIX 布置作业 openFileLink(item){ + let unitId = item.levelSecondId ? item.levelSecondId : item.levelFirstId // key 对应的 linkConfig.js 外部链接配置 let key = 'filehomework' let configObj = outLink()[key] // 通知主进程 ipcRenderer.send('openWindow', { key, - fullPath: configObj.fullPath + `&fileShowName=${item.fileShowName}&fileFullPath=${item.fileFullPath}`, + fullPath: configObj.fullPath + `&fileShowName=${item.fileShowName}&fileFullPath=${item.fileFullPath}&unitId=${unitId}`, cookieData: { ...configObj.data } }) + + this.$emit('on-filearg', item) } }, mounted() { diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 489c993..61e57ca 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -79,6 +79,7 @@ @on-delete="deleteTalk" @on-set="openSet" @on-delhomework="delhomework" + @on-filearg="isOpenHomework = true" > @@ -91,6 +92,7 @@ @on-delete="deleteTalk" @on-set="openSet" @on-delhomework="delhomework" + > @@ -227,8 +229,8 @@ export default { const curWin = Remote.getCurrentWindow() curWin.on('focus', ()=>{ if(!this.isOpenHomework) return - console.log(100) this.initHomeWork() + this.asyncAllFile() this.isOpenHomework = false }) @@ -475,10 +477,21 @@ export default { } // key 对应的 linkConfig.js 外部链接配置 let configObj = outLink()[key] + let fullPath = configObj.fullPath + //打开作业 高考 url增加unitId 章节ID + if(key != 'standard' && key != 'aiModel'){ + let unitId = this.uploadData.levelSecondId ? this.uploadData.levelSecondId : this.uploadData.levelFirstId + if(key == 'gk'){ + fullPath += `?unitId=${unitId}` + } + else{ + fullPath += `&unitId=${unitId}` + } + } // 通知主进程 ipcRenderer.send('openWindow', { key, - fullPath: configObj.fullPath, + fullPath: fullPath, cookieData: { ...configObj.data } }) }, @@ -551,10 +564,8 @@ export default { res.rows[i].entpcourseworklistarray = [] } } - // 去重 - let ary = uniqBy([...this.currentFileList, ...list], 'id') // 深度克隆 - this.currentWorkList = cloneDeep(ary) + this.currentWorkList = cloneDeep(list) }) }, getWeekday1(date) { From bf783cf940f5c594b58d9e6db212b6e547d09937 Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 14 Aug 2024 14:07:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 1a6e7c3..a26068a 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -147,7 +147,7 @@ import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue' import SetHomework from './container/set-homework.vue' import outLink from '@/utils/linkConfig' import { createWindow } from '@/utils/tool' -import { uniqBy, cloneDeep } from 'lodash' +import { cloneDeep } from 'lodash' import { delClasswork, addEntpcourse } from '@/api/teaching/classwork' import { getSelfReserv, startClass } from '@/api/classManage' const toolStore = useToolState()