hi-ucs/back/src/views/main-sidebar.vue

129 lines
4.3 KiB
Vue

<!--
* @Author: kongjun qdkongjun@gmail.com
* @Date: 2022-06-20 09:29:59
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-10-18 15:46:51
* @FilePath: \back\src\views\main-sidebar.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<aside
:class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]"
>
<div class="aui-sidebar__inner">
<el-menu
:default-active="$store.state.sidebarMenuActiveName"
:collapse="$store.state.sidebarFold"
:unique-opened="true"
:collapseTransition="false"
class="aui-sidebar__menu"
>
<div >
<sub-menu
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'
import returnLocationStr from '@/utils/location'
import bus from '@/views/bus.js'
export default {
data () {
return {
numObject: {}
}
},
components: {
SubMenu
},
created () {
this.getNum()
// this.$store.state.sidebarMenuList = window.SITE_CONFIG.menuList
// 更新我的待办得数量
bus.$off('updateTaskNum')
bus.$on('updateTaskNum', () => {
this.getNum()
})
},
methods: {
getNum () {
http.get('/act/task/myToDoTaskNum').then(({ data: res }) => {
this.numObject = res.data
const menuList = window.SITE_CONFIG.menuList
console.log('menuList====>', menuList)
console.log('this.numObject====>', this.numObject)
for (var i = 0; i < menuList.length; i++) {
const menu = menuList[i]
if (menu.id == '1541261628388888578') { // 我的待办
let daibanNum = 0
for (let j = 0; j < menu.children.length; j++) {
const children = menu.children[j]
if (children.id == '1541261780432408577') { // 能力申请 v2
// 西海岸 v2 市局v3
children.total = returnLocationStr() == 'qingdao' ? Number(this.numObject.abilityprocess_v3) : Number(this.numObject.abilityprocess_v2)
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 {
width: 266px;
.aui-sidebar__inner {
width: 260px;
//overflow-y: hidden;
/*滚动条样式*/
&::-webkit-scrollbar {
width: 0px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5;
background: rgba(0, 0, 0, 0.25);
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f2f2f2;
}
.aui-sidebar__menu {
width: 266px;
}
}
}
</style>