index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!--
  2. * @Author: your name
  3. * @Date: 2025-01-13 14:15:47
  4. * @LastEditTime: 2025-03-14 20:22:13
  5. * @LastEditors: bogon
  6. * @Description: In User Settings Edit
  7. * @FilePath: /performance-test/src/views/overview/components/dicCard/index.vue
  8. -->
  9. <template>
  10. <div>
  11. <el-button
  12. @click="drawer = true"
  13. type="primary"
  14. style="margin-left: 16px"
  15. icon="el-icon-s-fold"
  16. >
  17. </el-button>
  18. <el-drawer :visible.sync="drawer" title="分析评论">
  19. <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
  20. <el-tab-pane label="当前评论" name="current">
  21. <template
  22. v-if="commentDescriptionVos && commentDescriptionVos.length > 0"
  23. >
  24. <el-descriptions
  25. class="margin-top"
  26. title="分析评论"
  27. :column="1"
  28. v-for="(item, inds) in commentDescriptionVos"
  29. :key="inds + 'current'"
  30. >
  31. <el-descriptions-item label="评论时间">
  32. <div v-html="item.createTime"></div>
  33. </el-descriptions-item>
  34. <el-descriptions-item label="评论批次">
  35. <div v-html="item.analysisName"></div>
  36. </el-descriptions-item>
  37. <el-descriptions-item label="评论描述">
  38. <div v-html="item.comment"></div>
  39. </el-descriptions-item>
  40. </el-descriptions>
  41. </template>
  42. <el-empty description="暂无分析评论" v-else></el-empty>
  43. </el-tab-pane>
  44. <el-tab-pane label="历史评论" name="history">
  45. <template
  46. v-if="historyCommentDescList && historyCommentDescList.length > 0"
  47. >
  48. <el-descriptions
  49. class="margin-top"
  50. title="分析评论"
  51. :column="1"
  52. v-for="(item, inds) in historyCommentDescList"
  53. :key="inds + 'history'"
  54. >
  55. <el-descriptions-item label="评论时间">
  56. <div v-html="item.createTime"></div>
  57. </el-descriptions-item>
  58. <el-descriptions-item label="评论批次">
  59. <div v-html="item.analysisName"></div>
  60. </el-descriptions-item>
  61. <el-descriptions-item label="评论描述">
  62. <div v-html="item.comment"></div>
  63. </el-descriptions-item>
  64. </el-descriptions>
  65. </template>
  66. <el-empty description="暂无历史评论" v-else></el-empty>
  67. </el-tab-pane>
  68. </el-tabs>
  69. </el-drawer>
  70. </div>
  71. </template>
  72. <script>
  73. import { analysisCommentDescList } from "@/api/overview";
  74. export default {
  75. props: {
  76. batchCode: {
  77. type: String,
  78. default: "",
  79. },
  80. analysisTypeCode: {
  81. type: String,
  82. default: "",
  83. },
  84. commentDescriptionVos: {
  85. type: Array,
  86. default: [],
  87. },
  88. },
  89. data() {
  90. return {
  91. activeName: "current",
  92. historyCommentDescList: [],
  93. drawer: false,
  94. };
  95. },
  96. watch: {
  97. batchCode(newVal) {
  98. console.log(newVal, "this.activeName ===");
  99. if (newVal) {
  100. this.activeName = "current";
  101. }
  102. },
  103. //分析模型
  104. // analysisTypeCode() {
  105. // if (newVal) {
  106. // this.analysisCommentDescListHistory()
  107. // }
  108. // }
  109. },
  110. methods: {
  111. handleClick(tab, event) {
  112. console.log(this.activeName, "activeName");
  113. if (this.activeName === "history") {
  114. this.analysisCommentDescListHistory();
  115. }
  116. },
  117. async analysisCommentDescListHistory() {
  118. try {
  119. const res = await analysisCommentDescList({
  120. // batchCode: this.batchCode,
  121. analysisTypeCode: this.analysisTypeCode,
  122. });
  123. this.historyCommentDescList = res.data || [];
  124. console.log(
  125. res.data,
  126. "历史评论",
  127. this.batchCode,
  128. this.analysisTypeCode
  129. );
  130. } catch (err) {}
  131. },
  132. },
  133. };
  134. </script>
  135. <style scoped lang="scss">
  136. .el-tabs--border-card {
  137. height: 100%;
  138. overflow: scroll;
  139. .el-tabs__content {
  140. }
  141. }
  142. </style>