This commit is contained in:
“zouyf” 2024-11-11 13:43:09 +08:00
parent 2929997d17
commit f504cee74b
1 changed files with 42 additions and 13 deletions

View File

@ -442,7 +442,7 @@ const handleQueryParamFromEntpCourseWork = (queryType) => {
* 1 - 按条件查询 * 1 - 按条件查询
* 2 - 按关键词查询 * 2 - 按关键词查询
*/ */
const handleQueryFromEntpCourseWork= async (queryType) => { const handleQueryFromEntpCourseWork= async (queryType, value) => {
pageParams.value.loading = true; pageParams.value.loading = true;
const queryForm = { const queryForm = {
@ -476,6 +476,20 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
// } // }
const entpcourseworkres = await listEntpcourseworkNew(queryForm); const entpcourseworkres = await listEntpcourseworkNew(queryForm);
// ,
if (nextLevelSecondId != -1) {
console.log('再次执行')
nextLevelSecondId = -1;
const debouncedFunction = debounceQueryData(10);
debouncedFunction();
return;
}
// ,
if (paginationParams.pageNum == 1) {
initPageParams();
}
const data = entpcourseworkres.data; const data = entpcourseworkres.data;
if(data && data.length>0){ if(data && data.length>0){
// workResource.entpCourseWorkList = entpcourseworkres.data; // workResource.entpCourseWorkList = entpcourseworkres.data;
@ -486,9 +500,12 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
item.worktype = '单选题' item.worktype = '单选题'
} }
}) })
// //
processList(data); processList(data);
workResource.entpCourseWorkList.push(...data); workResource.entpCourseWorkList.push(...data);
// //
@ -956,17 +973,21 @@ onMounted(async() => {
}) })
const debounceQueryData = debounce(() => { let nextLevelSecondId = -1;
console.log("防抖 加载数据中...") const debounceQueryData = (wait) => {
// const debouncedFunction = debounce(() => {
initPageParams(); console.log("防抖 加载数据中...")
// //
handleQueryFromEntpCourseWork(0); initPageParams();
// //
getQueryFromEvaluationclue(); handleQueryFromEntpCourseWork(0);
// //
getEntpCourseWorkPointList(); getQueryFromEvaluationclue();
}, 1000); //
getEntpCourseWorkPointList();
}, wait);
return debouncedFunction;
}
watch(() => props.propsformobj.uniquekey, (newVal) => { watch(() => props.propsformobj.uniquekey, (newVal) => {
@ -977,7 +998,15 @@ watch(() => props.propsformobj.uniquekey, (newVal) => {
}) })
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => { watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
debounceQueryData(); console.log('更改章节id->', newVal);
//nextLevelSecondId = newVal;
if (pageParams.value.loading) {
console.log('更改章节id->', newVal);
nextLevelSecondId = newVal;
return;
}
const debouncedFunction = debounceQueryData(1000);
debouncedFunction();
}) })
</script> </script>