diff --git a/src/renderer/src/api/mode/index.js b/src/renderer/src/api/mode/index.js index 26540bb..efbdcdb 100644 --- a/src/renderer/src/api/mode/index.js +++ b/src/renderer/src/api/mode/index.js @@ -136,14 +136,6 @@ export function syllabusList(params) { }) } -// 大纲详情 -export function syllabuss(id) { - return request({ - url: '/education/generate/' + id, - method: 'get', - }) -} - // 删除大纲 export function removeSyllabus(id) { return request({ diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 50526fb..0ed1188 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"> @@ -38,8 +44,9 @@
-
+
@@ -334,7 +341,8 @@ onMounted( async () => { } } -.tree-label { +.tree-label-wrap, .tree-label { + max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; diff --git a/src/renderer/src/hooks/useProcessList.js b/src/renderer/src/hooks/useProcessList.js index c9f1e07..a3dcd8b 100644 --- a/src/renderer/src/hooks/useProcessList.js +++ b/src/renderer/src/hooks/useProcessList.js @@ -328,7 +328,7 @@ export const processList = (row, aloneOption=false) => { // 处理[答案显示] - 1-正常 0-错误 const answer = workAnswerArr .map((item) => { - return item === '1' ? '正确' : '错误' + return DICT_TRUE_OR_FALSE.TRUE.includes(item) ? '正确' : DICT_TRUE_OR_FALSE.FALSE.includes(item)?'错误':item; }) .join('、') row[i].workanswerFormat = answer @@ -341,3 +341,8 @@ export const processList = (row, aloneOption=false) => { } } } + +const DICT_TRUE_OR_FALSE = { + TRUE: ['正确', '对', '√', '1'], + FALSE: ['错误', '错', '×', '0'], +}; \ No newline at end of file diff --git a/src/renderer/src/utils/ppt-request.js b/src/renderer/src/utils/ppt-request.js index 642d9a9..2918d0c 100644 --- a/src/renderer/src/utils/ppt-request.js +++ b/src/renderer/src/utils/ppt-request.js @@ -107,12 +107,12 @@ const getBackGroundV2 = async () => { } }; -const createOutlineV2 = async (params) => { +const createOutlineV2 = async (data) => { try { const response = await request({ url:"/api/aipptV2/createOutlineV2", - method: "POST", - params + method: "POST", + data }); console.log("createOutline response:", response); @@ -133,6 +133,18 @@ const createPPTV2 = async (data) => { throw error; } }; + +const createPptByOutline = async (data) => { + try { + const response = await req("/api/aipptV2/createPptByOutline", "POST", data); + console.log("createOutline response:", response); + + return response.data; + } catch (error) { + console.error("请求失败:", error); + throw error; + } +}; const getProgressV2 = async (id) => { try { const response = await req(`/api/aipptV2/progressV2?sid=${id}`, "GET"); @@ -143,4 +155,4 @@ const getProgressV2 = async (id) => { } }; -export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createOutlineV2, createPPTV2, getProgressV2, createByOutline }; +export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createOutlineV2, createPPTV2, getProgressV2, createByOutline, createPptByOutline }; 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..0bad55b 100644 --- a/src/renderer/src/views/prepare/container/pptist-dialog.vue +++ b/src/renderer/src/views/prepare/container/pptist-dialog.vue @@ -1,30 +1,123 @@ diff --git a/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue b/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue deleted file mode 100644 index a58bbd8..0000000 --- a/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue +++ /dev/null @@ -1,282 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index 4c01048..30f78d6 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -9,14 +9,10 @@ 生成教学大纲 - + 删除大纲 - - - 编辑大纲 -
@@ -55,7 +51,7 @@ import EditDialog from './edit-dialog.vue' import emitter from '@/utils/mitt' import * as commUtils from '@/utils/comm.js' import { createChart, sendChart } from '@/api/ai/index' -import { completion, addSyllabus, syllabuss, removeSyllabus, editSyllabus } from '@/api/mode/index.js' +import { completion, addSyllabus, removeSyllabus, editSyllabus } from '@/api/mode/index.js' import { createOutlineV2 } from '@/utils/ppt-request.js' import useUserStore from '@/store/modules/user' import { cloneDeep } from 'lodash' @@ -85,17 +81,15 @@ emitter.on('selected', (data) => { // 回显大纲 const curItem = reactive({}) emitter.on('onShow', (data) => { - console.log(data) aiShow.value = false Object.assign(answer, JSON.parse(data.outline)) - Object.assign(curItem, data) - emitter.emit('onResult',data) + curItem.outline = JSON.parse(curItem.outline) + emitter.emit('onResult',curItem) }) - const params = reactive( { prompt: '', @@ -114,7 +108,7 @@ const createAi = async () => { return } - let str = selectedData.value.map(item => item.name).join('、') + let str = selectedData.value.map( item => item.name).join('、') let bookV = curNode.roottitle.split('-')[1] + '版' loading.value = true aiShow.value = true @@ -140,9 +134,10 @@ const createAi = async () => { data = res.data } const res = await createOutlineV2({ query: data.answer }) - console.log(res) - emitter.emit('onResult', res) + Object.assign(answer, res.outline) + curItem.outline = res.outline + emitter.emit('onResult', curItem) onSaveTemp(JSON.stringify(res.outline)) } finally { loading.value = false @@ -182,6 +177,8 @@ emitter.on('editItem', (item) =>{ loading.value = true editSyllabus(data).then( res =>{ + curItem.outline = answer + emitter.emit('onResult', curItem) ElMessage.success('操作成功') }).finally( ()=>{ loading.value = false @@ -221,7 +218,7 @@ const delAnswer = () => { answer.value = '' emitter.emit('resetSelect') }) - .catch(() => { }) + .catch(() => {}) } @@ -301,4 +298,5 @@ onMounted(() => { } } } - \ No newline at end of file + + diff --git a/src/renderer/src/views/teachingDesign/container/keyword-dialog.vue b/src/renderer/src/views/teachingDesign/container/keyword-dialog.vue deleted file mode 100644 index db1aa90..0000000 --- a/src/renderer/src/views/teachingDesign/container/keyword-dialog.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/renderer/src/views/teachingDesign/container/left.vue b/src/renderer/src/views/teachingDesign/container/left.vue index f0343b4..0ac347c 100644 --- a/src/renderer/src/views/teachingDesign/container/left.vue +++ b/src/renderer/src/views/teachingDesign/container/left.vue @@ -1,193 +1,394 @@ \ No newline at end of file + diff --git a/src/renderer/src/views/teachingDesign/container/left2.vue b/src/renderer/src/views/teachingDesign/container/left2.vue deleted file mode 100644 index 0ac347c..0000000 --- a/src/renderer/src/views/teachingDesign/container/left2.vue +++ /dev/null @@ -1,394 +0,0 @@ - - - - - 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/right.vue b/src/renderer/src/views/teachingDesign/container/right.vue index 3c91cb6..300399f 100644 --- a/src/renderer/src/views/teachingDesign/container/right.vue +++ b/src/renderer/src/views/teachingDesign/container/right.vue @@ -1,107 +1,49 @@ - - - diff --git a/src/renderer/src/views/teachingDesign/container/right2.vue b/src/renderer/src/views/teachingDesign/container/right2.vue deleted file mode 100644 index 03ce212..0000000 --- a/src/renderer/src/views/teachingDesign/container/right2.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - \ No newline at end of file diff --git a/src/renderer/src/views/teachingDesign/index.vue b/src/renderer/src/views/teachingDesign/index.vue index 773aebf..1ffaf52 100644 --- a/src/renderer/src/views/teachingDesign/index.vue +++ b/src/renderer/src/views/teachingDesign/index.vue @@ -1,54 +1,35 @@ \ No newline at end of file +