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
55504f08
Commit
55504f08
authored
Nov 13, 2024
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(首页): 体验优化
parent
92997eb3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
35 deletions
+48
-35
markdown-render.vue
src/components/markdown-render/markdown-render.vue
+2
-1
agent-about.vue
src/views/home/components/agent-about.vue
+1
-1
footer-operation.vue
src/views/home/components/footer-operation.vue
+23
-19
message-bubble-loading.vue
src/views/home/components/message-bubble-loading.vue
+4
-3
message-item.vue
src/views/home/components/message-item.vue
+17
-10
personal-settings.vue
src/views/personal-settings/personal-settings.vue
+1
-1
No files found.
src/components/markdown-render/markdown-render.vue
View file @
55504f08
...
@@ -64,7 +64,8 @@ watchEffect(() => {
...
@@ -64,7 +64,8 @@ watchEffect(() => {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.article-container
{
.article-container
{
letter-spacing
:
0
.1ch
;
// letter-spacing: 0.1ch;
font-family
:
'Microsoft YaHei UI'
;
background-color
:
unset
;
background-color
:
unset
;
}
}
</
style
>
</
style
>
src/views/home/components/agent-about.vue
View file @
55504f08
...
@@ -134,7 +134,7 @@ const handleRecommendQuestionListUpdate = debounce(
...
@@ -134,7 +134,7 @@ const handleRecommendQuestionListUpdate = debounce(
<div
v-else
class=
"flex-center flex"
>
<div
v-else
class=
"flex-center flex"
>
<div
class=
"font-600 flex items-center rounded-[31px] bg-[#ECEFFF] px-[38px] py-[11px] text-[18px]"
>
<div
class=
"font-600 flex items-center rounded-[31px] bg-[#ECEFFF] px-[38px] py-[11px] text-[18px]"
>
<div
<div
class=
"mr-[6px] h-[22px] w-[22px]
bg-contain
bg-no-repeat"
class=
"mr-[6px] h-[22px] w-[22px]
rounded-[6px] bg-cover
bg-no-repeat"
:style=
"{ backgroundImage: `url(${currentAgentApplication.agentAvatar})` }"
:style=
"{ backgroundImage: `url(${currentAgentApplication.agentAvatar})` }"
></div>
></div>
<span>
{{ currentAgentApplication.agentTitle || '--' }}
</span>
<span>
{{ currentAgentApplication.agentTitle || '--' }}
</span>
...
...
src/views/home/components/footer-operation.vue
View file @
55504f08
...
@@ -44,9 +44,13 @@ const isQuestionSubmitBtnDisabled = computed(() => {
...
@@ -44,9 +44,13 @@ const isQuestionSubmitBtnDisabled = computed(() => {
getAgentApplicationSelectList
()
getAgentApplicationSelectList
()
})()
})()
const
messageListScrollToBottomThrottle
=
throttle
(()
=>
{
const
messageListScrollToBottomThrottle
=
throttle
(
emit
(
'messageListScrollToBottom'
)
()
=>
{
},
1000
)
emit
(
'messageListScrollToBottom'
)
},
500
,
{
leading
:
true
,
trailing
:
true
},
)
function
getAgentApplicationSelectList
()
{
function
getAgentApplicationSelectList
()
{
fetchAgentApplicationSelectList
<
AgentApplicationRecordItem
[]
>
().
then
((
res
)
=>
{
fetchAgentApplicationSelectList
<
AgentApplicationRecordItem
[]
>
().
then
((
res
)
=>
{
...
@@ -130,12 +134,14 @@ function questionSubmit() {
...
@@ -130,12 +134,14 @@ function questionSubmit() {
name
:
agentName
,
name
:
agentName
,
})
})
emit
(
'messageListScrollToBottom'
)
setTimeout
(()
=>
{
emit
(
'messageListScrollToBottom'
)
},
200
)
})
})
isAgentResponding
.
value
=
true
isAgentResponding
.
value
=
true
let
isFirstClip
=
true
//
let isFirstClip = true
let
messageContent
=
''
let
messageContent
=
''
currentFetchEventSourceController
.
value
=
fetchEventStreamSource
(
currentFetchEventSourceController
.
value
=
fetchEventStreamSource
(
...
@@ -149,22 +155,20 @@ function questionSubmit() {
...
@@ -149,22 +155,20 @@ function questionSubmit() {
onmessage
:
(
message
)
=>
{
onmessage
:
(
message
)
=>
{
messageContent
+=
message
messageContent
+=
message
if
(
isFirstClip
)
{
emit
(
'updateSpecifyMessageItem'
,
currentLatestMessageItemKeyMap
.
value
.
get
(
'assistant'
)
!
,
{
emit
(
'updateSpecifyMessageItem'
,
currentLatestMessageItemKeyMap
.
value
.
get
(
'assistant'
)
!
,
{
content
:
messageContent
,
content
:
message
,
})
isAnswerLoading
:
false
,
})
isFirstClip
=
false
messageListScrollToBottomThrottle
()
}
else
{
},
emit
(
'updateSpecifyMessageItem'
,
currentLatestMessageItemKeyMap
.
value
.
get
(
'assistant'
)
!
,
{
onend
:
()
=>
{
content
:
messageContent
,
emit
(
'updateSpecifyMessageItem'
,
currentLatestMessageItemKeyMap
.
value
.
get
(
'assistant'
)
!
,
{
})
content
:
messageContent
,
}
isAnswerLoading
:
false
,
})
messageListScrollToBottomThrottle
()
messageListScrollToBottomThrottle
()
},
},
onend
:
()
=>
{},
onclose
:
()
=>
{
onclose
:
()
=>
{
isAgentResponding
.
value
=
false
isAgentResponding
.
value
=
false
...
@@ -223,7 +227,7 @@ function handleQuestionSubmitEnter(event: KeyboardEvent) {
...
@@ -223,7 +227,7 @@ function handleQuestionSubmitEnter(event: KeyboardEvent) {
<div
class=
"box-border flex !w-[160px] w-full items-center justify-between px-[12px]"
>
<div
class=
"box-border flex !w-[160px] w-full items-center justify-between px-[12px]"
>
<div
class=
"mr-[5px] flex flex-1 items-center overflow-hidden"
>
<div
class=
"mr-[5px] flex flex-1 items-center overflow-hidden"
>
<div
<div
class=
"mr-[10px] h-[16px] w-[16px]
bg-contain
bg-no-repeat"
class=
"mr-[10px] h-[16px] w-[16px]
rounded-[6px] bg-cover
bg-no-repeat"
:class=
"
{ 'bg-px-home-cuixiang_icon-png': !currentAgentApplication.agentAvatar }"
:class=
"
{ 'bg-px-home-cuixiang_icon-png': !currentAgentApplication.agentAvatar }"
:style="{ backgroundImage: `url(${currentAgentApplication.agentAvatar})` }"
:style="{ backgroundImage: `url(${currentAgentApplication.agentAvatar})` }"
>
</div>
>
</div>
...
@@ -255,7 +259,7 @@ function handleQuestionSubmitEnter(event: KeyboardEvent) {
...
@@ -255,7 +259,7 @@ function handleQuestionSubmitEnter(event: KeyboardEvent) {
@
click=
"handleApplicationChange(item)"
@
click=
"handleApplicationChange(item)"
>
>
<div
<div
class=
"mr-[10px] h-[16px] w-[16px]
bg-contain
bg-no-repeat"
class=
"mr-[10px] h-[16px] w-[16px]
rounded-[6px] bg-cover
bg-no-repeat"
:class=
"
{ 'bg-px-home-cuixiang_icon-png': !item.agentAvatar }"
:class=
"
{ 'bg-px-home-cuixiang_icon-png': !item.agentAvatar }"
:style="{ backgroundImage: `url(${item.agentAvatar})` }"
:style="{ backgroundImage: `url(${item.agentAvatar})` }"
>
</div>
>
</div>
...
...
src/views/home/components/message-bubble-loading.vue
View file @
55504f08
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
interface
Props
{
interface
Props
{
activeColor
:
string
activeColor
?:
string
width
?:
string
}
}
const
{
activeColor
=
'#fff'
}
=
defineProps
<
Props
>
()
const
{
activeColor
=
'#fff'
,
width
=
'6px'
}
=
defineProps
<
Props
>
()
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -12,7 +13,7 @@ const { activeColor = '#fff' } = defineProps<Props>()
...
@@ -12,7 +13,7 @@ const { activeColor = '#fff' } = defineProps<Props>()
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.loader
{
.loader
{
width
:
6px
;
width
:
v-bind
(
'width'
)
;
aspect-ratio
:
1
;
aspect-ratio
:
1
;
border-radius
:
50%
;
border-radius
:
50%
;
animation
:
l5
1s
infinite
linear
alternate
;
animation
:
l5
1s
infinite
linear
alternate
;
...
...
src/views/home/components/message-item.vue
View file @
55504f08
...
@@ -32,7 +32,7 @@ const name = computed(() => {
...
@@ -32,7 +32,7 @@ const name = computed(() => {
<
template
>
<
template
>
<div
class=
"mb-[20px] last:mb-0"
>
<div
class=
"mb-[20px] last:mb-0"
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<img
class=
"h-[36px] w-[36px]
object-contain
"
:src=
"avatarUrl"
alt=
"Avatar"
/>
<img
class=
"h-[36px] w-[36px]
rounded-[6px] object-cover
"
:src=
"avatarUrl"
alt=
"Avatar"
/>
<div
class=
"ml-[11px]"
>
<div
class=
"ml-[11px]"
>
<div
class=
"mb-[7px] text-[12px] text-[#999]"
>
<div
class=
"mb-[7px] text-[12px] text-[#999]"
>
...
@@ -46,17 +46,24 @@ const name = computed(() => {
...
@@ -46,17 +46,24 @@ const name = computed(() => {
'!min-w-[80px]': messageItem.isAnswerLoading,
'!min-w-[80px]': messageItem.isAnswerLoading,
}"
}"
>
>
<MarkdownRender
<div
v-if=
"!messageItem.isAnswerLoading"
v-if=
"messageItem.isAnswerLoading && !messageItem.content"
:raw-text-content=
"
class=
"flex h-[21px] items-center justify-center"
messageItem.content ? messageItem.content : t('common_module.dialogue_module.empty_message_content')
>
"
:color=
"isAgentMessage ? '#fff' : '#192338'"
/>
<div
v-else
class=
"flex h-[21px] items-center justify-center"
>
<MessageBubbleLoading
:active-color=
"isAgentMessage ? '#fff' : '#192338'"
/>
<MessageBubbleLoading
:active-color=
"isAgentMessage ? '#fff' : '#192338'"
/>
</div>
</div>
<template
v-else
>
<MarkdownRender
:raw-text-content=
"
messageItem.content ? messageItem.content : t('common_module.dialogue_module.empty_message_content')
"
:color=
"isAgentMessage ? '#fff' : '#192338'"
/>
<div
v-if=
"messageItem.isAnswerLoading"
class=
"ml-[15px] pt-[12px]"
>
<MessageBubbleLoading
active-color=
"#fff"
width=
"5px"
/>
</div>
</
template
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/views/personal-settings/personal-settings.vue
View file @
55504f08
...
@@ -160,7 +160,7 @@ function handlePasswordChangeSubmit() {
...
@@ -160,7 +160,7 @@ function handlePasswordChangeSubmit() {
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"h-full flex-col rounded-[20px] bg-white p-6 shadow-[0_2px_2px_#0000000a]"
>
<div
class=
"h-full
min-h-fit
flex-col rounded-[20px] bg-white p-6 shadow-[0_2px_2px_#0000000a]"
>
<div
class=
"ml-[56px] pt-[6px]"
>
<div
class=
"ml-[56px] pt-[6px]"
>
<ul>
<ul>
<li
class=
"font-600 flex items-center text-[18px]"
>
<li
class=
"font-600 flex items-center text-[18px]"
>
...
...
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