|
|
@@ -36,21 +36,25 @@
|
|
|
<el-tabs v-model="activeTestPaneName" style="width: 100%">
|
|
|
<el-tab-pane label="评测题" name="eval">
|
|
|
<div v-for="(item, key) in evalExamList" :key="key">
|
|
|
- <div>
|
|
|
- <el-divider style="margin: 10px 0 20px 0" content-position="left">{{ key }}</el-divider>
|
|
|
- </div>
|
|
|
- <div class="test-page-main">
|
|
|
- <TestCard v-for="exam in item" :key="exam.id" :testVO="exam" :isPublicTest="true"/>
|
|
|
+ <div v-if="item.length !== 0">
|
|
|
+ <div>
|
|
|
+ <el-divider style="margin: 10px 0 20px 0" content-position="left">{{ key }}</el-divider>
|
|
|
+ </div>
|
|
|
+ <div class="test-page-main">
|
|
|
+ <TestCard v-for="exam in item" :key="exam.id" :testVO="exam" :isPublicTest="true"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="代码题" name="coder">
|
|
|
<div v-for="(item, key) in coderExamList" :key="key">
|
|
|
- <div>
|
|
|
- <el-divider style="margin: 10px 0 20px 0;" content-position="left">{{ key }}</el-divider>
|
|
|
- </div>
|
|
|
- <div class="test-page-main">
|
|
|
- <TestCard v-for="exam in item" :key="exam.id" :testVO="exam"/>
|
|
|
+ <div v-if="item.length !== 0">
|
|
|
+ <div>
|
|
|
+ <el-divider style="margin: 10px 0 20px 0;" content-position="left">{{ key }}</el-divider>
|
|
|
+ </div>
|
|
|
+ <div class="test-page-main">
|
|
|
+ <TestCard v-for="exam in item" :key="exam.id" :testVO="exam"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
@@ -88,18 +92,24 @@
|
|
|
@click="$router.push('/manage')">管理页面</span>
|
|
|
查看相关测试。
|
|
|
</div>
|
|
|
+
|
|
|
+ <div v-if="this.activeIndex === '2' && !isLogin">
|
|
|
+ 请先
|
|
|
+ <span style="cursor: pointer;color: #409eff"
|
|
|
+ @click="$router.push('/auth')">登录</span>
|
|
|
+ </div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { Back, Document, DocumentChecked } from "@element-plus/icons-vue";
|
|
|
+import {Back, Document, DocumentChecked} from "@element-plus/icons-vue";
|
|
|
import TestCard from "@/components/TestCard";
|
|
|
|
|
|
export default {
|
|
|
name: "TestPage",
|
|
|
- components: { TestCard, Back, Document, DocumentChecked, },
|
|
|
+ components: {TestCard, Back, Document, DocumentChecked,},
|
|
|
data() {
|
|
|
return {
|
|
|
activeIndex: "1",
|
|
|
@@ -125,6 +135,9 @@ export default {
|
|
|
isStudent() {
|
|
|
return this.$store.getters.isStudent;
|
|
|
},
|
|
|
+ isLogin() {
|
|
|
+ return this.$store.getters.isLogin;
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$apis.getRecommendEvalExamsGroupByCourse().then(res => {
|