zhaoxingrui 5 lat temu
rodzic
commit
5d46ca6913
1 zmienionych plików z 28 dodań i 25 usunięć
  1. 28 25
      src/views/Project/Commit.vue

+ 28 - 25
src/views/Project/Commit.vue

@@ -4,31 +4,34 @@
       <h2>commit记录</h2>
     </el-row>
     <div>
-      <ElTimeline>
-        <ElTimelineItem
-          v-for="(git, index) in gits"
-          :key="index"
-          :timestamp="git.timestamp"
-          placement="top"
-          :color="git.relatedType === 'bug_id' ? 'chocolate' : '#42b983'"
-          size="large">
-          <ElCard>
-            <h3 class="id">#{{git.id}}</h3>
-            <div style="margin-top: 10px; font-size: 16px">{{git.message}}</div>
-            <div style="margin-top: 10px">
-              <el-row>
-                <el-col :span="12">
-                  处理人:<span style="font-weight: bold">{{git.gitlabUsername}}</span>
-                </el-col>
-                <el-col :span="12">
-                  类型:
-                  <span v-if="git.relatedType === 'bug_id'" class="node bug">缺陷</span>
-                  <span v-else class="node requirement">需求</span></el-col>
-              </el-row>
-            </div>
-          </ElCard>
-        </ElTimelineItem>
-      </ElTimeline>
+      <div v-if="gits.length === 0">暂无commit记录!</div>
+      <div v-else>
+        <ElTimeline>
+          <ElTimelineItem
+            v-for="(git, index) in gits"
+            :key="index"
+            :timestamp="git.timestamp"
+            placement="top"
+            :color="git.relatedType === 'bug_id' ? 'chocolate' : '#42b983'"
+            size="large">
+            <ElCard>
+              <h3 class="id">#{{git.id}}</h3>
+              <div style="margin-top: 10px; font-size: 16px">{{git.message}}</div>
+              <div style="margin-top: 10px">
+                <el-row>
+                  <el-col :span="12">
+                    处理人:<span style="font-weight: bold">{{git.gitlabUsername}}</span>
+                  </el-col>
+                  <el-col :span="12">
+                    类型:
+                    <span v-if="git.relatedType === 'bug_id'" class="node bug">缺陷</span>
+                    <span v-else class="node requirement">需求</span></el-col>
+                </el-row>
+              </div>
+            </ElCard>
+          </ElTimelineItem>
+        </ElTimeline>
+      </div>
     </div>
   </div>
 </template>