x-steps.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <!-- 获取一个数组,结构为
  3. [{
  4. nodeName:"流程发起"
  5. isAudit:false
  6. time:"2024-02-04 14:27:35"
  7. otherData:{
  8. assignee:{
  9. userId:"465"
  10. name:"XXX"
  11. company:"测试产业单位1"
  12. tenantId:"140"
  13. }
  14. }] -->
  15. <view class="bg">
  16. <view class="steps">
  17. <view class="steps_item" v-for="(i, index) in infoList" :key="index">
  18. <view class="s_r">
  19. <view class="line" :style="{ backgroundColor: index != 0 ? '#EAEAEA' : 'rgba(0,0,0,0)' }"></view>
  20. <view class="index" :style="{ backgroundColor: backgroundColor, color: color }"></view>
  21. <view class="line"
  22. :style="{ backgroundColor: index != infoList.length - 1 ? '#EAEAEA' : 'rgba(0,0,0,0)' }"></view>
  23. </view>
  24. <view class="s_l">
  25. <view class="info_item">
  26. <!-- 真是节点名称、时间 -->
  27. <view class="top_info">
  28. <view class="title">{{ i.text }}</view>
  29. <view class="date">{{ i.createdAt || '测试产业单位'}}</view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'XSteps',
  40. props: {
  41. infoList: {
  42. type: Array,
  43. default: [],
  44. },
  45. color: {
  46. type: String,
  47. default: '#fff',
  48. },
  49. backgroundColor: {
  50. type: String,
  51. default: '#2979ff',
  52. },
  53. lineNum: {
  54. type: Number,
  55. default: 0,
  56. },
  57. },
  58. methods: {
  59. // 审核状态
  60. auditStatus(i) {
  61. if (i == 2) {
  62. return {
  63. text: '通过',
  64. color: '#00D288',
  65. bgColor: '#EAFFF8',
  66. }
  67. } else if (i == 3) {
  68. return {
  69. text: '驳回',
  70. color: '#FF4141',
  71. bgColor: '#FFDCD5',
  72. }
  73. }
  74. },
  75. handlePreview(url) {
  76. uni.previewImage({
  77. urls: [url]
  78. })
  79. },
  80. },
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .steps {
  85. display: flex;
  86. flex-direction: column;
  87. .steps_item {
  88. display: flex;
  89. .s_r {
  90. padding: 0 20rpx;
  91. display: flex;
  92. flex-direction: column;
  93. align-items: center;
  94. .line {
  95. flex: 1;
  96. width: 5rpx;
  97. }
  98. .index {
  99. width: 24rpx;
  100. height: 24rpx;
  101. border-radius: 50rpx;
  102. border: 4rpx solid #e3eeff;
  103. box-sizing: border-box;
  104. }
  105. }
  106. .s_l {
  107. display: flex;
  108. flex-direction: column;
  109. padding: 20rpx 0;
  110. flex: 1;
  111. .info_item {
  112. background-color: #ffffff;
  113. margin-right: 30rpx;
  114. border-radius: 10rpx;
  115. display: flex;
  116. flex-direction: column;
  117. justify-content: center;
  118. .top_info {
  119. display: flex;
  120. flex-direction: column;
  121. }
  122. text {
  123. font-size: 24rpx;
  124. font-weight: 500;
  125. color: rgba(51, 51, 51, 1);
  126. }
  127. .title {
  128. width: 100%;
  129. font-size: 28rpx;
  130. font-weight: 500;
  131. color: rgba(102, 102, 102, 1);
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. display: -webkit-box;
  135. flex-direction: column;
  136. }
  137. .date {
  138. font-size: 23rpx;
  139. color: #afb4be;
  140. }
  141. }
  142. .info_item:active {
  143. background-color: #f4f4f4;
  144. }
  145. }
  146. }
  147. }
  148. .ml5 {
  149. margin-left: 10rpx;
  150. }
  151. .mt10 {
  152. margin-top: 20rpx;
  153. }
  154. </style>