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. <select name="end" id="end">
  815. <option value="0">0</option>
  816. <option value="1">1</option>
  817. <option value="2">2</option>
  818. <option value="3">3</option>
  819. <option value="4">4</option>
  820. <option value="5">5</option>
  821. <option value="6">6</option>
  822. <option value="7">7</option>
  823. <option value="8">8</option>
  824. <option value="9">9</option>
  825. <option value="10">10</option>
  826. <option value="11">11</option>
  827. <option value="12">12</option>
  828. <option value="13">13</option>
  829. <option value="14">14</option>
  830. <option value="15">15</option>
  831. <option value="16">16</option>
  832. <option value="17">17</option>
  833. <option value="18">18</option>
  834. <option value="19">19</option>
  835. <option value="20">20</option>
  836. <option value="21">21</option>
  837. <option value="22">22</option>
  838. <option value="23">23</option>
  839. </select>
  840. </div>
  841. <div style="clear:both"></div>
  842. </div>
  843. <!-- 3结束 -->
  844. <div class="form-group">
  845. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  846. <font style="vertical-align: inherit;">
  847. <font style="vertical-align: inherit;"> 落虫时间 </font>
  848. </font>
  849. </label>
  850. <div class="col-sm-9">
  851. <span class="initVal">5</span>
  852. <div class="slider" id="dropTime-slider"></div>
  853. <span class="sliderVal" id="dropTime">20</span>
  854. </div>
  855. <div style="clear:both"></div>
  856. </div>
  857. <!-- 4结束 -->
  858. <div class="form-group">
  859. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  860. <font style="vertical-align: inherit;">
  861. <font style="vertical-align: inherit;"> 加热时间 </font>
  862. </font>
  863. </label>
  864. <div class="col-sm-9">
  865. <span class="initVal">5</span>
  866. <div class="slider" id="calefactionTime-slider"></div>
  867. <span class="sliderVal" id="calefactionTime">20</span>
  868. </div>
  869. <div style="clear:both"></div>
  870. </div>
  871. <!-- 5结束 -->
  872. <div class="form-group">
  873. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  874. <font style="vertical-align: inherit;">
  875. <font style="vertical-align: inherit;"> 加热温度 </font>
  876. </font>
  877. </label>
  878. <div class="col-sm-9">
  879. <span class="initVal">75</span>
  880. <div class="slider" id="calefactionTemperature-slider"></div>
  881. <span class="sliderVal" id="calefactionTemperature">125</span>
  882. </div>
  883. <div style="clear:both"></div>
  884. </div>
  885. <!-- 6结束 -->
  886. <div class="form-group">
  887. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  888. <font style="vertical-align: inherit;">
  889. <font style="vertical-align: inherit;"> 高温保护阈值 </font>
  890. </font>
  891. </label>
  892. <div class="col-sm-9">
  893. <span class="initVal">50</span>
  894. <div class="slider" id="highLimit-slider"></div>
  895. <span class="sliderVal" id="highLimit">70</span>
  896. </div>
  897. <div style="clear:both"></div>
  898. </div>
  899. <!-- 7结束 -->
  900. <div class="form-group">
  901. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  902. <font style="vertical-align: inherit;">
  903. <font style="vertical-align: inherit;"> 低温保护阈值 </font>
  904. </font>
  905. </label>
  906. <div class="col-sm-9">
  907. <span class="initVal">1</span>
  908. <div class="slider" id="lowLimit-slider"></div>
  909. <span class="sliderVal" id="lowLimit">10</span>
  910. </div>
  911. <div style="clear:both"></div>
  912. </div>
  913. <!-- 8结束 -->
  914. <div class="form-group">
  915. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  916. <font style="vertical-align: inherit;">
  917. <font style="vertical-align: inherit;"> 数据上传时间间隔 </font>
  918. </font>
  919. </label>
  920. <div class="col-sm-9">
  921. <span class="initVal">10</span>
  922. <div class="slider" id="dataUpTime-slider"></div>
  923. <span class="sliderVal" id="dataUpTime">60</span>
  924. </div>
  925. <div style="clear:both"></div>
  926. </div>
  927. <!-- 9结束 -->
  928. <div class="form-group">
  929. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  930. <font style="vertical-align: inherit;">
  931. <font style="vertical-align: inherit;"> 图片分辨率 </font>
  932. </font>
  933. </label>
  934. <div class="col-sm-9">
  935. <select name="imgHvga" id="imgHvga">
  936. <option value="0">高</option>
  937. <option value="1">中</option>
  938. <option value="2">低</option>
  939. </select>
  940. </div>
  941. <div style="clear:both"></div>
  942. </div>
  943. <!-- 结束 -->
  944. </div>
  945. <div class="collocateBtn">
  946. <button class="btn btn-sm btn-info" onclick="saveOperation()">
  947. <font style="vertical-align: inherit;">
  948. <font style="vertical-align: inherit;">确定</font>
  949. </font>
  950. </button>
  951. <button class="btn btn-sm" onclick="cancelConfig()">
  952. <font style="vertical-align: inherit;">
  953. <font style="vertical-align: inherit;">取消</font>
  954. </font>
  955. </button>
  956. </div>
  957. </div>
  958. </div>
  959. </div>
  960. </div>
  961. </div>
  962. </div>
  963. </div>
  964. <!-- 强制配置弹框 -->
  965. <div class="coerceConfig">
  966. <h1 class="configTitle">MQTT配置</h1>
  967. <form class="form-horizontal" role="form">
  968. <div class="form-group">
  969. <label class="col-sm-3 control-label no-padding-right">MQTT地址</label>
  970. <div class="col-sm-9">
  971. <input type="text" id="plankUrl" class="col-sm-6" placeholder="xxxx.com">
  972. </div>
  973. </div>
  974. <div class="form-group">
  975. <label class="col-sm-3 control-label no-padding-right">MQTT端口</label>
  976. <div class="col-sm-9">
  977. <input type="text" id="port" class="col-sm-6" placeholder="1883">
  978. </div>
  979. </div>
  980. <div class="form-group">
  981. <label class="col-sm-3 control-label no-padding-right">图片上传地址</label>
  982. <div class="col-sm-9">
  983. <input type="text" id="photoUrl" class="col-sm-6" placeholder="http://xxxxx.com">
  984. </div>
  985. </div>
  986. <div class="clearfix">
  987. <div class="col-md-offset-3 col-md-9">
  988. <button class="btn btn-sm" type="reset" onclick="closeConfig()">
  989. <i class="ace-icon fa fa-undo bigger-110"></i>
  990. 取消
  991. </button>
  992. &nbsp; &nbsp; &nbsp;
  993. <button class="btn btn-sm btn-info" type="button" onclick="saveConfig()">
  994. <i class="ace-icon fa fa-check bigger-110"></i>
  995. 确定
  996. </button>
  997. </div>
  998. </div>
  999. </form>
  1000. </div>
  1001. <div class="markimg"></div>
  1002. <!-- loading -->
  1003. <div id="loadingParent">
  1004. <div id="loadCenter">
  1005. <div class="skype-loader">
  1006. <div class="dot">
  1007. <div class="first"></div>
  1008. </div>
  1009. <div class="dot"></div>
  1010. <div class="dot"></div>
  1011. <div class="dot"></div>
  1012. </div>
  1013. 正在更新...
  1014. </div>
  1015. </div>
  1016. <input type="hidden" value="{{equip_id}}" id="imei">
  1017. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  1018. <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
  1019. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  1020. <script src="{% static '/assets/js/ace.min.js' %}"></script>
  1021. <script src="{% static '/assets/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script>
  1022. <script src="{% static '/assets/js/main.js' %}" type="text/javascript" charset="utf-8"></script>
  1023. <script src="{% static '/assetsDemo/js/jquery-ui.min.js' %}"></script>
  1024. <script src="{% static '/assetsDemo/js/jquery.ui.touch-punch.min.js' %}"></script>
  1025. <script src="{% static '/lib/detailsAnimat.js' %}"></script>
  1026. <script src="{% static '/lib/coordOffset.js' %}"></script>
  1027. <script>
  1028. /**!
  1029. * easy-pie-chart
  1030. * Lightweight plugin to render simple, animated and retina optimized pie charts
  1031. *
  1032. * @license
  1033. * @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
  1034. * @version 2.1.7
  1035. **/
  1036. !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))) }) } });
  1037. </script>
  1038. <script type="text/javascript">
  1039. $.ajaxSetup({
  1040. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  1041. });
  1042. $('#iframe-main', parent.document).css('height', $('.content').height() + 40)
  1043. $(window).resize(function () {
  1044. $('#iframe-main', parent.document).css('height', $('.content').height() + 40)
  1045. });
  1046. var parentUserName = $('#parentUserName', parent.document).html();
  1047. if (!(parentUserName == 'admin' || parentUserName == 'user')) {
  1048. $('#operationBtn').remove();
  1049. $('#handleBtns').remove();
  1050. }
  1051. // 自定义动画
  1052. animate.init();
  1053. animate.showAll();
  1054. $('#showall').on('click',function(e){
  1055. animate.showAll();
  1056. e.stopPropagation();
  1057. })
  1058. // 获取位置
  1059. var geoc = new BMap.Geocoder();
  1060. var configData = '';//配置数据
  1061. // 获取当前设备状态信息
  1062. $.ajax({
  1063. url: 'equipmanage_cbd_detail',
  1064. type: 'post',
  1065. dataType: 'json',
  1066. data: {
  1067. id: $('#imei').val()
  1068. },
  1069. success: function (data) {
  1070. equipData(data);
  1071. }
  1072. })
  1073. function equipData(dat) {
  1074. var equipStatus = dat[0];
  1075. var equipData = dat[1];
  1076. $('#equip_name').html(equipStatus.equip_name || '无');
  1077. $('#upl_time').html(equipStatus.upl_time);
  1078. var stat = eval('(' + equipStatus.cbd_status + ')');;
  1079. var cbd_data = eval('(' + equipData.cbd_data + ')');;
  1080. // $('#ts').html(stat.ts ? '时控' : '光控');//定时模式
  1081. $('#gs').html('当前通道:' + (stat.gs ? '落虫' : '排水'));//通道模式
  1082. $('#upds').html('上仓门:' + (stat.upds ? '打开' : '关闭'));//上仓门
  1083. $('#dnds').html('下仓门:' + (stat.dnds ? '打开' : '关闭'));//下舱门
  1084. $('#csq').html('信号强度:' + stat.csq);//信号强度
  1085. $('#dver').html(stat.dver);//版本号
  1086. if (stat.lng > 999) {
  1087. var lng = Math.floor(stat.lng / 100) + ((stat.lng % 100) / 60);
  1088. var lat = Math.floor(stat.lat / 100) + ((stat.lat % 100) / 60);
  1089. } else {
  1090. var lng = Number(stat.lng);
  1091. var lat = Number(stat.lat);
  1092. }
  1093. var lng1 = wgs84togcj02(lng, lat);
  1094. var lng2 = gcj02tobd09(lng1[0], lng1[1]);
  1095. var pt = new BMap.Point(lng2[0], lng2[1]);
  1096. geoc.getLocation(pt, function(rs){
  1097. var addComp = rs.addressComponents;
  1098. // $('.area').html('位置:'+ addComp.province + ", " + addComp.city + ", " + addComp.district)
  1099. $('#curr_area').html(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
  1100. });
  1101. $('#lat').html('纬度:' + lat.toFixed(5));//维度
  1102. $('#lng').html('经度:' + lng.toFixed(4));//经度
  1103. $('#tps').html(stat.tps ? '异常' : '正常');
  1104. if (cbd_data.tps == 0) {//温控状态
  1105. $('#tps').attr('checked', 'checked');
  1106. } else {
  1107. $('#tps').attr('checked', false);
  1108. }
  1109. $('#lps').html('光控检测:' + (stat.lps ? '异常' : '正常'));//光控状态
  1110. $('#hs').html('加热开关:' + (stat.hs ? '开启' : '关闭'));//加热状态
  1111. $('#rps').html('雨控状态:' + (stat.rps ? '异常' : '正常'));//雨控状态
  1112. $('#hrt').html('加热仓温度:' + cbd_data.hrt);//加热仓温度
  1113. $('#at').html((cbd_data.at / 10).toFixed(1) + '℃');//环境温度
  1114. $('#ah').html((cbd_data.ah / 10).toFixed(1) + '℃');//环境湿度
  1115. }
  1116. $('#timing').on('change', function () {
  1117. if ($(this).val() == 0) {
  1118. $('.lightPattern').show();
  1119. $('.timePattern').hide();
  1120. } else {
  1121. $('.lightPattern').hide();
  1122. $('.timePattern').show();
  1123. }
  1124. })
  1125. // $('.slider').slider({
  1126. // disabled: true,
  1127. // })
  1128. // 1定时时长
  1129. $("#timingLength-slider").css('width', '85%').slider({
  1130. value: 1,
  1131. range: "min",
  1132. min: 1,
  1133. max: 10,
  1134. step: 1,
  1135. slide: function (event, ui) {
  1136. var val = parseInt(ui.value);
  1137. $('#timingLength').html(val);
  1138. }
  1139. });
  1140. // 2落虫
  1141. $("#dropTime-slider").css('width', '85%').slider({
  1142. value: 5,
  1143. range: "min",
  1144. min: 5,
  1145. max: 20,
  1146. step: 1,
  1147. slide: function (event, ui) {
  1148. var val = parseInt(ui.value);
  1149. $('#dropTime').html(val);
  1150. }
  1151. });
  1152. // 3加热时间
  1153. $("#calefactionTime-slider").css('width', '85%').slider({
  1154. value: 5,
  1155. range: "min",
  1156. min: 5,
  1157. max: 20,
  1158. step: 1,
  1159. slide: function (event, ui) {
  1160. var val = parseInt(ui.value);
  1161. $('#calefactionTime').html(val);
  1162. }
  1163. });
  1164. // 4加热温度
  1165. $("#calefactionTemperature-slider").css('width', '85%').slider({
  1166. value: 75,
  1167. range: "min",
  1168. min: 75,
  1169. max: 120,
  1170. step: 1,
  1171. slide: function (event, ui) {
  1172. var val = parseInt(ui.value);
  1173. $('#calefactionTemperature').html(val);
  1174. }
  1175. });
  1176. // 5高温保护阈值
  1177. $("#highLimit-slider").css('width', '85%').slider({
  1178. value: 50,
  1179. range: "min",
  1180. min: 50,
  1181. max: 70,
  1182. step: 1,
  1183. slide: function (event, ui) {
  1184. var val = parseInt(ui.value);
  1185. $('#highLimit').html(val);
  1186. }
  1187. });
  1188. // 6低温保护阈值
  1189. $("#lowLimit-slider").css('width', '85%').slider({
  1190. value: 1,
  1191. range: "min",
  1192. min: 1,
  1193. max: 10,
  1194. step: 1,
  1195. slide: function (event, ui) {
  1196. var val = parseInt(ui.value);
  1197. $('#lowLimit').html(val);
  1198. }
  1199. });
  1200. // 7数据上相间隔
  1201. $("#dataUpTime-slider").css('width', '85%').slider({
  1202. value: 1,
  1203. range: "min",
  1204. min: 10,
  1205. max: 60,
  1206. step: 10,
  1207. slide: function (event, ui) {
  1208. var val = parseInt(ui.value);
  1209. $('#dataUpTime').html(val);
  1210. }
  1211. });
  1212. //刷新:下发查询:
  1213. function reloadPage() {
  1214. var id = $('#imei').val();
  1215. $.ajax({
  1216. type: "post",
  1217. url: 'cbd_mqtt',
  1218. async: false,
  1219. data: {
  1220. "req": "read",//读取
  1221. "topicid": id,
  1222. "kind": "status"//读取下位机状态
  1223. },
  1224. dataType: "json",
  1225. success: function (data) {
  1226. if (data == "0") {
  1227. $.ajax({
  1228. type: "post",
  1229. url: 'cbd_mqtt',
  1230. async: false,
  1231. data: {
  1232. "req": "read",//读取
  1233. "topicid": id,
  1234. "kind": "data"//读取下位机状态
  1235. },
  1236. dataType: "json",
  1237. beforeSend: function () {
  1238. $('#loadingParent').show();
  1239. },
  1240. complete: function () {
  1241. setTimeout(function () {
  1242. $('#loadingParent').hide();
  1243. }, 6000)
  1244. },
  1245. success: function (data) {
  1246. if (data == "0") {
  1247. layer.msg("下发查询发送成功!")
  1248. setTimeout(function () {
  1249. // 获取当前设备状态信息
  1250. $.ajax({
  1251. url: 'equipmanage_cbd_detail',
  1252. type: 'post',
  1253. dataType: 'json',
  1254. data: {
  1255. id: $('#imei').val()
  1256. },
  1257. success: function (data) {
  1258. equipData(data);
  1259. }
  1260. })
  1261. }, 6000)
  1262. } else {
  1263. layer.msg("发送失败!")
  1264. }
  1265. }
  1266. })
  1267. } else {
  1268. layer.msg("发送失败!")
  1269. }
  1270. }
  1271. })
  1272. }
  1273. configurationSwitch()
  1274. // 配置按钮
  1275. function configurationSwitch() {
  1276. var id = $('#imei').val();
  1277. $.ajax({
  1278. type: "post",
  1279. url: 'cbd_mqtt',
  1280. data: {
  1281. "req": "read",//读取
  1282. "topicid": id,
  1283. "kind": "paramconf"//读取下位机状态
  1284. },
  1285. dataType: "json",
  1286. beforeSend: function () {
  1287. $('#configParent').show();
  1288. },
  1289. complete: function () {
  1290. setTimeout(function () {
  1291. $('#configParent').hide();
  1292. }, 3000)
  1293. },
  1294. success: function (data) {
  1295. if (data == "0") {
  1296. // layer.msg("发送成功!", { time: 2000 })
  1297. setTimeout(function () {
  1298. $.ajax({
  1299. url: "equipmanage_cbd",
  1300. type: 'post',
  1301. data: {
  1302. id: id,
  1303. req: "paramconf",
  1304. },
  1305. success: function (data) {
  1306. configData = data;
  1307. configFill(data);
  1308. }
  1309. })
  1310. }, 3000)
  1311. } else {
  1312. layer.msg("发送失败!")
  1313. }
  1314. }
  1315. })
  1316. }
  1317. // 填充函数
  1318. function configFill(dat) {
  1319. var data = $.parseJSON(dat);
  1320. var para = eval("(" + data.paramconf + ")");
  1321. if (para != '' && para != null) {
  1322. // 定时模式
  1323. $('#timing').val(para.ts);
  1324. if (para.ts == 0) {
  1325. $('.lightPattern').show();
  1326. $('.timePattern').hide();
  1327. } else {
  1328. $('.lightPattern').hide();
  1329. $('.timePattern').show();
  1330. }
  1331. // 滑块
  1332. $("#timingLength-slider").slider('value', para.tt);
  1333. $('#timingLength').html(para.tt);
  1334. $("#dropTime-slider").slider('value', para.collt);
  1335. $('#dropTime').html(para.collt);
  1336. $("#calefactionTime-slider").slider('value', para.htim);
  1337. $('#calefactionTime').html(para.htim);
  1338. $("#calefactionTemperature-slider").slider('value', para.hst);
  1339. $('#calefactionTemperature').html(para.hst);
  1340. $("#highLimit-slider").slider('value', para.tph);
  1341. $('#highLimit').html(para.tph);//高温
  1342. $('#tph').html(para.tph + '℃');
  1343. $("#lowLimit-slider").slider('value', para.tpl);
  1344. $('#lowLimit').html(para.tpl);//低温
  1345. $('#tpl').html(para.tpl + '℃');
  1346. $("#dataUpTime-slider").slider('value', para.datt);
  1347. $('#dataUpTime').html(para.datt);
  1348. // 时间
  1349. if ($('#timing').val() == 1) {
  1350. $('#timSelectBox').val(Math.floor(para.st));
  1351. $('#timSelectBox2').val(Math.floor(para.et));
  1352. $('#begin').val(Math.floor(para.st));
  1353. $('#end').val(Math.floor(para.et));
  1354. }
  1355. $('#imgHvga').val(para.imgres);
  1356. $('.slider').slider({
  1357. disabled: false,
  1358. })
  1359. } else {
  1360. // 定时模式
  1361. $('#timing').val(0);
  1362. $('.lightPattern').show();
  1363. $('.timePattern').hide();
  1364. // 滑块
  1365. $("#timingLength-slider").slider('value', 1);
  1366. $('#timingLength').html(1);
  1367. $("#dropTime-slider").slider('value', 5);
  1368. $('#dropTime').html(5);
  1369. $("#calefactionTime-slider").slider('value', 5);
  1370. $('#calefactionTime').html(5);
  1371. $("#calefactionTemperature-slider").slider('value', 75);
  1372. $('#calefactionTemperature').html(75);
  1373. $("#highLimit-slider").slider('value', 50);
  1374. $('#highLimit').html(50);
  1375. $("#lowLimit-slider").slider('value', 1);
  1376. $('#lowLimit').html(1);
  1377. $("#dataUpTime-slider").slider('value', 10);
  1378. $('#dataUpTime').html(10);
  1379. $('#begin').val(0);
  1380. $('#end').val(0);
  1381. $('#imgHvga').val(0);
  1382. $('#tph').html('70℃');
  1383. $('#tpl').html('1℃');
  1384. }
  1385. }
  1386. //保存
  1387. function saveOperation() {
  1388. var data = {
  1389. req: 'set',
  1390. id: $('#imei').val(),
  1391. timing: $('#timing').val(),
  1392. timingLength: $('#timingLength').html(),
  1393. begin: $('#begin').val(),
  1394. end: $('#end').val(),
  1395. dropTime: $('#dropTime').html(),
  1396. calefactionTime: $('#calefactionTime').html(),
  1397. calefactionTemperature: $('#calefactionTemperature').html(),
  1398. highLimit: $('#highLimit').html(),
  1399. lowLimit: $('#lowLimit').html(),
  1400. dataUpTime: $('#dataUpTime').html(),
  1401. imgHvga: $('#imgHvga').val()
  1402. }
  1403. if ($('#timing').val() == 1) {
  1404. if ($('#begin').val() && $('#end').val()) {
  1405. saveOperationAjax('cbd_mqtt', data)
  1406. } else {
  1407. layer.msg("请将时控时间填写完整!");
  1408. }
  1409. } else {
  1410. saveOperationAjax('cbd_mqtt', data);
  1411. }
  1412. }
  1413. function saveOperationAjax(url, data) {
  1414. $.ajax({
  1415. url: url,
  1416. type: 'post',
  1417. data: data,
  1418. beforeSend: function () {
  1419. $('.loadingParent').show();
  1420. },
  1421. complete: function () {
  1422. setTimeout(function () {
  1423. $('.loadingParent').hide();
  1424. }, 3000)
  1425. },
  1426. success: function (data) {
  1427. if (data == "0") {
  1428. setTimeout(function () {
  1429. layer.msg("配置成功!");
  1430. $('#tph').html($('#highLimit').html()+'℃');
  1431. $('#tpl').html($('#lowLimit').html()+'℃');
  1432. }, 3000)
  1433. }
  1434. }
  1435. })
  1436. }
  1437. // 取消配置
  1438. function cancelConfig() {
  1439. configFill(configData)
  1440. }
  1441. var popupIndex;
  1442. //operation配置弹框
  1443. function operation() {
  1444. //页面层
  1445. popupIndex = layer.open({
  1446. type: 1,
  1447. skin: 'layui-layer-rim', //加上边框
  1448. // area: ['420px', '240px'], //宽高
  1449. area: ["50%"],
  1450. content: $('#handleBtns').html()
  1451. });
  1452. }
  1453. // var confogFlag = 1;
  1454. function popupFrame(str, cmd, type, data) {
  1455. //询问框
  1456. layer.confirm('确定' + str + '?', {
  1457. icon: 3,
  1458. btn: ['确定', '取消'] //按钮
  1459. }, function (index) {
  1460. if(cmd == 'config'){
  1461. layer.close(popupIndex)
  1462. // if(type == 1){
  1463. // confogFlag = 1;
  1464. // $('.coerceConfig .configTitle').html('配置板子地址');
  1465. // $('.coerceConfig .form-group').eq(0).show();
  1466. // $('.coerceConfig .form-group').eq(1).show();
  1467. // $('.coerceConfig .form-group').eq(2).hide();
  1468. // }else{
  1469. // confogFlag = 2;
  1470. // $('.coerceConfig .configTitle').html('配置图片上传地址');
  1471. // $('.coerceConfig .form-group').eq(0).hide();
  1472. // $('.coerceConfig .form-group').eq(1).hide();
  1473. // $('.coerceConfig .form-group').eq(2).show();
  1474. // }
  1475. $('.markimg').show();
  1476. $('.coerceConfig').show();
  1477. }else{
  1478. handleFun(cmd, type, data);
  1479. }
  1480. layer.close(index);
  1481. }, function () {
  1482. });
  1483. }
  1484. function handleFun(cmd, type, data) {
  1485. var id = $('#imei').val();
  1486. $.ajax({
  1487. type: "post",
  1488. url: 'cbd_mqtt',
  1489. data: {
  1490. "req": "ctrl",//控制
  1491. "topicid": id,
  1492. "cmd": cmd,//升级 update
  1493. "type": type,
  1494. "data": data
  1495. },
  1496. dataType: "json",
  1497. beforeSend: function () {
  1498. $('#loadingParent').show();
  1499. },
  1500. complete: function () {
  1501. setTimeout(function () {
  1502. $('#loadingParent').hide();
  1503. }, 3000)
  1504. },
  1505. success: function (data) {
  1506. layer.close(popupIndex);
  1507. }
  1508. })
  1509. }
  1510. function saveConfig(){
  1511. var id = $('#imei').val();
  1512. // if(confogFlag == 1){
  1513. // if(!($('#plankUrl').val() && $('#port').val())){
  1514. // layer.msg("请将信息填写完整!");
  1515. // return false;
  1516. // }
  1517. // }else{
  1518. // if(!$('#photoUrl').val()){
  1519. // layer.msg("请将信息填写完整!");
  1520. // return false;
  1521. // }
  1522. // }
  1523. if(!($('#plankUrl').val() && $('#port').val() && $('#photoUrl').val())){
  1524. layer.msg("请将信息填写完整!");
  1525. return false;
  1526. }
  1527. // if(confogFlag == 1){
  1528. // var dat = {
  1529. // "req": "ip",//配置
  1530. // "topicid": id,
  1531. // "modifi_url": $('#plankUrl').val(),//升级 update
  1532. // "modifi_port":$('#port').val(),
  1533. // "photo_url": $('#plankUrl').val()//升级 update
  1534. // }
  1535. // }else{
  1536. // var dat = {
  1537. // "req": "ip",//配置
  1538. // "topicid": id,
  1539. // "photo_url": $('#photoUrl').val(),//升级 update
  1540. // }
  1541. // }
  1542. var dat = {
  1543. "req": "ip",//配置
  1544. "topicid": id,
  1545. "url": $('#plankUrl').val(),//升级 update
  1546. "port":$('#port').val(),
  1547. "photo_url": $('#photoUrl').val()//升级 update
  1548. }
  1549. $.ajax({
  1550. type: "post",
  1551. url: 'cbd_mqtt',
  1552. data: dat,
  1553. dataType: "json",
  1554. beforeSend: function () {
  1555. $('#loadingParent').show();
  1556. },
  1557. complete: function () {
  1558. setTimeout(function () {
  1559. $('#loadingParent').hide();
  1560. }, 3000)
  1561. },
  1562. success: function (data) {
  1563. closeConfig()
  1564. }
  1565. })
  1566. }
  1567. function closeConfig(){
  1568. $('.coerceConfig input').val('');
  1569. $('.markimg').hide();
  1570. $('.coerceConfig').hide();
  1571. }
  1572. </script>
  1573. </body>
  1574. </html>