From e8ecc274418367b4737c938ee8fe32374c2801bb Mon Sep 17 00:00:00 2001 From: zdg Date: Thu, 12 Dec 2024 17:33:39 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/api/classcourse.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/AixPPTist/src/api/classcourse.ts b/src/renderer/src/AixPPTist/src/api/classcourse.ts index 30e65e8..a3c7693 100644 --- a/src/renderer/src/AixPPTist/src/api/classcourse.ts +++ b/src/renderer/src/AixPPTist/src/api/classcourse.ts @@ -7,6 +7,7 @@ import { sessionStore } from '@/utils/store' // electron-store 状态管理 import * as useStore from '../store' // pptist-状态管理 import ChatWs from '@/plugins/socket' // 聊天socket import msgUtils from '@/plugins/modal' // 消息工具 +import * as Fullscreen from '../utils/fullscreen' // 全屏 const slidesStore = useStore.useSlidesStore() // 幻灯片-状态管理 const screenStore = useStore.useScreenStore() // 全屏-状态管理 @@ -27,7 +28,9 @@ export class Classcourse { load() { console.log('classcourse-load', classcourse) // 打开全屏 - screenStore.setScreening(!!classcourse) + const isCourse = !!classcourse + if (isCourse) Fullscreen.enterFullscreen() + screenStore.setScreening(isCourse) // 如果课堂信息有值,则连接socket if (!!classcourse) { // 连接socket From be2afadd43d7db0bf16c4194086f8890f207b85e Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 13 Dec 2024 10:10:36 +0800 Subject: [PATCH 02/23] edit --- .../src/components/template-study/container/right.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 2ac4a57..bc06fd4 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -161,7 +161,7 @@ const isStarted = ref([]); const listRef = ref() // 查询模板结果 const getTempResult = () => { - tempResult({ mainModelId: curTemplate.id, pageNum: 1, pageSize: 10000 }).then(res => { + tempResult({ mainModelId: curTemplate.id, pageNum: 1, pageSize: 10000, ex1: curNode.id }).then(res => { let rows = res.rows childTempList.value.forEach(item => { rows.forEach(el => { @@ -309,7 +309,7 @@ const againResult = async (index, item) => { await nextTick() childTempList.value[index].loading = true item.aiShow = true - params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` + params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` const { data } = await completion(params) childTempList.value[index].answer = getResult(data.answer); isStarted.value[index] = true @@ -333,7 +333,7 @@ const getCompletion = async () => { try { item.loading = true item.aiShow = true - params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` + params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` const { data } = await completion(params) item.answer = getResult(data.answer) onSaveTemp(item) @@ -377,7 +377,8 @@ const onSaveTemp = (item) => { mainModelId: curTemplate.id, modelId: item.id, examDocld: '', - content: item.answer + content: item.answer, + ex1: curNode.id } tempSave(data).then(res => { }) } From b5669a97f1d0bd51d3e2b8024c5654524599a784 Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 13 Dec 2024 10:28:42 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/template-study/container/right.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index bc06fd4..95c00a5 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -91,11 +91,12 @@ import keywordDialog from './keyword-dialog.vue'; import AdjustDialog from './adjust-dialog.vue' import EditDialog from './edit-dialog.vue' import TypingEffect from '@/components/typing-effect/index.vue' +import useUserStore from '@/store/modules/user' import emitter from '@/utils/mitt'; import { dataSetJson } from '@/utils/comm.js' const props = defineProps(['curNode', 'type']) - +const { user } = useUserStore() /*****************提示词相关****************/ /** @@ -137,7 +138,7 @@ const curTemplate = reactive({ name: '', id: '' }) const templateList = ref([]) const childTempList = ref([]) const getTemplateList = () => { - modelList({ model: props.type, type: 1, pageNum: 1, pageSize: 10000, ex1: curNode.edustage, ex2: curNode.edusubject }).then(res => { + modelList({ createUser: user.userId, model: props.type, type: 1, pageNum: 1, pageSize: 10000, ex1: curNode.edustage, ex2: curNode.edusubject }).then(res => { templateList.value = res.rows if(res.rows.length > 0){ Object.assign(curTemplate, res.rows[0]); From 83d885bcbea9d3a7d7278f73553148e83e5d7134 Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 13 Dec 2024 10:33:35 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/template-study/container/right.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 95c00a5..b763a63 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -97,6 +97,7 @@ import { dataSetJson } from '@/utils/comm.js' const props = defineProps(['curNode', 'type']) const { user } = useUserStore() + /*****************提示词相关****************/ /** From a3079a87d01166e8627531eb2e5fa88a18ee112d Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 13 Dec 2024 10:58:01 +0800 Subject: [PATCH 05/23] =?UTF-8?q?edit=20=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/keyword-dialog.vue | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/components/template-study/container/keyword-dialog.vue b/src/renderer/src/components/template-study/container/keyword-dialog.vue index 4eb1cd2..bdd6c29 100644 --- a/src/renderer/src/components/template-study/container/keyword-dialog.vue +++ b/src/renderer/src/components/template-study/container/keyword-dialog.vue @@ -40,7 +40,7 @@ const props = defineProps({ type: Number, default: 1 }, - item: { // 子模板 + item: { // 当前操作的模板 type: Object, default: () => { return { ex3: '' } @@ -73,23 +73,25 @@ const loading = ref(false) const saveAdd = async () => { loading.value = true if (props.item.ex3 == '1') { - + let id; // id 为主模板id if (props.item.isAdd) { - try { - // 系统预设模板 copy一份 - const { msg } = await addKeyWords({ name: form.name, id: props.item.id }) - emitter.emit('onGetMain') - ElMessage.success(msg) - mode.value = false - } finally { - loading.value = false - } + id = props.item.id } else{ - onAddChildTemp(props.item.parentId) + // 编辑状态下 item 为子模板 主模板则是item.parentId + id = props.item.parentId } + try { + // 系统预设模板 copy一份 + const { msg } = await addKeyWords({ name: form.name, id }) + emitter.emit('onGetMain') + ElMessage.success(msg) + mode.value = false + } finally { + loading.value = false + } + } else { - if (props.item.isAdd) { onAddChildTemp(props.item.id) } From 8f8016cb0b6e9bec0ecb20d066c199f05d591823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666> Date: Fri, 13 Dec 2024 11:18:33 +0800 Subject: [PATCH 06/23] =?UTF-8?q?fix=EF=BC=9A=E6=B7=BB=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=A4=B4=E5=83=8F=E4=BB=A5=E5=8F=8Apptlist=E7=9A=84bu?= =?UTF-8?q?g=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/api/index.ts | 37 ++++++++++--------- .../src/AixPPTist/src/store/slides.ts | 9 +---- .../ElementStylePanel/Active/index.vue | 4 +- src/renderer/src/layout/components/Aside.vue | 3 +- .../src/views/profile/cropperImage.vue | 4 +- src/renderer/src/views/profile/userAvatar.vue | 5 ++- src/renderer/src/views/profile/userInfo.vue | 2 +- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index 611efb6..ba0130e 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -55,26 +55,28 @@ export class PPTApi { // 变量 static isUpdate = true // 是否更新数据 - // 获取所有幻灯片列表 - static getSlideList(parentid: (Number | String)): Promise { + // 获取所有幻灯片列表 isUpdate为true不更新 + static getSlideList(parentid: (Number | String),isUpdate?:Boolean): Promise { return new Promise(async (resolve, reject) => { const params: object = { parentid, orderByColumn: 'fileidx', isAsc: 'asc', pageSize: 9999 } const res: Result = await API_entpcoursefile.listEntpcoursefileNew(params) - if (res.code === 200) { - const slides = (res.rows || []).map(o => { - if (!!o.datacontent) { - const json = JSON.parse(o.datacontent) - !!json && (json.id = o.id) - return json - } - // 如果没有数据,默认空白页 - return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}} - }) + if (res.code === 200) { + if(!isUpdate){ + const slides = (res.rows || []).map(o => { + if (!!o.datacontent) { + const json = JSON.parse(o.datacontent) + !!json && (json.id = o.id) + return json + } + // 如果没有数据,默认空白页 + return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}} + }) + // slidesStore.updateSlideIndex(0) // 下标0 为第一页 + slidesStore.setSlides(slides) // 写入数据 + } // 活动列表处理 const workList = (res.rows || []).map(o => o.activityContent) - const workItem = [...res.rows] - // slidesStore.updateSlideIndex(0) // 下标0 为第一页 - slidesStore.setSlides(slides) // 写入数据 + const workItem = res.rows ? [...res.rows] : [] // 写入作业列表数据 slidesStore.setWorkList(workList) // 获取所有的pptlist的数据 @@ -111,7 +113,6 @@ export class PPTApi { data.id = rid slidesStore.updateSlide(data) // msgUtils.msgSuccess('新增成功') - PPTApi.getSlideList(resource.id) this.isUpdate = false // 新增后会触发监听,不再更新数据 resolve(true) } else msgUtils.msgError('新增失败');resolve(false) @@ -134,7 +135,9 @@ export class PPTApi { const isAdd = !/^\d+$/.test(currentSlide.id) // 是否新增 if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片) const bool = await this.addSlide(currentSlide) - bool && this.batchUpdateSlides(newData, true) // 批量更新-排序 + bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序 + const resource = sessionStore.get('curr.resource')||{} + await PPTApi.getSlideList(resource.id) } else { // 防抖-更新 if (!this.isUpdate) return this.isUpdate = true // 下次更新数据 const params = { diff --git a/src/renderer/src/AixPPTist/src/store/slides.ts b/src/renderer/src/AixPPTist/src/store/slides.ts index 37ba6b2..c86c7c7 100644 --- a/src/renderer/src/AixPPTist/src/store/slides.ts +++ b/src/renderer/src/AixPPTist/src/store/slides.ts @@ -145,21 +145,16 @@ export const useSlidesStore = defineStore('slides', { setWorkItem(list: Object[]) { this.workItem = list }, - addWorkItem(data: any) { - const id = data?.id - if (!id) return - this.workItem.splice(this.slideIndex + 1, 0, data) - this.slideIndex += 1 - }, addSlide(slide: Slide | Slide[]) { const slides = Array.isArray(slide) ? slide : [slide] for (const slide of slides) { if (slide.sectionTag) delete slide.sectionTag } + // const addIndex = this.slideIndex + 1 this.slides.splice(this.slideIndex, 0, ...slides) + // this.slideIndex = addIndex }, - updateSlide(props: Partial, slideId?: string) { const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex this.slides[slideIndex] = { ...this.slides[slideIndex], ...props } diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue index cddd334..29792de 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue @@ -302,9 +302,9 @@ const getData = async (data: WorkItem) => { dialogVisible.value = false } const upDateData = async () => { - // await PPTApi.updateSlide(paramData.value) loadingActive.value = true - await updateEntpcoursefileNew(paramData.value) + await PPTApi.updateSlide(paramData.value) + // await updateEntpcoursefileNew(paramData.value) const resource = sessionStore.get('curr.resource') await PPTApi.getSlideList(resource.id) const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 }) diff --git a/src/renderer/src/layout/components/Aside.vue b/src/renderer/src/layout/components/Aside.vue index 9182498..607ee26 100644 --- a/src/renderer/src/layout/components/Aside.vue +++ b/src/renderer/src/layout/components/Aside.vue @@ -5,7 +5,7 @@ @@ -59,6 +59,7 @@ import { ElMessageBox, ElMessage } from 'element-plus' import useUserStore from '@/store/modules/user' import { sessionStore } from '@/utils/store' import pkc from "../../../../../package.json" +import defaultUserImg from '@/assets/images/img-avatar.png' const { ipcRenderer } = window.electron || {} diff --git a/src/renderer/src/views/profile/cropperImage.vue b/src/renderer/src/views/profile/cropperImage.vue index 702315b..ac19786 100644 --- a/src/renderer/src/views/profile/cropperImage.vue +++ b/src/renderer/src/views/profile/cropperImage.vue @@ -11,7 +11,7 @@
- +
@@ -164,7 +164,7 @@ export default { // 页面刷新自动执行 onMounted(() => { if (props.filePath) { - dataFile.image.src = dev_api.value + props.filePath; + dataFile.image.src = props.filePath; copper(); } }); diff --git a/src/renderer/src/views/profile/userAvatar.vue b/src/renderer/src/views/profile/userAvatar.vue index 9e3fa07..3d3bf4e 100644 --- a/src/renderer/src/views/profile/userAvatar.vue +++ b/src/renderer/src/views/profile/userAvatar.vue @@ -1,6 +1,6 @@ + \ No newline at end of file From 6eda37c8c9c7a77516993f7625066538d125f811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666> Date: Mon, 16 Dec 2024 09:55:48 +0800 Subject: [PATCH 13/23] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E6=B4=BB=E5=8A=A8=E7=9A=84=E6=96=B9=E5=BC=8F=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/store/slides.ts | 6 +++--- .../Editor/Toolbar/ElementStylePanel/Active/index.vue | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/store/slides.ts b/src/renderer/src/AixPPTist/src/store/slides.ts index c86c7c7..d7a3bae 100644 --- a/src/renderer/src/AixPPTist/src/store/slides.ts +++ b/src/renderer/src/AixPPTist/src/store/slides.ts @@ -151,9 +151,9 @@ export const useSlidesStore = defineStore('slides', { for (const slide of slides) { if (slide.sectionTag) delete slide.sectionTag } - // const addIndex = this.slideIndex + 1 - this.slides.splice(this.slideIndex, 0, ...slides) - // this.slideIndex = addIndex + const addIndex = this.slideIndex + 1 + this.slides.splice(addIndex, 0, ...slides) + this.slideIndex = addIndex }, updateSlide(props: Partial, slideId?: string) { const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue index 1294986..de3a244 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue @@ -45,9 +45,9 @@
- - -
+ + +
@@ -335,9 +335,10 @@ onMounted(() => { objItem.value = workItem.value[slideIndex.value] getCurrentPPtData() }) -watch(() => [workItem.value.length,slideIndex.value], (newVal,oldVal) => { +watch(() => [workItem.value.length,workItem.value[slideIndex.value]?.id], (newVal,oldVal) => { if(!objectsAreEqual(newVal,oldVal)) - getCurrentPPtData() + if(workItem.value[slideIndex.value]) + getCurrentPPtData() }) // watch(() => workItem.value.length, () => { // getCurrentPPtData() From 37d0592dcc69b002cf925050bd56d9da358b9f7e Mon Sep 17 00:00:00 2001 From: lyc Date: Mon, 16 Dec 2024 10:06:14 +0800 Subject: [PATCH 14/23] edit --- .../views/teachingDesign/container/right.vue | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/views/teachingDesign/container/right.vue b/src/renderer/src/views/teachingDesign/container/right.vue index 84e572b..61b323b 100644 --- a/src/renderer/src/views/teachingDesign/container/right.vue +++ b/src/renderer/src/views/teachingDesign/container/right.vue @@ -484,8 +484,29 @@ onUnmounted(() => { .con-item { width: 100%; flex-direction: column; - margin-bottom: 20px; - + padding-bottom: 20px; + position: relative; + padding-left: 15px; + box-sizing: border-box; + &::after{ + content: ''; + width: 15px; + height: 15px; + border-radius: 50%; + background: #409eff; + position: absolute; + left: -8px; + top: 5px; + } + &::before{ + content: ''; + width: 2px; + height: 100%; + background: #409eff; + position: absolute; + left: -1px; + top: 5px; + } .item-top { justify-content: space-between; align-items: center; From 9ad959dfb73e656de7afd12e585cb8b7043b55f0 Mon Sep 17 00:00:00 2001 From: zdg Date: Mon, 16 Dec 2024 10:15:08 +0800 Subject: [PATCH 15/23] =?UTF-8?q?ppt=E4=B8=8A=E8=AF=BE=20=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=E6=8E=92=E5=BA=8F=20=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E6=92=AD=E6=94=BE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron.vite.config.mjs | 1 + src/renderer/src/AixPPTist/src/App.vue | 2 +- .../src/AixPPTist/src/api/classcourse.ts | 4 +- src/renderer/src/AixPPTist/src/api/index.ts | 38 ++++++++++++++----- src/renderer/src/AixPPTist/src/api/watcher.ts | 4 +- .../AixPPTist/src/views/Screen/BaseView.vue | 32 +++++++++++++++- .../src/views/Screen/hooks/useExecPlay.ts | 21 +++++----- .../src/views/classTask/teachClassTask.vue | 4 +- 8 files changed, 80 insertions(+), 26 deletions(-) diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index 962bf8f..fb25549 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -33,6 +33,7 @@ export default defineConfig({ proxy: { '/dev-api': { target: 'http://27.128.240.72:7865', + // target: 'https://prev.ysaix.com:7868/prod-api/', // target: 'http://36.134.181.164:7863', // target: 'http://192.168.0.102:7865', changeOrigin: true, diff --git a/src/renderer/src/AixPPTist/src/App.vue b/src/renderer/src/AixPPTist/src/App.vue index c06919f..7fe9cd8 100644 --- a/src/renderer/src/AixPPTist/src/App.vue +++ b/src/renderer/src/AixPPTist/src/App.vue @@ -28,8 +28,8 @@ import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api import { PPTApi } from './api' import { sessionStore } from '@/utils/store' // electron-store 状态管理 -// import './api/watcher' // 监听 import watcher from './api/watcher' // 监听 +import emitter from '@/utils/mitt' //mitt 事件总线 watcher() // 监听启动 const loading = ref(true) const _isPC = isPC() diff --git a/src/renderer/src/AixPPTist/src/api/classcourse.ts b/src/renderer/src/AixPPTist/src/api/classcourse.ts index f15b0af..e513f3c 100644 --- a/src/renderer/src/AixPPTist/src/api/classcourse.ts +++ b/src/renderer/src/AixPPTist/src/api/classcourse.ts @@ -7,7 +7,6 @@ import { sessionStore } from '@/utils/store' // electron-store 状态管理 import * as useStore from '../store' // pptist-状态管理 import ChatWs from '@/plugins/socket' // 聊天socket import msgUtils from '@/plugins/modal' // 消息工具 -import * as Fullscreen from '../utils/fullscreen' // 全屏 import useExecPlay from '../views/Screen/hooks/useExecPlay' // 播放控制 const slidesStore = useStore.useSlidesStore() // 幻灯片-状态管理 @@ -31,10 +30,9 @@ export class Classcourse { console.log('classcourse-load', classcourse) // 打开全屏 const isCourse = !!classcourse - if (isCourse) Fullscreen.enterFullscreen() screenStore.setScreening(isCourse) // 如果课堂信息有值,则连接socket - if (!!classcourse) { + if (isCourse) { // 连接socket if (!ChatWs.ws) ChatWs.init() ChatWs.id = classcourse.timgroupid // 群组id diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index ba0130e..6d4126a 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -3,7 +3,7 @@ * @author zdg * @date 2024-11-26 */ -import { toRaw } from 'vue' +import { toRaw, nextTick } from 'vue' import type { Result } from './types' // 接口类型 import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api @@ -12,7 +12,8 @@ import * as useStore from '../store' // pptist-状态管理 import { sessionStore } from '@/utils/store' // electron-store 状态管理 import useUserStore from '@/store/modules/user' // 外部-用户信息 import * as Api_server from '@/api/apiService' // 相关api -import * as commUtils from '@/utils/comm.js' +import * as commUtils from '@/utils/comm.js' // 工具 +import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库 const slidesStore = useStore.useSlidesStore() const userStore = useUserStore() @@ -133,6 +134,9 @@ export class PPTApi { const currentSlide = toRaw(slidesStore.currentSlide) const isAdd = !/^\d+$/.test(currentSlide.id) // 是否新增 + const currInd = toRaw(slidesStore.slideIndex) // 当前页索引-new + const oldInd = oldData.findIndex(o => o.id == currentSlide.id) // 当前页索引-old + const isBatch = oldVal && oldVal.length && currInd != oldInd // 是否批量更新-排序 if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片) const bool = await this.addSlide(currentSlide) bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序 @@ -140,16 +144,22 @@ export class PPTApi { await PPTApi.getSlideList(resource.id) } else { // 防抖-更新 if (!this.isUpdate) return this.isUpdate = true // 下次更新数据 - const params = { - id: currentSlide.id, - datacontent: JSON.stringify(currentSlide), + if (isBatch) { // 批量更新-排序 + this.batchUpdateSlides(newData, true) + } else { // 更新当前页幻灯片 + const params = { + id: currentSlide.id, + datacontent: JSON.stringify(currentSlide), + } + Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2) } - Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2) } } // 更新幻灯片 static updateSlide(data: object): Promise { return new Promise(async (resolve, reject) => { + const thumUrl = await this.getSlideThumUrl() + data.base64Code = thumUrl // 更新缩略图 const res: Result = await API_entpcoursefile.updateEntpcoursefileNew(data) if (res.code === 200) { resolve(true) @@ -192,7 +202,18 @@ export class PPTApi { else msgUtils.msgError(res.msg || '更新失败');return false }) } - + // thumbnail-slide thumbnail 缩略图 + static getSlideThumUrl(): Promise { + return nextTick().then(async() => { + const slideIndex = slidesStore.slideIndex + const elements = document.querySelectorAll('.thumbnail-slide') + if (elements.length && slideIndex >= 0) { + const element = elements[slideIndex] + return await toPng(element) + } + return null + }) + } // 图片|音频|视频 转换为在线地址 static toRousrceUrl =async (o:any) => { const formData = new FormData() @@ -203,8 +224,7 @@ export class PPTApi { url &&(o.src = url) return url } - -} + } } export class Homework{ diff --git a/src/renderer/src/AixPPTist/src/api/watcher.ts b/src/renderer/src/AixPPTist/src/api/watcher.ts index f555f3d..8189fb5 100644 --- a/src/renderer/src/AixPPTist/src/api/watcher.ts +++ b/src/renderer/src/AixPPTist/src/api/watcher.ts @@ -86,8 +86,8 @@ export default () => { case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页 const slideIndex = content?.current || 0 const type = content?.animation - if (type === 'Nextsteps') execPlay.execNext() // 下一步 - else if (type === 'Previoustep') execPlay.execPrev() // 上一步 + if (type === 'Nextsteps') emitter.emit('useExecPlay', 'execNext') // 下一步 + else if (type === 'Previoustep') emitter.emit('useExecPlay', 'turnPrevSlide') // 上一步清空-动画 else slidesStore.updateSlideIndex(slideIndex) // 更新幻灯片下标 break case MsgEnum.HEADS.MSG_homework: // 作业|活动-布置 diff --git a/src/renderer/src/AixPPTist/src/views/Screen/BaseView.vue b/src/renderer/src/AixPPTist/src/views/Screen/BaseView.vue index d4cd388..ae2add1 100644 --- a/src/renderer/src/AixPPTist/src/views/Screen/BaseView.vue +++ b/src/renderer/src/AixPPTist/src/views/Screen/BaseView.vue @@ -100,7 +100,6 @@ const { execNext, animationIndex, } = useExecPlay() - const { slideWidth, slideHeight } = useSlideSize() const { exitScreening } = useScreening() const { fullscreenState, manualExitFullscreen } = useFullscreen() @@ -197,6 +196,37 @@ const contextmenus = (): ContextmenuItem[] => { emitter.on('upvoteTrigger', (type) => { upvoteRef.value?.trigger(type) }); +// zdg: 使用方法才生效 +const execPlay = { + autoPlayTimer, + autoPlay, + closeAutoPlay, + autoPlayInterval, + setAutoPlayInterval, + loopPlay, + setLoopPlay, + mousewheelListener, + touchStartListener, + touchEndListener, + turnPrevSlide, + turnNextSlide, + turnSlideToIndex, + turnSlideToId, + execPrev, + execNext, + animationIndex, +} +emitter.on('useExecPlay', (data: string|any) => { + if (!data) throw new Error('参数错误') + if (typeof data === 'string') { // 字符串 + if (execPlay[data]) execPlay[data]() + else throw new Error('方法不存在') + } else { // 对象 + const { method, ...params } = data || {} + if (execPlay[method]) execPlay[method](...params) + else throw new Error('方法不存在') + } +}) diff --git a/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts b/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts index 8ec0233..4b0016c 100644 --- a/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts +++ b/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts @@ -174,9 +174,8 @@ export default () => { // 鼠标滚动翻页 const mousewheelListener = throttle(function(e: WheelEvent) { - e.preventDefault() // 阻止默认事件 - if (e.deltaY < 0) execPrev() - else if (e.deltaY > 0) execNext() + if (e.deltaY < 0) turning(e, 'prev') + else if (e.deltaY > 0) turning(e, 'next') }, 500, { leading: true, trailing: false }) // 触摸屏上下滑动翻页 @@ -197,24 +196,28 @@ export default () => { const offsetY = e.changedTouches[0].clientY - touchInfo.value.y if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) { touchInfo.value = null - if (offsetY > 0) execPrev() - else execNext() + if (offsetY > 0) turning(e, 'prev') + else turning(e, 'next') } } - + // 向上翻页/向下翻页 + const turning = (e, type) => { + e.preventDefault() // 阻止默认事件 + if (type === 'prev') execPrev() + else if (type === 'next') execNext() + } // 快捷键翻页 const keydownListener = (e: KeyboardEvent) => { - e.preventDefault() // 阻止默认事件 const key = e.key.toUpperCase() - if (key === KEYS.UP || key === KEYS.LEFT || key === KEYS.PAGEUP) execPrev() + if (key === KEYS.UP || key === KEYS.LEFT || key === KEYS.PAGEUP) turning(e, 'prev') else if ( key === KEYS.DOWN || key === KEYS.RIGHT || key === KEYS.SPACE || key === KEYS.ENTER || key === KEYS.PAGEDOWN - ) execNext() + ) turning(e, 'next') } onMounted(() => document.addEventListener('keydown', keydownListener)) diff --git a/src/renderer/src/views/classTask/teachClassTask.vue b/src/renderer/src/views/classTask/teachClassTask.vue index 8d0db52..3db91ae 100644 --- a/src/renderer/src/views/classTask/teachClassTask.vue +++ b/src/renderer/src/views/classTask/teachClassTask.vue @@ -4,7 +4,7 @@
{{ classWorkAnalysis.title }}完成情况 - {{ + {{ classWorkAnalysis.worktype }}
@@ -726,6 +726,7 @@ const msgHandle = (msg) => { openDialog(data, false); break case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面 + console.log('切换页面-关闭窗口') window.close() // 关闭窗口 break // case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[] @@ -765,6 +766,7 @@ onMounted(() => { // im监听消息 if (ChatWs.ws) { + console.log('socket监听消息') ChatWs.watch((msg, e) => { try { msgHandle(JSON.parse(msg)) From d018a282008275538edd0b82ce3103e99fb02f44 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Mon, 16 Dec 2024 10:19:04 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E5=80=92=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/login/index.vue | 31 +++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/views/login/index.vue b/src/renderer/src/views/login/index.vue index 6a76a52..9b506aa 100644 --- a/src/renderer/src/views/login/index.vue +++ b/src/renderer/src/views/login/index.vue @@ -38,7 +38,7 @@ - 发送验证码 + {{ codeName }} @@ -64,7 +64,7 @@ width="500" style=" -webkit-app-region: no-drag;" > - 根据图片回答相关问题 + 根据图片回答相关问题1
@@ -162,6 +162,14 @@ const sbmitImg=()=>{ ElMessage.success('短信发送成功') ruleForm.Code=res.data isImg.value=false + codeName.value=60 + timer.value=setInterval(()=>{ + codeName.value-- + if(codeName.value==0){ + codeName.value='发送验证码' + clearInterval(timer.value); + } + },1000) } }) @@ -182,14 +190,14 @@ const sendyzm=()=>{ isPeopleImg.value='data:image/jpg;base64,'+res.img isImg.value=true resImg.imgData=res - codeName.value=60 - timer.value=setInterval(()=>{ - codeName.value-- - if(codeName.value==0){ - codeName.value='发送验证码' - clearInterval(timer.value); - } - },1000) + // codeName.value=60 + // timer.value=setInterval(()=>{ + // codeName.value-- + // if(codeName.value==0){ + // codeName.value='发送验证码' + // clearInterval(timer.value); + // } + // },1000) }else{ ElMessage.error(res.msg) } @@ -278,6 +286,9 @@ const setCookie = (name, value) => { } const gotoLogin = () => { codeName.value='发送验证码' + if (timer.value){ + clearInterval(timer.value); + } if (ruleFormRef.value) ruleFormRef.value.resetFields() isRegister.value = true } From a973d296fe49e0e41366d5d1b2356ad72c38bfc1 Mon Sep 17 00:00:00 2001 From: zdg Date: Mon, 16 Dec 2024 12:18:19 +0800 Subject: [PATCH 17/23] =?UTF-8?q?=E6=9B=B4=E6=96=B0ppt=E6=B4=BB=E5=8A=A8?= 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 | 33 +++++++++++++++++-- src/renderer/src/AixPPTist/src/api/store.ts | 18 +++++----- src/renderer/src/AixPPTist/src/api/watcher.ts | 5 +++ .../ElementStylePanel/Active/index.vue | 8 ++--- 5 files changed, 51 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/App.vue b/src/renderer/src/AixPPTist/src/App.vue index 7fe9cd8..74c4b73 100644 --- a/src/renderer/src/AixPPTist/src/App.vue +++ b/src/renderer/src/AixPPTist/src/App.vue @@ -74,6 +74,8 @@ 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 6d4126a..ccf7909 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -8,6 +8,7 @@ import type { Result } from './types' // 接口类型 import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api import * as API_smarttalk from '@/api/file' // 相关api +import * as API_classwork from '@/api/teaching/classwork' // 相关api import * as useStore from '../store' // pptist-状态管理 import { sessionStore } from '@/utils/store' // electron-store 状态管理 import useUserStore from '@/store/modules/user' // 外部-用户信息 @@ -76,12 +77,14 @@ export class PPTApi { slidesStore.setSlides(slides) // 写入数据 } // 活动列表处理 - const workList = (res.rows || []).map(o => o.activityContent) + // const workList = (res.rows || []).map(o => o.activityContent) const workItem = res.rows ? [...res.rows] : [] // 写入作业列表数据 - slidesStore.setWorkList(workList) + // slidesStore.setWorkList(workList) // 获取所有的pptlist的数据 slidesStore.setWorkItem(workItem) + + this.updateWorkList() resolve(true) } else msgUtils.msgError(res.msg || '获取数据失败');resolve(false) }) @@ -202,6 +205,32 @@ export class PPTApi { else msgUtils.msgError(res.msg || '更新失败');return false }) } + + // 更新-活动列表 + static async updateWorkList(): Promise { + const resolveData = (resolve, data = []) => { + slidesStore.setWorkList(data) + return resolve() + } + return new Promise(async (resolve, reject) => { + const workItem = slidesStore.workItem // 所有的pptlist的数据-原始数据 + const currentSlide = slidesStore.currentSlide // 当前页幻灯片 + const slideId = currentSlide.id // 当前页幻灯片id + if (!slideId) return resolveData(resolve) + // slide详情获取-作业id + // const res = await API_entpcoursefile.getEntpcoursefile(slideId) + // const workIds = res?.data?.activityContent||'' + // workItem-获取作业id + const workIds = workItem.find(o => o.id == slideId)?.activityContent + console.log('更新-活动列表', workItem, currentSlide, slideId, workIds) + if (!workIds) return resolveData(resolve) + // 获取作业列表 + const resW = await API_classwork.homeworklist({ ids: workIds, pageSize: 1000 }) + if (resW && resW.rows) return resolveData(resolve, resW.rows) + else msgUtils.msgError(resW.msg || '更新失败');return resolveData(resolve) + }) + } + // thumbnail-slide thumbnail 缩略图 static getSlideThumUrl(): Promise { return nextTick().then(async() => { diff --git a/src/renderer/src/AixPPTist/src/api/store.ts b/src/renderer/src/AixPPTist/src/api/store.ts index 7ec18ea..37591c4 100644 --- a/src/renderer/src/AixPPTist/src/api/store.ts +++ b/src/renderer/src/AixPPTist/src/api/store.ts @@ -7,13 +7,13 @@ import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api export default class { - // 删除幻灯片 - static delSlide(id: string): Promise { - return new Promise(async (resolve, reject) => { - const res: Result = await API_entpcoursefile.delEntpcoursefile(id) - if (res.code === 200) { - resolve(true) - } else msgUtils.msgError(res.msg || '删除失败');resolve(false) - }) - } + // 删除幻灯片 + static delSlide(id: string): Promise { + return new Promise(async (resolve, reject) => { + const res: Result = await API_entpcoursefile.delEntpcoursefile(id) + if (res.code === 200) { + resolve(true) + } else msgUtils.msgError(res.msg || '删除失败');resolve(false) + }) + } } \ No newline at end of file diff --git a/src/renderer/src/AixPPTist/src/api/watcher.ts b/src/renderer/src/AixPPTist/src/api/watcher.ts index 8189fb5..f5d91cb 100644 --- a/src/renderer/src/AixPPTist/src/api/watcher.ts +++ b/src/renderer/src/AixPPTist/src/api/watcher.ts @@ -35,6 +35,11 @@ export default () => { updatePPT({title: newVal}) }) + // 监听幻灯片下标变化 + watch(() => slidesStore.slideIndex, (newVal, oldVal) => { + PPTApi.updateWorkList() + }) + // 消息监听ws // console.log('监听器已开启', ChatWs) if (!!ChatWs.ws) { diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue index de3a244..7bba00e 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue @@ -32,7 +32,7 @@
-