11<script lang="ts" setup>
22import { ref , onMounted , onUnmounted } from ' vue'
3+ import icon_expand_right_filled from ' @/assets/svg/icon_expand-right_filled.svg'
34import gou_icon from ' @/assets/svg/gou_icon.svg'
45import icon_error from ' @/assets/svg/icon_error.svg'
56import icon_database_colorful from ' @/assets/svg/icon_database_colorful.svg'
@@ -11,8 +12,17 @@ import { debounce } from 'lodash-es'
1112const { t } = useI18n ()
1213const logHistory = ref <ChatLogHistory >({})
1314const dialogFormVisible = ref (false )
15+ const expandIds = ref <any >([])
1416const drawerSize = ref (' 600px' )
1517
18+ const handleExpand = (index : number ) => {
19+ if (expandIds .value .includes (index )) {
20+ expandIds .value = expandIds .value .filter ((ele : any ) => ele !== index )
21+ } else {
22+ expandIds .value .push (index )
23+ }
24+ }
25+
1626function getLogList(recordId : any ) {
1727 setDrawerSize ()
1828 chatApi .get_chart_log_history (recordId ).then ((res ) => {
@@ -66,24 +76,35 @@ defineExpose({
6676 <div class =" title" >{{ t('parameter.execution_details') }}</div >
6777
6878 <div class =" list" >
69- <div v-for =" ele in logHistory.steps" :key =" ele.duration" class =" list-item" >
70- <div class =" name" >
71- {{ ele.operate }}
72- </div >
73- <div class =" status" >
74- <div
75- v-if =" ele.total_tokens && ele.total_tokens > 0"
76- class =" time"
77- style =" margin-right : 12px "
78- >
79- {{ ele.total_tokens }} tokens
79+ <div
80+ v-for =" (ele, index) in logHistory.steps"
81+ :key =" ele.duration"
82+ class =" list-item"
83+ @click =" handleExpand(index)"
84+ >
85+ <div class =" header" >
86+ <div class =" name" >
87+ <el-icon class =" shrink" :class =" expandIds.includes(index) && 'expand'" size =" 10" >
88+ <icon _expand_right_filled ></icon _expand_right_filled >
89+ </el-icon >
90+ {{ ele.operate }}
91+ </div >
92+ <div class =" status" >
93+ <div
94+ v-if =" ele.total_tokens && ele.total_tokens > 0"
95+ class =" time"
96+ style =" margin-right : 12px "
97+ >
98+ {{ ele.total_tokens }} tokens
99+ </div >
100+ <div class =" time" >{{ ele.duration }}s</div >
101+ <el-icon size =" 16" >
102+ <icon _error v-if =" ele.error" ></icon _error >
103+ <gou _icon v-else ></gou _icon >
104+ </el-icon >
80105 </div >
81- <div class =" time" >{{ ele.duration }}s</div >
82- <el-icon size =" 16" >
83- <icon _error v-if =" ele.error" ></icon _error >
84- <gou _icon v-else ></gou _icon >
85- </el-icon >
86106 </div >
107+ <div class =" content" ></div >
87108 </div >
88109 </div >
89110 </el-drawer >
@@ -138,13 +159,39 @@ defineExpose({
138159 .list {
139160 .list-item {
140161 width : 100% ;
141- height : 54px ;
142162 border-radius : 12px ;
143163 border : 1px solid #dee0e3 ;
144164 padding : 16px ;
145165 margin-bottom : 8px ;
146- display : flex ;
147- align-items : center ;
166+
167+ .header {
168+ display : flex ;
169+ align-items : center ;
170+ }
171+
172+ @keyframes expand {
173+ 0% {
174+ height : 54px ;
175+ }
176+
177+ 100% {
178+ height : 504px ;
179+ }
180+ }
181+
182+ & :has(.expand ) {
183+ height : 504px ;
184+ animation : expand 0.5s ;
185+ }
186+
187+ .shrink {
188+ margin-right : 8px ;
189+ cursor : pointer ;
190+ }
191+
192+ .expand {
193+ transform : rotate (90deg );
194+ }
148195
149196 .status {
150197 display : flex ;
@@ -156,8 +203,7 @@ defineExpose({
156203 font-size : 14px ;
157204 line-height : 22px ;
158205 display : flex ;
159- flex-direction : row ;
160- gap : 12px ;
206+ align-items : center ;
161207 }
162208
163209 .time {
0 commit comments