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

This commit is contained in:
Hooray Hu
2023-04-12 13:46:58 +08:00
parent 58d4a56663
commit fffadc5f4f
6 changed files with 45 additions and 15 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
@@ -71,11 +71,6 @@ function pro() {
<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,12 +6,13 @@ 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 BuyIt from './components/BuyIt/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()
@@ -88,8 +89,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>
<BuyIt />
</div>
</template>
@@ -224,6 +230,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,
+1 -1
View File
@@ -4,6 +4,7 @@ const globalSettings: Settings.all = {
app: {
enablePermission: true,
enableDynamicTitle: true,
enableAppSetting: true,
},
layout: {
enableMobileAdaptation: true,
@@ -19,7 +20,6 @@ const globalSettings: Settings.all = {
enableFullscreen: true,
enablePageReload: true,
enableColorScheme: true,
enableAppSetting: 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 {
/**