123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915 |
- <!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>
- <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
- <link type="text/css" href="${ctx}/assets/lib/codemirror/lib/codemirror.css" rel="stylesheet" />
- <script type="text/javascript" src="${ctx}/assets/lib/codemirror/lib/codemirror.js"></script>
- <script src="${ctx}/assets/lib/codemirror/mode/xml/xml.js"></script>
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/webuploader/0.1.5/webuploader.css">
- <script type="text/javascript" src="${ctx}/assets/lib/webuploader/0.1.5/webuploader.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]-->
- <style type="text/css">
- .CodeMirror {
- border: 1px solid #eee;
- height: auto;
- }
- </style>
- <script type="text/javascript">
- $(function() {
- $(window).resize(function(){
- $("#jqGridGroup").setGridWidth($(window).width()-40);
- $("#jqGrid").setGridWidth($(window).width()-40);
- $("#jqGridSkin").setGridWidth($(window).width()-40);
- $("#jqGridCss").setGridWidth($(window).width()-40);
- });
- $("#jqGridGroup").jqGrid({
- url : '${ctx}/myconsole/templategroup/getByPage',
- editurl:"${ctx}/myconsole/templategroup/saveOrUpdate2",
- mtype : "POST",
- datatype : "json",
- caption:'模板组管理',
- prmNames : {
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [ {
- label : '模板组编号',
- name : 'keyid',
- hidden : true,
- editable: false,
- key : true,
- width : 80
- },{
- label : '模板组编号',
- name : 'templategroupid',
- editable: false,
- width : 80
- }, {
- label : '模板组名称',
- name : 'templategroupname',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'*'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{required:true}
- }, {
- label : '模板组描述',
- name : 'templategroupdesc',
- editable: true,
- width : 80,
- edittype : "textarea",
- editoptions: {
- size:50,
- maxlength: 500,
- rows:"5",
- cols:"40"
- }
- }, {
- label : '更新时间',
- name : 'updatetime',
- editable: false,
- width : 80
- },{
- label : '操作',
- name:'operMod',
- index:'operMod',
- align:"center",
- width:"40",
- formatter: function (cellvalue, options, rowdata) {
- var html = '<div><div class="filePicker">上传</div></div>';
- return html;
- }
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- height : 'auto',
- onSelectRow : function( rowid ) {
- if(rowid.length>10){
- var row = $(this).getRowData(rowid);
- $("#jqGrid").setColProp('templategroupkeyid',{editoptions:{value:row.templategroupid+":a"}});
- $("#jqGridSkin").setColProp('templategroupkeyid',{editoptions:{value:row.templategroupid+":a"}});
- $("#jqGridCss").setColProp('templategroupkeyid',{editoptions:{value:row.templategroupid+":a"}});
- $("#jqGrid").setCaption("模板管理--"+row.templategroupname);
- $("#jqGrid").jqGrid('setGridParam',{url: "${ctx}/myconsole/template/getByPage?templateGroupKeyID="+row.templategroupid});
- $("#jqGrid").trigger("reloadGrid");
- $("#jqGridSkin").jqGrid('setGridParam',{url: "${ctx}/myconsole/skin/getByPage?templateGroupKeyID="+row.templategroupid});
- $("#jqGridSkin").trigger("reloadGrid");
- $("#jqGridCss").jqGrid('setGridParam',{url: "${ctx}/myconsole/skin/getByPageCss?templateGroupKeyID="+row.templategroupid});
- $("#jqGridCss").trigger("reloadGrid");
- uploader.options.formData.templateGroupKeyID= row.templategroupid;
- }
- },
- loadComplete: function(){
- uploader = WebUploader.create({
- // 选完文件后,是否自动上传。
- auto: true,
- // swf文件路径
- swf: '${ctx}/assets/lib/webuploader/0.1.5/Uploader.swf',
- // 文件接收服务端。
- server: '${ctx}/myconsole/template/upload',
- // 选择文件的按钮。可选。
- // 内部根据当前运行是创建,可能是input元素,也可能是flash.
- pick: '.filePicker',
- duplicate: true,//可重复上传
- // 只允许选择图片文件。
- accept: {
- title: 'zips',
- extensions: 'zip',
- mimeTypes: '.zip'
- }
- });
- uploader.on('uploadSuccess', function( file ) {
- alert("上传成功");
- $("#jqGrid").trigger('reloadGrid');
- $("#jqGridSkin").trigger('reloadGrid');
- $("#jqGridCss").trigger('reloadGrid');
- });
- uploader.on('uploadError', function( file ) {
- alert("上传失败");
- });
- },
- pager : "#jqGridPagerGroup"
- });
- $('#jqGridGroup').navGrid('#jqGridPagerGroup',
- // the buttons to appear on the toolbar of the grid
- {
- edit : true,
- add : true,
- del : true,
- search : true,
- refresh : true,
- view : false,
- position : "left",
- cloneToTop : true
- },
- // options for the Edit Dialog
- {
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- closeAfterEdit : true,
- onInitializeForm:function(formid) {
- },
- serializeEditData: function(postdata) {
- //myconsole.log(postdata);
- $.each(postdata,function (index, value) {
- //myconsole.log(index);
- if(index!="jqGrid_id" && index!="oper" && index!="id"){
- modifyJosnKey(postdata,index,"templateGroup."+index);
- }
- if(index=="id"){
- postdata["templateGroup."+index]=value;
- }
- })
- //myconsole.log(postdata);
- return postdata;
- },
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.msg];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText;
- }
- },
- // options for the Add Dialog
- {
- closeAfterAdd : true,
- recreateForm : true,
- beforeSubmit: function(postdata, formid){
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper"){
- modifyJosnKey(postdata,index,"templateGroup."+index);
- }
- })
- return[true,''];
- },
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.msg];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText;
- }
- },
- // options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText;
- }
- },{
- // search options 这里支持多条件查询
- multipleSearch: true,
- sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.message];
- }
- }
- );
- ///////////////////////////////////////////
- $("#jqGrid").jqGrid({
- url : '${ctx}/myconsole/template/getByPage',
- editurl:"${ctx}/myconsole/template/saveOrUpdate",
- mtype : "POST",
- datatype : "json",
- caption:'模板管理',
- prmNames : {
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [ {
- label : '模板编号',
- name : 'keyid',
- hidden : true,
- key : true,
- width : 50
- }, {
- label : '模板组编号',
- name : 'templategroupkeyid',
- hidden : true,
- editable : true,
- edittype :"select",
- editoptions:{value:"a:a"}
- }, {
- label : '文件名称',
- name : 'filename',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'* 必须以.html结尾'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{
- custom:true,
- custom_func:function (value, colname) {
- var strEnglishOrNum = /^([0-9a-zA-Z.-_]+)?$/;
- if(!strEnglishOrNum.test(value))
- return [false, colname+"应该为英文字母或者数字"];
- else if (value=='')
- return [false,colname+" 不允许为空"];
- else if(!value.endsWith(".html"))
- return [false,colname+" 必须以.html结尾"];
- else
- return [true,""];
- }
- }
- }, {
- label : '模板名称',
- name : 'templatename',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'*'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{required:true}
- }, {
- label : '模板类型',
- name : 'templatetype',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "首页:首页;列表:列表;内容:内容"
- },
- stype:"select",
- searchoptions:{
- value: "首页:首页;列表:列表;内容:内容"
- },
- width : 80,
- }, {
- label : '内容区域宽度',
- name : 'contentwidth',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'像素整数'
- },
- editrules:{
- integer:true
- }
- }, {
- label : '更新时间',
- name : 'updatetime',
- editable: false,
- width : 80
- },{
- label : '操作',
- name:'operMod',
- index:'operMod',
- align:"center",
- width:"80",
- formatter: function (cellvalue, options, rowdata) {
- var html = "<button class='btn btn-success radius size-S' onclick=edit('"+rowdata.keyid+"')>编辑</button>";
- html += " <button class='btn btn-success radius size-S' onclick=dynamic('"+rowdata.keyid+"')>动态化</button>";
- //html += " <button class='btn btn-success radius size-S' onclick=design('"+rowdata.filename+"')>设计</button>";
- return html;
- }
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- height : 'auto',
- pager : "#jqGridPager"
- });
- $('#jqGrid').navGrid('#jqGridPager',
- //the buttons to appear on the toolbar of the grid
- {
- edit : true,
- add : true,
- del : true,
- search : true,
- refresh : true,
- view : false,
- position : "left",
- cloneToTop : true
- },
- //options for the Edit Dialog
- {
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- closeAfterEdit : true,
- onInitializeForm:function(formid) {
- },
- serializeEditData: function(postdata) {
- //myconsole.log(postdata);
- $.each(postdata,function (index, value) {
- //myconsole.log(index);
- if(index!="jqGrid_id" && index!="oper" && index!="id"){
- modifyJosnKey(postdata,index,"template."+index);
- }
- if(index=="id"){
- postdata["template."+index]=value;
- }
- })
- //myconsole.log(postdata);
- return postdata;
- },
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.msg];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText;
- }
- },
- //options for the Add Dialog
- {
- closeAfterAdd : true,
- recreateForm : true,
- beforeSubmit: function(postdata, formid){
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper"){
- modifyJosnKey(postdata,index,"template."+index);
- }
- })
- return[true,''];
- },
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.msg];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText;
- }
- },
- //options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText;
- }
- },{
- // search options 这里支持多条件查询
- multipleSearch: true,
- sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.message];
- }
- }
- );
- ///////////////////////////////////////////
- $("#jqGridCss").jqGrid({
- url : '${ctx}/myconsole/skin/getByPageCss',
- editurl:"${ctx}/myconsole/skin/saveOrUpdate",
- mtype : "POST",
- datatype : "json",
- caption:'样式管理',
- prmNames : {
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [ {
- label : '模板编号',
- name : 'keyid',
- hidden : true,
- key : true,
- width : 50
- }, {
- label : '模板组编号',
- name : 'templategroupkeyid',
- hidden : true,
- editable : true,
- edittype :"select" ,
- editoptions:{value:"a:a"}
-
- }, {
- label : '文件名称',
- name : 'filename',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'* 必须以.css结尾'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{
- custom:true,
- custom_func:function (value, colname) {
- var strEnglishOrNum = /^([0-9a-zA-Z.]+)?$/;
- if(!strEnglishOrNum.test(value))
- return [false, colname+"应该为英文字母或者数字"];
- else if (value=='')
- return [false,colname+" 不允许为空"];
- else if(!value.endsWith(".css"))
- return [false,colname+" 必须以.css结尾"];
- else
- return [true,""];
- }
- }
- }, {
- label : '样式名称',
- name : 'templatename',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'*'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{required:true}
- }, {
- label : '说明 ',
- name : 'readme',
- editable: true,
- width : 180,
- edittype : "textarea",
- editoptions: {
- maxlength: 1000
- }
- } , {
- label : '更新时间',
- name : 'updatetime',
- editable: false,
- width : 80
- } ,{
- label : '操作',
- name:'operMod',
- index:'operMod',
- align:"center",
- width:"80",
- formatter: function (cellvalue, options, rowdata) {
- var html = "<button class='btn btn-success radius size-S' onclick=editCss('"+rowdata.keyid+"','css')>编辑</button>";
- return html;
- }
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- height : 'auto',
- pager : "#jqGridPagerCss"
- });
- $('#jqGridCss').navGrid('#jqGridPagerCss',
- // the buttons to appear on the toolbar of the grid
- {
- edit : true,
- add : true,
- del : true,
- search : true,
- refresh : true,
- view : true,
- position : "left",
- cloneToTop : true
- },
- // options for the Edit Dialog
- {
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- closeAfterEdit : true,
- onInitializeForm:function(formid) {
- },
- serializeEditData: function(postdata) {
- //myconsole.log(postdata);
- $.each(postdata,function (index, value) {
- //myconsole.log(index);
- if(index!="jqGrid_id" && index!="oper" && index!="keyid"){
- modifyJosnKey(postdata,index,"skin."+index);
- }
- if(index=="keyid"){
- postdata["skin."+index]=value
- }
- })
- //myconsole.log(postdata);
- return postdata;
- },
- afterSubmit: function (response, postdata) {
- // console.log(response);
- var res=eval('(' + response.responseText + ')');
- //layer.msg(res.msg);
- return [res.state,res.msg,''];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Add Dialog
- {
- closeAfterAdd : true,
- recreateForm : true,
- beforeSubmit: function(postdata, formid){
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper"){
- modifyJosnKey(postdata,index,"skin."+index);
- }
- })
- return[true,''];
- },
- afterSubmit: function (response, postdata) {
- // console.log(response);
- var res=eval('(' + response.responseText + ')');
-
- return [res.state,res.msg,''];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },{
- // search options 这里支持多条件查询
- multipleSearch: true,
- sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.message];
- }
- }
- );
-
-
- ///////////////////////////////////////////
- $("#jqGridSkin").jqGrid({
- url : '${ctx}/myconsole/skin/getByPage',
- editurl:"${ctx}/myconsole/skin/saveOrUpdate",
- mtype : "POST",
- datatype : "json",
- caption:'换肤样式管理',
- prmNames : {
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [ {
- label : '模板编号',
- name : 'keyid',
- hidden : true,
- key : true,
- width : 50
- }, {
- label : '模板组编号',
- name : 'templategroupkeyid',
- hidden : true,
- editable : true,
- edittype :"select" ,
- editoptions:{value:"a:a"}
-
- }, {
- label : '文件名称',
- name : 'filename',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'* 必须以.css结尾'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{
- custom:true,
- custom_func:function (value, colname) {
- var strEnglishOrNum = /^([0-9a-zA-Z.]+)?$/;
- if(!strEnglishOrNum.test(value))
- return [false, colname+"应该为英文字母或者数字"];
- else if (value=='')
- return [false,colname+" 不允许为空"];
- else if(!value.endsWith(".css"))
- return [false,colname+" 必须以.css结尾"];
- else
- return [true,""];
- }
- }
- }, {
- label : '样式名称',
- name : 'templatename',
- editable: true,
- width : 80,
- formoptions:{
- elmsuffix:'*'
- },
- editoptions: {
- maxlength: 15
- },
- editrules:{required:true}
- }, {
- label : '说明 ',
- name : 'readme',
- editable: true,
- width : 180,
- edittype : "textarea",
- editoptions: {
- maxlength: 1000
- }
- } , {
- label : '更新时间',
- name : 'updatetime',
- editable: false,
- width : 80
- } ,{
- label : '操作',
- name:'operMod',
- index:'operMod',
- align:"center",
- width:"80",
- formatter: function (cellvalue, options, rowdata) {
- var html = "<button class='btn btn-success radius size-S' onclick=editCss('"+rowdata.keyid+"','skin')>编辑</button>";
- return html;
- }
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- height : 'auto',
- pager : "#jqGridPagerSkin"
- });
- $('#jqGridSkin').navGrid('#jqGridPagerSkin',
- // the buttons to appear on the toolbar of the grid
- {
- edit : true,
- add : true,
- del : true,
- search : true,
- refresh : true,
- view : true,
- position : "left",
- cloneToTop : true
- },
- // options for the Edit Dialog
- {
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- closeAfterEdit : true,
- onInitializeForm:function(formid) {
- },
- serializeEditData: function(postdata) {
- //myconsole.log(postdata);
- $.each(postdata,function (index, value) {
- //myconsole.log(index);
- if(index!="jqGrid_id" && index!="oper" && index!="keyid"){
- modifyJosnKey(postdata,index,"skin."+index);
- }
- if(index=="keyid"){
- postdata["skin."+index]=value
- }
- })
- //myconsole.log(postdata);
- return postdata;
- },
- afterSubmit: function (response, postdata) {
- // console.log(response);
- var res=eval('(' + response.responseText + ')');
- //layer.msg(res.msg);
- return [res.state,res.msg,''];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Add Dialog
- {
- closeAfterAdd : true,
- recreateForm : true,
- beforeSubmit: function(postdata, formid){
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper"){
- modifyJosnKey(postdata,index,"skin."+index);
- }
- })
- return[true,''];
- },
- afterSubmit: function (response, postdata) {
- // console.log(response);
- var res=eval('(' + response.responseText + ')');
-
- return [res.state,res.msg,''];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },{
- // search options 这里支持多条件查询
- multipleSearch: true,
- sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.message];
- }
- }
- );
- })
- function edit(tempID){
- $.post("${ctx}/myconsole/template/edit",{"tempID":tempID},function(data){
- var index=layer.open({
- type: 1,
- title: '编辑模板',
- btn: ['保存','取消'],
- yes:function(index, layero){
- $.post("${ctx}/myconsole/template/save",{"tempID":tempID,"tempContent":editor.getValue()},function(data){
- layer.close(index);
- layer.msg(data);
- })
- },
- // skin: 'layui-layer-rim', //加上边框
- area: ['90%', '90%'], //宽高
- content: '<textarea id="code">'+data+'</textarea>',
- success:function(layero, index){
- window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
- mode: "text/html",
- styleActiveLine: true, //line选择是是否加亮
- lineNumbers: true, //是否显示行数
- lineWrapping: true //是否自动换行
- });
- $(".CodeMirror-gutter-wrapper").css("left","-35px");
- }
- });
- })
- }
- function editCss(skinID,type){
- $.post("${ctx}/myconsole/skin/edit",{"skinID":skinID,"type":type},function(data){
- var index=layer.open({
- type: 1,
- title: '编辑模板',
- btn: ['保存','取消'],
- yes:function(index, layero){
- $.post("${ctx}/myconsole/skin/save",{"skinID":skinID,"type":type,"tempContent":editor.getValue()},function(data){
- layer.close(index);
- layer.msg(data);
- })
- },
- // skin: 'layui-layer-rim', //加上边框
- area: ['90%', '90%'], //宽高
- content: '<textarea id="code">'+data+'</textarea>',
- success:function(layero, index){
- window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
- mode: "text/html",
- styleActiveLine: true, //line选择是是否加亮
- lineNumbers: true, //是否显示行数
- lineWrapping: true //是否自动换行
- });
- $(".CodeMirror-gutter-wrapper").css("left","-35px");
- }
- });
- })
- }
- function dynamic(tempID){
-
- $.post("${ctx}/myconsole/template/query",{"tempID":tempID},function(data){
- if(data=="NO"){
- alert("请设置模板类型");
- }else{
- window.open("${ctx}/myconsole/dynamic?tempID="+tempID);
- }
-
- })
-
- }
- function design(tmpFile){
- window.open("${ctx}/myconsole/design?tmpFile="+tmpFile);
- }
- </script>
- <title>我的桌面</title>
- </head>
- <body>
- <div class="page-container">
- <table id="jqGridGroup"></table>
- <div id="jqGridPagerGroup"></div>
- <div> </div>
- <table id="jqGrid"></table>
- <div id="jqGridPager"></div>
- <div> </div>
- <table id="jqGridCss"></table>
- <div id="jqGridPagerCss"></div>
- <div> </div>
- <table id="jqGridSkin"></table>
- <div id="jqGridPagerSkin"></div>
- </div>
- <footer class="footer mt-20">
- <div class="container">
- <p></p>
- </div>
- </footer>
- </body>
- </html>
|