소스 검색

与后端张怡接口调试通过

Johnson 7 년 전
부모
커밋
3829437db0

+ 4 - 2
src/api/assignment.js

@@ -264,6 +264,8 @@ export const getUnsubmittedDocGroupsByDocId = documentId => {
  * @param documentId
  * @param documentId
  * @return {Promise<data:DocumentContentSerializerType>}
  * @return {Promise<data:DocumentContentSerializerType>}
  */
  */
-export const getDocContentByDocId = documentId => {
-  return request(`${ASSIGNMENT_MODULE}/teacher/document/${documentId}/content`);
+export const getDocContentByDocId = documentResultId => {
+  return request(
+    `${ASSIGNMENT_MODULE}/teacher/document/result/${documentResultId}/content`
+  );
 };
 };

+ 6 - 4
src/components/AssignmentCRUD/CreateAssignment/index.vue

@@ -82,6 +82,7 @@
               placeholder="输入关键字模糊查找"
               placeholder="输入关键字模糊查找"
               type="search"
               type="search"
               v-model="$v.searchContent.$model"
               v-model="$v.searchContent.$model"
+              @keyup.enter.native="search(searchContent)"
               expanded
               expanded
             >
             >
             </b-input>
             </b-input>
@@ -221,6 +222,7 @@ export default {
       errorMassage: null,
       errorMassage: null,
       isServerError: false,
       isServerError: false,
       submitting: false,
       submitting: false,
+      // 转圈圈
       loadingSearchQuestions: false,
       loadingSearchQuestions: false,
       loadingCreateAssignment: false
       loadingCreateAssignment: false
     };
     };
@@ -289,16 +291,16 @@ export default {
           );
           );
         }
         }
         this.myPromise.then(res => {
         this.myPromise.then(res => {
+          //创建成功
+          this.isCreateModalActive = false;
           if (res.code === 0) {
           if (res.code === 0) {
-            //创建成功
-            this.$emit("sendCreatedAssignment", res.data);
-            this.isCreateModalActive = false;
-            this.loadingCreateAssignment = false;
             if (this.assignType === 1) {
             if (this.assignType === 1) {
               this.$router.push({
               this.$router.push({
                 path: `${this.prefix}/review?documentHwId=${res.data.id}`
                 path: `${this.prefix}/review?documentHwId=${res.data.id}`
               });
               });
             }
             }
+            this.$emit("sendCreatedAssignment", res.data);
+            this.loadingCreateAssignment = false;
           } else {
           } else {
             //创建失败
             //创建失败
             this.isCreateModalActive = false;
             this.isCreateModalActive = false;

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

@@ -1,12 +1,5 @@
 <template>
 <template>
-  <div>
-    <a
-      style="color:#b34141"
-      :class="{ 'is-loading': loadingDelAssignment }"
-      @click="confirmDelete()"
-      >删除</a
-    >
-  </div>
+  <div><a style="color:#b34141" @click="confirmDelete()">删除</a></div>
 </template>
 </template>
 
 
 <script>
 <script>
@@ -25,17 +18,15 @@ export default {
   data() {
   data() {
     return {
     return {
       myPromise: null,
       myPromise: null,
-      submitting: false,
-      loadingDelAssignment: false
+      submitting: false
     };
     };
   },
   },
   methods: {
   methods: {
     confirmDelete() {
     confirmDelete() {
       if (this.submitting) return;
       if (this.submitting) return;
-      this.loadingDelAssignment = true;
       this.submitting = true;
       this.submitting = true;
       this.$dialog.confirm({
       this.$dialog.confirm({
-        message: "确认删除?",
+        message: `确认删除?`,
         confirmText: "删除",
         confirmText: "删除",
         type: "is-danger",
         type: "is-danger",
         onConfirm: () => {
         onConfirm: () => {
@@ -56,7 +47,6 @@ export default {
                 hasIcon: true
                 hasIcon: true
               });
               });
             }
             }
-            this.loadingDelAssignment = false;
           });
           });
         }
         }
       });
       });

+ 2 - 0
src/components/AssignmentCRUD/UpdateAssignment/index.vue

@@ -119,6 +119,8 @@ export default {
       this.isUpdateModalActive = true;
       this.isUpdateModalActive = true;
       this.params.name = this.updateItem.name;
       this.params.name = this.updateItem.name;
       this.params.description = this.updateItem.description;
       this.params.description = this.updateItem.description;
+      this.params.startAt = this.updateItem.startAt;
+      this.params.endAt = this.updateItem.endAt;
     },
     },
     /**
     /**
      * 确认修改
      * 确认修改

+ 6 - 3
src/views/student/Document/detail.vue

@@ -28,7 +28,9 @@
               <div class="subtitle is-6" v-if="isAvailable">
               <div class="subtitle is-6" v-if="isAvailable">
                 {{ detail.problem ? detail.problem.name : "" }}
                 {{ detail.problem ? detail.problem.name : "" }}
               </div>
               </div>
-              <div class="subtitle is-6" v-else>题目开始进行才可查看</div>
+              <div class="subtitle is-6" v-else>
+                <s>题目开始进行才可查看</s>
+              </div>
             </div>
             </div>
             <div class="column">
             <div class="column">
               <h5 class="title is-5">状态:</h5>
               <h5 class="title is-5">状态:</h5>
@@ -110,8 +112,9 @@ export default {
     getDocResultById(this.assignmentInfo.id).then(res => {
     getDocResultById(this.assignmentInfo.id).then(res => {
       this.docResult = res.data;
       this.docResult = res.data;
       // 有成绩
       // 有成绩
-      if (parseInt(this.docResult.result) !== -1) {
-        this.loadingDocResult = true;
+      // 修改为String
+      if (this.docResult.result !== null) {
+        this.loadingDocResult = true; //不显示
       }
       }
     });
     });
   },
   },

+ 51 - 24
src/views/teacher/Code/detail.vue

@@ -38,39 +38,55 @@
                   {{ props.row.group.id }}
                   {{ props.row.group.id }}
                 </b-table-column>
                 </b-table-column>
                 <b-table-column label="构建" centered>
                 <b-table-column label="构建" centered>
-                  <span :class="geneTitleAndTag(props.row.buildStatus.key).tag">
-                    {{ geneTitleAndTag(props.row.buildStatus.key).title }}
+                  <span :class="geneTag(props.row.buildStatus.key)">
+                    {{
+                      props.row.buildStatus.key === 0
+                        ? "未构建"
+                        : props.row.buildStatus.key === -1
+                        ? "失败"
+                        : "成功"
+                    }}
                   </span>
                   </span>
                 </b-table-column>
                 </b-table-column>
 
 
                 <b-table-column label="部署" centered>
                 <b-table-column label="部署" centered>
-                  <span
-                    :class="geneTitleAndTag(props.row.deployStatus.key).tag"
-                  >
-                    {{ geneTitleAndTag(props.row.deployStatus.key).title }}
+                  <span :class="geneTag(props.row.deployStatus.key)">
+                    {{
+                      props.row.deployStatus.key === 0
+                        ? "未部署"
+                        : props.row.deployStatus.key === -1
+                        ? "失败"
+                        : "成功"
+                    }}
                   </span>
                   </span>
                 </b-table-column>
                 </b-table-column>
-                <b-table-column label="单元测试">
-                  <span
-                    :class="geneTitleAndTag(props.row.unitTestStatus.key).tag"
-                  >
-                    {{ props.row.unitTestStatus.passCount }}/{{
-                      props.row.unitTestStatus.testCount
+                <b-table-column label="单元测试" centered>
+                  <span :class="geneTag(props.row.unitTestStatus.key)">
+                    {{
+                      props.row.unitTestStatus.key === 0
+                        ? "未测试"
+                        : props.row.unitTestStatus.key === -1
+                        ? "构建失败"
+                        : props.row.unitTestStatus.passCount +
+                          "/" +
+                          props.row.unitTestStatus.testCount
                     }}
                     }}
                   </span>
                   </span>
                 </b-table-column>
                 </b-table-column>
-                <b-table-column label="功能测试">
-                  <span
-                    :class="
-                      geneTitleAndTag(props.row.functionTestStatus.key).tag
-                    "
-                  >
-                    {{ props.row.functionTestStatus.passCount }}/{{
-                      props.row.functionTestStatus.testCount
+                <b-table-column label="功能测试" centered>
+                  <span :class="geneTag(props.row.functionTestStatus.key)">
+                    {{
+                      props.row.functionTestStatus.key === 0
+                        ? "未测试"
+                        : props.row.functionTestStatus.key === -1
+                        ? "未知状态"
+                        : props.row.functionTestStatus.passCount +
+                          "/" +
+                          props.row.functionTestStatus.testCount
                     }}
                     }}
                   </span>
                   </span>
                 </b-table-column>
                 </b-table-column>
-                <b-table-column label="详情">
+                <b-table-column label="详情" centered>
                   <router-link
                   <router-link
                     :to="{
                     :to="{
                       path: `/course-teacher/:courseId/code/detail/test`,
                       path: `/course-teacher/:courseId/code/detail/test`,
@@ -117,7 +133,7 @@
                 <b-table-column label="小组名称" centered>
                 <b-table-column label="小组名称" centered>
                   {{ props.row.name }}
                   {{ props.row.name }}
                 </b-table-column>
                 </b-table-column>
-                <b-table-column label="小组成员" centered>
+                <b-table-column label="小组a成员" centered>
                   <span v-for="member in props.row.members" :key="member.id"
                   <span v-for="member in props.row.members" :key="member.id"
                     >{{ member.username }}&emsp;</span
                     >{{ member.username }}&emsp;</span
                   >
                   >
@@ -168,12 +184,12 @@ export default {
     this.loadingUncommittedGroups = true;
     this.loadingUncommittedGroups = true;
     this.loadingCommittedGroups = true;
     this.loadingCommittedGroups = true;
     this.assignmentInfo = this.$route.query.assignmentInfo;
     this.assignmentInfo = this.$route.query.assignmentInfo;
-    getCodeProcedureListByCodeId(123).then(res => {
+    getCodeProcedureListByCodeId(this.$route.params.codeId).then(res => {
       this.codeProcedureList = res.data;
       this.codeProcedureList = res.data;
       this.submitInfo.yes = "已提交:" + this.codeProcedureList.length;
       this.submitInfo.yes = "已提交:" + this.codeProcedureList.length;
       this.loadingCommittedGroups = false;
       this.loadingCommittedGroups = false;
     });
     });
-    getUnsubmittedCodeGroupsList(123).then(res => {
+    getUnsubmittedCodeGroupsList(this.$route.params.codeId).then(res => {
       this.unsubmitedGroups = res.data;
       this.unsubmitedGroups = res.data;
       this.submitInfo.no = "未提交:" + this.unsubmitedGroups.length;
       this.submitInfo.no = "未提交:" + this.unsubmitedGroups.length;
       this.loadingUncommittedGroups = false;
       this.loadingUncommittedGroups = false;
@@ -196,6 +212,17 @@ export default {
     };
     };
   },
   },
   methods: {
   methods: {
+    geneTag(state) {
+      let showTag = "";
+      if (state === -1) {
+        showTag = tag.failed;
+      } else if (state === 0) {
+        showTag = tag.uncommitted;
+      } else {
+        showTag = tag.success;
+      }
+      return showTag;
+    },
     geneTitleAndTag(state) {
     geneTitleAndTag(state) {
       let data = {
       let data = {
         title: "",
         title: "",

+ 1 - 1
src/views/teacher/Document/detail.vue

@@ -57,7 +57,7 @@
                   ><router-link
                   ><router-link
                     :to="{
                     :to="{
                       path: `${$route.path}/content`,
                       path: `${$route.path}/content`,
-                      query: { assignId: docId }
+                      query: { groupWorkId: props.row.id }
                     }"
                     }"
                     >查看详情</router-link
                     >查看详情</router-link
                   >
                   >

+ 4 - 4
src/views/teacher/Document/docContent.vue

@@ -6,7 +6,7 @@
         { name: '文档作业', path: 'document' },
         { name: '文档作业', path: 'document' },
         {
         {
           name: `作业详情`,
           name: `作业详情`,
-          path: `document/${docId}`
+          path: `document/${groupWorkId}`
         },
         },
         { name: `文档内容`, path: `${$route.path}` }
         { name: `文档内容`, path: `${$route.path}` }
       ]"
       ]"
@@ -57,7 +57,7 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      docId: null,
+      groupWorkId: null,
       contentResult: {
       contentResult: {
         content: "",
         content: "",
         group: "",
         group: "",
@@ -68,11 +68,11 @@ export default {
     };
     };
   },
   },
   created() {
   created() {
-    this.docId = this.$route.query.assignId;
+    this.groupWorkId = this.$route.query.groupWorkId;
   },
   },
   mounted() {
   mounted() {
     this.loadingDocContent = true;
     this.loadingDocContent = true;
-    getDocContentByDocId(this.docId).then(res => {
+    getDocContentByDocId(this.groupWorkId).then(res => {
       this.contentResult = res.data;
       this.contentResult = res.data;
       this.loadingDocContent = false;
       this.loadingDocContent = false;
     });
     });

+ 1 - 1
vue.config.js

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