index.vue 3.6 KB

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