diff --git a/src/renderer/src/components/set-homework/index.vue b/src/renderer/src/components/set-homework/index.vue index 17127b8..08b92a8 100644 --- a/src/renderer/src/components/set-homework/index.vue +++ b/src/renderer/src/components/set-homework/index.vue @@ -259,9 +259,10 @@ const onSubmit = (formEl) => { classworkarray: JSON.stringify(ary) }) .then((res) => { + setLoading.value = false ElMessage.success('操作成功') - emit('on-success', res.data) + emit('on-success', res) cloneDialog(formEl) }) .catch(() => { diff --git a/src/renderer/src/views/tool/components/homework.vue b/src/renderer/src/views/tool/components/homework.vue index 720a905..04505d2 100644 --- a/src/renderer/src/views/tool/components/homework.vue +++ b/src/renderer/src/views/tool/components/homework.vue @@ -85,10 +85,11 @@ import FileImage from '@/components/file-image/index.vue' import { useGetHomework } from '@/hooks/useGetHomework' import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool' import { useToolState } from '@/store/modules/tool' +import {createWindow} from '@/utils/tool' import Lesson from './lesson.vue'; import { parseCataByNode } from '@/utils/talkFile' import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举 -import { createHomework } from '../createHomework' +import { createHomework, getClassWorkList, getStudentClassWorkData } from '../createHomework' import { sessionStore } from '@/utils/store' const route = useRoute(); @@ -111,10 +112,12 @@ const curNode = reactive({ }) const props = defineProps(['curNode']) - +const emit = defineEmits(['closeActive']) const sendHomework = (row,type) => { + + if(type == 'item'){ // 布置推送单个作业 curRow.value = [row] @@ -128,11 +131,28 @@ const sendHomework = (row,type) => { const closeHomework = async() => { ipcMsgSend('tool-sphere:set:ignore', true) } + + // 推送成功 -const successHomework = (data)=>{ +const successHomework = async (data)=>{ + // data.msg // console.log('推送成功', data) // 发送im消息-推送作业(app|平板) // ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016) + + /** + * 推送成功 打开作业批改 + * 2024/10/23 + * 以下两个函数 代码 参照"作业批改" 页面 + */ + let result = await getClassWorkList(data.msg) + result = await getStudentClassWorkData() + localStorage.setItem('teachClassWorkItem', JSON.stringify(result[0])); + toolStore.isTaskWin=true; // 设置打开批改窗口 + emit('closeActive') + createWindow('open-taskwin',{url:'/teachClassTask'}); // 调用新窗口批改页面 + + } // 章节目录change const changeChapter = async (data)=>{ diff --git a/src/renderer/src/views/tool/components/side.vue b/src/renderer/src/views/tool/components/side.vue index 1cb278b..29083db 100644 --- a/src/renderer/src/views/tool/components/side.vue +++ b/src/renderer/src/views/tool/components/side.vue @@ -25,7 +25,7 @@