equipmanage_ybq_detail.html 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712
  1. {% load staticfiles %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <link href="https://cdn.bootcss.com/bootstrap/3.1.1/css/bootstrap.css" rel="stylesheet">
  7. <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
  8. <link rel="stylesheet" href="{% static 'assetsDemo/css/fonts.googleapis.com.css' %}" />
  9. <link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  10. <link rel="stylesheet" href="{% static '/assetsDemo/css/ace.min.css' %}" class="ace-main-stylesheet" id="main-ace-style"
  11. />
  12. <!-- <link rel="stylesheet" href="{% static '/assetsDemo/css/ace-skins.min.css' %}"> -->
  13. <!-- <link rel="stylesheet" href="{% static '/assetsDemo/css/ace-rtl.min.css' %}"> -->
  14. <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
  15. <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.4" />
  16. <!-- <link rel="stylesheet" href="{% static '/assetsDemo/css/jquery-ui.min.css' %}" /> -->
  17. <style type="text/css">
  18. body {
  19. overflow: hidden;
  20. background: #fff;
  21. }
  22. .userinfo .fa {
  23. font-size: 18px;
  24. color: #26b3ff;
  25. margin: 0px 5px;
  26. }
  27. .ui-slider .ui-slider-handle {
  28. width: 1.4em;
  29. height: 1.4em;
  30. border-radius: 50%;
  31. }
  32. .ui-slider {
  33. background: #fff;
  34. }
  35. .userinfoTitle {
  36. margin-right: 30px;
  37. font-size: 16px;
  38. }
  39. .refresh {
  40. text-align: right;
  41. }
  42. .refresh button {
  43. padding: 2px 5px;
  44. border-radius: 5px;
  45. }
  46. /* .userinfo{
  47. margin-bottom: 15px !important;
  48. } */
  49. /* */
  50. .row {
  51. margin: 0;
  52. }
  53. .equiptypeicon {
  54. float: left;
  55. width: 60px;
  56. margin-left: 20%;
  57. }
  58. .equipInfo {
  59. margin: 20px 0;
  60. }
  61. .equipInfo .row {
  62. margin: 0 13px;
  63. box-shadow: 0 0 40px #eee;
  64. padding: 30px;
  65. }
  66. .equipInfo .row>div {
  67. height: 52px;
  68. text-align: center;
  69. border-left: 1px solid #eee;
  70. }
  71. .equipInfo .row .txt {
  72. position: absolute;
  73. left: 105px;
  74. }
  75. .equipInfo .row>div:first-child {
  76. border-left: none;
  77. }
  78. .typeResult {
  79. font-size: 18px;
  80. line-height: 30px;
  81. }
  82. .typeTitle {
  83. color: #666;
  84. }
  85. @media (max-width: 1200px) {
  86. .col-xs-4.secondLine {
  87. border-left: none !important;
  88. }
  89. .col-xs-4 {
  90. margin-bottom: 10px;
  91. }
  92. }
  93. /* */
  94. .backStyle {
  95. background: #fff;
  96. box-shadow: 0 0 40px #eee;
  97. padding: 20px;
  98. }
  99. .backStyle h1 {
  100. font-size: 18px;
  101. margin-bottom: 15px;
  102. }
  103. .circle_bar {
  104. text-align: center;
  105. padding: 54px 18px;
  106. }
  107. /* */
  108. .areaicon {
  109. width: 40px;
  110. float: left;
  111. height: 50px;
  112. margin-right: 15px;
  113. }
  114. .area p {
  115. font-size: 16px;
  116. line-height: 30px;
  117. }
  118. /* 配置项 */
  119. .form-group>label {
  120. margin: 4px 0 0 0;
  121. text-align: right;
  122. }
  123. .initVal {
  124. position: absolute;
  125. left: 8px;
  126. top: 5px;
  127. }
  128. .ui-slider {
  129. top: 8px;
  130. left: 18px;
  131. }
  132. .sliderVal {
  133. position: absolute;
  134. right: 25px;
  135. top: 5px;
  136. }
  137. .collocateBtn {
  138. text-align: center;
  139. }
  140. .collocateBtn button {
  141. margin: 10px 10px 20px 10px;
  142. }
  143. .form-group select {
  144. width: 200px;
  145. }
  146. .widget-body {
  147. margin-top: 20px;
  148. }
  149. .timePattern {
  150. display: none;
  151. }
  152. .hintTitle {
  153. text-align: center;
  154. display: inline-block;
  155. width: 100px;
  156. margin-right: 15px;
  157. color: #777;
  158. }
  159. .form-group select[name='begin'],
  160. .form-group select[name='end'] {
  161. padding: 0 26px 0 37px;
  162. width: initial;
  163. width: 103px;
  164. }
  165. .haloParent {
  166. position: absolute;
  167. width: 100px;
  168. height: 100px;
  169. float: left;
  170. margin-top: -23px;
  171. }
  172. .halo {
  173. position: absolute;
  174. width: 100px;
  175. height: 100px;
  176. border-radius: 50%;
  177. }
  178. .solidCircle {
  179. position: absolute;
  180. width: 50px;
  181. height: 50px;
  182. border-radius: 50%;
  183. left: 50%;
  184. top: 50%;
  185. margin-left: -25px;
  186. margin-top: -25%;
  187. }
  188. .solidCircle4 {
  189. background: #4ca1ff;
  190. }
  191. .solidCircle6 {
  192. background: #a597f8;
  193. }
  194. .halo4 {
  195. animation: haloFour 2s 3s infinite;
  196. }
  197. .halo6 {
  198. animation: haloSix 2s 3s infinite;
  199. }
  200. @keyframes haloFour {
  201. 0% {
  202. background: #4ca1ff;
  203. transform: scale(.3);
  204. opacity: 0
  205. }
  206. 20% {
  207. background: #1258a5;
  208. transform: scale(.5);
  209. opacity: .5
  210. }
  211. 100% {
  212. background: #1258a5;
  213. transform: scale(.8);
  214. opacity: 0
  215. }
  216. }
  217. @keyframes haloSix {
  218. 0% {
  219. background: #a597f8;
  220. transform: scale(.3);
  221. opacity: 0
  222. }
  223. 20% {
  224. background: #3d2aaf;
  225. transform: scale(.5);
  226. opacity: .5
  227. }
  228. 100% {
  229. background: #3d2aaf;
  230. transform: scale(.8);
  231. opacity: 0
  232. }
  233. }
  234. .haloIcon {
  235. margin-top: 14px;
  236. }
  237. .widget-body {
  238. min-height: 464px;
  239. }
  240. /* 左边设备 */
  241. .equiptInfo {
  242. height: 655px;
  243. position: relative;
  244. background: url(../static/img/equipImg.png) no-repeat;
  245. background-size: 230px;
  246. background-position-x: 45%;
  247. background-position-y: 22px;
  248. }
  249. /*闪烁点*/
  250. #animatCover {
  251. position: absolute;
  252. left: 45%;
  253. top: 0;
  254. bottom: 0;
  255. width: 233px;
  256. margin-left: -107px;
  257. z-index: 99;
  258. }
  259. .flashDot {
  260. width: 50px;
  261. height: 50px;
  262. background-image: url(../static/img/flash.png);
  263. background-size: cover;
  264. background-position-y: 0 -143px;
  265. cursor: pointer;
  266. position: absolute;
  267. }
  268. .flashDot .line {
  269. position: absolute;
  270. left: 39px;
  271. bottom: 40px;
  272. z-index: 900;
  273. width: 0;
  274. height: 35px;
  275. transition: all .3s;
  276. background-image: url(../static/img/line.png);
  277. }
  278. .flashDot .lineleft {
  279. background-image: url(../static/img/line2.png);
  280. }
  281. .flashDot .bottomline {
  282. bottom: -20px;
  283. transform: scale(1) rotateX(180deg);
  284. }
  285. .flashDot .panelBox {
  286. position: absolute;
  287. left: 141px;
  288. bottom: 46px;
  289. width: 190px;
  290. height: 48px;
  291. background-color: transparent;
  292. -webkit-background-size: 100% 100%;
  293. background-size: 100% 100%;
  294. transform: scale(0);
  295. animation-fill-mode: forwards;
  296. }
  297. .bgimg {
  298. position: absolute;
  299. top: 0;
  300. bottom: 0;
  301. left: 0;
  302. right: 0;
  303. background-image: url(../static/img/panel.png);
  304. background-size: 100% 100%;
  305. }
  306. .flashDot .bottompanel {
  307. bottom: -43px;
  308. }
  309. .flashDot .showPanel {
  310. animation: showPanel 1s .5s 1;
  311. animation-fill-mode: forwards;
  312. }
  313. .flashDot .text {
  314. position: absolute;
  315. left: 20px;
  316. top: 10px;
  317. width: 80%;
  318. height: 30px;
  319. line-height: 30px;
  320. color: #fff;
  321. font-size: 16px;
  322. }
  323. @keyframes showPanel {
  324. 0% {
  325. opacity: 1;
  326. transform: scale(0);
  327. }
  328. 80% {
  329. transform: scale(1.1);
  330. }
  331. 100% {
  332. opacity: 1;
  333. transform: scale(1);
  334. }
  335. }
  336. /* 闪烁点定位 */
  337. .flashDot1 {
  338. left: 150px;
  339. top: 60px;
  340. }
  341. .flashDot2 {
  342. left: 93px;
  343. top: 66px;
  344. }
  345. .flashDot3 {
  346. left: 100px;
  347. top: 226px;
  348. }
  349. .flashDot4 {
  350. left: 100px;
  351. top: 332px;
  352. }
  353. .flashDot5 {
  354. bottom: 225px;
  355. left: 112px;
  356. }
  357. .flashDot6 {
  358. bottom: 133px;
  359. left: 63px;
  360. }
  361. .flashDot7 {
  362. bottom: 141px;
  363. left: 126px;
  364. }
  365. .flashDot8 {
  366. bottom: 85px;
  367. left: 64px;
  368. }
  369. .flashDot9 {
  370. bottom: 90px;
  371. left: 122px;
  372. }
  373. /*温控开关 */
  374. .tempTitel,
  375. .switchbox {
  376. display: inline-block;
  377. vertical-align: middle;
  378. }
  379. .switchBj {
  380. width: 60px;
  381. height: 30px;
  382. background: #c8c8c8;
  383. border-radius: 20px;
  384. position: relative;
  385. }
  386. .switchBj:after {
  387. position: absolute;
  388. content: '关';
  389. left: 9px;
  390. line-height: 30px;
  391. color: #fff;
  392. }
  393. .switchBj:before {
  394. position: absolute;
  395. content: '开';
  396. left: 34px;
  397. line-height: 30px;
  398. color: #fff;
  399. }
  400. .switchBj span {
  401. display: inline-block;
  402. width: 26px;
  403. height: 26px;
  404. background: #fff;
  405. border-radius: 50%;
  406. box-shadow: 1px 1px 4px #515151;
  407. position: absolute;
  408. left: 30px;
  409. top: 2px;
  410. }
  411. .switchInp {
  412. display: none;
  413. }
  414. .switchInp:checked+.switchBj {
  415. background: #468FCC;
  416. border-color: #468FCC;
  417. }
  418. .switchInp:checked+.switchBj span {
  419. left: 2px;
  420. }
  421. /* 温度提示 */
  422. .weatherType {
  423. margin: 31px 0;
  424. }
  425. .font18 {
  426. font-size: 18px;
  427. }
  428. .tempTypeImg {
  429. width: 30%;
  430. float: left;
  431. height: 60px;
  432. line-height: 60px;
  433. }
  434. .tempTypeImg img {
  435. width: 100%;
  436. }
  437. .tempTypeValue {
  438. float: left;
  439. width: 70%;
  440. text-align: center;
  441. line-height: 28px;
  442. }
  443. /* 配置form */
  444. .coerceConfig{
  445. display: none;
  446. background: white;
  447. position: fixed;
  448. left: 25%;
  449. right: 25%;
  450. top: 20%;
  451. padding-bottom: 30px;
  452. z-index: 999999;
  453. }
  454. .configTitle{
  455. font-size: 22px;
  456. padding: 15px;
  457. text-indent: 8%;
  458. color: #10659d;
  459. }
  460. .markimg{
  461. display: none;
  462. position: fixed;
  463. left: 0;
  464. right: 0;
  465. top: 0;
  466. bottom: 0;
  467. background: rgba(0,0,0,.5);
  468. z-index: 98;
  469. }
  470. </style>
  471. </head>
  472. <body>
  473. <div class="content">
  474. <div class="page-header">
  475. <h1>
  476. <font style="vertical-align: inherit;">
  477. <font style="vertical-align: inherit;">
  478. 测报灯设备详情
  479. </font>
  480. </font>
  481. </h1>
  482. </div>
  483. <div class="userinfocover">
  484. <div class="row userinfo">
  485. <div class="col-xs-11">
  486. <i class="fa fa-user-o" aria-hidden="true"></i>
  487. 设备ID:
  488. <span class="userinfoTitle">{{equip_id}}</span>
  489. 设备名称:
  490. <span class="userinfoTitle" id="equip_name"></span>
  491. 上报时间:
  492. <span class="userinfoTitle" id="upl_time"></span>
  493. 位置:
  494. <span class="userinfoTitle" id="curr_area"></span>
  495. </div>
  496. <div class="col-xs-1 refresh">
  497. <button type="button" class="btn btn-sm btn-success" onclick="reloadPage()">刷新</button>
  498. <button type="button" class="btn btn-sm btn-primary" id="operationBtn" onclick="operation()">操作</button>
  499. </div>
  500. </div>
  501. <div id="handleBtns" style="display:none">
  502. <div style="padding: 20px; background-color: #F2F2F2;" id="">
  503. <div class="layui-row layui-col-space15">
  504. <div class="layui-col-md6">
  505. <div class="layui-card">
  506. <div class="layui-card-header">上仓门操作</div>
  507. <div class="layui-card-body">
  508. <div class="layui-row layui-col-space15">
  509. <div class="layui-col-md6">
  510. <button type="button" class="btn btn-sm btn-success" onclick="handleFun('ctrl','up','open')">打开上仓门</button>
  511. </div>
  512. <div class="layui-col-md6">
  513. <button type="button" class="btn btn-sm btn-success" onclick="handleFun('ctrl','up','close')">关闭上仓门</button>
  514. </div>
  515. <div class="layui-col-md6">
  516. <button type="button" class="btn btn-sm btn-success" onclick="handleFun('ctrl','up','force_open')">强制打开上仓门</button>
  517. </div>
  518. <div class="layui-col-md6">
  519. <button type="button" class="btn btn-sm btn-success" onclick="handleFun('ctrl','up','force_close')">强制关闭上仓门</button>
  520. </div>
  521. </div>
  522. </div>
  523. </div>
  524. </div>
  525. <div class="layui-col-md6">
  526. <div class="layui-card">
  527. <div class="layui-card-header">下仓门操作</div>
  528. <div class="layui-card-body">
  529. <div class="layui-row layui-col-space15">
  530. <div class="layui-col-md6">
  531. <button type="button" class="btn btn-sm btn-yellow" onclick="handleFun('ctrl','down','open')">打开下仓门</button>
  532. <br />
  533. </div>
  534. <div class="layui-col-md6">
  535. <button type="button" class="btn btn-sm btn-yellow" onclick="handleFun('ctrl','down','close')">关闭下仓门</button>
  536. <br />
  537. </div>
  538. <div class="layui-col-md6">
  539. <button type="button" class="btn btn-sm btn-yellow" onclick="handleFun('ctrl','dowm','force_open')">强制打开下仓门</button>
  540. </div>
  541. <div class="layui-col-md6">
  542. <button type="button" class="btn btn-sm btn-yellow" onclick="handleFun('ctrl','down','force_close')">强制关闭下仓门</button>
  543. </div>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. <div class="layui-col-md12">
  549. <div class="layui-card">
  550. <div class="layui-card-header">强制操作</div>
  551. <div class="layui-card-body">
  552. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('拍照','ctrl','takephoto','')">拍照</button>
  553. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('清虫','ctrl','turn','')">清虫</button>
  554. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('升级','update','','')">升级</button>
  555. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启','reboot','','')">重启</button>
  556. <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('配置','config','1','')">板子配置</button>
  557. <!-- <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('配置','config','2','')">图片上传路径</button> -->
  558. </div>
  559. </div>
  560. </div>
  561. </div>
  562. </div>
  563. </div>
  564. <div class="row">
  565. <!-- 设备模型 -->
  566. <div class="col-xs-12 col-md-6">
  567. <div class="backStyle equipInfo equiptInfo" id="showall">
  568. <div id="animatCover">
  569. <div class="flashDot flashDot1">
  570. <div class="line"></div>
  571. <div class="panelBox">
  572. <div class="bgimg">
  573. <div class="text" id="csq"></div>
  574. </div>
  575. </div>
  576. </div>
  577. <div class="flashDot flashDot2" style=" transform:rotateY(180deg) rotateX(0deg);">
  578. <div class="line"></div>
  579. <div class="panelBox">
  580. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  581. <div class="text" id="rps"></div>
  582. </div>
  583. </div>
  584. </div>
  585. <div class="flashDot flashDot3">
  586. <div class="line"></div>
  587. <div class="panelBox">
  588. <div class="bgimg">
  589. <div class="text">
  590. 诱虫灯管
  591. </div>
  592. </div>
  593. </div>
  594. </div>
  595. <div class="flashDot flashDot4" style=" transform:rotateY(180deg) rotateX(0deg);">
  596. <div class="line"></div>
  597. <div class="panelBox">
  598. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  599. <div class="text" id="lps"></div>
  600. </div>
  601. </div>
  602. </div>
  603. <div class="flashDot flashDot5">
  604. <div class="line"></div>
  605. <div class="panelBox">
  606. <div class="bgimg">
  607. <div class="text" id="gs"></div>
  608. </div>
  609. </div>
  610. </div>
  611. <div class="flashDot flashDot6" style=" transform:rotateY(180deg) rotateX(0deg);">
  612. <div class="line"></div>
  613. <div class="panelBox">
  614. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  615. <div class="text" id="hs"></div>
  616. </div>
  617. </div>
  618. </div>
  619. <div class="flashDot flashDot7">
  620. <div class="line"></div>
  621. <div class="panelBox">
  622. <div class="bgimg">
  623. <div class="text" id="upds"></div>
  624. </div>
  625. </div>
  626. </div>
  627. <div class="flashDot flashDot8" style=" transform:rotateY(180deg) rotateX(0deg);">
  628. <div class="line bottomline"></div>
  629. <div class="panelBox bottompanel">
  630. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  631. <div class="text" id="hrt"></div>
  632. </div>
  633. </div>
  634. </div>
  635. <div class="flashDot flashDot9">
  636. <div class="line bottomline"></div>
  637. <div class="panelBox bottompanel">
  638. <div class="bgimg">
  639. <div class="text" id="dnds"></div>
  640. </div>
  641. </div>
  642. </div>
  643. </div>
  644. </div>
  645. </div>
  646. <!-- 右边 -->
  647. <div class="col-xs-12 col-md-6" style="padding-left: 0px;padding-right:0px">
  648. <!-- 信息条 -->
  649. <div class="equipInfo">
  650. <div class="row" style="margin-left: 0;">
  651. <div class="col-xs-6">
  652. <div class="haloParent">
  653. <div class="halo halo6"></div>
  654. <div class="solidCircle solidCircle6">
  655. <img class="haloIcon" src="{% static '/img/haloIcon4.png' %}" alt="">
  656. </div>
  657. </div>
  658. <div class="txt">
  659. <span class="typeResult" id="dver"></span>
  660. <p class="typeResult">设备版本</p>
  661. </div>
  662. </div>
  663. <div class="col-xs-6">
  664. <div class="haloParent">
  665. <div class="halo halo4"></div>
  666. <div class="solidCircle solidCircle4">
  667. <img class="haloIcon" src="{% static '/img/haloIcon1.png' %}" alt="">
  668. </div>
  669. </div>
  670. <div class="txt">
  671. <span class="typeResult" id="lng">经度:113.46655</span>
  672. <p class="typeResult" id="lat">纬度:48.121211</p>
  673. </div>
  674. </div>
  675. </div>
  676. </div>
  677. <div class="row">
  678. <!-- 温控状态 -->
  679. <div class="col-xs-4" style="padding-left: 0;">
  680. <div class="backStyle" style="margin-bottom:20px">
  681. <span class="typeResult tempTitel">温控状态:</span>
  682. <div class="switchbox">
  683. <input class="switchInp" id="tps" type="checkbox">
  684. <div class="switchBj">
  685. <span></span>
  686. </div>
  687. </div>
  688. </div>
  689. <div class="backStyle">
  690. <div class="temperatureKind">
  691. <div class="clearfix weatherType">
  692. <div class="tempTypeImg">
  693. <img src="{% static '/img/statusIcon1.png' %}" alt="">
  694. </div>
  695. <div class="tempTypeValue">
  696. <p class="font18" id="tpl">1℃</p>
  697. <p>低温限值</p>
  698. </div>
  699. </div>
  700. <div class="clearfix weatherType">
  701. <div class="tempTypeImg">
  702. <img src="{% static '/img/statusIcon2.png' %}" alt="">
  703. </div>
  704. <div class="tempTypeValue">
  705. <p class="font18" id="tph">70℃</p>
  706. <p>高温限值</p>
  707. </div>
  708. </div>
  709. <div class="clearfix weatherType">
  710. <div class="tempTypeImg">
  711. <img src="{% static '/img/statusIcon3.png' %}" alt="">
  712. </div>
  713. <div class="tempTypeValue">
  714. <p class="font18" id="at"></p>
  715. <p>环境温度</p>
  716. </div>
  717. </div>
  718. <div class="clearfix weatherType">
  719. <div class="tempTypeImg">
  720. <img src="{% static '/img/statusIcon4.png' %}" alt="">
  721. </div>
  722. <div class="tempTypeValue">
  723. <p class="font18" id="ah"></p>
  724. <p>环境湿度</p>
  725. </div>
  726. </div>
  727. </div>
  728. </div>
  729. </div>
  730. <!-- 配置 -->
  731. <div class="col-xs-8" style="padding-left: 0;">
  732. <div class="backStyle">
  733. <div id="configParent" class="loadingParent">
  734. <div id="" class="loadCenter">
  735. <div class="skype-loader">
  736. <div class="dot">
  737. <div class="first"></div>
  738. </div>
  739. <div class="dot"></div>
  740. <div class="dot"></div>
  741. <div class="dot"></div>
  742. </div>
  743. 配置更新中...
  744. </div>
  745. </div>
  746. <div class="widget-body">
  747. <div class="row">
  748. <div class="form-group">
  749. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  750. <font style="vertical-align: inherit;">
  751. <font style="vertical-align: inherit;"> 定时模式 </font>
  752. </font>
  753. </label>
  754. <div class="col-sm-9">
  755. <select name="timing" id="timing">
  756. <option value="0">光控</option>
  757. <option value="1">时控</option>
  758. </select>
  759. </div>
  760. <div style="clear:both"></div>
  761. </div>
  762. <!-- 1结束 -->
  763. <div class="form-group lightPattern">
  764. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  765. <font style="vertical-align: inherit;">
  766. <font style="vertical-align: inherit;"> 定时时长 </font>
  767. </font>
  768. </label>
  769. <div class="col-sm-9">
  770. <span class="initVal">1</span>
  771. <div class="slider" id="timingLength-slider"></div>
  772. <span class="sliderVal" id="timingLength">1</span>
  773. </div>
  774. <div style="clear:both"></div>
  775. </div>
  776. <!-- 2结束 -->
  777. <div class="form-group timePattern">
  778. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  779. <font style="vertical-align: inherit;">
  780. <font style="vertical-align: inherit;"> 开始结束时间 </font>
  781. </font>
  782. </label>
  783. <div class="col-sm-9">
  784. <div>
  785. <span class="hintTitle">开始时间</span>
  786. <span class="hintTitle">结束时间</span>
  787. </div>
  788. <select name="begin" id="begin">
  789. <option value="0">0</option>
  790. <option value="1">1</option>
  791. <option value="2">2</option>
  792. <option value="3">3</option>
  793. <option value="4">4</option>
  794. <option value="5">5</option>
  795. <option value="6">6</option>
  796. <option value="7">7</option>
  797. <option value="8">8</option>
  798. <option value="9">9</option>
  799. <option value="10">10</option>
  800. <option value="11">11</option>
  801. <option value="12">12</option>
  802. <option value="13">13</option>
  803. <option value="14">14</option>
  804. <option value="15">15</option>
  805. <option value="16">16</option>
  806. <option value="17">17</option>
  807. <option value="18">18</option>
  808. <option value="19">19</option>
  809. <option value="20">20</option>
  810. <option value="21">21</option>
  811. <option value="22">22</option>
  812. <option value="23">23</option>
  813. </select>
  814. 至
  815. <select name="end" id="end">
  816. <option value="0">0</option>
  817. <option value="1">1</option>
  818. <option value="2">2</option>
  819. <option value="3">3</option>
  820. <option value="4">4</option>
  821. <option value="5">5</option>
  822. <option value="6">6</option>
  823. <option value="7">7</option>
  824. <option value="8">8</option>
  825. <option value="9">9</option>
  826. <option value="10">10</option>
  827. <option value="11">11</option>
  828. <option value="12">12</option>
  829. <option value="13">13</option>
  830. <option value="14">14</option>
  831. <option value="15">15</option>
  832. <option value="16">16</option>
  833. <option value="17">17</option>
  834. <option value="18">18</option>
  835. <option value="19">19</option>
  836. <option value="20">20</option>
  837. <option value="21">21</option>
  838. <option value="22">22</option>
  839. <option value="23">23</option>
  840. </select>
  841. </div>
  842. <div style="clear:both"></div>
  843. </div>
  844. <!-- 3结束 -->
  845. <div class="form-group">
  846. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  847. <font style="vertical-align: inherit;">
  848. <font style="vertical-align: inherit;"> 落虫时间 </font>
  849. </font>
  850. </label>
  851. <div class="col-sm-9">
  852. <span class="initVal">5</span>
  853. <div class="slider" id="dropTime-slider"></div>
  854. <span class="sliderVal" id="dropTime">20</span>
  855. </div>
  856. <div style="clear:both"></div>
  857. </div>
  858. <!-- 4结束 -->
  859. <div class="form-group">
  860. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  861. <font style="vertical-align: inherit;">
  862. <font style="vertical-align: inherit;"> 加热时间 </font>
  863. </font>
  864. </label>
  865. <div class="col-sm-9">
  866. <span class="initVal">5</span>
  867. <div class="slider" id="calefactionTime-slider"></div>
  868. <span class="sliderVal" id="calefactionTime">20</span>
  869. </div>
  870. <div style="clear:both"></div>
  871. </div>
  872. <!-- 5结束 -->
  873. <div class="form-group">
  874. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  875. <font style="vertical-align: inherit;">
  876. <font style="vertical-align: inherit;"> 加热温度 </font>
  877. </font>
  878. </label>
  879. <div class="col-sm-9">
  880. <span class="initVal">75</span>
  881. <div class="slider" id="calefactionTemperature-slider"></div>
  882. <span class="sliderVal" id="calefactionTemperature">125</span>
  883. </div>
  884. <div style="clear:both"></div>
  885. </div>
  886. <!-- 6结束 -->
  887. <div class="form-group">
  888. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  889. <font style="vertical-align: inherit;">
  890. <font style="vertical-align: inherit;"> 高温保护阈值 </font>
  891. </font>
  892. </label>
  893. <div class="col-sm-9">
  894. <span class="initVal">50</span>
  895. <div class="slider" id="highLimit-slider"></div>
  896. <span class="sliderVal" id="highLimit">70</span>
  897. </div>
  898. <div style="clear:both"></div>
  899. </div>
  900. <!-- 7结束 -->
  901. <div class="form-group">
  902. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  903. <font style="vertical-align: inherit;">
  904. <font style="vertical-align: inherit;"> 低温保护阈值 </font>
  905. </font>
  906. </label>
  907. <div class="col-sm-9">
  908. <span class="initVal">1</span>
  909. <div class="slider" id="lowLimit-slider"></div>
  910. <span class="sliderVal" id="lowLimit">10</span>
  911. </div>
  912. <div style="clear:both"></div>
  913. </div>
  914. <!-- 8结束 -->
  915. <div class="form-group">
  916. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  917. <font style="vertical-align: inherit;">
  918. <font style="vertical-align: inherit;"> 数据上传时间间隔 </font>
  919. </font>
  920. </label>
  921. <div class="col-sm-9">
  922. <span class="initVal">10</span>
  923. <div class="slider" id="dataUpTime-slider"></div>
  924. <span class="sliderVal" id="dataUpTime">60</span>
  925. </div>
  926. <div style="clear:both"></div>
  927. </div>
  928. <!-- 9结束 -->
  929. <div class="form-group">
  930. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  931. <font style="vertical-align: inherit;">
  932. <font style="vertical-align: inherit;"> 图片分辨率 </font>
  933. </font>
  934. </label>
  935. <div class="col-sm-9">
  936. <select name="imgHvga" id="imgHvga">
  937. <option value="0">高</option>
  938. <option value="1">中</option>
  939. <option value="2">低</option>
  940. </select>
  941. </div>
  942. <div style="clear:both"></div>
  943. </div>
  944. <!-- 结束 -->
  945. </div>
  946. <div class="collocateBtn">
  947. <button class="btn btn-sm btn-info" onclick="saveOperation()">
  948. <font style="vertical-align: inherit;">
  949. <font style="vertical-align: inherit;">确定</font>
  950. </font>
  951. </button>
  952. <button class="btn btn-sm" onclick="cancelConfig()">
  953. <font style="vertical-align: inherit;">
  954. <font style="vertical-align: inherit;">取消</font>
  955. </font>
  956. </button>
  957. </div>
  958. </div>
  959. </div>
  960. </div>
  961. </div>
  962. </div>
  963. </div>
  964. </div>
  965. <!-- 强制配置弹框 -->
  966. <div class="coerceConfig">
  967. <h1 class="configTitle">MQTT配置</h1>
  968. <form class="form-horizontal" role="form">
  969. <div class="form-group">
  970. <label class="col-sm-3 control-label no-padding-right">MQTT地址</label>
  971. <div class="col-sm-9">
  972. <input type="text" id="plankUrl" class="col-sm-6" placeholder="xxxx.com">
  973. </div>
  974. </div>
  975. <div class="form-group">
  976. <label class="col-sm-3 control-label no-padding-right">MQTT端口</label>
  977. <div class="col-sm-9">
  978. <input type="text" id="port" class="col-sm-6" placeholder="1883">
  979. </div>
  980. </div>
  981. <div class="form-group">
  982. <label class="col-sm-3 control-label no-padding-right">图片上传地址</label>
  983. <div class="col-sm-9">
  984. <input type="text" id="photoUrl" class="col-sm-6" placeholder="http://xxxxx.com">
  985. </div>
  986. </div>
  987. <div class="clearfix">
  988. <div class="col-md-offset-3 col-md-9">
  989. <button class="btn btn-sm" type="reset" onclick="closeConfig()">
  990. <i class="ace-icon fa fa-undo bigger-110"></i>
  991. 取消
  992. </button>
  993. &nbsp; &nbsp; &nbsp;
  994. <button class="btn btn-sm btn-info" type="button" onclick="saveConfig()">
  995. <i class="ace-icon fa fa-check bigger-110"></i>
  996. 确定
  997. </button>
  998. </div>
  999. </div>
  1000. </form>
  1001. </div>
  1002. <div class="markimg"></div>
  1003. <!-- loading -->
  1004. <div id="loadingParent">
  1005. <div id="loadCenter">
  1006. <div class="skype-loader">
  1007. <div class="dot">
  1008. <div class="first"></div>
  1009. </div>
  1010. <div class="dot"></div>
  1011. <div class="dot"></div>
  1012. <div class="dot"></div>
  1013. </div>
  1014. 正在更新...
  1015. </div>
  1016. </div>
  1017. <input type="hidden" value="{{equip_id}}" id="imei">
  1018. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  1019. <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
  1020. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  1021. <script src="{% static '/assets/js/ace.min.js' %}"></script>
  1022. <script src="{% static '/assets/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script>
  1023. <script src="{% static '/assets/js/main.js' %}" type="text/javascript" charset="utf-8"></script>
  1024. <script src="{% static '/assetsDemo/js/jquery-ui.min.js' %}"></script>
  1025. <script src="{% static '/assetsDemo/js/jquery.ui.touch-punch.min.js' %}"></script>
  1026. <script src="{% static '/lib/detailsAnimat.js' %}"></script>
  1027. <script src="{% static '/lib/coordOffset.js' %}"></script>
  1028. <script>
  1029. /**!
  1030. * easy-pie-chart
  1031. * Lightweight plugin to render simple, animated and retina optimized pie charts
  1032. *
  1033. * @license
  1034. * @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
  1035. * @version 2.1.7
  1036. **/
  1037. !function (a, b) { "function" == typeof define && define.amd ? define(["jquery"], function (a) { return b(a) }) : "object" == typeof exports ? module.exports = b(require("jquery")) : b(jQuery) }(this, function (a) { var b = function (a, b) { var c, d = document.createElement("canvas"); a.appendChild(d), "object" == typeof G_vmlCanvasManager && G_vmlCanvasManager.initElement(d); var e = d.getContext("2d"); d.width = d.height = b.size; var f = 1; window.devicePixelRatio > 1 && (f = window.devicePixelRatio, d.style.width = d.style.height = [b.size, "px"].join(""), d.width = d.height = b.size * f, e.scale(f, f)), e.translate(b.size / 2, b.size / 2), e.rotate((-0.5 + b.rotate / 180) * Math.PI); var g = (b.size - b.lineWidth) / 2; b.scaleColor && b.scaleLength && (g -= b.scaleLength + 2), Date.now = Date.now || function () { return +new Date }; var h = function (a, b, c) { c = Math.min(Math.max(-1, c || 0), 1); var d = 0 >= c; e.beginPath(), e.arc(0, 0, g, 0, 2 * Math.PI * c, d), e.strokeStyle = a, e.lineWidth = b, e.stroke() }, i = function () { var a, c; e.lineWidth = 1, e.fillStyle = b.scaleColor, e.save(); for (var d = 24; d > 0; --d)d % 6 === 0 ? (c = b.scaleLength, a = 0) : (c = .6 * b.scaleLength, a = b.scaleLength - c), e.fillRect(-b.size / 2 + a, 0, c, 1), e.rotate(Math.PI / 12); e.restore() }, j = function () { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (a) { window.setTimeout(a, 1e3 / 60) } }(), k = function () { b.scaleColor && i(), b.trackColor && h(b.trackColor, b.trackWidth || b.lineWidth, 1) }; this.getCanvas = function () { return d }, this.getCtx = function () { return e }, this.clear = function () { e.clearRect(b.size / -2, b.size / -2, b.size, b.size) }, this.draw = function (a) { b.scaleColor || b.trackColor ? e.getImageData && e.putImageData ? c ? e.putImageData(c, 0, 0) : (k(), c = e.getImageData(0, 0, b.size * f, b.size * f)) : (this.clear(), k()) : this.clear(), e.lineCap = b.lineCap; var d; d = "function" == typeof b.barColor ? b.barColor(a) : b.barColor, h(d, b.lineWidth, a / 100) }.bind(this), this.animate = function (a, c) { var d = Date.now(); b.onStart(a, c); var e = function () { var f = Math.min(Date.now() - d, b.animate.duration), g = b.easing(this, f, a, c - a, b.animate.duration); this.draw(g), b.onStep(a, c, g), f >= b.animate.duration ? b.onStop(a, c) : j(e) }.bind(this); j(e) }.bind(this) }, c = function (a, c) { var d = { barColor: "#ef1e25", trackColor: "#f9f9f9", scaleColor: "#dfe0e0", scaleLength: 5, lineCap: "round", lineWidth: 3, trackWidth: void 0, size: 110, rotate: 0, animate: { duration: 1e3, enabled: !0 }, easing: function (a, b, c, d, e) { return b /= e / 2, 1 > b ? d / 2 * b * b + c : -d / 2 * (--b * (b - 2) - 1) + c }, onStart: function (a, b) { }, onStep: function (a, b, c) { }, onStop: function (a, b) { } }; if ("undefined" != typeof b) d.renderer = b; else { if ("undefined" == typeof SVGRenderer) throw new Error("Please load either the SVG- or the CanvasRenderer"); d.renderer = SVGRenderer } var e = {}, f = 0, g = function () { this.el = a, this.options = e; for (var b in d) d.hasOwnProperty(b) && (e[b] = c && "undefined" != typeof c[b] ? c[b] : d[b], "function" == typeof e[b] && (e[b] = e[b].bind(this))); "string" == typeof e.easing && "undefined" != typeof jQuery && jQuery.isFunction(jQuery.easing[e.easing]) ? e.easing = jQuery.easing[e.easing] : e.easing = d.easing, "number" == typeof e.animate && (e.animate = { duration: e.animate, enabled: !0 }), "boolean" != typeof e.animate || e.animate || (e.animate = { duration: 1e3, enabled: e.animate }), this.renderer = new e.renderer(a, e), this.renderer.draw(f), a.dataset && a.dataset.percent ? this.update(parseFloat(a.dataset.percent)) : a.getAttribute && a.getAttribute("data-percent") && this.update(parseFloat(a.getAttribute("data-percent"))), a.style.width = a.style.height = e.size + "px", a.style.lineHeight = e.size - 1 + "px" }.bind(this); this.update = function (a) { return a = parseFloat(a), e.animate.enabled ? this.renderer.animate(f, a) : this.renderer.draw(a), f = a, this }.bind(this), this.disableAnimation = function () { return e.animate.enabled = !1, this }, this.enableAnimation = function () { return e.animate.enabled = !0, this }, g() }; a.fn.easyPieChart = function (b) { return this.each(function () { var d; a.data(this, "easyPieChart") || (d = a.extend({}, b, a(this).data()), a.data(this, "easyPieChart", new c(this, d))) }) } });
  1038. </script>
  1039. <script type="text/javascript">
  1040. $.ajaxSetup({
  1041. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  1042. });
  1043. $('#iframe-main', parent.document).css('height', $('.content').height() + 40)
  1044. $(window).resize(function () {
  1045. $('#iframe-main', parent.document).css('height', $('.content').height() + 40)
  1046. });
  1047. var parentUserName = $('#parentUserName', parent.document).html();
  1048. if (!(parentUserName == 'admin' || parentUserName == 'user')) {
  1049. $('#operationBtn').remove();
  1050. $('#handleBtns').remove();
  1051. }
  1052. // 自定义动画
  1053. animate.init();
  1054. animate.showAll();
  1055. $('#showall').on('click',function(e){
  1056. animate.showAll();
  1057. e.stopPropagation();
  1058. })
  1059. // 获取位置
  1060. var geoc = new BMap.Geocoder();
  1061. var configData = '';//配置数据
  1062. // 获取当前设备状态信息
  1063. $.ajax({
  1064. url: 'equipmanage_cbd_detail',
  1065. type: 'post',
  1066. dataType: 'json',
  1067. data: {
  1068. id: $('#imei').val()
  1069. },
  1070. success: function (data) {
  1071. equipData(data);
  1072. }
  1073. })
  1074. function equipData(dat) {
  1075. var equipStatus = dat[0];
  1076. var equipData = dat[1];
  1077. $('#equip_name').html(equipStatus.equip_name || '无');
  1078. $('#upl_time').html(equipStatus.upl_time);
  1079. var stat = eval('(' + equipStatus.cbd_status + ')');;
  1080. var cbd_data = eval('(' + equipData.cbd_data + ')');;
  1081. // $('#ts').html(stat.ts ? '时控' : '光控');//定时模式
  1082. $('#gs').html('当前通道:' + (stat.gs ? '落虫' : '排水'));//通道模式
  1083. $('#upds').html('上仓门:' + (stat.upds ? '打开' : '关闭'));//上仓门
  1084. $('#dnds').html('下仓门:' + (stat.dnds ? '打开' : '关闭'));//下舱门
  1085. $('#csq').html('信号强度:' + stat.csq);//信号强度
  1086. $('#dver').html(stat.dver);//版本号
  1087. if (stat.lng > 999) {
  1088. var lng = Math.floor(stat.lng / 100) + ((stat.lng % 100) / 60);
  1089. var lat = Math.floor(stat.lat / 100) + ((stat.lat % 100) / 60);
  1090. } else {
  1091. var lng = Number(stat.lng);
  1092. var lat = Number(stat.lat);
  1093. }
  1094. var lng1 = wgs84togcj02(lng, lat);
  1095. var lng2 = gcj02tobd09(lng1[0], lng1[1]);
  1096. var pt = new BMap.Point(lng2[0], lng2[1]);
  1097. geoc.getLocation(pt, function(rs){
  1098. var addComp = rs.addressComponents;
  1099. // $('.area').html('位置:'+ addComp.province + ", " + addComp.city + ", " + addComp.district)
  1100. $('#curr_area').html(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
  1101. });
  1102. $('#lat').html('纬度:' + lat.toFixed(5));//维度
  1103. $('#lng').html('经度:' + lng.toFixed(4));//经度
  1104. $('#tps').html(stat.tps ? '异常' : '正常');
  1105. if (cbd_data.tps == 0) {//温控状态
  1106. $('#tps').attr('checked', 'checked');
  1107. } else {
  1108. $('#tps').attr('checked', false);
  1109. }
  1110. $('#lps').html('光控检测:' + (stat.lps ? '异常' : '正常'));//光控状态
  1111. $('#hs').html('加热开关:' + (stat.hs ? '开启' : '关闭'));//加热状态
  1112. $('#rps').html('雨控状态:' + (stat.rps ? '异常' : '正常'));//雨控状态
  1113. $('#hrt').html('加热仓温度:' + cbd_data.hrt);//加热仓温度
  1114. $('#at').html((cbd_data.at / 10).toFixed(1) + '℃');//环境温度
  1115. $('#ah').html((cbd_data.ah / 10).toFixed(1) + '℃');//环境湿度
  1116. }
  1117. $('#timing').on('change', function () {
  1118. if ($(this).val() == 0) {
  1119. $('.lightPattern').show();
  1120. $('.timePattern').hide();
  1121. } else {
  1122. $('.lightPattern').hide();
  1123. $('.timePattern').show();
  1124. }
  1125. })
  1126. // $('.slider').slider({
  1127. // disabled: true,
  1128. // })
  1129. // 1定时时长
  1130. $("#timingLength-slider").css('width', '85%').slider({
  1131. value: 1,
  1132. range: "min",
  1133. min: 1,
  1134. max: 10,
  1135. step: 1,
  1136. slide: function (event, ui) {
  1137. var val = parseInt(ui.value);
  1138. $('#timingLength').html(val);
  1139. }
  1140. });
  1141. // 2落虫
  1142. $("#dropTime-slider").css('width', '85%').slider({
  1143. value: 5,
  1144. range: "min",
  1145. min: 5,
  1146. max: 20,
  1147. step: 1,
  1148. slide: function (event, ui) {
  1149. var val = parseInt(ui.value);
  1150. $('#dropTime').html(val);
  1151. }
  1152. });
  1153. // 3加热时间
  1154. $("#calefactionTime-slider").css('width', '85%').slider({
  1155. value: 5,
  1156. range: "min",
  1157. min: 5,
  1158. max: 20,
  1159. step: 1,
  1160. slide: function (event, ui) {
  1161. var val = parseInt(ui.value);
  1162. $('#calefactionTime').html(val);
  1163. }
  1164. });
  1165. // 4加热温度
  1166. $("#calefactionTemperature-slider").css('width', '85%').slider({
  1167. value: 75,
  1168. range: "min",
  1169. min: 75,
  1170. max: 120,
  1171. step: 1,
  1172. slide: function (event, ui) {
  1173. var val = parseInt(ui.value);
  1174. $('#calefactionTemperature').html(val);
  1175. }
  1176. });
  1177. // 5高温保护阈值
  1178. $("#highLimit-slider").css('width', '85%').slider({
  1179. value: 50,
  1180. range: "min",
  1181. min: 50,
  1182. max: 70,
  1183. step: 1,
  1184. slide: function (event, ui) {
  1185. var val = parseInt(ui.value);
  1186. $('#highLimit').html(val);
  1187. }
  1188. });
  1189. // 6低温保护阈值
  1190. $("#lowLimit-slider").css('width', '85%').slider({
  1191. value: 1,
  1192. range: "min",
  1193. min: 1,
  1194. max: 10,
  1195. step: 1,
  1196. slide: function (event, ui) {
  1197. var val = parseInt(ui.value);
  1198. $('#lowLimit').html(val);
  1199. }
  1200. });
  1201. // 7数据上相间隔
  1202. $("#dataUpTime-slider").css('width', '85%').slider({
  1203. value: 1,
  1204. range: "min",
  1205. min: 10,
  1206. max: 60,
  1207. step: 10,
  1208. slide: function (event, ui) {
  1209. var val = parseInt(ui.value);
  1210. $('#dataUpTime').html(val);
  1211. }
  1212. });
  1213. //刷新:下发查询:
  1214. function reloadPage() {
  1215. var id = $('#imei').val();
  1216. $.ajax({
  1217. type: "post",
  1218. url: 'cbd_mqtt',
  1219. async: false,
  1220. data: {
  1221. "req": "read",//读取
  1222. "topicid": id,
  1223. "kind": "status"//读取下位机状态
  1224. },
  1225. dataType: "json",
  1226. success: function (data) {
  1227. if (data == "0") {
  1228. $.ajax({
  1229. type: "post",
  1230. url: 'cbd_mqtt',
  1231. async: false,
  1232. data: {
  1233. "req": "read",//读取
  1234. "topicid": id,
  1235. "kind": "data"//读取下位机状态
  1236. },
  1237. dataType: "json",
  1238. beforeSend: function () {
  1239. $('#loadingParent').show();
  1240. },
  1241. complete: function () {
  1242. setTimeout(function () {
  1243. $('#loadingParent').hide();
  1244. }, 6000)
  1245. },
  1246. success: function (data) {
  1247. if (data == "0") {
  1248. layer.msg("下发查询发送成功!")
  1249. setTimeout(function () {
  1250. // 获取当前设备状态信息
  1251. $.ajax({
  1252. url: 'equipmanage_cbd_detail',
  1253. type: 'post',
  1254. dataType: 'json',
  1255. data: {
  1256. id: $('#imei').val()
  1257. },
  1258. success: function (data) {
  1259. equipData(data);
  1260. }
  1261. })
  1262. }, 6000)
  1263. } else {
  1264. layer.msg("发送失败!")
  1265. }
  1266. }
  1267. })
  1268. } else {
  1269. layer.msg("发送失败!")
  1270. }
  1271. }
  1272. })
  1273. }
  1274. configurationSwitch()
  1275. // 配置按钮
  1276. function configurationSwitch() {
  1277. var id = $('#imei').val();
  1278. $.ajax({
  1279. type: "post",
  1280. url: 'cbd_mqtt',
  1281. data: {
  1282. "req": "read",//读取
  1283. "topicid": id,
  1284. "kind": "paramconf"//读取下位机状态
  1285. },
  1286. dataType: "json",
  1287. beforeSend: function () {
  1288. $('#configParent').show();
  1289. },
  1290. complete: function () {
  1291. setTimeout(function () {
  1292. $('#configParent').hide();
  1293. }, 3000)
  1294. },
  1295. success: function (data) {
  1296. if (data == "0") {
  1297. // layer.msg("发送成功!", { time: 2000 })
  1298. setTimeout(function () {
  1299. $.ajax({
  1300. url: "equipmanage_cbd",
  1301. type: 'post',
  1302. data: {
  1303. id: id,
  1304. req: "paramconf",
  1305. },
  1306. success: function (data) {
  1307. configData = data;
  1308. configFill(data);
  1309. }
  1310. })
  1311. }, 3000)
  1312. } else {
  1313. layer.msg("发送失败!")
  1314. }
  1315. }
  1316. })
  1317. }
  1318. // 填充函数
  1319. function configFill(dat) {
  1320. var data = $.parseJSON(dat);
  1321. var para = eval("(" + data.paramconf + ")");
  1322. if (para != '' && para != null) {
  1323. // 定时模式
  1324. $('#timing').val(para.ts);
  1325. if (para.ts == 0) {
  1326. $('.lightPattern').show();
  1327. $('.timePattern').hide();
  1328. } else {
  1329. $('.lightPattern').hide();
  1330. $('.timePattern').show();
  1331. }
  1332. // 滑块
  1333. $("#timingLength-slider").slider('value', para.tt);
  1334. $('#timingLength').html(para.tt);
  1335. $("#dropTime-slider").slider('value', para.collt);
  1336. $('#dropTime').html(para.collt);
  1337. $("#calefactionTime-slider").slider('value', para.htim);
  1338. $('#calefactionTime').html(para.htim);
  1339. $("#calefactionTemperature-slider").slider('value', para.hst);
  1340. $('#calefactionTemperature').html(para.hst);
  1341. $("#highLimit-slider").slider('value', para.tph);
  1342. $('#highLimit').html(para.tph);//高温
  1343. $('#tph').html(para.tph + '℃');
  1344. $("#lowLimit-slider").slider('value', para.tpl);
  1345. $('#lowLimit').html(para.tpl);//低温
  1346. $('#tpl').html(para.tpl + '℃');
  1347. $("#dataUpTime-slider").slider('value', para.datt);
  1348. $('#dataUpTime').html(para.datt);
  1349. // 时间
  1350. if ($('#timing').val() == 1) {
  1351. $('#timSelectBox').val(Math.floor(para.st));
  1352. $('#timSelectBox2').val(Math.floor(para.et));
  1353. $('#begin').val(Math.floor(para.st));
  1354. $('#end').val(Math.floor(para.et));
  1355. }
  1356. $('#imgHvga').val(para.imgres);
  1357. $('.slider').slider({
  1358. disabled: false,
  1359. })
  1360. } else {
  1361. // 定时模式
  1362. $('#timing').val(0);
  1363. $('.lightPattern').show();
  1364. $('.timePattern').hide();
  1365. // 滑块
  1366. $("#timingLength-slider").slider('value', 1);
  1367. $('#timingLength').html(1);
  1368. $("#dropTime-slider").slider('value', 5);
  1369. $('#dropTime').html(5);
  1370. $("#calefactionTime-slider").slider('value', 5);
  1371. $('#calefactionTime').html(5);
  1372. $("#calefactionTemperature-slider").slider('value', 75);
  1373. $('#calefactionTemperature').html(75);
  1374. $("#highLimit-slider").slider('value', 50);
  1375. $('#highLimit').html(50);
  1376. $("#lowLimit-slider").slider('value', 1);
  1377. $('#lowLimit').html(1);
  1378. $("#dataUpTime-slider").slider('value', 10);
  1379. $('#dataUpTime').html(10);
  1380. $('#begin').val(0);
  1381. $('#end').val(0);
  1382. $('#imgHvga').val(0);
  1383. $('#tph').html('70℃');
  1384. $('#tpl').html('1℃');
  1385. }
  1386. }
  1387. //保存
  1388. function saveOperation() {
  1389. var data = {
  1390. req: 'set',
  1391. id: $('#imei').val(),
  1392. timing: $('#timing').val(),
  1393. timingLength: $('#timingLength').html(),
  1394. begin: $('#begin').val(),
  1395. end: $('#end').val(),
  1396. dropTime: $('#dropTime').html(),
  1397. calefactionTime: $('#calefactionTime').html(),
  1398. calefactionTemperature: $('#calefactionTemperature').html(),
  1399. highLimit: $('#highLimit').html(),
  1400. lowLimit: $('#lowLimit').html(),
  1401. dataUpTime: $('#dataUpTime').html(),
  1402. imgHvga: $('#imgHvga').val()
  1403. }
  1404. if ($('#timing').val() == 1) {
  1405. if ($('#begin').val() && $('#end').val()) {
  1406. saveOperationAjax('cbd_mqtt', data)
  1407. } else {
  1408. layer.msg("请将时控时间填写完整!");
  1409. }
  1410. } else {
  1411. saveOperationAjax('cbd_mqtt', data);
  1412. }
  1413. }
  1414. function saveOperationAjax(url, data) {
  1415. $.ajax({
  1416. url: url,
  1417. type: 'post',
  1418. data: data,
  1419. beforeSend: function () {
  1420. $('.loadingParent').show();
  1421. },
  1422. complete: function () {
  1423. setTimeout(function () {
  1424. $('.loadingParent').hide();
  1425. }, 3000)
  1426. },
  1427. success: function (data) {
  1428. if (data == "0") {
  1429. setTimeout(function () {
  1430. layer.msg("配置成功!");
  1431. $('#tph').html($('#highLimit').html()+'℃');
  1432. $('#tpl').html($('#lowLimit').html()+'℃');
  1433. }, 3000)
  1434. }
  1435. }
  1436. })
  1437. }
  1438. // 取消配置
  1439. function cancelConfig() {
  1440. configFill(configData)
  1441. }
  1442. var popupIndex;
  1443. //operation配置弹框
  1444. function operation() {
  1445. //页面层
  1446. popupIndex = layer.open({
  1447. type: 1,
  1448. skin: 'layui-layer-rim', //加上边框
  1449. // area: ['420px', '240px'], //宽高
  1450. area: ["50%"],
  1451. content: $('#handleBtns').html()
  1452. });
  1453. }
  1454. // var confogFlag = 1;
  1455. function popupFrame(str, cmd, type, data) {
  1456. //询问框
  1457. layer.confirm('确定' + str + '?', {
  1458. icon: 3,
  1459. btn: ['确定', '取消'] //按钮
  1460. }, function (index) {
  1461. if(cmd == 'config'){
  1462. layer.close(popupIndex)
  1463. // if(type == 1){
  1464. // confogFlag = 1;
  1465. // $('.coerceConfig .configTitle').html('配置板子地址');
  1466. // $('.coerceConfig .form-group').eq(0).show();
  1467. // $('.coerceConfig .form-group').eq(1).show();
  1468. // $('.coerceConfig .form-group').eq(2).hide();
  1469. // }else{
  1470. // confogFlag = 2;
  1471. // $('.coerceConfig .configTitle').html('配置图片上传地址');
  1472. // $('.coerceConfig .form-group').eq(0).hide();
  1473. // $('.coerceConfig .form-group').eq(1).hide();
  1474. // $('.coerceConfig .form-group').eq(2).show();
  1475. // }
  1476. $('.markimg').show();
  1477. $('.coerceConfig').show();
  1478. }else{
  1479. handleFun(cmd, type, data);
  1480. }
  1481. layer.close(index);
  1482. }, function () {
  1483. });
  1484. }
  1485. function handleFun(cmd, type, data) {
  1486. var id = $('#imei').val();
  1487. $.ajax({
  1488. type: "post",
  1489. url: 'cbd_mqtt',
  1490. data: {
  1491. "req": "ctrl",//控制
  1492. "topicid": id,
  1493. "cmd": cmd,//升级 update
  1494. "type": type,
  1495. "data": data
  1496. },
  1497. dataType: "json",
  1498. beforeSend: function () {
  1499. $('#loadingParent').show();
  1500. },
  1501. complete: function () {
  1502. setTimeout(function () {
  1503. $('#loadingParent').hide();
  1504. }, 3000)
  1505. },
  1506. success: function (data) {
  1507. layer.close(popupIndex);
  1508. }
  1509. })
  1510. }
  1511. function saveConfig(){
  1512. var id = $('#imei').val();
  1513. // if(confogFlag == 1){
  1514. // if(!($('#plankUrl').val() && $('#port').val())){
  1515. // layer.msg("请将信息填写完整!");
  1516. // return false;
  1517. // }
  1518. // }else{
  1519. // if(!$('#photoUrl').val()){
  1520. // layer.msg("请将信息填写完整!");
  1521. // return false;
  1522. // }
  1523. // }
  1524. if(!($('#plankUrl').val() && $('#port').val() && $('#photoUrl').val())){
  1525. layer.msg("请将信息填写完整!");
  1526. return false;
  1527. }
  1528. // if(confogFlag == 1){
  1529. // var dat = {
  1530. // "req": "ip",//配置
  1531. // "topicid": id,
  1532. // "modifi_url": $('#plankUrl').val(),//升级 update
  1533. // "modifi_port":$('#port').val(),
  1534. // "photo_url": $('#plankUrl').val()//升级 update
  1535. // }
  1536. // }else{
  1537. // var dat = {
  1538. // "req": "ip",//配置
  1539. // "topicid": id,
  1540. // "photo_url": $('#photoUrl').val(),//升级 update
  1541. // }
  1542. // }
  1543. var dat = {
  1544. "req": "ip",//配置
  1545. "topicid": id,
  1546. "url": $('#plankUrl').val(),//升级 update
  1547. "port":$('#port').val(),
  1548. "photo_url": $('#photoUrl').val()//升级 update
  1549. }
  1550. $.ajax({
  1551. type: "post",
  1552. url: 'cbd_mqtt',
  1553. data: dat,
  1554. dataType: "json",
  1555. beforeSend: function () {
  1556. $('#loadingParent').show();
  1557. },
  1558. complete: function () {
  1559. setTimeout(function () {
  1560. $('#loadingParent').hide();
  1561. }, 3000)
  1562. },
  1563. success: function (data) {
  1564. closeConfig()
  1565. }
  1566. })
  1567. }
  1568. function closeConfig(){
  1569. $('.coerceConfig input').val('');
  1570. $('.markimg').hide();
  1571. $('.coerceConfig').hide();
  1572. }
  1573. </script>
  1574. </body>
  1575. </html>