发布:版本 0.3.0
- Markdown Mermaid 图表支持(10+ 种图表类型) - 代码语法高亮(20+ 种常用编程语言) - 文件列表优化(文件夹优先显示) - 文件系统模块化重构 - 新增内部更新日志 CHANGELOG.internal.md - 更新作者邮箱
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
<a-layout-content class="content">
|
||||
<!-- 动态渲染 Tab 内容 -->
|
||||
<!-- 使用 KeepAlive 缓存组件状态,避免切换时重新加载 -->
|
||||
<KeepAlive include="FileSystem,DbCli,DeviceTest">
|
||||
<KeepAlive include="FileSystem,DbCli">
|
||||
<component :is="getComponent(activeTab)"/>
|
||||
</KeepAlive>
|
||||
</a-layout-content>
|
||||
@@ -76,7 +76,6 @@
|
||||
import {computed, onMounted, ref, watch} from 'vue'
|
||||
import {IconSettings} from '@arco-design/web-vue/es/icon'
|
||||
import {Message} from '@arco-design/web-vue'
|
||||
import DeviceTest from './components/DeviceTest.vue'
|
||||
import DbCli from './views/db-cli/index.vue'
|
||||
import ThemeToggle from './components/ThemeToggle.vue'
|
||||
import FileSystem from './components/FileSystem/index.vue'
|
||||
@@ -86,9 +85,9 @@ import UpdateNotification from './components/UpdateNotification.vue'
|
||||
// 存储键
|
||||
const ACTIVE_TAB_STORAGE_KEY = 'app-active-tab'
|
||||
|
||||
// 从 localStorage 恢复上次打开的区域,默认为 'db-cli'
|
||||
// 从 localStorage 恢复上次打开的区域,默认为 'file-system'
|
||||
const savedTab = localStorage.getItem(ACTIVE_TAB_STORAGE_KEY)
|
||||
const activeTab = ref((savedTab === 'user' ? 'db-cli' : savedTab) || 'db-cli')
|
||||
const activeTab = ref((savedTab === 'user' ? 'file-system' : savedTab) || 'file-system')
|
||||
const showSettings = ref(false)
|
||||
const isMaximized = ref(false)
|
||||
|
||||
@@ -101,7 +100,7 @@ const checkedUpdate = ref(false)
|
||||
const appConfig = ref({
|
||||
tabs: [],
|
||||
visibleTabs: [],
|
||||
defaultTab: 'db-cli'
|
||||
defaultTab: 'file-system'
|
||||
})
|
||||
|
||||
// 可见 Tabs(根据配置动态生成)
|
||||
@@ -109,9 +108,8 @@ const visibleTabs = computed(() => {
|
||||
if (!appConfig.value.tabs || appConfig.value.tabs.length === 0) {
|
||||
// 默认配置
|
||||
return [
|
||||
{key: 'db-cli', title: '数据库'},
|
||||
{key: 'file-system', title: '文件管理'},
|
||||
{key: 'device', title: '设备调用测试'}
|
||||
{key: 'db-cli', title: '数据库'}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -148,7 +146,7 @@ const loadConfig = async () => {
|
||||
appConfig.value = {
|
||||
tabs: syncedTabs,
|
||||
visibleTabs: visibleTabs,
|
||||
defaultTab: result.data.defaultTab || 'db-cli'
|
||||
defaultTab: result.data.defaultTab || 'file-system'
|
||||
}
|
||||
|
||||
// 设置默认 Tab
|
||||
@@ -169,12 +167,11 @@ const loadConfig = async () => {
|
||||
const useDefaultConfig = () => {
|
||||
appConfig.value = {
|
||||
tabs: [
|
||||
{key: 'db-cli', title: '数据库', visible: true, enabled: true},
|
||||
{key: 'file-system', title: '文件管理', visible: true, enabled: true},
|
||||
{key: 'device', title: '设备调用测试', visible: true, enabled: true}
|
||||
{key: 'db-cli', title: '数据库', visible: true, enabled: true}
|
||||
],
|
||||
visibleTabs: ['db-cli', 'file-system', 'device'],
|
||||
defaultTab: 'db-cli'
|
||||
visibleTabs: ['file-system', 'db-cli'],
|
||||
defaultTab: 'file-system'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,9 +212,8 @@ const handleSaveConfig = async (config) => {
|
||||
// 获取组件
|
||||
const getComponent = (key) => {
|
||||
const components = {
|
||||
'db-cli': DbCli,
|
||||
'file-system': FileSystem,
|
||||
'device': DeviceTest
|
||||
'db-cli': DbCli
|
||||
}
|
||||
return components[key] || null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user