This commit is contained in:
zhangxuelin 2025-01-09 16:54:09 +08:00
commit a4b1a5bb30
5 changed files with 19 additions and 8 deletions

View File

@ -8,7 +8,7 @@
http-equiv="Content-Security-Policy" http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/> --> /> -->
<meta http-equiv="Content-Security-Policy" content="connect-src * blob: data:; frame-src 'self' *; default-src 'self' https://wzyzoss.eos-chongqing-3.cmecloud.cn/; script-src 'self' 'unsafe-eval' http://www.wiris.net 'unsafe-inline'; style-src 'self' 'unsafe-inline' http://www.wiris.net; media-src * blob:;img-src * 'self' data: blob:;font-src 'self' http://www.wiris.net;" /> <meta http-equiv="Content-Security-Policy" content="connect-src * blob: data:; frame-src 'self' *; default-src 'self' https://wzyzoss.eos-chongqing-3.cmecloud.cn/; script-src 'self' 'unsafe-eval' http://www.wiris.net 'unsafe-inline'; style-src 'self' 'unsafe-inline' http://www.wiris.net; media-src * blob:;img-src * 'self' data: blob:;font-src 'self' http://www.wiris.net data:;" />
</head> </head>

View File

@ -70,7 +70,8 @@
const percentage = ref(0); const percentage = ref(0);
const outlineCreatePPT = () => { const outlineCreatePPT = () => {
const newOutlineData = { ...outlineData.value, }; 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课件" newOutlineData.query = "通过传入大纲帮我生成相应的PPT课件"
createPPTLoading.value = true; createPPTLoading.value = true;
createPptByOutline(newOutlineData).then((res) => { createPptByOutline(newOutlineData).then((res) => {

View File

@ -84,9 +84,9 @@ emitter.on('selected', (data) => {
const curItem = reactive({}) const curItem = reactive({})
emitter.on('onShow', (data) => { emitter.on('onShow', (data) => {
let outline = JSON.parse(data.outline) let outline = cloneDeep(JSON.parse(data.outline))
markeDownAnswer.value = outline.markdown markeDownAnswer.value = outline.markdown
emitter.emit('onResult',data) emitter.emit('onResult', cloneDeep(data))
Object.assign(curItem, data) Object.assign(curItem, data)
}) })
@ -138,10 +138,12 @@ const createAi = async () => {
markeDownAnswer.value = data.answer markeDownAnswer.value = data.answer
const res = await createOutlineV2({ query: data.answer }) const res = await createOutlineV2({ query: data.answer })
curItem.outline = JSON.stringify({ let outline = JSON.stringify({
json: res.outline, json: res.outline,
markdown: data.answer markdown: data.answer
}) })
Object.assign(curItem, {...curItem, outline})
emitter.emit('onResult', curItem) emitter.emit('onResult', curItem)
onSaveTemp() onSaveTemp()
} finally { } finally {
@ -207,10 +209,12 @@ const onSaveTemp = async () => {
createUserName: user.nickName createUserName: user.nickName
} }
await addSyllabus(data) await addSyllabus(data)
emitter.emit('getLastInfo')
} }
// //
const delAnswer = () => { const delAnswer = () => {
if(!curItem.id) return
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要删除大纲吗?', '确定要删除大纲吗?',
'温馨提示', '温馨提示',
@ -223,8 +227,11 @@ const delAnswer = () => {
.then(async () => { .then(async () => {
await removeSyllabus(curItem.id) await removeSyllabus(curItem.id)
ElMessage.success('操作成功') ElMessage.success('操作成功')
answer.value = '' markeDownAnswer.value = ''
emitter.emit('resetSelect') emitter.emit('resetSelect')
// window.location.reload();
}) })
.catch(() => {}) .catch(() => {})

View File

@ -150,6 +150,10 @@ const resetSelect = () => {
emitter.on('resetSelect', () => { emitter.on('resetSelect', () => {
resetSelect() resetSelect()
getSyllabus()
})
emitter.on('getLastInfo',() =>{
getSyllabus()
}) })
// //

View File

@ -66,7 +66,6 @@ const pptSlides = ref([])
emitter.on('onResult', (data)=>{ emitter.on('onResult', (data)=>{
console.log(data) console.log(data)
result.value = data result.value = data
result.value.outline = JSON.parse(data.outline).json
if (!!result.value.parentId) { if (!!result.value.parentId) {
listEntpcoursefileNew({parentid: result.value.parentId}).then(res=>{ listEntpcoursefileNew({parentid: result.value.parentId}).then(res=>{
pptSlides.value = res.rows pptSlides.value = res.rows