[作业设计] - 优化单元搜题

This commit is contained in:
“zouyf” 2024-12-13 16:46:11 +08:00
parent 33287aad57
commit 497f4dd778
1 changed files with 31 additions and 7 deletions

View File

@ -286,6 +286,7 @@ import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval
import { listEvaluation } from '@/api/subject' import { listEvaluation } from '@/api/subject'
import { listEntpcoursefile } from '@/api/education/entpcoursefile' import { listEntpcoursefile } from '@/api/education/entpcoursefile'
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint"; import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
import { isJson } from "@/utils/comm";
import { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
@ -483,12 +484,13 @@ function Apis(key) {
*/ */
const t = function(name, time) { const t = function(name, time) {
return new Promise(resolve => { return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = { const queryForm = {
// //
currentPage: paginationParams.pageNum, currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize, pageSize: paginationParams.pageSize,
// //
eid: props.bookobj.levelSecondId, eid: evalId,
sectionName: props.bookobj.coursetitle, sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject, edusubject: userStore.edusubject,
edustage: userStore.edustage, edustage: userStore.edustage,
@ -583,10 +585,14 @@ const getQueryFromEvaluationclue = () => {
} }
if (clueres.rows[i].childlist != '') { if (clueres.rows[i].childlist != '') {
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']'); const tmpJson = '['+clueres.rows[i].childlist+']';
for (var j=0; j<clueres.rows[i].childArray.length; j++) { if (isJson(tmpJson)){
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, ''); clueres.rows[i].childArray = JSON.parse(tmpJson);
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
}
} }
} else { } else {
clueres.rows[i].childArray = {}; clueres.rows[i].childArray = {};
} }
@ -1062,9 +1068,27 @@ watch(() => props.propsformobj.uniquekey, (newVal) => {
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; // classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; //
} }
}) })
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => { watch(
console.log(props.bookobj,'课程选择') [
debounceQueryData(); () => props.bookobj.levelSecondId,
() => props.bookobj.levelFirstId
],
([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
if(props.bookobj.node.edusubject == '英语' && props.bookobj.node.edustage == '高中'){
if(newLevelFirstId != oldLevelFirstId){
console.log(props.bookobj,'高中英语-课程选择')
debounceQueryData();
}
else{
//
workResource.entpCourseWorkList = [];
return;
}
}
else{
console.log(props.bookobj,'课程选择')
debounceQueryData();
}
}) })
</script> </script>