sex_trap_detail1.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  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 '/lib/css/jquery-ui.css' %}" />
  13. <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.0" />
  14. <style type="text/css">
  15. body {
  16. overflow: hidden;
  17. background: #fff;
  18. }
  19. /* 返回 */
  20. .headerPlace {
  21. font-size: 22px;
  22. color: #418fbb;
  23. cursor: pointer;
  24. }
  25. .headerPlace img {
  26. vertical-align: middle;
  27. margin-right: 10px;
  28. margin-top: -4px;
  29. }
  30. /* 设备信息 */
  31. .userinfo .fa {
  32. font-size: 18px;
  33. color: #26b3ff;
  34. margin: 0px 5px;
  35. }
  36. .ui-slider .ui-slider-handle {
  37. width: 1.4em;
  38. height: 1.4em;
  39. border-radius: 50%;
  40. }
  41. .ui-slider {
  42. background: #fff;
  43. }
  44. .userinfoTitle {
  45. margin-right: 30px;
  46. font-size: 16px;
  47. }
  48. /* 右侧操作按钮 */
  49. .refresh {
  50. text-align: right;
  51. }
  52. .refresh button {
  53. padding: 2px 5px;
  54. border-radius: 5px;
  55. }
  56. /* 设备信息条 */
  57. .equipBorder {
  58. border: 1px solid #e8e8e8;
  59. box-shadow: 0px 0px 13px 0px #d9d9d9;
  60. margin: 10px;
  61. border-radius: 5px;
  62. }
  63. .equipInfo .equipItem {
  64. display: flex;
  65. align-items: center;
  66. justify-content: center;
  67. }
  68. .equipInfo .equipItem:after {
  69. position: absolute;
  70. content: "";
  71. right: 0;
  72. height: 30px;
  73. border-right: 1px solid #cdcdcd;
  74. }
  75. .haloParent {
  76. position: relative;
  77. width: 100px;
  78. height: 100px;
  79. }
  80. .equipInfo .txt {
  81. text-align: center;
  82. font-size: 16px;
  83. }
  84. .equipInfo .txt p {
  85. color: #b6b6b6;
  86. letter-spacing: 1px;
  87. }
  88. .halo {
  89. width: 100px;
  90. height: 100px;
  91. border-radius: 50%;
  92. }
  93. .solidCircle {
  94. position: absolute;
  95. left: 50%;
  96. top: 50%;
  97. margin-top: -25px;
  98. margin-left: -25px;
  99. width: 50px;
  100. height: 50px;
  101. /* background: blue; */
  102. text-align: center;
  103. line-height: 50px;
  104. border-radius: 50%;
  105. }
  106. .halo1 {
  107. animation: anihalo1 2s 3s infinite;
  108. }
  109. .solidCircle1 {
  110. background: #ec6b6b;
  111. }
  112. @keyframes anihalo1 {
  113. 0% {
  114. background: #f8b2b2;
  115. transform: scale(.3);
  116. opacity: 0
  117. }
  118. 20% {
  119. background: #ec6b6b;
  120. transform: scale(.5);
  121. opacity: .5
  122. }
  123. 100% {
  124. background: #ec6b6b;
  125. transform: scale(.8);
  126. opacity: 0
  127. }
  128. }
  129. .halo2 {
  130. animation: anihalo2 2s 3s infinite;
  131. }
  132. .solidCircle2 {
  133. background: #6baeec;
  134. }
  135. @keyframes anihalo2 {
  136. 0% {
  137. background: #9ecaf3;
  138. transform: scale(.3);
  139. opacity: 0
  140. }
  141. 20% {
  142. background: #6baeec;
  143. transform: scale(.5);
  144. opacity: .5
  145. }
  146. 100% {
  147. background: #6baeec;
  148. transform: scale(.8);
  149. opacity: 0
  150. }
  151. }
  152. .halo3 {
  153. animation: anihalo3 2s 3s infinite;
  154. }
  155. .solidCircle3 {
  156. background: #f4bb0e;
  157. }
  158. @keyframes anihalo3 {
  159. 0% {
  160. background: #fce49e;
  161. transform: scale(.3);
  162. opacity: 0
  163. }
  164. 20% {
  165. background: #f4bb0e;
  166. transform: scale(.5);
  167. opacity: .5
  168. }
  169. 100% {
  170. background: #f4bb0e;
  171. transform: scale(.8);
  172. opacity: 0
  173. }
  174. }
  175. .halo4 {
  176. animation: anihalo4 2s 3s infinite;
  177. }
  178. .solidCircle4 {
  179. background: #4ddc75;
  180. }
  181. @keyframes anihalo4 {
  182. 0% {
  183. background: #9ee4b2;
  184. transform: scale(.3);
  185. opacity: 0
  186. }
  187. 20% {
  188. background: #4ddc75;
  189. transform: scale(.5);
  190. opacity: .5
  191. }
  192. 100% {
  193. background: #4ddc75;
  194. transform: scale(.8);
  195. opacity: 0
  196. }
  197. }
  198. .halo5 {
  199. animation: anihalo5 2s 3s infinite;
  200. }
  201. .solidCircle5 {
  202. background: #c279d4;
  203. }
  204. @keyframes anihalo5 {
  205. 0% {
  206. background: #d5b4df;
  207. transform: scale(.3);
  208. opacity: 0
  209. }
  210. 20% {
  211. background: #c279d4;
  212. transform: scale(.5);
  213. opacity: .5
  214. }
  215. 100% {
  216. background: #c279d4;
  217. transform: scale(.8);
  218. opacity: 0
  219. }
  220. }
  221. .halo6 {
  222. animation: anihalo6 2s 3s infinite;
  223. }
  224. .solidCircle6 {
  225. background: #ff7e00;
  226. }
  227. @keyframes anihalo6 {
  228. 0% {
  229. background: #f1caa2;
  230. transform: scale(.3);
  231. opacity: 0
  232. }
  233. 20% {
  234. background: #ff7e00;
  235. transform: scale(.5);
  236. opacity: .5
  237. }
  238. 100% {
  239. background: #ff7e00;
  240. transform: scale(.8);
  241. opacity: 0
  242. }
  243. }
  244. /* 设备内容 左图+右数据*/
  245. /* left */
  246. .paddingLeft {
  247. padding-right: 0;
  248. }
  249. .equipImg {
  250. height: 500px;
  251. background: #d9d9d9 url(./static/img/sexEquip.png) no-repeat center;
  252. background-size: auto 100%;
  253. }
  254. /* right */
  255. .paddingRight {
  256. padding-left: 0;
  257. }
  258. .equipRightData {
  259. display: flex;
  260. justify-content: space-around;
  261. align-items: center;
  262. }
  263. /* -----------svg环形图----------- */
  264. .chart {
  265. position: relative;
  266. display: inline-block;
  267. width: 120px;
  268. height: 120px;
  269. margin-top: 12px;
  270. margin-bottom: 12px;
  271. text-align: center;
  272. }
  273. .chart canvas {
  274. position: absolute;
  275. top: 0;
  276. left: 0;
  277. }
  278. .percent {
  279. display: block;
  280. line-height: 30px;
  281. z-index: 2;
  282. margin-top: 25%;
  283. }
  284. /* .percent:after {
  285. content: '';
  286. margin-left: 0.1em;
  287. font-size: .8em;
  288. } */
  289. .percent1 {
  290. display: block;
  291. line-height: 30px;
  292. z-index: 2;
  293. }
  294. /* -----------结束----------- */
  295. .equipPara {
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. padding: 13px 0;
  300. }
  301. .equipPara>img {
  302. width: 76px;
  303. }
  304. .equipPara>div {
  305. min-width: 90px;
  306. line-height: 24px;
  307. font-size: 16px;
  308. padding-left: 20px;
  309. }
  310. .equipPara>div p:nth-child(2) {
  311. color: #b6b6b6;
  312. }
  313. /* 控制类 */
  314. input[type=checkbox].ace.ace-switch.ace-switch-5+.lbl::before {
  315. content: "开\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a关";
  316. }
  317. .timeCtrl {
  318. width: 25%;
  319. }
  320. .ctrlTitle {
  321. border-left: 3px solid #26b3ff;
  322. padding-left: 10px;
  323. font-size: 16px;
  324. font-weight: 700;
  325. margin: 22px 0;
  326. }
  327. /* 滑块 */
  328. .SliderBox {
  329. display: flex;
  330. align-items: center;
  331. }
  332. .SliderBox span {
  333. width: 100px;
  334. text-align: center;
  335. }
  336. .collocateBtn {
  337. margin: 20px;
  338. text-align: right;
  339. }
  340. @media screen and (max-width: 990px) {
  341. .col-xs-12.paddingLeft {
  342. padding-right: 15px;
  343. }
  344. .col-xs-12.paddingRight {
  345. padding-left: 15px;
  346. }
  347. }
  348. /* 设置诱芯 */
  349. .authInp {
  350. margin: 0 0 0 20px;
  351. }
  352. </style>
  353. </head>
  354. <body>
  355. <div class="content">
  356. <!-- <a href="tencent://message/?uin=1289853582&Site=sc.chinaz.com&Menu=yes">tencent咨询</a> -->
  357. <div class="page-header">
  358. <span class="headerPlace" onclick="back()">
  359. <img src="{% static '/img/gobackIcon.png' %}" alt="">返回
  360. </span>
  361. </div>
  362. <div class="userinfocover">
  363. <div class="row ">
  364. <div class="col-xs-8 userinfo">
  365. <i class="fa fa-user-o" aria-hidden="true"></i>
  366. 设备ID:
  367. <span class="userinfoTitle" id="equip_id"></span>
  368. 设备名称:
  369. <span class="userinfoTitle" id="equip_name"></span>
  370. 上报时间:
  371. <span class="userinfoTitle" id="upl_time"></span>
  372. 位置:
  373. <span class="userinfoTitle" id="curr_area"></span>
  374. </div>
  375. <div class="col-xs-4 refresh">
  376. <button class="btn btn-sm btn-info" onclick='sendexamineSIM()'>
  377. <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
  378. SIM卡查询
  379. </button>
  380. {% if role == "superuser" %}
  381. <button type="button" class="btn btn-sm btn-primary" onclick="settingCore()">设置诱芯</button>
  382. {% endif %}
  383. <button type="button" class="btn btn-sm btn-success" onclick="reloadPage()">刷新</button>
  384. <button type="button" class="btn btn-sm btn-primary" id="operationBtn" onclick="debugFun()">调试</button>
  385. <button type="button" class="btn btn-sm btn-primary" id="operationBtn" onclick="operation()">操作</button>
  386. </div>
  387. </div>
  388. <!-- 用户调试权限 -->
  389. <div id="debugHandleBtns" style="display:none">
  390. <div style="padding: 20px; background-color: #F2F2F2;" id="">
  391. <div class="layui-row layui-col-space15">
  392. <div class="layui-col-md12">
  393. <div class="layui-card">
  394. <!-- <div class="layui-card-header">强制操作</div> -->
  395. <div class="layui-card-body">
  396. <div style="margin-bottom: 10px;">
  397. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('开启设备','ds1')">开启</button>
  398. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('关闭设备','ds0')">关闭</button>
  399. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启','reboot')">重启</button>
  400. <button type="button" class="btn btn-sm btn-danger"
  401. onclick="popupFrame('清网','clearnet')">清网</button>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. <!-- 管理员操作权限 -->
  410. <div id="handleBtns" style="display:none">
  411. <div style="padding: 20px; background-color: #F2F2F2;" id="">
  412. <div class="layui-row layui-col-space15">
  413. <div class="layui-col-md12">
  414. <div class="layui-card">
  415. <div class="layui-card-header">强制操作</div>
  416. <div class="layui-card-body">
  417. <div style="margin-bottom: 10px;">
  418. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('开启设备','ds1')">开启</button>
  419. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('关闭设备','ds0')">关闭</button>
  420. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启','reboot')">重启</button>
  421. <button type="button" class="btn btn-sm btn-danger"
  422. onclick="popupFrame('清网','clearnet')">清网</button>
  423. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('升级','update')">升级</button>
  424. </div>
  425. <div style="margin-bottom: 10px;">
  426. <button type="button" class="btn btn-sm btn-danger"
  427. onclick="popupFrame('查询服务器配置','serverconf')">查询服务器配置</button>
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>
  434. </div>
  435. <div class="equipBorder">
  436. <div class="row equipInfo">
  437. <div class="col-xs-4 col-md-2">
  438. <div class="equipItem">
  439. <div class="haloParent">
  440. <div class="halo halo1"></div>
  441. <div class="solidCircle solidCircle1">
  442. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus1.png' %}" alt="">
  443. </div>
  444. </div>
  445. <div class="txt">
  446. <span class="typeResult" id="equip_ds">开</span>
  447. <p class="typeResult">开机状态</p>
  448. </div>
  449. </div>
  450. </div>
  451. <div class="col-xs-4 col-md-2">
  452. <div class="equipItem">
  453. <div class="haloParent">
  454. <div class="halo halo2"></div>
  455. <div class="solidCircle solidCircle2">
  456. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus2.png' %}" alt="">
  457. </div>
  458. </div>
  459. <div class="txt">
  460. <span class="typeResult" id="equip_ws">正常</span>
  461. <p class="typeResult">工作状态</p>
  462. </div>
  463. </div>
  464. </div>
  465. <div class="col-xs-4 col-md-2">
  466. <div class="equipItem">
  467. <div class="haloParent">
  468. <div class="halo halo3"></div>
  469. <div class="solidCircle solidCircle3">
  470. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus3.png' %}" alt="">
  471. </div>
  472. </div>
  473. <div class="txt">
  474. <span class="typeResult" id="equip_cbs">正常</span>
  475. <p class="typeResult">充电状态</p>
  476. </div>
  477. </div>
  478. </div>
  479. <div class="col-xs-4 col-md-2">
  480. <div class="equipItem">
  481. <div class="haloParent">
  482. <div class="halo halo4"></div>
  483. <div class="solidCircle solidCircle4">
  484. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus4.png' %}" alt="">
  485. </div>
  486. </div>
  487. <div class="txt">
  488. <span class="typeResult" id="equip_rps">正常</span>
  489. <p class="typeResult">雨控状态</p>
  490. </div>
  491. </div>
  492. </div>
  493. <div class="col-xs-4 col-md-2">
  494. <div class="equipItem">
  495. <div class="haloParent">
  496. <div class="halo halo5"></div>
  497. <div class="solidCircle solidCircle5">
  498. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus5.png' %}" alt="">
  499. </div>
  500. </div>
  501. <div class="txt">
  502. <span class="typeResult" id="equip_tps">正常</span>
  503. <p class="typeResult">温控状态</p>
  504. </div>
  505. </div>
  506. </div>
  507. <div class="col-xs-4 col-md-2">
  508. <div class="equipItem">
  509. <div class="haloParent">
  510. <div class="halo halo6"></div>
  511. <div class="solidCircle solidCircle6">
  512. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus6.png' %}" alt="">
  513. </div>
  514. </div>
  515. <div class="txt">
  516. <span class="typeResult" id="equip_dps">正常</span>
  517. <p class="typeResult">倾倒状态</p>
  518. </div>
  519. </div>
  520. </div>
  521. </div>
  522. </div>
  523. <div class="row">
  524. <div class=" col-xs-12 col-md-4 paddingLeft">
  525. <div class="equipBorder equipImg"></div>
  526. </div>
  527. <div class="col-xs-12 col-md-8 paddingRight">
  528. <div class="equipBorder equipRight">
  529. <div class="equipRightData">
  530. <div>
  531. <span class="chart chart1" data-percent="">
  532. <span class="percent">3</span>
  533. <span class="percent1">充电电压(V)</span>
  534. </span>
  535. </div>
  536. <div>
  537. <span class="chart chart2" data-percent="">
  538. <span class="percent">3</span>
  539. <span class="percent1">电池电压(V)</span>
  540. </span>
  541. </div>
  542. <div>
  543. <span class="chart chart3" data-percent="">
  544. <span class="percent">3</span>
  545. <span class="percent1">环境温度(°C)</span>
  546. </span>
  547. </div>
  548. <div>
  549. <span class="chart chart4" data-percent="">
  550. <span class="percent">3</span>
  551. <span class="percent1">环境湿度(RH)</span>
  552. </span>
  553. </div>
  554. <div>
  555. <span class="chart chart5" data-percent="">
  556. <span class="percent">3</span>
  557. <span class="percent1">红外计数值</span>
  558. </span>
  559. </div>
  560. <!-- <div>
  561. <span class="chart chart6" data-percent="">
  562. <span class="percent">3</span>
  563. <span class="percent1">高压计数值</span>
  564. </span>
  565. </div> -->
  566. </div>
  567. </div>
  568. <!-- 右下部 -->
  569. <div class="row">
  570. <div class="col-xs-12">
  571. <div class="col-xs-3 paddingLeft paddingRight">
  572. <div class="equipBorder equipPara">
  573. <img src="{% static '/img/sex_trap/fx.png' %}" alt="">
  574. <div>
  575. <p id="wind_drec">南</p>
  576. <p>风向</p>
  577. </div>
  578. </div>
  579. <div class="equipBorder equipPara">
  580. <img src="{% static '/img/sex_trap/fs.png' %}" alt="">
  581. <div>
  582. <p id="wind_sped">南</p>
  583. <p>风速(M/S)</p>
  584. </div>
  585. </div>
  586. <!-- <div class="equipBorder equipPara">
  587. <img src="{% static '/img/sex_trap/chq.png' %}" alt="">
  588. <div>
  589. <p id="bt_ct">南</p>
  590. <p>重启次数</p>
  591. </div>
  592. </div> -->
  593. </div>
  594. <div class="col-xs-9 paddingLeft paddingRight">
  595. <div class="equipBorder">
  596. <div style="padding: 0 20px;">
  597. <div class="ctrlTitle">
  598. 时控开关
  599. <label class="pull-right inline">
  600. <input id="id-button-borders" type="checkbox" class="ace ace-switch ace-switch-5" />
  601. <span class="lbl middle"></span>
  602. </label>
  603. </div>
  604. <div>
  605. <span>时控开始和结束时间:</span>
  606. <select class="timeCtrl" name="" id="startTime"></select>
  607. --
  608. <select class="timeCtrl" name="" id="endTime"></select>
  609. </div>
  610. <div class="ctrlTitle">
  611. 数据上传时间间隔
  612. </div>
  613. <div>
  614. <div class="SliderBox">
  615. <span class="initVal">1</span>
  616. <div class="slider" id="dtlDropTime-slider"></div>
  617. <span class="sliderVal" id="dtlDropTime">60</span>
  618. </div>
  619. </div>
  620. <div class="collocateBtn">
  621. <button type="button" class="btn btn-white btn-primary" onclick="openNewPage()">查看历史数据</button>
  622. </div>
  623. </div>
  624. </div>
  625. </div>
  626. </div>
  627. </div>
  628. </div>
  629. </div>
  630. </div>
  631. <!-- <input type="hidden" value="{{equip_id}}" id="imei"> -->
  632. <!-- <input type="hidden" value="" id="iccid"> -->
  633. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  634. <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
  635. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  636. <script type="text/javascript"
  637. src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
  638. <script src="{% static '/js/common.js' %}?versions=0.5.0"></script>
  639. <!-- <script src="{% static '/assets/js/ace.min.js' %}"></script> -->
  640. <!-- <script src="{% static '/lib/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script> -->
  641. <!-- <script src="{% static '/lib/js/main.js' %}" type="text/javascript" charset="utf-8"></script> -->
  642. <script src="{% static '/lib/js/jquery-ui.min.js' %}"></script>
  643. <script src="{% static '/lib/js/jquery.ui.touch-punch.min.js' %}"></script>
  644. <!-- <script src="{% static '/lib/js/detailsAnimat.js' %}"></script> -->
  645. <script src="{% static '/lib/js/coordOffset.js' %}"></script>
  646. <script src="{% static '/lib/js/jquery.easy-pie-chart.js' %}"></script>
  647. <!-- <script src="http://www.jq22.com/demo/jquery-easy-150604221240/js/jquery.easy-pie-chart.js"></script> -->
  648. <!-- <script src="https://cdn.bootcss.com/easy-pie-chart/2.1.6/jquery.easypiechart.js"></script> -->
  649. <script type="text/javascript">
  650. $.ajaxSetup({
  651. data: {
  652. csrfmiddlewaretoken: '{{ csrf_token }}'
  653. },
  654. });
  655. $(window).resize(function () {
  656. scrollBar()
  657. });
  658. //operation配置弹框
  659. function operation() {
  660. //页面层
  661. popupIndex = layer.open({
  662. type: 1,
  663. skin: 'layui-layer-rim', //加上边框
  664. // area: ['420px', '240px'], //宽高
  665. area: ["420px", '220px'],
  666. content: $('#handleBtns').html()
  667. });
  668. }
  669. $(function () {
  670. currpage = getQueryString('currpage') || 1;
  671. equipName = getQueryString('equipName') || '';
  672. equipId = getQueryString('equipId') || '';
  673. id = getQueryString('id') || '';
  674. // type = getQueryString('etype') || '';
  675. type = getQueryString('etypeA') || '';
  676. onoffSelect = getQueryString('onoffSelect') || '';
  677. // console.log(type)
  678. // console.log(onoffSelect)
  679. var htmlOPtion = '';
  680. for (var i = 0; i < 24; i++) {
  681. htmlOPtion += '<option value="' + i + '">' + i + '点</option>'
  682. if (i == 23) {
  683. $('#startTime').html(htmlOPtion);
  684. $('#endTime').html(htmlOPtion);
  685. }
  686. }
  687. $('.chart1').easyPieChart({
  688. barColor: '#ff6800',
  689. lineWidth: 5,
  690. size: 120,
  691. onStep: function (from, to, percent) {
  692. // $(this.el).find('.percent').text(Math.round(percent));
  693. }
  694. });
  695. $('.chart2').easyPieChart({
  696. barColor: '#5d9f2c',
  697. lineWidth: 5,
  698. size: 120,
  699. onStep: function (from, to, percent) {
  700. }
  701. });
  702. $('.chart3').easyPieChart({
  703. barColor: '#f4bb0e',
  704. lineWidth: 5,
  705. size: 120,
  706. onStep: function (from, to, percent) {
  707. }
  708. });
  709. $('.chart4').easyPieChart({
  710. barColor: '#6baeec',
  711. lineWidth: 5,
  712. size: 120,
  713. onStep: function (from, to, percent) {
  714. }
  715. });
  716. $('.chart5').easyPieChart({
  717. barColor: '#ff7e00',
  718. lineWidth: 5,
  719. size: 120,
  720. onStep: function (from, to, percent) {
  721. }
  722. });
  723. $('.chart6').easyPieChart({
  724. barColor: '#c279d4',
  725. lineWidth: 5,
  726. size: 120,
  727. onStep: function (from, to, percent) {
  728. }
  729. });
  730. $("#takePhotoTime-slider").css('width', '85%').slider({
  731. value: 1,
  732. range: "min",
  733. min: 0,
  734. max: 23,
  735. step: 1,
  736. slide: function (event, ui) {
  737. var val = parseInt(ui.value);
  738. $('#takePhotoTime').html(val);
  739. },
  740. stop: function (event, ui) {
  741. // console.log(turnTime)
  742. // console.log(ui.value)
  743. layui.use('layer', function () {
  744. var layer = layui.layer;
  745. layer.confirm('是否修改卷粘虫板时间?', { icon: 3, title: '提示' }, function (index) {
  746. //do something
  747. var data = {
  748. ext: 'turnset',
  749. turn_t: ui.value,
  750. }
  751. sendCtrlFun(data, function () {
  752. turnTime = ui.value;
  753. })
  754. layer.close(index);
  755. }, function (index, layero) {
  756. $("#takePhotoTime-slider").slider('value', turnTime); //卷粘虫板时间
  757. $('#takePhotoTime').html(turnTime);
  758. });
  759. });
  760. }
  761. });
  762. scrollBar()
  763. getData()
  764. });
  765. $('#startTime').change(function () {
  766. var num = parseInt($(this).val()) + 1;
  767. var htmlOPtion = '';
  768. for (var i = num; i < 24; i++) {
  769. htmlOPtion += '<option value="' + i + '">' + i + '点</option>'
  770. if (i == 23) {
  771. $('#endTime').html(htmlOPtion);
  772. }
  773. }
  774. })
  775. function popupFrame(txt, msg) {
  776. layui.use('layer', function () {
  777. var layer = layui.layer;
  778. layer.confirm('是否' + txt + '?', { icon: 3, offset: '100px', title: '提示' }, function (index) {
  779. var data = {
  780. ext: msg
  781. }
  782. var fun = function () { };
  783. if (msg == 'work_tim1') {
  784. data = {
  785. ext: msg,
  786. st: $("#startTime").val(),
  787. et: $("#endTime").val()
  788. }
  789. }
  790. sendCtrlFun(data, fun)
  791. layer.close(index);
  792. });
  793. })
  794. }
  795. function sendCtrlFun(data, callback) {
  796. data.e_id = id;
  797. $.ajax({
  798. url: 'sex_mqtt_v1',
  799. type: 'post',
  800. data: data,
  801. success: function (data) {
  802. if (data == 0) {
  803. callback();
  804. }
  805. },
  806. error: function (type) {
  807. console.log(type)
  808. }
  809. })
  810. }
  811. // 获取详情数据
  812. var turnTime; //数据上传时间间隔
  813. function getData() {
  814. $.ajax({
  815. url: 'sex_trap_detail',
  816. type: 'post',
  817. data: {
  818. id: id,
  819. },
  820. dataType: 'json',
  821. success: function (data) {
  822. // renderTable(processingData(data));
  823. // renderPage(page,data)
  824. renderHtml(data);
  825. var sex_trap = eval('(' + data.sex_trap + ')');
  826. turnTime = sex_trap.dat_f;
  827. console.log(turnTime)
  828. },
  829. error: function (type) {
  830. console.log(type);
  831. }
  832. })
  833. }
  834. //刷新
  835. function reloadPage() {
  836. var data = {
  837. ext: 'data',
  838. }
  839. var fun = function () {
  840. var index = layer.load(2, { time: 3 * 1000 });
  841. setTimeout(function () {
  842. getData()
  843. }, 3000)
  844. };
  845. sendCtrlFun(data, fun)
  846. }
  847. // 调试
  848. function debugFun() {
  849. //页面层
  850. popupIndex = layer.open({
  851. type: 1,
  852. title: '调试',
  853. offset: '100px',
  854. // skin: 'layui-layer-rim', //加上边框
  855. // area: ['420px', '240px'], //宽高
  856. shadeClose: true,
  857. area: "300px",
  858. content: $('#debugHandleBtns').html()
  859. });
  860. }
  861. function getQueryString(name) {
  862. let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  863. let url = window.location.href.split('?')[1].match(reg);
  864. // console.log(url)
  865. if (url != null) {
  866. return decodeURI(url[2])//decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码。
  867. } else {
  868. return null
  869. }
  870. }
  871. function back() {
  872. // var url = 'sex_trap_view?equipId=' + equipId + '&equipName=' + equipName + '&currpage=' + currpage + '&etype=' + type + '&onoffSelect=' + onoffSelect;
  873. var url = 'sex_trap_view?equipId=' + equipId + '&equipName=' + equipName + '&currpage=' + currpage + '&etypeA=' + type + '&onoffSelect=' + onoffSelect + '&etype=SEX_TRAP_1';
  874. location.href = url;
  875. }
  876. // 渲染界面
  877. function renderHtml(data) {
  878. var stat = eval('(' + data.sex_trap + ')');
  879. if (stat.lng > 999) {
  880. var lng = Math.floor(stat.lng / 100) + ((stat.lng % 100) / 60);
  881. var lat = Math.floor(stat.lat / 100) + ((stat.lat % 100) / 60);
  882. } else {
  883. var lng = Number(stat.lng);
  884. var lat = Number(stat.lat);
  885. }
  886. var lng1 = wgs84togcj02(lng, lat);
  887. var lng2 = gcj02tobd09(lng1[0], lng1[1]);
  888. var pt = new BMap.Point(lng2[0], lng2[1]);
  889. // 获取位置
  890. var geoc = new BMap.Geocoder();
  891. geoc.getLocation(pt, function (rs) {
  892. var addComp = rs.addressComponents;
  893. $('#curr_area').html(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
  894. })
  895. $('#equip_id').html(id);
  896. $('#equip_name').html(data.equip_name || '无');
  897. $('#upl_time').html(data.upl_time);
  898. var sex_trap = eval('(' + data.sex_trap + ')');
  899. console.log(sex_trap);
  900. $('#equip_ds').html(sex_trap.ds ? '开启' : '关闭');
  901. $('#equip_ws').html(sex_trap.ws ? '工作' : '待机');
  902. $('#equip_cbs').html(sex_trap.cs ? '充电中' : '未充电');
  903. $('#equip_rps').html(sex_trap.rps ? '雨控' : '正常');
  904. $('#equip_tps').html(sex_trap.tps ? '温控' : '正常');
  905. $('#equip_dps').html(sex_trap.dps ? '倾倒' : '正常');
  906. var cv = parseInt(sex_trap.cv / 1000 / 30 * 100); //充电电压 最大值40(2/40)
  907. $('.chart1').data('easyPieChart').update(cv);
  908. $('.chart1').find('.percent').html(sex_trap.cv / 1000);
  909. var bv = parseInt(sex_trap.bv / 1000 / 20 * 100); //电池电压 最大值20
  910. $('.chart2').data('easyPieChart').update(bv);
  911. $('.chart2').find('.percent').html(sex_trap.bv / 1000);
  912. var at = parseInt(sex_trap.at / 120 * 100); //环境温度 最大值120
  913. $('.chart3').data('easyPieChart').update(at);
  914. $('.chart3').find('.percent').html(sex_trap.at);
  915. var ah = parseInt(sex_trap.ah / 99 * 100); //环境湿度 最大值99
  916. $('.chart4').data('easyPieChart').update(ah);
  917. $('.chart4').find('.percent').html(sex_trap.ah);
  918. var hwcnt = parseInt(sex_trap.infr_ct / 6534 * 100); //红外计数 最大值6534
  919. $('.chart5').data('easyPieChart').update(hwcnt);
  920. $('.chart5').find('.percent').html(sex_trap.infr_ct);
  921. // var volcnt = parseInt(sex_trap.volt_ct / 6534 * 100); //高压计数 最大值6534
  922. // $('.chart6').data('easyPieChart').update(volcnt);
  923. // $('.chart6').find('.percent').html(sex_trap.volt_ct);
  924. console.log(sex_trap);
  925. if (sex_trap.wind_drec == 0) {
  926. var wind_drec = '北风';
  927. } else if (sex_trap.wind_drec == 1) {
  928. var wind_drec = '东北风';
  929. } else if (sex_trap.wind_drec == 2) {
  930. var wind_drec = '东风';
  931. } else if (sex_trap.wind_drec == 3) {
  932. var wind_drec = '东南风';
  933. } else if (sex_trap.wind_drec == 4) {
  934. var wind_drec = '南风';
  935. } else if (sex_trap.wind_drec == 5) {
  936. var wind_drec = '西南风';
  937. } else if (sex_trap.wind_drec == 6) {
  938. var wind_drec = '西风';
  939. } else if (sex_trap.wind_drec == 7) {
  940. var wind_drec = '西北风';
  941. } else {
  942. var wind_drec = '--';
  943. }
  944. $("#dtlDropTime-slider").slider('value', sex_trap.dat_f); //数据上传时间间隔
  945. $('#dtlDropTime').html(sex_trap.dat_f);
  946. $('#wind_drec').html(wind_drec);//风向
  947. $('#wind_sped').html(sex_trap.wind_sped);//风速
  948. $('#bt_ct').html(sex_trap.bt_ct);//重启次数
  949. if (sex_trap.ts == 1) {
  950. $('#id-button-borders').attr('checked', 'checked')
  951. } else {
  952. $('#id-button-borders').attr('checked', false)
  953. }
  954. }
  955. // 切换
  956. $('#id-button-borders').on('change', function () {
  957. console.log($('#id-button-borders').prop('checked'));
  958. if ($('#id-button-borders').prop('checked')) {
  959. popupFrame('开启时控开关', 'work_tim1')
  960. } else {
  961. popupFrame('关闭时控开关', 'work_tim0')
  962. }
  963. });
  964. // 1数据上传时间间隔
  965. $("#dtlDropTime-slider").css('width', '85%').slider({
  966. value: 1,
  967. range: "min",
  968. min: 1,
  969. max: 60,
  970. step: 1,
  971. slide: function (event, ui) {
  972. var val = parseInt(ui.value);
  973. $('#dtlDropTime').html(val);
  974. },
  975. stop: function (event, ui) {
  976. layui.use('layer', function () {
  977. var layer = layui.layer;
  978. layer.confirm('是否修改数据上传时间间隔?', { icon: 3, title: '提示' }, function (index) {
  979. var data = {
  980. ext: 'data_tim',
  981. dat_f: ui.value,
  982. }
  983. sendCtrlFun(data, function () {
  984. turnTime = ui.value;
  985. })
  986. layer.close(index);
  987. }, function (index, layero) {
  988. console.log(123456);
  989. $("#dtlDropTime-slider").slider('value', turnTime); //卷粘虫板时间
  990. $('#dtlDropTime').html(turnTime);
  991. layer.close(index);
  992. });
  993. });
  994. }
  995. });
  996. // 2拍照时间间隔
  997. // $("#takePhotoTime-slider").css('width', '85%').slider({
  998. // value: 1,
  999. // range: "min",
  1000. // min: 1,
  1001. // max: 20,
  1002. // step: 1,
  1003. // slide: function (event, ui) {
  1004. // var val = parseInt(ui.value);
  1005. // $('#takePhotoTime').html(val);
  1006. // }
  1007. // });
  1008. // 查看历史数据
  1009. function openNewPage() {
  1010. // window.location.href = 'sex_trap_data?id=' + id + '&currpage=' + currpage + '&equipName=' + equipName + '&equipId=' + equipId + '&etype=SEX_TRAP_1';
  1011. // window.location.href = 'sex_trap_data?id=' + id + '&currpage=' + currpage + '&equipName=' + equipName + '&equipId=' + equipId + '&etype=' + type + '&onoffSelect' + onoffSelect;
  1012. window.location.href = 'sex_trap_data?id=' + id + '&currpage=' + currpage + '&equipName=' + equipName + '&equipId=' + equipId + '&etype=SEX_TRAP_1' + '&onoffSelect' + onoffSelect + '&etypeA=' + type;
  1013. }
  1014. //设置诱芯
  1015. function settingCore() {
  1016. layer.open({
  1017. title: '设置诱芯'
  1018. , content: '<input class="authInp" id="authInp" type="text">'
  1019. });
  1020. layer.open({
  1021. title: '设置诱芯'
  1022. , content: '<input class="authInp" id="authInp" type="text">'
  1023. , btn: ['确定', '取消']
  1024. , btnAlign: 'c' //按钮居中
  1025. , shade: .3 //不显示遮罩
  1026. , yes: function () {
  1027. var pest = $('.authInp').val()
  1028. $.ajax({
  1029. url: 'ybq_pest_set',
  1030. type: 'post',
  1031. data: {
  1032. e_id: id,
  1033. pest: pest
  1034. },
  1035. beforeSend: function (XMLHttpRequest) {
  1036. layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
  1037. },
  1038. success: function (data) {
  1039. if (data == 0) {
  1040. layer.msg('设置成功!!', { icon: 1, shade: 0.01, shadeClose: false, time: 1000 })
  1041. } else {
  1042. layer.msg('设置失败!');
  1043. }
  1044. },
  1045. error: function (type) {
  1046. layer.msg('设置失败!');
  1047. }
  1048. })
  1049. }
  1050. });
  1051. }
  1052. </script>
  1053. </body>
  1054. </html>