diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index 658ba69..8255435 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -6,6 +6,7 @@ import { toRaw } from 'vue' import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api +import * as API_smarttalk from '@/api/file' // 相关api import * as useStore from '../store' // pptist-状态管理 import { sessionStore } from '@/utils/store' // electron-store 状态管理 import useUserStore from '@/store/modules/user' // 外部-用户信息 @@ -166,6 +167,14 @@ export class PPTApi { } else msgUtils.msgError(res.msg || '删除失败');resolve(false) }) } + + // 更新-备课资源 标题 + static updateSmarttalk(data: object): Promise { + return API_smarttalk.updateSmarttalk(data).then(res => { + if (res.code === 200) return true + else msgUtils.msgError(res.msg || '更新失败');return false + }) + } } export default PPTApi \ 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 b5648ea..f1f21ba 100644 --- a/src/renderer/src/AixPPTist/src/api/watcher.ts +++ b/src/renderer/src/AixPPTist/src/api/watcher.ts @@ -7,7 +7,8 @@ import { PPTApi } from './index' import * as store from '../store' import { sessionStore } from '@/utils/store' // electron-store 状态管理 const slidesStore = store.useSlidesStore() -const resource = sessionStore.get('curr.resource') +const resource = sessionStore.get('curr.resource') // apt 资源 +const smarttalk = sessionStore.get('curr.smarttalk') // 备课资源 /** * @description 监听器 */ @@ -28,4 +29,11 @@ const updatePPT = async (data) => { data.id = resource.id await PPTApi.updateSlide(data) // 更新ppt内容 sessionStore.set('curr.resource.title', data.title) + // 更新smarttalk内容 + if (!!smarttalk && !!data.title) { + const {id, fileFlag} = smarttalk + const params = { id, fileShowName: `${data.title}.${fileFlag}` } + await PPTApi.updateSmarttalk(params) // 更新ppt内容 + sessionStore.set('curr.smarttalk.fileShowName', params.fileShowName) + } } \ No newline at end of file diff --git a/src/renderer/src/components/file-image/index.vue b/src/renderer/src/components/file-image/index.vue index 092c238..3c6bd18 100644 --- a/src/renderer/src/components/file-image/index.vue +++ b/src/renderer/src/components/file-image/index.vue @@ -34,7 +34,8 @@ const getFileTypeIcon = () => { gif: 'icon-gif', txt: 'icon-txt', rar: 'icon-rar', - apt: 'icon-A' + apt: 'icon-A', + aptist: 'icon-A', } if (iconObj[name]) { return '#' + iconObj[name] diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index f39fc99..a8dfa14 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -53,6 +53,7 @@ import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons- import useUserStore from '@/store/modules/user' // 用户信息 import msgUtils from '@/plugins/modal' // 消息工具 import { createWindow, sessionStore } from '@/utils/tool' // 相关工具 +import * as API_smarttalk from '@/api/file' // 文件相关api import * as API_entpcourse from '@/api/education/entpcourse' // 相关api import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api import { dataSetJson } from '@/utils/comm' // 数据集id文生图 @@ -196,6 +197,19 @@ const getResourceList = async () => { // 统一HTTP处理 const HTTP_SERVER_API = (type, params = {}) => { 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': { // 添加课程 const node = courseObj.node || {} if (!node) return msgUtils.msgWarning('请选择章节?') @@ -278,6 +292,8 @@ const handleAll = async(type, row) =>{ } // 生成ppt课件-子级(slide) await HTTP_SERVER_API('addEntpcoursefile', params) + // 生成备课资源-Smarttalk + await HTTP_SERVER_API('addSmarttalk',{fileId: id}) // 刷新资源列表 await getResourceList() } else { diff --git a/src/renderer/src/views/prepare/container/class-start.vue b/src/renderer/src/views/prepare/container/class-start.vue index 7913a5c..3829064 100644 --- a/src/renderer/src/views/prepare/container/class-start.vue +++ b/src/renderer/src/views/prepare/container/class-start.vue @@ -59,14 +59,16 @@ @@ -81,7 +83,7 @@