Compare commits

..

14 Commits

3 changed files with 78 additions and 68 deletions

View File

@ -55,6 +55,7 @@
<el-col :span="11"> <el-col :span="11">
<el-form-item label="知识点" label-width="70"> <el-form-item label="知识点" label-width="70">
<el-cascader <el-cascader
disabled
v-model="entpCourseWorkQueryParams.point" v-model="entpCourseWorkQueryParams.point"
clearable clearable
style="width: 100%" style="width: 100%"
@ -90,7 +91,12 @@
</el-row> </el-row>
<!-- 习题表格 --> <!-- 习题表格 -->
<div class="infinite-list-wrapper" > <div class="infinite-list-wrapper" >
<!-- <el-table :data="workResource.entpCourseWorkList" style="width: 100%; height: 100%;"> <el-table
:data="workResource.entpCourseWorkList"
style="width: 100%; height: 100%;"
v-loading="pageParams.loading"
ref="tableRef"
>
<el-table-column type="index" width="60" /> <el-table-column type="index" width="60" />
<el-table-column align="left" > <el-table-column align="left" >
<template #header> <template #header>
@ -114,22 +120,18 @@
<el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button> <el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> --> </el-table>
<ul
<!-- <ul
v-infinite-scroll="pageLoad" v-infinite-scroll="pageLoad"
class="infinite-list" class="infinite-list"
infinite-scroll-immediate="false" infinite-scroll-immediate="false"
infinite-scroll-distance='1' infinite-scroll-distance='100'
infinite-scroll-delay="1000" infinite-scroll-delay="1000"
:infinite-scroll-disabled="pageDisabled" :infinite-scroll-disabled="pageDisabled"
> >
<li v-for="(item,index) in workResource.entpCourseWorkList" :key="item" class="infinite-list-item"> <li v-for="(item,index) in workResource.entpCourseWorkList" :key="item" class="infinite-list-item">
<div align="left" style="width: 100%;" > <div align="left" style="width: 100%;" >
<!-- <template #header>
<div style="display: flex">
<div style="align-items: center;">题目内容</div>
</div>
</template> -->
<div @click="showExamAnalyseDrawer(item)"> <div @click="showExamAnalyseDrawer(item)">
<div> <div>
<span style="width: 20px;">{{ index +1 }}. </span> <span style="width: 20px;">{{ index +1 }}. </span>
@ -155,18 +157,18 @@
description="未找到相关试题" description="未找到相关试题"
style="width: 100%; height: 200px; margin-top: 20px;" style="width: 100%; height: 200px; margin-top: 20px;"
></el-empty> ></el-empty>
</div> </div> -->
</div> </div>
<!-- 分页 这里不用--> <!-- 分页 这里不用-->
<!-- <div style="height: 55px;"> <div style="height: 55px;">
<pagination <el-pagination
v-show="entpCourseWorkTotal > 0" v-show="pageParams.total > 0"
v-model:page="paginationParams.pageNum" v-model:page="paginationParams.pageNum"
v-model:limit="paginationParams.pageSize" v-model:limit="paginationParams.pageSize"
:total="entpCourseWorkTotal" :total="pageParams.total"
:style="{ position: 'relative', 'margin-top': '5px' }" :style="{ position: 'relative', 'margin-top': '5px' }"
@pagination="getPaginationList" /> @change="getPaginationList" />
</div> --> </div>
</div> </div>
<!-- 非习题训练常规作业 --> <!-- 非习题训练常规作业 -->
<div v-if="classWorkForm.worktype!='习题训练'"> <div v-if="classWorkForm.worktype!='习题训练'">
@ -276,6 +278,7 @@ import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance, computed
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { Search } from '@element-plus/icons-vue'
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork' import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
import { addClassworkReturnId } from '@/api/teaching/classwork' import { addClassworkReturnId } from '@/api/teaching/classwork'
@ -284,6 +287,7 @@ 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 { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
import { processList } from '@/hooks/useProcessList' import { processList } from '@/hooks/useProcessList'
import { getCurrentTime } from '@/utils/date' import { getCurrentTime } from '@/utils/date'
@ -409,15 +413,15 @@ const fileLoading = ref(false); // 常规作业loading
// //
const BASE_LIMIT_COUT = 50; // // const BASE_LIMIT_COUT = 50; //
const pageNoMore = computed( () => { // const pageNoMore = computed( () => {
if (pageParams.value.total < 1) { // if (pageParams.value.total < 1) {
return false; // return false;
} // }
let count = BASE_LIMIT_COUT >= pageParams.value.total ? pageParams.value.total : pageParams.value.originCount+BASE_LIMIT_COUT; // let count = BASE_LIMIT_COUT >= pageParams.value.total ? pageParams.value.total : pageParams.value.originCount+BASE_LIMIT_COUT;
return workResource.entpCourseWorkList.length >= count; // return workResource.entpCourseWorkList.length >= count;
}); // });
const pageDisabled = computed(() => pageParams.value.loading || pageNoMore.value); // const pageDisabled = computed(() => pageParams.value.loading || pageNoMore.value);
const pageParams = ref({ const pageParams = ref({
loading: false, // loading: false, //
originCount: 0, // originCount: 0, //
@ -497,7 +501,7 @@ function Apis(key) {
// //
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'', 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:'', keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
@ -508,10 +512,8 @@ function Apis(key) {
}) })
} }
const handleQueryFromEntpCourseWork= async (queryType) => { const handleQueryFromEntpCourseWork= async (queryType) => {
pageParams.value.loading = true; pageParams.value.loading = true;
// ( warn: ) // ( warn: )
// if (this.courseObj.edusubject=='' && this.courseObj.edustage=='') { // if (this.courseObj.edusubject=='' && this.courseObj.edustage=='') {
// // [+][+] // // [+][+]
@ -519,16 +521,16 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
// } // }
client(t('任务1', 1500)).then(res => { client(t('任务1', 1500)).then(res => {
console.log("请求返回",res); //console.log("",res);
if(paginationParams.pageNum == 1){ // if(paginationParams.pageNum == 1){
workResource.entpCourseWorkList = []; // workResource.entpCourseWorkList = [];
workResource.entpCourseWorkTotal = 0; // workResource.entpCourseWorkTotal = 0;
// // //
// pageParams.value.loading = false; // // pageParams.value.loading = false;
// pageParams.value.isFirst = true; // // pageParams.value.isFirst = true;
// pageParams.value.originCount = 0; // // pageParams.value.originCount = 0;
} // }
const data = res.data || []; const data = res.data || [];
if(data && data.length>0){ if(data && data.length>0){
// workResource.entpCourseWorkList = entpcourseworkres.data; // workResource.entpCourseWorkList = entpcourseworkres.data;
@ -542,22 +544,21 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
// //
processList(data); processList(data);
workResource.entpCourseWorkList.push(...data); //workResource.entpCourseWorkList.push(...data);
workResource.entpCourseWorkList = data;
// //
if (pageParams.value.isFirst) { if (pageParams.value.isFirst) {
pageParams.value.isFirst = false; pageParams.value.isFirst = false;
pageParams.value.originCount = workResource.entpCourseWorkList.length; pageParams.value.originCount = workResource.entpCourseWorkList.length;
pageParams.value.total = parseInt(res.msg); 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; pageParams.value.loading = false;
}); });
//const entpcourseworkres = await listEntpcourseworkNew(queryForm);
// const data = entpcourseworkres.data;
} }
// //
@ -977,6 +978,15 @@ const showExamAnalyseDrawer = (row) => {
}) })
} }
const tableRef = ref();
const getPaginationList = ( page, limit ) => {
paginationParams.pageNum = page;
paginationParams.pageSize = limit;
//console.log(page, limit)
handleQueryFromEntpCourseWork(0);
//
tableRef.value.setScrollTop(0);
}
const pageLoad = async() => { const pageLoad = async() => {
console.log("加载中...") console.log("加载中...")

View File

@ -179,7 +179,7 @@ const classWorkAnalysis = reactive({
entpcourseworklistarray: [], // ID entpcourseworklistarray: [], // ID
}) })
const tableRadio = reactive({ const tableRadio = reactive({
value: '1', // value: 1, //
list: [], // list list: [], // list
num1: 0, // num1: 0, //
num0: 0 // num0: 0 //
@ -219,7 +219,7 @@ const openDialog = (data, isInit=true) => {
classWorkAnalysis.workclass = data.workclass classWorkAnalysis.workclass = data.workclass
// //
tableRadio.list = [] tableRadio.list = []
tableRadio.value = '1' tableRadio.value = 1
tableRadio.num0 = 0 tableRadio.num0 = 0
tableRadio.num1 = 0 tableRadio.num1 = 0
@ -401,7 +401,7 @@ const getClassWorkStudentList = (rowId) => {
tableRadio.list = tableRadio.list =
classWorkAnalysis.classworkdata && classWorkAnalysis.classworkdata &&
classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '0') classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '0')
tableRadio.value = '1' tableRadio.value = 1
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length
tableRadio.num1 = tableRadio.list.length tableRadio.num1 = tableRadio.list.length
// //
@ -417,7 +417,7 @@ const getClassWorkStudentList = (rowId) => {
*/ */
const teacherCriticism = ()=>{ const teacherCriticism = ()=>{
// list // list
if(tableRadio.value == '1'&& classWorkAnalysis.worktype == '习题训练'){ if(tableRadio.value == 1 && classWorkAnalysis.worktype == '习题训练'){
// //
tableRadio.list = tableRadio.list.map((item) => { tableRadio.list = tableRadio.list.map((item) => {
return { return {
@ -572,16 +572,16 @@ const tableRadioChange = (e) => {
isopen_dtwk_table.value = false; isopen_dtwk_table.value = false;
console.log(e,'??????') console.log(e,'??????')
console.log("学生列表:", classWorkAnalysis.classworkdata) console.log("学生列表:", classWorkAnalysis.classworkdata)
if(e=='1'){ if(e==1){
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '0') tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '0')
tableRadio.value = '1'; tableRadio.value = 1;
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length; tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
tableRadio.num1 = tableRadio.list.length; tableRadio.num1 = tableRadio.list.length;
// //
teacherCriticism(); teacherCriticism();
}else if(e=='0'){ }else if(e==0){
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '0') tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '0')
tableRadio.value = '0'; tableRadio.value = 0;
tableRadio.num0 = tableRadio.list.length; tableRadio.num0 = tableRadio.list.length;
tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length; tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
} }

View File

@ -537,7 +537,7 @@ export default {
} }
}, },
clickChoose(value) { clickChoose(value) {
this.checkFileList = value ? this.currentSCFileList : [] this.checkFileList = value ? this.currentFileList : []
}, },
deleteTalk(item) { deleteTalk(item) {
let index = this.currentFileList.indexOf(item) let index = this.currentFileList.indexOf(item)