var url = CMS_SystemConfig.VirtualDirectoryPath + "/User/Edit"; var bathval = ""; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); function User_Export() { $(document.forms[0]).submit(); } function reload() { $("#dgUserList").cmsXDataTable("load", $.getDataGridParams("dgUserList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgUserList").cmsXDataTable("getSelections"), function (index) { d.push(this.UserID); }); return d; } //修改角色 function User_ModifyRole() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改角色的用户信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个用户进行修改角色。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/ModifyRole?UserID=' + d + '&MNU=' + mnu; $.popupTopWindow('修改角色', redirectTo, 650, 350, null, null); } //数据范围设置 function User_DataRange() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要设置的用户信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行设置。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/DataRange?UserID=' + d + '&MNU=' + mnu; $.popupTopWindow('数据范围设置', redirectTo, 650, 500, null, null); } //修改密码 function User_BatchInitPassword() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要修改密码的用户。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/BatchInitPassword?userID=+' + d + '&type=0&MNU=' + mnu + '&isView=1'; $.popupTopWindow('修改密码', redirectTo, 450, 200, null, null); } //密码规则 function User_BatchSetPassword() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/BatchInitPassword?userID=staff&type=0&MNU=' + mnu + '&isView=2'; $.popupTopWindow('密码规则', redirectTo, 450, 200, null, null); } //启用 function User_USABLE() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要启用的用户。"); return; } $.messager.confirm("系统提示", "您确定对选择的用户启用?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/User/Usable', { userIDList: d }, function (data) { $.messager.alert("系统提示", data.Message, 'info', function () { if (data.IsSuccess) { $("#dgUserList").cmsXDataTable('load'); } }); }); } }); } //禁用 function User_UNUSABLE() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要禁用的用户。"); return; } $.messager.confirm("系统提示", "您确定对选择的用户禁用?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/User/UnUsable', { userIDList: d }, function (data) { $.messager.alert("系统提示", data.Message, 'info', function () { if (data.IsSuccess) { $("#dgUserList").cmsXDataTable('load'); } }); }); } }); } function QueryCampusDropdownList(data) { //$("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + ""); var campusID = $("#CampusDropdown").combogridX("getValue"); if (campusID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); } reload(); } function QueryCollegeDropdownList(data) { //$("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data.Value + ""); var collegeID = $("#CollegeDropdown").combogridX("getValue"); if (collegeID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})"; $("#DepartmentDropdown").combogridX("reload", eval(jsonString)); } reload(); } function QueryCollegeDropdownListLoad(data) { if (data.length > 0 && $("#DepartmentDropdown").length > 0 && $.data($("#DepartmentDropdown")[0], "combobox")) { $("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data[0].Value + ""); } } function QueryDepartmentDropdownList(data) { reload(); } function QueryDepartmentDropdownListLoad(data) { if (data.length > 0 && $("#dgUserList").length > 0 && $.data($("#dgUserList")[0], "cmsXDataTable")) { reload(); } }