1
1
<template >
2
- <div
3
- ref =" aiChatRef"
4
- class =" ai-chat"
5
- :class =" type"
6
- :style =" {
7
- height: firsUserInput ? '100%' : undefined,
8
- paddingBottom: applicationDetails.disclaimer ? '20px' : 0,
9
- }"
10
- >
11
- <div
12
- v-show =" showUserInputContent"
13
- :class =" firsUserInput ? 'firstUserInput' : 'popperUserInput'"
14
- >
15
- <UserForm
16
- v-model:api_form_data =" api_form_data"
17
- v-model:form_data =" form_data"
18
- :application =" applicationDetails"
19
- :type =" type"
20
- :first =" firsUserInput"
21
- @confirm =" UserFormConfirm"
22
- @cancel =" UserFormCancel"
23
- ref =" userFormRef"
24
- ></UserForm >
2
+ <div ref =" aiChatRef" class =" ai-chat" :class =" type" :style =" {
3
+ height: firsUserInput ? '100%' : undefined,
4
+ paddingBottom: applicationDetails.disclaimer ? '20px' : 0,
5
+ }" >
6
+ <div v-show =" showUserInputContent" :class =" firsUserInput ? 'firstUserInput' : 'popperUserInput'" >
7
+ <UserForm v-model:api_form_data =" api_form_data" v-model:form_data =" form_data" :application =" applicationDetails"
8
+ :type =" type" :first =" firsUserInput" @confirm =" UserFormConfirm" @cancel =" UserFormCancel" ref =" userFormRef" >
9
+ </UserForm >
25
10
</div >
26
11
<template v-if =" ! (isUserInput || isAPIInput ) || ! firsUserInput || type === ' log' " >
27
12
<el-scrollbar ref =" scrollDiv" @scroll =" handleScrollTop" >
28
13
<div ref =" dialogScrollbar" class =" ai-chat__content p-16" >
29
- <PrologueContent
30
- :type =" type"
31
- :application =" applicationDetails"
32
- :available =" available"
33
- :send-message =" sendMessage"
34
- ></PrologueContent >
14
+ <PrologueContent :type =" type" :application =" applicationDetails" :available =" available"
15
+ :send-message =" sendMessage" ></PrologueContent >
35
16
36
17
<template v-for =" (item , index ) in chatList " :key =" index " >
37
18
<!-- 问题 -->
38
- <QuestionContent
39
- :type =" type"
40
- :application =" applicationDetails"
41
- :chat-record =" item"
42
- ></QuestionContent >
19
+ <QuestionContent :type =" type" :application =" applicationDetails" :chat-record =" item" ></QuestionContent >
43
20
<!-- 回答 -->
44
- <AnswerContent
45
- :application =" applicationDetails"
46
- :loading =" loading"
47
- v-model:chat-record =" chatList[index]"
48
- :type =" type"
49
- :send-message =" sendMessage"
50
- :chat-management =" ChatManagement"
21
+ <AnswerContent :application =" applicationDetails" :loading =" loading" v-model:chat-record =" chatList[index]"
22
+ :type =" type" :send-message =" sendMessage" :chat-management =" ChatManagement"
51
23
:executionIsRightPanel =" props.executionIsRightPanel"
52
24
@open-execution-detail =" emit('openExecutionDetail', chatList[index])"
53
- @openParagraph =" emit('openParagraph', chatList[index])"
54
- @openParagraphDocument ="
25
+ @openParagraph =" emit('openParagraph', chatList[index])" @openParagraphDocument ="
55
26
(val: any) => emit('openParagraphDocument', chatList[index], val)
56
- "
57
- ></AnswerContent >
27
+ " ></AnswerContent >
58
28
</template >
59
- <TransitionContent
60
- v-if =" transcribing"
61
- :text =" t('chat.transcribing')"
62
- :type =" type"
63
- :application =" applicationDetails"
64
- ></TransitionContent >
29
+ <TransitionContent v-if =" transcribing" :text =" t('chat.transcribing')" :type =" type"
30
+ :application =" applicationDetails" >
31
+ </TransitionContent >
65
32
</div >
66
33
</el-scrollbar >
67
34
68
- <ChatInputOperate
69
- :app-id =" appId"
70
- :application-details =" applicationDetails"
71
- :is-mobile =" isMobile"
72
- :type =" type"
73
- :send-message =" sendMessage"
74
- :open-chat-id =" openChatId"
75
- :validate =" validate"
76
- :chat-management =" ChatManagement"
77
- v-model:chat-id =" chartOpenId"
78
- v-model:loading =" loading"
79
- v-model:show-user-input =" showUserInput"
80
- v-if =" type !== 'log'"
81
- >
35
+ <ChatInputOperate :app-id =" appId" :application-details =" applicationDetails" :is-mobile =" isMobile" :type =" type"
36
+ :send-message =" sendMessage" :open-chat-id =" openChatId" :validate =" validate" :chat-management =" ChatManagement"
37
+ v-model:chat-id =" chartOpenId" v-model:loading =" loading" v-model:show-user-input =" showUserInput"
38
+ v-if =" type !== 'log'" >
82
39
<template #userInput >
83
- <el-button
84
- v-if =" isUserInput || isAPIInput"
85
- class =" user-input-button mb-8"
86
- @click =" toggleUserInput"
87
- >
40
+ <el-button v-if =" isUserInput || isAPIInput" class =" user-input-button mb-8" @click =" toggleUserInput" >
88
41
<AppIcon iconName =" app-edit" :size =" 16" class =" mr-4" ></AppIcon >
89
42
<span class =" ellipsis" >
90
43
{{ userInputTitle || $t('chat.userInput') }}
@@ -102,6 +55,7 @@ import { type Ref, ref, nextTick, computed, watch, reactive, onMounted, onBefore
102
55
import { useRoute } from ' vue-router'
103
56
import applicationApi from ' @/api/application/application'
104
57
import chatAPI from ' @/api/chat/chat'
58
+ import SystemResourceManagementApplicationAPI from " @/api/system-resource-management/application.ts"
105
59
import chatLogApi from ' @/api/application/chat-log'
106
60
import { ChatManagement , type chatType } from ' @/api/type/application'
107
61
import { randomId } from ' @/utils/common'
@@ -329,7 +283,11 @@ const getChatMessageAPI = () => {
329
283
}
330
284
const getOpenChatAPI = () => {
331
285
if (props .type === ' debug-ai-chat' ) {
332
- return applicationApi .open
286
+ if (route .path .includes (' resource-management' )) {
287
+ return SystemResourceManagementApplicationAPI .open
288
+ } else {
289
+ return applicationApi .open
290
+ }
333
291
} else {
334
292
return (a ? : string , loading ? : Ref <boolean >) => {
335
293
return chatAPI .open (loading )
@@ -650,20 +608,24 @@ defineExpose({
650
608
</script >
651
609
<style lang="scss">
652
610
@use ' ./index.scss' ;
611
+
653
612
.firstUserInput {
654
613
height : 100% ;
655
614
display : flex ;
656
615
justify-content : center ;
657
616
overflow : auto ;
617
+
658
618
.user-form-container {
659
619
max-width : 70% ;
660
620
}
661
621
}
622
+
662
623
.debug-ai-chat {
663
624
.user-form-container {
664
625
max-width : 100% ;
665
626
}
666
627
}
628
+
667
629
.popperUserInput {
668
630
position : absolute ;
669
631
z-index : 999 ;
@@ -675,10 +637,12 @@ defineExpose({
675
637
676
638
.video-stop-button {
677
639
box-shadow : 0px 6px 24px 0px rgba (31 , 35 , 41 , 0.08 );
640
+
678
641
& :hover {
679
642
background : #ffffff ;
680
643
}
681
644
}
645
+
682
646
@media only screen and (max-width : 768px ) {
683
647
.firstUserInput {
684
648
.user-form-container {
0 commit comments