-- fix 课程公开报名

This commit is contained in:
yuping
2023-01-17 04:32:33 +08:00
parent 56e935dfce
commit b4458895ee
6 changed files with 56 additions and 95 deletions

View File

@@ -34,25 +34,9 @@
<div style="margin-left: 8px">{{ data.planDto?.address }}</div>
</div>
</div>
<div v-if="projectStatus && projectEndTime">
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" style="display: flex">
<botton class="btn" style="margin-right: 20px" :style="{
background: isAllowSign? data.signFlag ? '#999' : 'rgb(57, 146, 249)':'#999',
}" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton v-if="data.planDto?.evalFlag !== 0" :style="{
background: `${new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`,
}" class="btn" @click="toSurvery">{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
<div v-else>
<div >
<div style="display: flex">
<botton class="btn" style="margin-right: 20px" :style="{
background: isAllowSign? data.signFlag ? '#999' : 'rgb(57, 146, 249)':'#999',
}" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }}
@@ -99,50 +83,39 @@
<FileTypeImg :v-model="el.name? el.name : el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.'))" :style="{width: '22px',height: '26px',marginLeft: '10px',}"></FileTypeImg>
<div style="margin-left: 20px">{{ el.name? el.name : el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.')) }}</div>
</div>
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
<div>
<div v-if="new Date(data.planDto.beginTime).getTime() > new Date().getTime()" class="download">
<img style="width: 16px; height: 15px" src="../../assets/image/download.png" />
<div style="margin-left: 5px;color:#999;" @click="downloads(el)">
下载
</div>
</div>
<div v-else class="download">
<img style="width: 16px; height: 15px" src="../../assets/image/download.png" />
<div style="margin-left: 5px" @click="download(el.name? el.response.data : el)">
下载
</div>
</div>
<!-- <div v-else class="download">-->
<!-- <img style="width: 16px; height: 15px" src="../../assets/image/download.png" />-->
<!-- <div style="margin-left: 5px" @click="download(el.name? el.response.data : el)">-->
<!-- 下载-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程作业" name="second">
<div class="work" v-if="data.workDto">
<div>
<div class="question">{{ data.workDto?.workName }}</div>
<div style="margin-top: 16px; display: flex">
<div class="tag1" v-if="data.workDto?.workFlag">必修</div>
<div class="tag3" style="margin-left: 11px">作业</div>
</div>
</div>
<div
v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()"
:style="{ background: new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : '' }"
class="submit" @click="toWork">
交作业
</div>
<div
v-else-if="projectStatus == undefined && projectEndTime==undefined"
:style="{ background: new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : '' }"
class="submit" @click="toWork">
交作业
</div>
<div>
<div class="question">{{ data.workDto?.workName }}</div>
<div style="margin-top: 16px; display: flex">
<div class="tag1" v-if="data.workDto?.workFlag">必修</div>
<div class="tag3" style="margin-left: 11px">作业</div>
</div>
</div>
<div
:style="{ background: new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : '' }"
class="submit" @click="toWork">
交作业
</div>
</div>
<div v-else
style=" font-size: 14px; font-weight: 400; line-height: 24px; cursor: pointer;margin-left: 40px;margin-top: 20px; ">
<div v-else style=" font-size: 14px; font-weight: 400; line-height: 24px; cursor: pointer;margin-left: 40px;margin-top: 20px; ">
此课程无作业
</div>
</el-tab-pane>
@@ -160,9 +133,7 @@
<div class="tag3" style="margin-left: 11px">考试</div>
</div>
</div>
<div
v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()"
:style="{ background: new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : '' }"
class="submit" @click="toExamItem(data.examinationDto)">
去考试
@@ -218,12 +189,10 @@ const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId, projectStatus, projectEndTime },
query: { courseId, type, id: taskId },
} = useRoute();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data);
console.log("项目状态字段传递", projectStatus, projectEndTime);
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId,usePermission:true });
const teacherInfo = useUserInfo(
computed(() => data.value?.planDto?.teacherId)
);
@@ -249,7 +218,7 @@ function formateArr(strs) {
try{
newArr = JSON.parse(strs)
} catch {
newArr = strs.split(',')
newArr = strs?.split(',')
}
console.log('112233', newArr)
return newArr
@@ -330,11 +299,7 @@ const signClick = () => {
data.value.signFlag = 1;
ElMessage.warning("签到成功");
if (taskId) {
request(TASK_OFFCOURSE_SIGN, { courseId: courseId, taskId, type });
} else {
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
}
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
};
function toSurvery() {
@@ -379,7 +344,7 @@ function toWork() {
query: {
courseId: data.value.workDto.workId,
id: taskId,
infoId: data.value.offcourseDto.offcourseId,
infoId: data.value.planDto.offcoursePlanId,
chapterOrStageId: 0,
type,
pName: "面授课",