Commit.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <div class="container">
  3. <el-row class="row-item title">
  4. <h2>commit记录</h2>
  5. </el-row>
  6. <div>
  7. <ElTimeline>
  8. <ElTimelineItem
  9. v-for="(git, index) in gits"
  10. :key="index"
  11. :timestamp="git.timestamp"
  12. placement="top">
  13. <ElCard>
  14. <h3 class="id">#{{git.id}}</h3>
  15. <div style="margin-top: 10px; font-size: 16px">{{git.message}}</div>
  16. <div style="margin-top: 10px">
  17. <el-row>
  18. <el-col :span="12">
  19. 处理人:<span style="font-weight: bold">{{git.gitlabUsername}}</span>
  20. </el-col>
  21. <el-col :span="12">
  22. 类型:
  23. <span v-if="git.relatedType === 'BUG_ID'" class="node bug">缺陷</span>
  24. <span v-else class="node requirement">需求</span></el-col>
  25. </el-row>
  26. </div>
  27. </ElCard>
  28. </ElTimelineItem>
  29. </ElTimeline>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'Commit.vue',
  36. data() {
  37. return {
  38. gits: [
  39. {
  40. id: '010f2a0ccf522fe6c1408bffdd494782880c1ec9',
  41. message: 'fix: working on #942#, 处理bug942',
  42. timestamp: '2021-07-10 15:09:36',
  43. gitlabUsername: 'xiaofei',
  44. relatedType: 'BUG_ID',
  45. relatedId: 942,
  46. },
  47. {
  48. id: '030a88a98695d83bdd91937783c08323451d5046',
  49. message: 'feat: complete #878# ',
  50. timestamp: '2021-07-09 23:18:20',
  51. gitlabUsername: '17313',
  52. relatedType: 'TREE_ID',
  53. relatedId: 878,
  54. },
  55. {
  56. id: '07f536fc5d660d8085d360961ab4fd337df9b8f1',
  57. message: 'fix: fixing on #17#',
  58. timestamp: '2021-07-08 13:45:22',
  59. gitlabUsername: 'suyiiis',
  60. relatedType: 'BUG_ID',
  61. relatedId: 17,
  62. },
  63. {
  64. id: '0c75b8b675291c1f90a56e912befc38341ec3171',
  65. message: 'feat: complete #273#',
  66. timestamp: '2021-07-08 10:11:23',
  67. gitlabUsername: 'YGcatwhite',
  68. relatedType: 'TREE_ID',
  69. relatedId: 273,
  70. },
  71. ],
  72. };
  73. },
  74. };
  75. </script>
  76. <style scoped>
  77. .container {
  78. margin: 50px 100px;
  79. width: 30%;
  80. }
  81. .row-item {
  82. display: flex;
  83. flex-direction: row;
  84. align-items: center;
  85. margin-bottom: 10px;
  86. }
  87. .id {
  88. width: fit-content;
  89. height: 20px;
  90. background-color: #2185d0;
  91. color: #fff;
  92. border: 0 solid transparent;
  93. border-radius: .28571429rem;
  94. }
  95. .node {
  96. width: 15px;
  97. color: #FFFFFF;
  98. border-radius: 3px;
  99. font-size: 14px;
  100. text-align: center;
  101. }
  102. .bug {
  103. background-color: chocolate;
  104. }
  105. .requirement {
  106. background-color: #42b983;
  107. }
  108. </style>