refactor!: 调整应用配置的配置项,并将应用配置按钮从工具栏删除

BREAKING CHANGE: 删除配置项 `toolbar.enableAppSetting` ,并替换为 `app.enableAppSetting`
This commit is contained in:
Hooray Hu
2023-04-12 13:48:45 +08:00
parent 78f96aab15
commit 1be22ab94e
5 changed files with 44 additions and 14 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ watch(() => settingsStore.settings.menu.menuMode, (value) => {
})
onMounted(() => {
eventBus.on('global-theme-toggle', () => {
eventBus.on('global-app-setting-toggle', () => {
isShow.value = !isShow.value
})
})
-5
View File
@@ -62,11 +62,6 @@ function userCommand(command: 'home' | 'setting' | 'hotkeys' | 'logout') {
<svg-icon v-show="settingsStore.settings.app.colorScheme === 'dark'" name="ep:moon" />
</el-icon>
</span>
<span v-if="settingsStore.settings.toolbar.enableAppSetting" class="item" @click="eventBus.emit('global-theme-toggle')">
<el-icon>
<svg-icon name="ep:setting" />
</el-icon>
</span>
</div>
<el-dropdown class="user-container" size="default" @command="userCommand">
<div class="user-wrapper">
+37 -2
View File
@@ -6,11 +6,12 @@ import MainSidebar from './components/MainSidebar/index.vue'
import SubSidebar from './components/SubSidebar/index.vue'
import Topbar from './components/Topbar/index.vue'
import Search from './components/Search/index.vue'
import AppSetting from './components/AppSetting/index.vue'
import HotkeysIntro from './components/HotkeysIntro/index.vue'
import AppSetting from './components/AppSetting/index.vue'
import useSettingsStore from '@/store/modules/settings'
import useKeepAliveStore from '@/store/modules/keepAlive'
import useMenuStore from '@/store/modules/menu'
import eventBus from '@/utils/eventBus'
const routeInfo = useRoute()
@@ -87,8 +88,13 @@ onUnmounted(() => {
<el-backtop :right="20" :bottom="20" title="回到顶部" />
</div>
<Search />
<AppSetting />
<HotkeysIntro />
<div v-if="settingsStore.settings.app.enableAppSetting">
<el-icon class="app-setting" @click="eventBus.emit('global-app-setting-toggle')">
<svg-icon name="ep:setting" />
</el-icon>
<AppSetting />
</div>
</div>
</template>
@@ -222,6 +228,35 @@ header:not(.header-leave-active) + .wrapper {
}
}
.app-setting {
position: fixed;
z-index: 10;
right: 0;
top: calc(50% + 250px);
width: 50px;
height: 50px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
font-size: 24px;
color: #fff;
background-color: var(--el-color-primary);
cursor: pointer;
svg {
animation: rotate 5s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
// 主内容区动画
.main-enter-active {
transition: 0.2s;
+1 -1
View File
@@ -11,6 +11,7 @@ const globalSettingsDefault: RecursiveRequired<Settings.all> = {
enableProgress: true,
enableDynamicTitle: false,
routeBaseOn: 'frontend',
enableAppSetting: false,
},
home: {
enable: true,
@@ -35,7 +36,6 @@ const globalSettingsDefault: RecursiveRequired<Settings.all> = {
enableFullscreen: false,
enablePageReload: false,
enableColorScheme: false,
enableAppSetting: false,
},
breadcrumb: {
enable: true,
+5 -5
View File
@@ -50,6 +50,11 @@ declare namespace Settings {
* @可选值 `'filesystem'` 文件系统
*/
routeBaseOn?: 'frontend' | 'backend' | 'filesystem'
/**
* 是否开启应用配置,强烈建议在生产环境中关闭
* @默认值 `false`
*/
enableAppSetting?: boolean
}
interface home {
/**
@@ -135,11 +140,6 @@ declare namespace Settings {
* @默认值 `false`
*/
enableColorScheme?: boolean
/**
* 是否开启应用配置,强烈建议在生产环境中关闭
* @默认值 `false`
*/
enableAppSetting?: boolean
}
interface breadcrumb {
/**