From ecc5079c63e86dd6caba6753b51ed480022bf89b Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期一, 05 二月 2024 19:19:01 +0800 Subject: [PATCH] 添加api拦截 --- src/components/layout/components/appsidebar/index.vue | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue index bf9aff6..89b72f6 100644 --- a/src/components/layout/components/appsidebar/index.vue +++ b/src/components/layout/components/appsidebar/index.vue @@ -36,12 +36,12 @@ <el-menu-item index="/backgroundConfig/rolePermssion">瑙掕壊鏉冮檺</el-menu-item> </el-submenu> --> </el-menu> + <el-empty v-if="this.menus===null||this.menus===undefined||this.menus.length===0" :image-size="130" description="娌℃湁渚ф爮鑿滃崟"></el-empty> </div> </div> </template> <script> -import {getMenuTreeByRole} from "@/api/menus/index" export default { name: "AppSidebar", props: {}, @@ -62,14 +62,22 @@ }, methods: { getMenuTreeByRole(){ - getMenuTreeByRole().then((res)=>{ - console.log(res.data.list,"crm鑿滃崟") - res.data.list.map((item)=>{ - if(item.systemType===2){ - this.menus=item.menus - } - }) - }) + let newList=this.$store.state.menus + console.log(newList,"newList") + // 闅愯棌浜� 鐢熸垚璁″垝 鍜� 鏈嶅姟鏀惰垂绠$悊妯″潡 + if(newList[1]){ + const found = newList[1].children.find(obj => obj.title === "鐢熸垚璁″垝") + if(found){ + newList[1].children=[...newList[1].children.slice(0, -1)]; + } + } + if(newList[2]){ + const found1 = newList[2].children.find(obj => obj.title === "鏈嶅姟鏀惰垂绠$悊") + if(found1){ + newList[2].children=[...newList[2].children.slice(0, -1)]; + } + } + this.menus=newList }, // 鐩戝惉璺敱 initNavMenu() { @@ -86,4 +94,11 @@ <!-- Add "scoped" attribute to limit CSS to this component only --> <style lang="scss" scoped> @import "./index.scss"; +::v-deep .el-empty{ + .el-empty__description{ + p{ + color: #dddd; + } + } +} </style> -- Gitblit v1.8.0