From b85b95e8176d1c00fd86ad72ba52fdfbf1eadf0c Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 9 Jan 2025 16:00:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/index.html | 2 +- src/renderer/src/views/prepare/container/pptist-dialog.vue | 3 ++- src/renderer/src/views/teachingDesign/container/right.vue | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/index.html b/src/renderer/index.html index 6e072ed..60caf7f 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,7 +8,7 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - + diff --git a/src/renderer/src/views/prepare/container/pptist-dialog.vue b/src/renderer/src/views/prepare/container/pptist-dialog.vue index 0bad55b..9067669 100644 --- a/src/renderer/src/views/prepare/container/pptist-dialog.vue +++ b/src/renderer/src/views/prepare/container/pptist-dialog.vue @@ -70,7 +70,8 @@ const percentage = ref(0); const outlineCreatePPT = () => { const newOutlineData = { ...outlineData.value, }; - newOutlineData.outline = props.dataList.outline; + let outline = JSON.parse(props.dataList.outline).json + newOutlineData.outline = JSON.stringify(outline); newOutlineData.query = "通过传入大纲帮我生成相应的PPT课件" createPPTLoading.value = true; createPptByOutline(newOutlineData).then((res) => { diff --git a/src/renderer/src/views/teachingDesign/container/right.vue b/src/renderer/src/views/teachingDesign/container/right.vue index 93b41fd..c075637 100644 --- a/src/renderer/src/views/teachingDesign/container/right.vue +++ b/src/renderer/src/views/teachingDesign/container/right.vue @@ -66,7 +66,6 @@ const pptSlides = ref([]) emitter.on('onResult', (data)=>{ console.log(data) result.value = data - result.value.outline = JSON.parse(data.outline).json if (!!result.value.parentId) { listEntpcoursefileNew({parentid: result.value.parentId}).then(res=>{ pptSlides.value = res.rows From 96e71ff45e69306da5021d4713080f9635684fb5 Mon Sep 17 00:00:00 2001 From: lyc Date: Thu, 9 Jan 2025 16:49:43 +0800 Subject: [PATCH 2/2] =?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 | 17 ++++++++++++----- .../src/views/teachingDesign/container/left.vue | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index f27faea..c3d083e 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -83,10 +83,10 @@ emitter.on('selected', (data) => { // 回显大纲 const curItem = reactive({}) emitter.on('onShow', (data) => { - - let outline = JSON.parse(data.outline) + + let outline = cloneDeep(JSON.parse(data.outline)) markeDownAnswer.value = outline.markdown - emitter.emit('onResult',data) + emitter.emit('onResult', cloneDeep(data)) Object.assign(curItem, data) }) @@ -138,10 +138,12 @@ const createAi = async () => { markeDownAnswer.value = data.answer const res = await createOutlineV2({ query: data.answer }) - curItem.outline = JSON.stringify({ + let outline = JSON.stringify({ json: res.outline, markdown: data.answer }) + + Object.assign(curItem, {...curItem, outline}) emitter.emit('onResult', curItem) onSaveTemp() } finally { @@ -207,10 +209,12 @@ const onSaveTemp = async () => { createUserName: user.nickName } await addSyllabus(data) + emitter.emit('getLastInfo') } // 删除大纲 const delAnswer = () => { + if(!curItem.id) return ElMessageBox.confirm( '确定要删除大纲吗?', '温馨提示', @@ -223,8 +227,11 @@ const delAnswer = () => { .then(async () => { await removeSyllabus(curItem.id) ElMessage.success('操作成功') - answer.value = '' + markeDownAnswer.value = '' + emitter.emit('resetSelect') + + // window.location.reload(); }) .catch(() => {}) diff --git a/src/renderer/src/views/teachingDesign/container/left.vue b/src/renderer/src/views/teachingDesign/container/left.vue index 0ac347c..95c37be 100644 --- a/src/renderer/src/views/teachingDesign/container/left.vue +++ b/src/renderer/src/views/teachingDesign/container/left.vue @@ -150,6 +150,10 @@ const resetSelect = () => { emitter.on('resetSelect', () => { resetSelect() + getSyllabus() +}) +emitter.on('getLastInfo',() =>{ + getSyllabus() }) // 点击教学模式