This commit is contained in:
白了个白 2024-11-11 12:53:16 +08:00
parent 2929997d17
commit 6c66c97e33
1 changed files with 91 additions and 29 deletions

View File

@ -287,7 +287,7 @@ import prevReadMsgDialog from '@/views/classTask/container/newTask/prevReadMsg-D
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 { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"
import {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'
const userStore = useUserStore().user const userStore = useUserStore().user
@ -434,6 +434,28 @@ const handleQueryParamFromEntpCourseWork = (queryType) => {
handleQueryFromEntpCourseWork(queryType); handleQueryFromEntpCourseWork(queryType);
}; };
let obj = {};
function Apis(key) {
obj[key] = [];
return function(task) {
return new Promise((resolve, reject) => {
obj[key].push(task);
Promise.all([...obj[key]]).then(res => {
const i = obj[key].findIndex(item => {
return item == task;
});
resolve(obj[key][i]);
//arr.splice(i, 1);
})
})
}
}
const client = new Apis('/paht');
/** /**
* @desc: 1习题训练 - 新查询试题 * @desc: 1习题训练 - 新查询试题
* @return: {*} * @return: {*}
@ -442,32 +464,40 @@ const handleQueryParamFromEntpCourseWork = (queryType) => {
* 1 - 按条件查询 * 1 - 按条件查询
* 2 - 按关键词查询 * 2 - 按关键词查询
*/ */
const t = function(name, time) {
return new Promise(resolve => {
const queryForm = {
//
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
//
eid: props.bookobj.levelSecondId,
sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject,
edustage: userStore.edustage,
//
//
worktype: entpCourseWorkQueryParams.worktype.label,
workTypeId: entpCourseWorkQueryParams.worktype.value,
//
workgroup: entpCourseWorkQueryParams.workgroup,
//
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
//
thirdId: entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
//
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
}
const entpcourseworkres = listEntpcourseworkNew(queryForm);
resolve(entpcourseworkres);
})
}
const handleQueryFromEntpCourseWork= async (queryType) => { const handleQueryFromEntpCourseWork= async (queryType) => {
pageParams.value.loading = true; pageParams.value.loading = true;
const queryForm = {
//
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
//
eid: props.bookobj.levelSecondId,
sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject,
edustage: userStore.edustage,
//
//
worktype: entpCourseWorkQueryParams.worktype.label,
workTypeId: entpCourseWorkQueryParams.worktype.value,
//
workgroup: entpCourseWorkQueryParams.workgroup,
//
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
//
thirdId: entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
//
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
}
// ( warn: ) // ( warn: )
// if (this.courseObj.edusubject=='' && this.courseObj.edustage=='') { // if (this.courseObj.edusubject=='' && this.courseObj.edustage=='') {
@ -475,9 +505,19 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
// queryForm.edusubject = ''; // queryForm.edusubject = '';
// } // }
const entpcourseworkres = await listEntpcourseworkNew(queryForm); client(t('任务1', 1500)).then(res => {
const data = entpcourseworkres.data; console.log("请求返回",res);
if(data && data.length>0){ if(paginationParams.pageNum == 1){
workResource.entpCourseWorkList = [];
workResource.entpCourseWorkTotal = 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; // workResource.entpCourseWorkList = entpcourseworkres.data;
// workResource.entpCourseWorkTotal = entpcourseworkres.data.length; // workResource.entpCourseWorkTotal = entpcourseworkres.data.length;
@ -498,6 +538,12 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
} }
} }
pageParams.value.loading = false; pageParams.value.loading = false;
});
//const entpcourseworkres = await listEntpcourseworkNew(queryForm);
// const data = entpcourseworkres.data;
} }
// //
@ -956,6 +1002,23 @@ onMounted(async() => {
}) })
// const refreshData = () => {
// console.log("")
// //
// initPageParams();
// //
// handleQueryFromEntpCourseWork(0);
// //
// getQueryFromEvaluationclue();
// //
// getEntpCourseWorkPointList();
// }
// //
// const debounceQueryData = debounce(throttle(refreshData, 1000), 1000);
//
const debounceQueryData = debounce(() => { const debounceQueryData = debounce(() => {
console.log("防抖 加载数据中...") console.log("防抖 加载数据中...")
// //
@ -968,7 +1031,6 @@ const debounceQueryData = debounce(() => {
getEntpCourseWorkPointList(); getEntpCourseWorkPointList();
}, 1000); }, 1000);
watch(() => props.propsformobj.uniquekey, (newVal) => { watch(() => props.propsformobj.uniquekey, (newVal) => {
console.log(props.propsformobj,'propsformobj') console.log(props.propsformobj,'propsformobj')
if(props.propsformobj.uniquekey){ if(props.propsformobj.uniquekey){