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..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 }}

+
+
+
@@ -36,7 +48,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 TypingEffect from '@/components/typing-effect/index.vue' +import { createOutlineV2 } from '@/utils/ppt-request.js' import useUserStore from '@/store/modules/user' const curMode = ref(2) @@ -64,8 +76,9 @@ emitter.on('selected', (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) @@ -88,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 @@ -119,17 +131,17 @@ const createAi = async ()=>{ // 知识库模型 else { const res = await completion(params) + data = res.data } - console.log(data) - emitter.emit('onResult', data.answer) - answer.value = getResult(data.answer) - - onSaveTemp(data.answer) + const res = await createOutlineV2({query: data.answer}) + console.log(res) + emitter.emit('onResult', res) + Object.assign(answer, res.outline) + onSaveTemp(JSON.stringify(res.outline)) } finally { loading.value = false } - } @@ -170,11 +182,6 @@ const delAnswer = () =>{ } -// 去掉字符串中的 ### ** -let getResult = (str) => { - let newStr = str.replace(/#+|(\*\*)/g, ''); - return newStr -} // 千帆创建对话 const conversation_id = ref('') @@ -227,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 3f4a612..0ac347c 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 +