bug修复
This commit is contained in:
parent
a7ac2e8a1e
commit
811e80a27c
|
@ -107,7 +107,6 @@ export default {
|
|||
} else {
|
||||
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
|
||||
}
|
||||
|
||||
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
|
||||
if (this.dataList[0].type === '组件服务') {
|
||||
this.dataList.map(val => {
|
||||
|
|
|
@ -104,7 +104,7 @@ router.beforeEach((to, from, next) => {
|
|||
Vue.prototype.$message.error(res.msg)
|
||||
return next({ name: 'login' })
|
||||
}
|
||||
window.SITE_CONFIG.menuList = res.data
|
||||
window.SITE_CONFIG.menuList = res.data.filter(item => item.site === 0)
|
||||
fnAddDynamicMenuRoutes(window.SITE_CONFIG.menuList)
|
||||
next({ ...to, replace: true })
|
||||
}).catch(() => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<!--
|
||||
* @Author: kongjun qdkongjun@gmail.com
|
||||
* @Date: 2022-06-20 09:29:59
|
||||
* @LastEditors: kongjun qdkongjun@gmail.com
|
||||
* @LastEditTime: 2022-06-22 10:04:56
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-10-14 15:20:28
|
||||
* @FilePath: \back\src\views\main-sidebar.vue
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
-->
|
||||
|
@ -25,7 +25,7 @@
|
|||
:menu="menu"
|
||||
>
|
||||
<span>sdddd</span>
|
||||
|
||||
|
||||
</sub-menu>
|
||||
</div>
|
||||
</el-menu>
|
||||
|
@ -35,63 +35,64 @@
|
|||
|
||||
<script>
|
||||
import http from '@/utils/request'
|
||||
import SubMenu from "./main-sidebar-sub-menu";
|
||||
import returnLocationStr from '@/utils/location';
|
||||
import SubMenu from './main-sidebar-sub-menu'
|
||||
import returnLocationStr from '@/utils/location'
|
||||
export default {
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
numObject:{}
|
||||
};
|
||||
numObject: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SubMenu,
|
||||
SubMenu
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
this.getNum()
|
||||
//this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
|
||||
// this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
|
||||
},
|
||||
methods: {
|
||||
getNum(){
|
||||
getNum () {
|
||||
http.get('/act/task/myToDoTaskNum').then(({ data: res }) => {
|
||||
this.numObject=res.data
|
||||
let menuList= window.SITE_CONFIG["menuList"];
|
||||
for(var i=0;i<menuList.length;i++){
|
||||
let menu=menuList[i];
|
||||
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"){//能力申请 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.numObject = res.data
|
||||
const menuList = window.SITE_CONFIG.menuList
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
this.$store.state.sidebarMenuList=menuList
|
||||
})
|
||||
}
|
||||
}};
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.aui-sidebar {
|
||||
|
|
|
@ -81,7 +81,7 @@ export default {
|
|||
init () {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.$refs.dataForm.resetFields()
|
||||
this.iconList = getIconList()
|
||||
this.dataForm.parentName = this.$t('menu.parentNameDefault')
|
||||
this.getMenuList()
|
||||
|
@ -89,11 +89,12 @@ export default {
|
|||
},
|
||||
// 获取菜单列表
|
||||
getMenuList () {
|
||||
console.log('获取菜单位置1')
|
||||
return this.$http.get('/sys/menu/list?type=0').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.menuList = res.data
|
||||
this.menuList = res.data.filter(item => item.site === 0)
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 上级菜单树, 设置默认值
|
||||
|
@ -114,11 +115,11 @@ export default {
|
|||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
this.$refs.dataForm.validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http['post']('/devtools/menu', this.dataForm).then(({ data: res }) => {
|
||||
this.$http.post('/devtools/menu', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -133,7 +134,7 @@ export default {
|
|||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}, 1000, { leading: true, trailing: false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -174,4 +175,4 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -123,11 +123,12 @@ export default {
|
|||
},
|
||||
// 获取菜单列表
|
||||
getMenuList () {
|
||||
console.log('获取菜单位置2')
|
||||
return this.$http.get('/sys/menu/list?type=0').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.menuList = res.data
|
||||
this.menuList = res.data.filter(item => item.site === 0)
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
<!--
|
||||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-06-14 09:30:23
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-10-17 14:54:26
|
||||
* @Description: 告诉大家这是什么
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__menu">
|
||||
|
|
|
@ -15,6 +15,7 @@ const state = () => ({
|
|||
accessToken: getAccessToken(),
|
||||
username: '',
|
||||
realName: '',
|
||||
deptName: '',
|
||||
userId: '',
|
||||
avatar: '',
|
||||
role: 0, // 用户管理员权限
|
||||
|
@ -26,6 +27,7 @@ const getters = {
|
|||
avatar: (state) => state.avatar,
|
||||
role: (state) => state.role,
|
||||
userId: (state) => state.userId,
|
||||
deptName: (state) => state.deptName,
|
||||
}
|
||||
const mutations = {
|
||||
/**
|
||||
|
@ -64,6 +66,10 @@ const mutations = {
|
|||
setUserId(state, id) {
|
||||
state.userId = id
|
||||
},
|
||||
// 设置用户单位
|
||||
setDeptName(state, name) {
|
||||
state.deptName = name
|
||||
},
|
||||
/**
|
||||
* @author chuzhixin 1204505056@qq.com
|
||||
* @description 设置头像
|
||||
|
@ -136,6 +142,7 @@ const actions = {
|
|||
commit('setRealname', res.data.data.realName)
|
||||
commit('setRole', res.data.data.roleIdList.length)
|
||||
commit('setUserId', res.data.data.id)
|
||||
commit('setDeptName', res.data.data.deptName)
|
||||
// TODO 获取用户信息,后续执行部分操作
|
||||
// let { username, avatar, roles, ability } = data
|
||||
// if (username && roles && Array.isArray(roles)) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue