【role】修改列表页操作列

pull/65/head
chenjinlong 4 years ago
parent a89493bcfa
commit 9ff9f10345

@ -1,8 +1,9 @@
layui.use(['layer', 'form', 'table', 'admin', 'HttpRequest', 'func'], function () {
layui.use(['layer', 'form', 'table', 'admin', 'HttpRequest', 'func', 'dropdown'], function () {
var $ = layui.$;
var table = layui.table;
var HttpRequest = layui.HttpRequest;
var func = layui.func;
var dropdown = layui.dropdown;
/**
* 系统管理--角色管理
@ -27,36 +28,36 @@ layui.use(['layer', 'form', 'table', 'admin', 'HttpRequest', 'func'], function (
{
field: 'dataScopeType', align: "center", sort: true, title: '数据范围类型', templet: function (data) {
if (data.dataScopeType === 10) {
return "仅本人数据";
return '<span class="layui-badge layui-badge-green">仅本人数据</span>';
}
if (data.dataScopeType === 20) {
return "本部门数据";
return '<span class="layui-badge layui-badge-green">本部门数据</span>';
}
if (data.dataScopeType === 30) {
return "本部门及以下数据";
return '<span class="layui-badge layui-badge-green">本部门及以下数据</span>';
}
if (data.dataScopeType === 40) {
return "指定部门数据";
return '<span class="layui-badge layui-badge-green">指定部门数据</span>';
}
if (data.dataScopeType === 50) {
return "全部数据";
return '<span class="layui-badge layui-badge-green">全部数据</span>';
}
return "未知";
return '<span class="layui-badge layui-badge-green">未知</span>';
}
},
{
field: 'statusFlag', align: "center", sort: true, title: '状态', templet: function (data) {
if (data.statusFlag === 1) {
return "启用";
return '<span class="layui-badge layui-badge-green">启用</span>';
}
if (data.statusFlag === 2) {
return "禁用";
return '<span class="layui-badge layui-badge-green">禁用</span>';
}
return "未知";
return '<span class="layui-badge layui-badge-green">未知</span>';
}
},
{field: 'remark', align: "center", sort: true, title: '备注'},
{align: 'center', toolbar: '#tableBar', title: '操作', minWidth: 400}
{align: 'center', toolbar: '#tableBar', title: '操作'}
]];
};

@ -33,17 +33,25 @@
@if(loginUser.haveButton("BUTTON_ROLE_EDIT")){
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
@}
@if(loginUser.haveButton("BUTTON_ROLE_EDIT")){
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="editDataScope">设置数据范围</a>
@}
@if(loginUser.haveButton("BUTTON_ROLE_DELETE")){
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
@}
@if(loginUser.haveButton("BUTTON_ROLE_ASSIGN_MENU_BUTTON")){
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="assignMenu">分配菜单按钮</a>
@}
@if(loginUser.haveButton("BUTTON_ROLE_ASSIGN_RESOURCE")){
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="assignApi">分配接口</a>
@if(loginUser.haveButton("BUTTON_ROLE_EDIT")||loginUser.haveButton("BUTTON_ROLE_ASSIGN_MENU_BUTTON")||loginUser.haveButton("BUTTON_ROLE_ASSIGN_RESOURCE")){
<a class="layui-btn layui-btn-xs" data-dropdown="#userTbDrop{{d.LAY_INDEX}}" no-shade="true">
更多<i class="layui-icon layui-icon-drop" style="font-size: 12px;margin-right: 0;"></i></a>
<!-- 下拉菜单 -->
<ul class="dropdown-menu-nav dropdown-bottom-right layui-hide" id="userTbDrop{{d.LAY_INDEX}}">
<div class="dropdown-anchor"></div>
@if(loginUser.haveButton("BUTTON_ROLE_EDIT")){
<li><a lay-event="editDataScope">设置数据范围</a></li>
@}
@if(loginUser.haveButton("BUTTON_ROLE_ASSIGN_MENU_BUTTON")){
<li><a lay-event="assignMenu">分配菜单按钮</a></li>
@}
@if(loginUser.haveButton("BUTTON_ROLE_ASSIGN_RESOURCE")){
<li><a lay-event="assignApi">分配接口</a></li>
@}
</ul>
@}
</script>
@}

Loading…
Cancel
Save