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 @@
- +
{{ node.label }} - +
- +
{{ node.label }} - +
@@ -44,8 +44,9 @@
-
+
@@ -341,6 +342,7 @@ onMounted( async () => { } .tree-label-wrap, .tree-label { + max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; From 49facdffa9233a8d36af6dc3ed3b3af74360199d Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 7 Jan 2025 16:25:07 +0800 Subject: [PATCH 3/6] =?UTF-8?q?edit=20=E6=A1=86=E6=9E=B6=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/teachingDesign/container/center.vue | 142 ++++++++++++------ .../teachingDesign/container/edit-dialog.vue | 59 ++++++-- 2 files changed, 142 insertions(+), 59 deletions(-) diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index 0627f9f..4c01048 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -13,30 +13,38 @@ 删除大纲 - + 编辑大纲
- -
封面页
-
-
标题:{{ answer.title }}
-
副标题:{{answer.subTitle }}
-
-
目录页
-
-
{{index + 1}}:{{ item.chapterTitle }}
-
-

{{ index + 1 }} - {{ i + 1}} : {{ el.chapterTitle }}

+ +
- + \ No newline at end of file diff --git a/src/renderer/src/views/teachingDesign/container/edit-dialog.vue b/src/renderer/src/views/teachingDesign/container/edit-dialog.vue index 49c7601..24c8528 100644 --- a/src/renderer/src/views/teachingDesign/container/edit-dialog.vue +++ b/src/renderer/src/views/teachingDesign/container/edit-dialog.vue @@ -7,11 +7,28 @@
- - - - - + +
+ +.sidebar { + width: 100%; + padding: 5px; + display: flex; + justify-content: space-between; +} - \ No newline at end of file +.nav-level-one,.nav-level-two { + margin-bottom: 20px; + width: 120px; +} +.nav-level-two .nav-item{ + text-align: center; +} + +.nav-item { + display: flex; + align-items: center; + margin-bottom: 10px; + padding: 8px 10px; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +.nav-item:hover { + background-color: rgb(245, 247, 250); +} + +.nav-text { + flex: 1; + font-size: 14px; + color: #333; +} + +.nav-arrow { + font-size: 12px; + margin-left: auto; +} + +.nav-level-one.nav-item:first-child.nav-text { + color: blue; +} +.active .nav-text{ + font-weight: bold; + color:rgb(64, 158, 255) +} +.active .icon{ + font-weight: bold; + color:rgb(64, 158, 255) +} + \ No newline at end of file