Forráskód Böngészése

在dev上修改了一些

Johnson 7 éve
szülő
commit
bf89b2d788

+ 1 - 1
mock/modules/assignment/index.js

@@ -43,7 +43,7 @@ router.route("/teacher/course/:courseId/code").get((req, res) => {
 });
 
 //老师查看单个代码作业
-router.route("/teacher/:codeId").get((req, res) => {
+router.route("/teacher/code/:codeId").get((req, res) => {
   res.send({
     code: 0,
     data: CodeSerializer()

+ 1 - 1
src/api/assignment.js

@@ -77,7 +77,7 @@ export const getCodeAssignmentListByTeacher = courseId => {
  * @returns {Promise<{data:CodeSerializerType}>}
  */
 export const getCodeAssignmentByTeacher = codeId => {
-  return request(`${ASSIGNMENT_MODULE}/teacher/${codeId}`);
+  return request(`${ASSIGNMENT_MODULE}/teacher/code/${codeId}`);
 };
 
 /**

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

@@ -176,7 +176,7 @@ import { difficultyClass } from "@/data/questionDifficulty";
 export default {
   props: {
     courseId: {
-      type: String
+      type: Number
     },
     assignType: {
       type: Number
@@ -206,9 +206,12 @@ export default {
       problemName: "",
       searchContent: "",
       questions: [],
+
+      // 控制modal活动
       isCreateModalActive: false,
       isSearchModalActive: false,
       isProblemListModalActive: false,
+
       startAtConfig: {
         ...this.getDefaultConfig(),
         minDate: "today",
@@ -222,6 +225,7 @@ export default {
       errorMassage: null,
       isServerError: false,
       submitting: false,
+
       // 转圈圈
       loadingSearchQuestions: false,
       loadingCreateAssignment: false
@@ -279,16 +283,10 @@ export default {
         this.parseParams();
         if (this.assignType === 1) {
           // 文档作业
-          this.myPromise = postDocAssignment(
-            this.params,
-            parseInt(this.courseId)
-          );
+          this.myPromise = postDocAssignment(this.params, this.courseId);
         } else {
           // 代码作业
-          this.myPromise = postCodeAssignment(
-            this.params,
-            parseInt(this.courseId)
-          );
+          this.myPromise = postCodeAssignment(this.params, this.courseId);
         }
         this.myPromise.then(res => {
           //创建成功

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

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

+ 22 - 11
src/components/AssignmentCRUD/UpdateAssignment/index.vue

@@ -27,17 +27,26 @@
               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 ? '请填写作业开始时间' : ''"
-          >
-            <flat-pickr
-              placeholder="Click to select..."
-              class="input"
-              v-model="$v.params.startAt.$model"
-              :config="startAtConfig"
-            ></flat-pickr>
+          <!--<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"
+              disabled
+              style="text-align: left"
+            >
+              {{ displayUnixTime(params.startAt) }}
+            </button>
           </b-field>
           <b-field
             label="结束时间"
@@ -69,7 +78,9 @@ import timeMixins from "@/mixins/time";
 import { putDocAssignment } from "@/api/assignment";
 import { putCodeAssignment } from "@/api/assignment";
 import { required } from "vuelidate/lib/validators";
+import BInput from "buefy/src/components/input/Input";
 export default {
+  components: { BInput },
   props: {
     updateItem: {
       type: Object

+ 1 - 18
src/views/teacher/Code/detail.vue

@@ -132,7 +132,7 @@
                 <b-table-column label="小组名称" centered>
                   {{ props.row.name }}
                 </b-table-column>
-                <b-table-column label="小组a成员" centered>
+                <b-table-column label="小组成员" centered>
                   <span v-for="member in props.row.members" :key="member.id"
                     >{{ member.username }}&emsp;</span
                   >
@@ -223,23 +223,6 @@ export default {
         showTag = tag.success;
       }
       return showTag;
-    },
-    geneTitleAndTag(state) {
-      let data = {
-        title: "",
-        tag: ""
-      };
-      if (state === -1) {
-        data.title = status.failed;
-        data.tag = tag.failed;
-      } else if (state === 0) {
-        data.title = status.uncommitted;
-        data.tag = tag.uncommitted;
-      } else {
-        data.title = status.success;
-        data.tag = tag.success;
-      }
-      return data;
     }
   }
 };

+ 4 - 8
src/views/teacher/Document/detail.vue

@@ -8,10 +8,10 @@
       ]"
     >
       <template slot="title">
-        {{ problem.name }}
+        {{ problem ? problem.name : "" }}
       </template>
       <template slot="content">
-        题目描述:{{ problem.description }}
+        题目描述:{{ problem ? problem.description : "" }}
       </template>
       <template slot="extraContent">
         题目进行阶段:{{ status }}
@@ -138,7 +138,7 @@ export default {
     PageSectionLoading
   },
   mounted() {
-    const { documentId } = this.$route.query;
+    const { documentId } = this.$route.params;
     this.loadingCommittedGroups = true;
     this.loadingUncommittedGroups = true;
     getDocAssignmentTeacherByCrs(documentId).then(res => {
@@ -158,11 +158,7 @@ export default {
   },
   data() {
     return {
-      problem: {
-        id: null,
-        name: null,
-        description: null
-      },
+      problem: null,
       submittedData: [],
       unsubmitedGroups: [],
       status: "",

+ 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://10.1.2.3:8080/",
         ws: true,
         changeOrigin: true
       }