From 7be60a3d72c6434fe255e18b45d6635b99b0ac70 Mon Sep 17 00:00:00 2001 From: lyc Date: Mon, 6 Jan 2025 17:24:56 +0800 Subject: [PATCH 1/4] edit --- src/renderer/src/utils/ppt-request.js | 8 +- .../views/teachingDesign/container/center.vue | 6 +- .../views/teachingDesign/container/left2.vue | 218 +++++++++--------- 3 files changed, 119 insertions(+), 113 deletions(-) diff --git a/src/renderer/src/utils/ppt-request.js b/src/renderer/src/utils/ppt-request.js index f080ece..642d9a9 100644 --- a/src/renderer/src/utils/ppt-request.js +++ b/src/renderer/src/utils/ppt-request.js @@ -107,9 +107,13 @@ const getBackGroundV2 = async () => { } }; -const createOutlineV2 = async (data) => { +const createOutlineV2 = async (params) => { try { - const response = await req("/api/aipptV2/createOutlineV2", "POST", data); + const response = await request({ + url:"/api/aipptV2/createOutlineV2", + method: "POST", + params + }); console.log("createOutline response:", response); return response.data; diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index ae9fa30..96515a1 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -36,6 +36,7 @@ import emitter from '@/utils/mitt' import * as commUtils from '@/utils/comm.js' import { createChart, sendChart } from '@/api/ai/index' import { completion, addSyllabus, syllabuss, removeSyllabus } from '@/api/mode/index.js' +import { createOutlineV2 } from '@/utils/ppt-request.js' import TypingEffect from '@/components/typing-effect/index.vue' import useUserStore from '@/store/modules/user' @@ -59,6 +60,7 @@ const modeOptions = ref([ // 选中的环节 const selectedData = ref([]) emitter.on('selected', (data)=>{ + console.log(data,3000) selectedData.value = data }) // 回显大纲 @@ -119,9 +121,11 @@ const createAi = async ()=>{ // 知识库模型 else { const res = await completion(params) + data = res.data } - console.log(data) + const res = await createOutlineV2({query: data.answer}) + console.log(res) emitter.emit('onResult', data.answer) answer.value = getResult(data.answer) diff --git a/src/renderer/src/views/teachingDesign/container/left2.vue b/src/renderer/src/views/teachingDesign/container/left2.vue index 3f4a612..def98d7 100644 --- a/src/renderer/src/views/teachingDesign/container/left2.vue +++ b/src/renderer/src/views/teachingDesign/container/left2.vue @@ -4,8 +4,11 @@ 教学模式
重置 - 新增 + 新增
@@ -13,33 +16,34 @@
- {{ item.name }} - -
- 添加 - 编辑 -
+ {{ item.name }} + +
+ 添加 + 编辑 +
- - + +
-
+
{{ child.name }} - - 编辑 + + 编辑
- - + +
+ style="border-radius: 10px; padding: 10px 15px"> - -
+ +
删除
@@ -64,7 +68,6 @@
- \ No newline at end of file + From fb428ba5cae411026d617b1325401674096452ce 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 10:52:36 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=85=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=B8=8E=E8=B6=85=E9=95=BF=E2=80=A6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 50526fb..811c1cc 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -11,15 +11,21 @@ :default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current @node-click="handleNodeClick"> @@ -334,7 +340,7 @@ onMounted( async () => { } } -.tree-label { +.tree-label-wrap, .tree-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; From 586ce134f84f08933b03c947236de3cf2251f43c Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 7 Jan 2025 11:02:11 +0800 Subject: [PATCH 3/4] =?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 | 49 ++++++++++++------- .../views/teachingDesign/container/left2.vue | 4 +- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index 96515a1..0627f9f 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -20,8 +20,20 @@
- - + +
封面页
+
+
标题:{{ answer.title }}
+
副标题:{{answer.subTitle }}
+
+
目录页
+
+
{{index + 1}}:{{ item.chapterTitle }}
+
+

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

+
+
+
@@ -37,7 +49,6 @@ import * as commUtils from '@/utils/comm.js' import { createChart, sendChart } from '@/api/ai/index' import { completion, addSyllabus, syllabuss, removeSyllabus } from '@/api/mode/index.js' import { createOutlineV2 } from '@/utils/ppt-request.js' -import TypingEffect from '@/components/typing-effect/index.vue' import useUserStore from '@/store/modules/user' const curMode = ref(2) @@ -60,14 +71,14 @@ const modeOptions = ref([ // 选中的环节 const selectedData = ref([]) emitter.on('selected', (data)=>{ - console.log(data,3000) selectedData.value = data }) // 回显大纲 const curItem = reactive({}) emitter.on('onShow', (data)=>{ + console.log(data) aiShow.value = false - answer.value = getResult(data.outline) + Object.assign(answer, JSON.parse(data.outline)) Object.assign(curItem, data) curItem.answer = curItem.outline getDetails(data.id) @@ -90,10 +101,9 @@ const params = reactive( // 研读 const loading = ref(false) -const answer = ref('') +const answer = reactive({}) const createAi = async ()=>{ - console.log(selectedData.value) if(selectedData.value.length == 0){ ElMessage.warning('请先选择教学环节后再生成教学大纲') return @@ -126,14 +136,12 @@ const createAi = async ()=>{ } const res = await createOutlineV2({query: data.answer}) console.log(res) - emitter.emit('onResult', data.answer) - answer.value = getResult(data.answer) - - onSaveTemp(data.answer) + emitter.emit('onResult', res) + Object.assign(answer, res.outline) + onSaveTemp(JSON.stringify(res.outline)) } finally { loading.value = false } - } @@ -174,11 +182,6 @@ const delAnswer = () =>{ } -// 去掉字符串中的 ### ** -let getResult = (str) => { - let newStr = str.replace(/#+|(\*\*)/g, ''); - return newStr -} // 千帆创建对话 const conversation_id = ref('') @@ -231,6 +234,18 @@ onMounted(() => { border-radius: 5px; text-align: left; overflow-y: auto; + padding: 15px; + .con-item{ + display: flex; + flex-direction: column; + margin-top: 15px; + .item-text{ + background: #F2F2F2; + padding: 15px; + border-radius: 5px; + margin-top: 10px; + } + } } } diff --git a/src/renderer/src/views/teachingDesign/container/left2.vue b/src/renderer/src/views/teachingDesign/container/left2.vue index def98d7..0ac347c 100644 --- a/src/renderer/src/views/teachingDesign/container/left2.vue +++ b/src/renderer/src/views/teachingDesign/container/left2.vue @@ -5,8 +5,8 @@
重置 新增
From 57caed47dd33721931fd76a40549696f6dc1442a Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Tue, 7 Jan 2025 11:03:05 +0800 Subject: [PATCH 4/4] =?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/views/model/index.vue | 1 + .../views/prepare/container/pptist-dialog.vue | 156 +++++++++- .../views/teachingDesign/container/center.vue | 12 +- .../container/progress-dialog.vue | 11 +- .../views/teachingDesign/container/right2.vue | 293 +++++++++++++++++- .../src/views/teachingDesign/index.vue | 12 +- 6 files changed, 455 insertions(+), 30 deletions(-) diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index f869bee..8e2049a 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -680,6 +680,7 @@ onMounted(async () => { display: flex; flex-wrap: wrap; gap: 15px; + padding: 10px; .content-body-right-item{ &:hover{ cursor: pointer; diff --git a/src/renderer/src/views/prepare/container/pptist-dialog.vue b/src/renderer/src/views/prepare/container/pptist-dialog.vue index 22b2155..0d907b4 100644 --- a/src/renderer/src/views/prepare/container/pptist-dialog.vue +++ b/src/renderer/src/views/prepare/container/pptist-dialog.vue @@ -1,30 +1,120 @@ diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index ae9fa30..ed59b32 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -9,11 +9,11 @@ 生成教学大纲 - + 删除大纲 - + 编辑大纲 @@ -96,7 +96,7 @@ const createAi = async ()=>{ ElMessage.warning('请先选择教学环节后再生成教学大纲') return } - + let str = selectedData.value.map( item => item.name).join('、') let bookV = curNode.roottitle.split('-')[1] + '版' loading.value = true @@ -167,7 +167,7 @@ const delAnswer = () =>{ emitter.emit('resetSelect') }) .catch(() => {}) - + } // 去掉字符串中的 ### ** @@ -188,7 +188,7 @@ const getChartId = () => { onUnmounted(()=>{ emitter.off('selected') emitter.off('onShow') - + }) const curNode = reactive({}) @@ -230,4 +230,4 @@ onMounted(() => { } } - \ No newline at end of file + diff --git a/src/renderer/src/views/teachingDesign/container/progress-dialog.vue b/src/renderer/src/views/teachingDesign/container/progress-dialog.vue index 5bfe036..7f01c73 100644 --- a/src/renderer/src/views/teachingDesign/container/progress-dialog.vue +++ b/src/renderer/src/views/teachingDesign/container/progress-dialog.vue @@ -1,6 +1,6 @@ @@ -29,5 +29,10 @@ const dAttrs = computed(() => { }) \ No newline at end of file + + diff --git a/src/renderer/src/views/teachingDesign/container/right2.vue b/src/renderer/src/views/teachingDesign/container/right2.vue index 03ce212..e3e5d72 100644 --- a/src/renderer/src/views/teachingDesign/container/right2.vue +++ b/src/renderer/src/views/teachingDesign/container/right2.vue @@ -4,22 +4,73 @@ 课件预览
一键生成 - 编辑课件 + 编辑课件
- + +
+
{{index+1}}
+
+ +