| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- {% extends "base.html" %} {% block headcss %} {% load staticfiles %}
- <html lang="en">
- <head>
- <title>预警</title>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
- <style>
- body{
- overflow: hidden;
- }
- .range-data li {
- width: 130px;
- }
- .form-group {
- display: inline-block;
- width: 160px;
- }
- .form-group label {
- margin-bottom: 0;
- }
- .users-enter-select {
- border: 1px solid #ccc;
- }
- .users-enter-select:focus {
- border-color: rgba(82, 168, 236, 0.8);
- outline: 0;
- outline: thin dotted \9;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- }
- .unusual-title,
- .enter-form,
- .users-manage-title {
- width: inherit;
- }
- .users-enter-form {
- width: inherit;
- margin-right: inherit;
- }
- #searchBtn {
- margin-left: 10px;
- }
- .form-item {
- margin-left: 30px;
- }
- .users-enter-form select {
- width: 159px;
- }
- </style>
- </head>
- <body>
- <div class="content">
- <div id="content-header">
- <h1 class="tb-fpsb" style="display: inline-block;">
- 预警
- </h1>
- <span id="">
- > 历史预警列表
- </span>
- </div>
- <div class="system-list-top">
- <ul class="range-data" style="width:330px;">
- <li>
- <i class="icon icon-link"></i>接入
- <span class="number">224</span>台</li>
- <li>
- <i class="icon icon-question-sign"></i>预警
- <span class="number">0</span>台</li>
- <li>
- <i class="icon icon-refresh"></i>运行
- <span class="number">210</span>台</li>
- <li>
- <i class="icon icon-off"></i>待机
- <span class="number">14</span>台</li>
- </ul>
- </div>
- <div class="user-manage-top">
- <form action="" method="post" id="form">
- <div class="form-item clearfix">
- <div class="users-manage-title">设备:</div>
- <div class="users-enter-form">
- <select class="users-enter-select" id="type" name="type">
- <option value="0">请选择</option>
- <option value="1">环境监测</option>
- <option value="2">杀虫灯</option>
- <option value="3">测报灯</option>
- <option value="4">农药残留</option>
- </select>
- </div>
- <div class="unusual-title">设备编号:</div>
- <div class="enter-form">
- <input type="text" name="num" value="" style="width: 145px;" />
- </div>
- <div class="users-manage-title">状态:</div>
- <div class="users-enter-form">
- <select class="users-enter-select" id="state" name="state">
- <option value="-1">请选择</option>
- <option value="0">未处理</option>
- <option value="1">已处理</option>
- </select>
- </div>
- <div class="users-manage-title">报警时间:</div>
- <div class="users-enter-form clearfix">
- <div class="riqi">
- <input type="text" id="test10" style="width: 180px;">
- <input type="hidden" id="begin" name="begin">
- <input type="hidden" id="end" name="end">
- </div>
- </div>
- <button class="btn btn-primary btn-save-cancel" id="searchBtn" type="submit">查询</button>
- <!-- <button class="btn btn-back btn-save-cancel" type="reset">清空</button> -->
- </div>
- <!-- <div class="form-item clearfix">
- <div class="unusual-title" style="display: block;width: 74px;">省市区:</div>
- <div id="distpicker5" style="display: inline-block;">
- <div class="form-group ">
- <label class="sr-only sx-title" for="province10"></label>
- <select class="form-control enter-select" id="province10"></select>
- </div>
- <div class="form-group ">
- <label class="sr-only" for="city10"></label>
- <select class="form-control enter-select" id="city10"></select>
- </div>
- <div class="form-group ">
- <label class="sr-only" for="district10"></label>
- <select class="form-control enter-select" id="district10"></select>
- </div>
- </div>
- </div> -->
- <!-- <div class="form-item clearfix" style="display: inline-block;">
- <div class="users-manage-title">报警时间:</div>
- <div class="users-enter-form02 clearfix">
- <div class="riqi">
- <input type="text" id="test10" style="width: 180px;">
- <input type="hidden" id="begin" name="begin">
- <input type="hidden" id="end" name="end">
- </div>
- </div>
- </div> -->
- </form>
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="span12">
- <div class="user-widget-box">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>设备名称</th>
- <th>设备类型</th>
- <th>设备ID</th>
- <th>报警时间</th>
- <th>报警信息</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- {% for i in alarm_record %}
- <tr>
- <td>{{ i.equip_id.equip_name }}</td>
- <td>{{ i.equip_id.equip_type.type_name }}</td>
- <td>{{ i.equip_id }}</td>
- <td>{{ i.alarm_time }}</td>
- <td>{{ i.alarm_desc }}</td>
- <td>
- <button class="btn btn-user-manage" onclick="">查看</button>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- <div class="fenpei-bottom">
- <input type="hidden" id="totalPage" value={{nums}}>
- <div id="page" style="text-align: center;"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="chuli" style="margin:20px 20px;display: none;">
- <div class="users-manage-title">处理时间:</div>
- <div class="users-enter-form">
- <input type="text" id="set" name="set" style="width:188px;" class="laydate-icon">
- </div>
- <div>
- <br>
- <br>
- </div>
- <div class="users-manage-title">处理描述:</div>
- <div class="users-enter-form">
- <textarea rows="6" id="miaoshu" style="width:300px;"></textarea>
- </div>
- <div>
- <br>
- <br>
- </div>
- <div class="users-enter-form" style="margin-left: 70px;">
- <input type="hidden" id="warningId">
- <button id="subWarn" class="btn btn-success btn-shaixuan" onclick="sub()">确定</button>
- <button id="cloWarn" class="btn btn-shaixuan" onclick="clo()">关闭</button>
- </div>
- </div>
- <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
- <script type="text/javascript">
- if ($('.content').height() > 750) {
- $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
- } else {
- $('#iframe-main', parent.document).css('height', '750px')
- }
- // var province = "";
- // loadProByCode("getDict/getProvince", "province", "", province);
- // province = parseInt(province);
- // var city = "";
- // if (province > 0) {
- // loadCityByCode("getDict/getCityByProCode",
- // "city", "", province, city);
- // }
- // city = parseInt(city);
- // if (city > 0) {
- // loadCountyByCode("getDict/getCountyByCityCode",
- // "county", "", city, "");
- // }
- // function reloadCity() {
- // var province = $("#province option:selected").val();
- // province = parseInt(province);
- // if (province > 0) {
- // loadCityByProCode("getDict/getCityByProCode",
- // "city", "", province);
- // $("#county").html("<option value='0'>无</option>");
- // } else {
- // $("#city").html("<option value='0'>无</option>");
- // $("#county").html("<option value='0'>无</option>");
- // }
- // }
- // function reloadCounty() {
- // var city = $("#city option:selected").val();
- // city = parseInt(city);
- // if (city > 0) {
- // loadCountyByCityCode("getDict/getCountyByCityCode",
- // "county", "", city);
- // } else {
- // $("#county").html("<option value='0'>无</option>");
- // }
- // }
- // $("select").select2();
- </script>
- <script type="text/javascript">
- function sub() {
- var set = $("#set").val();
- var miaoshu = $("#miaoshu").val();
- var warningId = $("#warningId").val();
- $.ajax({
- type: "post",
- url: "",
- data: {
- "set": set,
- "miaoshu": miaoshu,
- "warningId": warningId
- },
- dataType: "json",
- success: function (data) {
- if (data.err == 0) {
- layer.alert("保存成功!", function () {
- location.reload();
- });
- } else {
- layer.alert(data.msg);
- }
- }
- });
- }
- function clo() {
- layer.closeAll();
- }
- function chuli(state, id, handleTime, content) {
- if (state == 1) {//已处理
- $("#subWarn").css("display", "none");
- $("#cloWarn").css("display", "block");
- $("#miaoshu").val(content);
- $("#set").val(handleTime.substr(0, 19));
- } else {
- $("#subWarn").css("display", "block");
- $("#cloWarn").css("display", "none");
- $("#miaoshu").val("");
- $("#set").val("");
- }
- $("#warningId").val(id);
- layer.open({
- type: 1,
- title: '预警处理',
- skin: 'layui-layer-rim', //加上边框
- area: ['500px', '300px'], //宽高
- content: $("#chuli")
- });
- }
- function sel() {
- $("#state").val(-1);
- $("#type").val(0);
- $("select").select2();
- }
- </script>
- </body>
- </html>
- {% endblock headcss %}
|