add side menu and info

This commit is contained in:
AceDataCloud committed 2023-04-19 01:37:42 +08:00
1 parent 5b076b2374
commit 0577efe43a
7 files changed
+57 -4

No files matched your search

+1
View File
@@ -90,6 +90,7 @@ export default defineComponent({
onDeleteConversation(id: string) {
const newConversations = this.conversations.filter((i: IConversation) => i.id !== id);
this.$store.dispatch('setConversations', newConversations);
this.onNewConversation();
}
}
});
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<el-dialog :model-value="visible" @close="$emit('close')">
<el-dialog :model-value="visible" width="400px" @close="$emit('close')">
<h2 class="title">{{ $t('common.nav.setting') }}</h2>
<el-form label-width="120px">
<el-form-item :label="$t('setting.field.stream')">
@@ -1,5 +1,9 @@
<template>
<div class="new-message-box">
<span v-if="application" class="new-message-box-usage-info">
{{ $t('conversation.message.usedCount') }}: {{ application?.used_amount }}
{{ $t('conversation.message.remainingCount') }}: {{ application?.remaining_amount }}
</span>
<el-input
v-model="value"
type="textarea"
@@ -147,5 +151,13 @@ export default defineComponent({
font-size: 12px;
color: #666;
}
.new-message-box-usage-info {
color: #999;
font-size: 12px;
text-align: center;
display: block;
margin-bottom: 3px;
}
}
</style>
+3 -1
View File
@@ -22,5 +22,7 @@ export default {
errorUsedUp: '您的套餐次数已经用完,请购买更多次数继续使用',
errorUnknown: '服务器出现未知错误,请稍后重试或联系客服',
errorTimeout: '回答问题超时,请稍后重试',
howToBreakLine: '按 Shift+Enter 键可以换行'
howToBreakLine: '按 Shift+Enter 键可以换行',
remainingCount: '剩余次数',
usedCount: '使用次数'
};
+37 -2
View File
@@ -4,23 +4,47 @@
<left-navigator />
</el-aside>
<el-main class="main"> <router-view /> </el-main>
<el-button round class="menu" @click="drawer = true">
<font-awesome-icon icon="fa-solid fa-bars" class="icon-menu" />
</el-button>
<el-drawer v-model="drawer" :with-header="false" size="50%" class="drawer">
<left-navigator />
</el-drawer>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElMain, ElAside } from 'element-plus';
import { ElMain, ElAside, ElButton, ElDrawer } from 'element-plus';
import LeftNavigator from '@/components/common/LeftNavigator.vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
export default defineComponent({
name: 'LayoutConversation',
components: {
ElMain,
LeftNavigator
ElAside,
ElDrawer,
ElButton,
LeftNavigator,
FontAwesomeIcon
},
data() {
return {
drawer: false
};
}
});
</script>
<style lang="scss">
.drawer {
.el-drawer__body {
padding: 0;
}
}
</style>
<style lang="scss" scoped>
.container {
display: flex;
@@ -33,6 +57,10 @@ export default defineComponent({
padding: 0;
}
.menu {
display: none;
}
$width: 300px;
.aside {
width: $width;
@@ -71,5 +99,12 @@ $width: 300px;
.main {
width: 100%;
}
.menu {
display: block;
position: fixed;
right: 20px;
top: 20px;
}
}
</style>
+1
View File
@@ -352,6 +352,7 @@ export default defineComponent({
this.messages[this.messages.length - 1].state = IMessageState.FINISHED;
}
this.onProcessConversation();
this.onCheckApplication();
})
.catch((error) => {
this.answering = false;
+2
View File
@@ -9,6 +9,7 @@ import {
import {
faMicrophone as faSolidMicrophone,
faStop as faSolidStop,
faBars as faSolidBars,
faGear as faSolidGear,
faRotateRight as faSolidRotateRight,
faCheck as faSolidCheck,
@@ -33,6 +34,7 @@ library.add(faRegularSun);
library.add(faSolidBolt);
library.add(faSolidGear);
library.add(faSolidMicrophone);
library.add(faSolidBars);
library.add(faSolidPlus);
library.add(faSolidQuestion);
library.add(faSolidStop);