This commit is contained in:
dongruihua
2022-12-30 17:48:19 +08:00
8 changed files with 259 additions and 107 deletions

View File

@@ -24,8 +24,8 @@
<div class="time" style="margin-top: 26px"> <div class="time" style="margin-top: 26px">
<img style="width: 15px; height: 17px" src="../../assets/image/time.png" /> <img style="width: 15px; height: 17px" src="../../assets/image/time.png" />
<div style="margin-left: 8px"> <div style="margin-left: 8px">
{{ dayjs(data.planDto?.beginTime).format('YYYY-MM-DD HH:MM') + " 至 " + {{ dayjs(data.planDto?.beginTime).format('YYYY-MM-DD HH:mm') + " 至 " +
dayjs(data.planDto?.endTime).format('YYYY-MM-DD HH:MM') dayjs(data.planDto?.endTime).format('YYYY-MM-DD HH:mm')
}} }}
</div> </div>
</div> </div>
@@ -34,19 +34,37 @@
<div style="margin-left: 8px">{{ data.planDto?.address }}</div> <div style="margin-left: 8px">{{ data.planDto?.address }}</div>
</div> </div>
</div> </div>
<div style="display: flex"> <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', <botton class="btn" style="margin-right: 20px" :style="{
}" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }} background: isAllowSign? data.signFlag ? '#999' : 'rgb(57, 146, 249)':'#999',
</botton> }" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }}
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0"> </botton>
评估 <!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
</botton> --> 评估
<botton v-if="data.planDto?.evalFlag !== 0" :style="{ </botton> -->
background: `${new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`, <botton v-if="data.planDto?.evalFlag !== 0" :style="{
}" class="btn" @click="toSurvery">{{ data.isSurvery ? "已评估" : "评估" }} background: `${new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`,
</botton> }" class="btn" @click="toSurvery">{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
<div v-else>
<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 ? "已签到" : "签到" }}
</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>
</div> </div>
<!-- 基本信息 --> <!-- 基本信息 -->
@@ -78,19 +96,21 @@
<div v-for="(el, index) in formateArr(data.planDto?.attach)" :key="index" class="enclosure" <div v-for="(el, index) in formateArr(data.planDto?.attach)" :key="index" class="enclosure"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"> :style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }">
<div class="enclosureL"> <div class="enclosureL">
<FileTypeImg :v-model="el.slice(el.indexOf('-') + 1)" :style="{width: '22px',height: '26px',marginLeft: '10px',}"></FileTypeImg> <FileTypeImg :v-model="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.slice(el.indexOf('-') + 1) }}</div> <div style="margin-left: 20px">{{ el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.')) }}</div>
</div> </div>
<div v-if="new Date(data.planDto.beginTime).getTime() > new Date().getTime()" class="download"> <div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
<img style="width: 16px; height: 15px" src="../../assets/image/download.png" /> <div v-if="new Date(data.planDto.beginTime).getTime() > new Date().getTime()" class="download">
<div style="margin-left: 5px;color:#999;" @click="downloads(el)"> <img style="width: 16px; height: 15px" src="../../assets/image/download.png" />
下载 <div style="margin-left: 5px;color:#999;" @click="downloads(el)">
下载
</div>
</div> </div>
</div> <div v-else class="download">
<div v-else class="download"> <img style="width: 16px; height: 15px" src="../../assets/image/download.png" />
<img style="width: 16px; height: 15px" src="../../assets/image/download.png" /> <div style="margin-left: 5px" @click="download(el)">
<div style="margin-left: 5px" @click="download(el)"> 下载
下载 </div>
</div> </div>
</div> </div>
</div> </div>
@@ -109,6 +129,7 @@
<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' : '' }" :style="{ background: new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : '' }"
class="submit" @click="toWork"> class="submit" @click="toWork">
交作业 交作业
@@ -135,6 +156,7 @@
</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' : '' }" :style="{ background: new Date(data.planDto?.beginTime).getTime() > new Date().getTime() ? '#999' : '' }"
class="submit" @click="toExamItem(data.examinationDto)"> class="submit" @click="toExamItem(data.examinationDto)">
去考试 去考试
@@ -190,11 +212,12 @@ const returnclick = () => {
router.back(); router.back();
}; };
const { const {
query: { courseId, type, id: taskId }, query: { courseId, type, id: taskId, projectStatus, projectEndTime },
} = useRoute(); } = useRoute();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }); const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data); console.log("datadatadatadatadatadatadata", data);
console.log("项目状态字段传递", projectStatus, projectEndTime);
const teacherInfo = useUserInfo( const teacherInfo = useUserInfo(
computed(() => data.value?.planDto?.teacherId) computed(() => data.value?.planDto?.teacherId)
); );

View File

@@ -39,7 +39,7 @@
<div style="margin-left: 8px">{{ data.planDto?.address }}</div> <div style="margin-left: 8px">{{ data.planDto?.address }}</div>
</div> </div>
<div class="time" style="margin-top: 37px"> <div class="time" style="margin-top: 37px">
<botton class="btn" style="margin-right: 20px;width: 160px;height: 46px;" @click="onLineSignUp" :style="{ background: data.isSignUp ? '#999' : 'rgb(57, 146, 249)'}">{{data.isSignUp?'已报名':'立即报名'}}</botton> <botton class="btn" style="margin-right: 20px;width: 160px;height: 46px;" v-if="data.planDto.applyFlag" @click="onLineSignUp" :style="{ background: data.isSignUp ? '#999' : 'rgb(57, 146, 249)'}">{{data.isSignUp?'已报名':'立即报名'}}</botton>
</div> </div>
</div> </div>
</div> </div>
@@ -75,12 +75,12 @@
<div v-for="(el, index) in formateArr(data.offcourseDto.attach)" :key="index" class="enclosure" <div v-for="(el, index) in formateArr(data.offcourseDto.attach)" :key="index" class="enclosure"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"> :style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }">
<div class="enclosureL"> <div class="enclosureL">
<FileTypeImg :v-model="el.slice(el.indexOf('-') + 1)" :style="{ <FileTypeImg :v-model="el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.'))" :style="{
width: '22px', width: '22px',
height: '26px', height: '26px',
marginLeft: '10px', marginLeft: '10px',
}"></FileTypeImg> }"></FileTypeImg>
<div style="margin-left: 20px">{{ el.slice(el.indexOf('-') + 1) }}</div> <div style="margin-left: 20px">{{ el.slice(el.lastIndexOf('/')+1,el.indexOf('-')) + el.slice(el.lastIndexOf('.')) }}</div>
</div> </div>
<div class="download"> <div class="download">
<img style="width: 16px; height: 15px" src="../../assets/image/download.png"/> <img style="width: 16px; height: 15px" src="../../assets/image/download.png"/>

View File

@@ -48,12 +48,27 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="dayjs().isBefore(dayjs(data?.submitEndTime)) && dayjs(data?.submitStartTime).isBefore(dayjs())"> <div v-if="projectStatus && projectEndTime">
<UploadImg v-model:value="fileList" ref="uploadRef"> <div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
<button class="shangchuan" style="cursor: pointer"> <div v-if="dayjs().isBefore(dayjs(data?.submitEndTime)) && dayjs(data?.submitStartTime).isBefore(dayjs())">
上传 <UploadImg v-model:value="fileList" ref="uploadRef">
</button> <button class="shangchuan" style="cursor: pointer">
</UploadImg> 上传
</button>
</UploadImg>
</div>
</div>
</div>
<div v-else>
<div>
<div v-if="dayjs().isBefore(dayjs(data?.submitEndTime)) && dayjs(data?.submitStartTime).isBefore(dayjs())">
<UploadImg v-model:value="fileList" ref="uploadRef">
<button class="shangchuan" style="cursor: pointer">
上传
</button>
</UploadImg>
</div>
</div>
</div> </div>
<div class="uploadDetail" <div class="uploadDetail"
:style="{ display: showFileList && fileList && fileList.length > 0 ? 'block' : 'none' }" :style="{ display: showFileList && fileList && fileList.length > 0 ? 'block' : 'none' }"
@@ -118,24 +133,41 @@
<el-input disabled v-model="sbValue.content" :autosize="{ minRows: 12.5, maxRows: 12.5 }" resize="none" <el-input disabled v-model="sbValue.content" :autosize="{ minRows: 12.5, maxRows: 12.5 }" resize="none"
type="textarea" /> type="textarea" />
</div> </div>
<div v-if="projectStatus && projectEndTime">
<div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
<div v-if="dayjs().isBefore(dayjs(data?.submitEndTime)) && dayjs(data?.submitStartTime).isBefore(dayjs())"> <div v-if="dayjs().isBefore(dayjs(data?.submitEndTime)) && dayjs(data?.submitStartTime).isBefore(dayjs())">
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<button class="tijiao" @click="handleClick">{{ submitList && submitList.length > 0 ? "再次" : "" <button class="tijiao" @click="handleClick">{{ submitList && submitList.length > 0 ? "再次" : ""
}}提交</button> }}提交</button>
</div>
</div>
<div v-else>
<div style="display: flex; justify-content: center">
<button disabled class="tijiao"
style="background:#999;border-radius: 6px;cursor: not-allowed;">未到开始时间</button>
</div>
</div>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<div style="display: flex; justify-content: center"> <div>
<button disabled class="tijiao" <div v-if="dayjs().isBefore(dayjs(data?.submitEndTime)) && dayjs(data?.submitStartTime).isBefore(dayjs())">
style="background:#999;border-radius: 6px;cursor: not-allowed;">未到开始时间</button> <div style="display: flex; justify-content: center">
<button class="tijiao" @click="handleClick">{{ submitList && submitList.length > 0 ? "再次" : ""
}}提交</button>
</div>
</div>
<div v-else>
<div style="display: flex; justify-content: center">
<button disabled class="tijiao"
style="background:#999;border-radius: 6px;cursor: not-allowed;">未到开始时间</button>
</div>
</div>
</div> </div>
</div> </div>
<div class=""></div> <div class=""></div>
<div class="title" style="margin-top: 0px"> <div class="title" style="margin-top: 0px">
@@ -261,7 +293,7 @@ const returnclick = () => {
router.back(); router.back();
}; };
const { const {
query: { courseId: workId, type, id: taskId, pName, sName }, query: { courseId: workId, type, id: taskId, pName, sName, projectStatus, projectEndTime},
} = useRoute(); } = useRoute();
const { data } = taskId && taskId !== 'undefined' ? useRequest(TASK_WORK_DETAIL, { workId, taskId }) : useRequest(TASK_WORK_DETAIL, { workId }); const { data } = taskId && taskId !== 'undefined' ? useRequest(TASK_WORK_DETAIL, { workId, taskId }) : useRequest(TASK_WORK_DETAIL, { workId });

View File

@@ -45,26 +45,59 @@
<div style="margin-left: 8px">{{ data?.activityAddress }}</div> <div style="margin-left: 8px">{{ data?.activityAddress }}</div>
</div> --> </div> -->
</div> </div>
<div class="threeBtn"> <div v-if="projectStatus && projectEndTime">
<botton class="btn" :style="{ <div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" class="threeBtn">
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : 'rgb(59, 191, 252)'}`, <botton class="btn" :style="{
}" @click="showClick">观看 background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : 'rgb(59, 191, 252)'}`,
</botton> }" @click="showClick">观看
</botton>
<botton class="btn" :style="{ <botton class="btn" :style="{
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.signFlag ? '#999' : 'rgb(57, 146, 249)'}`, background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.signFlag ? '#999' : 'rgb(57, 146, 249)'}`,
}" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }} }" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }}
</botton> </botton>
<!-- <botton style="background: #999" class="btn" @click="commitClick" v-if="data.isEvaluate == 0"> <!-- <botton style="background: #999" class="btn" @click="commitClick" v-if="data.isEvaluate == 0">
评估 评估
</botton> --> </botton> -->
<botton :style="{ <botton :style="{
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`, background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`,
}" class="btn" @click="commitClick" v-if="data.isEvaluate && data.isEvaluate == 1">{{ data.isSurvery ? "已评估" : }" class="btn" @click="commitClick" v-if="data.isEvaluate && data.isEvaluate == 1">{{ data.isSurvery ? "已评估" :
"评估" "评估"
}} }}
</botton> </botton>
</div>
<div v-else class="threeBtn">
<botton :style="{
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`,
}" class="btn" @click="commitClick" v-if="data.isEvaluate && data.isEvaluate == 1&&data.isSurvery">{{ data.isSurvery ? "已评估" :
"评估"
}}
</botton>
</div>
</div>
<div v-else>
<div class="threeBtn">
<botton class="btn" :style="{
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : 'rgb(59, 191, 252)'}`,
}" @click="showClick">观看
</botton>
<botton class="btn" :style="{
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.signFlag ? '#999' : 'rgb(57, 146, 249)'}`,
}" @click="signClick">{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="commitClick" v-if="data.isEvaluate == 0">
评估
</botton> -->
<botton :style="{
background: `${new Date(data.liveStartTime).getTime() > new Date().getTime() ? '#999' : data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`,
}" class="btn" @click="commitClick" v-if="data.isEvaluate && data.isEvaluate == 1">{{ data.isSurvery ? "已评估" :
"评估"
}}
</botton>
</div>
</div> </div>
</div> </div>
<!-- 基本信息 --> <!-- 基本信息 -->
@@ -151,7 +184,7 @@ import { ElMessage } from "element-plus";
import dayjs from "dayjs"; import dayjs from "dayjs";
const { const {
query: { courseId: liveId, id: taskId, type, pName, sName }, query: { courseId: liveId, id: taskId, type, pName, sName, projectStatus, projectEndTime },
} = useRoute(); } = useRoute();
const router = useRouter(); const router = useRouter();
const returnclick = () => { const returnclick = () => {

View File

@@ -6,7 +6,7 @@
<div>{{ pName }}</div> <div>{{ pName }}</div>
<div style="margin-left: 6px; margin-right: 6px">/</div> <div style="margin-left: 6px; margin-right: 6px">/</div>
<div>{{ sName }}</div> <div>{{ sName }}</div>
<div style="margin-left: 6px; margin-right: 6px">/</div> <div v-if="sName" style="margin-left: 6px; margin-right: 6px">/</div>
<div style="font-weight: 700; font-size: 16px">活动详情</div> <div style="font-weight: 700; font-size: 16px">活动详情</div>
<!-- <!--
<div class="preNext"> <div class="preNext">
@@ -45,8 +45,22 @@
<div style="margin-left: 8px">{{ data?.activityAddress }}</div> <div style="margin-left: 8px">{{ data?.activityAddress }}</div>
</div> </div>
</div> </div>
<botton class="btn" :style="{background: `${data.signFlag ? '#999' : 'rgb(57, 146, 249)'}`, }" @click="signClick" >{{ data.signFlag ? "已签到" : "签到" }} <div v-if="projectStatus && projectEndTime">
</botton> <div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" >
<botton v-if="isAllowSign" class="btn" :style="{background: data.signFlag ? '#999' : 'rgb(57, 146, 249)' }" @click="signClick" >{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<botton v-else class="btn" :style="{background: '#999' }" @click="signClick" >{{ data.signFlag ? "已签到" : "签到" }}
</botton>
</div>
</div>
<div v-else>
<div>
<botton v-if="isAllowSign" class="btn" :style="{background: data.signFlag ? '#999' : 'rgb(57, 146, 249)' }" @click="signClick" >{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<botton v-else class="btn" :style="{background: '#999' }" @click="signClick" >{{ data.signFlag ? "已签到" : "签到" }}
</botton>
</div>
</div>
</div> </div>
<!-- 基本信息 --> <!-- 基本信息 -->
@@ -141,23 +155,34 @@ import { request, useRequest } from "@/api/request";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useRoute } from "vue-router/dist/vue-router"; import { useRoute } from "vue-router/dist/vue-router";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { reactive, onUnmounted } from "vue"; import { reactive, onUnmounted, toRefs} from "vue";
const router = useRouter(); const router = useRouter();
const returnclick = () => { const returnclick = () => {
router.back(); router.back();
}; };
const { const {
query: { courseId: activityId, id: taskId, type, pName, sName }, query: { courseId: activityId, id: taskId, type, pName, sName, projectStatus, projectEndTime },
} = useRoute(); } = useRoute();
const state = reactive({ const state = reactive({
isAllowSign: false, isAllowSign: false,
}); });
const { isAllowSign } = toRefs(state);
const { data } = useRequest(ACTIVITY, { activityId }); const { data } = useRequest(ACTIVITY, { activityId });
console.log('data', data)
const signClick = (tab, event) => { const signClick = (tab, event) => {
if (data.value.signFlag) { if (data.value.signFlag) {
return; return;
} }
if (!state.isAllowSign) {
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
ElMessage.warning("未在允许签到时间范围内");
return;
}
data.value.signFlag = true; data.value.signFlag = true;
ElMessage.warning("签到成功"); ElMessage.warning("签到成功");
request(TASK_ACTIVITY_SIGN, { request(TASK_ACTIVITY_SIGN, {
@@ -170,31 +195,35 @@ let timer = null;
//判断能否签到 //判断能否签到
function isSignClick() { function isSignClick() {
timer = setInterval(() => { timer = setInterval(() => {
let beginTime = new Date(data.activityStartTime).getTime(); let beginTime = new Date(data.value.activityStartTime).getTime();
let endTime = !data.afterSignIn let endTime = !data.value.afterSignIn
? new Date(data.activityEndTime).getTime() ? new Date(data.value.activityEndTime).getTime()
: new Date(data.activityStartTime).getTime(); : new Date(data.value.activityStartTime).getTime();
let nowTime = new Date().getTime(); let nowTime = new Date().getTime();
if (data.beforeSignIn && data.afterSignIn) { if (data.value.beforeSignIn && data.value.afterSignIn) {
//有开始前有开始后 //有开始前有开始后
beginTime = beginTime - data.beforeSignIn * 60 * 1000; beginTime = beginTime - data.value.beforeSignIn * 60 * 1000;
endTime = endTime + data.afterSignIn * 60 * 1000; endTime = endTime + data.value.afterSignIn * 60 * 1000;
console.log("1111"); console.log("1111");
} else if ( } else if (
data.beforeSignIn && data.value.beforeSignIn &&
!data.afterSignIn !data.value.afterSignIn
) { ) {
//只有开始前无开始后 //只有开始前无开始后
beginTime = beginTime - data.beforeSignIn * 60 * 1000; beginTime = beginTime - data.value.beforeSignIn * 60 * 1000;
console.log("11112222"); console.log("11112222");
} else if ( } else if (
!data.beforeSignIn && !data.value.beforeSignIn &&
data.afterSignIn data.value.afterSignIn
) { ) {
//无开始前有开始后 //无开始前有开始后
endTime = endTime + data.afterSignIn * 60 * 1000; endTime = endTime + data.value.afterSignIn * 60 * 1000;
console.log("1111333"); console.log("1111333");
} }
console.log(nowTime, beginTime, endTime, data.value)
console.log(nowTime < endTime , nowTime > beginTime)
console.log(state.isAllowSign)
if (nowTime < endTime && nowTime > beginTime) { if (nowTime < endTime && nowTime > beginTime) {
state.isAllowSign = true; state.isAllowSign = true;
} else { } else {

View File

@@ -274,6 +274,7 @@ import {
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import store from "@/store"; import store from "@/store";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
const { const {
query: { courseId, projectId }, query: { courseId, projectId },
} = useRoute(); } = useRoute();
@@ -353,17 +354,14 @@ const types = ref({
4: "/homeworkpage", 4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试 5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast", 6: "/livebroadcast",
7: ({ courseId }) => 7: ({ targetId }) => window.open(targetId, '_top'),
request(LINK_DETAILS(courseId), {}).then(({ data: { linkAddress } }) =>
window.open(linkAddress,'_top')
), //外联
8: "/discusspage", 8: "/discusspage",
9: "/moreactive", 9: "/moreactive",
10: ({ evaType, targetId }) => 10: ({ evaType, targetId }) =>
window.open( window.open(
(evaType == 0 evaType == 0
? import.meta.env.VITE_BOE_TEST_DETAIL_URL ? import.meta.env.VITE_BOE_TEST_DETAIL_URL+ targetId
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL+targetId+`&quizTaskKid=${projectId}&channelCode=project`
,'_top'), //测评 ,'_top'), //测评
11: "/surveydetail", 11: "/surveydetail",
12: "/ballotpage", 12: "/ballotpage",
@@ -374,9 +372,40 @@ const types = ref({
const dialogVisible = ref(false); const dialogVisible = ref(false);
const dialogVisibleTip = ref('该任务无法学习,请联系管理员进行替换!'); const dialogVisibleTip = ref('该任务无法学习,请联系管理员进行替换!');
// 判断当前任务已结束及时间意义上的结束 提示用户
function judgeTaskIsEnd(type, endTimes, status) {
// type 任务类型 endTime 结束时间 status 任务状态 (状态 0 未完成 1 已完成 2 未开始 3 已结束)
console.log(type, endTimes, status);
let isEnd = false;
let nowTime = new Date().getTime();
let endTime = new Date().getTime(endTimes);
switch (type) {
case 1:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break;
case 3:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break;
case 5:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break;
case 7:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break;
case 10:
status == 3 ? isEnd = true : nowTime > endTime ? isEnd = true : isEnd = false;
break;
}
return isEnd;
}
function toFinish(d, sName, chapterOrStageId) { function toFinish(d, sName, chapterOrStageId) {
console.log("dddddd", d, sName, chapterOrStageId); console.log("dddddd", d, sName, chapterOrStageId);
if(judgeTaskIsEnd(d.type ,data.value.endTime, data.value.status)){
ElMessage.error("当前任务已结束")
return
}
if (d.type == 2) { if (d.type == 2) {
let date1 = new Date(d.endTime).getTime(); let date1 = new Date(d.endTime).getTime();
let date2 = new Date().getTime(); let date2 = new Date().getTime();
@@ -460,7 +489,7 @@ function toFinish(d, sName, chapterOrStageId) {
return; return;
} }
if (d.type == 3 || d.type == 7) { if (d.type == 3 || d.type == 7) {
d.status || request(STUDY_RECORD, { d.status!==1 && request(STUDY_RECORD, {
studentId: data.value.userInfoBo.userId, studentId: data.value.userInfoBo.userId,
targetId: data.value.routerId, targetId: data.value.routerId,
logo: 2, logo: 2,
@@ -468,6 +497,7 @@ function toFinish(d, sName, chapterOrStageId) {
taskId: d.projectTaskId, taskId: d.projectTaskId,
}); });
} }
if (typeof types.value.path[d.type] === "string") { if (typeof types.value.path[d.type] === "string") {
types.value.path[d.type] && types.value.path[d.type] &&
types.value.path[d.type].startsWith("http") && types.value.path[d.type].startsWith("http") &&
@@ -483,7 +513,9 @@ function toFinish(d, sName, chapterOrStageId) {
courseId: d.courseId, courseId: d.courseId,
pName: data.value.name, pName: data.value.name,
sName, sName,
chapterOrStageId chapterOrStageId,
projectStatus: data.value.status?data.value.status:0, // 项目状态 -- 用于判断当前项目是否已经结束
projectEndTime: data.value.endTime?data.value.endTime:0 // 项目结束 -- 用于判断当前项目是否已经结束
}, },
}); });
} else if (typeof types.value.path[d.type] === "function") { } else if (typeof types.value.path[d.type] === "function") {

View File

@@ -341,17 +341,14 @@ const types = ref({
4: "/homeworkpage", 4: "/homeworkpage",
5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试 5: import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
6: "/livebroadcast", 6: "/livebroadcast",
7: ({ courseId }) => 7: ({ targetId }) => window.open(targetId, '_top'), //外联
request(LINK_DETAILS(courseId), {}).then(({ data: { linkAddress } }) =>
window.open(linkAddress, '_top')
), //外联
8: "/discusspage", 8: "/discusspage",
9: "/moreactive", 9: "/moreactive",
10: ({ evaType, targetId }) => 10: ({ evaType, targetId }) =>
window.open( window.open(
(evaType == 0 evaType == 0
? import.meta.env.VITE_BOE_TEST_DETAIL_URL ? import.meta.env.VITE_BOE_TEST_DETAIL_URL+targetId
: import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL) + targetId : import.meta.env.VITE_BOE_TEST_OUT_DETAIL_URL + targetId+`&quizTaskKid=${routerId}&channelCode=learningpath`
,'_top'), //测评 ,'_top'), //测评
11: "/surveydetail", 11: "/surveydetail",
12: "/ballotpage", 12: "/ballotpage",
@@ -443,7 +440,7 @@ function toFinish(d) {
} }
} }
if (d.type === 3 || d.type === 7) { if (d.type === 3 || d.type === 7) {
d.status || request(STUDY_RECORD, { d.status!==1 && request(STUDY_RECORD, {
studentId: userInfo.value.id, studentId: userInfo.value.id,
targetId: data.value.routerId, targetId: data.value.routerId,
logo: 1, logo: 1,

View File

@@ -296,9 +296,15 @@
data.assessmentMultipleChoiceDtoList?.length || data.assessmentMultipleChoiceDtoList?.length ||
data.assessmentSingleChoiceDtoList?.length || data.assessmentSingleChoiceDtoList?.length ||
data.assessmentScoringQuestionDtoList?.length data.assessmentScoringQuestionDtoList?.length
"> "> <div v-if="projectStatus && projectEndTime">
<div class="submit" @click="submit" :style="{ background: data.isSubmit ? '#999' : '#2478ff' }"> <div v-if="projectStatus !=='3' && new Date(projectEndTime).getTime() > new Date().getTime()" class="submit" @click="submit" :style="{ background: data.isSubmit ? '#999' : '#2478ff' }">
提交 提交
</div>
</div>
<div v-else>
<div class="submit" @click="submit" :style="{ background: data.isSubmit ? '#999' : '#2478ff' }">
提交
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -334,7 +340,7 @@ import { ElMessage } from "element-plus";
import { ref } from "vue"; import { ref } from "vue";
const { const {
query: { courseId, id: taskId, infoId, type, pName, sName, chapterOrStageId }, query: { courseId, id: taskId, infoId, type, pName, sName, chapterOrStageId, projectStatus, projectEndTime },
} = useRoute(); } = useRoute();
const router = useRouter(); const router = useRouter();
const returnclick = () => { const returnclick = () => {