Parcourir la source

Merge branch 'hotfix/bay' of SEEC-II-FrontEnd-Team/SEEC-II-FrontEnd into develop

WuXinyu il y a 7 ans
Parent
commit
c81bdb9a0e

+ 1 - 0
src/App.vue

@@ -7,5 +7,6 @@
 
 #app {
   background: $default-background;
+  word-wrap: break-word;
 }
 </style>

+ 7 - 2
src/components/AssignmentCRUD/CreateAssignment/index.vue

@@ -281,12 +281,17 @@ export default {
         this.submitting = true;
         this.params["type"] = this.postParam;
         this.parseParams();
+        const param = {
+          ...this.params,
+          startAt: parseInt(this.params.startAt),
+          endAt: parseInt(this.params.endAt)
+        };
         if (this.assignType === 1) {
           // 文档作业
-          this.myPromise = postDocAssignment(this.params, this.courseId);
+          this.myPromise = postDocAssignment(param, this.courseId);
         } else {
           // 代码作业
-          this.myPromise = postCodeAssignment(this.params, this.courseId);
+          this.myPromise = postCodeAssignment(param, this.courseId);
         }
         this.myPromise.then(res => {
           //创建成功

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

@@ -56,7 +56,8 @@ export default {
   },
   async mounted() {
     this.codeHomeworkListLoading = true;
-    const list = await getCodeAssignmentListByStu(this.$route.params.courseId);
+    const { courseId } = this.$route.params;
+    const list = await getCodeAssignmentListByStu(courseId);
     this.codeHomeworkList = list.data;
     this.codeHomeworkListLoading = false;
   }

+ 2 - 7
src/views/student/Document/index.vue

@@ -37,7 +37,6 @@
 </template>
 
 <script>
-import { mapState } from "vuex";
 import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
 import { getDocAssignmentListByCrs } from "@/api/assignment";
@@ -54,16 +53,12 @@ export default {
   mixins: [timeMixins],
   mounted() {
     this.loadingDocList = true;
-    getDocAssignmentListByCrs(this.course.id).then(res => {
+    const { courseId } = this.$route.params;
+    getDocAssignmentListByCrs(courseId).then(res => {
       this.docList = res.data;
       this.loadingDocList = false;
     });
   },
-  computed: {
-    ...mapState({
-      course: state => state.course.currentCourse
-    })
-  },
   data() {
     return {
       docList: [],

+ 2 - 7
src/views/student/Review/index.vue

@@ -35,7 +35,6 @@
 </template>
 
 <script>
-import { mapState } from "vuex";
 import { getStudentCourseReviewList } from "@/api/review";
 import Card from "@/components/Card";
 import PageHeader from "@/components/PageHeader";
@@ -48,11 +47,6 @@ export default {
     PageHeader,
     Card
   },
-  computed: {
-    ...mapState({
-      course: state => state.course.currentCourse
-    })
-  },
   data() {
     return {
       courses: [],
@@ -62,7 +56,8 @@ export default {
   },
   mounted() {
     this.loadingReviewList = true;
-    getStudentCourseReviewList(this.courses.id).then(value => {
+    const { courseId } = this.$route.params;
+    getStudentCourseReviewList(courseId).then(value => {
       this.review = value.data;
       this.loadingReviewList = false;
     });

+ 8 - 7
src/views/teacher/Code/index.vue

@@ -91,8 +91,8 @@
 import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
 import { getCodeAssignmentListByTeacher } from "@/api/assignment";
-import timeMixins from "@/mixins/time";
 import { mapState } from "vuex";
+import timeMixins from "@/mixins/time";
 import DeleteAssignment from "@/components/AssignmentCRUD/DeleteAssignment";
 import UpdateAssignment from "@/components/AssignmentCRUD/UpdateAssignment";
 import CreateAssignment from "@/components/AssignmentCRUD/CreateAssignment";
@@ -110,7 +110,8 @@ export default {
   mixins: [timeMixins],
   mounted() {
     this.loadingCodeList = true;
-    getCodeAssignmentListByTeacher(this.course.id).then(res => {
+    const { courseId } = this.$route.params;
+    getCodeAssignmentListByTeacher(courseId).then(res => {
       this.codeData = res.data;
       this.loadingCodeList = false;
     });
@@ -122,6 +123,11 @@ export default {
       loadingCodeList: false
     };
   },
+  computed: {
+    ...mapState({
+      course: state => state.course.currentCourse
+    })
+  },
   methods: {
     pushNewAssignment(item) {
       this.codeData.push(item);
@@ -144,11 +150,6 @@ export default {
         }
       }
     }
-  },
-  computed: {
-    ...mapState({
-      course: state => state.course.currentCourse
-    })
   }
 };
 </script>

+ 2 - 1
src/views/teacher/Document/index.vue

@@ -112,7 +112,8 @@ export default {
   mixins: [timeMixins],
   mounted() {
     this.loadingDocList = true;
-    getDocAssignmentListTeacherByCrs(this.course.id).then(res => {
+    const { courseId } = this.$route.params;
+    getDocAssignmentListTeacherByCrs(courseId).then(res => {
       this.docData = res.data;
       this.loadingDocList = false;
     });

+ 4 - 3
src/views/teacher/Review/index.vue

@@ -135,7 +135,7 @@ import Card from "@/components/Card";
 import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
 import ReviewStateTag from "@/components/ReviewStateTag/index";
-import { getDocAssignmentListByCrs } from "@/api/assignment";
+import { getDocAssignmentListTeacherByCrs } from "@/api/assignment";
 import timeMixins from "@/mixins/time";
 import { required } from "vuelidate/lib/validators";
 export default {
@@ -257,13 +257,14 @@ export default {
   },
   methods: {
     async getReviewList() {
-      const { data } = await getTeacherCourseReviewList(this.courses.id);
+      const { courseId } = this.$route.params;
+      const { data } = await getTeacherCourseReviewList(courseId);
       this.review = data;
     },
     async getDocHomework() {
       this.docHomeworkLoading = true;
       const { courseId } = this.$route.params;
-      const { data } = await getDocAssignmentListByCrs(courseId);
+      const { data } = await getDocAssignmentListTeacherByCrs(courseId);
       this.docHomework = data;
       this.docHomeworkLoading = false;
     },

+ 2 - 1
vue.config.js

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