webservicexyxxList.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. var webservicexyxx = new Object();
  2. webservicexyxx.loadSearchModule = function(p) {
  3. var $div = $("#" + p.id);
  4. if ($div.length > 0) {
  5. $div.load('webserviceSearchModule.htm', {
  6. callBackFunName : p.callBackFunName
  7. }, function() {
  8. });
  9. }
  10. };
  11. webservicexyxx.loadSearchModule({
  12. id : 'webserviceSearchModule',
  13. callBackFunName : 'searchWebserviceCallBack'
  14. });
  15. function searchWebserviceCallBack(data, fgf) {
  16. huimv.searchGrid("webservicexyxxGrid", {
  17. url : 'getWebservicexyxxList.htm',
  18. params : [{
  19. name : 'param',
  20. value : data
  21. }, {
  22. name : 'fgf',
  23. value : fgf
  24. }]
  25. }, '<b>webservice响应信息搜索结果</b>');
  26. }
  27. function loadWebservicexyxxGrid() {
  28. jQuery("#webservicexyxxGrid").flexigrid({
  29. url : 'getWebservicexyxxList.htm',
  30. dataType : 'json',
  31. method : 'post',
  32. title : '<b>webservice响应信息浏览</b>',
  33. usepager : true,
  34. useRp : true,
  35. rp : 10,
  36. singleSelect : true,
  37. hidehead : false,
  38. showInputPage : true,
  39. showSelectRp : false,
  40. showTableToggleBtn : false,
  41. width : '790',
  42. height : '335',
  43. nowrap : true,
  44. resizable : false,
  45. cache : false,// 清除缓存
  46. colModel : [{
  47. display : '行号',
  48. name : 'hh',
  49. width : 25,
  50. sortable : false,
  51. align : 'center',
  52. process : function(col, record, d) {
  53. jQuery(col).html(d + 1);
  54. }
  55. }, {
  56. display : '牧场名称',
  57. name : 'mcmc',
  58. width : 120,
  59. sortable : false,
  60. align : 'center'
  61. }, {
  62. display : '猪舍名称',
  63. name : 'zsmc',
  64. width : 120,
  65. sortable : false,
  66. align : 'center'
  67. }, {
  68. display : '机器编号',
  69. name : 'jqid',
  70. width : 100,
  71. sortable : true,
  72. align : 'center',
  73. process : function(col, record, postion, pid) {
  74. jQuery(col).addClass('s');
  75. jQuery(col).html('<a onclick="viewWebservicexyxx(\'' + record.id + '\' ,\'' + record.jqid + '\');">' + record.jqid + '</a>');
  76. }
  77. }, {
  78. display : '命令',
  79. name : 'cmd',
  80. width : 100,
  81. sortable : false,
  82. align : 'center'
  83. },{
  84. display : '参数',
  85. name : 'cs',
  86. width : 100,
  87. sortable : false,
  88. align : 'center'
  89. }, {
  90. display : '相应时间',
  91. name : 'xysj',
  92. width : 60,
  93. sortable : false,
  94. align : 'center'
  95. }, {
  96. display : '返回值',
  97. name : 'fhz',
  98. width : 90,
  99. sortable : false,
  100. align : 'center'
  101. }, {
  102. display : '操作',
  103. name : '',
  104. width : 90,
  105. sortable : false,
  106. align : 'center',
  107. process : function(col, record, postion, pid) {
  108. jQuery(col).addClass('s');
  109. var str = '<a onclick="editWebservicexyxx(\'' + record.id + '\' ,\'' + "edit" + '\');">修改</a>&nbsp;&nbsp;&nbsp;';
  110. str += '<a onclick="disableWebservicexyxx(\''+ record.id + '\');">删除</a>';
  111. jQuery(col).html(str);
  112. }
  113. }]
  114. });
  115. }
  116. /**
  117. * 删除此条webservice响应信息
  118. * @param id
  119. */
  120. function disableWebservicexyxx(id) {
  121. Dialogs.alert("确定删除当前webservice响应信息?", {
  122. title : '提示信息',
  123. width : 250,
  124. height : 80,
  125. top : 150,
  126. button : {
  127. ok : ['确定',function(){
  128. this.close();
  129. huimv.showProcessModel('处理数据中');
  130. jQuery.ajax({
  131. url : 'disableWebservicexyxx.htm',
  132. dataType : 'json',
  133. type : 'post',
  134. cache : false,
  135. data : {"id" : id},
  136. success : function(data) {
  137. huimv.hideProcessModel();
  138. if (data.returnCode > 0) {
  139. loadWebservicexyxxList();
  140. } else {
  141. Dialogs.alert("传入参数有误!", {
  142. width : 300,
  143. height : 50
  144. });
  145. }
  146. },
  147. error : function(data) {
  148. huimv.showError(data.responseText);
  149. }
  150. });
  151. }],
  152. cancel : ['取消',function(){
  153. this.close();
  154. }]
  155. }
  156. });
  157. }
  158. /**
  159. * 编辑Webservice详细信息
  160. * @param id
  161. */
  162. function editWebservicexyxx(id,from) {
  163. Dialogs.load('editWebservicexyxx.htm', {"id" : id, "from" : from}, {
  164. // 对话框基本配置选项
  165. draggable: true,//是否拖动
  166. autosize: false,//是否自适应大小
  167. resizable: true,//是否可以改变大小
  168. maximizable: true,//是否显示最大化最小化
  169. autopos: 'fixed',// 窗口是否(自动剧中,fixed)页面 默认’fixed’
  170. title: "修改",//窗口标题
  171. lightbox: true,//窗口应用时是否禁用其他操作
  172. width: 400,//窗口宽度
  173. height: 200,//窗口高度
  174. button: {
  175. ok: ['保存',function(){
  176. saveWebservicexyxx(id);
  177. }],
  178. cancel: ['取消',function(){
  179. this.close();
  180. }]
  181. }
  182. });
  183. }
  184. loadWebservicexyxxGrid();
  185. function viewWebservicexyxx(id, jqid ) {
  186. huimv.loadPage("webserviceRight", "viewWebservicexyxx.htm", {
  187. "id" : id,
  188. "jqid" : jqid,
  189. });
  190. }