middleground_code_v2/src/App.vue

195 lines
4.1 KiB
Vue
Raw Normal View History

2024-03-26 11:18:19 +08:00
<template>
<div id="app">
<!-- <keep-alive> -->
<router-view></router-view>
<!-- </keep-alive> -->
<!-- // 需要缓存的组件 -->
<!-- <keep-alive >
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive> -->
<!-- // 不需要缓存的组件 -->
<!-- <router-view v-if="!$route.meta.keepAlive"></router-view> -->
</div>
</template>
<script>
import { setTheme } from '@/utils/setTheme'
2024-03-26 11:18:19 +08:00
export default {
name: 'App',
2024-03-26 11:18:19 +08:00
data() {
return {
chalk: '', // content of theme-chalk css
theme: '',
routerAlive: true
}
2024-03-26 11:18:19 +08:00
},
provide() {
return {
routerRefresh: this.routerRefresh
}
2024-03-26 11:18:19 +08:00
},
mounted() {
setTheme(this.$store.state.settings.theme)
2024-03-26 11:18:19 +08:00
window.addEventListener(
'hashchange',
2024-03-26 11:18:19 +08:00
() => {
let currentPath = window.location.hash.slice(1)
2024-03-26 11:18:19 +08:00
if (this.$route.path !== currentPath) {
this.$router.push(currentPath)
2024-03-26 11:18:19 +08:00
}
},
false
)
2024-03-26 11:18:19 +08:00
},
methods: {
routerRefresh() {
this.routerAlive = false
2024-03-26 11:18:19 +08:00
this.$nextTick(() => {
this.routerAlive = true
})
}
2024-03-26 11:18:19 +08:00
},
metaInfo() {
return {
title:
this.$store.state.settings.dynamicTitle &&
this.$store.state.settings.title,
titleTemplate: (title) => {
return title
? `${title} - ${process.env.VUE_APP_TITLE}`
: process.env.VUE_APP_TITLE
}
}
2024-03-26 11:18:19 +08:00
},
activated() {
// 使用 Vue.nextTick 延迟执行代码
this.$nextTick(() => {
})
2024-03-26 11:18:19 +08:00
},
deactivated() {
// 使用 Vue.nextTick 延迟执行代码
this.$nextTick(() => {
})
}
}
2024-03-26 11:18:19 +08:00
</script>
<style lang="scss">
.loadingclass {
2024-03-26 11:18:19 +08:00
z-index: 9999999 !important;
}
2024-03-26 11:18:19 +08:00
// 全局滚动条样式调整
::-webkit-scrollbar {
width: 5px;
2024-03-26 11:18:19 +08:00
/*滚动条宽度*/
height: 5px;
2024-03-26 11:18:19 +08:00
/*滚动条高度*/
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
box-shadow: 0px 1px 3px #f1f1f1 inset;
/*滚动条的背景区域的内阴影*/
border-radius: 10px;
/*滚动条的背景区域的圆角*/
// background-color: #f1f1f1; /*滚动条的背景颜色*/
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
box-shadow: 0px 1px 3px #a8a8a8 inset;
/*滚动条的内阴影*/
border-radius: 10px;
/*滚动条的圆角*/
background-color: #e0e0e0;
/*滚动条的背景颜色*/
}
</style>
<style lang="scss">
.el-form-item__content {
display: block !important;
}
//所有按钮加号颜色
.el-button--primary.is-plain {
color: #fff !important;
}
//所有dialog标题设置下线
.el-dialog__header {
border-bottom: 1px solid #ebebeb;
}
/* 定义滚动条样式 */
.scrollable-box {
overflow: hidden;
}
.scrollable-box:hover {
overflow: auto;
}
2024-03-26 11:18:19 +08:00
.el-table__header-wrapper {
background: #f7f7f7 !important;
}
.el-button--primary {
background-color: #3877f5 !important;
}
2024-03-26 11:18:19 +08:00
.el-table {
width: 100%;
2024-03-26 11:18:19 +08:00
&::before {
display: none;
}
2024-03-26 11:18:19 +08:00
//以下代码是实现边框效果
thead th {
font-size: 14px;
color: #575757;
2024-03-26 11:18:19 +08:00
&:nth-last-child(2) {
border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
border-radius: 0 5px 5px 0;
right: 1px;
}
}
2024-03-26 11:18:19 +08:00
thead th,
.el-table__row td {
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
padding: 10px 0;
border-top: 0px solid rgba(0, 0, 0, 0.1) !important;
2024-03-26 11:18:19 +08:00
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
background: #fff;
2024-03-26 11:18:19 +08:00
&:first-child {
border-left: 0px solid rgba(0, 0, 0, 0.1) !important;
2024-03-26 11:18:19 +08:00
// border-radius: 5px 0 0 5px;
}
}
2024-03-26 11:18:19 +08:00
.el-table__row > td {
font-size: 12px;
color: #333333;
2024-03-26 11:18:19 +08:00
&:last-child {
border-right: 0px solid rgba(0, 0, 0, 0.1) !important;
2024-03-26 11:18:19 +08:00
// border-radius: 0 5px 5px 0;
right: 1px;
}
}
2024-03-26 11:18:19 +08:00
.el-table__body tr:hover > td.el-table__cell {
background-color: rgba(0, 110, 255, 0.05);
}
2024-03-26 11:18:19 +08:00
.el-table__fixed::before {
display: none;
}
}
</style>