column.html 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <!--[if lt IE 9]>
  10. <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
  11. <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
  12. <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
  13. <![endif]-->
  14. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
  15. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
  16. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
  17. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
  18. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
  19. <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
  20. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  21. <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
  22. <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
  23. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  24. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  25. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  26. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  27. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  28. <script type ="text/ecmascript" src ="${ctx}/assets/lib/jquery.ajaxfileupload.js"></script >
  29. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  30. <style type="text/css">
  31. ul.ztree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:220px;height:360px;overflow-y:scroll;overflow-x:auto;}
  32. </style>
  33. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
  34. <script src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js" type="text/javascript" ></script>
  35. <!--[if IE 6]>
  36. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  37. <script>DD_belatedPNG.fix('*');</script>
  38. <![endif]-->
  39. <style type="text/css">
  40. select{width: 163px;}
  41. </style>
  42. <script type="text/javascript">
  43. function refJQ(){
  44. $("#tree").trigger("reloadGrid");
  45. }
  46. function readperm(columnID){
  47. layer.open({
  48. type: 2,
  49. title: '阅读权限',
  50. shadeClose: true,
  51. shade: 0.8,
  52. area: ['570px', '460px'],
  53. content: '${ctx}/myconsole/readperm?resourceID='+columnID+'&resourceType=column'
  54. });
  55. }
  56. function imageFormat( cellvalue, options, rowObject ){
  57. if(cellvalue!=null && cellvalue!=""){
  58. return "<img src='"+cellvalue+"' style='height:50px;'/>";
  59. }else{
  60. return "";
  61. }
  62. }
  63. function imageUnFormat( cellvalue, options, cell){
  64. return $('img', cell).attr('src');
  65. }
  66. function initListTemplate(){
  67. $.ajax({
  68. type: "get",
  69. url: "${ctx}/myconsole/column/getTemplate",
  70. async: false, //设置同步
  71. dataType: "json",
  72. data: {"templateGroupID":$("#listtemplategroupid").val()},
  73. success: function (data) {
  74. $("#pclisttemplet").empty();
  75. $("#mobilelisttemplet").empty();
  76. $("#pclisttemplet").append("<option value=''>请选择</option>");
  77. $("#mobilelisttemplet").append("<option value=''>请选择</option>");
  78. $.each(data,function(index,item){
  79. if(item.templatetype=="列表" || item.templatetype=="首页"){
  80. $("#pclisttemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
  81. $("#mobilelisttemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
  82. }
  83. })
  84. }
  85. })
  86. }
  87. function initArticleTemplate(){
  88. $.ajax({
  89. type: "get",
  90. url: "${ctx}/myconsole/column/getTemplate",
  91. async: false, //设置同步
  92. dataType: "json",
  93. data: {"templateGroupID":$("#articletemplategroupid").val()},
  94. success: function (data) {
  95. $("#pcarticletemplet").empty();
  96. $("#mobilearticletemplet").empty();
  97. $("#pcarticletemplet").append("<option value=''>请选择</option>");
  98. $("#mobilearticletemplet").append("<option value=''>请选择</option>");
  99. $.each(data,function(index,item){
  100. if(item.templatetype=="内容"){
  101. $("#pcarticletemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
  102. $("#mobilearticletemplet").append("<option value='"+item.filename+"'>"+item.templatename+"</option>");
  103. }
  104. })
  105. }
  106. })
  107. }
  108. $(function() {
  109. $(window).resize(function(){
  110. $("#tree").setGridWidth($(window).width()-40); 
  111. });
  112. $("#tree").jqGrid({
  113. caption:'栏目管理',
  114. url : '${ctx}/myconsole/column/getByTree',
  115. editurl:"${ctx}/myconsole/column/saveOrUpdate", //定义对form编辑时的url
  116. mtype : "POST", // ajax提交方式。POST或者GET,默认GET
  117. "hoverrows":false, // 当为false时mouse hovering会被禁用 默认 false
  118. "viewrecords":false, // 定义是否要显示总记录数
  119. "gridview":true, // 构造一行数据后添加到grid中,如果设为true则是将整个表格的数据都构造完成后再添加到grid中,但treeGrid, subGrid, or afterInsertRow 不能用 默认为false
  120. "height":"auto", // 表格高度,可以是数字,像素值或者百分比
  121. //"loadonce":true,
  122. "rowNum":100, // 在grid上显示记录条数,这个参数是要被传递到后台
  123. "scrollrows":true, // 当为true时让所选择的行可见
  124. "treeGrid":true, // 启用或者禁用treegrid模式 默认false
  125. "ExpandColumn":"columnname", // 指定那列来展开tree grid,默认为第一列,只有在treeGrid为true时起作用
  126. "treedatatype":"json", // 数据类型,通常情况下与datatype相同,不会变
  127. "treeGridModel":"adjacency", // treeGrid所使用的方法
  128. "sortorder":"asc", // 排序顺序,升序或者降序(asc or desc) 默认asc
  129. autowidth : true, // 如果为ture时,则当表格在首次被创建时会根据父元素比例重新调整表格宽度。如果父元素宽度改变,为了使表格宽度能够自动调整则需要实现函数:setGridWidth 默认 false
  130. "datatype":"json",
  131. "pager":"#pager", // 定义翻页用的导航栏,必须是有效的html元素。翻页工具栏可以放置在html页面任意位置
  132. //定义表单的主键 Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
  133. prmNames : {
  134. id: "columnid", 
  135. oper:"oper",    
  136. addoper:"add",
  137. editoper:"edit",
  138. deloper:"del" 
  139. },
  140. colModel : [ {
  141. label : '栏目名称',
  142. name : 'columnname',
  143. editable: true,
  144. edittype:"text",
  145. width : 100,
  146. sortable:false,
  147. editoptions: {
  148. dataInit: function(elem){
  149. $(elem).width(218);
  150. },
  151. maxlength: 75
  152. },
  153. formoptions:{
  154. elmsuffix:" <span style='color:red'>*</span>",
  155. rowpos:1,
  156. colpos:1
  157. },
  158. editrules:{
  159. required: true
  160. }
  161. }, {
  162. label : '栏目编号',
  163. name : 'columnid',
  164. key : true,
  165. editable: true,
  166. edittype: "text",
  167. width : 50,
  168. sortable:false,
  169. editrules:{
  170. required: true,
  171. edithidden:true,
  172. custom:true, 
  173. custom_func: function(strFieldValue, strFieldName){
  174. var strEnglishOrNum = /^([0-9a-zA-Z]+)?$/;
  175.  if(!strEnglishOrNum.test(strFieldValue)){
  176.    return [false, strFieldName+"应该为英文字母或者数字"];
  177.   }
  178. else
  179. {
  180.   return [true,""];
  181. }
  182. }
  183. },
  184. editoptions: {
  185. title:"首次保存后将不允许修改",
  186. dataInit: function(elem){
  187. $(elem).width(218);
  188. },
  189. maxlength: 30
  190. },
  191. formoptions:{
  192. elmsuffix:"<span style='color:red'>*</span>",
  193. rowpos:1,
  194. colpos:2
  195. }
  196. }, {
  197. label : '数据编号',
  198. name : 'keyid',
  199. hidden:true
  200. }, {
  201. label : '显示名称',
  202. name : 'columndisplayname',
  203. editable: true,
  204. edittype:"text",
  205. width : 100,
  206. sortable:false,
  207. editoptions: {
  208. dataInit: function(elem){
  209. $(elem).width(218);
  210. },
  211. maxlength: 75
  212. },
  213. formoptions:{
  214. elmsuffix:" <span style='color:red'>*</span>",
  215. rowpos:1,
  216. colpos:3
  217. },
  218. editrules:{
  219. required: true
  220. },
  221. editrules:{edithidden:true}
  222. }, {
  223. label : '栏目类型',
  224. name : 'columntype',
  225. editable: true,
  226. edittype: "select",
  227. formatter:"select",
  228. width : 50,
  229. sortable:false,
  230. editoptions: {
  231. dataInit: function(elem){
  232. $(elem).width(225);
  233. },
  234. maxlength: 40,
  235. value : "${dic_columntype}"
  236. },
  237. formoptions:{
  238. elmsuffix:" <span style='color:red'>*</span>",
  239. rowpos:2,
  240. colpos:1
  241. },
  242. editrules:{
  243. edithidden:true,
  244. required: true
  245. }
  246. },{
  247. label : '上级栏目',
  248. name : 'parentid',
  249. editable: false,
  250. edittype: "text",
  251. hidden : true,
  252. width : 40,
  253. editoptions: {
  254. dataInit: function(elem){
  255. $(elem).width(218);
  256. },
  257. maxlength: 30
  258. },
  259. formoptions:{
  260. rowpos:2,
  261. colpos:2
  262. },
  263. editrules:{edithidden:true}
  264. }, {
  265. label : '链接地址',
  266. name : 'linkurl',
  267. editable: false,
  268. edittype: "text",
  269. width : 100,
  270. hidden :true,
  271. editrules:{edithidden:true},
  272. editoptions: {
  273. dataInit: function(elem){
  274. $(elem).width(218);
  275. },
  276. maxlength: 100
  277. },
  278. formoptions:{
  279. rowpos:2,
  280. colpos:3
  281. }
  282. },{
  283. label : '栏目图片',
  284. name : 'columnpicurl',
  285. editable: false,
  286. edittype: "text",
  287. align:"center",
  288. formatter:imageFormat,
  289. unformat:imageUnFormat,
  290. editoptions: {
  291. dataInit: function(elem){
  292. $(elem).width(218);
  293. },
  294. maxlength: 100
  295. },
  296. width : 40,
  297. formoptions:{
  298. rowpos:3,
  299. colpos:1
  300. }
  301. },{
  302. label : '上传栏目图片' ,
  303. name : 'columnpicurl1',
  304. editable: false,
  305. hidden : true,
  306. editrules:{
  307. edithidden : true
  308. },
  309. edittype: "file",
  310. editoptions: {
  311. dataInit: function(elem){
  312. $(elem).width(98);
  313. },
  314. enctype: "multipart/form-data",
  315. },
  316. formoptions:{
  317. rowpos:3,
  318. colpos:2
  319. }
  320. }, {
  321. label : '排序编号',
  322. name : 'sortid',
  323. editable: true,
  324. edittype: "text",
  325. width : 50,
  326. hidden :true,
  327. editrules:{
  328. edithidden:true,
  329. custom:true, 
  330. custom_func: function(strFieldValue, strFieldName){
  331. var strFloat = /^([-\+]?(((\d+)(\.\d+))|(\.\d+)|(\d*)))?$/;
  332.  if(!strFloat.test(strFieldValue)){
  333.    return [false, strFieldName+"应该为实数"];
  334.   }
  335. else
  336. {
  337.   return [true,""];
  338. }
  339. }
  340. },
  341. editoptions: {
  342. dataInit: function(elem){
  343. $(elem).width(218);
  344. },
  345. maxlength: 5
  346. },
  347. formoptions:{
  348. /* rowpos:3,
  349. colpos:3 */
  350. rowpos:2,
  351. colpos:2
  352. }
  353. },{
  354. label : '导航显示',
  355. name : 'isnavigation',
  356. editable: false,
  357. edittype: "select",
  358. hidden : true,
  359. formoptions:{
  360. rowpos:4,
  361. colpos:1
  362. },
  363. editoptions:{
  364. dataInit: function(elem){
  365. $(elem).width(225);
  366. },
  367. value : "true:导航显示;false:导航不显示"
  368. //dataUrl: '${ctx}/myconsole/column/getColumnListBySiteID/'
  369. },
  370. editrules:{edithidden:true}
  371. }, {
  372. label : '栏目提示',
  373. name : 'tips',
  374. editable: false,
  375. edittype: "text",
  376. width : 100,
  377. hidden :true,
  378. editrules:{edithidden:true},
  379. editoptions: {
  380. dataInit: function(elem){
  381. $(elem).width(218);
  382. },
  383. maxlength: 30
  384. },
  385. formoptions:{
  386. rowpos:4,
  387. colpos:2
  388. }
  389. },{
  390. label : '支持评论',
  391. name : 'iscritic',
  392. editable: false,
  393. edittype: "select",
  394. hidden : true,
  395. formoptions:{
  396. rowpos:4,
  397. colpos:3
  398. },
  399. editoptions:{
  400. dataInit: function(elem){
  401. $(elem).width(225);
  402. },
  403. value : "true:支持评论;false:不支持评论"
  404. //dataUrl: '${ctx}/myconsole/column/getColumnListBySiteID/'
  405. },
  406. editrules:{edithidden:true}
  407. },{
  408. label : '评论审批',
  409. name : 'iscriticcheck',
  410. editable: false,
  411. edittype: "select",
  412. hidden : true,
  413. formoptions:{
  414. rowpos:5,
  415. colpos:1
  416. },
  417. editoptions:{
  418. dataInit: function(elem){
  419. $(elem).width(225);
  420. },
  421. value : "true:不用审批;false:需要审批"
  422. //dataUrl: '${ctx}/myconsole/column/getColumnListBySiteID/'
  423. },
  424. editrules:{edithidden:true}
  425. },{
  426. label : '审核类型',
  427. name : 'checklevel',
  428. editable: false,
  429. edittype: "select",
  430. hidden : true,
  431. formoptions:{
  432. rowpos:5,
  433. colpos:2
  434. },
  435. editoptions:{
  436. dataInit: function(elem){
  437. $(elem).width(225);
  438. },
  439. value : "0:不需审核;1:流程审批"
  440. },
  441. editrules:{edithidden:true}
  442. },{
  443. label : '审核流程',
  444. name : 'flowid',
  445. editable: false,
  446. edittype: "select",
  447. hidden : true,
  448. formoptions:{
  449. rowpos:5,
  450. colpos:3
  451. },
  452. editoptions:{
  453. dataInit: function(elem){
  454. $(elem).width(225);
  455. },
  456. value : "${flows}"
  457. },
  458. editrules:{edithidden:true}
  459. },{
  460. label : '列表页模板组',
  461. name : 'listtemplategroupid',
  462. editable: true,
  463. hidden : true,
  464. edittype: "select",
  465. formatter:"select",
  466. width : 100,
  467. editoptions: {
  468. dataInit: function(elem){
  469. $(elem).width(225);
  470. },
  471. maxlength: 50,
  472. value : "${templateGroupIDOption}"
  473. },
  474. formoptions:{
  475. elmsuffix:" <span style='color:red'>*</span>",
  476. rowpos:6,
  477. colpos:1
  478. },
  479. editrules:{ required: true,edithidden:true}
  480. },{
  481. label : 'PC端列表模板',
  482. name : 'pclisttemplet',
  483. editable: true,
  484. hidden : true,
  485. edittype: "select",
  486. width : 100,
  487. editoptions: {
  488. dataInit: function(elem){
  489. $(elem).width(225);
  490. },
  491. maxlength: 50,
  492. value : "${dic_listtemplet}"
  493. },
  494. formoptions:{
  495. elmsuffix:" <span style='color:red'>*</span>",
  496. rowpos:6,
  497. colpos:2
  498. },
  499. editrules:{required: true,edithidden:true}
  500. },{
  501. label : '移动端列表模板',
  502. name : 'mobilelisttemplet',
  503. editable: false,
  504. hidden : true,
  505. edittype: "select",
  506. width : 100,
  507. editoptions: {
  508. dataInit: function(elem){
  509. $(elem).width(225);
  510. },
  511. maxlength: 50,
  512. value : "${dic_listtemplet}"
  513. },
  514. formoptions:{
  515. rowpos:6,
  516. colpos:3
  517. },
  518. editrules:{edithidden:true}
  519. },{
  520. label : '内容页模板组',
  521. name : 'articletemplategroupid',
  522. editable: true,
  523. hidden : true,
  524. edittype: "select",
  525. formatter:"select",
  526. width : 100,
  527. editoptions: {
  528. dataInit: function(elem){
  529. $(elem).width(225);
  530. },
  531. maxlength: 50,
  532. value : "${templateGroupIDOption}"
  533. },
  534. formoptions:{
  535. elmsuffix:" <span style='color:red'>*</span>",
  536. rowpos:7,
  537. colpos:1
  538. },
  539. editrules:{required: true,edithidden:true}
  540. }, {
  541. label : 'PC端文章模板',
  542. name : 'pcarticletemplet',
  543. editable: true,
  544. hidden : true,
  545. edittype: "select",
  546. width : 100,
  547. editoptions: {
  548. dataInit: function(elem){
  549. $(elem).width(225);
  550. },
  551. maxlength: 50,
  552. value : "${dic_articletemplet}"
  553. },
  554. formoptions:{
  555. elmsuffix:" <span style='color:red'>*</span>",
  556. rowpos:7,
  557. colpos:2
  558. },
  559. editrules:{required: true,edithidden:true}
  560. }, {
  561. label : '移动端文章模板',
  562. name : 'mobilearticletemplet',
  563. editable: false,
  564. hidden : true,
  565. edittype: "select",
  566. width : 100,
  567. editoptions: {
  568. dataInit: function(elem){
  569. $(elem).width(225);
  570. },
  571. maxlength: 50,
  572. value : "${dic_articletemplet}"
  573. },
  574. formoptions:{
  575. rowpos:7,
  576. colpos:3
  577. },
  578. editrules:{edithidden:true}
  579. },{
  580. label : '新文章天数',
  581. name : 'newinfoday',
  582. editable: false,
  583. edittype: "text",
  584. width : 50,
  585. hidden :true,
  586. editrules:{
  587. edithidden:true,
  588. number:true,
  589. minValue:1,
  590. maxValue:30
  591. },
  592. editoptions: {
  593. dataInit: function(elem){
  594. $(elem).width(218);
  595. },
  596. maxlength: 3,
  597. value : 1
  598. },
  599. formoptions:{
  600. rowpos:8,
  601. colpos:1
  602. }
  603. }, {
  604. label : '新文章条数',
  605. name : 'newinfonum',
  606. editable: false,
  607. edittype: "text",
  608. width : 50,
  609. hidden :true,
  610. editrules:{
  611. edithidden:true,
  612. number:true,
  613. minValue:1,
  614. maxValue:100
  615. },
  616. editoptions: {
  617. dataInit: function(elem){
  618. $(elem).width(218);
  619. },
  620. maxlength: 3,
  621. value : 2
  622. },
  623. formoptions:{
  624. rowpos:8,
  625. colpos:2
  626. }
  627. },{
  628. label : '列表数字图片',
  629. name : 'infonumpictype',
  630. editable: false,
  631. edittype: "select",
  632. width : 100,
  633. hidden :true,
  634. editrules:{edithidden:true},
  635. editoptions: {
  636. dataInit: function(elem){
  637. $(elem).width(225);
  638. },
  639. maxlength: 50,
  640. value : "${dic_infonumpictype}"
  641. },
  642. formoptions:{
  643. rowpos:8,
  644. colpos:3
  645. }
  646. }, {
  647. label : '数字图片个数',
  648. name : 'infonumpicnum',
  649. editable: false,
  650. edittype: "text",
  651. width : 50,
  652. hidden :true,
  653. editrules:{
  654. edithidden:true,
  655. number:true,
  656. minValue:1,
  657. maxValue:100
  658. },
  659. editoptions: {
  660. dataInit: function(elem){
  661. $(elem).width(218);
  662. },
  663. maxlength: 3,
  664. value : 2
  665. },
  666. formoptions:{
  667. rowpos:9,
  668. colpos:1
  669. }
  670. },{
  671. label : '列表固定图片',
  672. name : 'infopicurl',
  673. editable: false,
  674. hidden : true,
  675. edittype: "file",
  676. width : 100,
  677. editrules:{
  678. edithidden : true
  679. },
  680. editoptions: {
  681. dataInit: function(elem){
  682. $(elem).width(218);
  683. },
  684. enctype: "multipart/form-data",
  685. },
  686. formoptions:{
  687. rowpos:9,
  688. colpos:2
  689. }
  690. }, {
  691. label : '轮显图片个数',
  692. name : 'turnpicnum',
  693. editable: false,
  694. edittype: "text",
  695. width : 50,
  696. hidden :true,
  697. editrules:{
  698. edithidden:true,
  699. number:true,
  700. minValue:1,
  701. maxValue:100
  702. },
  703. editoptions: {
  704. dataInit: function(elem){
  705. $(elem).width(218);
  706. },
  707. maxlength: 3,
  708. value : 2
  709. },
  710. formoptions:{
  711. rowpos:9,
  712. colpos:3
  713. }
  714. }, {
  715. label : '查看类型',
  716. name : 'showtype',
  717. editable: false,
  718. hidden :true,
  719. edittype: "select",
  720. formatter:"select",
  721. width : 50,
  722. editoptions: {
  723. dataInit: function(elem){
  724. $(elem).width(225);
  725. },
  726. maxlength: 50,
  727. value : "public:公共信息;private:私有信息"
  728. },
  729. formoptions:{
  730. rowpos:10,
  731. colpos:1
  732. },
  733. editrules:{edithidden:true}
  734. }, {
  735. label : '栏目状态',
  736. name : 'tstate',
  737. editable: true,
  738. sortable:false,
  739. edittype: "select",
  740. formatter:"select",
  741. width : 50,
  742. editoptions: {
  743. dataInit: function(elem){
  744. $(elem).width(225);
  745. },
  746. maxlength: 10,
  747. value : "启用:启用;停用:停用"
  748. },
  749. formoptions:{
  750. elmsuffix:" <span style='color:red'>*</span>",
  751. rowpos:10,
  752. colpos:1
  753. },
  754. editrules:{required: true,edithidden:true}
  755. },{
  756. label : 'SEO标题',
  757. name : 'seotitle',
  758. editable: false,
  759. hidden : true,
  760. edittype: "text",
  761. width : 100,
  762. editrules:{
  763. edithidden : true
  764. },
  765. editoptions: {
  766. dataInit: function(elem){
  767. $(elem).width(218);
  768. },
  769. maxlength: 50
  770. },
  771. formoptions:{
  772. rowpos:10,
  773. colpos:3
  774. }
  775. },{
  776. label : 'SEO关键字',
  777. name : 'seokeyword',
  778. editable: false,
  779. hidden : true,
  780. edittype: "text",
  781. width : 100,
  782. editrules:{
  783. edithidden : true
  784. },
  785. editoptions: {
  786. dataInit: function(elem){
  787. $(elem).width(218);
  788. },
  789. maxlength: 50
  790. },
  791. formoptions:{
  792. rowpos:11,
  793. colpos:1
  794. }
  795. }, {
  796. label : 'SEO描述',
  797. name : 'seodesc',
  798. editable: false,
  799. width : 100,
  800. edittype : "text",
  801. hidden : true,
  802. editrules:{
  803. edithidden : true
  804. },
  805. editoptions: {
  806. dataInit: function(elem){
  807. $(elem).width(218);
  808. },
  809. maxlength: 50
  810. },
  811. formoptions:{
  812. rowpos:11,
  813. colpos:2
  814. }
  815. }, {
  816. label : '扩展字段',
  817. name : 'extendmodelid',
  818. editable: false,
  819. width : 100,
  820. edittype: "select",
  821. formatter:"select",
  822. hidden : true,
  823. editrules:{
  824. edithidden : true
  825. },
  826. editoptions: {
  827. dataInit: function(elem){
  828. $(elem).width(225);
  829. },
  830. maxlength: 10,
  831. value : "${dic_listextendmodel}"
  832. },
  833. formoptions:{
  834. rowpos:11,
  835. colpos:3
  836. }
  837. },{
  838. label : '前台每页信息数量',
  839. name : 'pagesize',
  840. editable: false,
  841. hidden : true,
  842. edittype: "select",
  843. formatter:"select",
  844. width : 100,
  845. editoptions: {
  846. dataInit: function(elem){
  847. $(elem).width(225);
  848. },
  849. maxlength: 50,
  850. value : "10:10;15:15;20:20;25:25;30:30"
  851. },
  852. formoptions:{
  853. rowpos:12,
  854. colpos:1
  855. },
  856. editrules:{edithidden:true}
  857. },{
  858. label : '静态化页面数量',
  859. name : 'staticsize',
  860. editable: false,
  861. hidden : true,
  862. edittype: "select",
  863. formatter:"select",
  864. width : 100,
  865. editoptions: {
  866. dataInit: function(elem){
  867. $(elem).width(225);
  868. },
  869. maxlength: 50,
  870. value : "-1:全部;10:10;15:15;20:20;25:25;30:30"
  871. },
  872. formoptions:{
  873. rowpos:12,
  874. colpos:2
  875. },
  876. editrules:{edithidden:true}
  877. }, {
  878. label : '发布规则',
  879. name : 'urlrulegroupkeyid',
  880. editable: true,
  881. width : 100,
  882. edittype: "select",
  883. formatter:"select",
  884. hidden : true,
  885. editrules:{
  886. required: true,
  887. edithidden : true
  888. },
  889. editoptions: {
  890. dataInit: function(elem){
  891. $(elem).width(225);
  892. },
  893. maxlength: 10,
  894. value : "${urlRuleGroupKeyIDs}"
  895. },
  896. formoptions:{
  897. elmsuffix:" <span style='color:red'>*</span>",
  898. /* rowpos:12,
  899. colpos:3 */
  900. rowpos:2,
  901. colpos:3
  902. }
  903. },{
  904. label : '创建人',
  905. name : 'username',
  906. width : 50,
  907. editable: false,
  908. sortable:false,
  909. edittype:"text"
  910. },{
  911. label : '创建时间',
  912. name : 'recordtime',
  913. width : 80,
  914. editable: false,
  915. sortable:false,
  916. edittype:"text"
  917. },/* {
  918. label : '操作',
  919. name : 'operMod',
  920. editable: false,
  921. align:"center",
  922. width:80,
  923. formatter: function (cellvalue, options, rowdata) {
  924. var html ="";
  925. <#if readPerm>
  926. html=html+"<button class='btn btn-success radius size-S' onclick=readperm('"+rowdata.keyid+"')>阅读权限</button>";
  927. </#if>
  928. html = html+" <a href='"+rowdata.columnurl+"' target='_blank'><button class='btn btn-success radius size-S'>预览内网</button></a>";
  929. html = html+" <a href='"+rowdata.columnstaticurl+"' target='_blank'><button class='btn btn-success radius size-S'>预览外网</button></a>";
  930. return html;
  931. }
  932. }, */{
  933. "name":"treelevel",
  934. "hidden":true
  935. } ],
  936. treeReader:{
  937. "level_field":"treelevel",
  938. "leaf_field":"isleaf",
  939. "expanded_field":"expanded",
  940. "loaded":"loaded",
  941. "parent_id_field":"parentid",
  942. "icon_field":"icon"
  943. }
  944. });
  945. jQuery('#tree').jqGrid('navGrid','#pager',
  946. {
  947. ${buttonflag}
  948. search : false,
  949. refresh : true,
  950. view : false,
  951. position : "left",
  952. cloneToTop : true
  953. },
  954. //编辑按钮事件处理
  955. {
  956. closeAfterEdit : true,
  957. recreateForm : true,
  958. width:1200,
  959. onInitializeForm: function(formid) {
  960. var config;
  961. $.ajax({
  962. type:"get",
  963. dataType:"json",
  964. url:"${ctx}/myconsole/ueditor/getConfig",
  965. async:false,
  966. success:function(data){
  967. config=eval(data);
  968. //console.log(config);
  969. }
  970. });
  971. $( '#columnpicurl1').ajaxfileupload({
  972. action: '${ctx}/myconsole/ueditor/?action=uploadimage',
  973. validate_extensions: false,
  974. onComplete: function(response) {
  975. if(response.state == "SUCCESS"){
  976. $( '#columnpicurl').val(config.imageUrlPrefix+response.url);
  977. } else{
  978. alert(response.state);
  979. }
  980. }
  981. });
  982. },
  983. beforeShowForm: function(formid) {
  984. initListTemplate();
  985. initArticleTemplate();
  986. var gr = jQuery("#tree").jqGrid('getGridParam', 'selrow');//得到最后一次选择的行
  987. var dr= jQuery("#tree").jqGrid('getRowData',gr);//得到该行的数据
  988. $("#pclisttemplet").val(dr.pclisttemplet);
  989. $("#pcarticletemplet").val(dr.pcarticletemplet);
  990. $("#mobilelisttemplet").val(dr.mobilelisttemplet);
  991. $("#mobilearticletemplet").val(dr.mobilearticletemplet);
  992. $("#listtemplategroupid").change(function(){
  993. initListTemplate();
  994. })
  995. $("#articletemplategroupid").change(function(){
  996. initArticleTemplate();
  997. })
  998. },
  999. afterShowForm : function(formid) {
  1000. var columnidObj = formid.find('#columnid');
  1001. columnidObj.attr('readOnly',true);
  1002. columnidObj.css({'background':'#cccccc'});
  1003. $('#columndisplayname').focus();
  1004. makeTree("parentid","/myconsole/column/getColumnTree","radio");
  1005. $("#_parentid").width(220);
  1006. var parentidObj = formid.find('#_parentid');
  1007. parentidObj.attr('readOnly',true);
  1008. parentidObj.css({'background':'#cccccc'});
  1009. $("#columnname").blur(function(){
  1010. $("#columndisplayname").val($("#columnname").val());
  1011. });
  1012. },
  1013. beforeSubmit: function(postdata, formid){
  1014. // 编辑时jqgrid 将主键变成 tree_id 手动添加 keyid
  1015. //postdata["keyid"] = postdata.tree_id;
  1016. $.each(postdata,function (index, value) {
  1017. if(index!="oper"){
  1018. modifyJosnKey(postdata,index,"column."+index);
  1019. }
  1020. })
  1021. return [true,'']; //返回值必须这么写 目前没找到原因,用true 和 返回对象都不好使。待查
  1022. },
  1023. afterSubmit: function(response,postdata)
  1024. {
  1025. var res=eval('(' + response.responseText + ')');
  1026. if(res.flag)
  1027. {
  1028. parent.layer.alert(res.message, {
  1029. skin: 'layui-layer-molv' //样式类名
  1030. ,closeBtn: 0
  1031. });
  1032. return [true,res.message,''];
  1033. }
  1034. else
  1035. {
  1036. parent.layer.alert(res.message, {
  1037. skin: 'layui-layer-molv' //样式类名
  1038. ,closeBtn: 0
  1039. });
  1040. return [false,res.message,''];
  1041. }
  1042. },
  1043. afterComplete : function (response, postdata, formid) {
  1044. //取消选择
  1045. $("#tree").jqGrid("resetSelection");
  1046. //关闭对话框
  1047. $(".ui-icon-closethick").trigger('click');
  1048. },
  1049. errorTextFormat : function(data) {
  1050. return 'Error: ' + data.responseText
  1051. }
  1052. },
  1053. //添加按钮处理事件
  1054. {
  1055. closeAfterAdd : true,
  1056. recreateForm : true,
  1057. checkOnUpdate : true,
  1058. checkOnSubmit : true,
  1059. width:1200,
  1060. onInitializeForm: function(formid) {
  1061. var config;
  1062. $.ajax({
  1063. type:"get",
  1064. dataType:"json",
  1065. url:"${ctx}/myconsole/ueditor/getConfig",
  1066. async:false,
  1067. success:function(data){
  1068. config=eval(data);
  1069. //console.log(config);
  1070. }
  1071. });
  1072. $( '#columnpicurl1').ajaxfileupload({
  1073. action: '${ctx}/myconsole/ueditor/?action=uploadimage',
  1074. validate_extensions: false,
  1075. onComplete: function(response) {
  1076. if(response.state == "SUCCESS"){
  1077. $( '#columnpicurl').val(config.imageUrlPrefix+response.url);
  1078. } else{
  1079. alert(response.state);
  1080. }
  1081. }
  1082. });
  1083. },
  1084. beforeShowForm: function(formid) {
  1085. initListTemplate();
  1086. $("#listtemplategroupid").change(function(){
  1087. initListTemplate();
  1088. });
  1089. initArticleTemplate();
  1090. $("#articletemplategroupid").change(function(){
  1091. initArticleTemplate();
  1092. })
  1093. $.post("${ctx}/myconsole/column/generateColumnID",function(data){
  1094. $("#columnid").val(data);
  1095. })
  1096. },
  1097. afterShowForm : function(formid) {
  1098. //$("#listtemplategroupid").val("${site.templategroupkeyid}");
  1099. $('#tree').setColProp('parentid',{editoptions:{readonly:true}});
  1100. $("#columnname").blur(function(){
  1101. $("#columndisplayname").val($("#columnname").val());
  1102. });
  1103. },
  1104. serializeEditData: function(postdata) {
  1105. var selRowId = $("#tree").jqGrid ('getGridParam', 'selrow');
  1106. if(selRowId == null) selRowId = "";
  1107. //获取选中的父节点主键值,添加下级站点
  1108. postdata.parentid=selRowId;
  1109. $.each(postdata,function(index,value){
  1110. if(index!="oper"){
  1111. modifyJosnKey(postdata,index,"column."+index);
  1112. }
  1113. })
  1114. //jqgrid 做添加操作会把主键id的值设置成“_empty”;这里修改成空;
  1115. postdata["column.keyid"]="";
  1116. return postdata;
  1117. },
  1118. afterSubmit: function(response,postdata)
  1119. {
  1120. var res=eval('(' + response.responseText + ')');
  1121. if(res.flag)
  1122. {
  1123. parent.layer.alert(res.message, {
  1124. skin: 'layui-layer-molv' //样式类名
  1125. ,closeBtn: 0
  1126. });
  1127. return [true,res.message,''];
  1128. }
  1129. else
  1130. {
  1131. parent.layer.alert(res.message, {
  1132. skin: 'layui-layer-molv' //样式类名
  1133. ,closeBtn: 0
  1134. });
  1135. return [false,res.message,''];
  1136. }
  1137. },
  1138. errorTextFormat : function(data) {
  1139. return 'Error: ' + data.responseText
  1140. }
  1141. },
  1142. //删除按钮处理事件
  1143. {
  1144. errorTextFormat : function(data) {
  1145. return 'Error: ' + data.responseText
  1146. },
  1147. afterSubmit: function(response,postdata)
  1148. {
  1149. var res=eval('(' + response.responseText + ')');
  1150. if(res.flag)
  1151. {
  1152. parent.layer.alert(res.message, {
  1153. skin: 'layui-layer-molv' //样式类名
  1154. ,closeBtn: 0
  1155. });
  1156. return [true,res.message,''];
  1157. }
  1158. else
  1159. {
  1160. parent.layer.alert(res.message, {
  1161. skin: 'layui-layer-molv' //样式类名
  1162. ,closeBtn: 0
  1163. });
  1164. return [false,res.message,''];
  1165. }
  1166. },
  1167. }).navButtonAdd('#pager',{
  1168. title:"合并",
  1169. caption:"栏目合并",
  1170. buttonicon:"ui-icon-del",
  1171. onClickButton: function(){
  1172. var sel=$('#tree').jqGrid('getGridParam','selrow');
  1173. if(sel==null){
  1174. //alert('请先选择数据');
  1175. layer.alert("请先选择需要合并的栏目!", {
  1176. skin: 'layui-layer-molv' //样式类名
  1177. ,closeBtn: 0
  1178. });
  1179. }else{
  1180. layer.open({
  1181. type: 2,
  1182. title: '栏目合并',
  1183. shadeClose: true,
  1184. shade: 0.8,
  1185. area: ['570px', '460px'],
  1186. content: '${ctx}/myconsole/column/merge?fromcolumnid='+sel
  1187. });
  1188. }
  1189. },
  1190. position : "last"
  1191. }
  1192. )
  1193. ;
  1194. jQuery('#tree').jqGrid('bindKeys');
  1195. })
  1196. function getSelectOptions(options,data){
  1197. var urls = "";
  1198. if('upperColumn' == options){
  1199. urls = "${ctx}/myconsole/column/getColumnListBySiteID/";
  1200. }else{
  1201. urls = "${ctx}/myconsole/template/getTemplateListBySiteID?type="+options;
  1202. }
  1203. $.ajax({url:urls,async:false, success:function(e){
  1204. if (e != null && e.length>0) {
  1205. data += ";" + e;
  1206. }
  1207. }
  1208. });
  1209. return data;
  1210. }
  1211. </script>
  1212. <title>我的桌面</title>
  1213. </head>
  1214. <body>
  1215. <div class="page-container">
  1216. <table id="tree"></table>
  1217. <div id="pager"></div>
  1218. </div>
  1219. <footer class="footer mt-20">
  1220. <div class="container">
  1221. <p></p>
  1222. </div>
  1223. </footer>
  1224. </body>
  1225. </html>