Johnson преди 7 години
родител
ревизия
b9769d6d1e

+ 0 - 18
src/api/assignment.js

@@ -98,15 +98,6 @@ export const getCodeAssignmentByStu = codeId => {
   return request(`${ASSIGNMENT_MODULE}/student/code/${codeId}`);
 };
 
-/**
- * 学生查看单个代码作业下的项目信息列表
- * @param codeId
- * @returns {Promise<{data:ProjectSerializerType}>}
- */
-export const getProjectListByCode = codeId => {
-  return request(`${ASSIGNMENT_MODULE}/student/code/${codeId}/project`);
-};
-
 /**
  * 学生查看单个代码作业下的成绩
  * @param codeId
@@ -138,15 +129,6 @@ export const getUnsubmittedCodeGroupsList = codeId => {
   );
 };
 
-/**
- * 老师查看单个代码作业的成绩列表(所有组的)
- * @param codeId
- * @returns {Promise<{data:CodeResultSerializerType}>}
- */
-export const getCodeResultListByCode = codeId => {
-  return request(`${ASSIGNMENT_MODULE}/teacher/code/${codeId}/result`);
-};
-
 /* 文档作业*/
 /**
  * 老师新建文档作业

+ 9 - 3
src/components/AssignmentCRUD/CreateAssignment/index.vue

@@ -176,7 +176,7 @@ import { difficultyClass } from "@/data/questionDifficulty";
 export default {
   props: {
     courseId: {
-      type: Number
+      type: String
     },
     assignType: {
       type: Number
@@ -283,10 +283,16 @@ export default {
         this.parseParams();
         if (this.assignType === 1) {
           // 文档作业
-          this.myPromise = postDocAssignment(this.params, this.courseId);
+          this.myPromise = postDocAssignment(
+            this.params,
+            parseInt(this.courseId)
+          );
         } else {
           // 代码作业
-          this.myPromise = postCodeAssignment(this.params, this.courseId);
+          this.myPromise = postCodeAssignment(
+            this.params,
+            parseInt(this.courseId)
+          );
         }
         this.myPromise.then(res => {
           //创建成功

+ 2 - 13
src/components/AssignmentCRUD/DeleteAssignment/index.vue

@@ -1,9 +1,5 @@
 <template>
-  <div>
-    <a style="color:#b34141" @click="confirmDelete(this)" disabled="true"
-      >删除</a
-    >
-  </div>
+  <div><a style="color:#827b7b">删除</a></div>
 </template>
 
 <script>
@@ -26,14 +22,7 @@ export default {
     };
   },
   methods: {
-    confirmDelete(obj) {
-      if (obj.disabled) {
-        return false;
-      } else {
-        this.doDelete();
-      }
-    },
-    doDelete() {
+    confirmDelete() {
       if (this.submitting) return;
       this.submitting = true;
       this.$dialog.confirm({

+ 3 - 18
src/components/AssignmentCRUD/UpdateAssignment/index.vue

@@ -27,26 +27,11 @@
               v-model="$v.params.description.$model"
             ></b-input>
           </b-field>
-          <!--<b-field-->
-          <!--label="开始时间"-->
-          <!--:type="$v.params.startAt.$error ? 'is-danger' : ''"-->
-          <!--:message="$v.params.startAt.$error ? '请填写作业开始时间' : ''"-->
-          <!--&gt;-->
-          <!--<flat-pickr-->
-          <!--placeholder="Click to select..."-->
-          <!--class="input"-->
-          <!--v-model="$v.params.startAt.$model"-->
-          <!--:config="startAtConfig"-->
-          <!--&gt;</flat-pickr>-->
-          <!--</b-field>          -->
           <b-field label="开始时间">
-            <button
-              class="button is-fullwidth"
+            <b-input
               disabled
-              style="text-align: left"
-            >
-              {{ displayUnixTime(params.startAt) }}
-            </button>
+              :value="displayUnixTime(params.startAt)"
+            ></b-input>
           </b-field>
           <b-field
             label="结束时间"

+ 2 - 2
vue.config.js

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