sex_trap_detail2.html 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396
  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.4" />
  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 0;
  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: 408px;
  251. background: #d9d9d9 url(./static/img/sexEquip2.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. .equipRightData>div {
  264. text-align: center;
  265. }
  266. /* -----------svg环形图----------- */
  267. .chart {
  268. position: relative;
  269. display: inline-block;
  270. width: 120px;
  271. height: 120px;
  272. margin-top: 11px;
  273. margin-bottom: 11px;
  274. text-align: center;
  275. }
  276. .chart canvas {
  277. position: absolute;
  278. top: 0;
  279. left: 0;
  280. }
  281. .percent {
  282. display: block;
  283. line-height: 30px;
  284. z-index: 2;
  285. margin-top: 25%;
  286. }
  287. /* .percent:after {
  288. content: '';
  289. margin-left: 0.1em;
  290. font-size: .8em;
  291. } */
  292. .percent1 {
  293. display: block;
  294. line-height: 30px;
  295. z-index: 2;
  296. }
  297. /* -----------结束----------- */
  298. .equipPara {
  299. display: flex;
  300. justify-content: center;
  301. align-items: center;
  302. padding: 13px 0;
  303. }
  304. .equipPara>img {
  305. width: 57px;
  306. }
  307. .equipPara>div {
  308. min-width: 90px;
  309. line-height: 24px;
  310. font-size: 16px;
  311. padding-left: 20px;
  312. }
  313. .equipPara>div p:nth-child(2) {
  314. color: #b6b6b6;
  315. }
  316. /* 控制类 */
  317. input[type=checkbox].ace.ace-switch.ace-switch-5+.lbl::before {
  318. content: "开\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a关";
  319. }
  320. .timeCtrl {
  321. width: 25%;
  322. }
  323. .ctrlTitle {
  324. border-left: 3px solid #26b3ff;
  325. padding-left: 10px;
  326. font-size: 16px;
  327. font-weight: 700;
  328. margin: 25px 0;
  329. }
  330. /* 滑块 */
  331. .SliderBox {
  332. display: flex;
  333. align-items: center;
  334. }
  335. .SliderBox span {
  336. width: 100px;
  337. text-align: center;
  338. }
  339. .collocateBtn {
  340. margin: 20px;
  341. text-align: right;
  342. }
  343. @media screen and (max-width: 990px) {
  344. .col-xs-12.paddingLeft {
  345. padding-right: 15px;
  346. }
  347. .col-xs-12.paddingRight {
  348. padding-left: 15px;
  349. }
  350. .equipImg {
  351. height: 284px;
  352. }
  353. }
  354. .layui-form-label {
  355. /* width: 80px;
  356. display: inline-block;
  357. float: inherit;*/
  358. padding: 10px 0;
  359. }
  360. /* 查看历史记录 */
  361. .intoBtn {
  362. margin-bottom: 20px;
  363. text-align: center;
  364. }
  365. /* 设置诱芯 */
  366. .authInp {
  367. margin: 0 0 0 20px;
  368. }
  369. </style>
  370. </head>
  371. <body>
  372. <div class="content">
  373. <div class="page-header">
  374. <span class="headerPlace" onclick="back()">
  375. <img src="{% static '/img/gobackIcon.png' %}" alt="">返回
  376. </span>
  377. </div>
  378. <div class="userinfocover">
  379. <div class="row ">
  380. <div class="col-xs-12 col-sm-8 userinfo">
  381. <i class="fa fa-user-o" aria-hidden="true"></i>
  382. 设备编号:
  383. <span class="userinfoTitle" id="devNum"></span>
  384. 设备ID:
  385. <span class="userinfoTitle" id="equip_id"></span>
  386. 设备名称:
  387. <span class="userinfoTitle" id="equip_name"></span>
  388. 上报时间:
  389. <span class="userinfoTitle" id="upl_time"></span>
  390. 信号:
  391. <span class="userinfoTitle" id="csq"></span>
  392. 位置:
  393. <span class="userinfoTitle" id="curr_area"></span>
  394. </div>
  395. <div class="col-xs-12 col-sm-4 refresh">
  396. <button class="btn btn-sm btn-info" onclick='sendexamineSIM()'>
  397. <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
  398. SIM卡查询
  399. </button>
  400. {% if role == "superuser" %}
  401. <button type="button" class="btn btn-sm btn-primary" onclick="settingCore()">设置诱芯</button>
  402. {% endif %}
  403. <button type="button" class="btn btn-sm btn-success" onclick="reloadPage()">刷新</button>
  404. <button type="button" class="btn btn-sm btn-primary" id="debugBtn" onclick="debugFun()">调试</button>
  405. {% if role == "superuser" or role == "staff" %}
  406. <button type="button" class="btn btn-sm btn-primary" id="operationBtn" onclick="operation()">操作</button>
  407. {% endif %}
  408. </div>
  409. </div>
  410. <!-- 用户调试权限 -->
  411. <div id="debugHandleBtns" style="display:none">
  412. <div style="padding: 20px; background-color: #F2F2F2;" id="">
  413. <div class="layui-row layui-col-space15">
  414. <div class="layui-col-md12">
  415. <div class="layui-card">
  416. <!-- <div class="layui-card-header">强制操作</div> -->
  417. <div class="layui-card-body">
  418. <div style="margin-bottom: 10px;">
  419. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('开启设备',7)">开启</button>
  420. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('关闭设备',8)">关闭</button>
  421. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启',1)">重启</button>
  422. </div>
  423. <div style="margin-bottom: 10px;">
  424. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('开启卷粘虫带',5)">卷粘虫带</button>
  425. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('拍照',4)">拍照</button>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. <!-- 管理员操作权限 -->
  434. <div id="handleBtns" style="display:none">
  435. <div style="padding: 20px; background-color: #F2F2F2;" id="">
  436. <div class="layui-row layui-col-space15">
  437. <div class="layui-col-md12">
  438. <div class="layui-card">
  439. <!-- <div class="layui-card-header">强制操作</div> -->
  440. <div class="layui-card-body">
  441. <div style="margin-bottom: 10px;">
  442. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启',1)">重启</button>
  443. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('升级',2)">升级</button>
  444. <button type="button" class="btn btn-sm btn-danger"
  445. onclick="popupFrame('查询mqtt网络配置',3)">mqtt网络配置</button>
  446. </div>
  447. <div>
  448. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('拍照',4)">拍照</button>
  449. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('开启卷粘虫带',5)">卷粘虫带</button>
  450. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重新上电',6)">重新上电</button>
  451. </div>
  452. </div>
  453. </div>
  454. </div>
  455. </div>
  456. </div>
  457. </div>
  458. <div class="row">
  459. <!-- 状态 -->
  460. <div class="col-xs-12">
  461. <div class="equipBorder">
  462. <div class="row equipInfo">
  463. <div class="col-xs-6 col-md-4 col-lg-2">
  464. <div class="equipItem">
  465. <div class="haloParent">
  466. <div class="halo halo1"></div>
  467. <div class="solidCircle solidCircle1">
  468. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus1.png' %}" alt="">
  469. </div>
  470. </div>
  471. <div class="txt">
  472. <span class="typeResult" id="equip_ds">开</span>
  473. <p class="typeResult">开机状态</p>
  474. </div>
  475. </div>
  476. </div>
  477. <div class="col-xs-6 col-md-4 col-lg-2">
  478. <div class="equipItem">
  479. <div class="haloParent">
  480. <div class="halo halo2"></div>
  481. <div class="solidCircle solidCircle2">
  482. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus2.png' %}" alt="">
  483. </div>
  484. </div>
  485. <div class="txt">
  486. <span class="typeResult" id="equip_ws">正常</span>
  487. <p class="typeResult">工作状态</p>
  488. </div>
  489. </div>
  490. </div>
  491. <div class="col-xs-6 col-md-4 col-lg-2">
  492. <div class="equipItem">
  493. <div class="haloParent">
  494. <div class="halo halo3"></div>
  495. <div class="solidCircle solidCircle3">
  496. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus3.png' %}" alt="">
  497. </div>
  498. </div>
  499. <div class="txt">
  500. <span class="typeResult" id="equip_cs">正常</span>
  501. <p class="typeResult">充电状态</p>
  502. </div>
  503. </div>
  504. </div>
  505. <div class="col-xs-6 col-md-4 col-lg-2">
  506. <div class="equipItem">
  507. <div class="haloParent">
  508. <div class="halo halo6"></div>
  509. <div class="solidCircle solidCircle6">
  510. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus7.png' %}" alt="">
  511. </div>
  512. </div>
  513. <div class="txt">
  514. <span class="typeResult" id="equip_bs">正常</span>
  515. <p class="typeResult">电池状态</p>
  516. </div>
  517. </div>
  518. </div>
  519. <div class="col-xs-6 col-md-4 col-lg-2">
  520. <div class="equipItem">
  521. <div class="haloParent">
  522. <div class="halo halo4"></div>
  523. <div class="solidCircle solidCircle4">
  524. <img class="haloIcon" src="{% static '/img/sex_trap/sexStatus5.png' %}" alt="">
  525. </div>
  526. </div>
  527. <div class="txt">
  528. <span class="typeResult" id="equip_cpuTmp">开</span>
  529. <p class="typeResult">CPU温度</p>
  530. </div>
  531. </div>
  532. </div>
  533. <div class="col-xs-6 col-md-4 col-lg-2">
  534. <div class="equipItem">
  535. <div class="haloParent">
  536. <div class="halo halo5"></div>
  537. <div class="solidCircle solidCircle5">
  538. <img class="haloIcon" src="{% static '/img/haloIcon4.png' %}" alt="">
  539. </div>
  540. </div>
  541. <div class="txt">
  542. <span class="typeResult" id="equip_dver">正常</span>
  543. <p class="typeResult">软件版本</p>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. </div>
  549. </div>
  550. <!-- 设备图 -->
  551. <div class=" col-xs-4 col-md-3">
  552. <div class="equipBorder equipImg"></div>
  553. </div>
  554. <!-- 设备状态圈圈图 -->
  555. <div class="col-xs-8 col-md-9 paddingRight">
  556. <div class="equipBorder equipRight">
  557. <div class="equipRightData row">
  558. <div class="col-xs-6 col-md-3">
  559. <span class="chart chart1" data-percent="">
  560. <span class="percent">3</span>
  561. <span class="percent1">充电电压(V)</span>
  562. </span>
  563. </div>
  564. <div class="col-xs-6 col-md-3">
  565. <span class="chart chart2" data-percent="">
  566. <span class="percent">3</span>
  567. <span class="percent1">电池电压(V)</span>
  568. </span>
  569. </div>
  570. <div class="col-xs-6 col-md-3">
  571. <span class="chart chart3" data-percent="">
  572. <span class="percent">3</span>
  573. <span class="percent1">环境温度(°C)</span>
  574. </span>
  575. </div>
  576. <div class="col-xs-6 col-md-3">
  577. <span class="chart chart4" data-percent="">
  578. <span class="percent">3</span>
  579. <span class="percent1">环境湿度(RH)</span>
  580. </span>
  581. </div>
  582. <!-- <div class="col-xs-4 col-md-2">
  583. <span class="chart chart5" data-percent="">
  584. <span class="percent">3</span>
  585. <span class="percent1">红外计数值</span>
  586. </span>
  587. </div>
  588. <div class="col-xs-4 col-md-2">
  589. <span class="chart chart6" data-percent="">
  590. <span class="percent">3</span>
  591. <span class="percent1">高压计数值</span>
  592. </span>
  593. </div> -->
  594. </div>
  595. </div>
  596. </div>
  597. <!-- 控制区域 -->
  598. <div class="col-xs-12 col-md-9 paddingRight">
  599. <div class="col-xs-12 col-sm-6 paddingLeft paddingRight">
  600. <div class="equipBorder">
  601. <div style="padding:10px 15px;min-height: 240px;">
  602. <div class="ctrlTitle">
  603. 数据上传时间间隔
  604. </div>
  605. <div>
  606. <div class="SliderBox">
  607. <span class="initVal">1</span>
  608. <div class="slider" id="dtlDropTime-slider"></div>
  609. <span class="sliderVal" id="dtlDropTime">20</span>
  610. </div>
  611. </div>
  612. <div class="ctrlTitle">
  613. 卷粘虫板时间
  614. </div>
  615. <div>
  616. <div class="SliderBox">
  617. <span class="initVal">1</span>
  618. <div class="slider" id="takePhotoTime-slider"></div>
  619. <span class="sliderVal" id="takePhotoTime">20</span>
  620. </div>
  621. </div>
  622. </div>
  623. </div>
  624. </div>
  625. <div class="col-xs-12 col-sm-4 paddingLeft paddingRight">
  626. <div class="equipBorder">
  627. <div style="padding:10px 15px;min-height: 240px;">
  628. <div class="ctrlTitle">
  629. 定时拍照循环工作时间
  630. </div>
  631. <div>
  632. <form class="layui-form" action="" lay-filter="selectObj">
  633. <div class="layui-form-item">
  634. <label class="layui-form-label">拍照时刻</label>
  635. <div class="layui-input-block">
  636. <select name="takePhotoTime" lay-verify="" lay-search>
  637. <option value="0">0点</option>
  638. <option value="1">1点</option>
  639. <option value="2">2点</option>
  640. <option value="3">3点</option>
  641. <option value="4">4点</option>
  642. <option value="5">5点</option>
  643. <option value="6">6点</option>
  644. <option value="7">7点</option>
  645. <option value="8">8点</option>
  646. <option value="9">9点</option>
  647. <option value="10">10点</option>
  648. <option value="11">11点</option>
  649. <option value="12">12点</option>
  650. <option value="13">13点</option>
  651. <option value="14">14点</option>
  652. <option value="15">15点</option>
  653. <option value="16">16点</option>
  654. <option value="17">17点</option>
  655. <option value="18">18点</option>
  656. <option value="19">19点</option>
  657. <option value="20">20点</option>
  658. <option value="21">21点</option>
  659. <option value="22">22点</option>
  660. <option value="23">23点</option>
  661. </select>
  662. </div>
  663. </div>
  664. <div class="layui-form-item">
  665. <label class="layui-form-label">拍照间隔</label>
  666. <div class="layui-input-block">
  667. <select name="takePhotoInterval" lay-verify="" lay-search>
  668. <option value="1">1</option>
  669. <option value="2">2</option>
  670. <option value="3">3</option>
  671. <option value="4">4</option>
  672. <option value="6">6</option>
  673. <option value="8">8</option>
  674. <option value="12">12</option>
  675. <option value="24">24</option>
  676. </select>
  677. </div>
  678. </div>
  679. </form>
  680. </div>
  681. </div>
  682. </div>
  683. </div>
  684. <div class="col-xs-12 col-sm-2 paddingLeft paddingRight">
  685. <div class="equipBorder">
  686. <div style="padding:10px 15px;min-height: 240px;">
  687. <div class="ctrlTitle">
  688. 记录
  689. </div>
  690. <div>
  691. <div class="intoBtn">
  692. <button type="button" class="btn btn-white btn-primary" onclick="openNewPage(1)">查看历史图片</button>
  693. </div>
  694. <div class="intoBtn">
  695. <button type="button" class="btn btn-white btn-primary" onclick="openNewPage(2)">查看历史数据</button>
  696. </div>
  697. </div>
  698. </div>
  699. </div>
  700. </div>
  701. </div>
  702. </div>
  703. </div>
  704. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  705. <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
  706. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  707. <script type="text/javascript"
  708. src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
  709. <script src="{% static '/js/common.js' %}?versions=0.5.4"></script>
  710. <!-- <script src="{% static '/assets/js/ace.min.js' %}"></script> -->
  711. <!-- <script src="{% static '/lib/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script> -->
  712. <!-- <script src="{% static '/lib/js/main.js' %}" type="text/javascript" charset="utf-8"></script> -->
  713. <script src="{% static '/lib/js/jquery-ui.min.js' %}"></script>
  714. <script src="{% static '/lib/js/jquery.ui.touch-punch.min.js' %}"></script>
  715. <!-- <script src="{% static '/lib/js/detailsAnimat.js' %}"></script> -->
  716. <script src="{% static '/lib/js/coordOffset.js' %}"></script>
  717. <script src="{% static '/lib/js/jquery.easy-pie-chart.js' %}"></script>
  718. <!-- <script src="http://www.jq22.com/demo/jquery-easy-150604221240/js/jquery.easy-pie-chart.js"></script> -->
  719. <!-- <script src="https://cdn.bootcss.com/easy-pie-chart/2.1.6/jquery.easypiechart.js"></script> -->
  720. <script type="text/javascript">
  721. var pic_t //拍照时刻
  722. var pic_f //拍照间隔
  723. $.ajaxSetup({
  724. data: {
  725. csrfmiddlewaretoken: '{{ csrf_token }}'
  726. },
  727. });
  728. $(window).resize(function () {
  729. scrollBar()
  730. });
  731. // 调试
  732. function debugFun() {
  733. //页面层
  734. popupIndex = layer.open({
  735. type: 1,
  736. title: '调试',
  737. offset: '100px',
  738. // skin: 'layui-layer-rim', //加上边框
  739. // area: ['420px', '240px'], //宽高
  740. shadeClose: true,
  741. area: "300px",
  742. content: $('#debugHandleBtns').html()
  743. });
  744. }
  745. //operation配置弹框
  746. function operation() {
  747. //页面层
  748. popupIndex = layer.open({
  749. type: 1,
  750. title: '控制',
  751. offset: '100px',
  752. shadeClose: true,
  753. // skin: 'layui-layer-rim', //加上边框
  754. // area: ['420px', '240px'], //宽高
  755. area: "300px",
  756. content: $('#handleBtns').html()
  757. });
  758. }
  759. $(function () {
  760. currpage = getQueryString('currpage') || 1;
  761. equipName = getQueryString('equipName') || '';
  762. equipId = getQueryString('equipId') || '';
  763. id = getQueryString('id') || '';
  764. // type = getQueryString('etype') || '';
  765. type = getQueryString('etypeA') || '';
  766. onoffSelect = getQueryString('onoffSelect') || '';
  767. console.log(type)
  768. $('.chart1').easyPieChart({
  769. barColor: '#ff6800',
  770. lineWidth: 5,
  771. size: 120,
  772. onStep: function (from, to, percent) {
  773. // $(this.el).find('.percent').text(Math.round(percent));
  774. }
  775. });
  776. $('.chart2').easyPieChart({
  777. barColor: '#5d9f2c',
  778. lineWidth: 5,
  779. size: 120,
  780. onStep: function (from, to, percent) {
  781. // $(this.el).find('.percent').text(Math.round(percent));
  782. }
  783. });
  784. $('.chart3').easyPieChart({
  785. barColor: '#f4bb0e',
  786. lineWidth: 5,
  787. size: 120,
  788. onStep: function (from, to, percent) {
  789. // $(this.el).find('.percent').text(Math.round(percent));
  790. }
  791. });
  792. $('.chart4').easyPieChart({
  793. barColor: '#6baeec',
  794. lineWidth: 5,
  795. size: 120,
  796. onStep: function (from, to, percent) {
  797. // $(this.el).find('.percent').text(Math.round(percent));
  798. }
  799. });
  800. $('.chart5').easyPieChart({
  801. barColor: '#ff7e00',
  802. lineWidth: 5,
  803. size: 120,
  804. onStep: function (from, to, percent) {
  805. $(this.el).find('.percent').text(Math.round(percent));
  806. }
  807. });
  808. $('.chart6').easyPieChart({
  809. barColor: '#c279d4',
  810. lineWidth: 5,
  811. size: 120,
  812. onStep: function (from, to, percent) {
  813. $(this.el).find('.percent').text(Math.round(percent));
  814. }
  815. });
  816. scrollBar()
  817. getData()
  818. });
  819. // 获取详情数据
  820. var datTime, turnTime, iccid; //数据上传,卷粘虫板
  821. function getData() {
  822. $.ajax({
  823. url: 'sex_trap_detail',
  824. type: 'post',
  825. data: {
  826. id: id,
  827. },
  828. dataType: 'json',
  829. success: function (data) {
  830. // renderTable(processingData(data));
  831. // renderPage(page,data)
  832. renderHtml(data);
  833. var sex_trap = eval('(' + data.sex_trap + ')');
  834. datTime = sex_trap.dat_f;
  835. turnTime = sex_trap.turn_t;
  836. iccid = sex_trap.iccid;
  837. },
  838. error: function (type) {
  839. console.log(type);
  840. }
  841. })
  842. }
  843. // 获取位置
  844. var geoc = new BMap.Geocoder();
  845. // 渲染界面
  846. function renderHtml(data) {
  847. $('#equip_id').html(id);
  848. $('#equip_name').html(data.equip_name || '--');
  849. $('#upl_time').html(data.upl_time);
  850. $('#curr_area').html(id);
  851. var sex_trap = eval('(' + data.sex_trap + ')');
  852. $('#devNum').html(sex_trap.dev_num || '--');
  853. $('#csq').html(sex_trap.csq);
  854. $('#equip_ds').html(sex_trap.ds ? '开启' : '关闭');
  855. $('#equip_ws').html(sex_trap.ws ? '工作' : '待机');
  856. // $('#equip_cs').html(sex_trap.cs?'未充电':'充电中');
  857. if (sex_trap.cs == 0) {
  858. $('#equip_cs').html('正常');
  859. } else if (sex_trap.cs == 1) {
  860. $('#equip_cs').html('光控');
  861. } else if (sex_trap.cs == 2) {
  862. $('#equip_cs').html('充电');
  863. }
  864. // $('#equip_cs').html(sex_trap.cs?'未充电':'充电中');
  865. if (sex_trap.bs != '') {
  866. if (sex_trap.bs == 0) {
  867. $('#equip_bs').html('正常');
  868. } else if (sex_trap.bs == 1) {
  869. $('#equip_bs').html('欠压');
  870. } else if (sex_trap.bs == 2) {
  871. $('#equip_bs').html('过压');
  872. }
  873. } else {
  874. $('#equip_bs').html('--');
  875. }
  876. $('#equip_cpuTmp').html((parseInt(sex_trap.cpu_tmp) / 1000).toFixed(2));
  877. $('#equip_dver').html(sex_trap.dver);
  878. var cv = parseInt(sex_trap.cv / 40 * 100); //充电电压 最大值40(2/40)
  879. $('.chart1').data('easyPieChart').update(cv / 1000);
  880. $('.chart1').find('.percent').html(sex_trap.cv / 1000);
  881. var bv = parseInt(sex_trap.bv / 1000 / 20 * 100); //电池电压 最大值20
  882. $('.chart2').data('easyPieChart').update(bv);
  883. $('.chart2').find('.percent').html(sex_trap.bv / 1000);
  884. var at = parseInt(sex_trap.at / 120 * 100); //环境温度 最大值120
  885. $('.chart3').data('easyPieChart').update(at);
  886. $('.chart3').find('.percent').html(sex_trap.at);
  887. var ah = parseInt(sex_trap.ah / 99 * 100); //环境湿度 最大值99
  888. $('.chart4').data('easyPieChart').update(ah);
  889. $('.chart4').find('.percent').html(sex_trap.ah);
  890. // var hwcnt = parseInt(sex_trap.hwcnt/6534); //红外计数 最大值6534
  891. // $('.chart5').data('easyPieChart').update(hwcnt);
  892. // $('.chart5').find('.percent').html(sex_trap.hwcnt);
  893. // var volcnt = parseInt(sex_trap.volcnt/6534); //高压计数 最大值20
  894. // $('.chart6').data('easyPieChart').update(volcnt);
  895. // $('.chart6').find('.percent').html(sex_trap.volcnt);
  896. $("#dtlDropTime-slider").slider('value', sex_trap.dat_f); //数据上传时间间隔
  897. $('#dtlDropTime').html(sex_trap.dat_f);
  898. $("#takePhotoTime-slider").slider('value', sex_trap.turn_t); //卷粘虫板时间
  899. $('#takePhotoTime').html(sex_trap.turn_t);
  900. layui.use('form', function () {
  901. var form = layui.form;
  902. //给表单赋值
  903. form.val("selectObj", { // form标签 lay-filter="" 对应的值
  904. "takePhotoTime": parseInt(sex_trap.pic_t) // "name": "value"
  905. , "takePhotoInterval": parseInt(sex_trap.pic_f)
  906. });
  907. pic_f = sex_trap.pic_f
  908. pic_t = sex_trap.pic_t
  909. });
  910. if (sex_trap.lng > 999) {
  911. var lng = Math.floor(sex_trap.lng / 100) + ((sex_trap.lng % 100) / 60);
  912. var lat = Math.floor(sex_trap.lat / 100) + ((sex_trap.lat % 100) / 60);
  913. } else {
  914. var lng = Number(sex_trap.lng);
  915. var lat = Number(sex_trap.lat);
  916. }
  917. var lng1 = wgs84togcj02(lng, lat);
  918. var lng2 = gcj02tobd09(lng1[0], lng1[1]);
  919. var pt = new BMap.Point(lng2[0], lng2[1]);
  920. geoc.getLocation(pt, function (rs) {
  921. var addComp = rs.addressComponents;
  922. // $('.area').html('位置:'+ addComp.province + ", " + addComp.city + ", " + addComp.district)
  923. $('#curr_area').html(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
  924. });
  925. }
  926. function getQueryString(name) {
  927. let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  928. let url = window.location.href.split('?')[1].match(reg);
  929. // console.log(url)
  930. if (url != null) {
  931. return decodeURI(url[2]) //decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码。
  932. } else {
  933. return null
  934. }
  935. }
  936. function back() {
  937. // var url = 'sex_trap_view?equipId=' + equipId + '&equipName=' + equipName + '&currpage=' + currpage + '&etype=' + type + '&onoffSelect=' + onoffSelect;
  938. var url = 'sex_trap_view?equipId=' + equipId + '&equipName=' + equipName + '&currpage=' + currpage + '&etype=SEX_TRAP_2' + '&etypeA=' + type + '&onoffSelect=' + onoffSelect;
  939. location.href = url;
  940. }
  941. // 数据上传时间间隔
  942. $("#dtlDropTime-slider").css('width', '85%').slider({
  943. value: 10,
  944. range: "min",
  945. min: 10,
  946. max: 120,
  947. step: 10,
  948. slide: function (event, ui) {
  949. var val = parseInt(ui.value);
  950. $('#dtlDropTime').html(val);
  951. },
  952. stop: function (event, ui) {
  953. console.log(datTime)
  954. console.log(ui.value)
  955. layui.use('layer', function () {
  956. var layer = layui.layer;
  957. layer.confirm('是否修改数据上传时间?', { icon: 3, title: '提示' }, function (index) {
  958. //do something 预留
  959. // var data = {
  960. // ext:'turnset',
  961. // turn_t:ui.value,
  962. // }
  963. // sendCtrlFun(data,function(){
  964. // turnTime = ui.value;
  965. // })
  966. layer.close(index);
  967. }, function (index, layero) {
  968. $("#dtlDropTime-slider").slider('value', datTime); //数据上传时间间隔
  969. $('#dtlDropTime').html(datTime);
  970. });
  971. });
  972. }
  973. });
  974. // $( "#dtlDropTime-slider" ).slider( "disable" );
  975. // 卷粘虫板时间
  976. $("#takePhotoTime-slider").css('width', '85%').slider({
  977. value: 1,
  978. range: "min",
  979. min: 0,
  980. max: 23,
  981. step: 1,
  982. slide: function (event, ui) {
  983. var val = parseInt(ui.value);
  984. $('#takePhotoTime').html(val);
  985. },
  986. stop: function (event, ui) {
  987. layui.use('layer', function () {
  988. var layer = layui.layer;
  989. layer.confirm('是否修改卷粘虫板时间?', { icon: 3, title: '提示' }, function (index) {
  990. //do something
  991. var data = {
  992. ext: 'turnset',
  993. turn_t: ui.value,
  994. }
  995. sendCtrlFun(data, function () {
  996. turnTime = ui.value;
  997. })
  998. layer.close(index);
  999. }, function (index, layero) {
  1000. $("#takePhotoTime-slider").slider('value', turnTime); //卷粘虫板时间
  1001. $('#takePhotoTime').html(turnTime);
  1002. });
  1003. });
  1004. }
  1005. });
  1006. layui.use('form', function () {
  1007. var form = layui.form;
  1008. form.on('select', function (data) {
  1009. console.log($(data.elem.form).find('select')); //得到select原始DOM对象
  1010. var select1 = $(data.elem.form).find('select')[0];
  1011. var select2 = $(data.elem.form).find('select')[1];
  1012. // console.log($(select1).val()); //得到被选中的值
  1013. // console.log($(select2).val()); //得到美化后的DOM对象
  1014. var data = {
  1015. ext: 'photoset',
  1016. pic_t: $(select1).val(),
  1017. pic_f: $(select2).val(),
  1018. }
  1019. sendCtrlFun(data, function () { })
  1020. });
  1021. });
  1022. function popupFrame(txt, flag) {
  1023. layui.use('layer', function () {
  1024. var layer = layui.layer;
  1025. layer.confirm('是否' + txt + '?', { icon: 3, offset: '100px', title: '提示' }, function (index) {
  1026. if (flag == 1) {
  1027. var data = {
  1028. ext: 'reboot',
  1029. }
  1030. var fun = function () { };
  1031. } else if (flag == 2) {
  1032. var data = {
  1033. ext: 'update',
  1034. }
  1035. var fun = function () { };
  1036. } else if (flag == 3) {
  1037. var data = {
  1038. ext: 'mqttconf',
  1039. }
  1040. var fun = function () {
  1041. var index = layer.load(2, { time: 3 * 1000 });
  1042. setTimeout(function () {
  1043. $.ajax({
  1044. url: 'sex_mqtt_detail',
  1045. type: 'post',
  1046. data: {
  1047. e_id: id
  1048. },
  1049. dataType: 'json',
  1050. success: function (data) {
  1051. layer.open({
  1052. type: 1
  1053. , title: false //不显示标题栏
  1054. , closeBtn: false
  1055. , area: '400px;'
  1056. , shade: 0.8
  1057. , id: 'LAY_layuipro' //设定一个id,防止重复弹出
  1058. , btn: ['确定']
  1059. , btnAlign: 'c'
  1060. , moveType: 1 //拖拽模式,0或者1
  1061. , content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">ip:' + data.ip + '<br />port:' + data.port + '<br />sub:' + data.sub + '<br />pub:' + data.pub + '<br />lastwill:' + data.lastwill + '<br />keepalive:' + data.keepalive + '<br />username:' + data.username + '<br />stamp:' + data.stamp + '</div>'
  1062. });
  1063. },
  1064. error: function (type) {
  1065. console.log(type)
  1066. }
  1067. })
  1068. }, 3000)
  1069. };
  1070. } else if (flag == 4) {
  1071. var data = {
  1072. ext: 'takephoto',
  1073. }
  1074. var fun = function () { };
  1075. } else if (flag == 5) {
  1076. var data = {
  1077. ext: 'turn',
  1078. }
  1079. var fun = function () { };
  1080. } else if (flag == 6) {
  1081. var data = {
  1082. ext: 'repower',
  1083. }
  1084. var fun = function () { };
  1085. } else if (flag == 7) {
  1086. var data = {
  1087. ext: 'ds1',
  1088. }
  1089. var fun = function () { };
  1090. } else if (flag == 8) {
  1091. var data = {
  1092. ext: 'ds0',
  1093. }
  1094. var fun = function () { };
  1095. }
  1096. sendCtrlFun(data, fun)
  1097. layer.close(index);
  1098. });
  1099. })
  1100. }
  1101. function sendCtrlFun(data, callback) {
  1102. data.e_id = id;
  1103. layui.use('layer', function () {
  1104. var pic_fA = data.pic_f
  1105. var pic_tA = data.pic_t
  1106. var layer = layui.layer;
  1107. layer.confirm('是否修改定时拍照循环工作时间?', { icon: 3, title: '提示' }, function (index) {
  1108. layer.close(index);
  1109. $.ajax({
  1110. url: 'sex_mqtt',
  1111. type: 'post',
  1112. data: data,
  1113. success: function (data) {
  1114. if (data == 0) {
  1115. pic_f = pic_fA
  1116. pic_t = pic_tA
  1117. callback();
  1118. }
  1119. },
  1120. error: function (type) {
  1121. console.log(type)
  1122. }
  1123. })
  1124. }, function (index, layero) {
  1125. layui.use('form', function () {
  1126. var form = layui.form;
  1127. //给表单赋值
  1128. form.val("selectObj", { // form标签 lay-filter="" 对应的值
  1129. "takePhotoTime": parseInt(pic_t) // "name": "value"
  1130. , "takePhotoInterval": parseInt(pic_f)
  1131. });
  1132. });
  1133. });
  1134. });
  1135. }
  1136. function reloadPage() {
  1137. var data = {
  1138. ext: 'data',
  1139. }
  1140. var fun = function () {
  1141. var index = layer.load(2, { time: 3 * 1000 });
  1142. setTimeout(function () {
  1143. getData()
  1144. }, 3000)
  1145. };
  1146. sendCtrlFun(data, fun)
  1147. }
  1148. // sim卡查询
  1149. function sendexamineSIM() {
  1150. examineSIM(iccid)
  1151. }
  1152. function examineSIM(iccid) {
  1153. $.ajax({
  1154. url: 'siminfo',
  1155. type: 'post',
  1156. dataType: 'json',
  1157. data: {
  1158. simid: iccid,
  1159. },
  1160. beforeSend: function (XMLHttpRequest) {
  1161. //注意,layer.msg默认3秒自动关闭,如果数据加载耗时比较长,需要设置time
  1162. loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
  1163. },
  1164. success: function (data) {
  1165. var dat = data.data;
  1166. if (data.code == 0) {
  1167. var status;
  1168. if (dat.account_status == "0") {
  1169. status = "未知";
  1170. } else if (dat.account_status == "1") {
  1171. status = "测试期";
  1172. } else if (dat.account_status == "2") {
  1173. status = "沉默期";
  1174. } else if (dat.account_status == "3") {
  1175. status = "使用中";
  1176. } else if (dat.account_status == "4") {
  1177. status = "停机";
  1178. } else if (dat.account_status == "5") {
  1179. status = "停机保号";
  1180. } else if (dat.account_status == "6") {
  1181. status = "预销号";
  1182. } else if (dat.account_status == "7") {
  1183. status = "销号";
  1184. }
  1185. var usage;
  1186. if (dat.iccid) {
  1187. usage = dat.data_usage;
  1188. } else {
  1189. usage.innerHTML = '--';
  1190. }
  1191. var balance;
  1192. if (dat.iccid) {
  1193. balance = dat.data_balance;
  1194. } else {
  1195. balance = '--';
  1196. }
  1197. var time;
  1198. if (dat.iccid) {
  1199. var timestamp4 = new Date(dat.expiry_date * 1000);//直接用 new Date(时间戳) 格式转化获得当前时间
  1200. time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
  1201. } else {
  1202. time = '--';
  1203. }
  1204. layer.close(loadingFlag);
  1205. layer.open({
  1206. type: 1
  1207. , title: false //不显示标题栏
  1208. , closeBtn: false
  1209. , area: '300px;'
  1210. , shade: 0.8
  1211. , offset: '100px'
  1212. , id: 'LAY_layuipro' //设定一个id,防止重复弹出
  1213. , btn: ['我知道了']
  1214. , btnAlign: 'c'
  1215. , moveType: 1 //拖拽模式,0或者1
  1216. , content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
  1217. , success: function (layero) {
  1218. }
  1219. });
  1220. } else {
  1221. layer.msg('查询失败!');
  1222. }
  1223. }
  1224. })
  1225. }
  1226. function openNewPage(falg) {
  1227. if (falg == 1) {
  1228. window.location.href = 'sex_trap_photo?id=' + id + '&currpage=' + currpage + '&equipName=' + equipName + '&equipId=' + equipId + '&etype=SEX_TRAP_2' + '&etypeA=' + type + '&onoffSelect=' + onoffSelect
  1229. }
  1230. if (falg == 2) {
  1231. window.location.href = 'sex_trap_data?id=' + id + '&currpage=' + currpage + '&equipName=' + equipName + '&equipId=' + equipId + '&etype=SEX_TRAP_2' + '&etypeA=' + type + '&onoffSelect=' + onoffSelect
  1232. }
  1233. }
  1234. //设置诱芯
  1235. function settingCore() {
  1236. layer.open({
  1237. title: '设置诱芯'
  1238. , content: '<input class="authInp" id="authInp" type="text">'
  1239. });
  1240. layer.open({
  1241. title: '设置诱芯'
  1242. , content: '<input class="authInp" id="authInp" type="text">'
  1243. , btn: ['确定', '取消']
  1244. , btnAlign: 'c' //按钮居中
  1245. , shade: .3 //不显示遮罩
  1246. , yes: function () {
  1247. var pest = $('.authInp').val()
  1248. $.ajax({
  1249. url: 'ybq_pest_set',
  1250. type: 'post',
  1251. data: {
  1252. e_id: id,
  1253. pest: pest
  1254. },
  1255. beforeSend: function (XMLHttpRequest) {
  1256. layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
  1257. },
  1258. success: function (data) {
  1259. if (data == 0) {
  1260. layer.msg('设置成功!!', { icon: 1, shade: 0.01, shadeClose: false, time: 1000 })
  1261. } else {
  1262. layer.msg('设置失败!');
  1263. }
  1264. },
  1265. error: function (type) {
  1266. layer.msg('设置失败!');
  1267. }
  1268. })
  1269. }
  1270. });
  1271. }
  1272. </script>
  1273. </body>
  1274. </html>