bbxxList.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /**
  2. * @author Zheng Tengfei
  3. */
  4. var bbxx = new Object();
  5. bbxx.loadSearchModule = function(p) {
  6. var $div = $("#" + p.id);
  7. if ($div.length > 0) {
  8. $div.load('bbxxSearchModule.htm', {
  9. from : p.from,
  10. callBackFunName : p.callBackFunName,
  11. 'bbxxSearchGrid' : $("#bbxxSearchModule").val()
  12. }, function() {
  13. });
  14. }
  15. };
  16. /**
  17. * 加载新闻查询模块
  18. */
  19. bbxx.loadSearchModule({
  20. id : 'bbxxSearchModule',
  21. from : 'bbxx',
  22. callBackFunName : 'searchBbxxCallBack'
  23. });
  24. /**
  25. * 搜索条件回调函数
  26. *
  27. * @param {搜索条件对象}
  28. * data
  29. * @param {分隔符}
  30. * fgf
  31. */
  32. function searchBbxxCallBack(data, fgf) {
  33. huimv.searchGrid("bbxxGrid", {
  34. url : 'getBbxxList.htm',
  35. params : [{
  36. name : 'param',
  37. value : data
  38. }, {
  39. name : 'fgf',
  40. value : fgf
  41. }]
  42. }, '<b>版本信息搜索结果</b>');
  43. }
  44. /**
  45. * 加载新闻列表数据
  46. */
  47. function loadBbxxGrid(bbxxSearchGrid) {
  48. jQuery("#bbxxGrid").flexigrid({
  49. url : 'getBbxxList.htm',
  50. dataType : 'json',
  51. method : 'post',
  52. params : [{
  53. name : 'bbxxSearchGrid',
  54. value : $('#bbxxSearchGrid').val()
  55. },{
  56. name : 'from',
  57. value : $("#from").val()
  58. }],
  59. title : '<b>版本信息浏览</b>',
  60. usepager : true,
  61. useRp : true,
  62. rp : 10,
  63. singleSelect : true,
  64. hidehead : false,
  65. showInputPage : true,
  66. showSelectRp : false,
  67. showTableToggleBtn : false,
  68. width : '790',
  69. resizable : false,
  70. nowrap : true,
  71. height : '335',
  72. cache : false,// 清除缓存
  73. colModel : [{
  74. display : '行号',
  75. name : 'hh',
  76. width : 25,
  77. sortable : false,
  78. align : 'center',
  79. process : function(col, record, d) {
  80. jQuery(col).html(d + 1);
  81. }
  82. }, {
  83. display : '版本号',
  84. name : 'bbh',
  85. width : 250,
  86. sortable : false,
  87. align : 'center',
  88. process : function(col, record, postion, pid) {
  89. jQuery(col).addClass('s');
  90. jQuery(col).html('<a onclick="viewBbxx(' + record.id + ');">' + record.bbh + '</a>');
  91. }
  92. }, {
  93. display : '发布人',
  94. name : 'fbrxm',
  95. width : 100,
  96. sortable : false,
  97. align : 'center'
  98. }, {
  99. display : '发布时间',
  100. name : 'fbsj',
  101. width : 100,
  102. sortable : true,
  103. align : 'center'
  104. }, {
  105. display : '修改人',
  106. name : 'xgrxm',
  107. width : 100,
  108. sortable : false,
  109. align : 'center'
  110. }, {
  111. display : '修改时间',
  112. name : 'xgsj',
  113. width : 100,
  114. sortable : true,
  115. align : 'center'
  116. }]
  117. });
  118. }
  119. loadBbxxGrid($('#xwfbSearchGrid'));
  120. /**
  121. * 加载新闻查看页面
  122. * @param id
  123. */
  124. function viewBbxx(id) {
  125. huimv.loadPage('bbxxRight', 'viewBbxx.htm', {
  126. "id" : id
  127. });
  128. }
  129. /**
  130. * 加载新闻编辑页面
  131. * @param id
  132. */
  133. function editBbxx(id, from) {
  134. huimv.loadPage('bbxxRight', 'editBbxx.htm', {
  135. "id" : id,
  136. "from" : from
  137. });
  138. }
  139. /**
  140. * 作废新闻
  141. * @param id
  142. */
  143. function disableBbxx(id, from) {
  144. Dialogs.alert("确定作废新闻?", {
  145. title : '提示信息',
  146. width : 250,
  147. height : 80,
  148. top : 150,
  149. button : {
  150. ok : ['确定',function(){
  151. this.close();
  152. huimv.showProcessModel('处理数据中');
  153. jQuery.ajax({
  154. url : 'disableBbxx.htm',
  155. dataType : 'json',
  156. type : 'post',
  157. cache : false,
  158. data : {"id" : id},
  159. success : function(data) {
  160. huimv.hideProcessModel();
  161. if (data.returnCode > 0) {
  162. if (from == 'list') {
  163. huimv.reloadGrid('bbxxGrid');
  164. } else if (from == 'view') {
  165. loadBbxxList();
  166. }
  167. } else {
  168. Dialogs.alert("传入参数有误!", {
  169. width : 300,
  170. height : 50
  171. });
  172. }
  173. },
  174. error : function(data) {
  175. huimv.showError(data.responseText);
  176. }
  177. });
  178. }],
  179. cancel : ['取消',function(){
  180. this.close();
  181. }]
  182. }
  183. });
  184. }