perf: 兼容luna显示智能问答

This commit is contained in:
“huailei000”
2023-12-26 18:30:26 +08:00
committed by Bryan
parent 96a3f0a334
commit 1e9107ec4a
5 changed files with 54 additions and 4 deletions

View File

@@ -27,6 +27,9 @@
if(pathname.indexOf('/ui') === -1) {
window.location.href = window.location.origin + '/ui/#' + pathname
}
if (pathname.startsWith('/ui/#/chat')) {
window.location.href = window.location.origin + pathname
}
}
</script>
<div id="app"></div>

View File

@@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="close-sidebar">
<i class="el-icon-close" @click="onClose" />
<i v-if="hasClose" class="el-icon-close" @click="onClose" />
</div>
<el-tabs v-model="active" :tab-position="'right'" @tab-click="handleClick">
<el-tab-pane v-for="(item) in submenu" :key="item.name" :name="item.name">
@@ -22,6 +22,10 @@ export default {
type: String,
default: 'chat'
},
hasClose: {
type: Boolean,
default: true
},
submenu: {
type: Array,
default: () => []
@@ -48,9 +52,10 @@ export default {
height: 100%;
background-color: #f0f1f5;
.close-sidebar {
height: 48px;
padding: 12px 0;
text-align: center;
font-size: 14px;
padding: 12px 0;
cursor: pointer;
i {
font-size: 16px;

View File

@@ -18,7 +18,7 @@
</div>
</div>
<div class="sidebar">
<Sidebar :active.sync="active" :submenu="submenu" />
<Sidebar v-bind="$attrs" :active.sync="active" :submenu="submenu" />
</div>
</div>
</template>
@@ -62,11 +62,14 @@ export default {
watch: {
drawerPanelVisible(value) {
if (value && !ws) {
this.$refs.component?.init()
this.initWebSocket()
}
}
},
methods: {
initWebSocket() {
this.$refs.component?.init()
},
onClose() {
this.$parent.show = false
},

View File

@@ -30,6 +30,16 @@ export default [
component: () => import('@/views/settings/Task/CeleryTaskLog'),
name: 'TaskLog',
hidden: true,
meta: {
title: i18n.t('setting.ChatAI'),
permissions: []
}
},
{
path: '/chat/chat-ai/',
component: () => import('@/views/chat/ChatAi'),
name: 'ChatAi',
hidden: true,
meta: {
title: i18n.t('route.CeleryTaskLog'),
permissions: []

View File

@@ -0,0 +1,29 @@
<template>
<div class="chat-container">
<ChatAi ref="chat" :drawer-panel-visible="true" :has-close="false" />
</div>
</template>
<script>
import ChatAi from '@/components/Apps/ChatAi'
export default {
components: {
ChatAi
},
data() {
return {
}
},
mounted() {
this.$refs.chat.initWebSocket()
},
methods: {
}
}
</script>
<style scoped>
.chat-container {
height: 100vh;
}
</style>