2022-04-21 18:20:39 +08:00
|
|
|
<script lang="ts" setup>
|
2022-04-22 01:16:02 +08:00
|
|
|
import { reactive, watch } from "vue"
|
2022-04-22 12:47:04 +08:00
|
|
|
import { useSettingsStore } from "@/store/modules/settings"
|
2022-04-21 18:20:39 +08:00
|
|
|
|
|
|
|
const settingsStore = useSettingsStore()
|
|
|
|
|
|
|
|
const state = reactive({
|
|
|
|
fixedHeader: settingsStore.fixedHeader,
|
|
|
|
showTagsView: settingsStore.showTagsView,
|
|
|
|
showSidebarLogo: settingsStore.showSidebarLogo,
|
|
|
|
showThemeSwitch: settingsStore.showThemeSwitch,
|
|
|
|
showScreenfull: settingsStore.showScreenfull
|
|
|
|
})
|
|
|
|
|
|
|
|
watch(
|
|
|
|
() => state.fixedHeader,
|
|
|
|
(value) => {
|
|
|
|
settingsStore.changeSetting({
|
2022-04-22 01:16:02 +08:00
|
|
|
key: "fixedHeader",
|
2022-04-21 18:20:39 +08:00
|
|
|
value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
|
|
|
watch(
|
|
|
|
() => state.showTagsView,
|
|
|
|
(value) => {
|
|
|
|
settingsStore.changeSetting({
|
2022-04-22 01:16:02 +08:00
|
|
|
key: "showTagsView",
|
2022-04-21 18:20:39 +08:00
|
|
|
value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
|
|
|
watch(
|
|
|
|
() => state.showSidebarLogo,
|
|
|
|
(value) => {
|
|
|
|
settingsStore.changeSetting({
|
2022-04-22 01:16:02 +08:00
|
|
|
key: "showSidebarLogo",
|
2022-04-21 18:20:39 +08:00
|
|
|
value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
|
|
|
watch(
|
|
|
|
() => state.showThemeSwitch,
|
|
|
|
(value) => {
|
|
|
|
settingsStore.changeSetting({
|
2022-04-22 01:16:02 +08:00
|
|
|
key: "showThemeSwitch",
|
2022-04-21 18:20:39 +08:00
|
|
|
value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
|
|
|
watch(
|
|
|
|
() => state.showScreenfull,
|
|
|
|
(value) => {
|
|
|
|
settingsStore.changeSetting({
|
2022-04-22 01:16:02 +08:00
|
|
|
key: "showScreenfull",
|
2022-04-21 18:20:39 +08:00
|
|
|
value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
|
|
|
</script>
|
|
|
|
|
2022-04-22 12:47:04 +08:00
|
|
|
<template>
|
|
|
|
<div class="drawer-container">
|
|
|
|
<div>
|
|
|
|
<h3 class="drawer-title">系统布局配置</h3>
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>显示 Tags-View</span>
|
|
|
|
<el-switch v-model="state.showTagsView" class="drawer-switch" />
|
|
|
|
</div>
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>显示侧边栏 Logo</span>
|
|
|
|
<el-switch v-model="state.showSidebarLogo" class="drawer-switch" />
|
|
|
|
</div>
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>固定 Header</span>
|
|
|
|
<el-switch v-model="state.fixedHeader" class="drawer-switch" />
|
|
|
|
</div>
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>显示换肤按钮</span>
|
|
|
|
<el-switch v-model="state.showThemeSwitch" class="drawer-switch" />
|
|
|
|
</div>
|
|
|
|
<div class="drawer-item">
|
|
|
|
<span>显示全屏按钮</span>
|
|
|
|
<el-switch v-model="state.showScreenfull" class="drawer-switch" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-04-21 18:20:39 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
.drawer-container {
|
|
|
|
padding: 24px;
|
|
|
|
font-size: 14px;
|
|
|
|
line-height: 1.5;
|
|
|
|
word-wrap: break-word;
|
|
|
|
.drawer-title {
|
|
|
|
margin-bottom: 12px;
|
|
|
|
font-size: 14px;
|
|
|
|
line-height: 22px;
|
|
|
|
}
|
|
|
|
.drawer-item {
|
|
|
|
font-size: 14px;
|
|
|
|
padding: 12px 0;
|
|
|
|
}
|
|
|
|
.drawer-switch {
|
|
|
|
float: right;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|