作业批改:需求变更修改
This commit is contained in:
parent
d65eb565e5
commit
e1c8ab42d9
|
@ -4,7 +4,7 @@
|
||||||
<div class="class-reserv-tabs">
|
<div class="class-reserv-tabs">
|
||||||
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="tabActive === '已结束'">
|
<div v-if="tabActive === '已批改'">
|
||||||
<div class="demo-date-picker">
|
<div class="demo-date-picker">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<div v-if="classWorkList.length > 0">
|
<div v-if="classWorkList.length > 0">
|
||||||
<task-item
|
<task-item
|
||||||
v-for="(item, index) in activeDataList"
|
v-for="(item, index) in activeDataList"
|
||||||
v-show="tabActive === '进行中'"
|
v-show="tabActive === '待批改'"
|
||||||
:key="index"
|
:key="index"
|
||||||
:item="item"
|
:item="item"
|
||||||
:tabactive="tabActive"
|
:tabactive="tabActive"
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
></task-item>
|
></task-item>
|
||||||
<task-item
|
<task-item
|
||||||
v-for="(item, index) in doneDataList"
|
v-for="(item, index) in doneDataList"
|
||||||
v-show="tabActive === '已结束'"
|
v-show="tabActive === '已批改'"
|
||||||
:key="index"
|
:key="index"
|
||||||
:item="item"
|
:item="item"
|
||||||
:tabactive="tabActive"
|
:tabactive="tabActive"
|
||||||
|
@ -76,8 +76,8 @@ const toolState = useToolState();
|
||||||
const classTaskStore = useClassTaskStore()
|
const classTaskStore = useClassTaskStore()
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
// const itemDialogRef = ref(null)
|
// const itemDialogRef = ref(null)
|
||||||
const tabOptions = ref(['进行中', '已结束'])
|
const tabOptions = ref(['待批改', '已批改'])
|
||||||
const tabActive = ref('进行中')
|
const tabActive = ref('待批改')
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
const EndDate = ref(getCurrentTime('YYYY-MM-DD'))
|
const EndDate = ref(getCurrentTime('YYYY-MM-DD'))
|
||||||
|
|
||||||
|
@ -144,8 +144,8 @@ const getClassWorkList = async () => {
|
||||||
edituserid: userStore.userId, // 老师的id
|
edituserid: userStore.userId, // 老师的id
|
||||||
edustage: userStore.edustage, // 学段
|
edustage: userStore.edustage, // 学段
|
||||||
edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
// deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期 弃用
|
// deaddate: tabActive.value === '待批改'? getTomorrow() : EndDate.value,// 待批改:明天,已批改:选择的日期 弃用
|
||||||
deaddate: EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: EndDate.value,// 待批改:明天,已批改:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
orderby: 'deaddate DESC',
|
orderby: 'deaddate DESC',
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
|
@ -153,15 +153,15 @@ const getClassWorkList = async () => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
||||||
* 1、进行中、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
* 1、待批改、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
||||||
* 2、已结束、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
* 2、已批改、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
||||||
*/
|
*/
|
||||||
let list = [];
|
let list = [];
|
||||||
if(tabActive.value === '进行中'){
|
if(tabActive.value === '待批改'){
|
||||||
// 进行中 当前日期时间 小于 截止 日期时间
|
// 待批改 当前日期时间 小于 截止 日期时间
|
||||||
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); // 待批改
|
||||||
}else{
|
}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
|
// edituserid: userStore.userId, // 老师的id
|
||||||
// classids: classTaskStore.classListIds.join(','),
|
// classids: classTaskStore.classListIds.join(','),
|
||||||
// edusubject: userStore.edusubject,//学科
|
// edusubject: userStore.edusubject,//学科
|
||||||
// deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
// deaddate: tabActive.value === '待批改'? getTomorrow() : EndDate.value,// 待批改:明天,已批改:选择的日期
|
||||||
// deaddate: EndDate.value,// 进行中:明天,已结束:选择的日期
|
// deaddate: EndDate.value,// 待批改:明天,已批改:选择的日期
|
||||||
// //status: '1', // 作业状态:1-已发布
|
// //status: '1', // 作业状态:1-已发布
|
||||||
// orderby: "deaddate DESC",//
|
// orderby: "deaddate DESC",//
|
||||||
// pageSize: 1000,
|
// pageSize: 1000,
|
||||||
|
@ -318,8 +318,17 @@ const getStudentClassWorkData = async() => {
|
||||||
classWorkList.value[t].finishpercent = parseInt(
|
classWorkList.value[t].finishpercent = parseInt(
|
||||||
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdatacount) * 100
|
(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 {
|
} else {
|
||||||
classWorkList.value[t].finishpercent = 0
|
classWorkList.value[t].finishpercent = 0
|
||||||
|
classWorkList.value[t].teacherCorrectionProgress = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 以下四个参数,都要计算
|
// 以下四个参数,都要计算
|
||||||
|
@ -379,6 +388,7 @@ const getStudentClassWorkDataPolling = () => {
|
||||||
getStudentVisible()
|
getStudentVisible()
|
||||||
// 在轮询
|
// 在轮询
|
||||||
pollingST.value = setInterval(() => {
|
pollingST.value = setInterval(() => {
|
||||||
|
console.log('轮询查询学生作业进度')
|
||||||
getStudentVisible()
|
getStudentVisible()
|
||||||
}, 1000 * 10)
|
}, 1000 * 10)
|
||||||
}
|
}
|
||||||
|
@ -422,8 +432,8 @@ const getStudentVisible = async () => {
|
||||||
edituserid: userStore.userId, // 老师的id
|
edituserid: userStore.userId, // 老师的id
|
||||||
edustage: userStore.edustage,// 学段
|
edustage: userStore.edustage,// 学段
|
||||||
edusubject: userStore.edusubject,//学科
|
edusubject: userStore.edusubject,//学科
|
||||||
// deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
// deaddate: tabActive.value === '待批改'? getTomorrow() : EndDate.value,// 待批改:明天,已批改:选择的日期
|
||||||
deaddate: EndDate.value,// 进行中:明天,已结束:选择的日期
|
deaddate: EndDate.value,// 待批改:明天,已批改:选择的日期
|
||||||
status: '1', // 作业状态:1-已发布
|
status: '1', // 作业状态:1-已发布
|
||||||
// orderby: 'concat(deaddate,uniquekey) DESC',
|
// orderby: 'concat(deaddate,uniquekey) DESC',
|
||||||
orderby: 'deaddate DESC',
|
orderby: 'deaddate DESC',
|
||||||
|
@ -432,15 +442,15 @@ const getStudentVisible = async () => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
||||||
* 1、进行中、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
* 1、待批改、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
||||||
* 2、已结束、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
* 2、已批改、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
||||||
*/
|
*/
|
||||||
let list = [];
|
let list = [];
|
||||||
if(tabActive.value === '进行中'){
|
if(tabActive.value === '待批改'){
|
||||||
// 进行中 当前日期时间 小于 截止 日期时间
|
// 待批改 当前日期时间 小于 截止 日期时间
|
||||||
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); // 待批改
|
||||||
}else{
|
}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
|
const curWorkList = list
|
||||||
|
@ -471,6 +481,15 @@ const getStudentVisible = async () => {
|
||||||
}
|
}
|
||||||
// 更新批阅数
|
// 更新批阅数
|
||||||
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
||||||
|
|
||||||
|
// 计算-已完成批阅数 : 已批阅数
|
||||||
|
// teacherCorrectionProgress 老师已批阅进度条:
|
||||||
|
// workdataresultcount 完成人数
|
||||||
|
// teacherrationgcount 已批阅人数
|
||||||
|
// 已批阅百分比: (已批阅数) / 人数 * 100
|
||||||
|
classWorkList.value[t].teacherCorrectionProgress = parseInt(
|
||||||
|
((curWork.teacherrationgcount) / curWork.workdataresultcount) * 100
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
// 学生未完成,但是老师批改了?
|
// 学生未完成,但是老师批改了?
|
||||||
if(curWork && curWork.workdataresultcount == 0){
|
if(curWork && curWork.workdataresultcount == 0){
|
||||||
|
@ -478,6 +497,7 @@ const getStudentVisible = async () => {
|
||||||
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
||||||
}
|
}
|
||||||
classWorkList.value[t].finishpercent = 0
|
classWorkList.value[t].finishpercent = 0
|
||||||
|
classWorkList.value[t].teacherCorrectionProgress = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,18 @@
|
||||||
| 截止时间:{{ item.deaddate }} | {{ tabactive }}
|
| 截止时间:{{ item.deaddate }} | {{ tabactive }}
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
<span v-if="item.workdataresultcount!=0" style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultcount }}</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>
|
<span v-if="item.workdataresultcount==0">{{ item.workdataresultcount }}</span>
|
||||||
|
@ -22,23 +33,11 @@
|
||||||
<span>已交</span>
|
<span>已交</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="class-reserv-item-tool">
|
<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 style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount?item.workdatacount - item.teacherrationgcount:item.workdatacount }}</span>
|
||||||
<span>待批阅</span>
|
<span>待批阅</span>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="class-reserv-item-tool">
|
<div class="class-reserv-item-tool">
|
||||||
<span>
|
<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 style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
||||||
</span>
|
</span>
|
||||||
<span>平均用时</span>
|
<span>平均用时</span>
|
||||||
|
@ -97,6 +96,10 @@ const props = defineProps({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.class-reserv-item-progress {
|
||||||
|
width: 200px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
.class-reserv-item-tool {
|
.class-reserv-item-tool {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -677,9 +677,7 @@ const handleClassOverviewOpen = (type) =>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const allTeacherRating = allTopic.reduce((acc, cur) => {
|
const allTeacherRating = allTopic.reduce((acc, cur) => acc + cur.teacherRating, 0)
|
||||||
return acc + cur.teacherRating;
|
|
||||||
},0)
|
|
||||||
|
|
||||||
rightAnswer > 0?item.scoingRate = (score/allTeacherRating * 100).toFixed(0):item.scoingRate = ''
|
rightAnswer > 0?item.scoingRate = (score/allTeacherRating * 100).toFixed(0):item.scoingRate = ''
|
||||||
item.getScore = score
|
item.getScore = score
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="class-name flex">
|
<div class="class-name flex">
|
||||||
<span class="name">{{ item.uniquekey }}</span>
|
<span class="name">{{ item.uniquekey }}</span>
|
||||||
<el-tag class="tag" round :type="tagType(item.deaddate)" effect="dark" size="small">{{
|
<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>
|
<el-tag :type="item.workclass" size="large">{{ item.worktype }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div class="class-time">{{ item.classcaption }} | 截止时间:{{ item.deaddate }} </div>
|
<div class="class-time">{{ item.classcaption }} | 截止时间:{{ item.deaddate }} </div>
|
||||||
|
@ -52,9 +52,9 @@ const getHomework = async () => {
|
||||||
const { edustage, edusubject } = user
|
const { edustage, edusubject } = user
|
||||||
try {
|
try {
|
||||||
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), status: '1', orderby: 'deaddate DESC', pageSize: 500 })
|
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 && 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) => {
|
homeworkList.value.forEach((item) => {
|
||||||
// 处理任务类型的UI
|
// 处理任务类型的UI
|
||||||
if (item.worktype == '学习目标定位') {
|
if (item.worktype == '学习目标定位') {
|
||||||
|
|
|
@ -43,6 +43,15 @@ export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) => {
|
||||||
|
|
||||||
let classWorkList = []
|
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 由于 后面截止时间加了 时分,特加判断
|
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
||||||
* 1、进行中、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
* 1、待批改、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
||||||
* 2、已结束、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
* 2、已批改、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let list = response.rows
|
let list = response.rows
|
||||||
|
|
Loading…
Reference in New Issue