diff --git a/src/renderer/src/store/modules/classTask.js b/src/renderer/src/store/modules/classTask.js index c5f8b31..05a9491 100644 --- a/src/renderer/src/store/modules/classTask.js +++ b/src/renderer/src/store/modules/classTask.js @@ -5,6 +5,7 @@ import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuesti const useClassTaskStore = defineStore('classTask',{ state: () => ({ + isOpenQuestUploadView: false, // 是否打开习题上传的页面 classListIds: [], entpCourseWorkTypeList: [ {value: 0, label: "不限"}, diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue index e8e9f7d..cf07db2 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -149,10 +149,14 @@ import { useGetHomework } from '@/hooks/useGetHomework' import { sessionStore } from '@/utils/store' import { useRouter, useRoute } from 'vue-router' import useUserStore from '@/store/modules/user' +import useClassTaskStore from '@/store/modules/classTask' + const userStore = useUserStore().user const route = useRoute(); const router = useRouter() const { proxy } = getCurrentInstance() +const useClassTaskStores = useClassTaskStore(); + const props = defineProps({ currentCourse: Object, }) @@ -189,6 +193,7 @@ const boardLoading = ref(false); const fileLoading = ref(false); // 常规作业loading onMounted(() => { + console.log("----onMounted-------") currentRow.value = {id:0}; if(propsQueryCourseObj){ if(JSON.parse(propsQueryCourseObj)){ @@ -216,7 +221,28 @@ onMounted(() => { } } initHomeWork(); + isInToMyQuestion(); // 如果是上传习题后返回的,跳转到个人题库 }) +// 是否进入个人题库 +const isInToMyQuestion = () => { + console.log('isOpenQuestUploadView',useClassTaskStores.isOpenQuestUploadView); + if(useClassTaskStores.isOpenQuestUploadView){ + useClassTaskStores.isOpenQuestUploadView = false; + + currentRow.value = {id:1}; // 作业设计 + activeAptTab.value = "个人题库"; + //提交内容清空 重置 + classWorkForm.id = 0; + classWorkForm.uniquekey = ""; // 作业唯一标识 作业名称 + classWorkForm.worktype = "习题训练"; //作业类型 + classWorkForm.title = ""; // 作业说明 + classWorkForm.quizlist = []; // 作业习题列表内容 + classWorkForm.chooseWorkLists = []; // 作业框架梳理list + classWorkForm.fileHomeworkList = []; // 常规作业文件列表 + classWorkForm.whiteboardObj = ""; // 作业资源 - 课堂展示 白板 + classWorkForm.question = ""; // 作业资源 - 课堂展示 输入的问题 + } +} watch(() => props.currentCourse, (newVal, oldVal) => { if(newVal){ courseObj.textbookId = newVal.textbookId // 版本 diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/questionUpload/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/questionUpload/index.vue index 46b94b8..b8c192b 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/questionUpload/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/questionUpload/index.vue @@ -74,7 +74,7 @@