subscrib_list.jsp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  6. <title>报表订阅</title>
  7. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  8. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  9. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  10. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  11. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  12. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  13. <script type="text/javascript" src="/shares/js/constant.js"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  16. <script type="text/javascript">
  17. var grid = null;
  18. $(function() {
  19. initGrid();
  20. });
  21. function initGrid(params) {
  22. var columns = [
  23. {
  24. display : '报表类型',
  25. name : 'type_name',
  26. width : '20%'
  27. }, {
  28. display : '报表名称',
  29. name : 'report_name',
  30. width : '40%'
  31. }, {
  32. display : '是否订阅',
  33. width : '15%',
  34. render:function(row,index){
  35. var subscribe_id=row.subscribe_id;
  36. if(subscribe_id !=null){
  37. return "已订阅";
  38. }
  39. return "未订阅";
  40. }
  41. }];
  42. columns
  43. .push({
  44. display : '操作',
  45. width : '20%',
  46. isAllowHide : false,
  47. render : function(row,index) {
  48. var html = '';
  49. var subscribe_id=row.subscribe_id;
  50. if(subscribe_id !=null){
  51. html += '<a href=\"#\" onclick=\"cancelSubscribe('+ row.subscribe_id +')\">退订</a>&nbsp;';
  52. }else{
  53. html += '<a href=\"#\" onclick=\"addSubscribe('+ row.universalid +','+row.push_id+')\">订阅</a>&nbsp;';
  54. }
  55. html += '<a href=\"#\" onclick=\"view('+row.push_id+')\">查看调度</a>&nbsp;';
  56. return html;
  57. }
  58. });
  59. grid = $("#maingrid4")
  60. .ligerGrid(
  61. {
  62. columns : columns,
  63. pageSize : 20,
  64. url : 'reportSubscribAction.do?method=subscriptPageList&time=' + new Date().getTime() + params,
  65. pageParmName:'p', //页索引参数名,(提交给服务器)
  66. pagesizeParmName:'pSize', //页记录数参数名,(提交给服务器)
  67. width : '99.9%',
  68. height : '99%'
  69. });
  70. $("#pageloading").hide();
  71. }
  72. //查询
  73. function searchByKword() {
  74. var s = "";
  75. var report_name = $("#report_name").val();//
  76. if (report_name != "" && typeof (report_name) != "undefined") {
  77. s += "&report_name=" + encodeURI(encodeURI(report_name));
  78. }
  79. var type_id = $("#type_id").val();//
  80. if (type_id != "" && typeof (type_id) != "undefined") {
  81. s += "&type_id=" + type_id;
  82. }
  83. if(grid){
  84. grid.set("newPage","1");
  85. }
  86. initGrid(s);
  87. }
  88. function view(push_id){
  89. addTab('viewPush' + getCurrentTabId(), '查看调度', '${pageContext.request.contextPath }/reportPushAction.do?method=viewPush&push_id='+push_id ,true,true);
  90. }
  91. function addSubscribe(report_id,push_id){
  92. $.ajax({
  93. url:"reportSubscribAction.do?method=addSubscrib&report_id="+report_id+"&push_id="+push_id+"&time="+new Date().getTime(),
  94. type:"post",
  95. dataType:"json",
  96. success:function(data){
  97. if(data.i>0){
  98. $.ligerDialog.success("操作成功");
  99. searchByKword();
  100. }else{
  101. $.ligerDialog.error("错误:"+data.i+",操作失败");
  102. }
  103. },
  104. error:function(data){
  105. }
  106. });
  107. }
  108. function cancelSubscribe(subscribe_id){
  109. $.ajax({
  110. type:"post",
  111. url:"reportSubscribAction.do?method=cancelSubscrib&subscribe_id="+subscribe_id+"&time="+new Date().getTime(),
  112. dataType:"json",
  113. success:function(data){
  114. if(data.i>0){
  115. $.ligerDialog.success("操作成功");
  116. searchByKword();
  117. }else{
  118. $.ligerDialog.error("错误:"+data.i+",操作失败");
  119. }
  120. },
  121. error:function(data){
  122. }
  123. });
  124. }
  125. $(function() {
  126. $("#type_id").ligerComboBox();
  127. });
  128. </script>
  129. </head>
  130. <body>
  131. <%@ include file="/include/message.jsp"%>
  132. <div class="container-layout">
  133. <div id="title" class="form-button">
  134. <input type="button" class="l-button" value="关闭" onclick="closeWindow()" style="width: 90px"/>
  135. </div>
  136. <div class="default_search" style="margin: 0;">
  137. <ul class="list_search">
  138. <li class="title">报表类型:</li>
  139. <li class="text">
  140. <select id="type_id" name="type_id" >
  141. <option value="" selected="selected">-请选择-</option>
  142. <c:forEach items="${reportTypeList }" var="item">
  143. <option value="${item.universalid }" >${item.type_name }</option>
  144. </c:forEach>
  145. </select>
  146. </li>
  147. </ul>
  148. <ul class="list_search">
  149. <li class="title">报表名称:</li>
  150. <li class="text">
  151. <input type="text" name="report_name" id="report_name" />
  152. </li>
  153. </ul>
  154. <ul>
  155. <li class="search-button"><input type="button" class='l-button'
  156. name="search" onclick="searchByKword()" value="查询" /></li>
  157. </ul>
  158. </div>
  159. <div style="clear:both;"></div>
  160. <div id="searchbar">
  161. <div style="overflow: hidden; clear: both;">
  162. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  163. </div>
  164. </div>
  165. </div>
  166. </body>
  167. </html>