11<script lang="ts" setup>
22import { ref } from ' vue'
33import icon_quick_question from ' @/assets/svg/icon_quick_question.svg'
4- import { Close } from ' @element-plus/icons-vue'
4+ import icon_close from ' @/assets/svg/operate/ope-close.svg'
5+ import icon_replace_outlined from ' @/assets/svg/icon_replace_outlined.svg'
56import RecommendQuestion from ' @/views/chat/RecommendQuestion.vue'
67import { ChatInfo } from ' @/api/chat.ts'
78import RecentQuestion from ' @/views/chat/RecentQuestion.vue'
89const activeName = ref (' recommend' )
910const recommendQuestionRef = ref ()
11+ const recentQuestionRef = ref ()
1012const popoverRef = ref ()
1113const getRecommendQuestions = () => {
1214 recommendQuestionRef .value .getRecommendQuestions ()
1315}
16+
17+ const retrieveQuestions = () => {
18+ getRecommendQuestions ()
19+ recentQuestionRef .value .getRecentQuestions ()
20+ }
1421const quickAsk = (question : string ) => {
1522 emits (' quickAsk' , question )
1623 hiddenProps ()
@@ -59,7 +66,18 @@ const props = withDefaults(
5966 trigger =" click"
6067 :width =" 320"
6168 >
62- <el-icon class =" close_icon" ><Close @click =" hiddenProps" /></el-icon >
69+ <el-button class =" tool-btn close_icon" text @click =" hiddenProps" >
70+ <el-icon size =" 18" >
71+ <icon _close />
72+ </el-icon >
73+ </el-button >
74+ <el-tooltip effect =" dark" :offset =" 8" :content =" $t('qa.retrieve_again')" placement =" top" >
75+ <el-button class =" tool-btn refresh_icon" text :disabled =" disabled" @click =" retrieveQuestions" >
76+ <el-icon size =" 18" >
77+ <icon _replace_outlined />
78+ </el-icon >
79+ </el-button >
80+ </el-tooltip >
6381 <el-tabs v-model =" activeName" class =" quick_question_tab" >
6482 <el-tab-pane :label =" $t('qa.recommend')" name =" recommend" >
6583 <RecommendQuestion
@@ -76,7 +94,13 @@ const props = withDefaults(
7694 />
7795 </el-tab-pane >
7896 <el-tab-pane v-if =" datasourceId" :label =" $t('qa.recently')" name =" recently" >
79- <RecentQuestion :datasource-id =" datasourceId" @click-question =" quickAsk" > </RecentQuestion >
97+ <RecentQuestion
98+ ref =" recentQuestionRef"
99+ :disabled =" disabled"
100+ :datasource-id =" datasourceId"
101+ @click-question =" quickAsk"
102+ >
103+ </RecentQuestion >
80104 </el-tab-pane >
81105 </el-tabs >
82106 <template #reference >
@@ -95,6 +119,11 @@ const props = withDefaults(
95119 .quick_question_tab {
96120 height : 230px ;
97121 }
122+ .ed-tab-pane {
123+ display : flex ;
124+ align-items : normal ;
125+ width : 100% ;
126+ }
98127 .ed-tabs__content {
99128 overflow : auto ;
100129 }
@@ -106,9 +135,38 @@ const props = withDefaults(
106135 .close_icon {
107136 position : absolute ;
108137 cursor : pointer ;
109- top : 12 px ;
110- right : 12 px ;
138+ top : 4 px ;
139+ right : 4 px ;
111140 }
141+
142+ .refresh_icon {
143+ position : absolute ;
144+ cursor : pointer ;
145+ top : 30px ;
146+ right : 4px ;
147+ z-index : 1 ;
148+ }
149+
150+ .tool-btn {
151+ font-size : 14px ;
152+ font-weight : 400 ;
153+ line-height : 22px ;
154+ color : rgba (100 , 106 , 115 , 1 );
155+
156+ .tool-btn-inner {
157+ display : flex ;
158+ flex-direction : row ;
159+ align-items : center ;
160+ }
161+
162+ & :hover {
163+ background : rgba (31 , 35 , 41 , 0.1 );
164+ }
165+ & :active {
166+ background : rgba (31 , 35 , 41 , 0.1 );
167+ }
168+ }
169+
112170 .ed-tabs__item {
113171 font-size : 14px ;
114172 height : 38px ;
0 commit comments