|
|
@ -38,35 +38,35 @@
|
|
|
|
<div class="drawer-item">
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>开启 TopNav</span>
|
|
|
|
<span>开启 TopNav</span>
|
|
|
|
<span class="comp-style">
|
|
|
|
<span class="comp-style">
|
|
|
|
<el-switch v-model="topNav" class="drawer-switch" />
|
|
|
|
<el-switch v-model="settingsStore.topNav" class="drawer-switch" />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="drawer-item">
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>开启 Tags-Views</span>
|
|
|
|
<span>开启 Tags-Views</span>
|
|
|
|
<span class="comp-style">
|
|
|
|
<span class="comp-style">
|
|
|
|
<el-switch v-model="tagsView" class="drawer-switch" />
|
|
|
|
<el-switch v-model="settingsStore.tagsView" class="drawer-switch" />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="drawer-item">
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>固定 Header</span>
|
|
|
|
<span>固定 Header</span>
|
|
|
|
<span class="comp-style">
|
|
|
|
<span class="comp-style">
|
|
|
|
<el-switch v-model="fixedHeader" class="drawer-switch" />
|
|
|
|
<el-switch v-model="settingsStore.fixedHeader" class="drawer-switch" />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="drawer-item">
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>显示 Logo</span>
|
|
|
|
<span>显示 Logo</span>
|
|
|
|
<span class="comp-style">
|
|
|
|
<span class="comp-style">
|
|
|
|
<el-switch v-model="sidebarLogo" class="drawer-switch" />
|
|
|
|
<el-switch v-model="settingsStore.sidebarLogo" class="drawer-switch" />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="drawer-item">
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>动态标题</span>
|
|
|
|
<span>动态标题</span>
|
|
|
|
<span class="comp-style">
|
|
|
|
<span class="comp-style">
|
|
|
|
<el-switch v-model="dynamicTitle" class="drawer-switch" />
|
|
|
|
<el-switch v-model="settingsStore.dynamicTitle" class="drawer-switch" />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
@ -80,7 +80,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import variables from '@/assets/styles/variables.module.scss'
|
|
|
|
import variables from '@/assets/styles/variables.module.scss'
|
|
|
|
import originElementPlus from 'element-plus/theme-chalk/index.css'
|
|
|
|
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
|
import { ElLoading, ElMessage } from 'element-plus'
|
|
|
|
import { ElLoading, ElMessage } from 'element-plus'
|
|
|
|
import { useDynamicTitle } from '@/utils/dynamicTitle'
|
|
|
|
import { useDynamicTitle } from '@/utils/dynamicTitle'
|
|
|
@ -99,55 +98,12 @@ const sideTheme = ref(settingsStore.sideTheme);
|
|
|
|
const storeSettings = computed(() => settingsStore);
|
|
|
|
const storeSettings = computed(() => settingsStore);
|
|
|
|
const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]);
|
|
|
|
const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]);
|
|
|
|
|
|
|
|
|
|
|
|
/** 是否需要topnav */
|
|
|
|
|
|
|
|
const topNav = computed({
|
|
|
|
|
|
|
|
get: () => storeSettings.value.topNav,
|
|
|
|
|
|
|
|
set: (val) => {
|
|
|
|
|
|
|
|
settingsStore.changeSetting({ key: 'topNav', value: val })
|
|
|
|
|
|
|
|
if (!val) {
|
|
|
|
|
|
|
|
appStore.toggleSideBarHide(false);
|
|
|
|
|
|
|
|
permissionStore.setSidebarRouters(permissionStore.defaultRoutes);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
/** 是否需要tagview */
|
|
|
|
|
|
|
|
const tagsView = computed({
|
|
|
|
|
|
|
|
get: () => storeSettings.value.tagsView,
|
|
|
|
|
|
|
|
set: (val) => {
|
|
|
|
|
|
|
|
settingsStore.changeSetting({ key: 'tagsView', value: val })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
/**是否需要固定头部 */
|
|
|
|
|
|
|
|
const fixedHeader = computed({
|
|
|
|
|
|
|
|
get: () => storeSettings.value.fixedHeader,
|
|
|
|
|
|
|
|
set: (val) => {
|
|
|
|
|
|
|
|
settingsStore.changeSetting({ key: 'fixedHeader', value: val })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
/**是否需要侧边栏的logo */
|
|
|
|
|
|
|
|
const sidebarLogo = computed({
|
|
|
|
|
|
|
|
get: () => storeSettings.value.sidebarLogo,
|
|
|
|
|
|
|
|
set: (val) => {
|
|
|
|
|
|
|
|
settingsStore.changeSetting({ key: 'sidebarLogo', value: val })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
/**是否需要侧边栏的动态网页的title */
|
|
|
|
|
|
|
|
const dynamicTitle = computed({
|
|
|
|
|
|
|
|
get: () => storeSettings.value.dynamicTitle,
|
|
|
|
|
|
|
|
set: (val) => {
|
|
|
|
|
|
|
|
settingsStore.changeSetting({ key: 'dynamicTitle', value: val })
|
|
|
|
|
|
|
|
// 动态设置网页标题
|
|
|
|
|
|
|
|
useDynamicTitle()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function themeChange(val) {
|
|
|
|
function themeChange(val) {
|
|
|
|
settingsStore.changeSetting({ key: 'theme', value: val })
|
|
|
|
settingsStore.theme = val;
|
|
|
|
theme.value = val;
|
|
|
|
|
|
|
|
handleThemeStyle(val);
|
|
|
|
handleThemeStyle(val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function handleTheme(val) {
|
|
|
|
function handleTheme(val) {
|
|
|
|
settingsStore.changeSetting({ key: 'sideTheme', value: val })
|
|
|
|
settingsStore.sideTheme = val;
|
|
|
|
sideTheme.value = val;
|
|
|
|
sideTheme.value = val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function saveSetting() {
|
|
|
|
function saveSetting() {
|
|
|
|