FlowTimeLine.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <el-card class="box-card" shadow="hover">
  3. <template #header>
  4. <div class="card-header">
  5. <span>流程信息</span>
  6. </div>
  7. </template>
  8. <el-timeline v-if="historicTaskMap.size">
  9. <el-timeline-item
  10. color="#3f9eff"
  11. :key="index"
  12. v-for="(arra, index) in historicTaskMap"
  13. :timestamp="
  14. moment(arra[1][0].histIns.endTime).format('YYYY-MM-DD')
  15. "
  16. placement="top"
  17. >
  18. <el-card class="flow">
  19. <h4>{{ arra[1][0].histIns.activityName }}</h4>
  20. <el-row :gutter="25">
  21. <el-col
  22. :key="index"
  23. v-for="(act, index) in arra[1]"
  24. class="tip"
  25. style="margin-left: 10px"
  26. :span="11"
  27. >
  28. <div class="item">
  29. <span class="label">审批人 : </span>
  30. <span class="value">{{
  31. act.assigneeName
  32. }}</span>
  33. </div>
  34. <div class="item">
  35. <span class="label">办理状态 : </span>
  36. <span class="value">
  37. <el-tag :type="act.comment.level === 'primary' ? '' : act.comment.level"
  38. >{{ act.comment.status }}
  39. </el-tag>
  40. </span>
  41. </div>
  42. <div class="item">
  43. <span class="label">审批意见 : </span>
  44. <el-tooltip
  45. effect="dark"
  46. :content="act.comment.message"
  47. placement="top-start"
  48. >
  49. <span class="value">
  50. {{ act.comment.message }}
  51. </span>
  52. </el-tooltip>
  53. </div>
  54. <div class="item">
  55. <span class="label">开始时间 : </span>
  56. <span class="value">
  57. {{ act.histIns.startTime }}
  58. </span>
  59. </div>
  60. <div class="item">
  61. <span class="label">结束时间 : </span>
  62. <span class="value">
  63. {{ act.histIns.endTime }}
  64. </span>
  65. </div>
  66. <div class="item">
  67. <span class="label">用时 : </span>
  68. <span class="value">{{
  69. act.durationTime || "0秒"
  70. }}</span>
  71. </div>
  72. </el-col>
  73. </el-row>
  74. </el-card>
  75. </el-timeline-item>
  76. </el-timeline>
  77. </el-card>
  78. </template>
  79. <script>
  80. export default {
  81. props: {
  82. historicTaskList: {
  83. type: Array,
  84. default: function () {
  85. return [];
  86. },
  87. },
  88. },
  89. computed: {
  90. historicTaskMap() {
  91. let map = new Map();
  92. let list = this.historicTaskList;
  93. for (var index = list.length - 1; index >= 0; index--) {
  94. let act = list[index];
  95. let key = act.histIns.activityId + act.histIns.startTime;
  96. let val = map.get(key);
  97. if (val) {
  98. val.push(act);
  99. } else {
  100. var array = [];
  101. array.push(act);
  102. map.set(key, array);
  103. }
  104. }
  105. return map;
  106. // this.historicTaskMap = map
  107. },
  108. },
  109. // created () {
  110. // console.log(this.historicTaskMap)
  111. // }
  112. };
  113. </script>
  114. <style lang="scss">
  115. .flow {
  116. .item {
  117. height: 32px;
  118. line-height: 32px;
  119. margin-bottom: 8px;
  120. .label {
  121. display: inline-block;
  122. height: 100%;
  123. width: 70px;
  124. font-size: 14px;
  125. color: #5e6d82;
  126. text-align: end;
  127. vertical-align: top;
  128. &::after {
  129. display: inline-block;
  130. width: 100%;
  131. content: "";
  132. height: 0;
  133. }
  134. }
  135. .value {
  136. padding-left: 10px;
  137. font-size: 14px;
  138. max-width: calc(100% - 90px);
  139. color: #5e6d82;
  140. display: inline-block;
  141. overflow: hidden;
  142. white-space: nowrap;
  143. text-overflow: ellipsis;
  144. }
  145. }
  146. }
  147. </style>