update icon and styles
This commit is contained in:
1 parent
de088445f6
commit
301dab1ca5
10 files changed
+186
-17
No files matched your search
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="navigator">
|
||||
<div class="conversations">
|
||||
<navigator-item icon="fa-regular fa-user" :title="$t('common.nav.newChat')" @click="onNewConversation" />
|
||||
<navigator-item icon="fa-solid fa-plus" :title="$t('common.nav.newChat')" @click="onNewConversation" />
|
||||
<navigator-item
|
||||
v-for="(conversation, conversationIndex) in conversations"
|
||||
:key="conversationIndex"
|
||||
icon="fa-regular fa-user"
|
||||
icon="fa-regular fa-comment"
|
||||
:title="conversation.title"
|
||||
@click="onSelectConversation(conversation.id)"
|
||||
/>
|
||||
@@ -13,17 +13,17 @@
|
||||
<div class="operators">
|
||||
<navigator-item
|
||||
v-show="!confirming"
|
||||
icon="fa-regular fa-user"
|
||||
icon="fa-solid fa-trash"
|
||||
:title="$t('common.nav.clearConversations')"
|
||||
@click="confirming = true"
|
||||
/>
|
||||
<navigator-item
|
||||
v-show="confirming"
|
||||
icon="fa-regular fa-user"
|
||||
icon="fa-solid fa-check"
|
||||
:title="$t('common.nav.confirmClearConversations')"
|
||||
@click="onClearConversations"
|
||||
/>
|
||||
<navigator-item icon="fa-regular fa-user" :title="$t('common.nav.logOut')" @click="onLogout" />
|
||||
<navigator-item icon="fa-solid fa-arrow-right-from-bracket" :title="$t('common.nav.logOut')" @click="onLogout" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<div class="introduction">
|
||||
<h2 class="title">ChatGPT</h2>
|
||||
<el-row class="introduction-items" :gutter="15">
|
||||
<el-col :span="8">
|
||||
<div class="text-center">
|
||||
<font-awesome-icon icon="fa-regular fa-sun" class="icon icon-rotate" />
|
||||
</div>
|
||||
<h3 class="subtitle">{{ $t('conversation.title.example') }}</h3>
|
||||
<introduction-item
|
||||
:content="$t('conversation.message.writeCode')"
|
||||
class="cursor-pointer"
|
||||
@click="$emit('draft', $t('conversation.message.writeCode'))"
|
||||
/>
|
||||
<introduction-item
|
||||
:content="$t('conversation.message.writeEmail')"
|
||||
class="cursor-pointer"
|
||||
@click="$emit('draft', $t('conversation.message.writeEmail'))"
|
||||
/>
|
||||
<introduction-item
|
||||
:content="$t('conversation.message.explainDefinition')"
|
||||
class="cursor-pointer"
|
||||
@click="$emit('draft', $t('conversation.message.explainDefinition'))"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="text-center">
|
||||
<font-awesome-icon icon="fa-solid fa-bolt" class="icon icon-rotate" />
|
||||
</div>
|
||||
<h3 class="subtitle">{{ $t('conversation.title.capabilities') }}</h3>
|
||||
<introduction-item :content="$t('conversation.message.rememberHistory')" />
|
||||
<introduction-item :content="$t('conversation.message.supportStream')" />
|
||||
<introduction-item :content="$t('conversation.message.rejectInvalidPrompt')" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="text-center">
|
||||
<font-awesome-icon icon="fa-solid fa-triangle-exclamation" class="icon icon-rotate" />
|
||||
</div>
|
||||
<h3 class="subtitle">{{ $t('conversation.title.limitations') }}</h3>
|
||||
<introduction-item :content="$t('conversation.message.generateInCorrect')" />
|
||||
<introduction-item :content="$t('conversation.message.generateHarmfulInfo')" />
|
||||
<introduction-item :content="$t('conversation.message.onlyKnowBefore2021')" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import IntroductionItem from './IntroductionItem.vue';
|
||||
import { ElRow, ElCol } from 'element-plus';
|
||||
export default defineComponent({
|
||||
name: 'ConversationIntroduction',
|
||||
components: {
|
||||
FontAwesomeIcon,
|
||||
IntroductionItem,
|
||||
ElRow,
|
||||
ElCol
|
||||
},
|
||||
emits: ['draft'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.introduction {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
|
||||
.title {
|
||||
height: 70px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.introduction-items {
|
||||
height: fit-content;
|
||||
margin-bottom: 100px;
|
||||
.icon {
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.introduction-item {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="introduction-item">
|
||||
{{ content }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ConversationIntroductionItem',
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.introduction-item {
|
||||
font-size: 14px;
|
||||
background-color: #eee;
|
||||
color: #333;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -35,9 +35,6 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
conversationId() {
|
||||
return this.$route.params?.id?.toString();
|
||||
|
||||
@@ -28,9 +28,6 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
conversationId() {
|
||||
return this.$route.params?.id?.toString();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import message from './message';
|
||||
import title from './title';
|
||||
|
||||
export default {
|
||||
message
|
||||
message,
|
||||
title
|
||||
};
|
||||
@@ -4,5 +4,14 @@ export default {
|
||||
noInput: '问题不能为空',
|
||||
apiInfo: '本服务由「知数云」提供技术支持',
|
||||
tryForFree: '免费使用',
|
||||
initializing: '初始化中,请稍后...'
|
||||
initializing: '初始化中,请稍后...',
|
||||
writeCode: '写一段 JavaScript 代码,发送HTTP请求',
|
||||
writeEmail: '写一封邮件给 Bob,告诉他我刚刚搬家了',
|
||||
explainDefinition: '用简单的术语解释量子计算',
|
||||
rememberHistory: '可以记住用户说过的话',
|
||||
supportStream: '支持流式数据传输',
|
||||
rejectInvalidPrompt: '可以拒绝回答不恰当的提问',
|
||||
generateInCorrect: '可能偶尔产生不正确的信息',
|
||||
generateHarmfulInfo: '可能偶尔产生有害的指令或有偏见的内容',
|
||||
onlyKnowBefore2021: '对2021年之后的世界和事件了解有限'
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
example: '样例',
|
||||
capabilities: '功能',
|
||||
limitations: '限制'
|
||||
};
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="conversation">
|
||||
<div class="messages">
|
||||
<el-row v-if="!messages || messages.length === 0" class="introduction-wrapper">
|
||||
<el-col :span="12" :offset="6">
|
||||
<introduction @draft="onDraft" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-else class="messages-wrapper">
|
||||
<div
|
||||
v-for="(message, messageIndex) in messages"
|
||||
:key="messageIndex"
|
||||
@@ -57,6 +62,7 @@ import { ROUTE_AUTH_LOGIN, ROUTE_CONVERSATION_DETAIL } from '@/router/constants'
|
||||
import { ERROR_CODE_DUPLICATION, ERROR_CODE_UNVERIFIED } from '@/constants';
|
||||
import { getVerificationUrl } from '@/utils';
|
||||
import { IConversation } from '@/operators/conversation/models';
|
||||
import Introduction from '@/components/conversation/Introduction.vue';
|
||||
|
||||
export interface IData {
|
||||
input: string;
|
||||
@@ -71,6 +77,7 @@ export interface IData {
|
||||
export default defineComponent({
|
||||
name: 'ChatDetail',
|
||||
components: {
|
||||
Introduction,
|
||||
Message,
|
||||
ElRow,
|
||||
ElCol,
|
||||
@@ -188,6 +195,9 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
},
|
||||
onDraft(content: string) {
|
||||
this.input = content;
|
||||
},
|
||||
onSend() {
|
||||
if (!this.input) {
|
||||
ElMessage.error(this.$t('conversation.message.noInput'));
|
||||
@@ -303,9 +313,11 @@ export default defineComponent({
|
||||
min-height: 100vh;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
.messages {
|
||||
.messages-wrapper,
|
||||
.introduction-wrapper {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.message-wrapper {
|
||||
border-color: rgba(0, 0, 0, 0.1);
|
||||
border-bottom-width: 1px;
|
||||
|
||||
@@ -3,27 +3,41 @@ import {
|
||||
faCopy as faRegularCopy,
|
||||
faUser as faRegularUser,
|
||||
faIdCard as faRegularIdCard,
|
||||
faPaperPlane as faRegularPaperPlane
|
||||
faPaperPlane as faRegularPaperPlane,
|
||||
faComment as faRegularComment,
|
||||
faSun as faRegularSun
|
||||
} from '@fortawesome/free-regular-svg-icons';
|
||||
import {
|
||||
faRotateRight as faSolidRotateRight,
|
||||
faCheck as faSolidCheck,
|
||||
faPlus as faSolidPlus,
|
||||
faCube as faSolidCube,
|
||||
faCubes as faSolidCubes,
|
||||
faStore as faSolidStore,
|
||||
faBolt as faSolidBolt,
|
||||
faQuestion as faSolidQuestion,
|
||||
faTrash as faSolidTrash,
|
||||
faArrowsRotate as faSolidArrowsRotate,
|
||||
faUpRightFromSquare as faSolidUpRightFromSquare
|
||||
faUpRightFromSquare as faSolidUpRightFromSquare,
|
||||
faArrowRightFromBracket as faSolidArrowRightFromBracket,
|
||||
faTriangleExclamation as faSolidTriangleExclamation
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
library.add(faRegularCopy);
|
||||
library.add(faSolidRotateRight);
|
||||
library.add(faSolidCheck);
|
||||
library.add(faRegularUser);
|
||||
library.add(faRegularIdCard);
|
||||
library.add(faRegularSun);
|
||||
library.add(faSolidBolt);
|
||||
library.add(faSolidCube);
|
||||
library.add(faSolidCubes);
|
||||
library.add(faSolidStore);
|
||||
library.add(faSolidPlus);
|
||||
library.add(faSolidQuestion);
|
||||
library.add(faSolidTriangleExclamation);
|
||||
library.add(faSolidUpRightFromSquare);
|
||||
library.add(faSolidArrowsRotate);
|
||||
library.add(faRegularPaperPlane);
|
||||
library.add(faRegularComment);
|
||||
library.add(faSolidArrowRightFromBracket);
|
||||
library.add(faSolidTrash);
|
||||
Reference in new issue
Block a user