pull/143/head
孙萌 2024-04-22 18:02:09 +08:00
parent 4221314e39
commit 4a34accad6
1 changed files with 42 additions and 7 deletions

View File

@ -123,11 +123,6 @@ export default {
{deviceTypeName:'大数据设备信息',router:'dataDevice',index:4}, {deviceTypeName:'大数据设备信息',router:'dataDevice',index:4},
{deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5}, {deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5},
] }, ] },
{ name: '管理员管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [
{deviceTypeName:'用户信息管理',router:'userInfoControl',index:6},
{deviceTypeName:'设备管理',router:'deviceManage',index:7},
// {deviceTypeName:'',router:'videoManage',index:8},
] },
], ],
manageList:['deviceStatusSet', manageList:['deviceStatusSet',
'deviceSet', 'deviceSet',
@ -148,7 +143,8 @@ export default {
IDTimer: null, IDTimer: null,
deviceId: '', deviceId: '',
limitUserId: [], limitUserId: [],
statusData: [] statusData: [],
roleId:2,
} }
}, },
watch: { watch: {
@ -158,7 +154,6 @@ export default {
if (!store.equipmentName) { if (!store.equipmentName) {
this.getByid() this.getByid()
} }
}, },
}, },
mounted() { mounted() {
@ -192,11 +187,51 @@ export default {
// id // id
this.get_user_getjurisdiction() this.get_user_getjurisdiction()
//
this.getRole()
}, },
beforeDestroy() { beforeDestroy() {
this.IDTimer && clearInterval(this.IDTimer) this.IDTimer && clearInterval(this.IDTimer)
}, },
methods: { methods: {
getRole(){
var user= JSON.parse(localStorage.getItem('userInfo'))
this.api.selUserbyid(user.userid).then(res=>{
if(res.data.code==200){
this.roleId=res.data.data.roleId
if(this.roleId==1){
this.leftList1= [
{ name: '管理', img: require('../assets/image/index-icon.png'), list: [], router: 'manage', isRouter: true, },
{ name: '用户管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [
{deviceTypeName:'控制器设备状态值设置',router:'deviceStatusSet',index:0},
{deviceTypeName:'控制器设备设定值设置',router:'deviceSet',index:1},
{deviceTypeName:'设备信息管理',router:'deviceInfoManage',index:2},
{deviceTypeName:'设备绑定气象站数据',router:'weatherData',index:3},
{deviceTypeName:'大数据设备信息',router:'dataDevice',index:4},
{deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5},
] },
{ name: '管理员管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [
{deviceTypeName:'用户信息管理',router:'userInfoControl',index:6},
{deviceTypeName:'设备管理',router:'deviceManage',index:7},
// {deviceTypeName:'',router:'videoManage',index:8},
] },
]
}else{
this.leftList1= [
{ name: '管理', img: require('../assets/image/index-icon.png'), list: [], router: 'manage', isRouter: true, },
{ name: '用户管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [
{deviceTypeName:'控制器设备状态值设置',router:'deviceStatusSet',index:0},
{deviceTypeName:'控制器设备设定值设置',router:'deviceSet',index:1},
{deviceTypeName:'设备信息管理',router:'deviceInfoManage',index:2},
{deviceTypeName:'设备绑定气象站数据',router:'weatherData',index:3},
{deviceTypeName:'大数据设备信息',router:'dataDevice',index:4},
{deviceTypeName:'手机控制模块信息',router:'mobileControl',index:5},
] },
]
}
}
})
},
// id // id
get_user_getjurisdiction() { get_user_getjurisdiction() {
let userInfo = localStorage.getItem("userInfo") ? JSON.parse(localStorage.getItem("userInfo")) : { userid: -1 }; let userInfo = localStorage.getItem("userInfo") ? JSON.parse(localStorage.getItem("userInfo")) : { userid: -1 };