Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
ee1c0330
Commit
ee1c0330
authored
Nov 15, 2024
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 应用AI自动新配置后重置应用预览
parent
208d2056
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app-preview.vue
...nal-space/personal-app-setting/components/app-preview.vue
+15
-1
app-setting.vue
...nal-space/personal-app-setting/components/app-setting.vue
+2
-0
mitt-events.d.ts
types/mitt-events.d.ts
+1
-0
No files found.
src/views/personal-space/personal-app-setting/components/app-preview.vue
View file @
ee1c0330
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
inject
,
onMounted
,
onUnmounted
,
ref
}
from
'vue'
import
Preamble
from
'./preamble.vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useRouter
}
from
'vue-router'
import
{
Emitter
}
from
'mitt'
import
MessageList
from
'./message-list.vue'
import
FooterInput
from
'./footer-input.vue'
import
{
fetchCreateContinueQuestions
}
from
'@/apis/agent-application'
...
...
@@ -16,6 +17,8 @@ const router = useRouter()
const
personalAppConfigStore
=
usePersonalAppConfigStore
()
const
emitter
=
inject
<
Emitter
<
MittEvents
>>
(
'emitter'
)
const
messageListRef
=
ref
<
InstanceType
<
typeof
MessageList
>
|
null
>
(
null
)
const
footerInputRef
=
ref
<
InstanceType
<
typeof
FooterInput
>
|
null
>
(
null
)
...
...
@@ -27,6 +30,17 @@ const continuousQuestionList = ref<string[]>([])
const
isShowMemoryPreviewModal
=
ref
(
false
)
const
selectedMemoryTabName
=
ref
(
'memoryVariable'
)
onMounted
(()
=>
{
emitter
?.
on
(
'resetAgent'
,
()
=>
{
footerInputRef
.
value
?.
blockMessageResponse
()
messageList
.
value
=
[]
})
})
onUnmounted
(()
=>
{
emitter
?.
off
(
'resetAgent'
)
})
function
handleAddMessageItem
(
messageItem
:
ConversationMessageItem
)
{
messageList
.
value
.
push
(
messageItem
)
}
...
...
src/views/personal-space/personal-app-setting/components/app-setting.vue
View file @
ee1c0330
...
...
@@ -103,6 +103,7 @@ onMounted(async () => {
onUnmounted
(()
=>
{
handleStopGenerate
()
emitter
?.
off
(
'isGetAgentDetail'
)
})
const
handleSavePersonalAppConfig
=
useThrottleFn
(
...
...
@@ -251,6 +252,7 @@ async function handleSettingAgent(autoConfigInputValue: string) {
handleAIGenerateAgentSystem
(),
]).
finally
(()
=>
{
isFullScreenLoading
.
value
=
false
emitter
?.
emit
(
'resetAgent'
)
})
})
.
catch
(()
=>
{
...
...
types/mitt-events.d.ts
View file @
ee1c0330
declare
type
MittEvents
=
{
selectQuestion
:
string
isGetAgentDetail
:
void
resetAgent
:
void
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment