Files
tk-page-Fan/src/views/nav.vue

89 lines
1.7 KiB
Vue
Raw Normal View History

2025-04-03 20:25:25 +08:00
<template>
<div class="app-container">
2025-04-14 21:52:19 +08:00
<Sidebar class="noneText" @activeIndex="activeIndexFn" />
2025-04-09 21:07:15 +08:00
<div class="content ">
2025-04-14 21:52:19 +08:00
<div v-show="activeIndex == 1">
<workbenches v-if="openWerk" />
</div>
<div v-show="activeIndex == 2">
<hostsList v-if="openList" />
</div>
2025-04-03 20:25:25 +08:00
</div>
</div>
</template>
<script setup>
import Sidebar from '../components/Sidebar.vue';
import { RouterLink, RouterView } from 'vue-router'
2025-04-14 21:52:19 +08:00
import hostsList from '@/views/hosts/hostsList.vue'
import workbenches from '@/views/hosts/workbenches.vue'
import { ref } from 'vue'
import { getUser } from '@/utils/storage'
let userType = ref(getUser().userType)
let activeIndex = ref(userType.value == 3 ? 1 : 2)
let openWerk = ref(userType.value == 3 ? true : false)
let openList = ref(userType.value == 3 ? false : true)
console.log("用户等级", getUser().userType)
function activeIndexFn(data) {
activeIndex.value = data
openWerk.value = true
openList.value = true
console.log(data)
}
2025-04-03 20:25:25 +08:00
</script>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
}
.app-container {
display: flex;
2025-04-09 21:07:15 +08:00
width: 1600px;
height: 900px;
background-color: #338F6A;
2025-04-14 21:52:19 +08:00
}
.noneText {
/* 页面无法选中 */
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
2025-04-03 20:25:25 +08:00
}
.sidebar {
width: 200px;
2025-04-09 21:07:15 +08:00
background-color: #338F6A;
2025-04-03 20:25:25 +08:00
padding: 20px;
2025-04-09 21:07:15 +08:00
/* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); */
2025-04-03 20:25:25 +08:00
}
.content {
2025-04-09 21:07:15 +08:00
margin-left: 280px;
width: 1304px;
height: 868px;
background: #FFFFFF;
border-radius: 36px;
margin-top: 16px;
}
2025-04-03 20:25:25 +08:00
2025-04-09 21:07:15 +08:00
.center-justify {
display: flex;
justify-content: space-around;
align-items: center;
2025-04-03 20:25:25 +08:00
}
</style>