diff --git a/src/renderer/src/api/mode/index.js b/src/renderer/src/api/mode/index.js index 59d0380..add0402 100644 --- a/src/renderer/src/api/mode/index.js +++ b/src/renderer/src/api/mode/index.js @@ -119,3 +119,12 @@ export function docList(params) { } +// 保存教学大纲 +export function addSyllabus(data) { + return request({ + url: '/education/generate', + method: 'post', + data + }) +} + diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index e8cac67..2bb122c 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -25,10 +25,14 @@ import { sessionStore } from '@/utils/store' import emitter from '@/utils/mitt' import * as commUtils from '@/utils/comm.js' import { createChart, sendChart } from '@/api/ai/index' -import { completion, tempResult, tempSave, removeChildTemp, editTempResult, modelList } from '@/api/mode/index.js' +import { completion, addSyllabus } from '@/api/mode/index.js' import TypingEffect from '@/components/typing-effect/index.vue' +import useUserStore from '@/store/modules/user' const curMode = ref(2) + +const { user } = useUserStore() + const modeOptions = ref([ { label: '教学大模型', @@ -59,10 +63,13 @@ const params = reactive( const loading = ref(false) const answer = ref('') const createAi = async ()=>{ + console.log(selectedData.value) if(selectedData.value.length == 0){ ElMessage.warning('请先选择教学环节后再生成教学大纲') return } + onSaveTemp() + return let str = selectedData.value.map( item => item.name).join('、') let bookV = curNode.roottitle.split('-')[1] + '版' loading.value = true @@ -97,6 +104,30 @@ const createAi = async ()=>{ } + +// 保存模板 +const onSaveTemp = async (data) => { + if (data == '') return + console.log(selectedData) + let modelIds = selectedData.value.map( item => item.id).join(',') + console.log(modelIds) + console.log(user) + const data1 = { + eduId: curNode.id, + outline: data, + outlineType: curMode.value == 1 ? 0 : 1, + modelIds, + sourceType: 1, + createUserId: 1 + } + // const res = await addSyllabus(data) + + if(!item.resultId){ + item.resultId = res.data + } +} + + // 去掉字符串中的 ### ** let getResult = (str) => { let newStr = str.replace(/#+|(\*\*)/g, ''); diff --git a/src/renderer/src/views/teachingDesign/container/left2.vue b/src/renderer/src/views/teachingDesign/container/left2.vue index 563adf2..17668a0 100644 --- a/src/renderer/src/views/teachingDesign/container/left2.vue +++ b/src/renderer/src/views/teachingDesign/container/left2.vue @@ -1,30 +1,39 @@