ppt生产 #83
|
@ -68,6 +68,7 @@ import {PPTXFileToJson} from '@/AixPPTist/src/hooks/useImport' // ppt转json
|
||||||
import * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
import * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
||||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||||
import * as Api_server from '@/api/apiService' // 相关api
|
import * as Api_server from '@/api/apiService' // 相关api
|
||||||
|
import * as API_smarttalk from '@/api/file' // 文件相关api
|
||||||
import msgUtils from '@/plugins/modal' // 消息工具
|
import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
@ -136,6 +137,8 @@ const addAiPPT = async(res) => {
|
||||||
const p_params = {parentContent: JSON.stringify(content)}
|
const p_params = {parentContent: JSON.stringify(content)}
|
||||||
const parentid = await HTTP_SERVER_API('addEntpcoursefile', p_params)
|
const parentid = await HTTP_SERVER_API('addEntpcoursefile', p_params)
|
||||||
if (!!parentid??null) { // 生成内容幻灯片
|
if (!!parentid??null) { // 生成内容幻灯片
|
||||||
|
// 生成备课资源-Smarttalk
|
||||||
|
HTTP_SERVER_API('addSmarttalk',{fileId: parentid})
|
||||||
if (slides.length > 0) {
|
if (slides.length > 0) {
|
||||||
const resSlides = slides.map(({id, ...slide}) => JSON.stringify(slide))
|
const resSlides = slides.map(({id, ...slide}) => JSON.stringify(slide))
|
||||||
const params = {parentid, filetype: 'slide', title: '', slides: resSlides }
|
const params = {parentid, filetype: 'slide', title: '', slides: resSlides }
|
||||||
|
@ -206,6 +209,19 @@ emitter.on('changeResult', (item) => {
|
||||||
// 统一HTTP处理
|
// 统一HTTP处理
|
||||||
const HTTP_SERVER_API = (type, params = {}) => {
|
const HTTP_SERVER_API = (type, params = {}) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case 'addSmarttalk': { // 获取课程
|
||||||
|
const def = {
|
||||||
|
fileId: '', // 文件id - Entpcoursefile 对应id
|
||||||
|
fileFlag: 'aptist',
|
||||||
|
fileShowName: courseObj.coursetitle + '.aptist',
|
||||||
|
textbookId: courseObj.textbookId,
|
||||||
|
levelFirstId: courseObj.levelFirstId,
|
||||||
|
levelSecondId: courseObj.levelSecondId,
|
||||||
|
fileSource: '个人',
|
||||||
|
fileRoot: '备课'
|
||||||
|
}
|
||||||
|
return API_smarttalk.creatAPT({...def, ...params})
|
||||||
|
}
|
||||||
case 'addEntpcourse': { // 添加课程
|
case 'addEntpcourse': { // 添加课程
|
||||||
const node = courseObj.node || {}
|
const node = courseObj.node || {}
|
||||||
if (!node) return msgUtils.msgWarning('请选择章节?')
|
if (!node) return msgUtils.msgWarning('请选择章节?')
|
||||||
|
|
Loading…
Reference in New Issue