This commit is contained in:
白了个白 2024-11-27 10:01:53 +08:00
parent 42f24041db
commit d8c4556393
3 changed files with 104 additions and 5 deletions

View File

@ -0,0 +1,86 @@
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

@ -5,6 +5,8 @@ import { listClassmain } from '@/api/classManage/index'
const useClassTaskStore = defineStore('classTask',{ const useClassTaskStore = defineStore('classTask',{
state: () => ({ state: () => ({
classListIds: [], classListIds: [],
jyCT: [],// 青优网题型列表
}), }),
actions: { actions: {
listClassmain(params) { listClassmain(params) {

View File

@ -5,7 +5,7 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item label="题型" label-width="70"> <el-form-item label="题型" label-width="70">
<el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" > <el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" >
<el-option v-for="(item, index) in entpCourseWorkTypeList" :key="index" :label="item.label" :value="item"> <el-option v-for="(item, index) in workTypeList" :key="index" :label="item.label" :value="item">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -13,14 +13,14 @@
<el-col :span="7"> <el-col :span="7">
<el-form-item label="题源" label-width="70"> <el-form-item label="题源" label-width="70">
<el-select v-model="entpCourseWorkQueryParams.workgroup" placeholder="请选择" > <el-select v-model="entpCourseWorkQueryParams.workgroup" placeholder="请选择" >
<el-option v-for="(item, index) in entpCourseWorkGroupList" :key="index" :label="item.Value" :value="item.Key" ></el-option> <el-option v-for="(item, index) in workGroupList" :key="index" :label="item.Value" :value="item.Key" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="年份" label-width="70"> <el-form-item label="年份" label-width="70">
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" > <el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
<el-option v-for="(item, index) in entpCourseWorkYearList" :key="index" :label="item.label" :value="item.value"></el-option> <el-option v-for="(item, index) in workYearList" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -125,12 +125,22 @@ import { delEntpcoursework, updateEntpcoursework } from "@/api/education/entpCou
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue' import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue"; import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
import { useHandleData } from "@/hooks/useHandleData"; import { useHandleData } from "@/hooks/useHandleData";
import { processList } from '@/hooks/useProcessList' import { processList } from '@/hooks/useProcessList';
import useClassTaskWorkQuest from '@/hooks/useClassTaskWorkQuest';
import { debounce } from '@/utils/comm' import { debounce } from '@/utils/comm'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const router = useRouter() const router = useRouter()
const {
workTypeList,
workGroupList,
workYearList,
workKeyWord,
inits,
} = useClassTaskWorkQuest();
// emit // emit
const emit = defineEmits(['addQuiz']) const emit = defineEmits(['addQuiz'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -218,9 +228,10 @@ const dlgImportSingle = reactive({
}) })
onMounted(() => { onMounted(() => {
inits();
debounceQueryData(); // debounceQueryData(); //
}) })
/** 前往习题上传页面 */
const goToQuestUpload = () => { const goToQuestUpload = () => {
router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(props.bookobj) } }); router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(props.bookobj) } });
} }