CzRger 14 小时之前
父节点
当前提交
ed4dccb471

+ 2 - 9
src/layout/index.vue

@@ -1,20 +1,13 @@
 <template>
-  <template v-if="menuLayoutCpt === 'top-left'">
-    <TopLeftLayout />
-  </template>
-  <template v-else-if="menuLayoutCpt === 'left'">
-    <LeftLayout />
-  </template>
+  <MenuLayout />
 </template>
 
 <script setup lang="ts">
 import { computed, getCurrentInstance, reactive } from 'vue'
-import TopLeftLayout from './top-left/index.vue'
-import LeftLayout from './left/index.vue'
+import MenuLayout from './menu/index.vue'
 
 const { proxy } = getCurrentInstance()
 const state: any = reactive({})
-const menuLayoutCpt = computed(() => window.czrConfig.menuLayout)
 </script>
 
 <style lang="scss" scoped></style>

+ 0 - 15
src/layout/left/head/index.vue

@@ -1,15 +0,0 @@
-<template>
-  <div class="head-com"></div>
-</template>
-
-<script setup lang="ts">
-import { getCurrentInstance, reactive } from 'vue'
-
-const { proxy } = getCurrentInstance()
-const state: any = reactive({})
-</script>
-
-<style lang="scss" scoped>
-.head-com {
-}
-</style>

+ 0 - 55
src/layout/left/index.vue

@@ -1,55 +0,0 @@
-<template>
-  <div class="left-layout">
-    <div class="left-layout-menu">
-      <MenuCom />
-    </div>
-    <div class="left-layout-center">
-      <div class="left-layout-center-head">
-        <HeadCom />
-      </div>
-      <div class="left-layout-center-breadcrumb">
-        <BreadcrumbCom />
-      </div>
-      <div class="left-layout-center-content">
-        <router-view />
-      </div>
-    </div>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { getCurrentInstance, onMounted, reactive } from 'vue'
-import HeadCom from './head/index.vue'
-import MenuCom from './menu/index.vue'
-import BreadcrumbCom from '../breadcrumb/index.vue'
-
-const { proxy } = getCurrentInstance()
-const state: any = reactive({})
-</script>
-
-<style lang="scss" scoped>
-.left-layout {
-  width: 100%;
-  height: 100%;
-  display: flex;
-  .left-layout-menu {
-    width: 300px;
-    height: 100%;
-    background-color: #0b46c9;
-  }
-  .left-layout-center {
-    flex: 1;
-    display: flex;
-    flex-direction: column;
-    .left-layout-center-head {
-      width: 100%;
-      height: 60px;
-      background-color: #22a5fe;
-    }
-    .left-layout-center-content {
-      flex: 1;
-      background-color: #666666;
-    }
-  }
-}
-</style>

+ 0 - 22
src/layout/left/menu/index.vue

@@ -1,22 +0,0 @@
-<template>
-  <div class="sub-menu-com">
-    <subMenuItem :data="MenuStore.menus" />
-  </div>
-</template>
-
-<script setup lang="ts">
-import { computed, getCurrentInstance, reactive } from 'vue'
-import subMenuItem from './sub-menu-item.vue'
-import { useMenuStore } from '@/stores'
-
-const MenuStore = useMenuStore()
-const { proxy } = getCurrentInstance()
-const state: any = reactive({})
-</script>
-
-<style lang="scss" scoped>
-.sub-menu-com {
-  display: flex;
-  flex-direction: column;
-}
-</style>

+ 5 - 5
src/layout/top-left/head/index.vue

@@ -19,11 +19,11 @@
         </div>
       </template>
     </div>
-    <div class="mr-4" v-if="AppStore.isSuperAdmin">
-      <el-button type="primary" @click="state.drawer = true"
-        >临时字典</el-button
-      >
-    </div>
+    <!--    <div class="mr-4">-->
+    <!--      <el-button type="primary" @click="state.drawer = true"-->
+    <!--        >临时字典</el-button-->
+    <!--      >-->
+    <!--    </div>-->
     <el-dropdown :disabled="AppStore.tenants.length < 2">
       <div class="__hover flex items-center gap-2 text-[#303133]">
         {{ AppStore.tenantInfo?.name }}

src/layout/top-left/index.vue → src/layout/menu/index.vue


src/layout/top-left/sub-menu/index.vue → src/layout/menu/sub-menu/index.vue


src/layout/left/menu/sub-menu-item.vue → src/layout/menu/sub-menu/sub-menu-item.vue


+ 0 - 32
src/layout/top-left/sub-menu/sub-menu-item.vue

@@ -1,32 +0,0 @@
-<template>
-  <template v-for="item in data">
-    <div
-      :class="`sub-menu-item level-${level}`"
-      :style="{ marginLeft: level * 20 + 'px' }"
-    >
-      <el-button
-        :type="
-          $route.matched.some((v) => v.path === item.path) ? 'success' : 'info'
-        "
-        @click="$router.push(item.redirect || item.path)"
-        >{{ item.meta.title }}</el-button
-      >
-    </div>
-    <template v-if="item.children?.length > 0">
-      <subMenuItem :data="item.children" :level="level + 1" />
-    </template>
-  </template>
-</template>
-
-<script setup lang="ts">
-import { getCurrentInstance, reactive } from 'vue'
-
-const { proxy } = getCurrentInstance()
-const props = defineProps({
-  data: {},
-  level: { default: 0 },
-})
-const state: any = reactive({})
-</script>
-
-<style lang="scss" scoped></style>

+ 1 - 3
src/out/config.js

@@ -1,3 +1 @@
-window.czrConfig = {
-  menuLayout: 'top-left', //  'left'-左侧,'top-left'-顶部左侧
-}
+window.czrConfig = {}