process.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="process-list">
  3. <view class="process-box">
  4. <view class="process-item" v-for="(item,index) in list" :key="index">
  5. <view class="user-avatar-box">
  6. <view class="user-avatar">{{index+1}}</view>
  7. <view :class="'user-avatar-status '+ returnStatus(item.status).className">
  8. <uni-icons :type="returnStatus(item.status).icon" size="10" color="#fff"></uni-icons>
  9. </view>
  10. </view>
  11. <view class="process-content">
  12. <view class="user-name">
  13. <view class="name">{{item.operatorName}}</view>
  14. <view v-if="item.status" class="date"><text>{{item.date}}</text></view>
  15. </view>
  16. <view class="user-content" v-if="item.remark">
  17. <view class="remark">
  18. {{item.remark}}
  19. </view>
  20. <view class="remark-file" v-if="item.attachment && item.attachment != '[]'">
  21. <upload :list="item.attachment ? JSON.parse(item.attachment) : []" type="preview"></upload>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="user-line" v-if="index < list.length-1"></view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import upload from '@/components/common/upload'
  32. export default {
  33. props: ['process'],
  34. data() {
  35. return {
  36. list: [],
  37. visible: false
  38. }
  39. },
  40. created() {
  41. this.list = this.process;
  42. },
  43. methods: {
  44. returnStatus(state) {
  45. let className = '',
  46. icon = '';
  47. switch (state) {
  48. case 0:
  49. className = 'info';
  50. icon = 'link';
  51. break;
  52. case 1:
  53. className = 'success'
  54. icon = 'checkmarkempty';
  55. break;
  56. case 2:
  57. className = 'failed'
  58. icon = 'closeempty';
  59. break;
  60. default:
  61. className = 'info'
  62. icon = 'link';
  63. break;
  64. }
  65. return {
  66. className: className,
  67. icon: icon
  68. };
  69. }
  70. },
  71. watch: {
  72. process() {
  73. this.list = this.process;
  74. }
  75. },
  76. components: {
  77. upload
  78. },
  79. }
  80. </script>
  81. <style lang="scss">
  82. .process-list {
  83. padding-top: 20rpx;
  84. .process-item {
  85. position: relative;
  86. display: flex;
  87. .user-avatar-box {
  88. position: relative;
  89. .user-avatar {
  90. width: 64rpx;
  91. height: 64rpx;
  92. background: $uni-primary;
  93. border-radius: 50%;
  94. margin-right: 20rpx;
  95. margin-top: 16rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. overprocess: hidden;
  100. color: #fff;
  101. }
  102. .user-avatar-status {
  103. width: 28rpx;
  104. height: 28rpx;
  105. border-radius: 50%;
  106. border: 2rpx solid #fff;
  107. position: absolute;
  108. top: 60rpx;
  109. right: 20rpx;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. }
  114. .user-avatar-status.success {
  115. background: $uni-success;
  116. }
  117. .user-avatar-status.failed {
  118. background: $uni-error;
  119. }
  120. .user-avatar-status.waiting {
  121. background: $uni-warning;
  122. }
  123. .user-avatar-status.info {
  124. background: $uni-info;
  125. }
  126. }
  127. .process-content {
  128. flex: 1;
  129. width: 0;
  130. .user-name {
  131. height: 96rpx;
  132. display: flex;
  133. flex-direction: column;
  134. justify-content: center;
  135. .name {
  136. font-size: 32rpx;
  137. font-weight: 600;
  138. }
  139. .date {
  140. font-size: 24rpx;
  141. color: $uni-secondary-color;
  142. display: flex;
  143. align-items: center;
  144. justify-content: space-between;
  145. }
  146. }
  147. .user-content {
  148. background-color: #f5f5f5;
  149. border-radius: 16rpx;
  150. padding: 20rpx 20rpx 10rpx 20rpx;
  151. .remark {
  152. line-height: 17px;
  153. font-weight: 400;
  154. padding-bottom: 10rpx;
  155. }
  156. }
  157. }
  158. .user-line {
  159. width: 1px;
  160. border-left: 1px solid $uni-border-4;
  161. position: absolute;
  162. top: 80rpx;
  163. bottom: -16rpx;
  164. left: 30rpx;
  165. }
  166. }
  167. }
  168. </style>