baigl #393
|
@ -168,7 +168,6 @@ const getClassWorkList = async () => {
|
|||
for (var i = 0; i < list.length; i++) {
|
||||
// 初始化部分新增字段值
|
||||
list[i].workdatalist = []
|
||||
list[i].workdatacount = 0 // 人数
|
||||
list[i].workdatalistVisible = false
|
||||
list[i].workdatafeedbackcount = 0 // 已交人数
|
||||
list[i].feedtimelength = 0
|
||||
|
@ -200,19 +199,10 @@ const getClassWorkList = async () => {
|
|||
} else {
|
||||
list[i].entpcourseworklistarray = []
|
||||
}
|
||||
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||
if (
|
||||
list[i].classworkdatastudentids != '' &&
|
||||
list[i].classworkdatastudentids != null &&
|
||||
list[i].classworkdatastudentids != 'null'
|
||||
) {
|
||||
const stuList = JSON.parse('[' + list[i].classworkdatastudentids + ']')
|
||||
list[i].workdatacount = stuList.length
|
||||
}
|
||||
}
|
||||
// 显示分配人数(workdatacount)>0 的
|
||||
// 显示分配人数(workdataresultsum)>0 的
|
||||
if (list && list.length > 0) {
|
||||
classWorkList.value = list && list.filter((item) => item.workdatacount > 0)
|
||||
classWorkList.value = list && list.filter((item) => item.workdataresultsum > 0)
|
||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||
total.value = 0
|
||||
}else{
|
||||
|
@ -305,29 +295,32 @@ const getStudentClassWorkData = async() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 当前这个学习任务,共推送给了几个学生,workdatacount
|
||||
// 当前这个学习任务,共推送给了几个学生,workdataresultsum
|
||||
if (res.rows[i].classworkid == classWorkList.value[t].id) {
|
||||
classWorkList.value[t].workdatalist.push(res.rows[i])
|
||||
}
|
||||
}
|
||||
// 计算完成进度 workdatacount人数要大于0
|
||||
// 计算完成进度 workdataresultsum人数要大于0
|
||||
if (
|
||||
classWorkList.value[t].workdataresultcount > 0 &&
|
||||
classWorkList.value[t].workdatacount > 0
|
||||
classWorkList.value[t].workdataresultsum > 0
|
||||
) {
|
||||
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
|
||||
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdataresultsum) * 100
|
||||
)
|
||||
} else {
|
||||
classWorkList.value[t].finishpercent = 0
|
||||
}
|
||||
|
||||
/** 计算 已批阅进度 */
|
||||
// workdataresultsum 人数 teacherrationgcount 已批阅人数
|
||||
// 已批阅百分比: (人数-已批阅数) / 人数 * 100
|
||||
if (classWorkList.value[t].workdataresultsum > 0) {
|
||||
// teacherCorrectionProgress 老师已批阅进度条:
|
||||
classWorkList.value[t].teacherCorrectionProgress = parseInt(
|
||||
((classWorkList.value[t].teacherrationgcount) / classWorkList.value[t].workdataresultsum) * 100
|
||||
)
|
||||
} else {
|
||||
classWorkList.value[t].teacherCorrectionProgress = 0
|
||||
}
|
||||
|
||||
|
@ -352,7 +345,7 @@ const getStudentClassWorkData = async() => {
|
|||
var dd =
|
||||
(classWorkList.value[t].rightAnswerCount /
|
||||
(classWorkList.value[t].entpcourseworklistarray.length *
|
||||
classWorkList.value[t].workdatacount)) *
|
||||
classWorkList.value[t].workdataresultsum)) *
|
||||
100
|
||||
classWorkList.value[t].scoingRate = dd.toFixed(0) + '%'
|
||||
} else {
|
||||
|
@ -466,12 +459,12 @@ const getStudentVisible = async () => {
|
|||
// }
|
||||
// 确保当前拿到的任务与页面中存在的任务能一对一(避免因删除其他操作而删除作业任务导致两个数组的index不统一而越界)
|
||||
let curWork = curWorkList.find((work) => work.id === classWorkList.value[t].id)
|
||||
// workdataresultcount 完成人数 workdatacount人数要大于0
|
||||
if (curWork && curWork.workdataresultcount > 0 && classWorkList.value[t].workdatacount > 0) {
|
||||
// workdataresultcount 完成人数 workdataresultsum人数要大于0
|
||||
if (curWork && curWork.workdataresultcount > 0 && classWorkList.value[t].workdataresultsum > 0) {
|
||||
classWorkList.value[t].workdataresultcount = curWork.workdataresultcount
|
||||
// 桌面端貌似不需要进度条了?
|
||||
classWorkList.value[t].finishpercent = parseInt(
|
||||
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdatacount) * 100
|
||||
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdataresultsum) * 100
|
||||
)
|
||||
// 计算参与学习任务的平均用时
|
||||
if (classWorkList.value[t].workdatafeedbackcount > 0) {
|
||||
|
@ -479,17 +472,7 @@ const getStudentVisible = async () => {
|
|||
} else {
|
||||
classWorkList.value[t].averagetime = 0
|
||||
}
|
||||
// 更新批阅数
|
||||
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){
|
||||
|
@ -497,6 +480,20 @@ const getStudentVisible = async () => {
|
|||
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
||||
}
|
||||
classWorkList.value[t].finishpercent = 0
|
||||
}
|
||||
|
||||
/** 计算 已批阅进度 */
|
||||
// workdataresultsum 人数 teacherrationgcount 已批阅人数
|
||||
// 已批阅百分比: (人数-已批阅数) / 人数 * 100
|
||||
if (curWork && curWork.workdataresultsum > 0) {
|
||||
// 更新批阅数
|
||||
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
||||
|
||||
// teacherCorrectionProgress 老师已批阅进度条:
|
||||
classWorkList.value[t].teacherCorrectionProgress = parseInt(
|
||||
((curWork.teacherrationgcount) / curWork.workdataresultsum) * 100
|
||||
)
|
||||
} else {
|
||||
classWorkList.value[t].teacherCorrectionProgress = 0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,27 +15,37 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<div v-if=" tabactive == '待批改' " class="class-reserv-item-progress">
|
||||
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.finishpercent" :color="'#000fff'" style="cursor: pointer"></el-progress>
|
||||
<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>
|
||||
/{{ item.workdatacount }}</span>
|
||||
<span>已交</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">{{ item.workdataresultcount }}</span>
|
||||
/{{ item.workdataresultsum }}
|
||||
</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 v-if=" tabactive == '待批改' " class="class-reserv-item-progress">
|
||||
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.teacherCorrectionProgress" :color="'#ff7f00'" style="cursor: pointer"></el-progress>
|
||||
<span>
|
||||
已批阅(<span style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount}}</span>)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- TODO 练习次数\引用次数 这里随便的假数据-->
|
||||
<div v-if=" tabactive == '已批改' " class="class-reserv-item-tool">
|
||||
<span style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultsum }}</span>
|
||||
<span>练习次数</span>
|
||||
</div>
|
||||
|
||||
<div v-if=" tabactive == '已批改' " class="class-reserv-item-tool">
|
||||
<span style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount?item.workdataresultsum - item.teacherrationgcount:item.workdataresultsum }}</span>
|
||||
<span>引用次数</span>
|
||||
</div>
|
||||
|
||||
<div class="class-reserv-item-tool">
|
||||
<span>
|
||||
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
|
||||
|
@ -98,6 +108,7 @@ const props = defineProps({
|
|||
}
|
||||
.class-reserv-item-progress {
|
||||
width: 200px;
|
||||
padding: 0 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.class-reserv-item-tool {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<div class="class-time">{{ item.classcaption }} | 截止时间:{{ item.deaddate }} </div>
|
||||
</div>
|
||||
<div class="class-right">
|
||||
<div><span class="num">{{ item.workdataresultcount }}</span> / {{ item.workdatacount }}</div>
|
||||
<div><span class="num">{{ item.workdataresultcount }}</span> / {{ item.workdataresultsum }}</div>
|
||||
<div>已交</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -72,7 +72,6 @@ const getHomework = async () => {
|
|||
item.workclass = ''
|
||||
}
|
||||
|
||||
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (item.entpcourseworklist != '') {
|
||||
item.entpcourseworklistarray = JSON.parse(
|
||||
|
|
|
@ -70,7 +70,6 @@ export const getClassWorkList = async (id) => {
|
|||
for (var i = 0; i < list.length; i++) {
|
||||
// 初始化部分新增字段值
|
||||
list[i].workdatalist = []
|
||||
list[i].workdatacount = 0 // 人数
|
||||
list[i].workdatalistVisible = false
|
||||
list[i].workdatafeedbackcount = 0 // 已交人数
|
||||
list[i].feedtimelength = 0
|
||||
|
@ -100,19 +99,10 @@ export const getClassWorkList = async (id) => {
|
|||
} else {
|
||||
list[i].entpcourseworklistarray = []
|
||||
}
|
||||
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||
if (
|
||||
list[i].classworkdatastudentids != '' &&
|
||||
list[i].classworkdatastudentids != null &&
|
||||
list[i].classworkdatastudentids != 'null'
|
||||
) {
|
||||
const stuList = JSON.parse('[' + list[i].classworkdatastudentids + ']')
|
||||
list[i].workdatacount = stuList.length
|
||||
}
|
||||
}
|
||||
// 显示分配人数(workdatacount)>0 的
|
||||
// 显示分配人数(workdataresultsum)>0 的
|
||||
if (list && list.length > 0) {
|
||||
classWorkList = list && list.filter((item) => item.workdatacount > 0)
|
||||
classWorkList = list && list.filter((item) => item.workdataresultsum > 0)
|
||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||
} else {
|
||||
classWorkList = []
|
||||
|
@ -180,18 +170,18 @@ export const getStudentClassWorkData = async () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 当前这个学习任务,共推送给了几个学生,workdatacount
|
||||
// 当前这个学习任务,共推送给了几个学生,workdataresultsum
|
||||
if (res.rows[i].classworkid == classWorkList[t].id) {
|
||||
classWorkList[t].workdatalist.push(res.rows[i])
|
||||
}
|
||||
}
|
||||
// 计算完成进度 workdatacount人数要大于0
|
||||
// 计算完成进度 workdataresultsum 人数要大于0
|
||||
if (
|
||||
classWorkList[t].workdataresultcount > 0 &&
|
||||
classWorkList[t].workdatacount > 0
|
||||
classWorkList[t].workdataresultsum > 0
|
||||
) {
|
||||
classWorkList[t].finishpercent = parseInt(
|
||||
(classWorkList[t].workdataresultcount / classWorkList[t].workdatacount) * 100
|
||||
(classWorkList[t].workdataresultcount / classWorkList[t].workdataresultsum) * 100
|
||||
)
|
||||
} else {
|
||||
classWorkList[t].finishpercent = 0
|
||||
|
@ -220,7 +210,7 @@ export const getStudentClassWorkData = async () => {
|
|||
var dd =
|
||||
(classWorkList[t].rightAnswerCount /
|
||||
(classWorkList[t].entpcourseworklistarray.length *
|
||||
classWorkList[t].workdatacount)) *
|
||||
classWorkList[t].workdataresultsum)) *
|
||||
100
|
||||
classWorkList[t].scoingRate = dd.toFixed(0) + '%'
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue