Skip to content

Commit 7b1a52b

Browse files
feat: chat
1 parent fb98259 commit 7b1a52b

File tree

2 files changed

+67
-23
lines changed

2 files changed

+67
-23
lines changed

ui/src/views/chat/embed/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<template>
22
<div
3-
class="chat-embed layout-bg"
3+
class="chat-embed layout-bg chat-background"
44
:class="{ 'chat-embed--popup': isPopup }"
55
v-loading="loading"
66
:style="{
77
'--el-color-primary': applicationDetail?.custom_theme?.theme_color,
88
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
9+
backgroundImage: `url(${applicationDetail?.chat_background})`,
910
}"
1011
>
11-
<div class="chat-embed__header" :style="customStyle">
12+
<div class="chat-embed__header" :style="(user.isEE() || user.isPE()) && customStyle">
1213
<div class="flex align-center">
1314
<div class="mr-12 ml-24 flex">
1415
<el-avatar
@@ -19,7 +20,7 @@
1920
>
2021
<img :src="applicationDetail?.icon" alt="" />
2122
</el-avatar>
22-
<LogoIcon v-else height="32px" />
23+
<LogoIcon v-else height="32px" />
2324
</div>
2425

2526
<h4>{{ applicationDetail?.name }}</h4>

ui/src/views/chat/mobile/index.vue

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
<template>
22
<div
3-
class="chat-mobile layout-bg"
3+
class="chat-mobile layout-bg chat-background"
44
v-loading="loading"
55
:style="{
6-
'--el-color-primary': applicationDetail?.custom_theme?.theme_color,
7-
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
6+
'--el-color-primary': applicationDetail?.custom_theme?.theme_color,
7+
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
8+
backgroundImage: `url(${applicationDetail?.chat_background})`,
89
}"
910
>
10-
<div class="chat-embed__header" :style="customStyle">
11+
<div class="chat-embed__header" :style="(user.isEE() || user.isPE()) && customStyle">
1112
<div class="flex align-center">
12-
<AppIcon iconName="app-history-outlined" style="font-size: 20px" class="ml-16" :style="{
13-
color: applicationDetail?.custom_theme?.header_font_color,
14-
}" @click.prevent.stop="show = true" />
13+
<AppIcon
14+
iconName="app-history-outlined"
15+
style="font-size: 20px"
16+
class="ml-16"
17+
:style="{
18+
color: applicationDetail?.custom_theme?.header_font_color,
19+
}"
20+
@click.prevent.stop="show = true"
21+
/>
1522
<div class="mr-12 ml-16 flex">
16-
<el-avatar v-if="isAppIcon(applicationDetail?.icon)" shape="square" :size="32" style="background: none">
23+
<el-avatar
24+
v-if="isAppIcon(applicationDetail?.icon)"
25+
shape="square"
26+
:size="32"
27+
style="background: none"
28+
>
1729
<img :src="applicationDetail?.icon" alt="" />
1830
</el-avatar>
1931
<LogoIcon v-else height="32px" />
@@ -46,11 +58,22 @@
4658
</AiChat>
4759
</div>
4860

49-
<el-drawer v-model="show" :with-header="false" class="left-drawer" direction="ltr" :size="280">
61+
<el-drawer
62+
v-model="show"
63+
:with-header="false"
64+
class="left-drawer"
65+
direction="ltr"
66+
:size="280"
67+
>
5068
<div>
5169
<div class="flex align-center mb-16">
5270
<div class="flex mr-8">
53-
<el-avatar v-if="isAppIcon(applicationDetail?.icon)" shape="square" :size="32" style="background: none">
71+
<el-avatar
72+
v-if="isAppIcon(applicationDetail?.icon)"
73+
shape="square"
74+
:size="32"
75+
style="background: none"
76+
>
5477
<img :src="applicationDetail?.icon" alt="" />
5578
</el-avatar>
5679
<LogoIcon v-else height="32px" />
@@ -67,14 +90,30 @@
6790
<div class="left-height pt-0">
6891
<el-scrollbar>
6992
<div>
70-
<common-list :style="{ '--el-color-primary': applicationDetail?.custom_theme?.theme_color }"
71-
:data="chatLogData" v-loading="left_loading" :defaultActive="currentChatId" @click="clickListHandle"
72-
@mouseenter="mouseenter" @mouseleave="mouseId = ''">
93+
<common-list
94+
:style="{ '--el-color-primary': applicationDetail?.custom_theme?.theme_color }"
95+
:data="chatLogData"
96+
v-loading="left_loading"
97+
:defaultActive="currentChatId"
98+
@click="clickListHandle"
99+
@mouseenter="mouseenter"
100+
@mouseleave="mouseId = ''"
101+
>
73102
<template #default="{ row }">
74103
<div class="flex-between">
75-
<ReadWrite @change="editName($event, row)" :data="row.abstract" trigger="manual"
76-
:write="row.writeStatus" @close="closeWrite(row)" :maxlength="1024" />
77-
<div @click.stop v-if="mouseId === row.id && row.id !== 'new' && !row.writeStatus" class="flex">
104+
<ReadWrite
105+
@change="editName($event, row)"
106+
:data="row.abstract"
107+
trigger="manual"
108+
:write="row.writeStatus"
109+
@close="closeWrite(row)"
110+
:maxlength="1024"
111+
/>
112+
<div
113+
@click.stop
114+
v-if="mouseId === row.id && row.id !== 'new' && !row.writeStatus"
115+
class="flex"
116+
>
78117
<el-button style="padding: 0" link @click.stop="openWrite(row)">
79118
<el-icon>
80119
<EditPen />
@@ -104,7 +143,9 @@
104143
<el-avatar :size="32">
105144
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
106145
</el-avatar>
107-
<span v-if="chatUser.chat_profile?.authentication" class="ml-8 color-text-primary">{{ chatUser.chatUserProfile?.nick_name }}</span>
146+
<span v-if="chatUser.chat_profile?.authentication" class="ml-8 color-text-primary">{{
147+
chatUser.chatUserProfile?.nick_name
148+
}}</span>
108149
</div>
109150
</el-drawer>
110151
</div>
@@ -299,8 +340,8 @@ onMounted(() => {
299340
})
300341
301342
const userCenterDrawerShow = ref(false)
302-
function toUserCenter () {
303-
if(!chatUser.chat_profile?.authentication) return
343+
function toUserCenter() {
344+
if (!chatUser.chat_profile?.authentication) return
304345
userCenterDrawerShow.value = true
305346
}
306347
</script>
@@ -332,7 +373,9 @@ function toUserCenter () {
332373
.left-drawer {
333374
.el-drawer__body {
334375
padding: 16px;
335-
background: linear-gradient(187.61deg, rgba(235, 241, 255, 0.5) 39.6%, rgba(231, 249, 255, 0.5) 94.3%), #eef1f4;
376+
background:
377+
linear-gradient(187.61deg, rgba(235, 241, 255, 0.5) 39.6%, rgba(231, 249, 255, 0.5) 94.3%),
378+
#eef1f4;
336379
overflow: hidden;
337380
338381
.add-button {

0 commit comments

Comments
 (0)