11<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 >
2510 </div >
2611 <template v-if =" ! (isUserInput || isAPIInput ) || ! firsUserInput || type === ' log' " >
2712 <el-scrollbar ref =" scrollDiv" @scroll =" handleScrollTop" >
2813 <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 >
3516
3617 <template v-for =" (item , index ) in chatList " :key =" index " >
3718 <!-- 问题 -->
38- <QuestionContent
39- :type =" type"
40- :application =" applicationDetails"
41- :chat-record =" item"
42- ></QuestionContent >
19+ <QuestionContent :type =" type" :application =" applicationDetails" :chat-record =" item" ></QuestionContent >
4320 <!-- 回答 -->
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"
5123 :executionIsRightPanel =" props.executionIsRightPanel"
5224 @open-execution-detail =" emit('openExecutionDetail', chatList[index])"
53- @openParagraph =" emit('openParagraph', chatList[index])"
54- @openParagraphDocument ="
25+ @openParagraph =" emit('openParagraph', chatList[index])" @openParagraphDocument ="
5526 (val: any) => emit('openParagraphDocument', chatList[index], val)
56- "
57- ></AnswerContent >
27+ " ></AnswerContent >
5828 </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 >
6532 </div >
6633 </el-scrollbar >
6734
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'" >
8239 <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" >
8841 <AppIcon iconName =" app-edit" :size =" 16" class =" mr-4" ></AppIcon >
8942 <span class =" ellipsis" >
9043 {{ userInputTitle || $t('chat.userInput') }}
@@ -102,6 +55,7 @@ import { type Ref, ref, nextTick, computed, watch, reactive, onMounted, onBefore
10255import { useRoute } from ' vue-router'
10356import applicationApi from ' @/api/application/application'
10457import chatAPI from ' @/api/chat/chat'
58+ import SystemResourceManagementApplicationAPI from " @/api/system-resource-management/application.ts"
10559import chatLogApi from ' @/api/application/chat-log'
10660import { ChatManagement , type chatType } from ' @/api/type/application'
10761import { randomId } from ' @/utils/common'
@@ -329,7 +283,11 @@ const getChatMessageAPI = () => {
329283}
330284const getOpenChatAPI = () => {
331285 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+ }
333291 } else {
334292 return (a ? : string , loading ? : Ref <boolean >) => {
335293 return chatAPI .open (loading )
@@ -650,20 +608,24 @@ defineExpose({
650608 </script >
651609<style lang="scss">
652610@use ' ./index.scss' ;
611+
653612.firstUserInput {
654613 height : 100% ;
655614 display : flex ;
656615 justify-content : center ;
657616 overflow : auto ;
617+
658618 .user-form-container {
659619 max-width : 70% ;
660620 }
661621}
622+
662623.debug-ai-chat {
663624 .user-form-container {
664625 max-width : 100% ;
665626 }
666627}
628+
667629.popperUserInput {
668630 position : absolute ;
669631 z-index : 999 ;
@@ -675,10 +637,12 @@ defineExpose({
675637
676638.video-stop-button {
677639 box-shadow : 0px 6px 24px 0px rgba (31 , 35 , 41 , 0.08 );
640+
678641 & :hover {
679642 background : #ffffff ;
680643 }
681644}
645+
682646@media only screen and (max-width : 768px ) {
683647 .firstUserInput {
684648 .user-form-container {
0 commit comments