Damon 4 years ago
parent
commit
5320ba358b

+ 4 - 6
src/api/coder.js

@@ -1,16 +1,14 @@
 const prefix = "/coder";
 
-import mockAPIs from "@/api/mock";
-import {axios} from "@/requests/axios.config";
+import { axios } from "@/requests/axios.config";
 
 function getAllCoderExams(data) {
-  // return axios.get(`${prefix}/exams`, data);
-  return mockAPIs.getAllCoderExams(data);
+  return axios.get(`${prefix}/exams`, data);
 }
 
-// page和limit非必需
-function getStudentCoderExams({page, limit}) {
+function getStudentCoderExams({ page, limit }) {
   return axios.get(`${prefix}/exams`, {
+    // page和limit非必需
     params: {
       page,
       limit

+ 2 - 4
src/api/eval.js

@@ -1,16 +1,14 @@
 const prefix = "/eval";
 
-import mockAPIs from "@/api/mock";
 import {axios} from "@/requests/axios.config";
 
 function getAllEvalExams(data) {
-  // return axios.get(`${prefix}/exams`, data);
-  return mockAPIs.getAllEvalExams(data);
+  return axios.get(`${prefix}/exams`, data);
 }
 
-// pageSize、pageNum非必需,state必需,"0 所有, 1 未开始,2 进行中,3 已结束"
 function getStudentEvalExams({pageSize, pageNum, state}){
   return axios.get(`${prefix}/exams/student`, {
+    // pageSize、pageNum非必需,state必需,"0 所有, 1 未开始,2 进行中,3 已结束"
     params:{
       pageSize,
       pageNum,

+ 8 - 8
src/components/CoderCard.vue

@@ -10,7 +10,7 @@
 
     <el-row>
       <el-col :span="16" class="name">
-        {{ coderVO.name }}
+        {{ coderVO.name !== undefined ? coderVO.name : "待添加" }}
       </el-col>
       <el-col :span="8" class="status">
         <el-tag v-if="state==='NOT_STARTED'" size="small" type="info">未开始</el-tag>
@@ -45,8 +45,6 @@ export default {
   props: {
     coderVO: {
       type: Object,
-      default: () => {
-      },
     }
   },
   data() {
@@ -76,11 +74,13 @@ export default {
     }
   },
   async mounted() {
-    const res = await this.$apis.getUserAPI(this.coderVO.creator.id);
-    if (res.data.code === 0) {
-      this.teacher = res.data.data;
-    } else {
-      this.teacher = {name: this.coderVO.creator.username};
+    if (this.coderVO.creator) {
+      const res = await this.$apis.getUserAPI(this.coderVO.creator.id);
+      if (res.data.code === 0) {
+        this.teacher = res.data.data;
+      } else {
+        this.teacher = {name: this.coderVO.creator.username};
+      }
     }
   },
   methods: {

+ 2 - 2
src/components/CourseCard.vue

@@ -24,8 +24,8 @@
     <el-row></el-row>
     <el-row v-if="isManagePage">
       <div class="button">
-        <el-button type="primary" icon="el-icon-edit" circle @click.stop="$emit('update')"></el-button>
-        <el-button type="danger" icon="el-icon-delete" circle @click.stop="$emit('delete')"></el-button>
+        <el-button type="primary" size="small" icon="el-icon-edit" round plain @click.stop="$emit('update')">修改</el-button>
+        <el-button type="danger" size="small" icon="el-icon-delete" round plain @click.stop="$emit('delete')">删除</el-button>
       </div>
     </el-row>
   </el-card>

+ 5 - 3
src/components/EvalCard.vue

@@ -10,7 +10,7 @@
 
     <el-row>
       <el-col :span="16" class="name">
-        {{ examVO.examName }}
+        {{ examVO.examName !== undefined ? examVO.examName : "待添加" }}
       </el-col>
       <el-col :span="8" class="status">
         <el-tag v-if="state==='NOT_STARTED'" size="small" type="info">未开始</el-tag>
@@ -71,8 +71,10 @@ export default {
     }
   },
   async mounted() {
-    const res = await this.$apis.getUserAPI(this.examVO.creatorId);
-    this.teacher = res.data.data;
+    if (this.examVO.creatorId) {
+      const res = await this.$apis.getUserAPI(this.examVO.creatorId);
+      this.teacher = res.data.data;
+    }
   },
   methods: {
     timestampToTime(timestamp) {

+ 1 - 1
src/components/GlobalHeader.vue

@@ -59,7 +59,7 @@
 </template>
 
 <script>
-import InfoCard from "@/views/PortalPage/components/InfoCard";
+import InfoCard from "@/components/InfoCard";
 import store from "@/store";
 
 export default {

+ 1 - 1
src/views/PortalPage/components/InfoCard.vue → src/components/InfoCard.vue

@@ -17,7 +17,7 @@
     </div>
     <div v-if="isLogin" id="info-card-name-id">
       <div>{{ name }}</div>
-      <div>{{ email }}</div>
+      <div style="font-size: x-small">{{ email }}</div>
     </div>
     <div v-if="isLogin" id="info-card-button-in" @click="logout">
       <span>登出</span>

+ 4 - 1
src/global/register-element.js

@@ -32,7 +32,10 @@ import {
   ElTag,
   ElTimeline,
   ElTimelineItem,
-  ElBacktop, ElMenu, ElMenuItem, ElSubmenu,
+  ElBacktop,
+  ElMenu,
+  ElMenuItem,
+  ElSubmenu,
 } from "element-plus";
 
 // NOTE 使用到的组件列表,请确保 import 和 component 的一致性

+ 30 - 19
src/views/ManagePage/ManagePage.vue

@@ -73,12 +73,16 @@
             </div>
           </div>
         </template>
-        <div class="course-card-list-container mt-16">
-          <div v-for="(item,index) in myCourseList" :key="index" class="cItem">
-            <CourseCard :ref="'courseCard'+item.id" :courseVO="item" @delete="deleteCourse(item)"
-                        @update="updateCourse(item)"></CourseCard>
-          </div>
-        </div>
+        暂无数据,接口还没对
+        <!-- todo 暂无数据,接口还没对-->
+        <el-tabs v-model="activeTestPaneName">
+          <el-tab-pane class="test-page-main" label="评测题" name="eval">
+            <EvalCard v-for="item in evalExamList" :key="item.id" :examVO="item"/>
+          </el-tab-pane>
+          <el-tab-pane class="test-page-main" label="代码题" name="coder">
+            <CoderCard v-for="item in coderExamList" :key="item.id" :coderVO="item"/>
+          </el-tab-pane>
+        </el-tabs>
       </el-card>
     </el-col>
     <el-dialog v-model="dialogVisible" :before-close="handleFormCancel" :width="600" title="新增课程">
@@ -112,7 +116,7 @@
         </el-form-item>
         <el-form-item label="课程时间" prop="time">
           <el-date-picker v-model="form.courseTime" end-placeholder="结束时间" range-separator="至" start-placeholder="开始时间"
-                          type="datetimerange">
+                          type="datetime-range">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="课程邀请码" prop="invitationCode">
@@ -153,14 +157,18 @@
 
 <script>
 import CourseCard from "@/components/CourseCard";
-import {ElMessage, ElMessageBox} from "element-plus";
+import { ElMessage, ElMessageBox } from "element-plus";
 import GlobalFooter from "@/components/GlobalFooter";
 import client from "@/utils/oss";
-import {Back, Document} from "@element-plus/icons-vue";
+import { Back, Document } from "@element-plus/icons-vue";
+import CoderCard from "@/components/CoderCard";
+import EvalCard from "@/components/EvalCard";
 
 export default {
   name: "ManagePage",
   components: {
+    EvalCard,
+    CoderCard,
     Document,
     Back,
     CourseCard,
@@ -195,6 +203,7 @@ export default {
     };
     return {
       activeIndex: "1",
+      activeTestPaneName: "eval",
       dialogVisible: false,
       dialogTitle: "新增课程",
       form: {
@@ -238,13 +247,14 @@ export default {
       },
       //
       myCourseList: [],
-      //
+      evalExamList: [],
+      coderExamList: [],
       courseType: "all",
       courseTypeOptions: [
-        {value: "all", label: "全部课程"},
-        {value: "pending", label: "未开始"},
-        {value: "start", label: "正在进行"},
-        {value: "end", label: "已结束"},
+        { value: "all", label: "全部课程" },
+        { value: "pending", label: "未开始" },
+        { value: "start", label: "正在进行" },
+        { value: "end", label: "已结束" },
       ],
     };
   },
@@ -252,7 +262,8 @@ export default {
   mounted() {
     this.$apis.getTeacherCourses(this.$store.state.user.id).then(res => {
       this.myCourseList = res.data.data;
-    }).catch();
+    });
+
   },
   methods: {
     handleSelect(index) {
@@ -260,10 +271,10 @@ export default {
         this.$router.push("portal");
       }
       if (index === "1") {
-        document.getElementById("app").scrollIntoView({behavior: "smooth"});
+        document.getElementById("app").scrollIntoView({ behavior: "smooth" });
       }
       if (index === "2") {
-        document.querySelector("#manage-page-divider").scrollIntoView({behavior: "smooth"});
+        document.querySelector("#manage-page-divider").scrollIntoView({ behavior: "smooth" });
       }
       this.activeIndex = index;
     },
@@ -380,13 +391,13 @@ export default {
     },
     beforeUpload(file) {
       const isJPG = file.type === "image/jpeg";
-      const isLt10M = file.size / 1024 / 1024 < 10;
+      const isLt10M = file.size / 1024 / 1024 < 3;
       const isPNG = file.type === "image/png";
       if (!(isJPG || isPNG)) {
         ElMessage.error("上传头像图片只能是 JPG/PNG 格式!");
       }
       if (!isLt10M) {
-        ElMessage.error("上传图片大小不能超过 10MB!");
+        ElMessage.error("上传图片大小不能超过 3MB!");
       }
       return (isJPG || isPNG) && isLt10M;
     },

+ 0 - 5
src/views/PortalPage/PortalPage.css

@@ -7,11 +7,6 @@
     padding: 10px 10vw 80px 10vw;
 }
 
-#portal-carousel-card {
-    grid-column-start: 1;
-    grid-column-end: 3;
-}
-
 .portal-card-title {
     display: flex;
     justify-content: space-between;

+ 82 - 70
src/views/PortalPage/PortalPage.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="portal-body">
 
-    <CarouselCard id="portal-carousel-card"/>
+    <CarouselCard style="grid-column-start: 1; grid-column-end: 3;"/>
 
     <div>
       <el-card :style="{height: courseRowHeight + 'px'}">
@@ -42,7 +42,6 @@
                :style="{height: (courseRowHeight - 63) + 'px', marginTop: (courseRowHeight / 2 - 100) + 'px'}"
                class="portal-card-main" style="cursor: pointer"
                @click="this.$router.push('/manage')">
-            <!--            <div style="font-size: small; font-weight: bold; color: #666666">去管理课程</div>-->
             <el-icon :size="72" color="#bfbfbf">
               <SetUp/>
             </el-icon>
@@ -73,36 +72,44 @@
           <div class="portal-card-title-main">我的测试</div>
         </div>
         <el-divider class="portal-card-divider"/>
-        <div v-if="isTeacher">
-          教师请前往
-          <span style="cursor: pointer;color: red"
-                @click="$router.push('/manage')">管理页面</span>
-          查看相关测试。
+
+        <div v-if="!isLogin"
+             :style="{height: (testRowHeight - 63) + 'px', marginTop: (testRowHeight / 2 - 100) + 'px'}"
+             class="portal-card-main" style="cursor: pointer"
+             @click="this.$router.push('/auth')">
+          <el-icon :size="72" color="#bfbfbf">
+            <Lock/>
+          </el-icon>
+          <div style="font-size: small; font-weight: bold; color: #666666">登录以查看</div>
         </div>
-        <div v-if="isStudent">
-          <div v-if="isLogin" :style="{height: (testRowHeight - 63) + 'px'}" class="portal-card-main">
-            <div class="portal-my-card-main">
-              <div v-if="myTestList.length !== 0">
-                <MyTestCard v-for="test in myTestList" :key="test.id" :testVO="test"/>
-              </div>
-              <div v-else>
-                您尚未参加任何测试,前往
-                <span style="cursor: pointer;color: red"
-                      @click="$router.push('/test')">全部测试
-                </span>
-                页面参加更多优质测试。
-              </div>
-            </div>
-          </div>
-          <div v-else :style="{height: (testRowHeight - 63) + 'px', marginTop: (testRowHeight / 2 - 100) + 'px'}"
-               class="portal-card-main" style="cursor: pointer"
-               @click="this.$router.push('/auth')">
-            <el-icon :size="72" color="#bfbfbf">
-              <Lock/>
-            </el-icon>
-            <div style="font-size: small; font-weight: bold; color: #666666">登录以查看</div>
+
+        <div v-if="isLogin && isStudent && myTestList!==null && myTestList.length!==0" :style="{height: (testRowHeight - 63) + 'px'}"
+             class="portal-card-main">
+          <div class="portal-my-card-main">
+            <MyTestCard v-for="test in myTestList" :key="test.id" :testVO="test"/>
           </div>
         </div>
+
+        <div v-if="isLogin && isStudent && myTestList!==null && myTestList.length===0"
+             :style="{height: (testRowHeight - 63) + 'px', marginTop: (testRowHeight / 2 - 100) + 'px'}"
+             class="portal-card-main" style="cursor: pointer"
+             @click="this.$router.push('/test')">
+          <el-icon :size="72" color="#bfbfbf">
+            <ShoppingCart/>
+          </el-icon>
+          <div style="font-size: small; font-weight: bold; color: #666666">去参加测试</div>
+        </div>
+
+        <div v-show="isLogin && isTeacher"
+             :style="{height: (testRowHeight - 63) + 'px', marginTop: (testRowHeight / 2 - 100) + 'px'}"
+             class="portal-card-main" style="cursor: pointer"
+             @click="this.$router.push('/manage')">
+          <el-icon :size="72" color="#bfbfbf">
+            <SetUp/>
+          </el-icon>
+          <div style="font-size: small; font-weight: bold; color: #666666">去管理测试</div>
+        </div>
+
       </el-card>
     </div>
 
@@ -146,10 +153,10 @@ import EvalCard from "@/components/EvalCard";
 import CoderCard from "@/components/CoderCard";
 import MyCourseCard from "@/views/PortalPage/components/MyCourseCard";
 import MyTestCard from "@/views/PortalPage/components/MyTestCard";
-import {Lock, SetUp, ShoppingCart} from "@element-plus/icons-vue";
+import { Lock, SetUp, ShoppingCart } from "@element-plus/icons-vue";
 
 export default {
-  //属性
+  //数据
   name: "PortalPage",
   components: {
     SetUp,
@@ -165,16 +172,14 @@ export default {
   },
   data() {
     return {
-      extending: false,
       cardRowLength: 3,
       activeTestPaneName: "eval",
       evalExamList: [],
       courseList: [],
       coderExamList: [],
-      myCourseList: null,
+      myCourseList: [],
       myEvalExamList: [],
       myCoderExamList: [],
-      myTestList: [],
       courseRowHeight: 360,
       testRowHeight: 300,
     };
@@ -188,11 +193,14 @@ export default {
     },
     isStudent() {
       return this.$store.getters.isStudent;
-    }
+    },
+    myTestList() {
+      return [].concat(this.myEvalExamList).concat(this.myCoderExamList);
+    },
   },
 
   //生命周期函数
-  beforeMount() {
+  created() {
     window.addEventListener("scroll", this.handleResize, true);
   },
   async mounted() {
@@ -205,35 +213,38 @@ export default {
 
     this.$apis.getExampleCourses().then(res => {
       this.courseList = res.data.data;
+      while (this.courseList.length < 6) {
+        this.courseList.push({});
+      }
+    });
+    this.$apis.getAllEvalExams().then(res => {
+      // todo ERROR: 缺少 token 就无法请求
+      this.evalExamList = res.data.data.examVOList;
+      while (this.evalExamList.length < 6) {
+        this.evalExamList.push({});
+      }
     });
-    // this.$apis.getAllEvalExams().then(res => {
-    //   this.evalExamList = res.data.data["examVOList"];
-    // });
-    // todo
-    this.evalExamList = this.$apis.getAllEvalExams().data.data["examVOList"];
-    // this.$apis.getAllCoderExams().then(res => {
-    //   this.coderExamList = res.data.data.res;
-    // });
-    // todo
-    this.coderExamList = this.$apis.getAllCoderExams().data.data.res;
+    this.$apis.getAllCoderExams().then(res => {
+      // todo ERROR: 缺少 token 就无法请求
+      this.coderExamList = res.data.data.res;
+      while (this.coderExamList.length < 6) {
+        this.coderExamList.push({});
+      }
+    });
+
     if (this.isLogin && this.isStudent) {
-      this.$apis.getStudentCourses(this.$store.state.user.id)
-        .then(res => {
-          this.myCourseList = res.data.data;
-        })
-        .catch();
-      this.$apis.getStudentEvalExams({state: 0})
-        .then(
-          res => {
-            this.myEvalExamList = res.data.data.examVOList;
-          })
-        .catch();
-      this.$apis.getStudentCoderExams({})
-        .then(res => {
-          this.myCoderExamList = res.data.data.res;
-        })
-        .catch();
-      this.myTestList = [].concat(this.myEvalExamList).concat(this.myCoderExamList);
+      this.$apis.getStudentCourses(this.$store.state.user.id).then(res => {
+        this.myCourseList = res.data.data;
+        that.handleResize();
+      });
+      this.$apis.getStudentEvalExams({ state: 0 }).then(res => {
+        this.myEvalExamList = res.data.data.examVOList;
+        that.handleResize();
+      });
+      this.$apis.getStudentCoderExams({}).then(res => {
+        this.myCoderExamList = res.data.data.res;
+        that.handleResize();
+      });
     }
 
     await this.$nextTick(() => {
@@ -250,19 +261,20 @@ export default {
       this.$router.push("/course");
     },
     handleResize() {
+      // todo 优化
       let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
       if (scrollTop > 100) {
-        this.extending = true;
+        this.courseRowHeight = 640;
         if (document.body.clientWidth >= 1200) {
           this.cardRowLength = 6;
-        } else if (document.body.clientWidth >= 992 && document.body.clientWidth < 1200) {
-          this.cardRowLength = 4;
-        } else if (document.body.clientWidth < 992) {
-          this.cardRowLength = 2;
         }
-        this.courseRowHeight = 640;
       }
-      this.testRowHeight = this.$refs.portalTestCardBodyMain.$el.clientHeight;
+      if (document.body.clientWidth >= 992 && document.body.clientWidth < 1200) {
+        this.cardRowLength = 4;
+      } else if (document.body.clientWidth < 992) {
+        this.cardRowLength = 2;
+      }
+      this.testRowHeight = Math.max(this.$refs.portalTestCardBodyMain.$el.clientHeight, 300);
     },
     changeTestPane() {
       const that = this;

+ 2 - 4
src/views/PortalPage/components/MyCourseCard.vue

@@ -58,10 +58,6 @@ export default {
       const Y = date.getFullYear() + "-";
       const M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
       const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
-      // const h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
-      // const m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes());
-      // const s = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
-      // return Y + M + D + h + m + s;
       return Y + M + D;
     },
   },
@@ -75,6 +71,7 @@ export default {
 
 <style scoped>
 .body {
+  min-width: 250px;
   margin-bottom: 8px;
   position: relative;
   border: 1px solid #cccccc;
@@ -87,6 +84,7 @@ export default {
 
 .course-img {
   width: 100%;
+  min-height: 50px;
   height: 100%;
   outline: solid 1px #dddddd;
   border-radius: 4px;

+ 0 - 2
src/views/PortalPage/components/MyTestCard.vue

@@ -128,8 +128,6 @@ export default {
       const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
       const h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
       const m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes());
-      // const s = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
-      // return Y + M + D + h + m + s;
       return Y + M + D + h + m;
     },
     toTestInfo() {

+ 2 - 2
src/views/TaskPage/TaskPage.vue

@@ -46,8 +46,8 @@ export default {
   },
 
   async mounted() {
-    this.myEvalExamList = this.$apis.getAllEvalExams().data.data["examVOList"];
-    this.myCoderExamList = this.$apis.getAllCoderExams().data.data["res"];
+    this.myEvalExamList = (await this.$apis.getAllEvalExams()).data.data["examVOList"];
+    this.myCoderExamList = (await this.$apis.getAllCoderExams()).data.data["res"];
     this.expiring = this.allTask = [].concat(this.myEvalExamList).concat(this.myCoderExamList);
   }
 };

+ 36 - 30
src/views/TestPage/TestPage.vue

@@ -31,16 +31,28 @@
             {{ activeName }}
           </span>
         </template>
-        <div v-if="this.activeIndex === '1'" class="test-page-main">
-          <EvalCard v-for="item in evalExamList" :key="item.id" :examVO="item"/>
-          <el-divider style="grid-column-start: 1; grid-column-end: 5"/>
-          <CoderCard v-for="item in coderExamList" :key="item.id" :coderVO="item"/>
+        <div v-if="this.activeIndex === '1'">
+          <el-tabs v-model="activeTestPaneName" style="width: 100%">
+            <el-tab-pane class="test-page-main" label="评测题" name="eval">
+              <EvalCard v-for="item in evalExamList" :key="item.id" :examVO="item"/>
+            </el-tab-pane>
+            <el-tab-pane class="test-page-main" label="代码题" name="coder">
+              <CoderCard v-for="item in coderExamList" :key="item.id" :coderVO="item"/>
+            </el-tab-pane>
+          </el-tabs>
         </div>
-        <div v-if="this.activeIndex === '2' && isStudent" class="test-page-main">
-          <EvalCard v-for="item in evalExamList_my" :key="item.id" :examVO="item"/>
-          <el-divider style="grid-column-start: 1; grid-column-end: 5"/>
-          <CoderCard v-for="item in coderExamList_my" :key="item.id" :coderVO="item"/>
+
+        <div v-if="this.activeIndex === '2' && isStudent">
+          <el-tabs v-model="activeTestPaneName_my" style="width: 100%">
+            <el-tab-pane class="test-page-main" label="评测题" name="eval">
+              <EvalCard v-for="item in evalExamList_my" :key="item.id" :examVO="item"/>
+            </el-tab-pane>
+            <el-tab-pane class="test-page-main" label="代码题" name="coder">
+              <CoderCard v-for="item in coderExamList_my" :key="item.id" :coderVO="item"/>
+            </el-tab-pane>
+          </el-tabs>
         </div>
+
         <!--todo-->
         <div v-if="this.activeIndex === '2' && isTeacher">
           教师请前往
@@ -59,12 +71,12 @@
 import EvalCard from "@/components/EvalCard";
 import CoderCard from "@/components/CoderCard";
 import GlobalFooter from "@/components/GlobalFooter";
-import {Back, Document, DocumentChecked} from "@element-plus/icons-vue";
+import { Back, Document, DocumentChecked } from "@element-plus/icons-vue";
 
 
 export default {
   name: "TestPage",
-  components: {Back, Document, DocumentChecked, GlobalFooter, CoderCard, EvalCard,},
+  components: { Back, Document, DocumentChecked, GlobalFooter, CoderCard, EvalCard, },
   data() {
     return {
       activeIndex: "1",
@@ -72,6 +84,8 @@ export default {
       coderExamList: [],
       evalExamList_my: [],
       coderExamList_my: [],
+      activeTestPaneName: "eval",
+      activeTestPaneName_my: "eval",
     };
   },
   computed: {
@@ -92,29 +106,21 @@ export default {
 
 
   mounted() {
-    // await this.$apis.getAllEvalExams().then(res => {
-    //   this.coderExamList = res.data.data["examVOList"];
-    // });
-    // todo
-    this.evalExamList = this.$apis.getAllEvalExams().data.data["examVOList"];
-
-    // await this.$apis.getAllCoderExams().then(res => {
-    //   this.coderExamList = res.data.data.res;
-    // });
-    // todo
-    this.coderExamList = this.$apis.getAllCoderExams().data.data["res"];
+    this.$apis.getAllEvalExams().then(res => {
+      this.evalExamList = res.data.data["examVOList"];
+    });
+    this.$apis.getAllCoderExams().then(res => {
+      this.coderExamList = res.data.data.res;
+    });
     if (this.isStudent) {
-      this.$apis.getStudentEvalExams({state: 0})
+      this.$apis.getStudentEvalExams({ state: 0 })
         .then(res => {
           this.evalExamList_my = res.data.data.examVOList;
-
-          this.$apis.getStudentCoderExams({})
-            .then(res => {
-              this.coderExamList_my = res.data.data.res;
-            })
-            .catch();
-        })
-        .catch();
+        });
+      this.$apis.getStudentCoderExams({})
+        .then(res => {
+          this.coderExamList_my = res.data.data.res;
+        });
     }
   },