Authored by wangtao

用户管理,资源授权优化

... ... @@ -1105,7 +1105,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions',
type: 1,
area: ['90%','80%'],
resize:false,
btn: ['确定','取消'],
btn: ['关闭'],
content: laytpl($('#userResourceAuthorization').html()).render(JSON.stringify({})),
success: function (index, layero) {
renderResAuthByUser(usernames[0])
... ... @@ -1121,31 +1121,31 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions',
})
},
yes: function(index, layero){
//获取表格中的数据
var $showTypeSelect= $('#res_user_table').next().find('.user_showType');
var resIds="";
$.each($showTypeSelect,function (i,v) {
var redis = $(this).attr("data-resId");
var showType = $(this).val();
var username = $(this).attr("data-username");
resIds+=(username+'##'+redis+'##'+showType+',');
});
if(resIds.length>0){
resIds[resIds.length-1]=resIds[resIds.length-1].substring(0,resIds[resIds.length-1].length-1);
}
//保存数据到资源用户表中
admin.req({
url:common.domainName + '/api-web/sysUserToResType/resourceSave'
, data:{
ids:resIds
}
}).done(function (res) {
if(res.success){
layer.msg('保存成功!', {icon: 1, time: 3000});
}else{
layer.msg('保存失败!', {icon: 7, time: 3000});
}
});
// //获取表格中的数据
// var $showTypeSelect= $('#res_user_table').next().find('.user_showType');
// var resIds="";
// $.each($showTypeSelect,function (i,v) {
// var redis = $(this).attr("data-resId");
// var showType = $(this).val();
// var username = $(this).attr("data-username");
// resIds+=(username+'##'+redis+'##'+showType+',');
// });
// if(resIds.length>0){
// resIds[resIds.length-1]=resIds[resIds.length-1].substring(0,resIds[resIds.length-1].length-1);
// }
// //保存数据到资源用户表中
// admin.req({
// url:common.domainName + '/api-web/sysUserToResType/resourceSave'
// , data:{
// ids:resIds
// }
// }).done(function (res) {
// if(res.success){
// layer.msg('保存成功!', {icon: 1, time: 3000});
// }else{
// layer.msg('保存失败!', {icon: 7, time: 3000});
// }
// });
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
});
... ...
... ... @@ -25,7 +25,7 @@
<select class="form-control input-sm" name="enabled" lay-filter="enabled">
<option value="">=状态=</option>
<option value="1">正常</option>
<option value="0">禁用</option>
<option value="0">冻结</option>
</select>
</div>
</div>
... ... @@ -137,4 +137,4 @@
fn(params);
});
};
</script>
\ No newline at end of file
</script>
... ...