Merge pull request 'baigl' (#327) from baigl into main

Reviewed-on: #327
This commit is contained in:
baigl 2024-10-17 11:29:35 +08:00
commit be4f9d2499
2 changed files with 69 additions and 38 deletions

View File

@ -145,63 +145,78 @@ const getClassWorkList = async () => {
edituserid: userStore.userId, // id
edustage: userStore.edustage, //
edusubject: userStore.edusubject,//
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,//
status: '1', // 1-
// orderby: 'concat(deaddate,uniquekey) DESC',
orderby: 'deaddate DESC',
pageSize: 100,
})
for (var i = 0; i < response.rows.length; i++) {
/**
* 2024-10-17 由于 后面截止时间加了 时分特加判断
* 1进行中以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2已结束以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
*/
let list = [];
if(tabActive.value === '进行中'){
//
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate); //
}else{
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate); //
}
for (var i = 0; i < list.length; i++) {
//
response.rows[i].workdatalist = []
response.rows[i].workdatacount = 0 //
response.rows[i].workdatalistVisible = false
response.rows[i].workdatafeedbackcount = 0 //
response.rows[i].feedtimelength = 0
response.rows[i].rightAnswerCount = 0
response.rows[i].scoingRate = 0 + '%' //
response.rows[i].averagetime = 0 //
list[i].workdatalist = []
list[i].workdatacount = 0 //
list[i].workdatalistVisible = false
list[i].workdatafeedbackcount = 0 //
list[i].feedtimelength = 0
list[i].rightAnswerCount = 0
list[i].scoingRate = 0 + '%' //
list[i].averagetime = 0 //
// ----------------------------------------------
// UI
if (response.rows[i].worktype == '学习目标定位') {
response.rows[i].workclass = 'success'
response.rows[i].workcodesList = JSON.parse(response.rows[i].workcodes)
} else if (response.rows[i].worktype == '教材研读') {
response.rows[i].workclass = 'primary'
} else if (response.rows[i].worktype == '框架梳理') {
response.rows[i].workclass = 'warning'
} else if (response.rows[i].worktype == '学科定位') {
response.rows[i].workclass = 'info'
} else if (response.rows[i].worktype == '习题训练') {
response.rows[i].workclass = 'danger'
if (list[i].worktype == '学习目标定位') {
list[i].workclass = 'success'
list[i].workcodesList = JSON.parse(response.rows[i].workcodes)
} else if (list[i].worktype == '教材研读') {
list[i].workclass = 'primary'
} else if (list[i].worktype == '框架梳理') {
list[i].workclass = 'warning'
} else if (list[i].worktype == '学科定位') {
list[i].workclass = 'info'
} else if (list[i].worktype == '习题训练') {
list[i].workclass = 'danger'
} else {
response.rows[i].workclass = ''
list[i].workclass = ''
}
//
if (response.rows[i].entpcourseworklist != '') {
response.rows[i].entpcourseworklistarray = JSON.parse(
'[' + response.rows[i].entpcourseworklist + ']'
if (list[i].entpcourseworklist != '') {
list[i].entpcourseworklistarray = JSON.parse(
'[' + list[i].entpcourseworklist + ']'
)
} else {
response.rows[i].entpcourseworklistarray = []
list[i].entpcourseworklistarray = []
}
// classworkdatastudentids
if (
response.rows[i].classworkdatastudentids != '' &&
response.rows[i].classworkdatastudentids != null &&
response.rows[i].classworkdatastudentids != 'null'
list[i].classworkdatastudentids != '' &&
list[i].classworkdatastudentids != null &&
list[i].classworkdatastudentids != 'null'
) {
const stuList = JSON.parse('[' + response.rows[i].classworkdatastudentids + ']')
response.rows[i].workdatacount = stuList.length
const stuList = JSON.parse('[' + list[i].classworkdatastudentids + ']')
list[i].workdatacount = stuList.length
}
}
// (workdatacount)>0
if (response.rows && response.rows.length > 0) {
classWorkList.value = response.rows && response.rows.filter((item) => item.workdatacount > 0)
if (list && list.length > 0) {
classWorkList.value = list && list.filter((item) => item.workdatacount > 0)
//TODO total
total.value = response.total
total.value = 0
}else{
classWorkList.value = []
total.value = 0
@ -222,6 +237,7 @@ const getStudentClassWorkData = async() => {
// classids: classTaskStore.classListIds.join(','),
// edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
// deaddate: EndDate.value,//
// //status: '1', // 1-
// orderby: "deaddate DESC",// TODO deaddate
// pageSize: 1000,
@ -407,13 +423,28 @@ const getStudentVisible = async () => {
edituserid: userStore.userId, // id
edustage: userStore.edustage,//
edusubject: userStore.edusubject,//
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,//
status: '1', // 1-
// orderby: 'concat(deaddate,uniquekey) DESC',
orderby: 'deaddate DESC',
pageSize: 100
})
const curWorkList = response.rows
/**
* 2024-10-17 由于 后面截止时间加了 时分特加判断
* 1进行中以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2已结束以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
*/
let list = [];
if(tabActive.value === '进行中'){
//
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate); //
}else{
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate); //
}
const curWorkList = list
/**
* warn: 这里仅更新了finishpercent(进度条), 且当前作业布置推送新任务时, curWorkList中会查到新的任务与当前页面中this.classWorkList长度不一致,

View File

@ -52,8 +52,8 @@ const getHomework = async () => {
try {
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'uniquekey DESC', pageSize: 500 })
//
// homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate)
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getTomorrow() <= item.deaddate) //
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate) //
// homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey && getTomorrow() <= item.deaddate) //
homeworkList.value.forEach((item) => {
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
//