/** * 用户角色分配管理 * */ $.namespace("user.userrole"); user.userrole.allData = null; user.userrole.data; // 页面初始化展示 user.userrole.init = function() { var str = ""; var jsonallData = $.parseJSON(user.userrole.allData); if (jsonallData) { for ( var i = 0; i < jsonallData.length; i++) { var all = jsonallData[i]; str += ""; str += "" + all.roleName + ""; /*一个问题 怎么加是否同步判断,数据库没有这个字*/ /* if (all.sel&&all.sfcytb=="1"&&all.sftb) { str += "已同步"; } else if(all.sel&&all.sfcytb=="1"&&!all.sftb){ str += ""; }else if(all.sel&&all.sfcytb!="1"){ str += ""; }else if(!all.sel&&all.sfcytb=="1"&&all.sftb){ str += "已同步"; }else if(!all.sel&&all.sfcytb=="1"&&!all.sftb){ str += ""; }else if(!all.sel&&all.sfcytb!="1"){ str += ""; } */ str += ""; if (all.sfcytb=="1"){ str +="" str += ""; }else{ str += "----"; } str += ""; } $("#divcontent").empty(); $("#divcontent").append(str); } // 返回按钮功能实现 user.userrole.back = function() { location.href = $.app + "/user/querylist.html"; }; // 全选按钮功能实现 user.userrole.all = function() { $(".roleClass").each(function() { $(this).prop("checked", true); }); $(".sfClass").each(function() { //$(this).prop("checked", true); //需求取消同步 $(this).prop("checked", false); }); }; // 全不选按钮功能实现 user.userrole.notall = function() { $(".roleClass").each(function() { $(this).prop("checked", false); }); $(".sfClass").each(function() { $(this).prop("checked", false); }); }; }; user.userrole.isNotBlank=function(value){ if(typeof(value)!='undefined'){ value=value+""; for(var i=0; i