This commit is contained in:
白了个白 2024-11-27 10:11:35 +08:00
parent 84e8acdef7
commit b967c684d6
2 changed files with 1 additions and 95 deletions

View File

@ -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,
}
}

View File

@ -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(); //
})
/** 前往习题上传页面 */