1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264 |
- <!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 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/ecmascript" src ="${ctx}/assets/lib/jquery.ajaxfileupload.js"></script >
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <style type="text/css">
- ul.ztree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:220px;height:360px;overflow-y:scroll;overflow-x:auto;}
- </style>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
- <script src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js" type="text/javascript" ></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">
- select{width: 163px;}
- </style>
- <script type="text/javascript">
- function refJQ(){
- $("#tree").trigger("reloadGrid");
- }
- function readperm(columnID){
- layer.open({
- type: 2,
- title: '阅读权限',
- shadeClose: true,
- shade: 0.8,
- area: ['570px', '460px'],
- content: '${ctx}/myconsole/readperm?resourceID='+columnID+'&resourceType=column'
- });
- }
- function imageFormat( cellvalue, options, rowObject ){
- if(cellvalue!=null && cellvalue!=""){
- return "<img src='"+cellvalue+"' style='height:50px;'/>";
- }else{
- return "";
- }
- }
- function imageUnFormat( cellvalue, options, cell){
- return $('img', cell).attr('src');
- }
- function initListTemplate(){
- $.ajax({
- type: "get",
- url: "${ctx}/myconsole/column/getTemplate",
- async: false, //设置同步
- dataType: "json",
- data: {"templateGroupID":$("#listtemplategroupid").val()},
- success: function (data) {
- $("#pclisttemplet").empty();
- $("#mobilelisttemplet").empty();
- $("#pclisttemplet").append("<option value=''>请选择</option>");
- $("#mobilelisttemplet").append("<option value=''>请选择</option>");
- $.each(data,function(index,item){
- if(item.templatetype=="列表" || item.templatetype=="首页"){
- $("#pclisttemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
- $("#mobilelisttemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
- }
- })
- }
- })
- }
- function initArticleTemplate(){
- $.ajax({
- type: "get",
- url: "${ctx}/myconsole/column/getTemplate",
- async: false, //设置同步
- dataType: "json",
- data: {"templateGroupID":$("#articletemplategroupid").val()},
- success: function (data) {
- $("#pcarticletemplet").empty();
- $("#mobilearticletemplet").empty();
- $("#pcarticletemplet").append("<option value=''>请选择</option>");
- $("#mobilearticletemplet").append("<option value=''>请选择</option>");
- $.each(data,function(index,item){
- if(item.templatetype=="内容"){
- $("#pcarticletemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
- $("#mobilearticletemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
- }
- })
- }
- })
- }
- $(function() {
- $(window).resize(function(){
- $("#tree").setGridWidth($(window).width()-40);
- });
- $("#tree").jqGrid({
- caption:'栏目管理',
- url : '${ctx}/myconsole/column/getByTree',
- editurl:"${ctx}/myconsole/column/saveOrUpdate", //定义对form编辑时的url
- mtype : "POST", // ajax提交方式。POST或者GET,默认GET
- "hoverrows":false, // 当为false时mouse hovering会被禁用 默认 false
- "viewrecords":false, // 定义是否要显示总记录数
- "gridview":true, // 构造一行数据后添加到grid中,如果设为true则是将整个表格的数据都构造完成后再添加到grid中,但treeGrid, subGrid, or afterInsertRow 不能用 默认为false
- "height":"auto", // 表格高度,可以是数字,像素值或者百分比
- //"loadonce":true,
- "rowNum":100, // 在grid上显示记录条数,这个参数是要被传递到后台
- "scrollrows":true, // 当为true时让所选择的行可见
- "treeGrid":true, // 启用或者禁用treegrid模式 默认false
- "ExpandColumn":"columnname", // 指定那列来展开tree grid,默认为第一列,只有在treeGrid为true时起作用
- "treedatatype":"json", // 数据类型,通常情况下与datatype相同,不会变
- "treeGridModel":"adjacency", // treeGrid所使用的方法
- "sortorder":"asc", // 排序顺序,升序或者降序(asc or desc) 默认asc
- autowidth : true, // 如果为ture时,则当表格在首次被创建时会根据父元素比例重新调整表格宽度。如果父元素宽度改变,为了使表格宽度能够自动调整则需要实现函数:setGridWidth 默认 false
- "datatype":"json",
- "pager":"#pager", // 定义翻页用的导航栏,必须是有效的html元素。翻页工具栏可以放置在html页面任意位置
- //定义表单的主键 Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
- prmNames : {
- id: "columnid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
- },
- colModel : [ {
- label : '栏目名称',
- name : 'columnname',
- editable: true,
- edittype:"text",
- width : 100,
- sortable:false,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 75
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:1,
- colpos:1
- },
- editrules:{
- required: true
- }
- }, {
- label : '栏目编号',
- name : 'columnid',
- key : true,
- editable: true,
- edittype: "text",
- width : 50,
- sortable:false,
- editrules:{
- required: true,
- edithidden:true,
- custom:true,
- custom_func: function(strFieldValue, strFieldName){
- var strEnglishOrNum = /^([0-9a-zA-Z]+)?$/;
- if(!strEnglishOrNum.test(strFieldValue)){
- return [false, strFieldName+"应该为英文字母或者数字"];
- }
- else
- {
- return [true,""];
- }
- }
- },
- editoptions: {
- title:"首次保存后将不允许修改",
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 30
- },
- formoptions:{
- elmsuffix:"<span style='color:red'>*</span>",
- rowpos:1,
- colpos:2
- }
- }, {
- label : '数据编号',
- name : 'keyid',
- hidden:true
- }, {
- label : '显示名称',
- name : 'columndisplayname',
- editable: true,
- edittype:"text",
- width : 100,
- sortable:false,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 75
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:1,
- colpos:3
- },
- editrules:{
- required: true
- },
- editrules:{edithidden:true}
- }, {
- label : '栏目类型',
- name : 'columntype',
- editable: true,
- edittype: "select",
- formatter:"select",
- width : 50,
- sortable:false,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 40,
- value : "${dic_columntype}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:2,
- colpos:1
- },
- editrules:{
- edithidden:true,
- required: true
- }
- },{
- label : '上级栏目',
- name : 'parentid',
- editable: false,
- edittype: "text",
- hidden : true,
- width : 40,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 30
- },
- formoptions:{
- rowpos:2,
- colpos:2
-
- },
- editrules:{edithidden:true}
- }, {
- label : '链接地址',
- name : 'linkurl',
- editable: false,
- edittype: "text",
- width : 100,
- hidden :true,
- editrules:{edithidden:true},
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 100
- },
- formoptions:{
- rowpos:2,
- colpos:3
- }
- },{
- label : '栏目图片',
- name : 'columnpicurl',
- editable: false,
- edittype: "text",
- align:"center",
- formatter:imageFormat,
- unformat:imageUnFormat,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 100
- },
- width : 40,
- formoptions:{
- rowpos:3,
- colpos:1
- }
- },{
- label : '上传栏目图片' ,
- name : 'columnpicurl1',
- editable: false,
- hidden : true,
- editrules:{
- edithidden : true
- },
- edittype: "file",
- editoptions: {
- dataInit: function(elem){
- $(elem).width(98);
- },
- enctype: "multipart/form-data",
- },
- formoptions:{
- rowpos:3,
- colpos:2
- }
- }, {
- label : '排序编号',
- name : 'sortid',
- editable: true,
- edittype: "text",
- width : 50,
- hidden :true,
- editrules:{
- edithidden:true,
- custom:true,
- custom_func: function(strFieldValue, strFieldName){
- var strFloat = /^([-\+]?(((\d+)(\.\d+))|(\.\d+)|(\d*)))?$/;
- if(!strFloat.test(strFieldValue)){
- return [false, strFieldName+"应该为实数"];
- }
- else
- {
- return [true,""];
- }
- }
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 5
- },
- formoptions:{
- /* rowpos:3,
- colpos:3 */
- rowpos:2,
- colpos:2
- }
- },{
- label : '导航显示',
- name : 'isnavigation',
- editable: false,
- edittype: "select",
- hidden : true,
- formoptions:{
- rowpos:4,
- colpos:1
-
- },
- editoptions:{
- dataInit: function(elem){
- $(elem).width(225);
- },
- value : "true:导航显示;false:导航不显示"
- //dataUrl: '${ctx}/myconsole/column/getColumnListBySiteID/'
- },
- editrules:{edithidden:true}
- }, {
- label : '栏目提示',
- name : 'tips',
- editable: false,
- edittype: "text",
- width : 100,
- hidden :true,
- editrules:{edithidden:true},
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 30
- },
- formoptions:{
- rowpos:4,
- colpos:2
- }
- },{
- label : '支持评论',
- name : 'iscritic',
- editable: false,
- edittype: "select",
- hidden : true,
- formoptions:{
- rowpos:4,
- colpos:3
-
- },
- editoptions:{
- dataInit: function(elem){
- $(elem).width(225);
- },
- value : "true:支持评论;false:不支持评论"
- //dataUrl: '${ctx}/myconsole/column/getColumnListBySiteID/'
- },
- editrules:{edithidden:true}
- },{
- label : '评论审批',
- name : 'iscriticcheck',
- editable: false,
- edittype: "select",
- hidden : true,
- formoptions:{
- rowpos:5,
- colpos:1
-
- },
- editoptions:{
- dataInit: function(elem){
- $(elem).width(225);
- },
- value : "true:不用审批;false:需要审批"
- //dataUrl: '${ctx}/myconsole/column/getColumnListBySiteID/'
- },
- editrules:{edithidden:true}
- },{
- label : '审核类型',
- name : 'checklevel',
- editable: false,
- edittype: "select",
- hidden : true,
- formoptions:{
- rowpos:5,
- colpos:2
-
- },
- editoptions:{
- dataInit: function(elem){
- $(elem).width(225);
- },
- value : "0:不需审核;1:流程审批"
- },
- editrules:{edithidden:true}
- },{
- label : '审核流程',
- name : 'flowid',
- editable: false,
- edittype: "select",
- hidden : true,
- formoptions:{
- rowpos:5,
- colpos:3
-
- },
- editoptions:{
- dataInit: function(elem){
- $(elem).width(225);
- },
- value : "${flows}"
- },
- editrules:{edithidden:true}
- },{
- label : '列表页模板组',
- name : 'listtemplategroupid',
- editable: true,
- hidden : true,
- edittype: "select",
- formatter:"select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${templateGroupIDOption}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:6,
- colpos:1
- },
- editrules:{ required: true,edithidden:true}
- },{
- label : 'PC端列表模板',
- name : 'pclisttemplet',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${dic_listtemplet}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:6,
- colpos:2
- },
- editrules:{required: true,edithidden:true}
- },{
- label : '移动端列表模板',
- name : 'mobilelisttemplet',
- editable: false,
- hidden : true,
- edittype: "select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${dic_listtemplet}"
- },
- formoptions:{
- rowpos:6,
- colpos:3
- },
- editrules:{edithidden:true}
- },{
- label : '内容页模板组',
- name : 'articletemplategroupid',
- editable: true,
- hidden : true,
- edittype: "select",
- formatter:"select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${templateGroupIDOption}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:7,
- colpos:1
- },
- editrules:{required: true,edithidden:true}
- }, {
- label : 'PC端文章模板',
- name : 'pcarticletemplet',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${dic_articletemplet}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:7,
- colpos:2
- },
- editrules:{required: true,edithidden:true}
- }, {
- label : '移动端文章模板',
- name : 'mobilearticletemplet',
- editable: false,
- hidden : true,
- edittype: "select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${dic_articletemplet}"
- },
- formoptions:{
- rowpos:7,
- colpos:3
- },
- editrules:{edithidden:true}
- },{
- label : '新文章天数',
- name : 'newinfoday',
- editable: false,
- edittype: "text",
- width : 50,
- hidden :true,
- editrules:{
- edithidden:true,
- number:true,
- minValue:1,
- maxValue:30
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 3,
- value : 1
- },
- formoptions:{
- rowpos:8,
- colpos:1
- }
- }, {
- label : '新文章条数',
- name : 'newinfonum',
- editable: false,
- edittype: "text",
- width : 50,
- hidden :true,
- editrules:{
- edithidden:true,
- number:true,
- minValue:1,
- maxValue:100
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 3,
- value : 2
- },
- formoptions:{
- rowpos:8,
- colpos:2
- }
- },{
- label : '列表数字图片',
- name : 'infonumpictype',
- editable: false,
- edittype: "select",
- width : 100,
- hidden :true,
- editrules:{edithidden:true},
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "${dic_infonumpictype}"
- },
- formoptions:{
- rowpos:8,
- colpos:3
- }
- }, {
- label : '数字图片个数',
- name : 'infonumpicnum',
- editable: false,
- edittype: "text",
- width : 50,
- hidden :true,
- editrules:{
- edithidden:true,
- number:true,
- minValue:1,
- maxValue:100
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 3,
- value : 2
- },
- formoptions:{
- rowpos:9,
- colpos:1
- }
- },{
- label : '列表固定图片',
- name : 'infopicurl',
- editable: false,
- hidden : true,
- edittype: "file",
- width : 100,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- enctype: "multipart/form-data",
- },
- formoptions:{
- rowpos:9,
- colpos:2
- }
- }, {
- label : '轮显图片个数',
- name : 'turnpicnum',
- editable: false,
- edittype: "text",
- width : 50,
- hidden :true,
- editrules:{
- edithidden:true,
- number:true,
- minValue:1,
- maxValue:100
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 3,
- value : 2
- },
- formoptions:{
- rowpos:9,
- colpos:3
- }
- }, {
- label : '查看类型',
- name : 'showtype',
- editable: false,
- hidden :true,
- edittype: "select",
- formatter:"select",
- width : 50,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "public:公共信息;private:私有信息"
- },
- formoptions:{
- rowpos:10,
- colpos:1
- },
- editrules:{edithidden:true}
- }, {
- label : '栏目状态',
- name : 'tstate',
- editable: true,
- sortable:false,
- edittype: "select",
- formatter:"select",
- width : 50,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 10,
- value : "启用:启用;停用:停用"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:10,
- colpos:1
- },
- editrules:{required: true,edithidden:true}
- },{
- label : 'SEO标题',
- name : 'seotitle',
- editable: false,
- hidden : true,
- edittype: "text",
- width : 100,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 50
- },
- formoptions:{
- rowpos:10,
- colpos:3
- }
- },{
- label : 'SEO关键字',
- name : 'seokeyword',
- editable: false,
- hidden : true,
- edittype: "text",
- width : 100,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 50
- },
- formoptions:{
- rowpos:11,
- colpos:1
- }
- }, {
- label : 'SEO描述',
- name : 'seodesc',
- editable: false,
- width : 100,
- edittype : "text",
- hidden : true,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(218);
- },
- maxlength: 50
- },
- formoptions:{
- rowpos:11,
- colpos:2
- }
- }, {
- label : '扩展字段',
- name : 'extendmodelid',
- editable: false,
- width : 100,
- edittype: "select",
- formatter:"select",
- hidden : true,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 10,
- value : "${dic_listextendmodel}"
- },
- formoptions:{
- rowpos:11,
- colpos:3
- }
- },{
- label : '前台每页信息数量',
- name : 'pagesize',
- editable: false,
- hidden : true,
- edittype: "select",
- formatter:"select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "10:10;15:15;20:20;25:25;30:30"
- },
- formoptions:{
- rowpos:12,
- colpos:1
- },
- editrules:{edithidden:true}
- },{
- label : '静态化页面数量',
- name : 'staticsize',
- editable: false,
- hidden : true,
- edittype: "select",
- formatter:"select",
- width : 100,
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 50,
- value : "-1:全部;10:10;15:15;20:20;25:25;30:30"
- },
- formoptions:{
- rowpos:12,
- colpos:2
- },
- editrules:{edithidden:true}
- }, {
- label : '发布规则',
- name : 'urlrulegroupkeyid',
- editable: true,
- width : 100,
- edittype: "select",
- formatter:"select",
- hidden : true,
- editrules:{
- required: true,
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 10,
- value : "${urlRuleGroupKeyIDs}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- /* rowpos:12,
- colpos:3 */
- rowpos:2,
- colpos:3
- }
- },{
- label : '创建人',
- name : 'username',
- width : 50,
- editable: false,
- sortable:false,
- edittype:"text"
- },{
- label : '创建时间',
- name : 'recordtime',
- width : 80,
- editable: false,
- sortable:false,
- edittype:"text"
- },/* {
- label : '操作',
- name : 'operMod',
- editable: false,
- align:"center",
- width:80,
- formatter: function (cellvalue, options, rowdata) {
- var html ="";
- <#if readPerm>
- html=html+"<button class='btn btn-success radius size-S' onclick=readperm('"+rowdata.keyid+"')>阅读权限</button>";
- </#if>
- html = html+" <a href='"+rowdata.columnurl+"' target='_blank'><button class='btn btn-success radius size-S'>预览内网</button></a>";
- html = html+" <a href='"+rowdata.columnstaticurl+"' target='_blank'><button class='btn btn-success radius size-S'>预览外网</button></a>";
- return html;
- }
- }, */{
- "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',
- {
- ${buttonflag}
- search : false,
- refresh : true,
- view : false,
- position : "left",
- cloneToTop : true
- },
- //编辑按钮事件处理
- {
- closeAfterEdit : true,
- recreateForm : true,
- width:1200,
- onInitializeForm: function(formid) {
- var config;
- $.ajax({
- type:"get",
- dataType:"json",
- url:"${ctx}/myconsole/ueditor/getConfig",
- async:false,
- success:function(data){
- config=eval(data);
- //console.log(config);
- }
- });
- $( '#columnpicurl1').ajaxfileupload({
- action: '${ctx}/myconsole/ueditor/?action=uploadimage',
- validate_extensions: false,
- onComplete: function(response) {
- if(response.state == "SUCCESS"){
- $( '#columnpicurl').val(config.imageUrlPrefix+response.url);
- } else{
- alert(response.state);
- }
- }
- });
- },
- beforeShowForm: function(formid) {
- initListTemplate();
- initArticleTemplate();
- var gr = jQuery("#tree").jqGrid('getGridParam', 'selrow');//得到最后一次选择的行
- var dr= jQuery("#tree").jqGrid('getRowData',gr);//得到该行的数据
- $("#pclisttemplet").val(dr.pclisttemplet);
- $("#pcarticletemplet").val(dr.pcarticletemplet);
- $("#mobilelisttemplet").val(dr.mobilelisttemplet);
- $("#mobilearticletemplet").val(dr.mobilearticletemplet);
- $("#listtemplategroupid").change(function(){
- initListTemplate();
- })
- $("#articletemplategroupid").change(function(){
- initArticleTemplate();
- })
- },
- afterShowForm : function(formid) {
- var columnidObj = formid.find('#columnid');
- columnidObj.attr('readOnly',true);
- columnidObj.css({'background':'#cccccc'});
-
- $('#columndisplayname').focus();
-
- makeTree("parentid","/myconsole/column/getColumnTree","radio");
- $("#_parentid").width(220);
- var parentidObj = formid.find('#_parentid');
- parentidObj.attr('readOnly',true);
- parentidObj.css({'background':'#cccccc'});
- $("#columnname").blur(function(){
- $("#columndisplayname").val($("#columnname").val());
- });
-
-
- },
- beforeSubmit: function(postdata, formid){
- // 编辑时jqgrid 将主键变成 tree_id 手动添加 keyid
- //postdata["keyid"] = postdata.tree_id;
-
- $.each(postdata,function (index, value) {
- if(index!="oper"){
- modifyJosnKey(postdata,index,"column."+index);
- }
- })
-
- return [true,'']; //返回值必须这么写 目前没找到原因,用true 和 返回对象都不好使。待查
- },
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
-
- }
- else
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
-
- }
-
- },
- afterComplete : function (response, postdata, formid) {
- //取消选择
- $("#tree").jqGrid("resetSelection");
- //关闭对话框
- $(".ui-icon-closethick").trigger('click');
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- //添加按钮处理事件
- {
- closeAfterAdd : true,
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- width:1200,
- onInitializeForm: function(formid) {
- var config;
- $.ajax({
- type:"get",
- dataType:"json",
- url:"${ctx}/myconsole/ueditor/getConfig",
- async:false,
- success:function(data){
- config=eval(data);
- //console.log(config);
- }
- });
- $( '#columnpicurl1').ajaxfileupload({
- action: '${ctx}/myconsole/ueditor/?action=uploadimage',
- validate_extensions: false,
- onComplete: function(response) {
- if(response.state == "SUCCESS"){
- $( '#columnpicurl').val(config.imageUrlPrefix+response.url);
- } else{
- alert(response.state);
- }
- }
- });
- },
- beforeShowForm: function(formid) {
- initListTemplate();
- $("#listtemplategroupid").change(function(){
- initListTemplate();
- });
- initArticleTemplate();
- $("#articletemplategroupid").change(function(){
- initArticleTemplate();
- })
- $.post("${ctx}/myconsole/column/generateColumnID",function(data){
- $("#columnid").val(data);
- })
- },
- afterShowForm : function(formid) {
- //$("#listtemplategroupid").val("${site.templategroupkeyid}");
- $('#tree').setColProp('parentid',{editoptions:{readonly:true}});
- $("#columnname").blur(function(){
- $("#columndisplayname").val($("#columnname").val());
- });
- },
- serializeEditData: function(postdata) {
- var selRowId = $("#tree").jqGrid ('getGridParam', 'selrow');
- if(selRowId == null) selRowId = "";
- //获取选中的父节点主键值,添加下级站点
- postdata.parentid=selRowId;
-
- $.each(postdata,function(index,value){
- if(index!="oper"){
- modifyJosnKey(postdata,index,"column."+index);
- }
- })
- //jqgrid 做添加操作会把主键id的值设置成“_empty”;这里修改成空;
- postdata["column.keyid"]="";
- return postdata;
- },
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
-
- }
- else
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
-
- }
-
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- //删除按钮处理事件
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- },
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
-
- }
- else
- {
- parent.layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
-
- }
-
- },
- }).navButtonAdd('#pager',{
- title:"合并",
- caption:"栏目合并",
- buttonicon:"ui-icon-del",
- onClickButton: function(){
- var sel=$('#tree').jqGrid('getGridParam','selrow');
- if(sel==null){
- //alert('请先选择数据');
- layer.alert("请先选择需要合并的栏目!", {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- }else{
-
-
- layer.open({
- type: 2,
- title: '栏目合并',
- shadeClose: true,
- shade: 0.8,
- area: ['570px', '460px'],
- content: '${ctx}/myconsole/column/merge?fromcolumnid='+sel
- });
- }
- },
- position : "last"
- }
- )
- ;
-
-
-
- jQuery('#tree').jqGrid('bindKeys');
- })
-
-
- function getSelectOptions(options,data){
- var urls = "";
- if('upperColumn' == options){
- urls = "${ctx}/myconsole/column/getColumnListBySiteID/";
- }else{
- urls = "${ctx}/myconsole/template/getTemplateListBySiteID?type="+options;
- }
- $.ajax({url:urls,async:false, success:function(e){
- if (e != null && e.length>0) {
- data += ";" + e;
- }
- }
- });
- return data;
- }
-
-
-
- </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>
|