From 1132dc2c0d4c5ec9fa772d20993f7f5007cf9c03 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Tue, 7 Jan 2025 15:24:26 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=94=9F=E6=88=90ppt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/utils/ppt-request.js | 20 +++++++++++++++---- .../views/prepare/container/pptist-dialog.vue | 11 ++++++---- .../views/teachingDesign/container/right2.vue | 5 +++-- 3 files changed, 26 insertions(+), 10 deletions(-) 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 = [] } }) From 7c1d669a569a34625ef5612f1d7d2800e4647356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Tue, 7 Jan 2025 16:06:40 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 811c1cc..0ed1188 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -14,17 +14,17 @@
{{ index + 1 }} - {{ i + 1}} : {{ el.chapterTitle }}
+ +{{ index + 1 }} - {{ i + 1 }} : {{ el.chapterTitle }}
+