DialogThinkContent.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div class="think">
  3. <a-button class="think-select" v-if="!show_think_page" @click="handleThinkClick">
  4. <span>{{ show_think_title }}</span>
  5. <icon-down class="down" />
  6. </a-button>
  7. <div class="think_content" v-else>
  8. <!-- <div class="content-title"><icon-check-circle class="icon" /></div> -->
  9. <div class="content-title" @click="handleThinkClick">
  10. <div class="content-title-left">
  11. <span>{{ show_think_title }}</span>
  12. </div>
  13. <icon-up class="down" />
  14. </div>
  15. <div class="content-text" v-html="deep_answer"></div>
  16. </div>
  17. </div>
  18. </template>
  19. <script setup>
  20. import { ref, computed } from 'vue';
  21. const props = defineProps({
  22. deep_loading: Boolean,
  23. deep_answer: String
  24. });
  25. const show_think_page = ref(true);
  26. const show_think_title = computed(() => {
  27. return props.deep_loading ? '大模型理解中...' : '已完成推理';
  28. });
  29. const handleThinkClick = () => {
  30. show_think_page.value = !show_think_page.value;
  31. };
  32. </script>
  33. <style scoped>
  34. .think {
  35. /* background: #D6F8F8; */
  36. /* background: rgba(10, 129, 126, 0.06); */
  37. color: #2c2c2c;
  38. margin-bottom: 10px;
  39. }
  40. .think-select {
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. gap: 5px;
  45. border-radius: 12px;
  46. background: rgba(10, 129, 126, 0.06);
  47. cursor: pointer;
  48. font-weight: 600;
  49. font-family: 思源黑体;
  50. font-size: 14px;
  51. color: #0a817e;
  52. padding: 2px 20px;
  53. }
  54. .think-select .down {
  55. margin-left: 10px;
  56. color: #0a817e;
  57. }
  58. .think_select span {
  59. color: #0a817e;
  60. font-size: 14px;
  61. font-weight: 600;
  62. font-family: 思源黑体;
  63. background: rgba(10, 129, 126, 0.06);
  64. }
  65. .think-select:hover {
  66. font-weight: 600;
  67. font-family: 思源黑体;
  68. color: #0a817e;
  69. background: rgba(10, 129, 126, 0.06);
  70. opacity: 0.8;
  71. }
  72. .think_content {
  73. /* background: #D6F8F8; */
  74. background: rgba(10, 129, 126, 0.06);
  75. transition: all 0.2s ease;
  76. border-radius: 12px;
  77. }
  78. .content-title {
  79. height: 30px;
  80. font-size: 14px;
  81. display: flex;
  82. align-items: center;
  83. justify-content: space-between;
  84. padding: 1px 20px;
  85. gap: 10px;
  86. cursor: pointer;
  87. border-radius: 12px;
  88. color: #0a817e;
  89. font-weight: 600;
  90. font-family: 思源黑体;
  91. }
  92. .content-title:hover {
  93. opacity: 0.8;
  94. }
  95. .content-title-left {
  96. }
  97. .content-text {
  98. padding: 0px 20px 10px 20px;
  99. margin-top: -10px;
  100. line-height: 24px;
  101. }
  102. </style>
  103. <style>
  104. .content-text table {
  105. border-collapse: collapse;
  106. }
  107. .content-text table,
  108. .content-text th,
  109. .content-text td {
  110. border: 1px solid rgb(184, 179, 179);
  111. }
  112. .content-text th,
  113. .content-text td {
  114. padding: 8px;
  115. text-align: left;
  116. }
  117. .content-text .katex-display > .katex {
  118. white-space: pre-wrap !important;
  119. }
  120. </style>