作业批改:需求变更修改

This commit is contained in:
白了个白 2024-11-04 11:25:58 +08:00
parent d65eb565e5
commit e1c8ab42d9
5 changed files with 75 additions and 45 deletions

View File

@ -4,7 +4,7 @@
<div class="class-reserv-tabs">
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
</div>
<div v-if="tabActive === '已结束'">
<div v-if="tabActive === '已批改'">
<div class="demo-date-picker">
<div class="block">
<el-date-picker
@ -27,7 +27,7 @@
<div v-if="classWorkList.length > 0">
<task-item
v-for="(item, index) in activeDataList"
v-show="tabActive === '进行中'"
v-show="tabActive === '待批改'"
:key="index"
:item="item"
:tabactive="tabActive"
@ -36,7 +36,7 @@
></task-item>
<task-item
v-for="(item, index) in doneDataList"
v-show="tabActive === '已结束'"
v-show="tabActive === '已批改'"
:key="index"
:item="item"
:tabactive="tabActive"
@ -76,8 +76,8 @@ const toolState = useToolState();
const classTaskStore = useClassTaskStore()
const userStore = useUserStore().user
// const itemDialogRef = ref(null)
const tabOptions = ref(['进行中', '已结束'])
const tabActive = ref('进行中')
const tabOptions = ref(['待批改', '已批改'])
const tabActive = ref('待批改')
const dataList = ref([])
const EndDate = ref(getCurrentTime('YYYY-MM-DD'))
@ -144,8 +144,8 @@ const getClassWorkList = async () => {
edituserid: userStore.userId, // id
edustage: userStore.edustage, //
edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,//
status: '1', // 1-
orderby: 'deaddate DESC',
pageSize: 100,
@ -153,15 +153,15 @@ const getClassWorkList = async () => {
/**
* 2024-10-17 由于 后面截止时间加了 时分特加判断
* 1进行中以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2结束以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
* 1待批改以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2批改以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
*/
let list = [];
if(tabActive.value === '进行中'){
//
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate); //
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); //
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate); //
}
@ -234,8 +234,8 @@ const getStudentClassWorkData = async() => {
// edituserid: userStore.userId, // id
// classids: classTaskStore.classListIds.join(','),
// edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
// deaddate: EndDate.value,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
// deaddate: EndDate.value,//
// //status: '1', // 1-
// orderby: "deaddate DESC",//
// pageSize: 1000,
@ -318,8 +318,17 @@ const getStudentClassWorkData = async() => {
classWorkList.value[t].finishpercent = parseInt(
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdatacount) * 100
)
// - : -
// teacherCorrectionProgress :
// workdataresultcount
// teacherrationgcount
// (-) / * 100
classWorkList.value[t].teacherCorrectionProgress = parseInt(
((classWorkList.value[t].teacherrationgcount) / classWorkList.value[t].workdataresultcount) * 100
)
} else {
classWorkList.value[t].finishpercent = 0
classWorkList.value[t].teacherCorrectionProgress = 0
}
//
@ -379,6 +388,7 @@ const getStudentClassWorkDataPolling = () => {
getStudentVisible()
//
pollingST.value = setInterval(() => {
console.log('轮询查询学生作业进度')
getStudentVisible()
}, 1000 * 10)
}
@ -422,8 +432,8 @@ const getStudentVisible = async () => {
edituserid: userStore.userId, // id
edustage: userStore.edustage,//
edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,//
status: '1', // 1-
// orderby: 'concat(deaddate,uniquekey) DESC',
orderby: 'deaddate DESC',
@ -432,15 +442,15 @@ const getStudentVisible = async () => {
/**
* 2024-10-17 由于 后面截止时间加了 时分特加判断
* 1进行中以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2结束以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
* 1待批改以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2批改以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
*/
let list = [];
if(tabActive.value === '进行中'){
//
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate); //
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); //
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate); //
}
const curWorkList = list
@ -471,6 +481,15 @@ const getStudentVisible = async () => {
}
//
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
// - :
// teacherCorrectionProgress :
// workdataresultcount
// teacherrationgcount
// () / * 100
classWorkList.value[t].teacherCorrectionProgress = parseInt(
((curWork.teacherrationgcount) / curWork.workdataresultcount) * 100
)
} else {
//
if(curWork && curWork.workdataresultcount == 0){
@ -478,6 +497,7 @@ const getStudentVisible = async () => {
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
}
classWorkList.value[t].finishpercent = 0
classWorkList.value[t].teacherCorrectionProgress = 0
}
}

View File

@ -14,7 +14,18 @@
&nbsp;|&nbsp; 截止时间{{ item.deaddate }} &nbsp;|&nbsp;{{ tabactive }}
</div>
</div>
<div class="class-reserv-item-tool">
<div class="class-reserv-item-progress">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.finishpercent" status="success" style="cursor: pointer"></el-progress>
<span>已交</span>
</div>
<div class="class-reserv-item-progress">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.teacherCorrectionProgress" status="success" style="cursor: pointer"></el-progress>
<span>已批阅</span>
</div>
<!-- <div class="class-reserv-item-tool">
<span>
<span v-if="item.workdataresultcount!=0" style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultcount }}</span>
<span v-if="item.workdataresultcount==0">{{ item.workdataresultcount }}</span>
@ -22,23 +33,11 @@
<span>已交</span>
</div>
<div class="class-reserv-item-tool">
<!-- 总人数-已批阅人数 -->
<span style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount?item.workdatacount - item.teacherrationgcount:item.workdatacount }}</span>
<span>待批阅</span>
</div>
</div> -->
<div class="class-reserv-item-tool">
<span>
<!-- {{ item.averagetime?item.averagetime:0 }} -->
<!-- <span v-if=" item.averagetime<60 ">
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
</span>
<span v-if=" item.averagetime==60 ">
<span style="color: #007fff; font-weight: 900; font-size: 15px">1</span>小时
</span>
<span v-if=" item.averagetime>60 ">
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime / 60)}}</span>小时
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ Math.floor(item.averagetime % 60)}}</span>分钟
</span> -->
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
</span>
<span>平均用时</span>
@ -97,6 +96,10 @@ const props = defineProps({
}
}
}
.class-reserv-item-progress {
width: 200px;
font-size: 14px;
}
.class-reserv-item-tool {
margin-left: 10px;
display: flex;

View File

@ -677,9 +677,7 @@ const handleClassOverviewOpen = (type) =>{
}
}
})
const allTeacherRating = allTopic.reduce((acc, cur) => {
return acc + cur.teacherRating;
},0)
const allTeacherRating = allTopic.reduce((acc, cur) => acc + cur.teacherRating, 0)
rightAnswer > 0?item.scoingRate = (score/allTeacherRating * 100).toFixed(0):item.scoingRate = ''
item.getScore = score

View File

@ -15,7 +15,7 @@
<div class="class-name flex">
<span class="name">{{ item.uniquekey }}</span>
<el-tag class="tag" round :type="tagType(item.deaddate)" effect="dark" size="small">{{
getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate ? '已结束' : '进行中' }}</el-tag>
getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate ? '已批改' : '待批改' }}</el-tag>
<el-tag :type="item.workclass" size="large">{{ item.worktype }}</el-tag>
</div>
<div class="class-time">{{ item.classcaption }} | 截止时间{{ item.deaddate }} </div>
@ -52,9 +52,9 @@ const getHomework = async () => {
const { edustage, edusubject } = user
try {
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'deaddate 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 && getTomorrow() <= item.deaddate) //
homeworkList.value.forEach((item) => {
// UI
if (item.worktype == '学习目标定位') {

View File

@ -43,6 +43,15 @@ export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) => {
let classWorkList = []
// 将标签中的双引号增加转义
let escapeHtmlQuotes = (str) => {
// 后端已replace双引号, 故前端不用在处理
const regex1 = /\\+/g; // 匹配多个反斜杠
let result = str.replace(regex1, '\\');
result = str.replace(/(?<!\\)\n/g, '<br />'); //替换\n而不替换\\n 为 \\n
return result;
}
/**
* 获取班级作业
*/
@ -52,8 +61,8 @@ export const getClassWorkList = async (id) => {
/**
* 2024-10-17 由于 后面截止时间加了 时分特加判断
* 1进行中以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2结束以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
* 1待批改以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2批改以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
*/
let list = response.rows