From db8629952308f6320ebab3a3db1df2aa7c2a1c50 Mon Sep 17 00:00:00 2001 From: zdg Date: Tue, 24 Dec 2024 11:32:52 +0800 Subject: [PATCH] =?UTF-8?q?ppt=E7=BC=A9=E7=95=A5=E5=9B=BE=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index bd0b57b..7ee3ab0 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -205,13 +205,12 @@ import TreeLog from '@/views/prepare/components/treeLog.vue' import classStart from './container/class-start.vue' // 预备上课 import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举 import * as commUtils from "@/utils/comm"; -import * as Api_server from "@/api/apiService"; import msgUtils from "@/plugins/modal"; +import * as Api_server from "@/api/apiService"; import * as API_entpcoursefile from "@/api/education/entpcoursefile"; +import { slidesToImg } from '@/utils/ppt' // ppt相关工具 import ChatWs from '@/plugins/socket' // 聊天socket if (!ChatWs.ws) ChatWs.init() -// import Chat from '@/utils/chat' // im 登录初始化 -// if (!Chat.imChat) Chat.init() const toolStore = useToolState() const fs = require('fs') @@ -573,8 +572,9 @@ export default { },500) }) }, - openFilePicker(){ + async openFilePicker(){ this.$refs.fileInput.click(); + // const files = await commUtils.getFiles() }, handleFileChange(){ const file = event.target.files[0]; @@ -634,6 +634,8 @@ export default { this.pgDialog.pg.percentage = 0 const resPptJson = await PPTXFileToJson(file) const { def, slides, ...content } = resPptJson + // 生成缩略图 + const thumbnails = await slidesToImg(slides, content.width) // 转换图片|音频|视频 为线上地址 let completed = 0 const total = slides.length @@ -686,6 +688,7 @@ export default { title: '', filetype: 'slide', slides: resSlides, + thumbnails, // 缩略图 edituserid: this.userStore.userId } const res_3 = await API_entpcoursefile.batchAddNew(params)