From 586ce134f84f08933b03c947236de3cf2251f43c Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 7 Jan 2025 11:02:11 +0800 Subject: [PATCH] =?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 @@
重置 新增