123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- {% 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/SyuserForm.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/SyuserForm.jsp?id=' + id
- });
- };
- var editFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '编辑用户信息',
- url : sy.contextPath + '/securityJsp/base/SyuserForm.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/syuser!delete.action', {
- id : id
- }, function() {
- grid.datagrid('reload');
- }, 'json');
- }
- });
- };
- var grantRoleFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '修改角色',
- url : sy.contextPath + '/securityJsp/base/SyuserRoleGrant.jsp?id=' + id,
- buttons : [ {
- text : '修改',
- handler : function() {
- dialog.find('iframe').get(0).contentWindow.submitForm(dialog, grid, parent.$);
- }
- } ]
- });
- };
- var grantOrganizationFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '修改机构',
- url : sy.contextPath + '/securityJsp/base/SyuserOrganizationGrant.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/syuser!grid.action',
- striped : true,
- rownumbers : true,
- pagination : true,
- singleSelect : true,
- idField : 'id',
- sortName : 'createdatetime',
- sortOrder : 'desc',
- pageSize : 50,
- pageList : [ 10, 20, 30, 40, 50, 100, 200, 300, 400, 500 ],
- frozenColumns : [ [ {
- width : '100',
- title : '登录名',
- field : 'loginname',
- sortable : true
- }, {
- width : '80',
- title : '姓名',
- field : 'name',
- sortable : true
- } ] ],
- columns : [ [ {
- width : '150',
- title : '创建时间',
- field : 'createdatetime',
- sortable : true
- }, {
- width : '150',
- title : '修改时间',
- field : 'updatedatetime',
- sortable : true
- }, {
- width : '50',
- title : '性别',
- field : 'sex',
- sortable : true,
- formatter : function(value, row, index) {
- switch (value) {
- case '0':
- return '女';
- case '1':
- return '男';
- }
- }
- }, {
- width : '50',
- title : '年龄',
- field : 'age',
- hidden : true
- }, {
- width : '250',
- title : '照片',
- field : 'photo',
- formatter : function(value, row) {
- if(value){
- return sy.formatString('<span title="{0}">{1}</span>', value, value);
- }
- }
- }, {
- title : '操作',
- field : 'action',
- width : '90',
- formatter : function(value, row) {
- var str = '';
- {%if current_user.have_permission("/base/syuser!getById") %}
- str += sy.formatString('<img class="iconImg ext-icon-note" title="查看" onclick="showFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if current_user.have_permission("/base/syuser!update") %}
- str += sy.formatString('<img class="iconImg ext-icon-note_edit" title="编辑" onclick="editFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if current_user.have_permission("/base/syuser!grantRole") %}
- str += sy.formatString('<img class="iconImg ext-icon-user" title="用户角色" onclick="grantRoleFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if current_user.have_permission("/base/syuser!grantOrganization") %}
- str += sy.formatString('<img class="iconImg ext-icon-group" title="用户机构" onclick="grantOrganizationFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if current_user.have_permission("/base/syuser!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>
- <td>
- <form id="searchForm">
- <table>
- <tr>
- <td>登录名</td>
- <td><input name="QUERY_t#loginname_S_LK" style="width: 80px;" /></td>
- <td>姓名</td>
- <td><input name="QUERY_t#name_S_LK" style="width: 80px;" /></td>
- <td>性别</td>
- <td><select name="QUERY_t#sex_S_EQ" class="easyui-combobox" data-options="panelHeight:'auto',editable:false"><option value="">请选择</option>
- <option value="1">男</option>
- <option value="0">女</option></select></td>
- <td>创建时间</td>
- <td><input name="QUERY_t#createdatetime_D_GE" class="Wdate" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width: 120px;" />-<input name="QUERY_t#createdatetime_D_LE" class="Wdate" onclick="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width: 120px;" /></td>
- <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom',plain:true" onclick="grid.datagrid('load',sy.serializeObject($('#searchForm')));">过滤</a><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom_out',plain:true" onclick="$('#searchForm input').val('');grid.datagrid('load',{});">重置过滤</a></td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- <tr>
- <td>
- <table>
- <tr>
- {%if current_user.have_permission("/base/syuser!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><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
- <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td>
- </tr>
- </table>
- </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 %}
|