alarm_history.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. {% extends "base.html" %} {% block headcss %} {% load staticfiles %}
  2. <html lang="en">
  3. <head>
  4. <title>预警</title>
  5. <meta charset="UTF-8" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
  8. <style>
  9. body{
  10. overflow: hidden;
  11. }
  12. .range-data li {
  13. width: 130px;
  14. }
  15. .form-group {
  16. display: inline-block;
  17. width: 160px;
  18. }
  19. .form-group label {
  20. margin-bottom: 0;
  21. }
  22. .users-enter-select {
  23. border: 1px solid #ccc;
  24. }
  25. .users-enter-select:focus {
  26. border-color: rgba(82, 168, 236, 0.8);
  27. outline: 0;
  28. outline: thin dotted \9;
  29. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  30. -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  31. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  32. }
  33. .unusual-title,
  34. .enter-form,
  35. .users-manage-title {
  36. width: inherit;
  37. }
  38. .users-enter-form {
  39. width: inherit;
  40. margin-right: inherit;
  41. }
  42. #searchBtn {
  43. margin-left: 10px;
  44. }
  45. .form-item {
  46. margin-left: 30px;
  47. }
  48. .users-enter-form select {
  49. width: 159px;
  50. }
  51. </style>
  52. </head>
  53. <body>
  54. <div class="content">
  55. <div id="content-header">
  56. <h1 class="tb-fpsb" style="display: inline-block;">
  57. 预警
  58. </h1>
  59. <span id="">
  60. > 历史预警列表
  61. </span>
  62. </div>
  63. <div class="system-list-top">
  64. <ul class="range-data" style="width:330px;">
  65. <li>
  66. <i class="icon icon-link"></i>接入
  67. <span class="number">224</span>台</li>
  68. <li>
  69. <i class="icon icon-question-sign"></i>预警
  70. <span class="number">0</span>台</li>
  71. <li>
  72. <i class="icon icon-refresh"></i>运行
  73. <span class="number">210</span>台</li>
  74. <li>
  75. <i class="icon icon-off"></i>待机
  76. <span class="number">14</span>台</li>
  77. </ul>
  78. </div>
  79. <div class="user-manage-top">
  80. <form action="" method="post" id="form">
  81. <div class="form-item clearfix">
  82. <div class="users-manage-title">设备:</div>
  83. <div class="users-enter-form">
  84. <select class="users-enter-select" id="type" name="type">
  85. <option value="0">请选择</option>
  86. <option value="1">环境监测</option>
  87. <option value="2">杀虫灯</option>
  88. <option value="3">测报灯</option>
  89. <option value="4">农药残留</option>
  90. </select>
  91. </div>
  92. <div class="unusual-title">设备编号:</div>
  93. <div class="enter-form">
  94. <input type="text" name="num" value="" style="width: 145px;" />
  95. </div>
  96. <div class="users-manage-title">状态:</div>
  97. <div class="users-enter-form">
  98. <select class="users-enter-select" id="state" name="state">
  99. <option value="-1">请选择</option>
  100. <option value="0">未处理</option>
  101. <option value="1">已处理</option>
  102. </select>
  103. </div>
  104. <div class="users-manage-title">报警时间:</div>
  105. <div class="users-enter-form clearfix">
  106. <div class="riqi">
  107. <input type="text" id="test10" style="width: 180px;">
  108. <input type="hidden" id="begin" name="begin">
  109. <input type="hidden" id="end" name="end">
  110. </div>
  111. </div>
  112. <button class="btn btn-primary btn-save-cancel" id="searchBtn" type="submit">查询</button>
  113. <!-- <button class="btn btn-back btn-save-cancel" type="reset">清空</button> -->
  114. </div>
  115. <!-- <div class="form-item clearfix">
  116. <div class="unusual-title" style="display: block;width: 74px;">省市区:</div>
  117. <div id="distpicker5" style="display: inline-block;">
  118. <div class="form-group ">
  119. <label class="sr-only sx-title" for="province10"></label>
  120. <select class="form-control enter-select" id="province10"></select>
  121. </div>
  122. <div class="form-group ">
  123. <label class="sr-only" for="city10"></label>
  124. <select class="form-control enter-select" id="city10"></select>
  125. </div>
  126. <div class="form-group ">
  127. <label class="sr-only" for="district10"></label>
  128. <select class="form-control enter-select" id="district10"></select>
  129. </div>
  130. </div>
  131. </div> -->
  132. <!-- <div class="form-item clearfix" style="display: inline-block;">
  133. <div class="users-manage-title">报警时间:</div>
  134. <div class="users-enter-form02 clearfix">
  135. <div class="riqi">
  136. <input type="text" id="test10" style="width: 180px;">
  137. <input type="hidden" id="begin" name="begin">
  138. <input type="hidden" id="end" name="end">
  139. </div>
  140. </div>
  141. </div> -->
  142. </form>
  143. <div class="container-fluid">
  144. <div class="row-fluid">
  145. <div class="span12">
  146. <div class="user-widget-box">
  147. <table class="table table-striped">
  148. <thead>
  149. <tr>
  150. <th>设备名称</th>
  151. <th>设备类型</th>
  152. <th>设备ID</th>
  153. <th>报警时间</th>
  154. <th>报警信息</th>
  155. <th>操作</th>
  156. </tr>
  157. </thead>
  158. <tbody>
  159. {% for i in alarm_record %}
  160. <tr>
  161. <td>{{ i.equip_id.equip_name }}</td>
  162. <td>{{ i.equip_id.equip_type.type_name }}</td>
  163. <td>{{ i.equip_id }}</td>
  164. <td>{{ i.alarm_time }}</td>
  165. <td>{{ i.alarm_desc }}</td>
  166. <td>
  167. <button class="btn btn-user-manage" onclick="">查看</button>
  168. </td>
  169. </tr>
  170. {% endfor %}
  171. </tbody>
  172. </table>
  173. <div class="fenpei-bottom">
  174. <input type="hidden" id="totalPage" value={{nums}}>
  175. <div id="page" style="text-align: center;"></div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. <div id="chuli" style="margin:20px 20px;display: none;">
  184. <div class="users-manage-title">处理时间:</div>
  185. <div class="users-enter-form">
  186. <input type="text" id="set" name="set" style="width:188px;" class="laydate-icon">
  187. </div>
  188. <div>
  189. <br>
  190. <br>
  191. </div>
  192. <div class="users-manage-title">处理描述:</div>
  193. <div class="users-enter-form">
  194. <textarea rows="6" id="miaoshu" style="width:300px;"></textarea>
  195. </div>
  196. <div>
  197. <br>
  198. <br>
  199. </div>
  200. <div class="users-enter-form" style="margin-left: 70px;">
  201. <input type="hidden" id="warningId">
  202. <button id="subWarn" class="btn btn-success btn-shaixuan" onclick="sub()">确定</button>
  203. <button id="cloWarn" class="btn btn-shaixuan" onclick="clo()">关闭</button>
  204. </div>
  205. </div>
  206. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  207. <script type="text/javascript">
  208. if ($('.content').height() > 750) {
  209. $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
  210. } else {
  211. $('#iframe-main', parent.document).css('height', '750px')
  212. }
  213. // var province = "";
  214. // loadProByCode("getDict/getProvince", "province", "", province);
  215. // province = parseInt(province);
  216. // var city = "";
  217. // if (province > 0) {
  218. // loadCityByCode("getDict/getCityByProCode",
  219. // "city", "", province, city);
  220. // }
  221. // city = parseInt(city);
  222. // if (city > 0) {
  223. // loadCountyByCode("getDict/getCountyByCityCode",
  224. // "county", "", city, "");
  225. // }
  226. // function reloadCity() {
  227. // var province = $("#province option:selected").val();
  228. // province = parseInt(province);
  229. // if (province > 0) {
  230. // loadCityByProCode("getDict/getCityByProCode",
  231. // "city", "", province);
  232. // $("#county").html("<option value='0'>无</option>");
  233. // } else {
  234. // $("#city").html("<option value='0'>无</option>");
  235. // $("#county").html("<option value='0'>无</option>");
  236. // }
  237. // }
  238. // function reloadCounty() {
  239. // var city = $("#city option:selected").val();
  240. // city = parseInt(city);
  241. // if (city > 0) {
  242. // loadCountyByCityCode("getDict/getCountyByCityCode",
  243. // "county", "", city);
  244. // } else {
  245. // $("#county").html("<option value='0'>无</option>");
  246. // }
  247. // }
  248. // $("select").select2();
  249. </script>
  250. <script type="text/javascript">
  251. function sub() {
  252. var set = $("#set").val();
  253. var miaoshu = $("#miaoshu").val();
  254. var warningId = $("#warningId").val();
  255. $.ajax({
  256. type: "post",
  257. url: "",
  258. data: {
  259. "set": set,
  260. "miaoshu": miaoshu,
  261. "warningId": warningId
  262. },
  263. dataType: "json",
  264. success: function (data) {
  265. if (data.err == 0) {
  266. layer.alert("保存成功!", function () {
  267. location.reload();
  268. });
  269. } else {
  270. layer.alert(data.msg);
  271. }
  272. }
  273. });
  274. }
  275. function clo() {
  276. layer.closeAll();
  277. }
  278. function chuli(state, id, handleTime, content) {
  279. if (state == 1) {//已处理
  280. $("#subWarn").css("display", "none");
  281. $("#cloWarn").css("display", "block");
  282. $("#miaoshu").val(content);
  283. $("#set").val(handleTime.substr(0, 19));
  284. } else {
  285. $("#subWarn").css("display", "block");
  286. $("#cloWarn").css("display", "none");
  287. $("#miaoshu").val("");
  288. $("#set").val("");
  289. }
  290. $("#warningId").val(id);
  291. layer.open({
  292. type: 1,
  293. title: '预警处理',
  294. skin: 'layui-layer-rim', //加上边框
  295. area: ['500px', '300px'], //宽高
  296. content: $("#chuli")
  297. });
  298. }
  299. function sel() {
  300. $("#state").val(-1);
  301. $("#type").val(0);
  302. $("select").select2();
  303. }
  304. </script>
  305. </body>
  306. </html>
  307. {% endblock headcss %}