习题筛选修改

This commit is contained in:
白了个白 2024-11-27 10:39:21 +08:00
parent 48571086c3
commit ef5dfc8ed1
5 changed files with 59 additions and 140 deletions

View File

@ -6,9 +6,34 @@ import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuesti
const useClassTaskStore = defineStore('classTask',{ const useClassTaskStore = defineStore('classTask',{
state: () => ({ state: () => ({
classListIds: [], classListIds: [],
jyCT: [], entpCourseWorkTypeList: [
jySO: [], {value: 0, label: "不限"},
jyYear: [], {value: 1, label: "单选题"},
{value: 2, label: "填空题"},
{value: 3, label: "多选题"},
{value: 4, label: "判断题"},
{value: 5, label: "主观题"},
{value: 6, label: "复合题"},
], // 习题查询条件 - 题型
entpCourseWorkGroupList: [{
Key: -1,
Value: '不限',
}, {
Key: 1,
Value: '真题',
}, {
Key: 0,
Value: '非真题',
}
], // 习题查询条件 - 题源
entpCourseWorkYearList: [
{label: '不限', value: '-1'},
{label: '2024', value: '2024'},
{label: '2023', value: '2023'},
{label: '2022', value: '2022'},
{label: '2021', value: '2021'},
{label: '2020', value: '2020'},
], // 习题查询条件 - 年份
}), }),
actions: { actions: {
listClassmain(params) { listClassmain(params) {
@ -32,15 +57,12 @@ const useClassTaskStore = defineStore('classTask',{
Promise.all([getJYYear(), getJYSO(education), getJYCT(education)]) Promise.all([getJYYear(), getJYSO(education), getJYCT(education)])
.then(results => { .then(results => {
console.log('更新第三方题源+题型succ:', results); console.log('更新第三方题源+题型succ:', results);
this.jyYear = results[0]; this.entpCourseWorkYearList = results[0];
this.jyCT = results[2]; this.entpCourseWorkTypeList = results[2];
this.jySO = results[1]; this.entpCourseWorkGroupList = results[1];
}) })
.catch(error => { .catch(error => {
console.error('更新第三方题源+题型err:', error); console.error('更新第三方题源+题型err:', error);
this.jyYear = [];
this.jySO = [];
this.jyCT = [];
}); });
}, },
}, },

View File

@ -294,8 +294,8 @@ import FileUpload from "@/components/FileUpload/index.vue";
import whiteboard from '@/components/whiteboard/whiteboard.vue' import whiteboard from '@/components/whiteboard/whiteboard.vue'
import prevReadMsgDialog from '@/views/classTask/container/newTask/prevReadMsg-Dialog.vue' import prevReadMsgDialog from '@/views/classTask/container/newTask/prevReadMsg-Dialog.vue'
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue' import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"
import useClassTaskStore from '@/store/modules/classTask'
import {throttle,debounce } from '@/utils/comm' import {throttle,debounce } from '@/utils/comm'
import { useToolState } from '@/store/modules/tool' import { useToolState } from '@/store/modules/tool'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
@ -303,6 +303,11 @@ const userStore = useUserStore().user
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const router = useRouter() const router = useRouter()
const toolStore = useToolState() const toolStore = useToolState()
const {
entpCourseWorkTypeList,
entpCourseWorkGroupList,
entpCourseWorkYearList
} = useClassTaskStore();
const props = defineProps({ const props = defineProps({
bookobj: { bookobj: {
@ -326,39 +331,11 @@ const props = defineProps({
const prevReadMsgDialogRef = ref(null);// ref const prevReadMsgDialogRef = ref(null);// ref
const classWorkFormRef = ref(null); const classWorkFormRef = ref(null);
const entpCourseWorkTypeList = ref([
{value: 0, label: "不限"},
{value: 1, label: "单选题"},
{value: 2, label: "填空题"},
{value: 3, label: "多选题"},
{value: 4, label: "判断题"},
{value: 5, label: "主观题"},
{value: 6, label: "复合题"},
]); // -
const entpCourseWorkGroupList = ref([{
Key: -1,
Value: '不限',
}, {
Key: 1,
Value: '真题',
}, {
Key: 0,
Value: '非真题',
}]); // -
const entpCourseWorkPointList = ref([ const entpCourseWorkPointList = ref([
{label: '不限', value: []}, {label: '不限', value: []},
]); // - ]); // -
const knowledgePointProps = ref({value: 'thirdId', label: 'title'}); const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
const entpCourseWorkYearList =ref([
{label: '不限', value: '-1'},
{label: '2024', value: '2024'},
{label: '2023', value: '2023'},
{label: '2022', value: '2022'},
{label: '2021', value: '2021'},
{label: '2020', value: '2020'},
]); // -
const paginationParams = reactive({ const paginationParams = reactive({
@ -1006,18 +983,6 @@ const initPageParams = () => {
onMounted(async() => { onMounted(async() => {
//
const name = userStore.edustage + userStore.edusubject;
const jyCT = await JYApiListCT(name);
if (jyCT.length == 0) {
ElMessage.error('获取题型失败!');
return;
}
entpCourseWorkTypeList.value = jyCT;
//
entpCourseWorkYearList.value = JYApiListOriginYear();
entpCourseWorkGroupList.value = await JYApiListSO(name);
}) })
// const refreshData = () => { // const refreshData = () => {

View File

@ -139,7 +139,11 @@ const router = useRouter()
const emit = defineEmits(['addQuiz']) const emit = defineEmits(['addQuiz'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const userStore = useUserStore().user const userStore = useUserStore().user
const classTaskStore = useClassTaskStore(); const {
entpCourseWorkTypeList,
entpCourseWorkGroupList,
entpCourseWorkYearList
} = useClassTaskStore();
const props = defineProps({ const props = defineProps({
bookobj: { bookobj: {
@ -148,37 +152,7 @@ const props = defineProps({
}, },
}) })
const entpCourseWorkTypeList = ref([
{value: 0, label: "不限"},
{value: 1, label: "单选题"},
{value: 2, label: "填空题"},
{value: 3, label: "多选题"},
{value: 4, label: "判断题"},
{value: 5, label: "主观题"},
{value: 6, label: "复合题"},
]); // -
const entpCourseWorkGroupList = ref([{
Key: -1,
Value: '不限',
}, {
Key: 1,
Value: '真题',
}, {
Key: 0,
Value: '非真题',
}]); // -
const knowledgePointProps = ref({value: 'thirdId', label: 'title'}); const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
const entpCourseWorkYearList =ref([
{label: '不限', value: '-1'},
{label: '2024', value: '2024'},
{label: '2023', value: '2023'},
{label: '2022', value: '2022'},
{label: '2021', value: '2021'},
{label: '2020', value: '2020'},
]); // -
// //
@ -224,16 +198,6 @@ const dlgImportSingle = reactive({
}) })
onMounted(() => { onMounted(() => {
if (classTaskStore.jyCT.length>0) {
entpCourseWorkTypeList.value = classTaskStore.jyCT;
}
if (classTaskStore.jySO.length>0) {
entpCourseWorkGroupList.value = classTaskStore.jySO;
}
if (classTaskStore.jyYear.length>0) {
entpCourseWorkYearList.value = classTaskStore.jyYear;
}
debounceQueryData(); // debounceQueryData(); //
}) })
/** 前往习题上传页面 */ /** 前往习题上传页面 */

View File

@ -417,7 +417,11 @@ import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask' import useClassTaskStore from '@/store/modules/classTask'
const userStore = useUserStore().user const userStore = useUserStore().user
const classTaskStore = useClassTaskStore(); const {
entpCourseWorkTypeList,
entpCourseWorkGroupList,
entpCourseWorkYearList
} = useClassTaskStore();
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// emit // emit
@ -619,15 +623,15 @@ onMounted(() => {
}; };
// //
if (classTaskStore.jyCT.length>0) { if (entpCourseWorkTypeList.length>0) {
const flagDict = ['单选题', '多选题', '判断题', '填空题']; const flagDict = ['单选题', '多选题', '判断题', '填空题'];
fromOptions.type = classTaskStore.jyCT.filter(item => flagDict.includes(item.label)); fromOptions.type = entpCourseWorkTypeList.filter(item => flagDict.includes(item.label));
} }
if (classTaskStore.jySO.length>0) { if (entpCourseWorkGroupList.length>0) {
fromOptions.flag = classTaskStore.jySO; fromOptions.flag = entpCourseWorkGroupList;
} }
// if (classTaskStore.jyYear.length>0) { // if (entpCourseWorkYearList.length>0) {
// yearList.value = classTaskStore.jyYear; // yearList.value = entpCourseWorkYearList;
// } // }
}) })

View File

@ -125,7 +125,11 @@ import useClassTaskStore from '@/store/modules/classTask'
const emit = defineEmits(['addQuiz']) const emit = defineEmits(['addQuiz'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const userStore = useUserStore().user const userStore = useUserStore().user
const classTaskStore = useClassTaskStore(); const {
entpCourseWorkTypeList,
entpCourseWorkGroupList,
entpCourseWorkYearList
} = useClassTaskStore();
const props = defineProps({ const props = defineProps({
bookobj: { bookobj: {
@ -134,41 +138,11 @@ const props = defineProps({
}, },
}) })
const entpCourseWorkTypeList = ref([
{value: 0, label: "不限"},
{value: 1, label: "单选题"},
{value: 2, label: "填空题"},
{value: 3, label: "多选题"},
{value: 4, label: "判断题"},
{value: 5, label: "主观题"},
{value: 6, label: "复合题"},
]); // -
const entpCourseWorkGroupList = ref([{
Key: -1,
Value: '不限',
}, {
Key: 1,
Value: '真题',
}, {
Key: 0,
Value: '非真题',
}]); // -
const entpCourseWorkPointList = ref([ const entpCourseWorkPointList = ref([
{label: '不限', value: []}, {label: '不限', value: []},
]); // - ]); // -
const knowledgePointProps = ref({value: 'thirdId', label: 'title'}); const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
//const knowledgePointProps = ref({value: 'thirdId', label: 'knowTitle'}); //const knowledgePointProps = ref({value: 'thirdId', label: 'knowTitle'});
const entpCourseWorkYearList =ref([
{label: '不限', value: '-1'},
{label: '2024', value: '2024'},
{label: '2023', value: '2023'},
{label: '2022', value: '2022'},
{label: '2021', value: '2021'},
{label: '2020', value: '2020'},
]); // -
// //
@ -209,16 +183,6 @@ const workResource = reactive({
}); // }); //
onMounted(() => { onMounted(() => {
if (classTaskStore.jyCT.length>0) {
entpCourseWorkTypeList.value = classTaskStore.jyCT;
}
if (classTaskStore.jySO.length>0) {
entpCourseWorkGroupList.value = classTaskStore.jySO;
}
if (classTaskStore.jyYear.length>0) {
entpCourseWorkYearList.value = classTaskStore.jyYear;
}
debounceQueryData(); // debounceQueryData(); //
}) })