123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- {% extends "base.html" %}
- {% block title %}
- {% endblock %}
- {% block head %}
- <script type="text/javascript">
- var grid;
- var addFun = function() {
- var dialog = parent.sy.modalDialog({
- title : '添加角色信息',
- url : sy.contextPath + '/securityJsp/base/SyroleForm.jsp',
- buttons : [ {
- text : '添加',
- handler : function() {
- dialog.find('iframe').get(0).contentWindow.submitForm(dialog, grid, parent.$);
- }
- } ]
- });
- };
- var showFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '查看角色信息',
- url : sy.contextPath + '/securityJsp/base/SyroleForm.jsp?id=' + id
- });
- };
- var editFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '编辑角色信息',
- url : sy.contextPath + '/securityJsp/base/SyroleForm.jsp?id=' + id,
- buttons : [ {
- text : '编辑',
- handler : function() {
- dialog.find('iframe').get(0).contentWindow.submitForm(dialog, grid, parent.$);
- }
- } ]
- });
- };
- var removeFun = function(id) {
- parent.$.messager.confirm('询问', '您确定要删除此记录?', function(r) {
- if (r) {
- $.post(sy.contextPath + '/base/syrole!delete.action', {
- id : id
- }, function() {
- grid.datagrid('reload');
- }, 'json');
- }
- });
- };
- var grantFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '角色授权',
- url : sy.contextPath + '/securityJsp/base/SyroleGrant.jsp?id=' + id,
- buttons : [ {
- text : '授权',
- handler : function() {
- dialog.find('iframe').get(0).contentWindow.submitForm(dialog, grid, parent.$);
- }
- } ]
- });
- };
- $(function() {
- grid = $('#grid').datagrid({
- title : '',
- url : sy.contextPath + '/base/syrole!grid.action',
- striped : true,
- rownumbers : true,
- pagination : true,
- singleSelect : true,
- idField : 'id',
- sortName : 'seq',
- sortOrder : 'asc',
- frozenColumns : [ [ {
- width : '100',
- title : '角色名称',
- field : 'name',
- sortable : true
- } ] ],
- columns : [ [ {
- width : '150',
- title : '创建时间',
- field : 'createdatetime',
- sortable : true
- }, {
- width : '150',
- title : '修改时间',
- field : 'updatedatetime',
- sortable : true
- }, {
- width : '300',
- title : '资源描述',
- field : 'description'
- }, {
- width : '60',
- title : '排序',
- field : 'seq',
- hidden : true,
- sortable : true
- }, {
- title : '操作',
- field : 'action',
- width : '80',
- formatter : function(value, row) {
- var str = '';
- {%if current_user.have_permission("/base/syrole!getById") %}
- str += sy.formatString('<img class="iconImg ext-icon-note" title="查看" onclick="showFun(\'{0}\');"/>', row.id);
- {% endif %}
- {%if current_user.have_permission("/base/syrole!update") %}
- str += sy.formatString('<img class="iconImg ext-icon-note_edit" title="编辑" onclick="editFun(\'{0}\');"/>', row.id);
- {% endif %}
- {%if current_user.have_permission("/base/syrole!grant") %}
- str += sy.formatString('<img class="iconImg ext-icon-key" title="授权" onclick="grantFun(\'{0}\');"/>', row.id);
- {% endif %}
- {%if current_user.have_permission("/base/syrole!delete") %}
- str += sy.formatString('<img class="iconImg ext-icon-note_delete" title="删除" onclick="removeFun(\'{0}\');"/>', row.id);
- {% endif %}
- return str;
- }
- } ] ],
- toolbar : '#toolbar',
- onBeforeLoad : function(param) {
- parent.$.messager.progress({
- text : '数据加载中....'
- });
- },
- onLoadSuccess : function(data) {
- $('.iconImg').attr('src', sy.pixel_0);
- parent.$.messager.progress('close');
- }
- });
- });
- </script>
- {% endblock %}
- {% block body %}
- <body class="easyui-layout" data-options="fit:true,border:false">
- <div id="toolbar" style="display: none;">
- <table>
- <tr>
- {%if current_user.have_permission("/base/syrole!save") %}
- <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-note_add',plain:true" onclick="addFun();">添加</a></td>
- {%endif%}
- <td><div class="datagrid-btn-separator"></div></td>
- <td><input id="searchBox" class="easyui-searchbox" style="width: 150px" data-options="searcher:function(value,name){grid.datagrid('load',{'QUERY_t#name_S_LK':value});},prompt:'搜索角色名称'"></input></td>
- <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom_out',plain:true" onclick="$('#searchBox').searchbox('setValue','');grid.datagrid('load',{});">清空查询</a></td>
- </tr>
- </table>
- </div>
- <div data-options="region:'center',fit:true,border:false">
- <table id="grid" data-options="fit:true,border:false"></table>
- </div>
- </body>
- {% endblock %}
|