1、优化权限管理
This commit is contained in:
parent
acdf5cea0f
commit
1aee2adc0f
@ -113,6 +113,7 @@ public class GnssCalcDataController extends BasicController implements CommonExc
|
||||
|
||||
@Override
|
||||
public String tenantIdField() {
|
||||
return "d.tenantid";
|
||||
if(isJoinQuery) return "d.tenantid";
|
||||
else return "tenantid";
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.common.Role;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.entity.TenantMapper;
|
||||
import com.imdroid.beidou.entity.User;
|
||||
@ -42,8 +43,9 @@ public class UserController extends BasicController {
|
||||
@RequestMapping("/sys/user/add")
|
||||
public String addUser(Model m, HttpSession session){
|
||||
initModel(m, session);
|
||||
|
||||
List<Tenant> tenants = tenantMapper.selectList(null);
|
||||
QueryWrapper<Tenant> queryWrapper = new QueryWrapper<>();
|
||||
if(loginRole.equals(Role.ADMIN)) queryWrapper.ne("id",Tenant.SAAS_PROVIDER_ID);
|
||||
List<Tenant> tenants = tenantMapper.selectList(queryWrapper);
|
||||
m.addAttribute("tenant_list", tenants);
|
||||
|
||||
return "/page/table/user_add";
|
||||
@ -52,7 +54,10 @@ public class UserController extends BasicController {
|
||||
@RequestMapping("/sys/user/edit")
|
||||
public String editUser(Model m, HttpSession session){
|
||||
initModel(m, session);
|
||||
List<Tenant> tenants = tenantMapper.selectList(null);
|
||||
QueryWrapper<Tenant> queryWrapper = new QueryWrapper<>();
|
||||
if(loginRole.equals(Role.ADMIN)) queryWrapper.ne("id",Tenant.SAAS_PROVIDER_ID);
|
||||
List<Tenant> tenants = tenantMapper.selectList(queryWrapper);
|
||||
|
||||
m.addAttribute("tenant_list", tenants);
|
||||
return "/page/table/user_add";
|
||||
}
|
||||
@ -63,6 +68,7 @@ public class UserController extends BasicController {
|
||||
public JSONObject list(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<User> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
||||
if(loginRole.equals(Role.ADMIN)) queryWrapper.ne("role",Role.SUPER_ADMIN);
|
||||
|
||||
IPage<User> cs = userMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "形变监测平台",
|
||||
"title": "北斗管理平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
@ -53,12 +53,6 @@
|
||||
"icon": "fa fa-gear",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "通用参数",
|
||||
"href": "page/gnss_group_cfg",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "设备参数",
|
||||
"href": "page/gnss_dev_cfg",
|
||||
@ -78,24 +72,16 @@
|
||||
"href": "page/fwd_records",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统管理",
|
||||
"icon": "fa fa-lemon-o",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "操作日志",
|
||||
"href": "",
|
||||
"icon": "fa fa-pencil-square-o",
|
||||
"title": "等待推送",
|
||||
"href": "page/resend_records",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "形变监测平台",
|
||||
"title": "北斗管理平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
@ -156,12 +156,6 @@
|
||||
"href": "sys/user",
|
||||
"icon": "fa fa-user",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "操作日志",
|
||||
"href": "",
|
||||
"icon": "fa fa-pencil-square-o",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
133
sec-beidou/src/main/resources/static/api/init_sys_admin.json
Normal file
133
sec-beidou/src/main/resources/static/api/init_sys_admin.json
Normal file
@ -0,0 +1,133 @@
|
||||
{
|
||||
"homeInfo": {
|
||||
"title": "首页",
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "北斗管理平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
"menuInfo": [
|
||||
{
|
||||
"title": "设备管理",
|
||||
"icon": "fa fa-address-book",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "设备总览",
|
||||
"href": "page/device_overview",
|
||||
"icon": "fa fa-home",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "运行状态",
|
||||
"href": "page/gnss_status",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "告警管理",
|
||||
"href": "",
|
||||
"icon": "fa fa-bell-o",
|
||||
"target": "",
|
||||
"child": [
|
||||
{
|
||||
"title": "告警消息",
|
||||
"href": "page/warning",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "告警参数",
|
||||
"href": "page/warning_cfg",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "解算结果",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "配置管理",
|
||||
"href": "",
|
||||
"icon": "fa fa-gear",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "通用参数",
|
||||
"href": "page/gnss_group_cfg",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "设备参数",
|
||||
"href": "page/gnss_dev_cfg",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "设备消息",
|
||||
"href": "",
|
||||
"icon": "fa fa-file-text-o",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "状态消息",
|
||||
"href": "page/gnss_msg_status",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "统计消息",
|
||||
"href": "page/gnss_msg_trx",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "数据推送",
|
||||
"href": "",
|
||||
"icon": "fa fa-send-o",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "推送记录",
|
||||
"href": "page/fwd_records",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "等待推送",
|
||||
"href": "page/resend_records",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统管理",
|
||||
"icon": "fa fa-lemon-o",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "用户管理",
|
||||
"href": "sys/user",
|
||||
"icon": "fa fa-user",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -131,8 +131,11 @@
|
||||
miniAdmin = layui.miniAdmin;
|
||||
|
||||
var nav_url;
|
||||
if([[${role}]] == "SUPER_ADMIN" || [[${role}]] == "ADMIN") {
|
||||
nav_url = "api/init.json";
|
||||
if([[${role}]] == "SUPER_ADMIN" ) {
|
||||
nav_url = "api/init_super_admin.json";
|
||||
}
|
||||
else if([[${role}]] == "ADMIN") {
|
||||
nav_url = "api/init_sys_admin.json";
|
||||
}
|
||||
else {
|
||||
nav_url = "api/init_enterprise.json"
|
||||
|
||||
@ -89,9 +89,9 @@
|
||||
{field: 'b562e', title: '原始东', templet: "<div>{{d.b562e.toFixed(2)}}</div>"},
|
||||
{field: 'b562n', title: '原始北', templet: "<div>{{d.b562n.toFixed(2)}}</div>"},
|
||||
{field: 'b562d', title: '原始天', templet: "<div>{{d.b562d.toFixed(2)}}</div>"},
|
||||
{field: 'rpose', title: '相对东', templet: "<div>{{d.rpose==null?'':d.rpose.toFixed(2)}}</div>"},
|
||||
{field: 'rposn', title: '相对北', templet: "<div>{{d.rposn==null?'':d.rposn.toFixed(2)}}</div>"},
|
||||
{field: 'rposd', title: '相对天', templet: "<div>{{d.rposd==null?'':d.rposd.toFixed(2)}}</div>"},
|
||||
{field: 'rpose', title: '滤波东', templet: "<div>{{d.rpose==null?'':d.rpose.toFixed(2)}}</div>"},
|
||||
{field: 'rposn', title: '滤波北', templet: "<div>{{d.rposn==null?'':d.rposn.toFixed(2)}}</div>"},
|
||||
{field: 'rposd', title: '滤波天', templet: "<div>{{d.rposd==null?'':d.rposd.toFixed(2)}}</div>"},
|
||||
//{field: 'auxe', title: '辅助东', templet: "<div>{{d.auxe==null?'':d.auxe.toFixed(2)}}</div>"},
|
||||
//{field: 'auxn', title: '辅助北', templet: "<div>{{d.auxn==null?'':d.auxn.toFixed(2)}}</div>"},
|
||||
//{field: 'auxd', title: '辅助天', templet: "<div>{{d.auxd==null?'':d.auxd.toFixed(2)}}</div>"},
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
{field: 'deviceid', title: '设备号', sort: true},
|
||||
{field: 'name', title: '设备名称'},
|
||||
{field: 'devicetype', title: '类型',templet: '#typeTrans'},
|
||||
{field: 'parentid', title: '父设备号', sort: true},
|
||||
{field: 'parentid', title: '基站编号', sort: true},
|
||||
{field: 'tenantname', title: '所属组织'},
|
||||
{field: 'project_id', title: '项目号', sort: true},
|
||||
{field: 'group_id', title: '基本参数组', sort: true},
|
||||
@ -99,9 +99,8 @@
|
||||
{field: 'syn', title: '参数同步',templet: '#synTrans'},
|
||||
{title: '操作', toolbar: '#currentTableBar', align: "center", minWidth: 120}
|
||||
];
|
||||
if([[${role}]] != "ADMIN" && [[${role}]] != "SUPER_ADMIN" &&
|
||||
!([[${role}]] == "MANAGER" && [[${tenant_id}]] == 0)) {
|
||||
cfg_cols[9].hide = true;
|
||||
if([[${role}]] == "USER") {
|
||||
cfg_cols[12].hide = true;
|
||||
}
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">父设备号</label>
|
||||
<label class="layui-form-label">基站编号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="parentid" id="parentid" placeholder="请输入关联基准站编号" value="" class="layui-input">
|
||||
</div>
|
||||
@ -83,7 +83,7 @@
|
||||
<input type="text" name="project_id" id="project_id" placeholder="请输入项目编号" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-inline" th:if="${role=='SUPER_ADMIN'}">
|
||||
<label class="layui-form-label">项目2号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="project2_id" id="project2_id" placeholder="请输入项目编号" value="" class="layui-input">
|
||||
@ -114,7 +114,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" th:if="${role=='SUPER_ADMIN' || role=='ADMIN'}">
|
||||
<div class="layui-inline" th:if="${role=='SUPER_ADMIN'}">
|
||||
<label class="layui-form-label">推送2</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="fwd_group_id2" id="fwd_group_id2" lay-search="">
|
||||
@ -204,6 +204,7 @@
|
||||
console.log("ajax error");
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
@ -51,8 +51,8 @@
|
||||
<label class="layui-form-label">角色</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="role" id="role" lay-filter="role">
|
||||
<option value="SUPER_ADMIN" th:if="${tenant_id}==0">超级管理员</option>
|
||||
<option value="ADMIN" th:if="${tenant_id}==0">系统管理员</option>
|
||||
<option value="SUPER_ADMIN" th:if="${role=='SUPER_ADMIN' && tenant_id==0}">超级管理员</option>
|
||||
<option value="ADMIN" th:if="${role=='SUPER_ADMIN' || role=='ADMIN'}">系统管理员</option>
|
||||
<option value="MANAGER">管理员</option>
|
||||
<option value="USER">用户</option>
|
||||
</select>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user