chatBIReport.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="chatBIReport" :style="{ height: openMessageflag ? '' : '200px' }">
  3. <div class="header">
  4. <div class="reporter">{{ title }}</div>
  5. <div class="commitTime">
  6. <div class="label">提交时间:</div>
  7. <div class="value">{{ commitTime }}</div>
  8. </div>
  9. </div>
  10. <div class="tab">智能洞察<img :src="require('@/assets/dongcha.png')" /></div>
  11. <div class="content" v-if="reportAnalysisData">
  12. <p class="message" v-html="reportAnalysisData"></p>
  13. <div class="foldBtn">
  14. <img
  15. :class="[openMessageflag ? 'openMessage-img' : '']"
  16. :src="require('@/assets/foldBtn.png')"
  17. @click="openMessageflag = !openMessageflag" />
  18. </div>
  19. </div>
  20. <div class="mask" v-if="!reportAnalysisData">
  21. <van-loading type="spinner" color="#1989fa" />
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import { reportAnalysis } from '@/api/week';
  27. export default {
  28. props: {
  29. title: {
  30. type: String,
  31. default: '',
  32. },
  33. commitTime: {
  34. type: String,
  35. default: '',
  36. },
  37. reportId: {
  38. type: String,
  39. default: '',
  40. },
  41. },
  42. data() {
  43. return {
  44. openMessageflag: false,
  45. reportAnalysisData: null,
  46. };
  47. },
  48. created() {
  49. this.getReportAnalysis();
  50. },
  51. methods: {
  52. getReportAnalysis() {
  53. reportAnalysis({ reportId: this.reportId })
  54. .then((res) => {
  55. if (res.code == 200) {
  56. this.reportAnalysisData = res.msg || '';
  57. } else {
  58. this.$toast(response.msg);
  59. }
  60. })
  61. .catch((error) => {
  62. this.toastLoading().clear();
  63. this.$toast(error.msg);
  64. });
  65. },
  66. },
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .chatBIReport {
  71. margin: 10px;
  72. overflow-y: auto;
  73. position: relative;
  74. .header {
  75. background-color: #fff;
  76. padding: 10px 16px;
  77. font-size: 16px;
  78. margin-bottom: 10px;
  79. }
  80. .commitTime {
  81. display: flex;
  82. align-items: center;
  83. margin-top: 10px;
  84. }
  85. .tab {
  86. background-color: #fff;
  87. font-size: 18px;
  88. padding: 10px 16px;
  89. display: flex;
  90. align-items: center;
  91. color: #0057ba;
  92. border-bottom: 1px solid #999;
  93. img {
  94. width: 20px;
  95. margin-left: 5px;
  96. }
  97. }
  98. .content {
  99. background-color: #fff;
  100. .message {
  101. padding: 10px 16px;
  102. font-size: 16px;
  103. white-space: pre-wrap;
  104. line-height: 24px;
  105. background-color: #fff;
  106. margin-top: 0;
  107. }
  108. .foldBtn {
  109. position: sticky;
  110. bottom: 0px;
  111. text-align: right;
  112. margin-right: 10px;
  113. img {
  114. width: 25px;
  115. transform: rotate(180deg);
  116. }
  117. .openMessage-img {
  118. transform: rotate(0deg);
  119. }
  120. }
  121. }
  122. .mask {
  123. position: absolute;
  124. width: 100%;
  125. height: 100%;
  126. top: 0;
  127. background: rgba(255, 255, 255, 0.8);
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. }
  132. }
  133. </style>