|
@@ -0,0 +1,161 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="parent d-flex flex-column">
|
|
|
|
+ <Headers class="headers"></Headers>
|
|
|
|
+ <div class="content d-flex">
|
|
|
|
+ <side class="content-sticky" v-if="!router.currentRoute.value?.meta?.hideSide"></side>
|
|
|
|
+ <div class="content-box d-flex flex-column" :style="`width: ${ !isInWhiteList(route.path) ? 'calc(100% - 230px)' : '100%'}`">
|
|
|
|
+ <div v-if="!isInWhiteList(route.path)" class="breadcrumbs_sticky">
|
|
|
|
+ <div class=" d-flex align-center justify-space-between">
|
|
|
|
+ <v-breadcrumbs :items="system.breadcrumbs" elevation="3">
|
|
|
|
+ <template v-slot:item="{ item }">
|
|
|
|
+ <span class="text" :class="{active: !item.disabled}" @click="toPath(item)">{{ item.text }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </v-breadcrumbs>
|
|
|
|
+ </div>
|
|
|
|
+ <v-divider></v-divider>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="box pa-3">
|
|
|
|
+ <div v-if="!isInWhiteList(route.path)" class="box-content">
|
|
|
|
+ <router-view :key="key"></router-view>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else class="full">
|
|
|
|
+ <router-view :key="key"></router-view>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup>
|
|
|
|
+defineOptions({ name: 'teacher-layout-index' })
|
|
|
|
+import Headers from './teacher/navBar.vue'
|
|
|
|
+import side from './teacher/side.vue'
|
|
|
|
+import { useRouter, useRoute } from 'vue-router'
|
|
|
|
+import { watch, computed } from 'vue'
|
|
|
|
+import { useSystem } from '@/store/system'
|
|
|
|
+import { useUserStore } from '@/store/user'
|
|
|
|
+
|
|
|
|
+const router = useRouter()
|
|
|
|
+const route = useRoute()
|
|
|
|
+const system = useSystem()
|
|
|
|
+const key = computed(() => {
|
|
|
|
+ return route.path + Math.random()
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const whiteList = []
|
|
|
|
+// 查询是否在白名单内,在则不展示面包屑
|
|
|
|
+const isInWhiteList = (url)=> {
|
|
|
|
+ const path = url.split('?')[0]
|
|
|
|
+ for (const item of whiteList) {
|
|
|
|
+ if (path.startsWith(item)) {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const user = useUserStore()
|
|
|
|
+watch(
|
|
|
|
+ () => route.matched,
|
|
|
|
+ async (val) => {
|
|
|
|
+ // getTitle(val, route.fullPath)
|
|
|
|
+ system.setBreadcrumbs(val, route.fullPath)
|
|
|
|
+ await user.getEnterpriseInfo(true)
|
|
|
|
+ },
|
|
|
|
+ { immediate: true },
|
|
|
|
+ { deep: true }
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+const toPath = (item) => {
|
|
|
|
+ const { disabled, to } = item
|
|
|
|
+ if (disabled) {
|
|
|
|
+ event.preventDefault()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ router.push(to)
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+$top: 50px;
|
|
|
|
+.parent {
|
|
|
|
+ background-color: var(--default-bgc);
|
|
|
|
+ min-width: 1200px;
|
|
|
|
+}
|
|
|
|
+.headers {
|
|
|
|
+ position: sticky;
|
|
|
|
+ top: 0;
|
|
|
|
+ z-index: 999;
|
|
|
|
+}
|
|
|
|
+.box {
|
|
|
|
+ height: 0;
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: calc(100vh - 50px);
|
|
|
|
+ &-content {
|
|
|
|
+ width: 100%;
|
|
|
|
+ min-height: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.full {
|
|
|
|
+ height: calc(100vh - $top - 25px);
|
|
|
|
+ width: 100%;
|
|
|
|
+ flex: 1;
|
|
|
|
+ position: relative;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+}
|
|
|
|
+.slider {
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 50%;
|
|
|
|
+ right: 24px;
|
|
|
|
+ translate: 0 50%;
|
|
|
|
+ z-index: 999;
|
|
|
|
+}
|
|
|
|
+.content {
|
|
|
|
+ height: 0;
|
|
|
|
+ flex: 1;
|
|
|
|
+
|
|
|
|
+ &-sticky {
|
|
|
|
+ position: sticky;
|
|
|
|
+ top: $top;
|
|
|
|
+ height: calc(100vh - $top);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.breadcrumbs_sticky {
|
|
|
|
+ position: sticky;
|
|
|
|
+ top: $top;
|
|
|
|
+ background: #FFF;
|
|
|
|
+ z-index: var(--zIndex-breadcrumbs);
|
|
|
|
+ border-left: 1px solid #eaecef;
|
|
|
|
+}
|
|
|
|
+.text {
|
|
|
|
+ color: var(--color-999);
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ &.active {
|
|
|
|
+ color: var(--v-primary-base);
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+/* 滚动条样式 */
|
|
|
|
+::-webkit-scrollbar {
|
|
|
|
+ -webkit-appearance: none;
|
|
|
|
+ width: 0px;
|
|
|
|
+ height: 0px;
|
|
|
|
+}
|
|
|
|
+/* 滚动条内的轨道 */
|
|
|
|
+::-webkit-scrollbar-track {
|
|
|
|
+ background: rgba(0, 0, 0, 0.1);
|
|
|
|
+ border-radius: 0;
|
|
|
|
+}
|
|
|
|
+/* 滚动条内的滑块 */
|
|
|
|
+::-webkit-scrollbar-thumb {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ background: rgba(0, 0, 0, 0.15);
|
|
|
|
+ transition: color 0.2s ease;
|
|
|
|
+}
|
|
|
|
+</style>
|