ppt缩略图生成
This commit is contained in:
parent
c152a3d3ee
commit
db86299523
|
@ -205,13 +205,12 @@ import TreeLog from '@/views/prepare/components/treeLog.vue'
|
||||||
import classStart from './container/class-start.vue' // 预备上课
|
import classStart from './container/class-start.vue' // 预备上课
|
||||||
import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举
|
import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举
|
||||||
import * as commUtils from "@/utils/comm";
|
import * as commUtils from "@/utils/comm";
|
||||||
import * as Api_server from "@/api/apiService";
|
|
||||||
import msgUtils from "@/plugins/modal";
|
import msgUtils from "@/plugins/modal";
|
||||||
|
import * as Api_server from "@/api/apiService";
|
||||||
import * as API_entpcoursefile from "@/api/education/entpcoursefile";
|
import * as API_entpcoursefile from "@/api/education/entpcoursefile";
|
||||||
|
import { slidesToImg } from '@/utils/ppt' // ppt相关工具
|
||||||
import ChatWs from '@/plugins/socket' // 聊天socket
|
import ChatWs from '@/plugins/socket' // 聊天socket
|
||||||
if (!ChatWs.ws) ChatWs.init()
|
if (!ChatWs.ws) ChatWs.init()
|
||||||
// import Chat from '@/utils/chat' // im 登录初始化
|
|
||||||
// if (!Chat.imChat) Chat.init()
|
|
||||||
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
@ -573,8 +572,9 @@ export default {
|
||||||
},500)
|
},500)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFilePicker(){
|
async openFilePicker(){
|
||||||
this.$refs.fileInput.click();
|
this.$refs.fileInput.click();
|
||||||
|
// const files = await commUtils.getFiles()
|
||||||
},
|
},
|
||||||
handleFileChange(){
|
handleFileChange(){
|
||||||
const file = event.target.files[0];
|
const file = event.target.files[0];
|
||||||
|
@ -634,6 +634,8 @@ export default {
|
||||||
this.pgDialog.pg.percentage = 0
|
this.pgDialog.pg.percentage = 0
|
||||||
const resPptJson = await PPTXFileToJson(file)
|
const resPptJson = await PPTXFileToJson(file)
|
||||||
const { def, slides, ...content } = resPptJson
|
const { def, slides, ...content } = resPptJson
|
||||||
|
// 生成缩略图
|
||||||
|
const thumbnails = await slidesToImg(slides, content.width)
|
||||||
// 转换图片|音频|视频 为线上地址
|
// 转换图片|音频|视频 为线上地址
|
||||||
let completed = 0
|
let completed = 0
|
||||||
const total = slides.length
|
const total = slides.length
|
||||||
|
@ -686,6 +688,7 @@ export default {
|
||||||
title: '',
|
title: '',
|
||||||
filetype: 'slide',
|
filetype: 'slide',
|
||||||
slides: resSlides,
|
slides: resSlides,
|
||||||
|
thumbnails, // 缩略图
|
||||||
edituserid: this.userStore.userId
|
edituserid: this.userStore.userId
|
||||||
}
|
}
|
||||||
const res_3 = await API_entpcoursefile.batchAddNew(params)
|
const res_3 = await API_entpcoursefile.batchAddNew(params)
|
||||||
|
|
Loading…
Reference in New Issue