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
ea9e68b2
Commit
ea9e68b2
authored
Nov 03, 2024
by
shirlyn.guo
👌🏻
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.gsstcloud.com/poc/poc-fe
into shirlyn
parents
491141b5
e1e55d9f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
60 deletions
+96
-60
footer-operation.vue
src/views/home/components/footer-operation.vue
+7
-0
message-item.vue
src/views/home/components/message-item.vue
+11
-7
home.vue
src/views/home/home.vue
+23
-3
types.d.ts
src/views/home/types.d.ts
+2
-0
app-preview.vue
...nal-space/personal-app-setting/components/app-preview.vue
+53
-50
No files found.
src/views/home/components/footer-operation.vue
View file @
ea9e68b2
...
...
@@ -112,8 +112,13 @@ function questionSubmit() {
content
:
questionContent
.
value
.
trim
(),
timestamp
:
Date
.
now
(),
isAnswerLoading
:
false
,
avatar
:
''
,
name
:
''
,
})
const
agentAvatar
=
currentAgentApplication
.
value
.
agentAvatar
const
agentName
=
currentAgentApplication
.
value
.
agentTitle
nextTick
(()
=>
{
emit
(
'addMessageItem'
,
latestAssistantMessageKey
,
{
role
:
'assistant'
,
...
...
@@ -121,6 +126,8 @@ function questionSubmit() {
content
:
''
,
timestamp
:
Date
.
now
(),
isAnswerLoading
:
true
,
avatar
:
agentAvatar
,
name
:
agentName
,
})
emit
(
'messageListScrollToBottom'
)
...
...
src/views/home/components/message-item.vue
View file @
ea9e68b2
...
...
@@ -14,25 +14,29 @@ const props = defineProps<Props>()
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
agentAvatarUrl
=
readonly
({
url
:
'https://gsst-poe-sit.gz.bcebos.com/icon/agent-avatar.png'
})
const
agent
Default
AvatarUrl
=
readonly
({
url
:
'https://gsst-poe-sit.gz.bcebos.com/icon/agent-avatar.png'
})
const
isAgentMessage
=
computed
(()
=>
{
return
props
.
messageItem
.
role
===
'assistant'
})
const
avatarUrl
=
computed
(()
=>
{
return
isAgentMessage
.
value
?
props
.
messageItem
.
avatar
||
agentDefaultAvatarUrl
.
url
:
userStore
.
userInfo
.
avatarUrl
})
const
name
=
computed
(()
=>
{
return
isAgentMessage
.
value
?
props
.
messageItem
.
name
||
'AI助理'
:
userStore
.
userInfo
.
nickName
})
</
script
>
<
template
>
<div
class=
"mb-[20px] last:mb-0"
>
<div
class=
"flex"
>
<img
class=
"h-[36px] w-[36px]"
:src=
"isAgentMessage ? agentAvatarUrl.url : userStore.userInfo.avatarUrl"
alt=
"Avatar"
/>
<img
class=
"h-[36px] w-[36px]"
:src=
"avatarUrl"
alt=
"Avatar"
/>
<div
class=
"ml-[11px]"
>
<div
class=
"mb-[7px] text-[12px] text-[#999]"
>
{{
isAgentMessage
?
'AI助理'
:
userStore
.
userInfo
.
nickN
ame
}}
{{
n
ame
}}
</div>
<div
class=
"box-content min-h-[21px] min-w-[10px] rounded-[10px] border border-[#9EA3FF] px-[15px] py-[14px] text-justify"
...
...
src/views/home/home.vue
View file @
ea9e68b2
...
...
@@ -152,11 +152,31 @@ function onGetMessageRecordList(recordId: string) {
const
loadingCtl
=
window
.
$message
.
loading
(
t
(
'home_module.switching_over'
))
fetchMessageRecordList
<
MessageItemInterface
[]
>
(
recordId
)
fetchMessageRecordList
<
{
role
:
'user'
|
'assistant'
agentId
:
string
agentAvatar
:
string
agentTitle
:
string
content
:
string
timestamp
:
number
}[]
>
(
recordId
)
.
then
((
res
)
=>
{
if
(
res
.
data
&&
Array
.
isArray
(
res
.
data
))
{
const
messageListDraft
=
res
.
data
.
map
((
recordItem
)
=>
{
return
[
nanoid
(),
{
...
recordItem
,
isAnswerLoading
:
false
}]
const
messageListDraft
:
(
string
|
MessageItemInterface
)[][]
=
res
.
data
.
map
((
recordItem
)
=>
{
return
[
nanoid
(),
{
role
:
recordItem
.
role
,
agentId
:
recordItem
.
agentId
,
content
:
recordItem
.
content
,
isAnswerLoading
:
false
,
name
:
recordItem
.
agentTitle
,
avatar
:
recordItem
.
agentAvatar
,
timestamp
:
recordItem
.
timestamp
,
},
]
})
messageList
.
value
=
new
Map
(
messageListDraft
as
any
)
...
...
src/views/home/types.d.ts
View file @
ea9e68b2
...
...
@@ -13,4 +13,6 @@ export interface MessageItemInterface {
content
:
string
timestamp
:
number
isAnswerLoading
:
boolean
avatar
:
string
name
:
string
}
src/views/personal-space/personal-app-setting/components/app-preview.vue
View file @
ea9e68b2
...
...
@@ -2,6 +2,7 @@
import
{
ref
}
from
'vue'
import
Preamble
from
'./preamble.vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useRouter
}
from
'vue-router'
import
MessageList
from
'./message-list.vue'
import
FooterInput
from
'./footer-input.vue'
import
{
fetchCreateContinueQuestions
}
from
'@/apis/agent-application'
...
...
@@ -11,7 +12,7 @@ import MemoryPreviewModal from './memory-preview-modal.vue'
const
{
t
}
=
useI18n
()
//
const router = useRouter()
const
router
=
useRouter
()
const
personalAppConfigStore
=
usePersonalAppConfigStore
()
...
...
@@ -74,14 +75,14 @@ function handleUpdateContinueQuestionStatus(status: 'default' | 'close') {
continuousQuestionList
.
value
=
[]
}
//
function handleTurnMultiModelDialogue() {
//
router.push({
//
name: 'MultiModelDialogue',
//
params: {
//
agentId: personalAppConfigStore.baseInfo.agentId,
//
},
//
})
//
}
function
handleTurnMultiModelDialogue
()
{
router
.
push
({
name
:
'MultiModelDialogue'
,
params
:
{
agentId
:
personalAppConfigStore
.
baseInfo
.
agentId
,
},
})
}
function
handleOpenMemoryPreviewModal
(
MemoryTabName
:
string
)
{
selectedMemoryTabName
.
value
=
MemoryTabName
...
...
@@ -97,6 +98,16 @@ function handleOpenMemoryPreviewModal(MemoryTabName: string) {
{{
t
(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.preview'
)
}}
</p>
<div
class=
"flex items-center"
>
<div
v-show=
"personalAppConfigStore.baseInfo.agentId"
class=
"text-font-color hover:text-theme-color cursor-pointer"
@
click=
"handleTurnMultiModelDialogue"
>
<i
class=
"iconfont icon-moxing mr-1 text-sm"
/>
<span>
{{
t
(
'common_module.multi_model_debug'
)
}}
</span>
</div>
<div
v-show=
"
personalAppConfigStore.commConfig.variableStructure !== null ||
...
...
@@ -133,15 +144,7 @@ function handleOpenMemoryPreviewModal(MemoryTabName: string) {
</n-popover>
</div>
</div>
<!-- <div
v-show="personalAppConfigStore.baseInfo.agentId"
class="text-font-color hover:text-theme-color cursor-pointer"
@click="handleTurnMultiModelDialogue"
>
<i class="iconfont icon-moxing mr-1 text-sm" />
<span>{{ t('common_module.multi_model_debug') }}</span>
</div> -->
</div>
</div>
<div
class=
"flex w-full flex-1 overflow-hidden"
>
...
...
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