Explorar el Código

[修改]build页面

soleil hace 7 años
padre
commit
fc1cd4c762

+ 43 - 3
src/views/student/Code/ProjectDetail/BuildDetail.vue

@@ -3,7 +3,7 @@
     <div v-if="detailLoading"><page-section-loading show /></div>
     <div v-if="detailLoading"><page-section-loading show /></div>
     <div v-else>
     <div v-else>
       <div
       <div
-        v-for="item in projectDetail.buildList"
+        v-for="(item, index) in projectDetail.buildList"
         :key="item.id"
         :key="item.id"
         class="gap-section"
         class="gap-section"
       >
       >
@@ -15,12 +15,28 @@
                 {{ item.commitMessage }} · #构建ID:{{ item.id }}
                 {{ item.commitMessage }} · #构建ID:{{ item.id }}
               </strong>
               </strong>
             </div>
             </div>
+            <div class="level-right">
+              <strong>完成时间:{{ item.buildTime }}</strong>
+            </div>
+          </div>
+          <div class="level">
+            <div class="level-left">
+              <strong style="padding-left: 10px">
+                #branchID:{{ item.branchId }}
+              </strong>
+            </div>
             <div v-if="item.buildState === 1" class="level-right">
             <div v-if="item.buildState === 1" class="level-right">
               <strong>mirror : {{ item.mirrorId }}</strong>
               <strong>mirror : {{ item.mirrorId }}</strong>
             </div>
             </div>
           </div>
           </div>
-          <div class="code-section">
-            {{ item.buildMessage }} 构建时间: {{ item.time }}ms
+          <a
+            class="button is-info is-small"
+            @click="changeBuildMessageStatus(index)"
+            aria-controls="contentIdForA11y2"
+            >查看详细编译信息</a
+          >
+          <div class="code-section" v-show="buildMessageIsOpen[index]">
+            {{ item.buildMessage }}
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
@@ -43,6 +59,30 @@ export default {
       type: Boolean,
       type: Boolean,
       default: false
       default: false
     }
     }
+  },
+  computed: {},
+  watch: {
+    projectDetail: function(newVal) {
+      let buildMessageIsOpen = [];
+      for (let item of newVal.buildList) {
+        //处理buildTime格式
+        item.buildTime = item.buildTime.replace("T", " ") + "ms";
+        buildMessageIsOpen.push(false);
+      }
+      this.buildMessageIsOpen = buildMessageIsOpen;
+    }
+  },
+  data() {
+    return {
+      buildMessageIsOpen: []
+    };
+  },
+  mounted() {},
+  methods: {
+    changeBuildMessageStatus(index) {
+      let status = !this.buildMessageIsOpen[index];
+      this.buildMessageIsOpen.splice(index, 1, status);
+    }
   }
   }
 };
 };
 </script>
 </script>

+ 5 - 5
src/views/student/Code/ProjectDetail/DeployDetail.vue

@@ -43,7 +43,7 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { getDeployDetail } from "@/api/codehw";
+// import { getDeployDetail } from "@/api/codehw";
 
 
 export default {
 export default {
   data() {
   data() {
@@ -53,10 +53,10 @@ export default {
     };
     };
   },
   },
   mounted() {
   mounted() {
-    getDeployDetail(123).then(res => {
-      console.log(res.data);
-      this.deployInfo = res.data;
-    });
+    // getDeployDetail(123).then(res => {
+    //   console.log(res.data);
+    //   this.deployInfo = res.data;
+    // });
   }
   }
 };
 };
 </script>
 </script>