Compare commits

..

9 Commits

3 changed files with 35 additions and 36 deletions

View File

@ -73,7 +73,6 @@ export class PPTApi {
// 活动列表处理 // 活动列表处理
const workList = (res.rows || []).map(o => o.activityContent) const workList = (res.rows || []).map(o => o.activityContent)
const workItem = [...res.rows] const workItem = [...res.rows]
// 加入活动后刷新ppt数据内容不跟换为第一页
// slidesStore.updateSlideIndex(0) // 下标0 为第一页 // slidesStore.updateSlideIndex(0) // 下标0 为第一页
slidesStore.setSlides(slides) // 写入数据 slidesStore.setSlides(slides) // 写入数据
// 写入作业列表数据 // 写入作业列表数据
@ -110,11 +109,9 @@ export class PPTApi {
const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params) const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params)
if (!!rid) { if (!!rid) {
data.id = rid data.id = rid
params.id = rid
params.activityContent = null
slidesStore.addWorkItem(params)
slidesStore.updateSlide(data) slidesStore.updateSlide(data)
// msgUtils.msgSuccess('新增成功') // msgUtils.msgSuccess('新增成功')
PPTApi.getSlideList(resource.id)
this.isUpdate = false // 新增后会触发监听,不再更新数据 this.isUpdate = false // 新增后会触发监听,不再更新数据
resolve(true) resolve(true)
} else msgUtils.msgError('新增失败');resolve(false) } else msgUtils.msgError('新增失败');resolve(false)

View File

@ -305,10 +305,10 @@ const upDateData = async () => {
// await PPTApi.updateSlide(paramData.value) // await PPTApi.updateSlide(paramData.value)
loadingActive.value = true loadingActive.value = true
await updateEntpcoursefileNew(paramData.value) await updateEntpcoursefileNew(paramData.value)
const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 })
await formatClassWorkFile(res.rows)
const resource = sessionStore.get('curr.resource') const resource = sessionStore.get('curr.resource')
await PPTApi.getSlideList(resource.id) await PPTApi.getSlideList(resource.id)
const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 })
await formatClassWorkFile(res.rows)
} }
// //
const objectsAreEqual = (obj1: Record<string, any>, obj2: Record<string, any>) => { const objectsAreEqual = (obj1: Record<string, any>, obj2: Record<string, any>) => {

View File

@ -714,37 +714,39 @@ const closeDialog = () => {
// im // im
const msgHandle = (msg) => { const msgHandle = (msg) => {
const { type, data } = msg if (typeof msg === 'object'){
switch(type) { const { head, content, ...other } = msg
case MsgEnum.HEADS.MSG_closed: // : switch(head) {
case MsgEnum.HEADS.MSG_closed: // :
window.close() //
break
case MsgEnum.HEADS.MSG_finishHomework: // :
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
openDialog(data, false);
break
case MsgEnum.HEADS.MSG_slideFlapping: //
window.close() // window.close() //
break break
case MsgEnum.HEADS.MSG_finishHomework: // : // case 'TIMAddRecvNewMsgCallback': // data=[]
const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); // {
openDialog(data, false); // (data||[]).forEach(o => {
break // const msgArr = o?.message_elem_array||[]
case MsgEnum.HEADS.MSG_slideFlapping: // // msgArr.forEach(info => {
window.close() // // const msgType = info?.elem_type // TIMElemType
break // const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : ''
// case 'TIMAddRecvNewMsgCallback': // data=[] // //
// { // //console.log('msgData->', msgData);
// (data||[]).forEach(o => { // if (msgData.msgKey == "finishHomework"){
// const msgArr = o?.message_elem_array||[] // //
// msgArr.forEach(info => { // const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
// const msgType = info?.elem_type // TIMElemType // //console.log('data->', data);
// const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : '' // openDialog(data, false);
// // // }
// //console.log('msgData->', msgData); // })
// if (msgData.msgKey == "finishHomework"){ // })
// // // }
// const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); // break
// //console.log('data->', data); }
// openDialog(data, false);
// }
// })
// })
// }
// break
} }
} }