mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
feat(analysis): rename lab and move debug tools
This commit is contained in:
1 parent
e75bb1e556
commit
5aa330147b
8 files changed
+49
-61
No files matched your search
@@ -1,7 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { SectionTabs } from '@/components/navigation'
|
||||
import { DebugTab } from '@/components/DebugTab'
|
||||
import { useSettingsStore } from '@/stores/settings'
|
||||
import SQLLabTab from './SQLLabTab.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -10,22 +13,37 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
const settingsStore = useSettingsStore()
|
||||
const { debugMode } = storeToRefs(settingsStore)
|
||||
|
||||
// 保留实验室二级导航容器,后续新增实验能力时只需扩展这里的配置与内容分支。
|
||||
const subTabs = computed(() => [
|
||||
{
|
||||
id: 'sql-lab',
|
||||
label: t('ai.tab.sqlLab'),
|
||||
icon: 'i-heroicons-command-line',
|
||||
},
|
||||
])
|
||||
const subTabs = computed(() => {
|
||||
const tabs = [
|
||||
{
|
||||
id: 'sql-lab',
|
||||
label: t('ai.tab.sqlLab'),
|
||||
icon: 'i-heroicons-command-line',
|
||||
},
|
||||
]
|
||||
if (debugMode.value) {
|
||||
tabs.push({
|
||||
id: 'debug',
|
||||
label: t('analysis.tabs.debug'),
|
||||
icon: 'i-heroicons-bug-ant',
|
||||
})
|
||||
}
|
||||
return tabs
|
||||
})
|
||||
|
||||
const activeSubTab = ref('sql-lab')
|
||||
|
||||
watch(debugMode, (enabled) => {
|
||||
if (!enabled && activeSubTab.value === 'debug') activeSubTab.value = 'sql-lab'
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-full flex-col">
|
||||
<SectionTabs v-model="activeSubTab" :items="subTabs" persist-key="labTab" />
|
||||
<SectionTabs v-model="activeSubTab" :items="subTabs" persist-key="moreTab" />
|
||||
|
||||
<div class="min-h-0 flex-1 overflow-hidden">
|
||||
<Transition name="fade" mode="out-in">
|
||||
@@ -35,6 +53,7 @@ const activeSubTab = ref('sql-lab')
|
||||
:session-id="props.sessionId"
|
||||
:chat-type="props.chatType"
|
||||
/>
|
||||
<DebugTab v-else-if="activeSubTab === 'debug'" class="h-full" :session-id="props.sessionId" />
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@ const emit = defineEmits<{
|
||||
const { t } = useI18n()
|
||||
const layoutStore = useLayoutStore()
|
||||
|
||||
const timeSelectVisible = computed(() => !['ai-chat', 'memory', 'lab', 'debug'].includes(activeTab.value))
|
||||
const timeSelectVisible = computed(() => !['ai-chat', 'memory', 'more'].includes(activeTab.value))
|
||||
const navigationItems = computed(() =>
|
||||
props.tabs.map((tab) => ({
|
||||
id: tab.id,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"ranking": "Rankings",
|
||||
"aiChat": "AI Chat",
|
||||
"memory": "Memory",
|
||||
"lab": "Lab",
|
||||
"more": "More",
|
||||
"debug": "Debug"
|
||||
},
|
||||
"debug": {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"ranking": "ランキング",
|
||||
"aiChat": "AIチャット",
|
||||
"memory": "メモリー",
|
||||
"lab": "ラボ",
|
||||
"more": "その他",
|
||||
"debug": "Debug"
|
||||
},
|
||||
"debug": {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"ranking": "榜单",
|
||||
"aiChat": "AI对话",
|
||||
"memory": "记忆",
|
||||
"lab": "实验室",
|
||||
"more": "更多",
|
||||
"debug": "Debug"
|
||||
},
|
||||
"debug": {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"ranking": "榜單",
|
||||
"aiChat": "AI 對話",
|
||||
"memory": "記憶",
|
||||
"lab": "實驗室",
|
||||
"more": "更多",
|
||||
"debug": "Debug"
|
||||
},
|
||||
"debug": {
|
||||
|
||||
@@ -3,9 +3,8 @@ import { ref, computed, defineAsyncComponent, provide } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import LabTab from '@/components/analysis/LabTab.vue'
|
||||
import MoreTab from '@/components/analysis/MoreTab.vue'
|
||||
import MemoryTab from '@/components/analysis/MemoryTab.vue'
|
||||
import { DebugTab } from '@/components/DebugTab'
|
||||
import { ChatExplorer } from '@/components/AIChat'
|
||||
import GroupChatInsights from './components/insights/GroupChatInsights.vue'
|
||||
import RankingView from '@/components/analysis/ranking/RankingView.vue'
|
||||
@@ -52,24 +51,14 @@ function openChatRecordViewer() {
|
||||
}
|
||||
|
||||
// Tab 配置
|
||||
const baseTabs = [
|
||||
const tabs = [
|
||||
{ id: 'insights', labelKey: 'analysis.tabs.insights', icon: 'i-heroicons-presentation-chart-bar' },
|
||||
{ id: 'ranking', labelKey: 'analysis.tabs.ranking', icon: 'i-heroicons-trophy' },
|
||||
{ id: 'ai-chat', labelKey: 'analysis.tabs.aiChat', icon: 'i-heroicons-chat-bubble-left-ellipsis' },
|
||||
{ id: 'memory', labelKey: 'analysis.tabs.memory', icon: 'i-heroicons-light-bulb' },
|
||||
{ id: 'lab', labelKey: 'analysis.tabs.lab', icon: 'i-heroicons-beaker' },
|
||||
{ id: 'more', labelKey: 'analysis.tabs.more', icon: 'i-heroicons-squares-2x2' },
|
||||
]
|
||||
|
||||
// Tab 列表(Debug tab 仅在 debugMode 开启时显示)
|
||||
const tabs = computed(() => {
|
||||
if (settingsStore.debugMode) {
|
||||
return [...baseTabs, { id: 'debug', labelKey: 'analysis.tabs.debug', icon: 'i-heroicons-bug-ant' }]
|
||||
}
|
||||
return baseTabs
|
||||
})
|
||||
|
||||
const allTabIds = computed(() => tabs.value.map((tab) => tab.id))
|
||||
|
||||
const {
|
||||
activeTab,
|
||||
isLoading,
|
||||
@@ -93,7 +82,7 @@ const {
|
||||
currentSessionId,
|
||||
selectSession: sessionStore.selectSession,
|
||||
defaultTab: settingsStore.defaultSessionTab,
|
||||
validTabIds: allTabIds.value,
|
||||
validTabIds: tabs.map((tab) => tab.id),
|
||||
})
|
||||
|
||||
provide('session-switch-loading', isSessionSwitching)
|
||||
@@ -187,17 +176,12 @@ const filteredMemberCount = computed(() => {
|
||||
:session-id="currentSessionId!"
|
||||
:session-name="session.name"
|
||||
/>
|
||||
<LabTab
|
||||
v-else-if="activeTab === 'lab'"
|
||||
:key="'lab-' + currentSessionId"
|
||||
<MoreTab
|
||||
v-else-if="activeTab === 'more'"
|
||||
:key="'more-' + currentSessionId"
|
||||
:session-id="currentSessionId!"
|
||||
chat-type="group"
|
||||
/>
|
||||
<DebugTab
|
||||
v-else-if="activeTab === 'debug'"
|
||||
:key="'debug-' + currentSessionId"
|
||||
:session-id="currentSessionId!"
|
||||
/>
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,9 +3,8 @@ import { ref, computed, defineAsyncComponent, provide } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import LabTab from '@/components/analysis/LabTab.vue'
|
||||
import MoreTab from '@/components/analysis/MoreTab.vue'
|
||||
import MemoryTab from '@/components/analysis/MemoryTab.vue'
|
||||
import { DebugTab } from '@/components/DebugTab'
|
||||
import { ChatExplorer } from '@/components/AIChat'
|
||||
import PrivateChatInsights from './components/insights/PrivateChatInsights.vue'
|
||||
import MemberList from '@/components/common/member/MemberList.vue'
|
||||
@@ -49,22 +48,14 @@ function openChatRecordViewer() {
|
||||
layoutStore.openChatRecordDrawer({})
|
||||
}
|
||||
|
||||
// Tab 配置 - 私聊包含洞察、AI 对话和实验室
|
||||
const baseTabs = [
|
||||
// Tab 配置 - 私聊包含洞察、AI 对话、记忆和更多工具
|
||||
const tabs = [
|
||||
{ id: 'insights', labelKey: 'analysis.tabs.insights', icon: 'i-heroicons-presentation-chart-bar' },
|
||||
{ id: 'ai-chat', labelKey: 'analysis.tabs.aiChat', icon: 'i-heroicons-chat-bubble-left-ellipsis' },
|
||||
{ id: 'memory', labelKey: 'analysis.tabs.memory', icon: 'i-heroicons-light-bulb' },
|
||||
{ id: 'lab', labelKey: 'analysis.tabs.lab', icon: 'i-heroicons-beaker' },
|
||||
{ id: 'more', labelKey: 'analysis.tabs.more', icon: 'i-heroicons-squares-2x2' },
|
||||
]
|
||||
|
||||
// Tab 列表(Debug tab 仅在 debugMode 开启时显示)
|
||||
const tabs = computed(() => {
|
||||
if (settingsStore.debugMode) {
|
||||
return [...baseTabs, { id: 'debug', labelKey: 'analysis.tabs.debug', icon: 'i-heroicons-bug-ant' }]
|
||||
}
|
||||
return baseTabs
|
||||
})
|
||||
|
||||
const {
|
||||
activeTab,
|
||||
isLoading,
|
||||
@@ -87,7 +78,7 @@ const {
|
||||
currentSessionId,
|
||||
selectSession: sessionStore.selectSession,
|
||||
defaultTab: settingsStore.defaultSessionTab,
|
||||
validTabIds: tabs.value.map((tab) => tab.id),
|
||||
validTabIds: tabs.map((tab) => tab.id),
|
||||
})
|
||||
|
||||
provide('session-switch-loading', isSessionSwitching)
|
||||
@@ -200,18 +191,12 @@ const otherMemberAvatar = computed(() => {
|
||||
:session-id="currentSessionId!"
|
||||
:session-name="session.name"
|
||||
/>
|
||||
<!-- Product decision: private-chat Lab only exposes SQL; keyword ranking remains group-chat only. -->
|
||||
<LabTab
|
||||
v-else-if="activeTab === 'lab'"
|
||||
:key="'lab-' + currentSessionId"
|
||||
<MoreTab
|
||||
v-else-if="activeTab === 'more'"
|
||||
:key="'more-' + currentSessionId"
|
||||
:session-id="currentSessionId!"
|
||||
chat-type="private"
|
||||
/>
|
||||
<DebugTab
|
||||
v-else-if="activeTab === 'debug'"
|
||||
:key="'debug-' + currentSessionId"
|
||||
:session-id="currentSessionId!"
|
||||
/>
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user