Browse Source

[修改]学生代码作业接口

soleil 7 years ago
parent
commit
041edb040e

+ 1 - 1
src/views/student/Code/ProjectList/index.vue

@@ -22,7 +22,7 @@
           v-for="item in projectList"
           class="column is-4"
         >
-          <router-link :to="`${$route.path}/${item.projectId}`">
+          <router-link :to="`${$route.path}/${item.id}`">
             <card hoverable>{{ item.name }}</card>
           </router-link>
         </div>

+ 3 - 3
src/views/student/Code/index.vue

@@ -18,12 +18,12 @@
         </div>
         <div
           v-else
-          :key="item.homeworkId"
+          :key="item.id"
           v-for="item in codeHomeworkList"
           class="column is-4-desktop"
         >
-          <router-link :to="`${$route.path}/${item.homeworkId}`">
-            <card hoverable>{{ item.description }}</card>
+          <router-link :to="`${$route.path}/${item.id}`">
+            <card hoverable>{{ item.name }}</card>
           </router-link>
         </div>
       </div>

+ 5 - 18
src/views/teacher/Result/index.vue

@@ -313,25 +313,12 @@ export default {
       });
     }
   },
-  mounted() {
+  async mounted() {
     //获取成绩信息
-    let getResultIntervel = setInterval(() => {
-      if (this.course.id) {
-        clearInterval(getResultIntervel);
-        getStudentFinaleResult(this.course.id)
-          .then(res => {
-            this.data = res.data;
-            this.isResultLoading = false;
-          })
-          .catch(e => {
-            this.isResultLoading = false;
-            this.$toast.open({
-              message: e.message || "服务器错误,请稍后再试",
-              type: "is-danger"
-            });
-          });
-      }
-    }, 800);
+    const resultData = await getStudentFinaleResult(
+      this.$route.params.courseId
+    );
+    this.data = resultData;
     //统计学生分数
     let studentResultStatistics = this.studenResultStatistics(this.data);
     //绘制图表

+ 2 - 2
vue.config.js

@@ -3,8 +3,8 @@ module.exports = {
     proxy: {
       "^/api": {
         // target: "http://localhost:4000/",
-        // target: "http://10.1.1.198:8080/",
-        target: "http://10.1.2.3:8080/",
+        target: "http://10.1.1.198:8080/",
+        // target: "http://10.1.2.3:8080/",
         ws: true,
         changeOrigin: true
       }