作业管理:习题上传后,返回进入 个人题库界面

This commit is contained in:
白了个白 2024-12-18 09:51:44 +08:00
parent dfd53637be
commit de9235751f
3 changed files with 41 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuesti
const useClassTaskStore = defineStore('classTask',{ const useClassTaskStore = defineStore('classTask',{
state: () => ({ state: () => ({
isOpenQuestUploadView: false, // 是否打开习题上传的页面
classListIds: [], classListIds: [],
entpCourseWorkTypeList: [ entpCourseWorkTypeList: [
{value: 0, label: "不限"}, {value: 0, label: "不限"},

View File

@ -149,10 +149,14 @@ import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask'
const userStore = useUserStore().user const userStore = useUserStore().user
const route = useRoute(); const route = useRoute();
const router = useRouter() const router = useRouter()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const useClassTaskStores = useClassTaskStore();
const props = defineProps({ const props = defineProps({
currentCourse: Object, currentCourse: Object,
}) })
@ -189,6 +193,7 @@ const boardLoading = ref(false);
const fileLoading = ref(false); // loading const fileLoading = ref(false); // loading
onMounted(() => { onMounted(() => {
console.log("----onMounted-------")
currentRow.value = {id:0}; currentRow.value = {id:0};
if(propsQueryCourseObj){ if(propsQueryCourseObj){
if(JSON.parse(propsQueryCourseObj)){ if(JSON.parse(propsQueryCourseObj)){
@ -216,7 +221,28 @@ onMounted(() => {
} }
} }
initHomeWork(); 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) => { watch(() => props.currentCourse, (newVal, oldVal) => {
if(newVal){ if(newVal){
courseObj.textbookId = newVal.textbookId // courseObj.textbookId = newVal.textbookId //

View File

@ -74,7 +74,7 @@
<script setup> <script setup>
import "vue-cropper/dist/index.css"; import "vue-cropper/dist/index.css";
import { VueCropper } from "vue-cropper"; import { VueCropper } from "vue-cropper";
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick, onUnmounted } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
@ -88,6 +88,8 @@ import { useRouter, useRoute } from 'vue-router'
import { ocrImg2ExamByManualUpl, ocrImg2ItemByManualUpl } from "@/views/classTask/newClassTaskAssign/questionUpload/ocrImg2ExamQues"; import { ocrImg2ExamByManualUpl, ocrImg2ItemByManualUpl } from "@/views/classTask/newClassTaskAssign/questionUpload/ocrImg2ExamQues";
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue"; import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
import useClassTaskStore from '@/store/modules/classTask'
// const Remote = require('@electron/remote') // const Remote = require('@electron/remote')
// const fs = require('fs'); // const fs = require('fs');
@ -96,7 +98,9 @@ import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user const userStore = useUserStore().user
const route = useRoute(); const route = useRoute();
const router = useRouter() const router = useRouter()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance();
const useClassTaskStores = useClassTaskStore(); // TODO
const props = defineProps({ const props = defineProps({
}) })
@ -151,6 +155,7 @@ const cropOption = reactive({
onMounted(() => { onMounted(() => {
useClassTaskStores.isOpenQuestUploadView = true; //
console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj)); console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj));
if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){ if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
@ -161,7 +166,13 @@ onMounted(() => {
} }
initHomeWork(); initHomeWork();
}) })
onUnmounted(()=>{
// 1s isOpenQuestUploadView
setTimeout(()=>{
useClassTaskStores.isOpenQuestUploadView = false; //
console.log('onUnmounted 习题上传');
}, 1000)
})
/** /**
* 获取 entpcourseid 获取作业列表 * 获取 entpcourseid 获取作业列表