savespace.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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 type="text/css" href="${ctx}/assets/lib/codemirror/lib/codemirror.css" rel="stylesheet" />
  24. <script type="text/javascript" src="${ctx}/assets/lib/codemirror/lib/codemirror.js"></script>
  25. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  26. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  27. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  28. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  29. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  30. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  31. <!--[if IE 6]>
  32. <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  33. <script>DD_belatedPNG.fix('*');</script>
  34. <![endif]-->
  35. <script type="text/javascript">
  36. $(function() {
  37. $(window).resize(function(){
  38. $("#jqGrid").setGridWidth($(window).width()-40); 
  39. });
  40. $("#jqGrid").jqGrid({
  41. url : '${ctx}/myconsole/savespace/getByPage',
  42. editurl:"${ctx}/myconsole/savespace/saveOrUpdate",
  43. mtype : "POST",
  44. datatype : "json",
  45. caption:'存储空间管理',
  46. prmNames : {
  47. id: "keyid", 
  48. oper:"oper",    
  49. addoper:"add",
  50. editoper:"edit",
  51. deloper:"del" 
  52. },
  53. colModel : [ {
  54. label : '数据编号',
  55. name : 'keyid',
  56. hidden : true,
  57. key : true,
  58. width : 50,
  59. }, {
  60. label : '存储空间名称',
  61. name : 'tname',
  62. editable: true,
  63. edittype:"text",
  64. width : 100,
  65. editoptions: {
  66. dataInit: function(elem){
  67. $(elem).width(200);
  68. },
  69. maxlength: 50
  70. },
  71. formoptions:{
  72. elmsuffix:" <span style='color:red'>*<span>",
  73. rowpos:1,
  74. colpos:1
  75. },
  76. editrules:{
  77. required: true
  78. }
  79. },{
  80. label : '存储路径规则',
  81. name : 'savepathrule',
  82. editable: true,
  83. edittype: "text",
  84. width : 200,
  85. editoptions: {
  86. dataInit: function(elem){
  87. $(elem).width(200);
  88. },
  89. maxlength: 100,
  90. },
  91. formoptions:{
  92. elmsuffix:" <span style='color:red'>*<span>",
  93. rowpos:1,
  94. colpos:2
  95. },
  96. editrules:{
  97. required: true
  98. }
  99. },{
  100. label : '主存储位置',
  101. name : 'mainsaveposition',
  102. editable: true,
  103. edittype: "text",
  104. width : 200,
  105. editoptions: {
  106. dataInit: function(elem){
  107. $(elem).width(200);
  108. },
  109. maxlength: 100,
  110. },
  111. formoptions:{
  112. elmsuffix:" <span style='color:red'>*<span>",
  113. rowpos:2,
  114. colpos:1
  115. },
  116. editrules:{
  117. required: true
  118. }
  119. },{
  120. label : '排序编号',
  121. name : 'sortid',
  122. editable: true,
  123. hidden : true,
  124. edittype: "text",
  125. width : 100,
  126. editoptions: {
  127. dataInit: function(elem){
  128. $(elem).width(200);
  129. },
  130. maxlength: 6,
  131. },
  132. editrules:{
  133. edithidden:true,
  134. required: true,
  135. custom:true, 
  136. custom_func: function(strFieldValue, strFieldName){
  137. var strFloat = /^([-\+]?(((\d+)(\.\d+))|(\.\d+)|(\d*)))?$/;
  138.  if(!strFloat.test(strFieldValue)){
  139.    return [false, strFieldName+"应该为实数"];
  140.   }
  141. else
  142. {
  143.   return [true,""];
  144. }
  145. }
  146. },
  147. formoptions:{
  148. elmsuffix:" <span style='color:red'>*<span>",
  149. rowpos:2,
  150. colpos:2
  151. }
  152. } ,{
  153. label : 'PC端静态页面存储位置',
  154. name : 'pchtmlsaveposition',
  155. editable: true,
  156. hidden : true,
  157. edittype: "text",
  158. width : 200,
  159. editoptions: {
  160. dataInit: function(elem){
  161. $(elem).width(200);
  162. },
  163. maxlength: 100,
  164. },
  165. formoptions:{
  166. elmsuffix:" <span style='color:red'>*<span>",
  167. rowpos:3,
  168. colpos:1
  169. },
  170. editrules:{
  171. edithidden : true,
  172. required: true
  173. }
  174. },{
  175. label : 'PC端静态页面访问地址',
  176. name : 'pchtmlaccessaddress',
  177. editable: true,
  178. hidden : true,
  179. edittype: "text",
  180. width : 200,
  181. editoptions: {
  182. dataInit: function(elem){
  183. $(elem).width(200);
  184. },
  185. maxlength: 100,
  186. },
  187. formoptions:{
  188. elmsuffix:" <span style='color:red'>*<span>",
  189. rowpos:3,
  190. colpos:2
  191. },
  192. editrules:{
  193. edithidden : true,
  194. required: true
  195. }
  196. },{
  197. label : '移动端静态页面存储位置',
  198. name : 'mobilehtmlsaveposition',
  199. editable: true,
  200. hidden : true,
  201. edittype: "text",
  202. width : 200,
  203. editoptions: {
  204. dataInit: function(elem){
  205. $(elem).width(200);
  206. },
  207. maxlength: 100,
  208. },
  209. formoptions:{
  210. elmsuffix:" <span style='color:red'>*<span>",
  211. rowpos:4,
  212. colpos:1
  213. },
  214. editrules:{
  215. edithidden : true,
  216. required: true
  217. }
  218. },{
  219. label : '移动端静态页面访问地址',
  220. name : 'mobilehtmlaccessaddress',
  221. editable: true,
  222. hidden : true,
  223. edittype: "text",
  224. width : 200,
  225. editoptions: {
  226. dataInit: function(elem){
  227. $(elem).width(200);
  228. },
  229. maxlength: 100,
  230. },
  231. formoptions:{
  232. elmsuffix:" <span style='color:red'>*<span>",
  233. rowpos:4,
  234. colpos:2
  235. },
  236. editrules:{
  237. edithidden : true,
  238. required: true
  239. }
  240. },{
  241. label : '图片存储位置',
  242. name : 'imagesaveposition',
  243. editable: true,
  244. hidden : true,
  245. edittype: "text",
  246. width : 200,
  247. editoptions: {
  248. dataInit: function(elem){
  249. $(elem).width(200);
  250. },
  251. maxlength: 100,
  252. },
  253. formoptions:{
  254. elmsuffix:" <span style='color:red'>*<span>",
  255. rowpos:5,
  256. colpos:1
  257. },
  258. editrules:{
  259. edithidden : true,
  260. required: true
  261. }
  262. },{
  263. label : '图片访问地址',
  264. name : 'imageaccessaddress',
  265. editable: true,
  266. hidden : true,
  267. edittype: "text",
  268. width : 200,
  269. editoptions: {
  270. dataInit: function(elem){
  271. $(elem).width(200);
  272. },
  273. maxlength: 100,
  274. },
  275. formoptions:{
  276. elmsuffix:" <span style='color:red'>*<span>",
  277. rowpos:5,
  278. colpos:2
  279. },
  280. editrules:{
  281. edithidden : true,
  282. required: true
  283. }
  284. },{
  285. label : '文件存储位置',
  286. name : 'filesaveposition',
  287. editable: true,
  288. hidden : true,
  289. edittype: "text",
  290. width : 200,
  291. editoptions: {
  292. dataInit: function(elem){
  293. $(elem).width(200);
  294. },
  295. maxlength: 100,
  296. },
  297. formoptions:{
  298. elmsuffix:" <span style='color:red'>*<span>",
  299. rowpos:6,
  300. colpos:1
  301. },
  302. editrules:{
  303. edithidden : true,
  304. required: true
  305. }
  306. },{
  307. label : '文件访问地址',
  308. name : 'fileaccessaddress',
  309. editable: true,
  310. hidden : true,
  311. edittype: "text",
  312. width : 200,
  313. editoptions: {
  314. dataInit: function(elem){
  315. $(elem).width(200);
  316. },
  317. maxlength: 100,
  318. },
  319. formoptions:{
  320. elmsuffix:" <span style='color:red'>*<span>",
  321. rowpos:6,
  322. colpos:2
  323. },
  324. editrules:{
  325. edithidden : true,
  326. required: true
  327. }
  328. },{
  329. label : '视频存储位置',
  330. name : 'videosaveposition',
  331. editable: true,
  332. hidden : true,
  333. edittype: "text",
  334. width : 200,
  335. editoptions: {
  336. dataInit: function(elem){
  337. $(elem).width(200);
  338. },
  339. maxlength: 100,
  340. },
  341. formoptions:{
  342. elmsuffix:" <span style='color:red'>*<span>",
  343. rowpos:7,
  344. colpos:1
  345. },
  346. editrules:{
  347. edithidden : true,
  348. required: true
  349. }
  350. },{
  351. label : '视频访问地址',
  352. name : 'videoaccessaddress',
  353. editable: true,
  354. hidden : true,
  355. edittype: "text",
  356. width : 200,
  357. editoptions: {
  358. dataInit: function(elem){
  359. $(elem).width(200);
  360. },
  361. maxlength: 100,
  362. },
  363. formoptions:{
  364. elmsuffix:" <span style='color:red'>*<span>",
  365. rowpos:7,
  366. colpos:2
  367. },
  368. editrules:{
  369. edithidden : true,
  370. required: true
  371. }
  372. }
  373. ],
  374. rownumbers : true,//添加左侧行号
  375. viewrecords : true,//是否在浏览导航栏显示记录总数
  376. rowNum : 10,//每页显示记录数
  377. rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
  378. autowidth : true,
  379. height : 'auto',
  380. pager : "#jqGridPager"
  381. });
  382. $('#jqGrid').navGrid('#jqGridPager',
  383. // the buttons to appear on the toolbar of the grid
  384. {
  385. edit : true,
  386. add : true,
  387. del : true,
  388. search : true,
  389. refresh : true,
  390. view : true,
  391. position : "left",
  392. cloneToTop : true
  393. },
  394. // options for the Edit Dialog
  395. {
  396. recreateForm : true,
  397. checkOnUpdate : true,
  398. checkOnSubmit : true,
  399. closeAfterEdit : true,
  400. width:800,
  401. onInitializeForm:function(formid) {
  402. },
  403. afterShowForm : function(formid) {
  404. },
  405. serializeEditData: function(postdata) {
  406. //myconsole.log(postdata);
  407. $.each(postdata,function (index, value) {
  408. //myconsole.log(index);
  409. if(index!="jqGrid_id" && index!="oper" && index!="id"){
  410. modifyJosnKey(postdata,index,"saveSpace."+index);
  411. }
  412. if(index=="id"){
  413. postdata["saveSpace."+index]=value
  414. }
  415. })
  416. //myconsole.log(postdata);
  417. return postdata;
  418. },
  419. afterSubmit: function(response,postdata)
  420. {
  421. var res=eval('(' + response.responseText + ')');
  422. if(res.flag)
  423. {
  424. parent.layer.alert(res.message, {
  425. skin: 'layui-layer-molv' //样式类名
  426. ,closeBtn: 0
  427. });
  428. return [true,res.message,''];
  429. }
  430. else
  431. {
  432. parent.layer.alert(res.message, {
  433. skin: 'layui-layer-molv' //样式类名
  434. ,closeBtn: 0
  435. });
  436. return [false,res.message,''];
  437. }
  438. },
  439. errorTextFormat : function(data) {
  440. return 'Error: ' + data.responseText
  441. }
  442. },
  443. // options for the Add Dialog
  444. {
  445. closeAfterAdd : true,
  446. recreateForm : true,
  447. width:800,
  448. afterShowForm : function(formid) {
  449. },
  450. beforeSubmit: function(postdata, formid){
  451. $.each(postdata,function (index, value) {
  452. if(index!="jqGrid_id" && index!="oper"){
  453. modifyJosnKey(postdata,index,"saveSpace."+index);
  454. }
  455. })
  456. return[true,''];
  457. },
  458. afterSubmit: function(response,postdata)
  459. {
  460. var res=eval('(' + response.responseText + ')');
  461. if(res.flag)
  462. {
  463. parent.layer.alert(res.message, {
  464. skin: 'layui-layer-molv' //样式类名
  465. ,closeBtn: 0
  466. });
  467. return [true,res.message,''];
  468. }
  469. else
  470. {
  471. parent.layer.alert(res.message, {
  472. skin: 'layui-layer-molv' //样式类名
  473. ,closeBtn: 0
  474. });
  475. return [false,res.message,''];
  476. }
  477. },
  478. errorTextFormat : function(data) {
  479. return 'Error: ' + data.responseText
  480. }
  481. },
  482. // options for the Delete Dailog
  483. {
  484. afterSubmit: function(response,postdata)
  485. {
  486. var res=eval('(' + response.responseText + ')');
  487. if(res.flag)
  488. {
  489. parent.layer.alert(res.message, {
  490. skin: 'layui-layer-molv' //样式类名
  491. ,closeBtn: 0
  492. });
  493. return [true,''];
  494. }
  495. else
  496. {
  497. parent.layer.alert(res.message, {
  498. skin: 'layui-layer-molv' //样式类名
  499. ,closeBtn: 0
  500. });
  501. return [true,''];
  502. }
  503. }
  504. },{
  505. // search options 这里支持多条件查询
  506. multipleSearch: true,
  507. sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
  508. afterSubmit: function(r, data) {
  509. var messageString = r.responseText;
  510. var mesObj = eval('(' + messageString + ')');
  511. return [mesObj.state, mesObj.message];
  512. }
  513. }
  514. );
  515. })
  516. </script>
  517. <title>我的桌面</title>
  518. </head>
  519. <body>
  520. <div class="page-container">
  521. <table id="jqGrid"></table>
  522. <div id="jqGridPager"></div>
  523. </div>
  524. <footer class="footer mt-20">
  525. <div class="container">
  526. <p></p>
  527. </div>
  528. </footer>
  529. </body>
  530. </html>