我得待办添加标签

This commit is contained in:
gongjiale 2022-10-13 09:35:33 +08:00
parent fe17edeb39
commit 7f662ee870
2 changed files with 66 additions and 5 deletions

View File

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

View File

@ -18,29 +18,81 @@
:collapseTransition="false"
class="aui-sidebar__menu"
>
<div >
<sub-menu
v-for="menu in $store.state.sidebarMenuList"
v-for="menu in $store.state.sidebarMenuList"
:key="menu.id"
:menu="menu"
/>
>
<span>sdddd</span>
</sub-menu>
</div>
</el-menu>
</div>
</aside>
</template>
<script>
import http from '@/utils/request'
import SubMenu from "./main-sidebar-sub-menu";
export default {
data() {
return {};
return {
numObject:{}
};
},
components: {
SubMenu,
},
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>
<style scoped lang="scss">
.aui-sidebar {