fix:修改评估按钮和时间 添加面授考试跳转

This commit is contained in:
lixg
2022-12-16 22:08:35 +08:00
parent 5b9a8faa02
commit 8ab9b94b87
5 changed files with 237 additions and 152 deletions

View File

@@ -14,24 +14,37 @@
<div class="title">面授课{{ data.planDto?.name }}</div>
<div class="time" style="margin-top: 26px">
<img
style="width: 15px; height: 17px"
src="../../assets/image/time.png"
style="width: 15px; height: 17px"
src="../../assets/image/time.png"
/>
<div style="margin-left: 8px">
{{ data.offcourseDto?.publishTime }}
{{ data.planDto?.beginTime + "至" + data.planDto?.endTime }}
</div>
</div>
<div class="time" style="margin-top: 23px">
<img
style="width: 16px; height: 18px"
src="../../assets/image/position.png"
style="width: 16px; height: 18px"
src="../../assets/image/position.png"
/>
<div style="margin-left: 8px">{{ data.planDto?.address }}</div>
</div>
</div>
<botton :style="{background:`${data.isSurvery?'#999':'rgb(57, 146, 249)'}`}" class="btn" @click="toSurvery"
v-if="data.evalFlag && data.evalFlag==='1'"
>{{ data.isSurvery ? '已评估' : '评估' }}
<botton
style="background: #999"
class="btn"
@click="toSurvery"
v-if="data.planDto?.evalFlag == 0"
>
评估
</botton>
<botton
:style="{
background: `${data.isSurvery ? '#999' : 'rgb(57, 146, 249)'}`,
}"
class="btn"
@click="toSurvery"
v-if="data.planDto?.evalFlag && data.planDto?.evalFlag == 1"
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
<!-- 基本信息 -->
@@ -43,8 +56,8 @@
<div class="" style="margin-left: 48px; margin-right: 48px">
<div class="title">
<img
style="width: 20px; height: 20px"
src="../../assets/image/course.png"
style="width: 20px; height: 20px"
src="../../assets/image/course.png"
/>
<div class="text">课程详情</div>
<div class="box"></div>
@@ -58,16 +71,29 @@
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程附件" name="first">
<div
v-for="(el, index) in JSON.parse(data.planDto?.attach)"
:key="index"
v-if="data.planDto"
class="enclosure"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"
v-if="data.planDto?.attach === '[]'"
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
"
>
此课程无附件
</div>
<div
v-for="(el, index) in JSON.parse(data.planDto?.attach)"
:key="index"
v-if="data.planDto"
class="enclosure"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"
>
<div class="enclosureL">
<FileTypeImg
v-model="el.name"
:style="{
v-model="el.name"
:style="{
width: '22px',
height: '26px',
marginLeft: '10px',
@@ -77,15 +103,33 @@
</div>
<div class="download">
<img
style="width: 16px; height: 15px"
src="../../assets/image/download.png"
style="width: 16px; height: 15px"
src="../../assets/image/download.png"
/>
<div style="margin-left: 5px" @click="download(el.response.data)">下载</div>
<div
style="margin-left: 5px"
@click="download(el.response.data)"
>
下载
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程作业" name="second">
<div class="work" v-if="data.workDto?.workName ">
<div
v-if="data.planDto?.attach === '[]'"
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
"
>
此课程无作业
</div>
<div class="work" v-if="data.workDto?.workName">
<div>
<div class="question">{{ data.workDto?.workName }}</div>
<div style="margin-top: 16px; display: flex">
@@ -94,11 +138,24 @@
</div>
</div>
<div class="submit" @click="toWork" v-if="data.workDto?.workId">
提交
去作业
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程考试" name="third">
<div
v-if="data.planDto?.attach === '[]'"
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
"
>
此课程无考试
</div>
<div class="work" v-if="data.examinationDto?.examinationTestName">
<div>
<div class="question">
@@ -106,17 +163,17 @@
</div>
<div style="margin-top: 16px; display: flex">
<div
class="tag1"
v-if="data.examinationDto?.examinationFlag"
class="tag1"
v-if="data.examinationDto?.examinationFlag"
>
必修
</div>
<div class="tag3" style="margin-left: 11px">考试</div>
</div>
</div>
<!-- <div class="submit" @click="toExamItem(data.examinationDto)">-->
<!-- 去考试-->
<!-- </div>-->
<div class="submit" @click="toExamItem(data.examinationDto)">
去考试
</div>
</div>
</el-tab-pane>
</el-tabs>
@@ -125,15 +182,15 @@
<div class="teacher">
<div class="title">
<img
style="width: 21px; height: 23px"
src="../../assets/image/livelecturer.png"
style="width: 21px; height: 23px"
src="../../assets/image/livelecturer.png"
/>
<div class="text">直播讲师</div>
<div class="box"></div>
</div>
<!-- todo #面授课接口 讲师缺少img和介绍-->
<div class="teacheritem">
<img class="peopleimg" :src="userAvatar"/>
<img class="peopleimg" :src="userAvatar" />
<div style="margin-left: 17px; width: 190px">
<div class="teacherName" style="margin-right: 5px">
{{ data.planDto?.teacher }}
@@ -149,32 +206,32 @@
</template>
<script setup>
import {computed, reactive, toRefs, watch} from "vue";
import { computed, reactive, toRefs, watch } from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import {request, useRequest} from "@/api/request";
import {STU_OFFCOURSE_DETAIL} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {useUserInfo} from "@/api/utils";
import { request, useRequest } from "@/api/request";
import { STU_OFFCOURSE_DETAIL } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
const router = useRouter();
const returnclick = () => {
router.back();
};
const {
query: {courseId, type},
query: { courseId, type },
} = useRoute();
const {data} = useRequest(STU_OFFCOURSE_DETAIL, {courseId});
const {avatar: userAvatar} = useUserInfo(
computed(() => data.value?.planDto?.teacherId)
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data);
const { avatar: userAvatar } = useUserInfo(
computed(() => data.value?.planDto?.teacherId)
);
const state = reactive({
activeName: "first",
enclosure: "",
});
const {activeName, enclosure} = toRefs(state);
const { activeName, enclosure } = toRefs(state);
const handleClick = (tab, event) => {
console.log(tab, event);
};
@@ -184,11 +241,15 @@ const download = (url) => {
function toSurvery() {
if (data.value.isSurvery) {
return
return;
}
if (data.value.planDto.evalFlag == 0) {
alert("此课程无评估");
return;
}
router.push({
path: "/surveydetail",
query: {courseId: data.value.planDto.evaluateId},
query: { courseId: data.value.planDto.evaluateId },
});
}
@@ -204,7 +265,9 @@ function toWork() {
}
function toExamItem(obj) {
router.push({path: "/starttest", query: {id: obj.courseId}});
console.log("obj", obj.examinationTestId);
window.open(import.meta.env.VITE_BOE_EXAM_DETAIL_URL + obj.examinationTestId); //测评
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });
}
</script>