From f2dbf12f3c244f6eb79c60d24f288e8d28899d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Tue, 12 Nov 2024 15:01:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E4=BD=9C=E4=B8=9A=E5=B8=83=E7=BD=AE]=20-?= =?UTF-8?q?=20=E6=9B=B4=E6=94=B9=E4=B8=BA=E5=88=86=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/newTask/taskTypeView.vue | 83 +++++++++++-------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue index 059ad31..84550c1 100644 --- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue +++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue @@ -90,7 +90,11 @@
- -
- + @change="getPaginationList" /> +
@@ -276,6 +276,7 @@ import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance, computed import { ElMessage } from 'element-plus' import { cloneDeep } from 'lodash' import { useRouter } from 'vue-router' +import { Search } from '@element-plus/icons-vue' import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork' import { addClassworkReturnId } from '@/api/teaching/classwork' @@ -284,6 +285,7 @@ import { listEvaluation } from '@/api/subject' import { listEntpcoursefile } from '@/api/education/entpcoursefile' import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint"; + import { useGetHomework } from '@/hooks/useGetHomework' import { processList } from '@/hooks/useProcessList' import { getCurrentTime } from '@/utils/date' @@ -409,15 +411,15 @@ const fileLoading = ref(false); // 常规作业loading // 下拉滚动参数 -const BASE_LIMIT_COUT = 50; // 总加载额外试题数 -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 BASE_LIMIT_COUT = 50; // 总加载额外试题数 +// 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, // 初始条目数量 @@ -519,16 +521,16 @@ const handleQueryFromEntpCourseWork= async (queryType) => { // } client(t('任务1', 1500)).then(res => { - console.log("请求返回",res); - if(paginationParams.pageNum == 1){ - workResource.entpCourseWorkList = []; - workResource.entpCourseWorkTotal = 0; + //console.log("请求返回",res); + // if(paginationParams.pageNum == 1){ + // workResource.entpCourseWorkList = []; + // workResource.entpCourseWorkTotal = 0; - // 初始化下拉滚动条参数 - // pageParams.value.loading = false; - // pageParams.value.isFirst = true; - // pageParams.value.originCount = 0; - } + // // 初始化下拉滚动条参数 + // // pageParams.value.loading = false; + // // pageParams.value.isFirst = true; + // // pageParams.value.originCount = 0; + // } const data = res.data || []; if(data && data.length>0){ // workResource.entpCourseWorkList = entpcourseworkres.data; @@ -542,17 +544,20 @@ const handleQueryFromEntpCourseWork= async (queryType) => { // 格式化试题信息 processList(data); - workResource.entpCourseWorkList.push(...data); + //workResource.entpCourseWorkList.push(...data); + workResource.entpCourseWorkList = data; // 初次加载时更新当前试题数量 if (pageParams.value.isFirst) { pageParams.value.isFirst = false; pageParams.value.originCount = workResource.entpCourseWorkList.length; pageParams.value.total = parseInt(res.msg); + paginationParams.pageNum = Math.ceil(parseInt(res.msg)/paginationParams.pageSize); + console.log('first->', pageParams.value, paginationParams); } } pageParams.value.loading = false; - }); +}); //const entpcourseworkres = await listEntpcourseworkNew(queryForm); @@ -977,6 +982,12 @@ const showExamAnalyseDrawer = (row) => { }) } +const getPaginationList = ( page, limit ) => { + paginationParams.pageNum = page; + paginationParams.pageSize = limit; + console.log(page, limit) + handleQueryFromEntpCourseWork(0); +} const pageLoad = async() => { console.log("加载中...") From 7c1c4e9b7dea4e5b6124740a6d67b860d87adf30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Tue, 12 Nov 2024 15:26:46 +0800 Subject: [PATCH 2/3] 1 --- .../src/views/classTask/container/newTask/taskTypeView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue index 84550c1..cb34954 100644 --- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue +++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue @@ -499,7 +499,7 @@ function Apis(key) { // 年份 yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'', // 知识点 - thirdId: entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'', + thirdId: entpCourseWorkQueryParams.point && entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'', // 关键字 keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'', From fa54546f5e87a02f1b8979e2a9ef728f532e7893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Tue, 12 Nov 2024 15:43:47 +0800 Subject: [PATCH 3/3] 1 --- .../container/newTask/taskTypeView.vue | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue index cb34954..f8d13ce 100644 --- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue +++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue @@ -510,9 +510,7 @@ function Apis(key) { }) } const handleQueryFromEntpCourseWork= async (queryType) => { - pageParams.value.loading = true; - // 初中政治特殊处理( warn: 需确认是否修改 ) // if (this.courseObj.edusubject=='政治' && this.courseObj.edustage=='初中') { @@ -536,32 +534,28 @@ const handleQueryFromEntpCourseWork= async (queryType) => { // workResource.entpCourseWorkList = entpcourseworkres.data; // workResource.entpCourseWorkTotal = entpcourseworkres.data.length; - data.forEach(item=> { - if (item.worktype == '选择题') { - item.worktype = '单选题' + data.forEach(item=> { + if (item.worktype == '选择题') { + item.worktype = '单选题' + } + }) + + // 格式化试题信息 + processList(data); + //workResource.entpCourseWorkList.push(...data); + workResource.entpCourseWorkList = data; + + // 初次加载时更新当前试题数量 + if (pageParams.value.isFirst) { + pageParams.value.isFirst = false; + pageParams.value.originCount = workResource.entpCourseWorkList.length; + pageParams.value.total = parseInt(res.msg); + paginationParams.pageNum = Math.ceil(parseInt(res.msg)/paginationParams.pageSize); + //console.log('first->', pageParams.value, paginationParams); } - }) - - // 格式化试题信息 - processList(data); - //workResource.entpCourseWorkList.push(...data); - workResource.entpCourseWorkList = data; - - // 初次加载时更新当前试题数量 - if (pageParams.value.isFirst) { - pageParams.value.isFirst = false; - pageParams.value.originCount = workResource.entpCourseWorkList.length; - pageParams.value.total = parseInt(res.msg); - paginationParams.pageNum = Math.ceil(parseInt(res.msg)/paginationParams.pageSize); - console.log('first->', pageParams.value, paginationParams); } - } - pageParams.value.loading = false; -}); - - //const entpcourseworkres = await listEntpcourseworkNew(queryForm); - - // const data = entpcourseworkres.data; + pageParams.value.loading = false; + }); }