@@ -56,6 +56,7 @@ import { useRoute } from 'vue-router'
56
56
import applicationApi from ' @/api/application/application'
57
57
import chatAPI from ' @/api/chat/chat'
58
58
import SystemResourceManagementApplicationAPI from " @/api/system-resource-management/application.ts"
59
+ import syetrmResourceManagementChatLogApi from ' @/api/system-resource-management/chat-log'
59
60
import chatLogApi from ' @/api/application/chat-log'
60
61
import { ChatManagement , type chatType } from ' @/api/type/application'
61
62
import { randomId } from ' @/utils/common'
@@ -295,35 +296,36 @@ const getOpenChatAPI = () => {
295
296
}
296
297
}
297
298
298
- /**
299
- * 获取对话详情
300
- * @param row
301
- */
302
- function getSourceDetail(row : any ) {
299
+ const getChatRecordDetailsAPI = (row : any ) => {
303
300
if (row .record_id ) {
304
301
if (props .type === ' debug-ai-chat' ) {
305
- chatLogApi
306
- .getChatRecordDetails (id || props .appId , row .chat_id , row .record_id , loading )
307
- .then ((res ) => {
308
- const exclude_keys = [' answer_text' , ' id' , ' answer_text_list' ]
309
- Object .keys (res .data ).forEach ((key ) => {
310
- if (! exclude_keys .includes (key )) {
311
- row [key ] = res .data [key ]
312
- }
313
- })
314
- })
302
+ if (route .path .includes (' resource-management' )) {
303
+ return syetrmResourceManagementChatLogApi
304
+ .getChatRecordDetails (id || props .appId , row .chat_id , row .record_id , loading )
305
+ } else {
306
+ return chatLogApi
307
+ .getChatRecordDetails (id || props .appId , row .chat_id , row .record_id , loading )
308
+ }
315
309
} else {
316
- chatAPI .getChatRecord (row .chat_id , row .record_id , loading ).then ((res ) => {
317
- const exclude_keys = [' answer_text' , ' id' , ' answer_text_list' ]
318
- Object .keys (res .data ).forEach ((key ) => {
319
- if (! exclude_keys .includes (key )) {
320
- row [key ] = res .data [key ]
321
- }
322
- })
323
- })
310
+ return chatAPI .getChatRecord (row .chat_id , row .record_id , loading )
324
311
}
325
312
}
326
- return true
313
+ return Promise .reject (" 404" )
314
+ }
315
+ /**
316
+ * 获取对话详情
317
+ * @param row
318
+ */
319
+ function getSourceDetail(row : any ) {
320
+ return getChatRecordDetailsAPI (row ).then ((res ) => {
321
+ const exclude_keys = [' answer_text' , ' id' , ' answer_text_list' ]
322
+ Object .keys (res .data ).forEach ((key ) => {
323
+ if (! exclude_keys .includes (key )) {
324
+ row [key ] = res .data [key ]
325
+ }
326
+ })
327
+ })
328
+
327
329
}
328
330
/**
329
331
* 对话
0 commit comments