123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- {% 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/SyorganizationForm.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/SyorganizationForm.jsp?id=' + id
- });
- };
- var editFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '编辑机构信息',
- url : sy.contextPath + '/securityJsp/base/SyorganizationForm.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/syorganization!delete.action', {
- id : id
- }, function() {
- grid.treegrid('reload');
- }, 'json');
- }
- });
- };
- var grantFun = function(id) {
- var dialog = parent.sy.modalDialog({
- title : '机构授权',
- url : sy.contextPath + '/securityJsp/base/SyorganizationGrant.jsp?id=' + id,
- buttons : [ {
- text : '授权',
- handler : function() {
- dialog.find('iframe').get(0).contentWindow.submitForm(dialog, grid, parent.$);
- }
- } ]
- });
- };
- var redoFun = function() {
- var node = grid.treegrid('getSelected');
- if (node) {
- grid.treegrid('expandAll', node.id);
- } else {
- grid.treegrid('expandAll');
- }
- };
- var undoFun = function() {
- var node = grid.treegrid('getSelected');
- if (node) {
- grid.treegrid('collapseAll', node.id);
- } else {
- grid.treegrid('collapseAll');
- }
- };
- $(function() {
- grid = $('#grid').treegrid({
- title : '',
- url : sy.contextPath + '/base/syorganization!treeGrid.action',
- idField : 'id',
- treeField : 'name',
- parentField : 'pid',
- rownumbers : true,
- pagination : false,
- sortName : 'seq',
- sortOrder : 'asc',
- frozenColumns : [ [ {
- width : '200',
- title : '机构名称',
- field : 'name'
- } ] ],
- columns : [ [ {
- width : '150',
- title : '图标名称',
- field : 'iconCls'
- }, {
- width : '150',
- title : '机构编码',
- field : 'code'
- }, {
- width : '200',
- title : '机构地址',
- field : 'address'
- }, {
- width : '150',
- title : '创建时间',
- field : 'createdatetime',
- hidden : true
- }, {
- width : '150',
- title : '修改时间',
- field : 'updatedatetime',
- hidden : true
- }, {
- width : '60',
- title : '排序',
- field : 'seq',
- hidden : true
- }, {
- title : '操作',
- field : 'action',
- width : '80',
- formatter : function(value, row) {
- var str = '';
- {%if (current_user.have_permission("/base/syorganization!getById")) %}
- str += sy.formatString('<img class="iconImg ext-icon-note" title="查看" onclick="showFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if (current_user.have_permission("/base/syorganization!update"))%}
- str += sy.formatString('<img class="iconImg ext-icon-note_edit" title="编辑" onclick="editFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if (current_user.have_permission("/base/syorganization!grant")) %}
- str += sy.formatString('<img class="iconImg ext-icon-group_key" title="授权" onclick="grantFun(\'{0}\');"/>', row.id);
- {%endif%}
- {%if (current_user.have_permission("/base/syorganization!delete")) %}
- str += sy.formatString('<img class="iconImg ext-icon-note_delete" title="删除" onclick="removeFun(\'{0}\');"/>', row.id);
- {%endif%}
- return str;
- }
- } ] ],
- toolbar : '#toolbar',
- onBeforeLoad : function(row, param) {
- parent.$.messager.progress({
- text : '数据加载中....'
- });
- },
- onLoadSuccess : function(row, 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/syorganization!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 onclick="redoFun();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'ext-icon-resultset_next'">展开</a><a onclick="undoFun();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'ext-icon-resultset_previous'">折叠</a></td>
- <td><div class="datagrid-btn-separator"></div></td>
- <td><a onclick="grid.treegrid('reload');" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'ext-icon-arrow_refresh'">刷新</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 %}
|