var url = CMS_SystemConfig.VirtualDirectoryPath + "/Role/Edit"; var bathval = ""; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); function Role_Export() { $(document.forms[0]).submit(); } //新增 function Role_Add() { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('教师信息新增', redirectTo, 650, 250, null, null); } function reload() { $("#dgRoleList").cmsXDataTable("load", $.getDataGridParams("dgRoleList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgRoleList").cmsXDataTable("getSelections"), function (index) { d.push(this.RoleID); }); return d; } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url +"?RoleID=" + rowdata.RoleID + "&MNU=" + mnu + "&isView=1"; $.popupTopWindow('教师角色信息', redirectTo, 650, 250, null, null); } //修改按钮 function Role_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的角色类型。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?RoleID=" + d + "&MNU=" + mnu; $.popupTopWindow('教师角色信息修改', redirectTo, 650, 250, null, null); } //删除 function Role_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的角色类型。"); return; } $.messager.confirm("系统提示", "您确定要删除该角色类型?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Role/Delete', { roleIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); $("#dgRoleList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //授权 function Role_Authenization() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要授权的角色类型。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行授权。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Role/Authenization?RoleID=" + d+ "&MNU=" + mnu; $.popupTopWindow('角色类型授权', redirectTo, 320, 550, null, null); } //数据范围设置 function Role_DataRange() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要设置的角色类型。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行设置。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Role/DataRange?RoleID=" + d +"&MNU="+ mnu; $.popupTopWindow('数据范围设置', redirectTo, 600, 550, null, null); }