1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
| <script type="text/javascript"> $(function () { loadData(); }); function loadData(pars) { $('#tt').datagrid({ url: '/RoleInfo/GetRoleInfoList', title: '角色数据表格', width: 700, height: 400, fitColumns: true, nowrap: false, idField: 'ID', loadMsg: '正在加载用户的信息...', pagination: true, singleSelect: false, pageSize: 5, pageNumber: 1, pageList: [5, 10, 15], queryParams: pars, columns: [[ { field: 'ck', checkbox: true, align: 'left', width: 50 }, { field: 'ID', title: '编号', width: 80 }, { field: 'RoleName', title: '姓名', width: 120 }, { field: 'ModifiedOn', title: '上次修改时间', width: 120, align: 'right', formatter: function (value, row, index) { return (eval(value.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"))).pattern("yyyy-M-d"); } }, { field: 'Remark', title: '备注', width: 120 }, { field: 'SubTime', title: '创建时间', width: 80, align: 'right', formatter: function (value, row, index) { return (eval(value.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"))).pattern("yyyy-M-d"); } } ]], toolbar: [{ id: 'btnDelete', text: '删除', iconCls: 'icon-remove', handler: function () { deleteInfo(); } }, { id: 'btnAdd', text: '添加', iconCls: 'icon-add', handler: function () { addInfo(); } }, { id: 'btnEidt', text: '编辑', iconCls: 'icon-edit', handler: function () {
showEditInfo(); } }, { id: 'btnSetRoleAction', text: '为角色分配权限', iconCls: 'icon-edit', handler: function () {
showRoleAction(); } }] }); } function showRoleAction() { var rows = $("#tt").datagrid("getSelections"); if (rows.length != 1) { $.messager.alert("提示", "请选择要分配权限的角色", "error"); return; } $('#setActionFrame').attr("src", "/RoleInfo/ShowRoleAction/?id=" + rows[0].ID) $("#setActionDiv").css("display", "block"); $('#setActionDiv').dialog({ title: '为角色分配权限数据', width: 300, height: 400, collapsible: true, maximizable: true, resizable: true, modal: true, buttons: [{ text: 'Ok', iconCls: 'icon-ok', handler: function () { var childWindow = $("#setActionFrame")[0].contentWindow; childWindow.subForm(); } }, { text: 'Cancel', handler: function () { $('#setActionDiv').dialog('close'); } }] }); } function addInfo() { $("#addFrame").attr("src", "/RoleInfo/ShowAddRoleInfo"); $("#addDiv").css("display", "block"); $('#addDiv').dialog({ title: '添加角色数据', width: 300, height: 400, collapsible: true, maximizable: true, resizable: true, modal: true, buttons: [{ text: 'Ok', iconCls: 'icon-ok', handler: function () { var childWindow = $("#addFrame")[0].contentWindow; childWindow.subForm();
} }, { text: 'Cancel', handler: function () { $("#addRoleForm textbox").val(''); $('#addDiv').dialog('close'); } }] }); } function afterSet(data) { if (data == "ok") { $('#setActionDiv').dialog('close'); $('#tt').datagrid('reload'); } } </script> </head> <body> <div> 用户名:<input type="text" id="txtSearchName" /> 备注<input type="text" id="txtSearchRemark" /><a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:80px" id="btnSearch">Search</a> <table id="tt" style="width: 700px;" title="标题,可以使用代码进行初始化,也可以使用这种属性的方式" iconcls="icon-edit"></table> </div> <div id="addDiv"> <iframe id="addFrame" width="100%" height="100%" frameborder="0"></iframe> </div> <div id="setActionDiv"> <iframe id="setActionFrame" width="100%" height="100%" frameborder="0"></iframe> </div> </body>
|