From b967c684d60475af87878733fd80c1c71936d40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Wed, 27 Nov 2024 10:11:35 +0800 Subject: [PATCH] 1 --- .../src/hooks/useClassTaskWorkQuest.js | 86 ------------------- .../newClassTaskAssign/myQuestion/index.vue | 10 +-- 2 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 src/renderer/src/hooks/useClassTaskWorkQuest.js diff --git a/src/renderer/src/hooks/useClassTaskWorkQuest.js b/src/renderer/src/hooks/useClassTaskWorkQuest.js deleted file mode 100644 index 7837ec2..0000000 --- a/src/renderer/src/hooks/useClassTaskWorkQuest.js +++ /dev/null @@ -1,86 +0,0 @@ -import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance, computed } from 'vue'; -import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"; -import useUserStore from '@/store/modules/user'; -const userStore = useUserStore().user; -import useClassTaskStore from '@/store/modules/classTask.js' - - -export default () => { - const { proxy } = getCurrentInstance(); - const { } = useClassTaskStore(); - - const workTypeList = ref([]); // 习题查询条件 - 题型 - const workGroupList = ref([]); // 习题查询条件 - 题源 - const workYearList = ref([]); // 习题查询条件 - 年份(label: '2024', value: '2024') - const workKeyWord = ref(''); // 习题查询条件 - 关键字 - - - const name = userStore.edustage + userStore.edusubject; // 获取当前学科下的题型 - - // 获取题型列表 - const getWorkTypeList =async() =>{ - const jyCT = await JYApiListCT(proxy, name); - if (jyCT.length == 0) { - // ElMessage.error('获取题型失败!'); - // return; - workTypeList.value = [ - {value: 0, label: "不限"}, - {value: 1, label: "单选题"}, - {value: 2, label: "填空题"}, - {value: 3, label: "多选题"}, - {value: 4, label: "判断题"}, - {value: 5, label: "主观题"}, - {value: 6, label: "复合题"}, - ]; // 习题查询条件 - 题型 - return; - } - workTypeList.value = jyCT; - }; - - // 获取题源列表 - const getWorkGroupList =async() =>{ - const jySO = await JYApiListSO(proxy, name); - if (jySO.length == 0) { - workGroupList.value = [{ - Key: -1, - Value: '不限', - }, { - Key: 1, - Value: '真题', - }, { - Key: 0, - Value: '非真题', - }]; - return; - } - workGroupList.value = jySO; - }; - - //获取年份 - const getWorkYearList =()=> { - const now = new Date(); - const year = now.getFullYear(); //年份 - workYearList.value = []; - const arrYear = [{label: '不限', value: '-1'}]; // 默认添加不限选项 - for(let i = 0; i < 10; i++) { - arrYear.push({label: `${year - i}`, value: `${year - i}`}) - } - workYearList.value = arrYear; - }; - - - const inits= () => { - getWorkTypeList(); - getWorkGroupList(); - getWorkYearList(); - }; - - - return { - workTypeList, - workGroupList, - workYearList, - workKeyWord, - inits, - } -} \ No newline at end of file diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue index 3f84258..9daa584 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue @@ -126,7 +126,6 @@ import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue' import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue"; import { useHandleData } from "@/hooks/useHandleData"; import { processList } from '@/hooks/useProcessList'; -import useClassTaskWorkQuest from '@/hooks/useClassTaskWorkQuest'; import { debounce } from '@/utils/comm' @@ -134,13 +133,7 @@ import useUserStore from '@/store/modules/user' import useClassTaskStore from '@/store/modules/classTask' const router = useRouter() -const { - workTypeList, - workGroupList, - workYearList, - workKeyWord, - inits, -} = useClassTaskWorkQuest(); + // 定义要发送的emit事件 const emit = defineEmits(['addQuiz']) @@ -241,7 +234,6 @@ onMounted(() => { entpCourseWorkYearList.value = classTaskStore.jyYear; } - inits(); debounceQueryData(); // 查询习题列表 }) /** 前往习题上传页面 */