123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <!--[if lt IE 9]>
- <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <!--[if IE 6]>
- <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
- <script>DD_belatedPNG.fix('*');</script>
- <![endif]-->
- <script type="text/javascript">
- $(function() {
- $(window).resize(function(){
- $("#tree").setGridWidth($(window).width()-40);
- });
- $("#tree").jqGrid({
- caption:'资源管理',
- url : '${ctx}/myconsole/menu/getByTree',
- editurl:"${ctx}/myconsole/menu/saveOrUpdate",
- mtype : "POST",
- hoverrows:false,
- viewrecords:false,
- gridview:true,
- height:"auto",
- rowNum:100,
- scrollrows:true,
- treeGrid:true,
- ExpandColumn:"menuname",
- treedatatype:"json",
- treeGridModel:"adjacency",
- sortorder:"asc",
- autowidth : true,
- datatype:"json",
- pager:"#pager",
- prmNames : {
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [ {
- label : '编号',
- name : 'keyid',
- hidden : true,
- key : true,
- width : 75
- }, {
- label : '资源名称',
- name : 'menuname',
- edittype:"text",
- editable: true,
- width : 100,
- formoptions:{
- elmsuffix:" <span style='color:red'>*<span>"
- },
- editrules:{required:true},
- editoptions: {
- size:50,
- maxlength: 60
- }
- }, {
- label : '资源编号',
- name : 'menuid',
- edittype:"text",
- editable: true,
- width : 100,
- formoptions:{
- elmsuffix:" <span style='color:red'>*<span>"
- },
- editrules:{required:true},
- editoptions: {
- size:50,
- maxlength: 60
- }
- }, {
- label : '资源地址',
- name : 'menuurl',
- editable: true,
- width : 100,
- edittype : "text",
- editoptions: {
- size:50,
- maxlength: 255
- }
- },{
- label : '资源类型',
- name : 'stype',
- editable: true,
- edittype: "select",
- width : 50,
- editrules:{
- edithidden : true
- },
- editoptions:{
- dataInit: function(elem){
- $(elem).width(120);
- },
- maxlength: 40,
- value : "menu:菜单;function:功能"
- }
- },{
- label : '资源描述',
- name : 'menudesc',
- editable: true,
- hidden:true,
- width : 100,
- edittype : "textarea",
- editrules:{
- edithidden : true
- },
- editoptions: {
- size:50,
- maxlength: 200,
- rows:"5",
- cols:"53"
- }
- }, {
- label : '显示标志',
- name : 'isshow',
- editable: true,
- width : 100,
- align:'center',
- edittype: 'checkbox',
- editoptions: { value: "true:false" },
- formatter: "checkbox", formatoptions: { disabled: true}
- },{
- label : '更新时间',
- name : 'updatetime',
- width : 100,
- editable: false,
- edittype:"text"
- },{
- label : '排序值',
- name : 'sortid',
- edittype:"text",
- editable: true,
- width : 100,
- editoptions: {
- size:50,
- maxlength: 50
- },
- editrules:{required:true,integer:true},
- formoptions:{
- elmsuffix:'*'
- },
- },{
- name:"parentid",
- hidden:true
- },{
- name:"treelevel",
- hidden:true
- } ],
- "treeReader":{
- "level_field":"treelevel",
- "leaf_field":"isleaf",
- "expanded_field":"expanded",
- "loaded":"loaded",
- "parent_id_field":"parentid",
- "icon_field":"icon"
- }
- });
- jQuery('#tree').jqGrid('navGrid','#pager',
- // the buttons to appear on the toolbar of the grid
- {
- edit : true,
- add : true,
- del : true,
- search : false,
- refresh : true,
- view : false,
- position : "left",
- cloneToTop : true
- },
- // options for the Edit Dialog
- {
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- closeAfterEdit : true,
- serializeEditData: function(postdata) {
- //myconsole.log(postdata);
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper" && index!="id"){
- modifyJosnKey(postdata,index,"menu."+index);
- }
- if(index=="id"){
- postdata["menu."+index]=value
- }
- })
- //myconsole.log(postdata);
- return postdata;
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Add Dialog
- {
- closeAfterAdd : true,
- recreateForm : true,
-
- beforeSubmit: function(postdata, formid){
- var selRowId = $("#tree").jqGrid ('getGridParam', 'selrow');
- //myconsole.log(selRowId);
- postdata.parentid=selRowId;
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper"){
- modifyJosnKey(postdata,index,"menu."+index);
- }
- })
- return[true,''];
- },
- afterComplete : function (response, postdata, formid) {
- //取消选择
- $("#tree").jqGrid("resetSelection");
- //关闭对话框
- $(".ui-icon-closethick").trigger('click');
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- });
-
- jQuery('#tree').jqGrid('bindKeys');
- })
- </script>
- <title>我的桌面</title>
- </head>
- <body>
- <div class="page-container">
- <table id="tree"></table>
- <div id="pager"></div>
- </div>
- <footer class="footer mt-20">
- <div class="container">
- <p></p>
- </div>
- </footer>
- </body>
- </html>
|