fix style

This commit is contained in:
AceDataCloud committed 2023-12-29 23:53:47 +08:00
1 parent f39e155301
commit f1d9fc3778
4 files changed
+27 -5

No files matched your search

+16 -3
View File
@@ -1,8 +1,15 @@
<template> <template>
<div class="sidebar"> <div class="sidebar">
<el-skeleton v-if="loading && conversations === undefined" /> <el-skeleton v-if="loading && conversations === undefined" />
<div v-else-if="conversations?.length === 0"> <div v-else-if="conversations?.length === 0" class="conversations">
<p class="p-5 description">{{ $t('chat.message.noConversations') }}</p> <div class="conversation" @click="onNewConversation">
<div class="icons">
<font-awesome-icon icon="fa-solid fa-plus" class="icon" />
</div>
<div class="title">
{{ $t('chat.message.startNewChat') }}
</div>
</div>
</div> </div>
<div v-else class="conversations"> <div v-else class="conversations">
<div <div
@@ -63,7 +70,7 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { ElSkeleton, ElInput } from 'element-plus'; import { ElSkeleton, ElInput } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { ROUTE_CHAT_CONVERSATION } from '@/router/constants'; import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from '@/router/constants';
import { apiUsageOperator, IApplication, chatOperator, applicationOperator } from '@/operators'; import { apiUsageOperator, IApplication, chatOperator, applicationOperator } from '@/operators';
import { IChatConversation } from '@/operators/chat/models'; import { IChatConversation } from '@/operators/chat/models';
import { import {
@@ -110,6 +117,11 @@ export default defineComponent({
await this.onFetchConversations(); await this.onFetchConversations();
}, },
methods: { methods: {
async onNewConversation() {
this.$router.push({
name: ROUTE_CHAT_CONVERSATION_NEW
});
},
async onFetchApplications() { async onFetchApplications() {
this.initializing = true; this.initializing = true;
const { data: applications } = await applicationOperator.getAll({ const { data: applications } = await applicationOperator.getAll({
@@ -207,6 +219,7 @@ export default defineComponent({
.title { .title {
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
line-height: 32px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
padding-right: 8px; padding-right: 8px;
+9 -1
View File
@@ -2,7 +2,13 @@
<div class="sidebar"> <div class="sidebar">
<div class="top"> <div class="top">
<div v-for="(link, linkIndex) in links" :key="linkIndex" class="link"> <div v-for="(link, linkIndex) in links" :key="linkIndex" class="link">
<el-button class="button" @click="$router.push(link.route)"> <el-button
:class="{
button: true,
active: $route.name === link.route.name
}"
@click="$router.push(link.route)"
>
<font-awesome-icon :icon="link.icon" /> <font-awesome-icon :icon="link.icon" />
</el-button> </el-button>
</div> </div>
@@ -79,9 +85,11 @@ export default defineComponent({
border-radius: 10px; border-radius: 10px;
border: none; border: none;
background-color: var(--el-bg-color-page); background-color: var(--el-bg-color-page);
&.active,
&:hover, &:hover,
&:focus { &:focus {
background-color: var(--el-button-hover-bg-color); background-color: var(--el-button-hover-bg-color);
color: var(--el-button-active-text-color);
} }
} }
} }
+1 -1
View File
@@ -1,5 +1,5 @@
export default { export default {
startNewChat: '开始新的聊天', startNewChat: '开始新的会话',
noToken: '请先申请对应服务', noToken: '请先申请对应服务',
newMessagePlaceholder: '请输入你的问题...', newMessagePlaceholder: '请输入你的问题...',
noInput: '问题不能为空', noInput: '问题不能为空',
+1
View File
@@ -48,6 +48,7 @@ export default defineComponent({
width: 300px; width: 300px;
height: 100%; height: 100%;
border-right: 1px solid #eee; border-right: 1px solid #eee;
overflow-y: scroll;
} }
} }
} }