|
@@ -1,113 +1,35 @@
|
|
|
<template>
|
|
|
- <el-menu
|
|
|
- router
|
|
|
- :unique-opened="true"
|
|
|
- text-color="#a7b1c2"
|
|
|
- active-text-color="#36639E"
|
|
|
- :default-active="defaultActive"
|
|
|
- class="my-menu"
|
|
|
- >
|
|
|
- <template v-for="item in store.leftMenuList" :key="item.CODE">
|
|
|
- <el-sub-menu class="layer-1-menu" :index="item.CODE + ''" v-if="(item.childList.length > 0)" >
|
|
|
- <template #title>
|
|
|
- <span class="menu_icon" :class="item.O_LCON"></span>
|
|
|
- <span class="layer-1-title">{{item.NAME}}</span>
|
|
|
- </template>
|
|
|
-<!-- <el-menu-item class="layer-3" v-for="child in item.childList" :route="{path:child.O_PATH}" :index="child.O_PATH + ''" >-->
|
|
|
-<!-- <div class="name-item">-->
|
|
|
-<!-- {{child.NAME}}-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </el-menu-item>-->
|
|
|
-
|
|
|
- <template v-for="child in item.childList">
|
|
|
- <template v-if="!(child.childList.length > 0)">
|
|
|
- <el-menu-item :route="{
|
|
|
- path:'/main' + child.O_PATH
|
|
|
- }" :index="child.CODE + ''">{{child.NAME}}</el-menu-item>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-sub-menu class="layer-2-menu" :index="child.CODE + ''">
|
|
|
- <template #title >{{child.NAME}}</template>
|
|
|
- <el-menu-item :route="{
|
|
|
- path:'/main' + childchild.O_PATH
|
|
|
- }" v-for="childchild in child.childList" :index="childchild.CODE + ''" >{{childchild.NAME}}</el-menu-item>
|
|
|
- </el-sub-menu>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- </el-sub-menu>
|
|
|
- <el-menu-item v-else class="one-menu" :route="{path:item.O_PATH}" :index="item.O_PATH + ''" >
|
|
|
- <div class="layer-1-title">
|
|
|
- {{item.NAME}}
|
|
|
- </div>
|
|
|
- </el-menu-item>
|
|
|
- </template>
|
|
|
- </el-menu>
|
|
|
-
|
|
|
+ <menu-i :menu-list="store.leftMenuList"/>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {useRootStore} from "../../../pinia/useStore";
|
|
|
-import {computed, onMounted, ref, toRef, watch} from "vue";
|
|
|
+import {computed, ref} from "vue";
|
|
|
+import {useRootStore} from "@/pinia/useStore";
|
|
|
import {useRoute} from "vue-router";
|
|
|
+import MenuI from "@/components/common/Menul.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "MyMenu",
|
|
|
+ components: {MenuI},
|
|
|
setup() {
|
|
|
-
|
|
|
- const route = useRoute()
|
|
|
- const defaultActive = ref('')
|
|
|
- watch(() => route.path,(val) => {
|
|
|
- console.log('变化le',route.meta)
|
|
|
- defaultActive.value = route.meta.CODE + ''
|
|
|
- },{
|
|
|
- immediate:true
|
|
|
- })
|
|
|
-
|
|
|
+ const route =useRoute()
|
|
|
const store = useRootStore()
|
|
|
- // const menus = ref([...store.leftMenuList])
|
|
|
-
|
|
|
-
|
|
|
+ debugger
|
|
|
+ // const currentM = computed(() => {
|
|
|
+ // return otherReflectArr.find(i => i.name === store.pageType).menus
|
|
|
+ // })
|
|
|
+ function homeCountAdd() {
|
|
|
+ store.toHomeCounter++
|
|
|
+ }
|
|
|
return {
|
|
|
store,
|
|
|
- // menus,
|
|
|
- defaultActive
|
|
|
-
|
|
|
+ homeCountAdd,
|
|
|
+ //otherReflectArr
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
-.el-menu-vertical-demo{
|
|
|
- height: 100%;
|
|
|
- overflow: auto;
|
|
|
- &::-webkit-scrollbar {
|
|
|
- width: 7px;
|
|
|
- background-color: transparent;
|
|
|
- }
|
|
|
- &::-webkit-scrollbar-thumb {
|
|
|
- border-radius: 7px;
|
|
|
- background-color: rgba(0, 0, 0, 0.4);
|
|
|
- }
|
|
|
- .el-aside{
|
|
|
-
|
|
|
- }
|
|
|
- :deep(.el-sub-menu__title){
|
|
|
- //padding-left: 50px !important;
|
|
|
- }
|
|
|
- :deep(.el-menu-item){
|
|
|
- white-space: normal !important;
|
|
|
- }
|
|
|
- font-weight: 600;
|
|
|
- font-family: '微软雅黑';
|
|
|
-}
|
|
|
-.menu_icon{
|
|
|
-
|
|
|
- margin-right: 10px;
|
|
|
-}
|
|
|
</style>
|