theme change is ready

This commit is contained in:
RockYang
2024-04-27 13:13:28 +08:00
parent 5b16dc6ee7
commit 039d949523
20 changed files with 162 additions and 44 deletions

View File

@@ -296,6 +296,12 @@ const changePlatform = () => {
.el-select {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content righ
}
}
.el-form {

View File

@@ -178,7 +178,7 @@
import {onMounted, ref} from "vue";
import {httpGet, httpPost} from "@/utils/http";
import {ElMessage} from "element-plus";
import {dateFormat, processContent, removeArrayItem} from "@/utils/libs";
import {dateFormat, processContent} from "@/utils/libs";
import {Search} from "@element-plus/icons-vue";
import 'highlight.js/styles/a11y-dark.css'
import hl from "highlight.js";
@@ -365,6 +365,12 @@ const showMessages = (row) => {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
.chat-box {
overflow-y: auto;
overflow-x hidden

View File

@@ -365,5 +365,11 @@ const remove = function (row) {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -328,5 +328,11 @@ const generateToken = () => {
text-align center
}
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -1,10 +1,10 @@
<template>
<div class="admin-home" v-if="isLogin">
<admin-sidebar/>
<admin-sidebar v-model:theme="theme"/>
<div class="content-box" :class="{ 'content-collapse': sidebar.collapse }">
<admin-header/>
<admin-tags/>
<div class="content dark">
<admin-header v-model:theme="theme" @changeTheme="changeTheme"/>
<admin-tags v-model:theme="theme"/>
<div :class="'content '+theme" :style="{height:contentHeight+'px'}">
<router-view v-slot="{ Component }">
<transition name="move" mode="out-in">
<keep-alive :include="tags.nameList">
@@ -25,10 +25,13 @@ import AdminTags from "@/components/admin/AdminTags.vue";
import {useRouter} from "vue-router";
import {checkAdminSession} from "@/action/session";
import {ref} from "vue";
import {getAdminTheme, setAdminTheme} from "@/store/system";
const sidebar = useSidebarStore();
const tags = useTagsStore();
const isLogin = ref(false)
const contentHeight = window.innerHeight - 80
const theme = ref(getAdminTheme())
// 获取会话信息
const router = useRouter();
@@ -37,6 +40,16 @@ checkAdminSession().then(() => {
}).catch(() => {
router.replace('/admin/login')
})
const changeTheme = (value) => {
if (value) {
theme.value = 'dark'
} else {
theme.value = 'light'
}
setAdminTheme(theme.value)
}
</script>
<style scoped lang="stylus">

View File

@@ -71,5 +71,11 @@ const fetchList = function (_page, _pageSize) {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -74,7 +74,6 @@ import {httpGet, httpPost} from "@/utils/http";
import {ElMessage, ElMessageBox} from "element-plus";
import {dateFormat, removeArrayItem} from "@/utils/libs";
import {Plus} from "@element-plus/icons-vue";
import {Sortable} from "sortablejs";
// 变量定义
const items = ref([])
@@ -178,5 +177,11 @@ const remove = function (row) {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -150,5 +150,11 @@ const remove = function (row) {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -68,7 +68,7 @@
<script setup>
import {onMounted, ref} from "vue";
import {httpGet, httpPost} from "@/utils/http";
import {httpPost} from "@/utils/http";
import {ElMessage} from "element-plus";
import {dateFormat} from "@/utils/libs";
import {Search} from "@element-plus/icons-vue";
@@ -156,5 +156,12 @@ const fetchData = () => {
width: 100%
}
.pagination {
padding 20px 0
display flex
width 100%
justify-content right
}
}
</style>

View File

@@ -230,5 +230,11 @@ const remove = function (row) {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -105,5 +105,11 @@ const remove = function (row) {
width: 100%
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -369,5 +369,11 @@ const uploadImg = (file) => {
text-align center
}
}
.pagination {
padding 20px 0
display flex
justify-content right
}
}
</style>

View File

@@ -459,10 +459,9 @@ const onUploadImg = (files, callback) => {
.el-tabs {
width 100%
background-color #ffffff
background-color var(--el-bg-color)
padding 10px 20px 40px 20px
border: 1px solid #ddd;
border-radius: 5px
border: 1px solid var(--el-border-color);
.container {
.el-form {

View File

@@ -351,6 +351,11 @@ const doResetPass = () => {
}
}
.pagination {
padding 20px 0
display flex
}
.el-select {
width: 100%
}