mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-10 02:07:12 +08:00
feat: save chat brief after question
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.75 14.25V15.75H2.25V14.25H15.75ZM15.75 3.75H2.25V15.75L2.09692 15.7419C1.39076 15.6704 0.82965 15.1092 0.758057 14.4031L0.75 14.25V3.75C0.75 2.92157 1.42157 2.25 2.25 2.25H15.75C16.5784 2.25 17.25 2.92157 17.25 3.75V14.25C17.25 15.0784 16.5784 15.75 15.75 15.75V3.75Z" fill="#1F2329"/>
|
||||
<path d="M5.625 5.25H3.375C3.27554 5.25 3.18016 5.28951 3.10983 5.35984C3.03951 5.43016 3 5.52554 3 5.625V6.375C3 6.47446 3.03951 6.56984 3.10983 6.64017C3.18016 6.71049 3.27554 6.75 3.375 6.75H5.625C5.67425 6.75 5.72301 6.7403 5.76851 6.72145C5.814 6.70261 5.85534 6.67499 5.89017 6.64017C5.92499 6.60534 5.95261 6.564 5.97146 6.51851C5.9903 6.47301 6 6.42425 6 6.375V5.625C6 5.57575 5.9903 5.52699 5.97146 5.48149C5.95261 5.436 5.92499 5.39466 5.89017 5.35984C5.85534 5.32501 5.814 5.29739 5.76851 5.27855C5.72301 5.2597 5.67425 5.25 5.625 5.25Z" fill="#1F2329"/>
|
||||
<path d="M5.625 7.5H3.375C3.27554 7.5 3.18016 7.53951 3.10983 7.60984C3.03951 7.68016 3 7.77554 3 7.875V8.625C3 8.72446 3.03951 8.81984 3.10983 8.89017C3.18016 8.96049 3.27554 9 3.375 9H5.625C5.67425 9 5.72301 8.9903 5.76851 8.97145C5.814 8.95261 5.85534 8.92499 5.89017 8.89017C5.92499 8.85534 5.95261 8.814 5.97146 8.76851C5.9903 8.72301 6 8.67425 6 8.625V7.875C6 7.82575 5.9903 7.77699 5.97146 7.73149C5.95261 7.686 5.92499 7.64466 5.89017 7.60984C5.85534 7.57501 5.814 7.54739 5.76851 7.52855C5.72301 7.5097 5.67425 7.5 5.625 7.5Z" fill="#1F2329"/>
|
||||
<path d="M6.75 3.75H8.25V14.25H6.75V3.75Z" fill="#1F2329"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -137,8 +137,8 @@ function handleCommand(command: string | number | object, chat: Chat) {
|
||||
--hover-color: var(--ed-color-primary-light-9);
|
||||
--active-color: var(--hover-color);
|
||||
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
@@ -152,6 +152,7 @@ function handleCommand(command: string | number | object, chat: Chat) {
|
||||
cursor: pointer;
|
||||
border-radius: 6px;
|
||||
line-height: 1em;
|
||||
font-size: 14px;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -177,15 +178,21 @@ function handleCommand(command: string | number | object, chat: Chat) {
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--hover-color);
|
||||
background-color: rgba(31, 35, 41, 0.1);
|
||||
|
||||
.icon-more {
|
||||
display: inline-flex;
|
||||
color: rgba(100, 106, 115, 1);
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(31, 35, 41, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--active-color);
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
<template>
|
||||
<el-container class="chat-container">
|
||||
<el-container class="chat-container no-padding">
|
||||
<el-aside v-if="!isAssistant" class="chat-container-left">
|
||||
<el-container class="chat-container-right-container">
|
||||
<el-header class="chat-list-header">
|
||||
<el-button type="primary" @click="createNewChat">
|
||||
<div class="title">
|
||||
<div>智能问数</div>
|
||||
<el-button link type="primary" class="icon-btn">
|
||||
<el-icon>
|
||||
<icon_sidebar_outlined />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button class="btn" type="primary" @click="createNewChat">
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
{{ t('qa.New Conversation') }}
|
||||
</el-button>
|
||||
<el-input v-model="search" class="search" placeholder="placeholder" />
|
||||
</el-header>
|
||||
<el-main class="chat-list">
|
||||
<ChatList
|
||||
@@ -166,6 +175,7 @@ import MdComponent from './component/MdComponent.vue'
|
||||
import RecommendQuestion from './RecommendQuestion.vue'
|
||||
import ChatCreator from './ChatCreator.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import icon_sidebar_outlined from '@/assets/svg/icon_sidebar_outlined.svg'
|
||||
import { endsWith, find, startsWith } from 'lodash-es'
|
||||
|
||||
import { useAssistantStore } from '@/stores/assistant'
|
||||
@@ -231,6 +241,8 @@ const goEmpty = () => {
|
||||
inputMessage.value = ''
|
||||
}
|
||||
|
||||
const search = ref<string>()
|
||||
|
||||
const createNewChat = async () => {
|
||||
goEmpty()
|
||||
if (isAssistant.value) {
|
||||
@@ -494,6 +506,14 @@ const sendMessage = async () => {
|
||||
case 'info':
|
||||
console.log(data.msg)
|
||||
break
|
||||
case 'brief':
|
||||
currentChat.value.brief = data.brief
|
||||
chatList.value.forEach((c: Chat) => {
|
||||
if (c.id === currentChat.value.id) {
|
||||
c.brief = currentChat.value.brief
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'error':
|
||||
currentRecord.error = data.content
|
||||
isTyping.value = false
|
||||
@@ -808,21 +828,57 @@ defineExpose({
|
||||
.chat-container {
|
||||
height: 100%;
|
||||
|
||||
.icon-btn {
|
||||
min-width: unset;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
font-size: 18px;
|
||||
|
||||
&:hover {
|
||||
background: rgba(31, 35, 41, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.chat-container-left {
|
||||
--ed-aside-width: 260px;
|
||||
--ed-aside-width: 280px;
|
||||
border-radius: 12px 0 0 12px;
|
||||
//box-shadow: 0 0 3px #d7d7d7;
|
||||
//z-index: 1;
|
||||
|
||||
box-shadow: 0 0 3px #d7d7d7;
|
||||
z-index: 1;
|
||||
|
||||
background: var(--ed-fill-color-blank);
|
||||
background: rgba(245, 246, 247, 1);
|
||||
|
||||
.chat-container-right-container {
|
||||
height: 100%;
|
||||
|
||||
.chat-list-header {
|
||||
--ed-header-padding: 16px;
|
||||
--ed-header-height: calc(16px + 24px + 16px + 40px + 16px + 32px + 16px);
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.title {
|
||||
height: 24px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.search {
|
||||
height: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-list {
|
||||
@@ -833,7 +889,7 @@ defineExpose({
|
||||
|
||||
.chat-record-list {
|
||||
padding: 0 0 20px 0;
|
||||
background: rgba(224, 224, 226, 0.29);
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.chat-footer {
|
||||
|
||||
@@ -216,7 +216,7 @@ defineExpose({
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less">
|
||||
<style lang="less" scoped>
|
||||
.custom-drawer {
|
||||
.ed-drawer__footer {
|
||||
height: 64px !important;
|
||||
@@ -235,9 +235,9 @@ defineExpose({
|
||||
.chat-container-left {
|
||||
padding-top: 20px;
|
||||
--ed-aside-width: 260px;
|
||||
|
||||
box-shadow: 0 0 3px #d7d7d7;
|
||||
z-index: 1;
|
||||
border-radius: 12px 0 0 12px;
|
||||
//box-shadow: 0 0 3px #d7d7d7;
|
||||
//z-index: 1;
|
||||
|
||||
background: var(--ed-fill-color-blank);
|
||||
|
||||
@@ -258,7 +258,7 @@ defineExpose({
|
||||
|
||||
.chat-record-list {
|
||||
padding: 0 0 20px 0;
|
||||
background: rgba(224, 224, 226, 0.29);
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.chat-footer {
|
||||
|
||||
Reference in New Issue
Block a user