feat: chat

This commit is contained in:
wangdan-fit2cloud 2025-07-03 19:51:06 +08:00
parent fb98259881
commit 7b1a52beff
2 changed files with 67 additions and 23 deletions

View File

@ -1,14 +1,15 @@
<template> <template>
<div <div
class="chat-embed layout-bg" class="chat-embed layout-bg chat-background"
:class="{ 'chat-embed--popup': isPopup }" :class="{ 'chat-embed--popup': isPopup }"
v-loading="loading" v-loading="loading"
:style="{ :style="{
'--el-color-primary': applicationDetail?.custom_theme?.theme_color, '--el-color-primary': applicationDetail?.custom_theme?.theme_color,
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1), '--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
backgroundImage: `url(${applicationDetail?.chat_background})`,
}" }"
> >
<div class="chat-embed__header" :style="customStyle"> <div class="chat-embed__header" :style="(user.isEE() || user.isPE()) && customStyle">
<div class="flex align-center"> <div class="flex align-center">
<div class="mr-12 ml-24 flex"> <div class="mr-12 ml-24 flex">
<el-avatar <el-avatar

View File

@ -1,19 +1,31 @@
<template> <template>
<div <div
class="chat-mobile layout-bg" class="chat-mobile layout-bg chat-background"
v-loading="loading" v-loading="loading"
:style="{ :style="{
'--el-color-primary': applicationDetail?.custom_theme?.theme_color, '--el-color-primary': applicationDetail?.custom_theme?.theme_color,
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1), '--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
backgroundImage: `url(${applicationDetail?.chat_background})`,
}" }"
> >
<div class="chat-embed__header" :style="customStyle"> <div class="chat-embed__header" :style="(user.isEE() || user.isPE()) && customStyle">
<div class="flex align-center"> <div class="flex align-center">
<AppIcon iconName="app-history-outlined" style="font-size: 20px" class="ml-16" :style="{ <AppIcon
iconName="app-history-outlined"
style="font-size: 20px"
class="ml-16"
:style="{
color: applicationDetail?.custom_theme?.header_font_color, color: applicationDetail?.custom_theme?.header_font_color,
}" @click.prevent.stop="show = true" /> }"
@click.prevent.stop="show = true"
/>
<div class="mr-12 ml-16 flex"> <div class="mr-12 ml-16 flex">
<el-avatar v-if="isAppIcon(applicationDetail?.icon)" shape="square" :size="32" style="background: none"> <el-avatar
v-if="isAppIcon(applicationDetail?.icon)"
shape="square"
:size="32"
style="background: none"
>
<img :src="applicationDetail?.icon" alt="" /> <img :src="applicationDetail?.icon" alt="" />
</el-avatar> </el-avatar>
<LogoIcon v-else height="32px" /> <LogoIcon v-else height="32px" />
@ -46,11 +58,22 @@
</AiChat> </AiChat>
</div> </div>
<el-drawer v-model="show" :with-header="false" class="left-drawer" direction="ltr" :size="280"> <el-drawer
v-model="show"
:with-header="false"
class="left-drawer"
direction="ltr"
:size="280"
>
<div> <div>
<div class="flex align-center mb-16"> <div class="flex align-center mb-16">
<div class="flex mr-8"> <div class="flex mr-8">
<el-avatar v-if="isAppIcon(applicationDetail?.icon)" shape="square" :size="32" style="background: none"> <el-avatar
v-if="isAppIcon(applicationDetail?.icon)"
shape="square"
:size="32"
style="background: none"
>
<img :src="applicationDetail?.icon" alt="" /> <img :src="applicationDetail?.icon" alt="" />
</el-avatar> </el-avatar>
<LogoIcon v-else height="32px" /> <LogoIcon v-else height="32px" />
@ -67,14 +90,30 @@
<div class="left-height pt-0"> <div class="left-height pt-0">
<el-scrollbar> <el-scrollbar>
<div> <div>
<common-list :style="{ '--el-color-primary': applicationDetail?.custom_theme?.theme_color }" <common-list
:data="chatLogData" v-loading="left_loading" :defaultActive="currentChatId" @click="clickListHandle" :style="{ '--el-color-primary': applicationDetail?.custom_theme?.theme_color }"
@mouseenter="mouseenter" @mouseleave="mouseId = ''"> :data="chatLogData"
v-loading="left_loading"
:defaultActive="currentChatId"
@click="clickListHandle"
@mouseenter="mouseenter"
@mouseleave="mouseId = ''"
>
<template #default="{ row }"> <template #default="{ row }">
<div class="flex-between"> <div class="flex-between">
<ReadWrite @change="editName($event, row)" :data="row.abstract" trigger="manual" <ReadWrite
:write="row.writeStatus" @close="closeWrite(row)" :maxlength="1024" /> @change="editName($event, row)"
<div @click.stop v-if="mouseId === row.id && row.id !== 'new' && !row.writeStatus" class="flex"> :data="row.abstract"
trigger="manual"
:write="row.writeStatus"
@close="closeWrite(row)"
:maxlength="1024"
/>
<div
@click.stop
v-if="mouseId === row.id && row.id !== 'new' && !row.writeStatus"
class="flex"
>
<el-button style="padding: 0" link @click.stop="openWrite(row)"> <el-button style="padding: 0" link @click.stop="openWrite(row)">
<el-icon> <el-icon>
<EditPen /> <EditPen />
@ -104,7 +143,9 @@
<el-avatar :size="32"> <el-avatar :size="32">
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" /> <img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
</el-avatar> </el-avatar>
<span v-if="chatUser.chat_profile?.authentication" class="ml-8 color-text-primary">{{ chatUser.chatUserProfile?.nick_name }}</span> <span v-if="chatUser.chat_profile?.authentication" class="ml-8 color-text-primary">{{
chatUser.chatUserProfile?.nick_name
}}</span>
</div> </div>
</el-drawer> </el-drawer>
</div> </div>
@ -332,7 +373,9 @@ function toUserCenter () {
.left-drawer { .left-drawer {
.el-drawer__body { .el-drawer__body {
padding: 16px; padding: 16px;
background: linear-gradient(187.61deg, rgba(235, 241, 255, 0.5) 39.6%, rgba(231, 249, 255, 0.5) 94.3%), #eef1f4; background:
linear-gradient(187.61deg, rgba(235, 241, 255, 0.5) 39.6%, rgba(231, 249, 255, 0.5) 94.3%),
#eef1f4;
overflow: hidden; overflow: hidden;
.add-button { .add-button {