equipmanage_ybq.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. {% load staticfiles %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <link href="{% static '/lib/bootstrap-3.3.7/css/bootstrap.css' %}" rel="stylesheet">
  7. <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
  8. <link rel="stylesheet" href="{% static '/lib/css/ace.min.css' %}"/>
  9. <link rel="stylesheet" href="{% static '/lib/css/ace-skins.min.css' %}">
  10. <link rel="stylesheet" href="{% static '/lib/css/ace-rtl.min.css' %}">
  11. <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
  12. <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.0" />
  13. <style type="text/css">
  14. body {
  15. overflow: hidden;
  16. background: #fff;
  17. }
  18. .searchCover {
  19. margin: 20px 0;
  20. margin-bottom: 10px;
  21. }
  22. .innerTable {
  23. padding: 0 1px 0 0;
  24. min-width: 750px;
  25. }
  26. .table,
  27. .table.table-striped>thead>tr>th {
  28. text-align: center;
  29. }
  30. table td {
  31. vertical-align: middle !important;
  32. }
  33. .nullData {
  34. width: 100%;
  35. height: 500px;
  36. background: #ddd;
  37. text-align: center;
  38. line-height: 500px;
  39. font-size: 20px;
  40. border: 1px solid #ddd;
  41. }
  42. .check,
  43. #checkAll {
  44. width: 18px;
  45. height: 19px;
  46. vertical-align: middle;
  47. margin-top: -6px;
  48. visibility: hidden;
  49. display: none;
  50. }
  51. .my_protocol input[type='checkbox']+span {
  52. cursor: pointer;
  53. width: 18px;
  54. height: 18px;
  55. background-color: red;
  56. display: inline-block;
  57. background: url(/static/img/tick.png) no-repeat center;
  58. background-position: -19px 0px;
  59. position: relative;
  60. top: 3px;
  61. border: 1px solid #bbb;
  62. }
  63. .my_protocol input[type='checkbox']:checked+span {
  64. background-position-x: 3px;
  65. background-position-y: 3px;
  66. }
  67. .controlModel{
  68. display: none;
  69. margin-bottom: 10px;
  70. background: rgb(236, 246, 255);
  71. text-align: right;
  72. padding: 10px 0;
  73. }
  74. .selectedColor{
  75. background: #faffc2;
  76. }
  77. .content{
  78. overflow-x: scroll;
  79. }
  80. .coerce{
  81. display: inline-block;
  82. width: 0;
  83. transition: all .3s;
  84. opacity: 0;
  85. height: 33px;
  86. overflow: hidden;
  87. vertical-align: middle;
  88. }
  89. .coerceBlock{
  90. width: 109px;
  91. opacity: 1;
  92. }
  93. .controlModel select,.controlModel select:focus{
  94. vertical-align: middle;
  95. border-color: #ABBAC3;
  96. }
  97. #inquireBtn,#operationBtn{
  98. height: 30px;
  99. line-height: 20px;
  100. }
  101. </style>
  102. <body>
  103. <div class="content">
  104. <div class="searchCover">
  105. 开关状态:
  106. <select class="enter-select " name="openState" id="eswitch">
  107. <option selected="selected" value="-1">请选择</option>
  108. <option value="1">开启</option>
  109. <option value="0">关闭</option>
  110. </select>
  111. 设备名称:
  112. <input type="text" value="" class="fp-user" id="ename" placeholder="请输入设备名称" onkeypress="if (event.keyCode == 13) sub_filter();" /> 设备ID:
  113. <input type="text" value="" id="eId" placeholder="请输入设备ID" onkeypress="if (event.keyCode == 13) sub_filter();" />
  114. <button type="button" onclick="sub_filter()" class="btn btn-sm btn-primary">筛选</button>
  115. </div>
  116. <div class="controlModel">
  117. <!-- 全局定时控制 -->
  118. <span>
  119. <img src="{% static '/img/timingIcon.png' %}" style="width: 19px;" alt="定时">
  120. </span>
  121. <select class="worktime-select" id="state" onchange="timing($(this))">
  122. <OPTION>定时时长</OPTION>
  123. <OPTION value="0">常亮</OPTION>
  124. <OPTION value="1">1小时</OPTION>
  125. <OPTION value="2">2小时</OPTION>
  126. <OPTION value="3">3小时</OPTION>
  127. <OPTION value="4">4小时</OPTION>
  128. <OPTION value="5">5小时</OPTION>
  129. <OPTION value="6">6小时</OPTION>
  130. <OPTION value="7">7小时</OPTION>
  131. </select>
  132. <!-- 设备开关 -->
  133. <span>
  134. <img src="{% static '/img/switchBtnIcon.png' %}" style="width: 21px;" alt="开关">
  135. </span>
  136. <select class="worktime-select" id="switchBtn" onchange="SetSwitch($(this))">
  137. <OPTION>设备开关</OPTION>
  138. <OPTION value="1">开启</OPTION>
  139. <OPTION value="0">关闭</OPTION>
  140. </select>
  141. <button class="btn btn-white btn-sm btn-default" id="inquireBtn" onclick="reloadPage()">
  142. <i class="ace-icon fa fa-search"></i>
  143. 查询
  144. </button>
  145. <button class="btn btn-white btn-sm btn-default" id="operationBtn" onclick="coerceshow(this)">
  146. <i class="ace-icon fa fa-cog"></i>
  147. 设置
  148. </button>
  149. <div class="coerce">
  150. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('升级','ctrl','update')">升级</button>
  151. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启','ctrl','reboot')">重启</button>
  152. </div>
  153. </div>
  154. <div class="innerTable">
  155. <table id="datatable" class="table table-striped table-hover">
  156. <thead>
  157. <tr>
  158. <th>
  159. <div style="position:relative">
  160. <label class="my_protocol">
  161. <input type="checkbox" onchange="checkAll($(this))" id="checkAll" name="title-table-checkbox" />
  162. <span></span>
  163. </label>
  164. </div>
  165. </th>
  166. <th>设备ID</th>
  167. <th>设备名称</th>
  168. <th>在线状态</th>
  169. <th>设备开关</th>
  170. <th>工作状态</th>
  171. <!-- <th>定时模式</th> -->
  172. <th>定时时长</th>
  173. <th>灯管状态</th>
  174. <th>光控状态</th>
  175. <th>雨控状态</th>
  176. <th>温控状态</th>
  177. <th>倾倒状态</th>
  178. <th>信号强度</th>
  179. <th>设备版本</th>
  180. <th>上报时间</th>
  181. <!-- <th>详情</th> -->
  182. </tr>
  183. </thead>
  184. <tbody>
  185. </tbody>
  186. </table>
  187. <div class="fenpei-bottom">
  188. <input type="hidden" id="totalPage" value={{ nums }}>
  189. <div id="page" style="text-align: center;"></div>
  190. </div>
  191. </div>
  192. </div>
  193. <!-- 配置模态框 -->
  194. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  195. <div class="modal-dialog" role="document">
  196. <div class="modal-content">
  197. <div class="modal-header">
  198. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  199. <span aria-hidden="true">&times;</span>
  200. </button>
  201. <h4 class="modal-title" id="myModalLabel">配置</h4>
  202. </div>
  203. <div class="modal-body">
  204. <div class="clearfix">
  205. <div class="fl modelTitle">定时模式:</div>
  206. <div class="fl modeBody">
  207. <select name="" id="clock">
  208. <option value="0">光控</option>
  209. <option value="1">时控</option>
  210. </select>
  211. </div>
  212. </div>
  213. <div class="clearfix" id="durationParent">
  214. <div class="fl modelTitle">定时时长:</div>
  215. <div class="fl modeBody">
  216. <select name="" id="duration">
  217. <option value="0">常亮</option>
  218. <option value="1">1小时</option>
  219. <option value="2">2小时</option>
  220. <option value="3">3小时</option>
  221. <option value="4">4小时</option>
  222. <option value="5">5小时</option>
  223. <option value="6">6小时</option>
  224. <option value="7">7小时</option>
  225. </select>
  226. </div>
  227. </div>
  228. <div class="clearfix" id="timeHourParent">
  229. <div class="fl modelTitle">定时时间:</div>
  230. <div class="fl modeBody">
  231. <div class="enter-form layui-input-inline">
  232. <input type="text" class="layui-input" class="laydate-icon" id="timSelectBox" placeholder="请选择时间段 ">
  233. <input type="hidden" value="00:00:00" id="begin">
  234. <input type="hidden" value="00:00:00" id="end">
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. <div class="modal-footer">
  240. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  241. <button type="button" class="btn btn-primary" id="saveMode" onclick="saveMode()">保存</button>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. <!-- loading -->
  247. <div id="loadingParent">
  248. <div id="loadCenter">
  249. <div class="skype-loader">
  250. <div class="dot">
  251. <div class="first"></div>
  252. </div>
  253. <div class="dot"></div>
  254. <div class="dot"></div>
  255. <div class="dot"></div>
  256. </div>
  257. Logging in...
  258. </div>
  259. </div>
  260. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  261. <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
  262. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  263. <script src="{% static '/js/common.js' %}?versions=0.5.0"></script>
  264. <script type="text/javascript">
  265. $.ajaxSetup({
  266. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  267. });
  268. var parentUserName = $('#parentUserName', parent.document).html();
  269. if (!(parentUserName == 'admin' || parentUserName == 'user')) {
  270. $('#operationBtn').remove();
  271. $('.coerce').remove();
  272. }
  273. </script>
  274. <script src="{% static '/js/equipmanage/equipmanage_ybq.js' %}?versions=0.5.0" type="text/javascript"></script>
  275. </body>
  276. </html>