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