process.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. </style>