Compare commits

..

2 Commits

2 changed files with 66 additions and 5 deletions

View File

@ -9,6 +9,7 @@
<use :xlink:href="`#${menu.icon}`"></use> <use :xlink:href="`#${menu.icon}`"></use>
</svg> </svg>
<span class="first-level-text">{{ menu.name }}</span> <span class="first-level-text">{{ menu.name }}</span>
<span class="tabNum" v-if="menu.total && menu.total !==0">{{menu.total}}</span>
</template> </template>
<sub-menu <sub-menu
v-for="item in menu.children" v-for="item in menu.children"
@ -32,6 +33,7 @@
<use :xlink:href="`#${menu.icon}`"></use> <use :xlink:href="`#${menu.icon}`"></use>
</svg> </svg>
<span>{{ menu.name }}</span> <span>{{ menu.name }}</span>
<span class="tabNum" v-if="menu.total && menu.total !==0 ">{{menu.total}}</span>
</a> </a>
</el-menu-item> </el-menu-item>
</template> </template>
@ -110,6 +112,13 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.tabNum{
color: #ffffff;
margin-left: 5px;
background: red;
padding:1px 4px;
border-radius:5px;
}
.aui-sidebar__menu { .aui-sidebar__menu {
.first-level-text { .first-level-text {
font-size: 16px; font-size: 16px;

View File

@ -18,29 +18,81 @@
:collapseTransition="false" :collapseTransition="false"
class="aui-sidebar__menu" class="aui-sidebar__menu"
> >
<div >
<sub-menu <sub-menu
v-for="menu in $store.state.sidebarMenuList" v-for="menu in $store.state.sidebarMenuList"
:key="menu.id" :key="menu.id"
:menu="menu" :menu="menu"
/> >
<span>sdddd</span>
</sub-menu>
</div>
</el-menu> </el-menu>
</div> </div>
</aside> </aside>
</template> </template>
<script> <script>
import http from '@/utils/request'
import SubMenu from "./main-sidebar-sub-menu"; import SubMenu from "./main-sidebar-sub-menu";
export default { export default {
data() { data() {
return {}; return {
numObject:{}
};
}, },
components: { components: {
SubMenu, SubMenu,
}, },
created() { created() {
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"]; this.getNum()
//this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
}, },
}; methods: {
getNum(){
http.get('/act/task/myToDoTaskNum').then(({ data: res }) => {
this.numObject=res.data
console.log("this.numObject========",this.numObject)
let menuList= window.SITE_CONFIG["menuList"];
for(var i=0;i<menuList.length;i++){
let menu=menuList[i];
// menu.total=0;
if(menu.id=='1541261628388888578'){//
let daibanNum=0
for(let j=0;j<menu.children.length;j++){
let children=menu.children[j]
if(children.id=="1541261780432408577"){// v3
children.total=Number(this.numObject.abilityprocess_v3)
daibanNum=Number(daibanNum)+Number(children.total)
} if(children.id=="1559376285703081986"){//
children.total=Number(this.numObject.meetingroom_book)
daibanNum=Number(daibanNum)+Number(children.total)
}if(children.id=="1545292602084827138"){//
children.total=Number(this.numObject.resourcemountapply)
daibanNum=Number(daibanNum)+Number(children.total)
}if(children.id=="1545312045695377410"){//
children.total=Number(this.numObject.abilitydemandapply)
daibanNum=Number(daibanNum)+Number(children.total)
}if(children.id=="1545313018614521857"){//
children.total=Number(this.numObject.resourcundercarriageapply)
daibanNum=Number(daibanNum)+Number(children.total)
}if(children.id=="1545313754106699777"){//
children.total=Number(this.numObject.comment_review)
daibanNum=Number(daibanNum)+Number(children.total)
}if(children.id=="1554294862931562498"){//
children.total=0
daibanNum=Number(daibanNum)+Number(children.total)
}
}
menu.total=daibanNum
}
}
this.$store.state.sidebarMenuList=menuList
})
}
}};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.aui-sidebar { .aui-sidebar {