11<script setup lang="ts">
22import { computed , ref } from " vue"
33import TextComponent from " ./Text.vue"
4+ import { ChatLineRound } from " @element-plus/icons-vue"
45
56interface Props {
67 dateTime? : string
78 text? : string
89 inversion? : boolean
910 error? : boolean
1011 loading? : boolean
12+ id? : string
13+ botName? : string
1114}
1215
1316interface Emit {
1417 (ev : " regenerate" ): void
1518 (ev : " delete" ): void
1619}
1720
21+ const showDialog = ref (false )
1822const props = defineProps <Props >()
19-
2023const emit = defineEmits <Emit >()
21-
2224const textRef = ref <HTMLElement >()
23-
2425const asRawText = ref (props .inversion )
25-
2626const messageRef = ref <HTMLElement >()
27-
28- function handleRegenerate() {
29- messageRef .value ?.scrollIntoView ()
30- emit (" regenerate" )
31- }
32-
33- async function handleCopy() {
34- try {
35- // await copyToClip(props.text || '')
36- } catch {}
27+ console .log (props .botName )
28+ const handleShowDialog = () => {
29+ console .log (props .botName )
30+ showDialog .value = true
3731}
3832 </script >
3933
@@ -55,13 +49,24 @@ async function handleCopy() {
5549 :loading =" loading"
5650 :as-raw-text =" asRawText"
5751 />
58- <!-- <div class="flex flex-col">
59- <button
60- v-if="!inversion"
61- class="mb-2 transition text-neutral-300 hover:text-neutral-800 dark:hover:text-neutral-300"
62- @click="handleRegenerate"
63- ></button>
64- </div> -->
52+ <div class =" flex flex-col-reverse" >
53+ <el-tooltip effect =" dark" content =" 评论" placement =" top" >
54+ <button
55+ v-if =" !inversion"
56+ class =" mb-1 ml-2 p-0 border-0 bg-white text-[#b4bbc4] transition hover:text-[#1a73e8] hover:border-0 focus:outline-0"
57+ @click =" handleShowDialog"
58+ >
59+ <ChatLineRound style =" width : 16px ; height : 16px " />
60+ </button >
61+ </el-tooltip >
62+ </div >
6563 </div >
6664 </div >
65+ <el-dialog v-model =" showDialog" >
66+ <template #header =" { titleId , titleClass } " >
67+ <div class =" my-header text-center" >
68+ <h3 :id =" titleId" :class =" titleClass" >评论</h3 >
69+ </div >
70+ </template >
71+ </el-dialog >
6772</template >
0 commit comments