From eed27d3000e127c433fd45609d0d5e5d06b7868c Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 26 十二月 2023 11:14:28 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/crm-web into dev --- src/components/layout/components/appsidebar/index.vue | 47 ++++++++++++++++++++++++----------------------- 1 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue index 7be1f15..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,28 +62,22 @@ }, methods: { getMenuTreeByRole(){ - getMenuTreeByRole().then((res)=>{ - console.log(res.data.list,"crm鑿滃崟") - res.data.list.map((item)=>{ - if(item.systemType===2){ - let newList= JSON.parse(JSON.stringify([...item.menus])) - // 闅愯棌浜� 鐢熸垚璁″垝 鍜� 鏈嶅姟鏀惰垂绠$悊妯″潡 - 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 - } - }) - }) + 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() { @@ -100,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