From f7a3aa6e538b2b7d1c284cd0d7bf112f2e2e9f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Fri, 20 Dec 2024 16:37:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=A7=91=E5=AD=A6=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=EF=BC=9A=E5=AD=A6=E7=A7=91=E5=86=99=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/selectClass.vue | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue index e539610..0837584 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue @@ -61,14 +61,27 @@ const checkList = ref([])// 当前年级对应学科的课程, // 获取基础的学科 const getSubject = () => { //没有学科则不进行下面的步骤 - if(!userStore.subject) return - listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => { - const arr = userStore.subject.split(',') - subjectList.value = res.rows.filter(item => arr.includes(String(item.id))).map(items => items) +// if(!userStore.subject) return +// listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => { +// const arr = userStore.subject.split(',') +// subjectList.value = res.rows.filter(item => arr.includes(String(item.id))).map(items => items) +// console.log(subjectList,'subjectList'); +// }) + //这里获取死数据 学科list + const edustageList = ['小学','初中','高中']; + const subList = ['数学','物理','化学','生物','科学']; + edustageList.forEach((item) => { + subList.forEach((subItems) => { + subjectList.value.push({ + edustage: item, + edusubject: subItems, + itemtitle: subItems + }) + }) + }) console.log(subjectList,'subjectList'); - }) - // 默认读取一个学科 - handleUserEduStage(useClassTaskStore().experimentObj.edustage) + // 默认读取一个学科 + handleUserEduStage(useClassTaskStore().experimentObj.edustage) } // 展示有 实验科目的学科 const isExpList = (edusubject) => { From 7aa75794dc0043f18bb755cf312be77f2ed336ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Fri, 20 Dec 2024 17:16:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=A7=91=E5=AD=A6=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=EF=BC=9A=E6=89=B9=E6=94=B9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/classTask/item-dialog-score.vue | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue b/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue index 0c90c6c..1e23490 100644 --- a/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue +++ b/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue @@ -709,29 +709,33 @@ const acceptParams = async (params) => { } else { // 学生回答 if (params.studentObj.worktype == '常规作业' || params.studentObj.worktype == '科学实验') { - try { - // 老师布置的附件 datacontent TODO:常规作业、其他类型还未接入 - const res = await getClassworkdata(params.studentObj.id); - if(res.data.datacontent != ''){ - const teachWorkFileList = JSON.parse(res.data.datacontent); - console.log(teachWorkFileList, '老师filelist-------------') - teachWorkFileList && - teachWorkFileList.forEach((item) => { - if ( - item.name.indexOf('jpg') > -1 || - item.name.indexOf('jpeg') > -1 || - item.name.indexOf('png') > -1 - ) { - teachImageList.value.push(item) - } else { - teachFileList.value.push(item) - } - }) - teacherFeedContentList.value.push(teachWorkFileList) - } + if(params.studentObj.worktype == '常规作业'){ + try { + // 老师布置的附件 datacontent TODO:常规作业、其他类型还未接入 + const res = await getClassworkdata(params.studentObj.id); + if(res.data.datacontent != ''){ + const teachWorkFileList = JSON.parse(res.data.datacontent); + console.log(teachWorkFileList, '老师filelist-------------') + teachWorkFileList && + teachWorkFileList.forEach((item) => { + if ( + item.name.indexOf('jpg') > -1 || + item.name.indexOf('jpeg') > -1 || + item.name.indexOf('png') > -1 + ) { + teachImageList.value.push(item) + } else { + teachFileList.value.push(item) + } + }) + teacherFeedContentList.value.push(teachWorkFileList) + } - } catch (error) { - console.error('Invalid JSON:', error) + } catch (error) { + console.error('Invalid JSON:', error) + } + }else{ + // TODO 科学实验 布置的活动 暂时不在批改中显示 2024-12-20 } params.studentQuizAllList.forEach((item) => { From 6b45fa61dd631aa760f4a5ad19163ad4568cc887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Fri, 20 Dec 2024 17:17:35 +0800 Subject: [PATCH 3/4] 1 --- .../views/classTask/container/classTask/item-dialog-score.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue b/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue index 1e23490..79a062e 100644 --- a/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue +++ b/src/renderer/src/views/classTask/container/classTask/item-dialog-score.vue @@ -735,7 +735,7 @@ const acceptParams = async (params) => { console.error('Invalid JSON:', error) } }else{ - // TODO 科学实验 布置的活动 暂时不在批改中显示 2024-12-20 + // TODO 科学实验 老师布置的活动 暂时不在批改中显示 2024-12-20 } params.studentQuizAllList.forEach((item) => { From acb02313041d2883fbe0f412ac13b2d9a4cecb52 Mon Sep 17 00:00:00 2001 From: zdg Date: Sat, 21 Dec 2024 12:15:58 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.pptList=20=E5=AE=9E=E9=AA=8C=E5=AE=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=202.pplList=20=E6=89=B9=E9=87=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/App.vue | 2 - src/renderer/src/AixPPTist/src/api/index.ts | 21 ++++++-- src/renderer/src/AixPPTist/src/api/types.ts | 2 + src/renderer/src/AixPPTist/src/api/watcher.ts | 7 ++- src/renderer/src/plugins/imChat/msgEnum.js | 2 + src/renderer/src/utils/dialog.js | 49 +++++++++++++++++++ .../src/views/classTask/teachClassTask.vue | 14 ++++-- 7 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 src/renderer/src/utils/dialog.js diff --git a/src/renderer/src/AixPPTist/src/App.vue b/src/renderer/src/AixPPTist/src/App.vue index 74c4b73..7fe9cd8 100644 --- a/src/renderer/src/AixPPTist/src/App.vue +++ b/src/renderer/src/AixPPTist/src/App.vue @@ -74,8 +74,6 @@ const initLoad: Function = () => { !!(opt.ratio??null) && slidesStore.setViewportRatio(opt.ratio)// 有比例配置项 } return PPTApi.getSlideList(resource.id) - // PPTApi.updateWorkList() - // return Promise.resolve() } return Promise.resolve() } diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index a82ffc4..5e5bcb6 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -50,6 +50,8 @@ export class Utils { }, delay) } } + // 延时 + static sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) } /** ppt相关后端接口处理 */ @@ -84,6 +86,12 @@ export class PPTApi { slidesStore.setWorkItem(workItem) // 没有上课时调用-作业列表 if(!classcourse) this.updateWorkList() + // 没有上课时调用-批量更新缩略图 + if(!classcourse) { + Utils.sleep(1500).then(() => { + this.batchUpdateThumUrl() + }) + } resolve(true) } else msgUtils.msgError(res.msg || '获取数据失败');resolve(false) }) @@ -233,13 +241,20 @@ export class PPTApi { // 批量更新缩略图-异步 static batchUpdateThumUrl() { - return new Promise(async resolve => { + return nextTick().then(async () => { const list = slidesStore.workItem || [] - if (!list.length) return resolve() + if (!list.length) return const upList = [] for (const [ind,o] of list.entries()) { - const thumUrl = await this.getSlideThumUrl(ind) + const isCreate = !o.fileurl // 是否创建 + if (isCreate) { + const thumUrl = await this.getSlideThumUrl(ind) + upList.push({ id: o.id, fileurl: thumUrl }) + } } + if (!upList.length) return + // 批量更新 + return await API_entpcoursefile.batchUpdateNew(upList) }) } diff --git a/src/renderer/src/AixPPTist/src/api/types.ts b/src/renderer/src/AixPPTist/src/api/types.ts index 3678ed4..0beb5ef 100644 --- a/src/renderer/src/AixPPTist/src/api/types.ts +++ b/src/renderer/src/AixPPTist/src/api/types.ts @@ -126,6 +126,8 @@ export class MsgEnum { MSG_homework : 'HOMEWORK', /** @desc: 公屏 - 课堂作业|活动 */ MSG_pushSreen_work : 'pushSreen_work', + /** @desc: 公屏 - 实验 */ + MSG_pushSreen_experiment : 'pushSreen_experiment', /** @desc: 点赞 */ MSG_dz : 'dz', /** @desc: 疑惑 */ diff --git a/src/renderer/src/AixPPTist/src/api/watcher.ts b/src/renderer/src/AixPPTist/src/api/watcher.ts index 34c3294..005aef2 100644 --- a/src/renderer/src/AixPPTist/src/api/watcher.ts +++ b/src/renderer/src/AixPPTist/src/api/watcher.ts @@ -10,6 +10,7 @@ import { MsgEnum } from './types' // 消息枚举 import ChatWs from '@/plugins/socket' // 聊天socket import Classcourse from './classcourse' // 课程相关 import msgUtils from '@/plugins/modal' // 消息工具 +import * as dialogUtils from '@/utils/dialog' // 弹窗-函数 import { Homework } from './index' // api-作业相关 // import emitter from '@/utils/mitt' //mitt 事件总线 import useExecPlay from '../views/Screen/hooks/useExecPlay' // 播放控制 @@ -114,6 +115,10 @@ export default () => { if (!content.id) return Homework.showHomework(content.id) break + case MsgEnum.HEADS.MSG_pushSreen_experiment: // 打开实验: + if (!content.url) return + dialogUtils.openLink(content.url) + break case MsgEnum.HEADS.MSG_closed: // 下课: close() break @@ -137,4 +142,4 @@ export default () => { window.close() // 关闭窗口 }, 1000) } -} +} \ No newline at end of file diff --git a/src/renderer/src/plugins/imChat/msgEnum.js b/src/renderer/src/plugins/imChat/msgEnum.js index a83fed7..42458a2 100644 --- a/src/renderer/src/plugins/imChat/msgEnum.js +++ b/src/renderer/src/plugins/imChat/msgEnum.js @@ -100,6 +100,8 @@ export class MsgEnum { MSG_homework : 'HOMEWORK', /** @desc: 公屏 - 课堂作业|活动 */ MSG_pushSreen_work : 'pushSreen_work', + /** @desc: 公屏 - 实验 */ + MSG_pushSreen_experiment : 'pushSreen_experiment', /** @desc: 点赞 */ MSG_dz : 'dz', /** @desc: 疑惑 */ diff --git a/src/renderer/src/utils/dialog.js b/src/renderer/src/utils/dialog.js new file mode 100644 index 0000000..66b41d3 --- /dev/null +++ b/src/renderer/src/utils/dialog.js @@ -0,0 +1,49 @@ +/** + * 弹窗-函数 + */ +import { h, render } from 'vue' +import { ElDialog } from 'element-plus' + +// 打开弹窗-函数 +export const openDialog = (option, content) => { + let vNode + const body = document.body + const dOpts = { + modelValue: true, + width: 800, + height: 600, + title: '添加-超连接', + draggable: true, + 'onUpdate:modelValue': val => { + if (vNode && !val) render(null, body) + }, + ...option + } + vNode = h(ElDialog, dOpts, { + default: typeof content == 'function' ? content(h) : content + }) + render(vNode, body) +} + +// 打开链接 +export const openLink = (option, title) => { + // https://phet.colorado.edu/sims/html/number-play/latest/number-play_zh_CN.html + const isStr = typeof option == 'string' + const opt = isStr ? {} : option + const url = isStr ? option : option?.url || option?.src || option?.href + const titleNew = isStr? title||'实验室' : option?.title || '添加-超连接' + openDialog({ + title: titleNew, + ...opt + }, (h) => { + return h('iframe', { + src: url, + width: '100%', + style: { + height: 'calc(80vh - 75px)', + }, + scrolling: 'no', + frameborder: '0', + }) + }) +} \ No newline at end of file diff --git a/src/renderer/src/views/classTask/teachClassTask.vue b/src/renderer/src/views/classTask/teachClassTask.vue index 83b5ec9..0d1afe6 100644 --- a/src/renderer/src/views/classTask/teachClassTask.vue +++ b/src/renderer/src/views/classTask/teachClassTask.vue @@ -721,19 +721,23 @@ const msgHandle = (msg) => { const { head, content, ...other } = msg switch(head) { case MsgEnum.HEADS.MSG_closed: // 下课: - Homework.win = null - window.close() // 关闭窗口 - break + Homework.win = null + window.close() // 关闭窗口 + break case MsgEnum.HEADS.MSG_finishHomework: // 跟新作业: console.log('更新作业', head, content) const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); openDialog(data, false); - break + break case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面 console.log('切换页面-关闭窗口') Homework.win = null window.close() // 关闭窗口 - break + break + case MsgEnum.HEADS.MSG_pushSreen_experiment: // 实验: + Homework.win = null + window.close() // 关闭窗口 + break // case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[] // { // (data||[]).forEach(o => {