diff --git a/src/renderer/src/utils/ppt-request.js b/src/renderer/src/utils/ppt-request.js index 642d9a9..2918d0c 100644 --- a/src/renderer/src/utils/ppt-request.js +++ b/src/renderer/src/utils/ppt-request.js @@ -107,12 +107,12 @@ const getBackGroundV2 = async () => { } }; -const createOutlineV2 = async (params) => { +const createOutlineV2 = async (data) => { try { const response = await request({ url:"/api/aipptV2/createOutlineV2", - method: "POST", - params + method: "POST", + data }); console.log("createOutline response:", response); @@ -133,6 +133,18 @@ const createPPTV2 = async (data) => { throw error; } }; + +const createPptByOutline = async (data) => { + try { + const response = await req("/api/aipptV2/createPptByOutline", "POST", data); + console.log("createOutline response:", response); + + return response.data; + } catch (error) { + console.error("请求失败:", error); + throw error; + } +}; const getProgressV2 = async (id) => { try { const response = await req(`/api/aipptV2/progressV2?sid=${id}`, "GET"); @@ -143,4 +155,4 @@ const getProgressV2 = async (id) => { } }; -export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createOutlineV2, createPPTV2, getProgressV2, createByOutline }; +export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createOutlineV2, createPPTV2, getProgressV2, createByOutline, createPptByOutline }; diff --git a/src/renderer/src/views/prepare/container/pptist-dialog.vue b/src/renderer/src/views/prepare/container/pptist-dialog.vue index 0d907b4..0bad55b 100644 --- a/src/renderer/src/views/prepare/container/pptist-dialog.vue +++ b/src/renderer/src/views/prepare/container/pptist-dialog.vue @@ -34,8 +34,10 @@ import AiPptist from './ai-pptistV2.vue'; import {Select} from "@element-plus/icons-vue"; import {ref, defineEmits, onMounted} from "vue"; - import {createPPTV2, getBackGroundV2, getProgressV2} from "@/utils/ppt-request"; + import {createPPTV2, getBackGroundV2, getProgressV2, createPptByOutline} from "@/utils/ppt-request"; import {ElMessage} from "element-plus"; + import useUserStore from '@/store/modules/user' + const userStore = useUserStore() const model = defineModel() const emit = defineEmits(['addSuccess', 'close-dialogs']) const backGroundList = ref([]); @@ -60,7 +62,7 @@ const outlineData = ref({ query: '', // 用户要求(最多8000字) templateId: '', // ppt生成主题 - author: 'AIX平台', + author: userStore.user.nickName, isFigure: false, // 是否自动配图 search: true, language: "cn" @@ -68,9 +70,10 @@ const percentage = ref(0); const outlineCreatePPT = () => { const newOutlineData = { ...outlineData.value, }; - newOutlineData.query = props.dataList.outline; + newOutlineData.outline = props.dataList.outline; + newOutlineData.query = "通过传入大纲帮我生成相应的PPT课件" createPPTLoading.value = true; - createPPTV2(newOutlineData).then((res) => { + createPptByOutline(newOutlineData).then((res) => { console.log(res, "正在生成中"); createPPTLoading.value = false; activeStep.value = 2 diff --git a/src/renderer/src/views/teachingDesign/container/right2.vue b/src/renderer/src/views/teachingDesign/container/right2.vue index e3e5d72..300399f 100644 --- a/src/renderer/src/views/teachingDesign/container/right2.vue +++ b/src/renderer/src/views/teachingDesign/container/right2.vue @@ -33,12 +33,11 @@ import * as API_entpcourse from "@/api/education/entpcourse"; import * as API_entpcoursefile from "@/api/education/entpcoursefile"; import * as commUtils from '@/utils/comm.js' import * as Api_server from '@/api/apiService' // 相关api -import useUserStore from '@/store/modules/user' import {createWindow} from "@/utils/tool"; import {editSyllabus} from "@/api/mode"; import { getSmarttalkPage } from "@/api/file" +import useUserStore from '@/store/modules/user' const userStore = useUserStore() - const pptDialog = ref(false) const result = ref(null) const courseObj = reactive({ @@ -70,6 +69,8 @@ emitter.on('onResult', (data)=>{ listEntpcoursefileNew({parentid: result.value.parentId}).then(res=>{ pptSlides.value = res.rows }) + }else { + pptSlides.value = [] } })