process.vue 3.8 KB

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