diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue index 30f368b..059ad31 100644 --- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue +++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue @@ -410,12 +410,19 @@ const fileLoading = ref(false); // 常规作业loading // 下拉滚动参数 const BASE_LIMIT_COUT = 50; // 总加载额外试题数 -const pageNoMore = computed( () => workResource.entpCourseWorkList.length >= pageParams.value.originCount+BASE_LIMIT_COUT ); +const pageNoMore = computed( () => { + if (pageParams.value.total < 1) { + return false; + } + let count = BASE_LIMIT_COUT >= pageParams.value.total ? pageParams.value.total : pageParams.value.originCount+BASE_LIMIT_COUT; + return workResource.entpCourseWorkList.length >= count; +}); const pageDisabled = computed(() => pageParams.value.loading || pageNoMore.value); const pageParams = ref({ loading: false, // 是否正在加载中 originCount: 0, // 初始条目数量 isFirst: true, // 是否是第一次加载 + total: 0, }) /*** @@ -541,6 +548,7 @@ const handleQueryFromEntpCourseWork= async (queryType) => { if (pageParams.value.isFirst) { pageParams.value.isFirst = false; pageParams.value.originCount = workResource.entpCourseWorkList.length; + pageParams.value.total = parseInt(res.msg); } } pageParams.value.loading = false; @@ -986,6 +994,7 @@ const initPageParams = () => { pageParams.value.loading = false; pageParams.value.isFirst = true; pageParams.value.originCount = 0; + pageParams.value.total = 0; // 初始化分页参数 paginationParams.pageNum = 1; @@ -1008,6 +1017,22 @@ onMounted(async() => { }) +// const refreshData = () => { +// console.log("刷新数据") +// // 初始化滚动加载参数 +// initPageParams(); +// // 习题资源 +// handleQueryFromEntpCourseWork(0); +// // 框架梳理 +// getQueryFromEvaluationclue(); +// // 知识点 +// getEntpCourseWorkPointList(); +// } +// // 结合防抖和节流 +// const debounceQueryData = debounce(throttle(refreshData, 1000), 1000); + + + // 防抖 const debounceQueryData = debounce(() => { console.log("防抖 加载数据中...")