diff --git a/src/renderer/src/plugins/shareStore.js b/src/renderer/src/plugins/shareStore.js index 10aec30..caa5e52 100644 --- a/src/renderer/src/plugins/shareStore.js +++ b/src/renderer/src/plugins/shareStore.js @@ -66,9 +66,10 @@ function stateSyncWatch(storeName, newState) { const keyArr = key.split('.') || [] keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue) const jsonStr = JSON.stringify(newValue) // 从新组装-json数据 - // // 更新本地数据-session + // 更新本地数据-session + // console.log('state-change-update:', key, value) sessionStore.set(key, value) - // // 通知主线程更新 + // 通知主线程更新 ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr) // console.log('======',key, value, jsonStr ) } diff --git a/src/renderer/src/views/desktop/container/class-start.vue b/src/renderer/src/views/prepare/container/class-start.vue similarity index 87% rename from src/renderer/src/views/desktop/container/class-start.vue rename to src/renderer/src/views/prepare/container/class-start.vue index 56a3139..cfb9ec9 100644 --- a/src/renderer/src/views/desktop/container/class-start.vue +++ b/src/renderer/src/views/prepare/container/class-start.vue @@ -119,71 +119,22 @@ onMounted(() => { */ const open = async (id) => { visible.value = true - // 获取apt详情 - if (id) await getAptInfo(id) - // 模拟数据 - // myClassActive.value = { - // "createBy": null, - // "createTime": null, - // "updateBy": null, - // "updateTime": null, - // "remark": null, - // "id": 14740, - // "idarray": null, - // "jsonarray": null, - // "entpid": 255, - // "parentid": 14741, - // "linkids": "", - // "linklist": "", - // "entpcourseid": 7300, - // "entpcourseidarray": null, - // "evalid": 39952, - // "evaltitle": " 质点 参考系", - // "coursetitle": " 质点 参考系", - // "classid": 0, - // "ppttype": "file", - // "title": " 质点 参考系", - // "fileidx": 0, - // "fileurl": "", - // "pathfile": null, - // "filetype": "ppt", - // "filesize": null, - // "datacontent": "", - // "filekey": "", - // "filetag": "", - // "dflag": 0, - // "status": "", - // "edituserid": 2781, - // "editusername": "张雪林", - // "edituserheadimgurl": "/profile/avatar/2024/08/12/blob_20240812152930A001.jpeg", - // "edituserentpname": "AIx数字平台内测中心", - // "editstudentid": null, - // "editstudentname": null, - // "timestamp": "2024-09-10 15:07:20", - // "token": null, - // "base64Code": null, - // "orderby": null, - // "childcount": 4, - // "commentlikecount": 0, - // "commenttextcount": 0, - // "commentusecount": 0, - // "commentvisitcount": 90, - // "unixstamp": null, - // "classworkcount": 0, - // "classworklist": "", - // "authjson": "", - // "defaultslide": null - // } - // 获取班级列表 - getClassList() - - // 初始化im-chat - // nextTick(async() => { - // chat = await imChatRef.value?.initImChat() - // }) + if (id) { + // 重置数据 + reset() + // 获取apt详情 + await getAptInfo(id) + // 获取班级列表 + getClassList() + // 初始化im-chat + nextTick(async() => { + chat = await imChatRef.value?.initImChat() + }) + } } // 关闭弹窗 const handleClose = async () => { + reset() // 重置数据 await chat?.logout() chat = null } @@ -204,6 +155,15 @@ const initData = () => { { label: '故障备用', prop: 'backup', show: false }, ] } +// 重置数据 +const reset = () => { + // 初始化-表单数据 + classForm.form = {} + teacherForm.form = { classcourseid: 0 } + dt.isCreate = false + dt.isHistory = false + dt.atCourse = {} +} // 获取课件APT const getAptInfo = async (id) => { const res = await Http_Entpcoursefile.getEntpcoursefile(id) diff --git a/src/renderer/src/views/prepare/container/kj-list-item.vue b/src/renderer/src/views/prepare/container/kj-list-item.vue index 05f068b..2e28989 100644 --- a/src/renderer/src/views/prepare/container/kj-list-item.vue +++ b/src/renderer/src/views/prepare/container/kj-list-item.vue @@ -52,7 +52,8 @@