log-item.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="log-item">
  3. <!-- eslint-disable-next-line -->
  4. <view class="address" v-if="logData.content.address">{{ logData.content.address }}</view>
  5. <view class="content">
  6. {{ logData.content.content || '' }}
  7. </view>
  8. <wk-image-content
  9. v-if="logData.img && logData.img.length > 0"
  10. :preview="preview"
  11. :list="logData.img" />
  12. <wk-file-content
  13. v-if="logData.file && logData.file.length > 0"
  14. :list="logData.file" />
  15. <relevance-section
  16. v-if="showRelevance"
  17. class="relevance-section"
  18. :relevance-data="relevanceData" />
  19. <view
  20. v-if="logData.nextTime"
  21. class="desc-info">
  22. <text class="wk wk-time" />下次跟进时间:{{ logData.nextTime }}
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import RelevanceSection from './relevance-section'
  28. export default {
  29. name: 'LogItem',
  30. components: {
  31. RelevanceSection
  32. },
  33. props: {
  34. logData: {
  35. type: Object,
  36. required: true
  37. },
  38. preview: {
  39. type: Boolean,
  40. default: true
  41. }
  42. },
  43. computed: {
  44. relevanceData() {
  45. return {
  46. customerList: this.logData.customerList || [],
  47. contactsList: this.logData.contactsList || [],
  48. businessList: this.logData.businessList || [],
  49. contractList: this.logData.contractList || [],
  50. }
  51. },
  52. showRelevance() {
  53. const arr = ['contactsList', 'businessList', 'customerList', 'contractList']
  54. for (let i = 0; i < arr.length; i++) {
  55. let key = arr[i]
  56. if (this.logData.hasOwnProperty(key) && !this.$isEmpty(this.logData[key])) return true
  57. }
  58. return false
  59. }
  60. },
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .log-item {
  65. .address {
  66. white-space: pre-wrap;
  67. word-wrap: break-word;
  68. color: $theme-color;
  69. }
  70. .content {
  71. white-space: pre-wrap;
  72. word-wrap: break-word;
  73. }
  74. }
  75. .desc-info {
  76. font-size: 24rpx;
  77. color: $gray;
  78. margin-top: 10rpx;
  79. .wk {
  80. color: inherit;
  81. font-size: inherit;
  82. margin-right: 10rpx;
  83. }
  84. }
  85. .relevance-section {
  86. margin-bottom: 20rpx;
  87. ::v-deep .relevance-box-icon {
  88. height: 60rpx;
  89. }
  90. ::v-deep .content-item {
  91. height: 60rpx;
  92. }
  93. }
  94. </style>