Commit1.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div class="container">
  3. <div class="row-item">
  4. <div>
  5. <el-select v-model="branch" clearable placeholder="请选择分支">
  6. <el-option
  7. v-for="branch in branches"
  8. :key="branch.value"
  9. :label="branch.label"
  10. :value="branch.value"
  11. ></el-option>
  12. </el-select>
  13. </div>
  14. <div class="title" v-if="branch !== ''">
  15. <h4>当前所选分支:</h4>
  16. <h3>{{branch}}</h3>
  17. </div>
  18. </div>
  19. <div class="body">
  20. <el-row>
  21. <el-col :span="12">
  22. <el-timeline>
  23. <el-timeline-item
  24. v-for="(git, index) in gits"
  25. :key="index"
  26. :timestamp="git.timestamp"
  27. >
  28. <div class="card">
  29. <div class="user left-5 top-5">{{git.user}}</div>
  30. <div class="id left-5 top-5">{{git.id}}</div>
  31. <div class="content left-5 top-5">{{git.content}}</div>
  32. </div>
  33. </el-timeline-item>
  34. </el-timeline>
  35. </el-col>
  36. <el-col :span="11" :offset="1">具体的git记录</el-col>
  37. </el-row>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. name: 'Commit1.vue',
  44. data() {
  45. return {
  46. branches: [
  47. {
  48. value: 'master',
  49. label: 'master',
  50. },
  51. {
  52. value: 'dev',
  53. label: 'dev',
  54. },
  55. {
  56. value: 'zxr',
  57. label: 'zxr',
  58. },
  59. {
  60. value: 'wph',
  61. label: 'wph',
  62. },
  63. ],
  64. branch: '',
  65. gits: [
  66. {
  67. user: 'ZhaoXR',
  68. timestamp: '2018-04-12 20:46',
  69. content: '!1 mytest',
  70. id: '95d6c7eeef26229959ac9a8b839fa22d3adb09e2',
  71. },
  72. {
  73. user: 'ZhaoXR',
  74. timestamp: '2018-04-12 20:46',
  75. content: '!1 mytest',
  76. id: '95d6c7eeef26229959ac9a8b839fa22d3adb09e2',
  77. },
  78. {
  79. user: 'ZhaoXR',
  80. timestamp: '2018-04-12 20:46',
  81. content: '!1 mytest',
  82. id: '95d6c7eeef26229959ac9a8b839fa22d3adb09e2',
  83. },
  84. {
  85. user: 'ZhaoXR',
  86. timestamp: '2018-04-12 20:46',
  87. content: '!1 mytest',
  88. id: '95d6c7eeef26229959ac9a8b839fa22d3adb09e2',
  89. },
  90. ],
  91. };
  92. },
  93. };
  94. </script>
  95. <style scoped lang="scss">
  96. .container {
  97. margin: 50px 100px;
  98. width: 70%;
  99. }
  100. .row-item {
  101. display: flex;
  102. flex-direction: row;
  103. align-items: center;
  104. }
  105. .title {
  106. display: flex;
  107. float: left;
  108. height: 40px;
  109. line-height: 40px;
  110. margin-left: 20px;
  111. }
  112. .body {
  113. margin-top: 30px;
  114. }
  115. ::v-deep .el-timeline {
  116. padding-left: 130px;
  117. .el-timeline-item {
  118. .el-timeline-item__tail {
  119. border-left: 2px solid #1296db;
  120. }
  121. .el-timeline-item__node {
  122. background-color: #1296db;
  123. }
  124. }
  125. .el-timeline-item__timestamp.is-bottom {
  126. position: absolute;
  127. left: -117px;
  128. top: -5px;
  129. color: #333333;
  130. }
  131. }
  132. .card {
  133. border: 1px solid black;
  134. border-radius: 4px;
  135. }
  136. .left-5 {
  137. margin-left: 5px;
  138. }
  139. .top-5 {
  140. margin-top: 5px;
  141. }
  142. .user {
  143. font-size: 16px;
  144. font-weight: bold;
  145. }
  146. .id {
  147. color: #666666;
  148. font: 14px Monaco, monospace;
  149. }
  150. .content {
  151. color: black;
  152. font: 14px Monaco, monospace;
  153. }
  154. </style>