feat:增加项目任务入口时间和状态判断

This commit is contained in:
wuyx
2022-12-22 11:01:41 +08:00
parent 83c348a25f
commit 64790f3c05

View File

@@ -19,10 +19,7 @@
<img src="../../assets/image/pathdetails/circle.png" /> <img src="../../assets/image/pathdetails/circle.png" />
<div class="titleRT">进行中</div> <div class="titleRT">进行中</div>
</div> </div>
<div <div class="titleR" :style="{ display: i.status === 2 ? 'flex' : 'none' }">
class="titleR"
:style="{ display: i.status === 2 ? 'flex' : 'none' }"
>
<img src="../../assets/image/pathdetails/circle2.png" /> <img src="../../assets/image/pathdetails/circle2.png" />
<div class="titleRT" style="color: rgba(102, 102, 102, 1)"> <div class="titleRT" style="color: rgba(102, 102, 102, 1)">
未开始 未开始
@@ -30,14 +27,9 @@
</div> </div>
</div> </div>
<div v-if="i.stageId == '0' && i.taskProcessList.length == 0"></div> <div v-if="i.stageId == '0' && i.taskProcessList.length == 0"></div>
<div <div v-else class="course" v-for="(value, index) in i.taskProcessList.filter(
v-else
class="course"
v-for="(value, index) in i.taskProcessList.filter(
(e) => !whiteTypes(e.type) (e) => !whiteTypes(e.type)
)" )" :key="index">
:key="index"
>
<div style="width: 70%"> <div style="width: 70%">
<div class="coursename">{{ value.name }}</div> <div class="coursename">{{ value.name }}</div>
<div class="coursetag"> <div class="coursetag">
@@ -56,18 +48,11 @@
<!-- {{ item.name }}--> <!-- {{ item.name }}-->
<!-- </div>--> <!-- </div>-->
</div> </div>
<div <div v-if="value.type == 1" class="progressBox">
class="progressBox"
:style="{ display: value.status === 1 ? 'block' : 'none' }"
>
<div>当前进度</div> <div>当前进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress <el-progress :percentage="value.currentRatio" :show-text="false" :stroke-width="8" :color="
:percentage="value.currentRatio"
:show-text="false"
:stroke-width="8"
:color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -76,11 +61,9 @@
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt(value.currentRatio / 20)] }[parseInt(value.currentRatio / 20)]
" " />
/>
</div> </div>
<div <div style="font-size: 14px;font-weight: 500;color: #277aff;margin-left: 10px;color:#677d86;">
style="font-size: 14px;font-weight: 500;color: #277aff;margin-left: 10px;color:#677d86;">
{{ value.currentRatio }}% {{ value.currentRatio }}%
</div> </div>
</div> </div>
@@ -154,18 +137,12 @@
<div class="detailRB"> <div class="detailRB">
<div class="info"> <div class="info">
<div class="title"> <div class="title">
<img <img style="width: 21px; height: 20px" src="../../assets/image/pathdetails/info.png" />
style="width: 21px; height: 20px"
src="../../assets/image/pathdetails/info.png"
/>
<div class="text" style="margin-left: 7px">个人信息</div> <div class="text" style="margin-left: 7px">个人信息</div>
<div class="box"></div> <div class="box"></div>
</div> </div>
<!-- todo #路径详情 个人信息缺少img和介绍--> <!-- todo #路径详情 个人信息缺少img和介绍-->
<div <div class="teacheritem" :style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }">
class="teacheritem"
:style="{ 'border-bottom': '1px solid rgba(56, 125, 247, 0.2)' }"
>
<img class="peopleimg" :src="`/upload${userInfo.avatar}`" /> <img class="peopleimg" :src="`/upload${userInfo.avatar}`" />
<div style="margin-left: 17px"> <div style="margin-left: 17px">
<div class="teacherName"> <div class="teacherName">
@@ -182,10 +159,7 @@
</div> </div>
<div class="info" style="padding-top: 20px"> <div class="info" style="padding-top: 20px">
<div class="title"> <div class="title">
<img <img style="width: 18px; height: 17px" src="../../assets/image/pathdetails/study.png" />
style="width: 18px; height: 17px"
src="../../assets/image/pathdetails/study.png"
/>
<div class="text" style="margin-left: 9px">学习进度</div> <div class="text" style="margin-left: 9px">学习进度</div>
<div class="box"></div> <div class="box"></div>
</div> </div>
@@ -199,10 +173,7 @@
<div>总进度</div> <div>总进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress <el-progress :percentage="parseInt(data.totalProgress * 100)" :show-text="false" :stroke-width="8"
:percentage="parseInt(data.totalProgress * 100)"
:show-text="false"
:stroke-width="8"
:color=" :color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
@@ -212,11 +183,9 @@
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.totalProgress * 100) / 20)] }[parseInt((data.totalProgress * 100) / 20)]
" " />
/>
</div> </div>
<div <div style="font-size: 14px; font-weight: 500; margin-left: 10px;color:#677d86;">
style="font-size: 14px; font-weight: 500; margin-left: 10px;color:#677d86;">
{{ parseInt(data.totalProgress * 100) }}% {{ parseInt(data.totalProgress * 100) }}%
</div> </div>
</div> </div>
@@ -227,11 +196,8 @@
<div>必修进度</div> <div>必修进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress <el-progress :percentage="parseInt(data.compulsoryProgress * 100)" :show-text="false"
:percentage="parseInt(data.compulsoryProgress * 100)" :stroke-width="8" :color="
:show-text="false"
:stroke-width="8"
:color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -240,11 +206,9 @@
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.compulsoryProgress * 100) / 20)] }[parseInt((data.compulsoryProgress * 100) / 20)]
" " />
/>
</div> </div>
<div <div style="
style="
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #277aff; color: #277aff;
@@ -357,6 +321,62 @@ const types = ref({
}); });
function toFinish(d, sName, chapterId) { function toFinish(d, sName, chapterId) {
console.log("dddddd", d); console.log("dddddd", d);
// 作业过期判断
if (d.type == 4) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
ElMessage.error("当前作业已结束")
return
}
}
// 直播结束时间
if (d.type == 6) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
ElMessage.error("当前直播已结束")
return
}
}
// 考试 停用
if (d.type == 5) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
ElMessage.error("该任务无法学习,请联系管理员进行替换。")
return
}
}
// 评估 停用
if (d.type == 11) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
ElMessage.error("该任务无法学习,请联系管理员进行替换。")
return
}
}
// 其他活动 结束时间
if (d.type == 9) {
let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime();
if (date1 < date2) {
ElMessage.error("当前活动已结束")
return
}
}
// 在线课 停用 -- 暂时没有在线课停用标记
if (d.type == 1) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
ElMessage.error("该任务无法学习,请联系管理员进行替换。")
return
}
}
// 面授课 停用
if (d.type == 2) {
if (d.taskStatus == 1 || d.taskStatus == 2) {
ElMessage.error("该任务无法学习,请联系管理员进行替换。")
return
}
}
if (!types.value.path[d.type]) { if (!types.value.path[d.type]) {
ElMessage.error("暂时未开放"); ElMessage.error("暂时未开放");
return; return;
@@ -403,16 +423,19 @@ function whiteTypes(type) {
font-size: 14px; font-size: 14px;
line-height: 24px; line-height: 24px;
} }
.pdname { .pdname {
font-size: 20px; font-size: 20px;
font-weight: 800; font-weight: 800;
color: #ffffff; color: #ffffff;
margin-top: 17px; margin-top: 17px;
} }
.detailinfo { .detailinfo {
width: 100%; width: 100%;
margin-top: 24px; margin-top: 24px;
display: flex; display: flex;
.detailL { .detailL {
flex: 1; flex: 1;
margin-right: 20px; margin-right: 20px;
@@ -421,6 +444,7 @@ function whiteTypes(type) {
padding-left: 45px; padding-left: 45px;
padding-right: 45px; padding-right: 45px;
padding-top: 23px; padding-top: 23px;
.title { .title {
height: 50px; height: 50px;
display: flex; display: flex;
@@ -429,16 +453,19 @@ function whiteTypes(type) {
background-color: rgba(249, 249, 249, 1); background-color: rgba(249, 249, 249, 1);
margin-top: 27px; margin-top: 27px;
margin-bottom: 19px; margin-bottom: 19px;
.titleL { .titleL {
font-size: 16px; font-size: 16px;
font-weight: 800; font-weight: 800;
color: #333333; color: #333333;
margin-left: 27px; margin-left: 27px;
} }
.titleR { .titleR {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.titleR .titleRT { .titleR .titleRT {
font-size: 16px; font-size: 16px;
font-weight: 800; font-weight: 800;
@@ -447,6 +474,7 @@ function whiteTypes(type) {
margin-left: 2px; margin-left: 2px;
} }
} }
.course { .course {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -454,6 +482,7 @@ function whiteTypes(type) {
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 32px; margin-bottom: 32px;
margin-left: 26px; margin-left: 26px;
.coursename { .coursename {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
@@ -463,23 +492,28 @@ function whiteTypes(type) {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.coursetag { .coursetag {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.progressBox { .progressBox {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #677d86; color: #677d86;
margin-top: 24px; margin-top: 24px;
.progress { .progress {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.progress .el-progress-bar__outer { .progress .el-progress-bar__outer {
background-color: rgba(232, 241, 254, 1); background-color: rgba(232, 241, 254, 1);
} }
} }
.goclass { .goclass {
width: 126px; width: 126px;
height: 46px; height: 46px;
@@ -497,21 +531,26 @@ function whiteTypes(type) {
} }
} }
} }
.detailR { .detailR {
width: 434px; width: 434px;
.detailRT { .detailRT {
min-height: 298px; min-height: 298px;
background: #ffffff; background: #ffffff;
border-radius: 8px; border-radius: 8px;
.el-tabs__item { .el-tabs__item {
height: 56px; height: 56px;
padding: 10px 33px 0px 27px; padding: 10px 33px 0px 27px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
background-color: rgba(56, 125, 247, 0.2); background-color: rgba(56, 125, 247, 0.2);
} }
.notice { .notice {
padding: 15px 43px 30px 47px; padding: 15px 43px 30px 47px;
font-size: 14px; font-size: 14px;
@@ -519,6 +558,7 @@ function whiteTypes(type) {
color: #333330; color: #333330;
line-height: 24px; line-height: 24px;
} }
.sharedocname { .sharedocname {
width: 259px; width: 259px;
font-size: 14px; font-size: 14px;
@@ -527,6 +567,7 @@ function whiteTypes(type) {
margin-left: 20px; margin-left: 20px;
line-height: 24px; line-height: 24px;
} }
.download { .download {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -537,11 +578,13 @@ function whiteTypes(type) {
color: #2478ff; color: #2478ff;
} }
} }
.detailRB { .detailRB {
min-height: 459px; min-height: 459px;
background: #ffffff; background: #ffffff;
border-radius: 8px; border-radius: 8px;
margin-top: 17px; margin-top: 17px;
.info .title { .info .title {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -549,12 +592,14 @@ function whiteTypes(type) {
position: relative; position: relative;
margin-left: 48px; margin-left: 48px;
} }
.info .title .text { .info .title .text {
margin-left: 8px; margin-left: 8px;
font-size: 16px; font-size: 16px;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
font-weight: 800; font-weight: 800;
} }
.info .title .box { .info .title .box {
width: 75px; width: 75px;
height: 10px; height: 10px;
@@ -563,6 +608,7 @@ function whiteTypes(type) {
left: 23px; left: 23px;
top: 53px; top: 53px;
} }
.info .teacheritem { .info .teacheritem {
margin-left: 48px; margin-left: 48px;
margin-right: 48px; margin-right: 48px;
@@ -570,11 +616,13 @@ function whiteTypes(type) {
display: flex; display: flex;
// align-items: center; // align-items: center;
} }
.info .teacheritem .peopleimg { .info .teacheritem .peopleimg {
width: 60px; width: 60px;
height: 60px; height: 60px;
border-radius: 30px; border-radius: 30px;
} }
.info .teacheritem .teacherName { .info .teacheritem .teacherName {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
@@ -583,6 +631,7 @@ function whiteTypes(type) {
align-items: center; align-items: center;
width: 260px; width: 260px;
} }
.info .teacheritem .teacherName .teacherMedal { .info .teacheritem .teacherName .teacherMedal {
width: 17px; width: 17px;
height: 19px; height: 19px;
@@ -590,6 +639,7 @@ function whiteTypes(type) {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.info .teacheritem .introduce { .info .teacheritem .introduce {
width: 260px; width: 260px;
font-size: 14px; font-size: 14px;
@@ -598,6 +648,7 @@ function whiteTypes(type) {
margin-top: 14px; margin-top: 14px;
line-height: 24px; line-height: 24px;
} }
.info .rate { .info .rate {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -606,6 +657,7 @@ function whiteTypes(type) {
margin-left: 48px; margin-left: 48px;
margin-right: 26px; margin-right: 26px;
} }
.info .rate .ratetext { .info .rate .ratetext {
width: 259px; width: 259px;
font-size: 14px; font-size: 14px;
@@ -613,6 +665,7 @@ function whiteTypes(type) {
color: #677d86; color: #677d86;
line-height: 24px; line-height: 24px;
} }
.info .rate .ratebtn { .info .rate .ratebtn {
width: 86px; width: 86px;
height: 36px; height: 36px;
@@ -627,16 +680,19 @@ function whiteTypes(type) {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.info .progressBox { .info .progressBox {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #677d86; color: #677d86;
margin-top: 16px; margin-top: 16px;
margin-left: 44px; margin-left: 44px;
.progress { .progress {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.progress .el-progress-bar__outer { .progress .el-progress-bar__outer {
background-color: rgba(232, 241, 254, 1); background-color: rgba(232, 241, 254, 1);
} }