manhole_cover.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  5. <meta charset="utf-8">
  6. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  7. <meta content="yes" name="apple-mobile-web-app-capable">
  8. <meta content="black" name="apple-mobile-web-app-status-bar-style">
  9. <meta content="telephone=no" name="format-detection">
  10. <title>永天消防</title>
  11. </head>
  12. <link rel="stylesheet" type="text/css" href="__PUBLIC__/wxapp/css/style.css">
  13. <!--<script type="text/javascript" src="__PUBLIC__/wxapp/js/jquery-1.11.3.min.js"></script>-->
  14. <script src="__PUBLIC__/wxapp/js/lib/jquery-2.2.3.min.js"></script>
  15. <script src="__PUBLIC__/wxapp/js/lib/dropload.js"></script>
  16. <script type="text/javascript"
  17. src="__PUBLIC__/wxapp/js/jquery.mloading-master/jquery.mloading-master/src/jquery.mloading.js"></script>
  18. <body>
  19. <!--头部-->
  20. <div class="header"><a class="comblack"
  21. href="__MODULE__/ComprehensiveAlarm/index{$tokenurl}/companyid/{$companyid}"></a> 井盖监测
  22. </div>
  23. <!--内容-->
  24. <div class="content">
  25. <!--导航-->
  26. <div class="fire-alarm-title">
  27. <span onclick="tabset(this)" name="all" class="title-label select-color">全部
  28. <if condition="$wcl eq 0 ">
  29. <else/> <p>{$wcl}</p>
  30. </if>
  31. <!--<p>{$wcl}</p>-->
  32. </span>
  33. <span onclick="tabset(this)" name="untreated" class="title-label">未处理</span>
  34. <span onclick="tabset(this)" name="treated" class="title-label">已处理</span>
  35. </div>
  36. <!--选择内容-->
  37. <!-- <div class="content-bottom" id="content-data">-->
  38. <!-- </div>-->
  39. <article class="content-bottom">
  40. <section class="khfxPane" style="display:block">
  41. </section>
  42. <section class="khfxPane">
  43. </section>
  44. <section class="khfxPane">
  45. </section>
  46. </article>
  47. </div>
  48. <!--底部-->
  49. <div class="footer"></div>
  50. </body>
  51. <script type="text/javascript">
  52. // $(document).ready(function(){
  53. // $(function(){
  54. // $(".title-label").click(function(){
  55. // $("#content-data").mLoading("show");
  56. //
  57. // });
  58. // });
  59. // });
  60. var type = 'all';
  61. let load_one = function () {
  62. var page = 0;
  63. let companyid = '{$companyid}';
  64. // var name_type=document.getElementById('name_type').value
  65. $('.content-bottom').dropload({
  66. scrollArea: window,
  67. distance: 50, // 拉动距离
  68. threshold: 100, // 提前加载距离
  69. domDown: { // 下方DOM
  70. domClass: 'dropload-down',
  71. domRefresh: '',
  72. domRefresh: '',
  73. domLoad: '',
  74. domNoData: ''
  75. },
  76. loadDownFn: function (me) {
  77. // alert(me);
  78. page++;
  79. var result = '';
  80. $.ajax({
  81. url: "__MODULE__/ManholeCover/change{$tokenurl}",
  82. type: "POST",
  83. data: {
  84. type: type,
  85. companyid: companyid,
  86. page: page
  87. },
  88. dataType: "JSON",
  89. success: function (res) {
  90. console.log(res);
  91. var arr_length = res.length;
  92. result = '';
  93. if (arr_length > 0) {
  94. for (var i = 0; i < arr_length; i++) {
  95. var clzt = res[i].clzt;
  96. var clztHtml = '';
  97. if (clzt == 1) {
  98. clztHtml = '<a href="__MODULE__/Fireinfo/index{$tokenurl}/type/128/id/' + res[i].id + '">已处理</a>';
  99. } else {
  100. clztHtml = '<a class="bule" href="__MODULE__/Fireinfo/index{$tokenurl}/type/128/id/' + res[i].id + '">未处理</a>';
  101. }
  102. var device_status = '';
  103. if (res[i].device_status == 0) {
  104. device_status = '打开恢复';
  105. } else if (res[i].device_status == 1) {
  106. device_status = '打开告警';
  107. } else if (res[i].device_status == 2) {
  108. device_status = '满溢恢复';
  109. } else if (res[i].device_status == 3) {
  110. device_status = '满溢告警';
  111. }
  112. result += ''
  113. + '<div class="item-list">'
  114. + '<p>' + res[i].time + ' <span class="size" >' + device_status + '</span></p>'
  115. + '<p>' + res[i].owner_name + ''
  116. + '<span>'
  117. + clztHtml
  118. + '</span></p>'
  119. + '<p>'
  120. + device_status
  121. + '</p>'
  122. + '</div>';
  123. }
  124. ;
  125. setTimeout(function () {
  126. if (type == "all") {
  127. $('.khfxPane').eq(0).append(result);
  128. } else if (type == "untreated") {
  129. $('.khfxPane').eq(1).append(result);
  130. } else if (type == "treated") {
  131. $('.khfxPane').eq(2).append(result);
  132. }
  133. // $('#content-data').append(result);
  134. me.resetload();
  135. }, 500);
  136. // alert(page);
  137. } else {
  138. // alert("page"+page);
  139. // 锁定
  140. me.lock();
  141. // 无数据
  142. me.noData();
  143. me.resetload();
  144. }
  145. },
  146. error: function (xhr, type) {
  147. alert('Ajax error!');
  148. // 即使加载出错,也得重置
  149. me.resetload();
  150. }
  151. });
  152. }
  153. });
  154. // load_one();
  155. }
  156. //点击 tab页 切换tab页
  157. $('.khfxPane').eq(0).html("");
  158. $('.khfxPane').eq(1).html("");
  159. $('.khfxPane').eq(2).html("");
  160. // $("#content-data").mLoading("show");
  161. let tabset = function (tab) {
  162. page = 0;
  163. pageNum = 1;
  164. $('.khfxPane').eq(0).html("");
  165. $('.khfxPane').eq(1).html("");
  166. $('.khfxPane').eq(2).html("");
  167. let companyid = '{$companyid}';
  168. type = $(tab).attr("name");
  169. if (type == 'all' || tab == 'all') {
  170. type = 'all';
  171. $(tab).siblings().removeClass('select-color');
  172. $(tab).addClass('select-color');
  173. $('.khfxPane').eq(0).css("display", "block");
  174. $('.khfxPane').eq(1).css("display", "none");
  175. $('.khfxPane').eq(2).css("display", "none");
  176. // $('.khfxPane').eq(0).unlock();
  177. // $('.khfxPane').eq(0).noData(false);
  178. // dropload.lock('down');
  179. // dropload.noData();
  180. } else if (type == 'untreated') {
  181. // type = $(tab).attr("name");
  182. $(tab).siblings().removeClass('select-color');
  183. $(tab).addClass('select-color');
  184. type = 'untreated';
  185. $('.khfxPane').eq(0).css("display", "none");
  186. $('.khfxPane').eq(1).css("display", "block");
  187. $('.khfxPane').eq(2).css("display", "none");
  188. // $('.khfxPane').eq(1).unlock();
  189. // $('.khfxPane').eq(1).noData(false);
  190. } else if (type == 'treated') {
  191. type = 'treated';
  192. $(tab).siblings().removeClass('select-color');
  193. $(tab).addClass('select-color');
  194. $('.khfxPane').eq(0).css("display", "none");
  195. $('.khfxPane').eq(1).css("display", "none");
  196. $('.khfxPane').eq(2).css("display", "block");
  197. // $('.khfxPane').eq(1).unlock();
  198. // $('.khfxPane').eq(1).noData(false);
  199. }
  200. // document.getElementById("name_type").value=type;
  201. // load_two();
  202. load_one()
  203. // load_two();
  204. // load_one();
  205. //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  206. // $.post('__MODULE__/GateMagnetism/change{$tokenurl}', {'type': type, 'companyid': companyid}, function (res) {
  207. // $("#content-data").mLoading("hide");
  208. // $('#content-data').html(res);
  209. // });
  210. }
  211. // let tabset = function (tab) {
  212. // document.getElementById("content-data").innerHTML = "";
  213. // $("#content-data").mLoading("show");
  214. // let companyid = '{$companyid}';
  215. // if (tab == 'all') {
  216. // var type = 'all';
  217. // } else {
  218. // var type = $(tab).attr("name");
  219. // $(tab).siblings().removeClass('select-color');
  220. // $(tab).addClass('select-color');
  221. // }
  222. // //let index=$(".fire-alarm-title span").index(tab);获取点击的是第几个tab页
  223. // $.post('__MODULE__/ManholeCover/change{$tokenurl}', {'type': type, 'companyid': companyid}, function (res) {
  224. // $("#content-data").mLoading("hide");
  225. // $('#content-data').html(res);
  226. // });
  227. //
  228. // }
  229. tabset('all');
  230. </script>
  231. </html>