DialogThinkContent.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="think">
  3. <a-button class="think-select" v-if="!show_think_page" @click="handleThinkClick">
  4. <icon-robot class="robot" />
  5. <span>{{ show_think_title }}</span>
  6. <icon-down class="down" />
  7. </a-button>
  8. <div class="think_content" v-else>
  9. <!-- <div class="content-title"><icon-check-circle class="icon" /></div> -->
  10. <div class="content-title" @click="handleThinkClick">
  11. <div class="content-title-left">
  12. <icon-robot class="robot" />
  13. <span>{{ show_think_title }}</span>
  14. </div>
  15. <icon-up class="down" />
  16. </div>
  17. <div class="content-text" v-html="deep_answer"></div>
  18. </div>
  19. </div>
  20. </template>
  21. <script setup>
  22. import { ref, computed } from 'vue';
  23. const props = defineProps({
  24. deep_loading: Boolean,
  25. deep_answer: String
  26. });
  27. const show_think_page = ref(true);
  28. const show_think_title = computed(() => {
  29. return props.deep_loading ? '思考中...' : '已完成推理';
  30. });
  31. const handleThinkClick = () => {
  32. show_think_page.value = !show_think_page.value;
  33. };
  34. </script>
  35. <style scoped>
  36. .think-select {
  37. display: flex;
  38. align-items: center;
  39. justify-content: center;
  40. gap: 5px;
  41. border-radius: 12px;
  42. background: var(--color-fill-2);
  43. cursor: pointer;
  44. .robot {
  45. color: #20b759;
  46. font-size: 16px;
  47. }
  48. .down {
  49. margin-left: 10px;
  50. }
  51. }
  52. .think_content {
  53. background: #f3f5fc;
  54. transition: all 0.2s ease;
  55. border-radius: 12px;
  56. }
  57. .content-title {
  58. height: 30px;
  59. font-size: 14px;
  60. display: flex;
  61. align-items: center;
  62. justify-content: space-between;
  63. padding: 0 15px;
  64. gap: 10px;
  65. cursor: pointer;
  66. color: var(--color-text-2);
  67. }
  68. .content-title:hover {
  69. background-color: var(--color-secondary-hover);
  70. color: var(--color-text-2);
  71. }
  72. .content-title-left {
  73. .robot {
  74. color: #20b759;
  75. margin-right: 10px;
  76. /* color: #668ff3; */
  77. }
  78. }
  79. .content-text {
  80. margin-left: 20px;
  81. border-left: 1px solid #ccc;
  82. padding: 10px 20px;
  83. }
  84. </style>