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
a564e5ad
Commit
a564e5ad
authored
Mar 18, 2025
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 移动端应用提问中离开页面打断后再次进入支持重新生成
parent
0572c27c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
8 deletions
+43
-8
en.yaml
src/locales/langs/en.yaml
+1
-0
zh-cn.yaml
src/locales/langs/zh-cn.yaml
+1
-0
zh-hk.yaml
src/locales/langs/zh-hk.yaml
+1
-0
footer-input.vue
src/views/share/components/footer-input.vue
+8
-6
message-list.vue
src/views/share/components/message-list.vue
+3
-1
share-application-mobile.vue
src/views/share/share-application-mobile.vue
+28
-1
locales.d.ts
types/locales.d.ts
+1
-0
No files found.
src/locales/langs/en.yaml
View file @
a564e5ad
...
...
@@ -167,6 +167,7 @@ common_module:
upload_image_size_error_message
:
'
The
size
of
the
uploaded
image
cannot
exceed
5
MB'
upload_image_format_error_message
:
'
Only
png,
jpg,
jpeg,
webp
format
images
can
be
uploaded,
please
upload
again'
do_not_exit_page
:
'
Do
not
leave
the
page
during
the
generation
to
avoid
interrupting
the
conversation'
content_interrupted
:
'
Content
generation
is
interrupted.
Whether
to
regenerate
it'
data_table_module
:
action
:
'
Controls'
...
...
src/locales/langs/zh-cn.yaml
View file @
a564e5ad
...
...
@@ -166,6 +166,7 @@ common_module:
upload_image_size_error_message
:
'
上传图片大小不能超过5M'
upload_image_format_error_message
:
'
只能上传png、jpg、jpeg、webp格式图片,请重新上传'
do_not_exit_page
:
'
生成期间请勿离开页面,以免中断对话流程'
content_interrupted
:
'
内容生成被中断,是否重新生成'
data_table_module
:
action
:
'
操作'
...
...
src/locales/langs/zh-hk.yaml
View file @
a564e5ad
...
...
@@ -166,6 +166,7 @@ common_module:
upload_image_size_error_message
:
'
上傳圖片大小不能超過5M'
upload_image_format_error_message
:
'
只能上傳png、jpg、jpeg、webp格式圖片,請重新上傳'
do_not_exit_page
:
'
生成期間請勿離開頁面,以免中斷對話流程'
content_interrupted
:
'
內容生成被中斷,是否重新生成'
data_table_module
:
action
:
'
操作'
...
...
src/views/share/components/footer-input.vue
View file @
a564e5ad
...
...
@@ -54,12 +54,11 @@ const userStore = useUserStore()
const
{
uploadFileList
,
handleLimitUpload
,
handleUpload
,
handleRemoveFile
}
=
useDialogueFile
()
const
{
uploadImageList
,
handleLimitUploadImage
,
handleUploadImage
,
handleRemoveUploadImage
}
=
useUploadImage
()
const
isAnswerResponse
Loading
=
defineModel
<
boolean
>
(
'isAnswerResponseLoading'
,
{
required
:
true
})
const
isAnswerResponse
Wait
=
defineModel
<
boolean
>
(
'isAnswerResponseLoading'
,
{
required
:
true
})
const
emitter
=
inject
<
Emitter
<
MittEvents
>>
(
'emitter'
)
const
inputMessageContent
=
ref
(
''
)
const
isAnswerResponseWait
=
ref
(
false
)
const
currentReplyContentSentenceExtractIndex
=
ref
(
0
)
const
sentenceFragmentSerialNo
=
ref
(
0
)
const
sentenceExtractCheckEnabled
=
ref
(
false
)
...
...
@@ -154,12 +153,16 @@ function handleInputMessageEnter(event: KeyboardEvent) {
}
}
function
handleMessageSend
()
{
function
handleMessageSend
(
lastQuestionContent
?:
string
)
{
if
(
!
isLogin
.
value
)
{
window
.
$message
.
warning
(
t
(
'common_module.not_login_text'
))
return
}
if
(
lastQuestionContent
)
{
inputMessageContent
.
value
=
lastQuestionContent
}
if
(
!
inputMessageContent
.
value
.
trim
()
||
isInputMessageDisabled
.
value
)
{
return
}
...
...
@@ -198,7 +201,6 @@ function handleMessageSend() {
let
replyTextContent
=
''
let
reasoningContent
=
''
isAnswerResponseLoading
.
value
=
true
isAnswerResponseWait
.
value
=
true
currentReplyContentSentenceExtractIndex
.
value
=
0
sentenceFragmentSerialNo
.
value
=
0
...
...
@@ -272,7 +274,6 @@ function handleMessageSend() {
isAnswerResponseLoading
:
false
,
})
isAnswerResponseLoading
.
value
=
false
isCreateContinueQuestions
.
value
&&
emit
(
'createContinueQuestions'
,
replyTextContent
)
emit
(
'updatePageScroll'
)
isAnswerResponseWait
.
value
=
false
...
...
@@ -441,6 +442,7 @@ function ttsSocketSendText(text: string, audioUrlSerialNo: number, messageId: st
defineExpose
({
blockMessageResponse
,
errorMessageResponse
,
handleMessageSend
,
})
</
script
>
...
...
@@ -545,7 +547,7 @@ defineExpose({
? 'opacity-60'
: 'cursor-pointer'
"
@
click=
"handleMessageSend"
@
click=
"handleMessageSend
()
"
/>
<div
v-show=
"!isLogin"
class=
"absolute left-3 top-[5px] flex h-[30px] items-center text-[#84868c]"
>
...
...
src/views/share/components/message-list.vue
View file @
a564e5ad
...
...
@@ -15,6 +15,7 @@ interface Props {
continuousQuestionList
:
string
[]
isAnswerResponseLoading
:
boolean
createContinueQuestionsException
:
boolean
lastQuestionContent
?:
string
}
const
props
=
defineProps
<
Props
>
()
...
...
@@ -37,7 +38,8 @@ const isShowContinueQuestion = computed(() => {
props
.
continuousQuestionStatus
===
'default'
&&
props
.
messageList
.
size
>
1
&&
!
props
.
isAnswerResponseLoading
&&
!
props
.
createContinueQuestionsException
!
props
.
createContinueQuestionsException
&&
!
props
.
lastQuestionContent
)
})
...
...
src/views/share/share-application-mobile.vue
View file @
a564e5ad
...
...
@@ -34,6 +34,24 @@ const { isMobile } = useLayoutConfig()
useEventListener
(
document
,
'visibilitychange'
,
()
=>
{
if
(
document
.
visibilityState
===
'hidden'
)
{
handleExitPage
()
handleAudioPause
()
}
else
if
(
document
.
visibilityState
===
'visible'
&&
lastQuestionContent
.
value
)
{
window
.
$dialog
.
warning
({
title
:
t
(
'share_agent_module.create_agent_dialogue_title'
),
content
:
t
(
'common_module.dialogue_module.content_interrupted'
),
negativeText
:
t
(
'common_module.cancel_btn_text'
),
positiveText
:
t
(
'common_module.confirm_btn_text'
),
onPositiveClick
()
{
footerInputRef
.
value
?.
handleMessageSend
(
lastQuestionContent
.
value
)
lastQuestionContent
.
value
=
''
},
onNegativeClick
()
{
lastQuestionContent
.
value
=
''
},
onAfterLeave
()
{
lastQuestionContent
.
value
=
''
},
})
}
})
...
...
@@ -58,6 +76,7 @@ const currentSoundCtl = shallowRef<Howl | null>(null)
const
isSoundCtlCreated
=
ref
(
false
)
const
isAnswerResponseLoading
=
ref
(
false
)
const
createContinueQuestionsException
=
ref
(
false
)
const
lastQuestionContent
=
ref
(
''
)
// 上一次提问内容
const
isEnableDocumentParse
=
computed
(()
=>
{
return
agentApplicationConfig
.
value
.
knowledgeConfig
.
isDocumentParsing
===
'Y'
...
...
@@ -325,7 +344,14 @@ function handleInitSoundPlay() {
// 退出页面中断对话
function
handleExitPage
()
{
footerInputRef
.
value
?.
errorMessageResponse
()
if
(
messageList
.
value
.
size
>
0
&&
isAnswerResponseLoading
.
value
)
{
const
messageListArr
=
Array
.
from
(
messageList
.
value
.
values
())
if
(
messageListArr
.
length
>=
2
)
{
lastQuestionContent
.
value
=
messageListArr
[
messageListArr
.
length
-
2
]?.
textContent
||
''
}
footerInputRef
.
value
?.
errorMessageResponse
()
}
}
</
script
>
...
...
@@ -362,6 +388,7 @@ function handleExitPage() {
:continuous-question-list=
"continueQuestionList"
:is-answer-response-loading=
"isAnswerResponseLoading"
:create-continue-questions-exception=
"createContinueQuestionsException"
:last-question-content=
"lastQuestionContent"
@
audio-play=
"handleAudioPlay"
@
audio-pause=
"handleAudioPause"
/>
...
...
types/locales.d.ts
View file @
a564e5ad
...
...
@@ -166,6 +166,7 @@ declare namespace I18n {
upload_image_size_error_message
:
string
upload_image_format_error_message
:
string
do_not_exit_page
:
string
content_interrupted
:
string
}
data_table_module
:
{
...
...
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