edit 框架设计

This commit is contained in:
lyc 2025-01-10 15:14:24 +08:00
parent 4e85477a5a
commit 250f73cce6
1 changed files with 3 additions and 7 deletions

View File

@ -62,7 +62,6 @@ emitter.on('selected', (data) => {
// //
const curItem = reactive({}) const curItem = reactive({})
emitter.on('onShow', (data) => { emitter.on('onShow', (data) => {
let outline = cloneDeep(JSON.parse(data.outline)) let outline = cloneDeep(JSON.parse(data.outline))
markeDownAnswer.value = outline.markdown markeDownAnswer.value = outline.markdown
emitter.emit('onResult', cloneDeep(data)) emitter.emit('onResult', cloneDeep(data))
@ -124,8 +123,9 @@ const createAi = async () => {
}) })
Object.assign(curItem, {...curItem, outline}) Object.assign(curItem, {...curItem, outline})
emitter.emit('onResult', curItem) emitter.emit('onResult', curItem)
onSaveTemp() onSaveTemp(outline)
} finally { } finally {
loading.value = false loading.value = false
} }
@ -173,12 +173,8 @@ const createAi = async () => {
// }) // })
// //
const onSaveTemp = async () => { const onSaveTemp = async (outline) => {
let modelIds = selectedData.value.map(item => item.id).join(',') let modelIds = selectedData.value.map(item => item.id).join(',')
let outline = JSON.stringify({
markdown: markeDownAnswer.value,
json:curItem.outline
})
const data = { const data = {
eduId: curNode.id, eduId: curNode.id,
outline, outline,