Commit b58506ca authored by xinzhedeai's avatar xinzhedeai

add: 用户角色,报警预设值与历史列表 的编辑按钮隐藏处理

parent 84f91a12
...@@ -2270,7 +2270,7 @@ var reqApis = function () { ...@@ -2270,7 +2270,7 @@ var reqApis = function () {
labelWidth: '120', labelWidth: '120',
operWidth: '120', operWidth: '120',
title: '监测项', title: '监测项',
buttons: [ buttons: Cookies.get('userrole') == 'PT' ? []:[
//{'fn':'', 'type':'success', 'icon':'el-icon-more'}, //{'fn':'', 'type':'success', 'icon':'el-icon-more'},
{ {
'fn': 'toEdit', 'type': 'primary', 'icon': 'el-icon-edit', 'callback': function (item) { 'fn': 'toEdit', 'type': 'primary', 'icon': 'el-icon-edit', 'callback': function (item) {
...@@ -2360,7 +2360,7 @@ var reqApis = function () { ...@@ -2360,7 +2360,7 @@ var reqApis = function () {
labelWidth: '120', labelWidth: '120',
operWidth: '120', operWidth: '120',
title: '监测项', title: '监测项',
buttons: Cookies.get('username') == 'hbb' ? []:[ buttons: Cookies.get('userrole') == 'PT' ? []:[
{ {
'type': 'primary', 'icon': 'el-icon-close-notification', 'isvalid': function (item) { 'type': 'primary', 'icon': 'el-icon-close-notification', 'isvalid': function (item) {
return item.state !== 1 return item.state !== 1
......
...@@ -44,9 +44,13 @@ const user = { ...@@ -44,9 +44,13 @@ const user = {
commit('SET_LOAD_MENUS', true); commit('SET_LOAD_MENUS', true);
// 2025-5-27 10:52:58新增存储登录权限到cookie中 // 2025-5-27 10:52:58新增存储登录权限到cookie中
// Cookies.set('role', body.roles[0]); // Cookies.set('role', body.roles[0]);
// debugger const roles4putong = body.user.user.roles.find((item)=>{
Cookies.set('username', body.user.user.username); return item.name === '普通用户'
})
// Cookies.set('username', body.user.user.username);
if(roles4putong){
Cookies.set('userrole', 'PT');
}
}; };
resolve(res) resolve(res)
}).catch(error => { }).catch(error => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment