Browse Source

增加部署状态:停止

靳炳淑 6 years ago
parent
commit
4001ad84fe
1 changed files with 21 additions and 27 deletions
  1. 21 27
      src/views/teacher/Code/detail.vue

+ 21 - 27
src/views/teacher/Code/detail.vue

@@ -7,12 +7,8 @@
         { name: '作业详情', path: `${$route.path}` }
       ]"
     >
-      <template slot="title">
-        {{ problemInfo.name }}
-      </template>
-      <template slot="content">
-        {{ problemInfo.description }}
-      </template>
+      <template slot="title">{{ problemInfo.name }}</template>
+      <template slot="content">{{ problemInfo.description }}</template>
     </page-header>
 
     <page-body>
@@ -34,9 +30,8 @@
                   numeric
                   sortable
                   centered
+                  >{{ props.row.group.id }}</b-table-column
                 >
-                  {{ props.row.group.id }}
-                </b-table-column>
                 <b-table-column label="构建" centered>
                   <span :class="geneTag(props.row.buildStatus.key)">
                     {{
@@ -52,22 +47,18 @@
                 <b-table-column label="生产环境部署" centered>
                   <span :class="geneTag(props.row.prodDeployStatus.key)">
                     {{
-                      props.row.prodDeployStatus.key === 0
-                        ? "未部署"
-                        : props.row.prodDeployStatus.key === -1
-                        ? "失败"
-                        : "成功"
+                      ["失败", "未部署", "成功", "停止"][
+                        props.row.prodDeployStatus.key + 1
+                      ]
                     }}
                   </span>
                 </b-table-column>
                 <b-table-column label="测试环境部署" centered>
                   <span :class="geneTag(props.row.testDeployStatus.key)">
                     {{
-                      props.row.testDeployStatus.key === 0
-                        ? "未部署"
-                        : props.row.testDeployStatus.key === -1
-                        ? "失败"
-                        : "成功"
+                      ["失败", "未部署", "成功", "停止"][
+                        props.row.prodDeployStatus.key + 1
+                      ]
                     }}
                   </span>
                 </b-table-column>
@@ -130,9 +121,8 @@
                         <small
                           v-for="member of props.row.group.members"
                           :key="member.id"
+                          >{{ member.username }}&emsp;</small
                         >
-                          {{ member.username }}&emsp;
-                        </small>
                       </p>
                     </div>
                   </div>
@@ -152,12 +142,11 @@
                   numeric
                   sortable
                   centered
+                  >{{ props.row.id }}</b-table-column
                 >
-                  {{ props.row.id }}
-                </b-table-column>
-                <b-table-column label="小组名称" centered>
-                  {{ props.row.name }}
-                </b-table-column>
+                <b-table-column label="小组名称" centered>{{
+                  props.row.name
+                }}</b-table-column>
                 <b-table-column label="小组成员" centered>
                   <span v-for="member in props.row.members" :key="member.id"
                     >{{ member.username }}&emsp;</span
@@ -184,13 +173,15 @@ import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
 const tag = {
   success: "tag is-success",
   failed: "tag is-danger",
-  uncommitted: "tag is-dark"
+  uncommitted: "tag is-dark",
+  stopped: "tag is-light"
 };
 
 const status = {
   uncommitted: "UNCOMMITTED",
   success: "SUCCESS",
-  failed: "FAILED"
+  failed: "FAILED",
+  stopped: "STOPPED"
 };
 
 export default {
@@ -211,6 +202,7 @@ export default {
       this.codeProcedureList = res.data;
       this.submitInfo.yes = "已提交:" + this.codeProcedureList.length;
       this.loadingCommittedGroups = false;
+      console.log("codeProcedureList", this.codeProcedureList);
     });
     getUnsubmittedCodeGroupsList(codeId).then(res => {
       this.unsubmitedGroups = res.data;
@@ -245,6 +237,8 @@ export default {
         showTag = tag.failed;
       } else if (state === 0) {
         showTag = tag.uncommitted;
+      } else if (state === 2) {
+        showTag = tag.stopped;
       } else {
         showTag = tag.success;
       }