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 | 91 +++++++++++++++++++++++++++------------------ 1 files changed, 54 insertions(+), 37 deletions(-) diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue index db1ae8b..89b72f6 100644 --- a/src/components/layout/components/appsidebar/index.vue +++ b/src/components/layout/components/appsidebar/index.vue @@ -4,50 +4,39 @@ <div class="box"> <el-menu router + unique-opened :default-active="$route.path" class="el-menu-vertical-demo" @select="handleOpen" @close="handleClose" - background-color="#545c64" - text-color="#fff" - active-text-color="#ffd04b" + background-color="#314255" + text-color="#bfcbd9" + active-text-color="#fff" > - <el-submenu index=""> + <el-submenu v-for="item in menus" :key="item.id" :index="item.id.toString()" > + <template slot="title"> + <i class="el-icon-money icon"></i> + <span>{{ item.title }}</span> + </template> + <el-menu-item v-for="itm in item.children" :key="itm.id" :index="itm.path">{{ itm.title }}</el-menu-item> + + <!-- <el-menu-item index="/client/salesLead">閿�鍞嚎绱�</el-menu-item> + <el-menu-item index="/client/clientManage">瀹㈡埛绠$悊</el-menu-item> + <el-menu-item index="/client/contacts">鑱旂郴浜�</el-menu-item> + <el-menu-item index="/client/followupRecords">璺熻繘璁板綍</el-menu-item> --> + </el-submenu> + + + <!-- <el-submenu index="4"> <template slot="title"> <i class="el-icon-location"></i> - <span>瀹㈡埛绠$悊</span> + <span>鍚庡彴閰嶇疆</span> </template> - <el-menu-item index="/custom/salesLead">閿�鍞嚎绱�</el-menu-item> - <el-menu-item index="/custom/customManage">瀹㈡埛绠$悊</el-menu-item> - <el-menu-item index="/custom/contacts">鑱旂郴浜�</el-menu-item> - <el-menu-item index="/custom/followupRecords">璺熻繘璁板綍</el-menu-item> - </el-submenu> - <el-submenu index="2"> - <template slot="title"> - <i class="el-icon-location"></i> - <span>閿�鍞鐞�</span> - </template> - <el-menu-item index="/sales/salesOpportunity">閿�鍞満浼�</el-menu-item> - <el-menu-item index="/sales/quotation">鎶ヤ环鍗�</el-menu-item> - <el-menu-item index="/sales/masterOrder">閿�鍞�诲崟</el-menu-item> - <el-menu-item index="/sales/subOrder">閿�鍞瓙鍗�</el-menu-item> - <el-menu-item index="/sales/salesDetails">閿�鍞槑缁嗗崟</el-menu-item> - <el-menu-item index="/sales/salesReturn">閿�鍞��璐у崟</el-menu-item> - <el-menu-item index="/sales/refundForm">閿�鍞��娆惧崟</el-menu-item> - <el-menu-item index="/sales/contractManage">鍚堝悓绠$悊</el-menu-item> - <el-menu-item index="/sales/productPlan">鐢熶骇璁″垝</el-menu-item> - </el-submenu> - <el-submenu index="3"> - <template slot="title"> - <i class="el-icon-location"></i> - <span>鏈嶅姟绠$悊</span> - </template> - <el-menu-item index="/service/serviceContract">鏈嶅姟鍚堝悓</el-menu-item> - <el-menu-item index="/service/orderManage">宸ュ崟绠$悊</el-menu-item> - <el-menu-item index="/service/serviceFollowup">鏈嶅姟鍥炶鍗�</el-menu-item> - <el-menu-item index="/service/serviceFeeManage">鏈嶅姟鏀惰垂绠$悊</el-menu-item> - </el-submenu> + <el-menu-item index="/backgroundConfig/memberManage">鎴愬憳绠$悊</el-menu-item> + <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> @@ -57,7 +46,9 @@ name: "AppSidebar", props: {}, data() { - return {} + return { + menus:[] + } }, watch: { // $route: { @@ -67,14 +58,33 @@ }, created() { this.initNavMenu() + this.getMenuTreeByRole() }, methods: { + getMenuTreeByRole(){ + 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() { // console.log(this.$route.name) }, handleOpen(index) { - console.log("aaa", index) + console.log(index) }, handleClose() {} } @@ -84,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