equipmanage_cbd_detail.html 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983
  1. {% load staticfiles %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <link href="{% static '/lib/bootstrap-3.3.7/css/bootstrap.css' %}" rel="stylesheet">
  7. <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
  8. <link rel="stylesheet" href="{% static '/lib/css/ace.min.css' %}" />
  9. <link rel="stylesheet" href="{% static '/lib/css/ace-skins.min.css' %}">
  10. <link rel="stylesheet" href="{% static '/lib/css/ace-rtl.min.css' %}">
  11. <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
  12. <link rel="stylesheet" href="{% static '/lib/css/jquery-ui.css' %}" />
  13. <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.4" />
  14. <style type="text/css">
  15. body {
  16. overflow: hidden;
  17. background: #fff;
  18. }
  19. /* 返回 */
  20. .headerPlace {
  21. font-size: 22px;
  22. color: #418fbb;
  23. cursor: pointer;
  24. }
  25. .headerPlace img {
  26. vertical-align: middle;
  27. margin-right: 10px;
  28. margin-top: -4px;
  29. }
  30. /* */
  31. .userinfo .fa {
  32. font-size: 18px;
  33. color: #26b3ff;
  34. margin: 0px 5px;
  35. }
  36. .ui-slider .ui-slider-handle {
  37. width: 1.4em;
  38. height: 1.4em;
  39. border-radius: 50%;
  40. }
  41. .ui-slider {
  42. background: #fff;
  43. }
  44. .userinfoTitle {
  45. margin-right: 30px;
  46. font-size: 16px;
  47. }
  48. .refresh {
  49. text-align: right;
  50. }
  51. .refresh button {
  52. padding: 2px 5px;
  53. border-radius: 5px;
  54. }
  55. /* .userinfo{
  56. margin-bottom: 15px !important;
  57. } */
  58. /* */
  59. .row {
  60. margin: 0;
  61. }
  62. .equiptypeicon {
  63. float: left;
  64. width: 60px;
  65. margin-left: 20%;
  66. }
  67. .equipInfo {
  68. margin: 20px 0;
  69. }
  70. .equipInfo .row {
  71. margin: 0 13px;
  72. box-shadow: 0 0 40px #eee;
  73. padding: 30px;
  74. }
  75. .equipInfo .row>div {
  76. height: 52px;
  77. text-align: center;
  78. border-left: 1px solid #eee;
  79. }
  80. .equipInfo .row .txt {
  81. position: absolute;
  82. left: 105px;
  83. }
  84. .equipInfo .row>div:first-child {
  85. border-left: none;
  86. }
  87. .typeResult {
  88. font-size: 18px;
  89. line-height: 30px;
  90. }
  91. .typeTitle {
  92. color: #666;
  93. }
  94. @media (max-width: 1200px) {
  95. .col-xs-4.secondLine {
  96. border-left: none !important;
  97. }
  98. .col-xs-4 {
  99. margin-bottom: 10px;
  100. }
  101. }
  102. /* */
  103. .backStyle {
  104. background: #fff;
  105. box-shadow: 0 0 40px #eee;
  106. padding: 20px;
  107. }
  108. .backStyle h1 {
  109. font-size: 18px;
  110. margin-bottom: 15px;
  111. }
  112. .circle_bar {
  113. text-align: center;
  114. padding: 54px 18px;
  115. }
  116. /* */
  117. .areaicon {
  118. width: 40px;
  119. float: left;
  120. height: 50px;
  121. margin-right: 15px;
  122. }
  123. .area p {
  124. font-size: 16px;
  125. line-height: 30px;
  126. }
  127. /* 配置项 */
  128. .form-group>label {
  129. margin: 4px 0 0 0;
  130. text-align: right;
  131. }
  132. .form-group>.col-sm-9 {
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. }
  137. .timePattern>.col-sm-9 {
  138. display: block;
  139. }
  140. .initVal {
  141. /* position: absolute;
  142. left: 8px;
  143. top: 5px; */
  144. /* margin-right: 20px; */
  145. width: 35px;
  146. }
  147. .sliderVal {
  148. width: 43px;
  149. text-align: right;
  150. /* margin-left: 20px; */
  151. /* position: absolute;
  152. right: 25px;
  153. top: 5px; */
  154. }
  155. .collocateBtn {
  156. text-align: center;
  157. }
  158. .collocateBtn button {
  159. margin: 10px 10px 20px 10px;
  160. }
  161. .form-group select {
  162. width: 200px;
  163. }
  164. .widget-body {
  165. margin-top: 20px;
  166. }
  167. .timePattern {
  168. display: none;
  169. }
  170. .hintTitle {
  171. text-align: center;
  172. display: inline-block;
  173. width: 100px;
  174. margin-right: 15px;
  175. color: #777;
  176. }
  177. .form-group select[name='begin'],
  178. .form-group select[name='end'] {
  179. padding: 0 37px 0 37px;
  180. width: initial;
  181. width: 103px;
  182. }
  183. .haloParent {
  184. position: absolute;
  185. width: 100px;
  186. height: 100px;
  187. float: left;
  188. margin-top: -23px;
  189. }
  190. .halo {
  191. position: absolute;
  192. width: 100px;
  193. height: 100px;
  194. border-radius: 50%;
  195. }
  196. .solidCircle {
  197. position: absolute;
  198. width: 50px;
  199. height: 50px;
  200. border-radius: 50%;
  201. left: 50%;
  202. top: 50%;
  203. margin-left: -25px;
  204. margin-top: -25%;
  205. }
  206. .solidCircle4 {
  207. background: #4ca1ff;
  208. }
  209. .solidCircle6 {
  210. background: #a597f8;
  211. }
  212. .solidCircle8 {
  213. background: #fc9558;
  214. }
  215. .halo4 {
  216. animation: haloFour 2s 3s infinite;
  217. }
  218. .halo6 {
  219. animation: haloSix 2s 3s infinite;
  220. }
  221. .halo8 {
  222. animation: haloEight 2s 3s infinite;
  223. }
  224. @keyframes haloFour {
  225. 0% {
  226. background: #4ca1ff;
  227. transform: scale(.3);
  228. opacity: 0
  229. }
  230. 20% {
  231. background: #1258a5;
  232. transform: scale(.5);
  233. opacity: .5
  234. }
  235. 100% {
  236. background: #1258a5;
  237. transform: scale(.8);
  238. opacity: 0
  239. }
  240. }
  241. @keyframes haloSix {
  242. 0% {
  243. background: #a597f8;
  244. transform: scale(.3);
  245. opacity: 0
  246. }
  247. 20% {
  248. background: #3d2aaf;
  249. transform: scale(.5);
  250. opacity: .5
  251. }
  252. 100% {
  253. background: #3d2aaf;
  254. transform: scale(.8);
  255. opacity: 0
  256. }
  257. }
  258. @keyframes haloEight {
  259. 0% {
  260. background: #f8bb97;
  261. transform: scale(.3);
  262. opacity: 0
  263. }
  264. 20% {
  265. background: #fa8845;
  266. transform: scale(.5);
  267. opacity: .5
  268. }
  269. 100% {
  270. background: #f27125;
  271. transform: scale(.8);
  272. opacity: 0
  273. }
  274. }
  275. .haloIcon {
  276. margin-top: 14px;
  277. }
  278. .widget-body {
  279. min-height: 440px;
  280. }
  281. /* 左边设备 */
  282. .equiptInfo {
  283. height: 655px;
  284. position: relative;
  285. background: url(../static/img/equipImg.png) no-repeat;
  286. background-size: 230px;
  287. background-position-x: 45%;
  288. background-position-y: 22px;
  289. }
  290. /*闪烁点*/
  291. #animatCover {
  292. position: absolute;
  293. left: 45%;
  294. top: 0;
  295. bottom: 0;
  296. width: 233px;
  297. margin-left: -107px;
  298. z-index: 99;
  299. }
  300. .flashDot {
  301. width: 50px;
  302. height: 50px;
  303. background-image: url(../static/img/flash.png);
  304. background-size: cover;
  305. background-position-y: 0 -143px;
  306. cursor: pointer;
  307. position: absolute;
  308. }
  309. .flashDot .line {
  310. position: absolute;
  311. left: 39px;
  312. bottom: 40px;
  313. z-index: 900;
  314. width: 0;
  315. height: 35px;
  316. transition: all .3s;
  317. background-image: url(../static/img/line.png);
  318. }
  319. .flashDot .lineleft {
  320. background-image: url(../static/img/line2.png);
  321. }
  322. .flashDot .bottomline {
  323. bottom: -20px;
  324. transform: scale(1) rotateX(180deg);
  325. }
  326. .flashDot .panelBox {
  327. position: absolute;
  328. left: 141px;
  329. bottom: 46px;
  330. width: 190px;
  331. height: 48px;
  332. background-color: transparent;
  333. -webkit-background-size: 100% 100%;
  334. background-size: 100% 100%;
  335. transform: scale(0);
  336. animation-fill-mode: forwards;
  337. }
  338. .bgimg {
  339. position: absolute;
  340. top: 0;
  341. bottom: 0;
  342. left: 0;
  343. right: 0;
  344. background-image: url(../static/img/panel.png);
  345. background-size: 100% 100%;
  346. }
  347. .flashDot .bottompanel {
  348. bottom: -43px;
  349. }
  350. .flashDot .showPanel {
  351. animation: showPanel 1s .5s 1;
  352. animation-fill-mode: forwards;
  353. }
  354. .flashDot .text {
  355. position: absolute;
  356. left: 20px;
  357. top: 10px;
  358. width: 80%;
  359. height: 30px;
  360. line-height: 30px;
  361. color: #fff;
  362. font-size: 16px;
  363. }
  364. @keyframes showPanel {
  365. 0% {
  366. opacity: 1;
  367. transform: scale(0);
  368. }
  369. 80% {
  370. transform: scale(1.1);
  371. }
  372. 100% {
  373. opacity: 1;
  374. transform: scale(1);
  375. }
  376. }
  377. /* 闪烁点定位 */
  378. .flashDot1 {
  379. left: 150px;
  380. top: 60px;
  381. }
  382. .flashDot2 {
  383. left: 93px;
  384. top: 66px;
  385. }
  386. .flashDot3 {
  387. left: 100px;
  388. top: 226px;
  389. }
  390. .flashDot4 {
  391. left: 100px;
  392. top: 332px;
  393. }
  394. .flashDot5 {
  395. bottom: 225px;
  396. left: 112px;
  397. }
  398. .flashDot6 {
  399. bottom: 133px;
  400. left: 63px;
  401. }
  402. .flashDot7 {
  403. bottom: 141px;
  404. left: 126px;
  405. }
  406. .flashDot8 {
  407. bottom: 85px;
  408. left: 64px;
  409. }
  410. .flashDot9 {
  411. bottom: 90px;
  412. left: 122px;
  413. }
  414. /*温控开关 */
  415. .tempTitel,
  416. .switchbox {
  417. display: inline-block;
  418. vertical-align: middle;
  419. }
  420. .switchBj {
  421. width: 60px;
  422. height: 30px;
  423. background: #c8c8c8;
  424. border-radius: 20px;
  425. position: relative;
  426. }
  427. .switchBj:after {
  428. position: absolute;
  429. content: '关';
  430. left: 9px;
  431. line-height: 30px;
  432. color: #fff;
  433. }
  434. .switchBj:before {
  435. position: absolute;
  436. content: '开';
  437. left: 34px;
  438. line-height: 30px;
  439. color: #fff;
  440. }
  441. .switchBj span {
  442. display: inline-block;
  443. width: 26px;
  444. height: 26px;
  445. background: #fff;
  446. border-radius: 50%;
  447. box-shadow: 1px 1px 4px #515151;
  448. position: absolute;
  449. left: 30px;
  450. top: 2px;
  451. }
  452. .switchInp {
  453. display: none;
  454. }
  455. .switchInp:checked+.switchBj {
  456. background: #468FCC;
  457. border-color: #468FCC;
  458. }
  459. .switchInp:checked+.switchBj span {
  460. left: 2px;
  461. }
  462. /* 温度提示 */
  463. .weatherType {
  464. margin: 31px 0;
  465. }
  466. .font18 {
  467. font-size: 18px;
  468. }
  469. .tempTypeImg {
  470. width: 30%;
  471. float: left;
  472. height: 60px;
  473. line-height: 60px;
  474. }
  475. .tempTypeImg img {
  476. width: 100%;
  477. }
  478. .tempTypeValue {
  479. float: left;
  480. width: 70%;
  481. text-align: center;
  482. line-height: 28px;
  483. }
  484. /* 配置form */
  485. .coerceConfig {
  486. display: none;
  487. background: white;
  488. position: fixed;
  489. left: 25%;
  490. right: 25%;
  491. top: 20%;
  492. padding-bottom: 30px;
  493. z-index: 999999;
  494. }
  495. .configTitle {
  496. font-size: 22px;
  497. padding: 15px;
  498. text-indent: 8%;
  499. color: #10659d;
  500. }
  501. .markimg {
  502. display: none;
  503. position: fixed;
  504. left: 0;
  505. right: 0;
  506. top: 0;
  507. bottom: 0;
  508. background: rgba(0, 0, 0, .5);
  509. z-index: 98;
  510. }
  511. #showall,
  512. #swfDiv {
  513. display: none;
  514. }
  515. /* 配置项 */
  516. .form-group>label {
  517. margin: 4px 0 0 0;
  518. text-align: right;
  519. }
  520. .collocateBtn {
  521. text-align: center;
  522. }
  523. .collocateBtn button {
  524. margin: 0;
  525. }
  526. .form-group select {
  527. width: 200px;
  528. }
  529. .widget-body {
  530. margin-top: 20px;
  531. }
  532. .timePattern {
  533. display: none;
  534. }
  535. .hintTitle {
  536. text-align: center;
  537. display: inline-block;
  538. width: 100px;
  539. margin-right: 15px;
  540. color: #777;
  541. }
  542. .form-group select[name='begin'],
  543. .form-group select[name='end'] {
  544. padding: 0 37px 0 37px;
  545. width: initial;
  546. }
  547. #desc {
  548. width: 100px;
  549. }
  550. .col-sm-9>div {
  551. /* margin: 4px 0; */
  552. width: 80%;
  553. }
  554. .progressParent {
  555. display: inline-block;
  556. width: 80%;
  557. }
  558. .progressVal {
  559. display: inline-block;
  560. text-align: right;
  561. width: 17%;
  562. }
  563. #changeIccid {
  564. width: 70%;
  565. }
  566. #rtuInfoBtn {
  567. display: none;
  568. }
  569. .nullData {
  570. color: #666;
  571. text-align: center;
  572. height: 480px;
  573. line-height: 480px;
  574. margin: 0 0 0 12px;
  575. }
  576. /* 设备开关 */
  577. .facilitySwitch {
  578. margin: 0 0 0 60px;
  579. }
  580. .facilitySwitch_tlt {
  581. font-size: 15px;
  582. }
  583. .dataNone {
  584. display: none;
  585. }
  586. .inmBox {
  587. padding: 20px 25px 45px 20px;
  588. }
  589. </style>
  590. </head>
  591. <body>
  592. <div class="content">
  593. <div class="page-header">
  594. <span class="headerPlace" onclick="goback('equipmanage_cbd')">
  595. <img src="{% static '/img/gobackIcon.png' %}" alt="">返回
  596. </span>
  597. </div>
  598. <div class="userinfocover">
  599. <div class="row ">
  600. <div class="col-xs-12 userinfo">
  601. <i class="fa fa-user-o" aria-hidden="true"></i>
  602. 设备ID:
  603. <span class="userinfoTitle">{{equip_id}}</span>
  604. 设备名称:
  605. <span class="userinfoTitle" id="equip_name"></span>
  606. 上报时间:
  607. <span class="userinfoTitle" id="upl_time"></span>
  608. 位置:
  609. <span class="userinfoTitle" id="curr_area"></span>
  610. </div>
  611. <div class="col-xs-12 refresh">
  612. {% if is_hk %}
  613. <button class="btn btn-sm btn-primary configurationBtn"
  614. onclick="setSimIccid($(this),'{{equip_id}}','{{iccid|default_if_none:""}}')" {% if iccid %}
  615. {% else %}style="display:none" {% endif %}>SIM卡更换</button>
  616. <button class="btn btn-sm btn-danger configurationBtn"
  617. onclick="setSimIccid($(this),'{{equip_id}}','{{iccid|default_if_none:""}}')" {% if iccid %}
  618. style="display:none" {% else %}{% endif %}>SIM卡绑定</button>
  619. {% else %} {% endif %}
  620. <button type="button" class="btn btn-sm btn-primary" id="rtuInfoBtn">
  621. <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
  622. RTU信息
  623. </button>
  624. <button type="button" class="btn btn-sm btn-primary" id="takephotoShowBtn"
  625. onclick="popupFrame('拍照','ctrl','takephoto','')">
  626. <i class="fa fa-camera" aria-hidden="true"></i>
  627. 拍照
  628. </button>
  629. <button type="button" class="btn btn-sm btn-primary" id="semaphore" onclick="ceshiceshi()">
  630. 查看信号质量曲线
  631. </button>
  632. <button class="btn btn-sm btn-info" onclick='sendexamineSIM()'>
  633. <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
  634. SIM卡查询
  635. </button>
  636. <button type="button" class="btn btn-sm btn-success" onclick="reloadPage()">刷新</button>
  637. <button type="button" class="btn btn-sm btn-primary" id="operationBtn"
  638. onclick="operation()">操作</button>
  639. </div>
  640. </div>
  641. <div id="handleBtns" style="display:none">
  642. <div style="padding: 20px; background-color: #F2F2F2;" id="">
  643. <div class="layui-row layui-col-space15">
  644. <div class="layui-col-md6">
  645. <div class="layui-card">
  646. <div class="layui-card-header">上仓门操作</div>
  647. <div class="layui-card-body">
  648. <div class="layui-row layui-col-space15">
  649. <div class="layui-col-md6">
  650. <button type="button" class="btn btn-sm btn-success"
  651. onclick="handleFun('ctrl','up','open')">打开上仓门</button>
  652. </div>
  653. <div class="layui-col-md6">
  654. <button type="button" class="btn btn-sm btn-success"
  655. onclick="handleFun('ctrl','up','close')">关闭上仓门</button>
  656. </div>
  657. <div class="layui-col-md6">
  658. <button type="button" class="btn btn-sm btn-success"
  659. onclick="handleFun('ctrl','up','force_open')">强制打开上仓门</button>
  660. </div>
  661. <div class="layui-col-md6">
  662. <button type="button" class="btn btn-sm btn-success"
  663. onclick="handleFun('ctrl','up','force_close')">强制关闭上仓门</button>
  664. </div>
  665. </div>
  666. </div>
  667. </div>
  668. </div>
  669. <div class="layui-col-md6">
  670. <div class="layui-card">
  671. <div class="layui-card-header">下仓门操作</div>
  672. <div class="layui-card-body">
  673. <div class="layui-row layui-col-space15">
  674. <div class="layui-col-md6">
  675. <button type="button" class="btn btn-sm btn-yellow"
  676. onclick="handleFun('ctrl','down','open')">打开下仓门</button>
  677. <br />
  678. </div>
  679. <div class="layui-col-md6">
  680. <button type="button" class="btn btn-sm btn-yellow"
  681. onclick="handleFun('ctrl','down','close')">关闭下仓门</button>
  682. <br />
  683. </div>
  684. <div class="layui-col-md6">
  685. <button type="button" class="btn btn-sm btn-yellow"
  686. onclick="handleFun('ctrl','down','force_open')">强制打开下仓门</button>
  687. </div>
  688. <div class="layui-col-md6">
  689. <button type="button" class="btn btn-sm btn-yellow"
  690. onclick="handleFun('ctrl','down','force_close')">强制关闭下仓门</button>
  691. </div>
  692. </div>
  693. </div>
  694. </div>
  695. </div>
  696. <div class="layui-col-md12">
  697. <div class="layui-card">
  698. <div class="layui-card-header">强制操作</div>
  699. <div class="layui-card-body">
  700. <button type="button" class="btn btn-sm btn-danger"
  701. onclick="popupFrame('拍照','ctrl','takephoto','')">拍照</button>
  702. <button type="button" class="btn btn-sm btn-danger"
  703. onclick="popupFrame('清虫','ctrl','turn','')">清虫</button>
  704. <button type="button" class="btn btn-sm btn-danger"
  705. onclick="popupFrame('升级','update','','')">升级</button>
  706. <button type="button" class="btn btn-sm btn-danger"
  707. onclick="popupFrame('重启','reboot','','')">重启</button>
  708. <!-- 测试 -->
  709. <button type="button" class="btn btn-sm btn-danger"
  710. onclick="popupFrame('震动开启','shake','','','1')">震动开启</button>
  711. <button type="button" class="btn btn-sm btn-danger"
  712. onclick="popupFrame('震动关闭','shake','','', '0')">震动关闭</button>
  713. <!-- 测试 -->
  714. <button type="button" class="btn btn-sm btn-danger"
  715. onclick="popupFrame('配置','config','1','')">板子配置</button>
  716. <!-- <button type="button" class="btn btn-sm btn-danger"
  717. onclick="popupFrame('禁用屏幕','screen','1','')">屏幕禁用</button> -->
  718. <!-- <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('配置','config','2','')">图片上传路径</button> -->
  719. </div>
  720. </div>
  721. </div>
  722. <div class="layui-col-md12">
  723. <div class="layui-card">
  724. <div class="layui-card-header">板子设置</div>
  725. <div class="layui-card-body">
  726. <button type="button" class="btn btn-sm btn-primary"
  727. onclick="lookChangeImei('look')">查看原始imei</button>
  728. <button type="button" class="btn btn-sm btn-danger"
  729. onclick="lookChangeImei('change')">更改imei</button>
  730. </div>
  731. </div>
  732. </div>
  733. </div>
  734. </div>
  735. </div>
  736. <div class="row">
  737. <input type="hidden" value="{{dver}}" id="dverInp">
  738. <!-- 设备模型 -->
  739. <div class="col-xs-12 col-md-6">
  740. <div style="height:680px;overflow:hidden;margin: 20px 0;" id="swfDiv">
  741. <embed style="width:100%;height:100%" wmode="Opaque" src="{% static 'flash/cbdFlash.swf'%}" />
  742. </div>
  743. <div class="backStyle equipInfo equiptInfo" id="showall">
  744. <div id="animatCover">
  745. <div class="flashDot flashDot1">
  746. <div class="line"></div>
  747. <div class="panelBox">
  748. <div class="bgimg">
  749. <div class="text" id="csq"></div>
  750. </div>
  751. </div>
  752. </div>
  753. <div class="flashDot flashDot2" style=" transform:rotateY(180deg) rotateX(0deg);">
  754. <div class="line"></div>
  755. <div class="panelBox">
  756. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  757. <div class="text" id="rps"></div>
  758. </div>
  759. </div>
  760. </div>
  761. <div class="flashDot flashDot3">
  762. <div class="line"></div>
  763. <div class="panelBox">
  764. <div class="bgimg">
  765. <div class="text">
  766. 诱虫灯管
  767. </div>
  768. </div>
  769. </div>
  770. </div>
  771. <div class="flashDot flashDot4" style=" transform:rotateY(180deg) rotateX(0deg);">
  772. <div class="line"></div>
  773. <div class="panelBox">
  774. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  775. <div class="text" id="lps"></div>
  776. </div>
  777. </div>
  778. </div>
  779. <div class="flashDot flashDot5">
  780. <div class="line"></div>
  781. <div class="panelBox">
  782. <div class="bgimg">
  783. <div class="text" id="gs"></div>
  784. </div>
  785. </div>
  786. </div>
  787. <div class="flashDot flashDot6" style=" transform:rotateY(180deg) rotateX(0deg);">
  788. <div class="line"></div>
  789. <div class="panelBox">
  790. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  791. <div class="text" id="hs"></div>
  792. </div>
  793. </div>
  794. </div>
  795. <div class="flashDot flashDot7">
  796. <div class="line"></div>
  797. <div class="panelBox">
  798. <div class="bgimg">
  799. <div class="text" id="upds"></div>
  800. </div>
  801. </div>
  802. </div>
  803. <div class="flashDot flashDot8" style=" transform:rotateY(180deg) rotateX(0deg);">
  804. <div class="line bottomline"></div>
  805. <div class="panelBox bottompanel">
  806. <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
  807. <div class="text" id="hrt"></div>
  808. </div>
  809. </div>
  810. </div>
  811. <div class="flashDot flashDot9">
  812. <div class="line bottomline"></div>
  813. <div class="panelBox bottompanel">
  814. <div class="bgimg">
  815. <div class="text" id="dnds"></div>
  816. </div>
  817. </div>
  818. </div>
  819. </div>
  820. </div>
  821. </div>
  822. <!-- 右边 -->
  823. <div class="col-xs-12 col-md-6" style="padding-left: 0px;padding-right:0px">
  824. <!-- 信息条 -->
  825. <div class="equipInfo">
  826. <div class="row" style="margin-left: 0;">
  827. <div class="col-xs-4">
  828. <div class="haloParent">
  829. <div class="halo halo6"></div>
  830. <div class="solidCircle solidCircle6">
  831. <img class="haloIcon" src="{% static '/img/haloIcon4.png' %}" alt="">
  832. </div>
  833. </div>
  834. <div class="txt">
  835. <span class="typeResult" id="dver"></span>
  836. <p class="typeResult">设备版本</p>
  837. </div>
  838. </div>
  839. <div class="col-xs-4">
  840. <div class="haloParent">
  841. <div class="halo halo4"></div>
  842. <div class="solidCircle solidCircle4">
  843. <img class="haloIcon" src="{% static '/img/haloIcon8.png' %}" alt="">
  844. </div>
  845. </div>
  846. <div class="txt">
  847. <span class="typeResult" id="weather">经度:113.46655</span>
  848. <p class="" id="wind">纬度:48.121211</p>
  849. </div>
  850. </div>
  851. <div class="col-xs-4">
  852. <div class="haloParent">
  853. <div class="halo halo8"></div>
  854. <div class="solidCircle solidCircle8">
  855. <img class="haloIcon" src="{% static '/img/haloIcon9.png' %}" alt="">
  856. </div>
  857. </div>
  858. <div class="txt">
  859. <span class="typeResult" id="csqValue"></span>
  860. <p class="typeResult" id="lat">信号强度</p>
  861. </div>
  862. </div>
  863. </div>
  864. </div>
  865. <div class="row">
  866. <!-- 温控状态 -->
  867. <div class="col-xs-4" style="padding-left: 0;">
  868. <!-- <div class="backStyle" style="margin-bottom:20px">
  869. <span class="typeResult tempTitel">设备开关:</span>
  870. <div class="switchbox">
  871. <input class="switchInp" id="onOff" type="checkbox">
  872. <div class="switchBj" onclick="sendOrder(this,'设备')">
  873. <span></span>
  874. </div>
  875. </div>
  876. </div> -->
  877. <div class="backStyle" style="margin-bottom:20px">
  878. <span class="typeResult tempTitel">温控状态:</span>
  879. <span class="typeResult tempTitel" id="tps"></span>
  880. <!-- <div class="switchbox">
  881. <input class="switchInp" id="tps" type="checkbox">
  882. <div class="switchBj">
  883. <span></span>
  884. </div>
  885. </div> -->
  886. </div>
  887. <div class="backStyle inmBox">
  888. <div class="temperatureKind">
  889. <div class="clearfix weatherType">
  890. <div class="tempTypeImg">
  891. <img src="{% static '/img/statusIcon1.png' %}" alt="">
  892. </div>
  893. <div class="tempTypeValue">
  894. <p class="font18" id="tpl">1℃</p>
  895. <p>低温限值</p>
  896. </div>
  897. </div>
  898. <div class="clearfix weatherType">
  899. <div class="tempTypeImg">
  900. <img src="{% static '/img/statusIcon2.png' %}" alt="">
  901. </div>
  902. <div class="tempTypeValue">
  903. <p class="font18" id="tph">70℃</p>
  904. <p>高温限值</p>
  905. </div>
  906. </div>
  907. <div class="clearfix weatherType">
  908. <div class="tempTypeImg">
  909. <img src="{% static '/img/statusIcon3.png' %}" alt="">
  910. </div>
  911. <div class="tempTypeValue">
  912. <p class="font18" id="at"></p>
  913. <p>环境温度</p>
  914. </div>
  915. </div>
  916. <div class="clearfix weatherType">
  917. <div class="tempTypeImg">
  918. <img src="{% static '/img/statusIcon4.png' %}" alt="">
  919. </div>
  920. <div class="tempTypeValue">
  921. <p class="font18" id="ah"></p>
  922. <p>环境湿度</p>
  923. </div>
  924. </div>
  925. </div>
  926. </div>
  927. </div>
  928. <!-- 配置 -->
  929. <div class="col-xs-8" style="padding-left: 0;">
  930. <div class="backStyle">
  931. <div style="text-align:right;position: absolute;right: 30px;">
  932. <button type="button" class="btn btn-sm btn-success"
  933. onclick="dtlconfigurationSwitch()">获取最新配置</button>
  934. </div>
  935. <div id="configParent" class="loadingParent">
  936. <div id="" class="loadCenter">
  937. <div class="skype-loader">
  938. <div class="dot">
  939. <div class="first"></div>
  940. </div>
  941. <div class="dot"></div>
  942. <div class="dot"></div>
  943. <div class="dot"></div>
  944. </div>
  945. 配置更新中...
  946. </div>
  947. </div>
  948. <!-- <div class="backStyle" style="margin-bottom:20px"> -->
  949. <div class="facilitySwitch" style="margin-bottom:20px">
  950. <span class="typeResult tempTitel facilitySwitch_tlt">设备开关:</span>
  951. <div class="switchbox">
  952. <input class="switchInp" name="Pho" id="onOff" type="checkbox" checked>
  953. <div class="switchBj" onclick="sendOrder(this,'设备')">
  954. <span></span>
  955. </div>
  956. </div>
  957. </div>
  958. <div class="widget-body">
  959. <div class="row">
  960. <div class="form-group">
  961. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  962. <font style="vertical-align: inherit;">
  963. <font style="vertical-align: inherit;"> 工作模式 </font>
  964. </font>
  965. </label>
  966. <div class="col-sm-9">
  967. <select name="workPattern" id="workPattern"
  968. onchange="popupFrame('切换工作模式','workmode',$(this),'')">
  969. <option value="">请选择</option>
  970. <option value="0">节能</option>
  971. <option value="1">常规</option>
  972. <option value="2">加强</option>
  973. </select>
  974. </div>
  975. <div style="clear:both"></div>
  976. </div>
  977. <div class="form-group">
  978. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  979. <font style="vertical-align: inherit;">
  980. <font style="vertical-align: inherit;"> 定时模式 </font>
  981. </font>
  982. </label>
  983. <div class="col-sm-9">
  984. <select name="timing" id="dtlTiming">
  985. <option value="0">光控</option>
  986. <option value="1">时控</option>
  987. </select>
  988. </div>
  989. <div style="clear:both"></div>
  990. </div>
  991. <!-- 1结束 -->
  992. <div class="form-group lightPattern">
  993. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  994. <font style="vertical-align: inherit;">
  995. <font style="vertical-align: inherit;"> 定时时长 </font>
  996. </font>
  997. </label>
  998. <div class="col-sm-9">
  999. <span class="initVal">1</span>
  1000. <div class="slider" id="dtlTimingLength-slider"></div>
  1001. <span class="sliderVal" id="dtlTimingLength">1</span>
  1002. </div>
  1003. <div style="clear:both"></div>
  1004. </div>
  1005. <!-- 2结束 -->
  1006. <div class="form-group timePattern">
  1007. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1008. <font style="vertical-align: inherit;">
  1009. <font style="vertical-align: inherit;"> 开始结束时间 </font>
  1010. </font>
  1011. </label>
  1012. <div class="col-sm-9">
  1013. <div>
  1014. <span class="hintTitle">开始时间</span>
  1015. <span class="hintTitle">结束时间</span>
  1016. </div>
  1017. <select name="begin" id="begin">
  1018. <option value="0">0</option>
  1019. <option value="1">1</option>
  1020. <option value="2">2</option>
  1021. <option value="3">3</option>
  1022. <option value="4">4</option>
  1023. <option value="5">5</option>
  1024. <option value="6">6</option>
  1025. <option value="7">7</option>
  1026. <option value="8">8</option>
  1027. <option value="9">9</option>
  1028. <option value="10">10</option>
  1029. <option value="11">11</option>
  1030. <option value="12">12</option>
  1031. <option value="13">13</option>
  1032. <option value="14">14</option>
  1033. <option value="15">15</option>
  1034. <option value="16">16</option>
  1035. <option value="17">17</option>
  1036. <option value="18">18</option>
  1037. <option value="19">19</option>
  1038. <option value="20">20</option>
  1039. <option value="21">21</option>
  1040. <option value="22">22</option>
  1041. <option value="23">23</option>
  1042. </select>
  1043. <select name="end" id="end">
  1044. <option value="0">0</option>
  1045. <option value="1">1</option>
  1046. <option value="2">2</option>
  1047. <option value="3">3</option>
  1048. <option value="4">4</option>
  1049. <option value="5">5</option>
  1050. <option value="6">6</option>
  1051. <option value="7">7</option>
  1052. <option value="8">8</option>
  1053. <option value="9">9</option>
  1054. <option value="10">10</option>
  1055. <option value="11">11</option>
  1056. <option value="12">12</option>
  1057. <option value="13">13</option>
  1058. <option value="14">14</option>
  1059. <option value="15">15</option>
  1060. <option value="16">16</option>
  1061. <option value="17">17</option>
  1062. <option value="18">18</option>
  1063. <option value="19">19</option>
  1064. <option value="20">20</option>
  1065. <option value="21">21</option>
  1066. <option value="22">22</option>
  1067. <option value="23">23</option>
  1068. </select>
  1069. </div>
  1070. <div style="clear:both"></div>
  1071. </div>
  1072. <!-- 3结束 -->
  1073. <div class="form-group">
  1074. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1075. <font style="vertical-align: inherit;">
  1076. <font style="vertical-align: inherit;"> 落虫时间 </font>
  1077. </font>
  1078. </label>
  1079. <div class="col-sm-9">
  1080. <span class="initVal">1</span>
  1081. <div class="slider" id="dtlDropTime-slider"></div>
  1082. <span class="sliderVal" id="dtlDropTime">20</span>
  1083. </div>
  1084. <div style="clear:both"></div>
  1085. </div>
  1086. <!-- 4结束 -->
  1087. <div class="form-group">
  1088. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1089. <font style="vertical-align: inherit;">
  1090. <font style="vertical-align: inherit;"> 加热时间 </font>
  1091. </font>
  1092. </label>
  1093. <div class="col-sm-9">
  1094. <span class="initVal">1</span>
  1095. <div class="slider" id="dtlCalefactionTime-slider"></div>
  1096. <span class="sliderVal" id="dtlCalefactionTime">20</span>
  1097. </div>
  1098. <div style="clear:both"></div>
  1099. </div>
  1100. <!-- 5结束 -->
  1101. <div class="form-group">
  1102. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1103. <font style="vertical-align: inherit;">
  1104. <font style="vertical-align: inherit;"> 加热温度 </font>
  1105. </font>
  1106. </label>
  1107. <div class="col-sm-9">
  1108. <span class="initVal">75</span>
  1109. <div class="slider" id="dtlCalefactionTemperature-slider"></div>
  1110. <span class="sliderVal" id="dtlCalefactionTemperature">125</span>
  1111. </div>
  1112. <div style="clear:both"></div>
  1113. </div>
  1114. <!-- 6结束 -->
  1115. <div class="form-group">
  1116. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1117. <font style="vertical-align: inherit;">
  1118. <font style="vertical-align: inherit;"> 高温保护阈值 </font>
  1119. </font>
  1120. </label>
  1121. <div class="col-sm-9">
  1122. <span class="initVal">50</span>
  1123. <div class="slider" id="dtlHighLimit-slider"></div>
  1124. <span class="sliderVal" id="dtlHighLimit">70</span>
  1125. </div>
  1126. <div style="clear:both"></div>
  1127. </div>
  1128. <!-- 7结束 -->
  1129. <div class="form-group">
  1130. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1131. <font style="vertical-align: inherit;">
  1132. <font style="vertical-align: inherit;"> 低温保护阈值 </font>
  1133. </font>
  1134. </label>
  1135. <div class="col-sm-9">
  1136. <span class="initVal">1</span>
  1137. <div class="slider" id="dtlLowLimit-slider"></div>
  1138. <span class="sliderVal" id="dtlLowLimit">10</span>
  1139. </div>
  1140. <div style="clear:both"></div>
  1141. </div>
  1142. <!-- 8结束 -->
  1143. <div class="form-group">
  1144. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1145. <font style="vertical-align: inherit;">
  1146. <font style="vertical-align: inherit;"> 数据上传间隔 </font>
  1147. </font>
  1148. </label>
  1149. <div class="col-sm-9">
  1150. <span class="initVal">10</span>
  1151. <div class="slider" id="dtlDataUpTime-slider"></div>
  1152. <span class="sliderVal" id="dtlDataUpTime">60</span>
  1153. </div>
  1154. <div style="clear:both"></div>
  1155. </div>
  1156. <!-- 9结束 -->
  1157. <div class="form-group" id="shakeID">
  1158. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1159. <font style="vertical-align: inherit;">
  1160. <font style="vertical-align: inherit;"> 震动时间(秒) </font>
  1161. </font>
  1162. </label>
  1163. <div class="col-sm-9">
  1164. <span class="initVal">0</span>
  1165. <div class="slider" id="shakeTime-slider"></div>
  1166. <span class="sliderVal" id="shakeTime">1</span>
  1167. </div>
  1168. <div style="clear:both"></div>
  1169. </div>
  1170. <!-- 10结束 -->
  1171. <!-- <div class="form-group">
  1172. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1173. <font style="vertical-align: inherit;">
  1174. <font style="vertical-align: inherit;"> 图片分辨率 </font>
  1175. </font>
  1176. </label>
  1177. <div class="col-sm-9">
  1178. <select name="imgHvga" id="imgHvga">
  1179. <option value="0">高</option>
  1180. <option value="1">中</option>
  1181. <option value="2">低</option>
  1182. </select>
  1183. </div>
  1184. <div style="clear:both"></div>
  1185. </div> -->
  1186. <!-- 结束 -->
  1187. </div>
  1188. <div class="collocateBtn">
  1189. <button class="btn btn-sm btn-info" onclick="saveOperation()">
  1190. <font style="vertical-align: inherit;">
  1191. <font style="vertical-align: inherit;">确定</font>
  1192. </font>
  1193. </button>
  1194. <button class="btn btn-sm" onclick="cancelConfig()">
  1195. <font style="vertical-align: inherit;">
  1196. <font style="vertical-align: inherit;">取消</font>
  1197. </font>
  1198. </button>
  1199. </div>
  1200. </div>
  1201. </div>
  1202. </div>
  1203. </div>
  1204. </div>
  1205. </div>
  1206. </div>
  1207. <!-- 强制配置弹框 -->
  1208. <div class="coerceConfig">
  1209. <h1 class="configTitle">MQTT配置</h1>
  1210. <form class="form-horizontal" role="form">
  1211. <div class="form-group">
  1212. <label class="col-sm-3 control-label no-padding-right">MQTT地址</label>
  1213. <div class="col-sm-9">
  1214. <input type="text" id="plankUrl" class="col-sm-6" placeholder="xxxx.com">
  1215. </div>
  1216. </div>
  1217. <div class="form-group">
  1218. <label class="col-sm-3 control-label no-padding-right">端口</label>
  1219. <div class="col-sm-9">
  1220. <input type="text" id="port" class="col-sm-6" placeholder="1883">
  1221. </div>
  1222. </div>
  1223. <div class="form-group">
  1224. <label class="col-sm-3 control-label no-padding-right">上传地址</label>
  1225. <div class="col-sm-9">
  1226. <input type="text" id="pub" value="/yfkj/cbd/pub/" class="col-sm-6"
  1227. placeholder="/yfkj/cbd/pub/">
  1228. </div>
  1229. </div>
  1230. <div class="form-group">
  1231. <label class="col-sm-3 control-label no-padding-right">下发地址</label>
  1232. <div class="col-sm-9">
  1233. <input type="text" id="sub" value="/yfkj/cbd/sub/" class="col-sm-6"
  1234. placeholder="/yfkj/cbd/sub/">
  1235. </div>
  1236. </div>
  1237. <div class="form-group">
  1238. <label class="col-sm-3 control-label no-padding-right">图片上传地址</label>
  1239. <div class="col-sm-9">
  1240. <input type="text" id="photoUrl" class="col-sm-6" placeholder="http://xxxxx.com">
  1241. </div>
  1242. </div>
  1243. <div class="clearfix">
  1244. <div class="col-md-offset-3 col-md-9">
  1245. <button class="btn btn-sm" type="reset" onclick="closeConfig()">
  1246. <i class="ace-icon fa fa-undo bigger-110"></i>
  1247. 取消
  1248. </button>
  1249. &nbsp; &nbsp; &nbsp;
  1250. <button class="btn btn-sm btn-info" type="button" onclick="saveConfig()">
  1251. <i class="ace-icon fa fa-check bigger-110"></i>
  1252. 确定
  1253. </button>
  1254. </div>
  1255. </div>
  1256. </form>
  1257. </div>
  1258. <div class="markimg"></div>
  1259. <!-- 配置项 -->
  1260. <div class="modal" id="myModal" tabindex="-1" data-backdrop="static" data-keyboard="false" role="dialog"
  1261. aria-labelledby="myModalLabel" style="display: none;">
  1262. <div class="modal-dialog" role="document">
  1263. <div class="modal-content">
  1264. <div class="widget-header">
  1265. <h4 class="widget-title">
  1266. SIM卡详情:
  1267. <span id="sppbId"></span>
  1268. <!-- <input type="hidden" value="" id="hideId" name="id"> -->
  1269. </h4>
  1270. <div class="widget-toolbar">
  1271. <a href="#" data-dismiss="modal" aria-hidden="true">
  1272. <i class="ace-icon fa fa-times"></i>
  1273. </a>
  1274. </div>
  1275. </div>
  1276. <div class="widget-body">
  1277. <div class="row">
  1278. <div class="form-group">
  1279. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1280. <font style="vertical-align: inherit;">
  1281. <font style="vertical-align: inherit;"> ICCID: </font>
  1282. </font>
  1283. </label>
  1284. <div class="col-sm-9">
  1285. <div class="currIccid"></div>
  1286. </div>
  1287. <div style="clear:both"></div>
  1288. </div>
  1289. <div class="form-group">
  1290. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1291. <font style="vertical-align: inherit;">
  1292. <font style="vertical-align: inherit;"> 状态: </font>
  1293. </font>
  1294. </label>
  1295. <div class="col-sm-9">
  1296. <div id="account_status"></div>
  1297. </div>
  1298. <div style="clear:both"></div>
  1299. </div>
  1300. <div class="form-group">
  1301. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1302. <font style="vertical-align: inherit;">
  1303. <font style="vertical-align: inherit;"> 套餐: </font>
  1304. </font>
  1305. </label>
  1306. <div class="col-sm-9">
  1307. <div id="data_plan">
  1308. <div class="progressParent">
  1309. <div class="layui-progress">
  1310. <div class="layui-progress-bar layui-bg-blue" lay-percent="100%"></div>
  1311. </div>
  1312. </div>
  1313. <div class="progressVal"></div>
  1314. </div>
  1315. </div>
  1316. <div style="clear:both"></div>
  1317. </div>
  1318. <div class="form-group">
  1319. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1320. <font style="vertical-align: inherit;">
  1321. <font style="vertical-align: inherit;"> 已用流量: </font>
  1322. </font>
  1323. </label>
  1324. <div class="col-sm-9">
  1325. <div id="data_usage">
  1326. <div class="progressParent">
  1327. <div class="layui-progress">
  1328. <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
  1329. </div>
  1330. </div>
  1331. <div class="progressVal"></div>
  1332. </div>
  1333. </div>
  1334. <div style="clear:both"></div>
  1335. </div>
  1336. <div class="form-group">
  1337. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1338. <font style="vertical-align: inherit;">
  1339. <font style="vertical-align: inherit;"> 剩余流量: </font>
  1340. </font>
  1341. </label>
  1342. <div class="col-sm-9">
  1343. <div id="data_balance">
  1344. <div class="progressParent">
  1345. <div class="layui-progress" lay-filter="demo">
  1346. <div class="layui-progress-bar layui-bg-green" lay-percent="0%"></div>
  1347. </div>
  1348. </div>
  1349. <div class="progressVal"></div>
  1350. </div>
  1351. </div>
  1352. <div style="clear:both"></div>
  1353. </div>
  1354. <div class="form-group">
  1355. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1356. <font style="vertical-align: inherit;">
  1357. <font style="vertical-align: inherit;"> 到期时间: </font>
  1358. </font>
  1359. </label>
  1360. <div class="col-sm-9">
  1361. <div class="expiry_date">2019-11-01 13:59:35</div>
  1362. </div>
  1363. <div style="clear:both"></div>
  1364. </div>
  1365. <div class="form-group">
  1366. <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
  1367. <font style="vertical-align: inherit;">
  1368. <font style="vertical-align: inherit;"> 更换ICCID: </font>
  1369. </font>
  1370. </label>
  1371. <div class="col-sm-9">
  1372. <input type="text" id="changeIccid" autocomplete="off">
  1373. </div>
  1374. <div style="clear:both"></div>
  1375. </div>
  1376. <!-- 结束 -->
  1377. </div>
  1378. <div class="collocateBtn">
  1379. <button class="btn btn-sm btn-info" onclick="saveChangeIccid()">
  1380. <font style="vertical-align: inherit;">
  1381. <font style="vertical-align: inherit;">确定</font>
  1382. </font>
  1383. </button>
  1384. <button class="btn btn-sm" data-dismiss="modal" aria-hidden="true">
  1385. <font style="vertical-align: inherit;">
  1386. <font style="vertical-align: inherit;">取消</font>
  1387. </font>
  1388. </button>
  1389. </div>
  1390. </div>
  1391. <div>
  1392. </div>
  1393. </div>
  1394. </div>
  1395. </div>
  1396. <!-- 信号强度折线图 -->
  1397. <div id="signal" style="max-width:800px;height:400px;display:none">
  1398. </div>
  1399. <!-- loading -->
  1400. <div id="loadingParent">
  1401. <div id="loadCenter">
  1402. <div class="skype-loader">
  1403. <div class="dot">
  1404. <div class="first"></div>
  1405. </div>
  1406. <div class="dot"></div>
  1407. <div class="dot"></div>
  1408. <div class="dot"></div>
  1409. </div>
  1410. 正在更新...
  1411. </div>
  1412. </div>
  1413. <input type="hidden" value="{{equip_id}}" id="imei">
  1414. <input type="hidden" value="" id="iccid">
  1415. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  1416. <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
  1417. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  1418. <script type="text/javascript"
  1419. src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
  1420. <script src="{% static '/js/common.js' %}?versions=0.5.4"></script>
  1421. <!-- <script src="{% static '/assets/js/ace.min.js' %}"></script> -->
  1422. <!-- <script src="{% static '/lib/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script> -->
  1423. <!-- <script src="{% static '/lib/js/main.js' %}" type="text/javascript" charset="utf-8"></script> -->
  1424. <script src="{% static '/lib/js/jquery-ui.min.js' %}"></script>
  1425. <script src="{% static '/lib/js/highcharts.js'%}" type="text/javascript"></script>
  1426. <script src="{% static '/lib/js/jquery.ui.touch-punch.min.js' %}"></script>
  1427. <script src="{% static '/lib/js/detailsAnimat.js' %}"></script>
  1428. <script src="{% static '/lib/js/coordOffset.js' %}"></script>
  1429. <script type="text/javascript">
  1430. $.ajaxSetup({
  1431. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  1432. });
  1433. $(window).resize(function () {
  1434. scrollBar()
  1435. });
  1436. var parentUserName = $('#parentUserName', parent.document).html();
  1437. // if(!(parentUserName == '云飞展示账号')){
  1438. // $('#takephotoShowBtn').remove();
  1439. // }
  1440. if (!(parentUserName == 'admin' || parentUserName == 'user')) {
  1441. $('#operationBtn').remove();
  1442. $('#handleBtns').remove();
  1443. $('#semaphore').remove();
  1444. }
  1445. // 自定义动画
  1446. animate.init();
  1447. animate.showAll();
  1448. $('#showall').on('click', function (e) {
  1449. animate.showAll();
  1450. e.stopPropagation();
  1451. })
  1452. // 获取位置
  1453. var geoc = new BMap.Geocoder();
  1454. // rtu信息
  1455. var rtuInfo;
  1456. var configData = '';//配置数据
  1457. // 获取当前设备状态信息
  1458. $.ajax({
  1459. url: 'equipmanage_cbd_detail',
  1460. type: 'post',
  1461. dataType: 'json',
  1462. data: {
  1463. id: $('#imei').val()
  1464. },
  1465. success: function (data) {
  1466. equipData(data);
  1467. var stat = eval('(' + data[0].cbd_status + ')');
  1468. var dver = stat.dver.split('.');
  1469. if (dver[0] == 4 || dver[0] == 5) {
  1470. $('#swfDiv').show()
  1471. } else {
  1472. $('#showall').show()
  1473. }
  1474. // rtu信息
  1475. if ((data[0].rtu_info == null) || (data[0].rtu_info.length < 2)) {
  1476. $('#rtuInfoBtn').hide();
  1477. } else {
  1478. $('#rtuInfoBtn').show();
  1479. }
  1480. $('#rtuInfoBtn').on('click', function () {
  1481. setRtuHtml(data[0].rtu_info);
  1482. })
  1483. }
  1484. })
  1485. $.ajax({
  1486. url: "equipmanage_cbd",
  1487. type: 'post',
  1488. data: {
  1489. id: $('#imei').val(),
  1490. req: "paramconf",
  1491. },
  1492. success: function (data) {
  1493. configData = data;
  1494. configFill(data);
  1495. // var str = "5.9HK(verify)";
  1496. // console.log(str)
  1497. // if () {
  1498. // }
  1499. // console.log(str.indexOf("HK") != -1 ); // true
  1500. }
  1501. })
  1502. var ab
  1503. function equipData(dat) {
  1504. var equipStatus = dat[0];
  1505. var equipData = dat[1];
  1506. $('#equip_name').html(equipStatus.equip_name || '无');
  1507. $('#upl_time').html(equipStatus.upl_time);
  1508. var stat = eval('(' + equipStatus.cbd_status + ')');
  1509. var cbd_data = eval('(' + equipData.cbd_data + ')');;
  1510. // $('#ts').html(stat.ts ? '时控' : '光控');//定时模式
  1511. $('#gs').html('当前通道:' + (stat.gs ? '落虫' : '排水'));//通道模式
  1512. $('#upds').html('上仓门:' + (stat.upds ? '打开' : '关闭'));//上仓门
  1513. $('#dnds').html('下仓门:' + (stat.dnds ? '打开' : '关闭'));//下舱门
  1514. $('#csq').html('信号强度:' + stat.csq);//信号强度
  1515. $('#dver').html(stat.dver);//版本号
  1516. //判断当前版本号是否为5.0版本再显示设备开关
  1517. ab = stat.dver;
  1518. var ab_str = ab.toString();
  1519. var ab_num = parseInt(ab_str.substring(0, ab_str.indexOf('.')));
  1520. if (ab_num == '5') {
  1521. $('.facilitySwitch').removeClass('dataNone')
  1522. } else {
  1523. $('.facilitySwitch').addClass('dataNone')
  1524. }
  1525. //判断当前设备是否为海康
  1526. var reg = RegExp(/HK/);
  1527. if (ab_str.match(reg)) {
  1528. // 包含
  1529. $('#shakeID').removeClass('dataNone')
  1530. } else {
  1531. $('#shakeID').addClass('dataNone')
  1532. }
  1533. // console.log(stat.csq);
  1534. // console.log(123);
  1535. $('#csqValue').html(stat.csq);//维度
  1536. if (stat.lng > 999) {
  1537. var lng = Math.floor(stat.lng / 100) + ((stat.lng % 100) / 60);
  1538. var lat = Math.floor(stat.lat / 100) + ((stat.lat % 100) / 60);
  1539. } else {
  1540. var lng = Number(stat.lng);
  1541. var lat = Number(stat.lat);
  1542. }
  1543. var lng1 = wgs84togcj02(lng, lat);
  1544. var lng2 = gcj02tobd09(lng1[0], lng1[1]);
  1545. var pt = new BMap.Point(lng2[0], lng2[1]);
  1546. geoc.getLocation(pt, function (rs) {
  1547. var addComp = rs.addressComponents;
  1548. // $('.area').html('位置:'+ addComp.province + ", " + addComp.city + ", " + addComp.district)
  1549. $('#curr_area').html(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
  1550. if (addComp.city) {
  1551. $.ajax({ //高德地图天气请求
  1552. type: 'get',
  1553. url: 'https://restapi.amap.com/v3/weather/weatherInfo?city=' + addComp.city + '&key=50e3d228f679af99eee7dbdb4523d069',
  1554. dataType: 'JSON',
  1555. error: function () {
  1556. alert('网络错误');
  1557. },
  1558. success: function (res) {
  1559. console.log(res)
  1560. if (res.info == 'OK' && res.lives.length) {
  1561. var allmsg = res.lives[0];
  1562. // $('#weather').append('<div>'+allmsg.city+','+allmsg.reporttime+','+allmsg.winddirection+'风'+allmsg.windpower+'级,'+allmsg.temperature+'C°,'+allmsg.weather+'</div>');
  1563. $('#weather').html(allmsg.temperature + 'C°,' + allmsg.weather);
  1564. $('#wind').html(allmsg.winddirection + '风' + allmsg.windpower + '级');
  1565. }
  1566. }
  1567. });
  1568. }
  1569. });
  1570. // $('#lat').html('纬度:' + lat.toFixed(5));//维度
  1571. // $('#lng').html('经度:' + lng.toFixed(4));//经度
  1572. $('#tps').html(stat.tps ? '异常' : '正常');
  1573. // if (cbd_data.tps == 0) {//温控状态
  1574. // $('#tps').attr('checked', 'checked');
  1575. // } else {
  1576. // $('#tps').attr('checked', false);
  1577. // }
  1578. $('#lps').html('光控检测:' + (stat.lps ? '有光照' : '无光照'));//光控状态
  1579. $('#hs').html('加热开关:' + (stat.hs ? '开启' : '关闭'));//加热状态
  1580. $('#rps').html('雨控状态:' + (stat.rps ? '下雨' : '正常'));//雨控状态
  1581. $('#hrt').html('加热仓温度:' + cbd_data.hrt);//加热仓温度
  1582. $('#at').html((cbd_data.at / 10).toFixed(1) + '℃');//环境温度
  1583. $('#ah').html((cbd_data.ah / 10).toFixed(1) + '%RH');//环境湿度
  1584. $('#iccid').val(stat.iccid);
  1585. }
  1586. $('#dtlTiming').on('change', function () {
  1587. if ($(this).val() == 0) {
  1588. $('.lightPattern').show();
  1589. $('.timePattern').hide();
  1590. } else {
  1591. $('.lightPattern').hide();
  1592. $('.timePattern').show();
  1593. }
  1594. })
  1595. // $('.slider').slider({
  1596. // disabled: true,
  1597. // })
  1598. // 1定时时长
  1599. $("#dtlTimingLength-slider").css('width', '85%').slider({
  1600. value: 1,
  1601. range: "min",
  1602. min: 1,
  1603. max: 10,
  1604. step: 1,
  1605. slide: function (event, ui) {
  1606. var val = parseInt(ui.value);
  1607. $('#dtlTimingLength').html(val);
  1608. }
  1609. });
  1610. // 2落虫
  1611. $("#dtlDropTime-slider").css('width', '85%').slider({
  1612. value: 1,
  1613. range: "min",
  1614. min: 1,
  1615. max: 20,
  1616. step: 1,
  1617. slide: function (event, ui) {
  1618. var val = parseInt(ui.value);
  1619. $('#dtlDropTime').html(val);
  1620. }
  1621. });
  1622. // 3加热时间
  1623. $("#dtlCalefactionTime-slider").css('width', '85%').slider({
  1624. value: 1,
  1625. range: "min",
  1626. min: 1,
  1627. max: 20,
  1628. step: 1,
  1629. slide: function (event, ui) {
  1630. var val = parseInt(ui.value);
  1631. $('#dtlCalefactionTime').html(val);
  1632. }
  1633. });
  1634. // 4加热温度
  1635. $("#dtlCalefactionTemperature-slider").css('width', '85%').slider({
  1636. value: 75,
  1637. range: "min",
  1638. min: 75,
  1639. max: 120,
  1640. step: 1,
  1641. slide: function (event, ui) {
  1642. var val = parseInt(ui.value);
  1643. $('#dtlCalefactionTemperature').html(val);
  1644. }
  1645. });
  1646. // 5高温保护阈值
  1647. $("#dtlHighLimit-slider").css('width', '85%').slider({
  1648. value: 50,
  1649. range: "min",
  1650. min: 50,
  1651. max: 70,
  1652. step: 1,
  1653. slide: function (event, ui) {
  1654. var val = parseInt(ui.value);
  1655. $('#dtlHighLimit').html(val);
  1656. }
  1657. });
  1658. // 6低温保护阈值
  1659. $("#dtlLowLimit-slider").css('width', '85%').slider({
  1660. value: 1,
  1661. range: "min",
  1662. min: 1,
  1663. max: 10,
  1664. step: 1,
  1665. slide: function (event, ui) {
  1666. var val = parseInt(ui.value);
  1667. $('#dtlLowLimit').html(val);
  1668. }
  1669. });
  1670. // 7数据上相间隔
  1671. $("#dtlDataUpTime-slider").css('width', '85%').slider({
  1672. value: 1,
  1673. range: "min",
  1674. min: 10,
  1675. max: 60,
  1676. step: 10,
  1677. slide: function (event, ui) {
  1678. var val = parseInt(ui.value);
  1679. $('#dtlDataUpTime').html(val);
  1680. }
  1681. });
  1682. // 8震动时间
  1683. $("#shakeTime-slider").css('width', '85%').slider({
  1684. value: 0,
  1685. range: "min",
  1686. min: 0,
  1687. max: 100,
  1688. step: 1,
  1689. slide: function (event, ui) {
  1690. var val = parseInt(ui.value);
  1691. $('#shakeTime').html(val);
  1692. }
  1693. });
  1694. //刷新:下发查询:
  1695. function reloadPage() {
  1696. var id = $('#imei').val();
  1697. $.ajax({
  1698. type: "post",
  1699. url: 'cbd_mqtt',
  1700. async: false,
  1701. data: {
  1702. "req": "read",//读取
  1703. "topicid": id,
  1704. "kind": "status"//读取下位机状态
  1705. },
  1706. dataType: "json",
  1707. success: function (data) {
  1708. if (data == "0") {
  1709. $.ajax({
  1710. type: "post",
  1711. url: 'cbd_mqtt',
  1712. async: false,
  1713. data: {
  1714. "req": "read",//读取
  1715. "topicid": id,
  1716. "kind": "data"//读取下位机状态
  1717. },
  1718. dataType: "json",
  1719. beforeSend: function () {
  1720. $('#loadingParent').show();
  1721. },
  1722. complete: function () {
  1723. setTimeout(function () {
  1724. $('#loadingParent').hide();
  1725. }, 6000)
  1726. },
  1727. success: function (data) {
  1728. if (data == "0") {
  1729. layer.msg("下发查询发送成功!")
  1730. setTimeout(function () {
  1731. // 获取当前设备状态信息
  1732. $.ajax({
  1733. url: 'equipmanage_cbd_detail',
  1734. type: 'post',
  1735. dataType: 'json',
  1736. data: {
  1737. id: $('#imei').val()
  1738. },
  1739. success: function (data) {
  1740. equipData(data);
  1741. }
  1742. })
  1743. }, 6000)
  1744. } else {
  1745. layer.msg("发送失败!")
  1746. }
  1747. }
  1748. })
  1749. } else {
  1750. layer.msg("发送失败!")
  1751. }
  1752. }
  1753. })
  1754. }
  1755. // dtlconfigurationSwitch()
  1756. // 配置按钮
  1757. function dtlconfigurationSwitch() {
  1758. var id = $('#imei').val();
  1759. $.ajax({
  1760. type: "post",
  1761. url: 'cbd_mqtt',
  1762. data: {
  1763. "req": "read",//读取
  1764. "topicid": id,
  1765. "kind": "paramconf"//读取下位机状态
  1766. },
  1767. dataType: "json",
  1768. beforeSend: function () {
  1769. $('#configParent').show();
  1770. },
  1771. complete: function () {
  1772. setTimeout(function () {
  1773. $('#configParent').hide();
  1774. }, 3000)
  1775. },
  1776. success: function (data) {
  1777. if (data == "0") {
  1778. // layer.msg("发送成功!", { time: 2000 })
  1779. setTimeout(function () {
  1780. $.ajax({
  1781. url: "equipmanage_cbd",
  1782. type: 'post',
  1783. data: {
  1784. id: id,
  1785. req: "paramconf",
  1786. },
  1787. success: function (data) {
  1788. configData = data;
  1789. configFill(data);
  1790. }
  1791. })
  1792. }, 3000)
  1793. } else {
  1794. layer.msg("发送失败!")
  1795. }
  1796. }
  1797. })
  1798. }
  1799. // 填充函数
  1800. function configFill(dat) {
  1801. var data = $.parseJSON(dat);
  1802. var para = eval("(" + data.paramconf + ")");
  1803. if (para != '' && para != null) {
  1804. // 定时模式
  1805. $('#dtlTiming').val(para.ts);
  1806. if (para.ts == 0) {
  1807. $('.lightPattern').show();
  1808. $('.timePattern').hide();
  1809. } else {
  1810. $('.lightPattern').hide();
  1811. $('.timePattern').show();
  1812. }
  1813. //设备开关
  1814. if (para.boot == 1) {
  1815. $("#onOff").prop('checked', false)
  1816. } else {
  1817. $("#onOff").prop('checked', true)
  1818. }
  1819. // 滑块
  1820. $("#dtlTimingLength-slider").slider('value', para.tt);
  1821. $('#dtlTimingLength').html(para.tt);
  1822. $("#dtlDropTime-slider").slider('value', para.collt);
  1823. $('#dtlDropTime').html(para.collt);
  1824. $("#dtlCalefactionTime-slider").slider('value', para.htim);
  1825. $('#dtlCalefactionTime').html(para.htim);
  1826. $("#dtlCalefactionTemperature-slider").slider('value', para.hst);
  1827. $('#dtlCalefactionTemperature').html(para.hst);
  1828. $("#dtlHighLimit-slider").slider('value', para.tph);
  1829. $('#dtlHighLimit').html(para.tph);//高温
  1830. $('#tph').html(para.tph + '℃');
  1831. $("#dtlLowLimit-slider").slider('value', para.tpl);
  1832. $('#dtlLowLimit').html(para.tpl);//低温
  1833. $('#tpl').html(para.tpl + '℃');
  1834. $("#dtlDataUpTime-slider").slider('value', para.datt);
  1835. $('#dtlDataUpTime').html(para.datt);
  1836. $("#shakeTime-slider").slider('value', para.shake_sec);
  1837. $('#shakeTime').html(para.shake_sec);
  1838. // 时间
  1839. if ($('#dtlTiming').val() == 1) {
  1840. $('#timSelectBox').val(Math.floor(para.st));
  1841. $('#timSelectBox2').val(Math.floor(para.et));
  1842. $('#begin').val(Math.floor(para.st));
  1843. $('#end').val(Math.floor(para.et));
  1844. }
  1845. // $('#imgHvga').val(para.imgres);
  1846. $('.slider').slider({
  1847. disabled: false,
  1848. })
  1849. } else {
  1850. // 定时模式
  1851. $('#dtlTiming').val(0);
  1852. $('.lightPattern').show();
  1853. $('.timePattern').hide();
  1854. // 滑块
  1855. $("#dtlTimingLength-slider").slider('value', 1);
  1856. $('#dtlTimingLength').html(1);
  1857. $("#dtlDropTime-slider").slider('value', 1);
  1858. $('#dtlDropTime').html(1);
  1859. $("#dtlCalefactionTime-slider").slider('value', 1);
  1860. $('#dtlCalefactionTime').html(1);
  1861. $("#dtlCalefactionTemperature-slider").slider('value', 75);
  1862. $('#dtlCalefactionTemperature').html(75);
  1863. $("#dtlHighLimit-slider").slider('value', 50);
  1864. $('#dtlHighLimit').html(50);
  1865. $("#dtlLowLimit-slider").slider('value', 1);
  1866. $('#dtlLowLimit').html(1);
  1867. $("#dtlDataUpTime-slider").slider('value', 10);
  1868. $('#dtlDataUpTime').html(10);
  1869. $("#shakeTime-slider").slider('value', 10);
  1870. $('#shakeTime').html(10);
  1871. $('#begin').val(0);
  1872. $('#end').val(0);
  1873. // $('#imgHvga').val(0);
  1874. $('#tph').html('70℃');
  1875. $('#tpl').html('1℃');
  1876. }
  1877. }
  1878. //保存
  1879. function saveOperation() {
  1880. //判断当前设备是否为海康
  1881. var ab_str = ab.toString();
  1882. var reg = RegExp(/HK/);
  1883. if (ab_str.match(reg)) {
  1884. // 包含
  1885. var data = {
  1886. req: 'set',
  1887. id: $('#imei').val(),
  1888. timing: $('#dtlTiming').val(),
  1889. timingLength: $('#dtlTimingLength').html(),
  1890. begin: $('#begin').val(),
  1891. end: $('#end').val(),
  1892. dropTime: $('#dtlDropTime').html(),
  1893. calefactionTime: $('#dtlCalefactionTime').html(),
  1894. calefactionTemperature: $('#dtlCalefactionTemperature').html(),
  1895. highLimit: $('#dtlHighLimit').html(),
  1896. lowLimit: $('#dtlLowLimit').html(),
  1897. dataUpTime: $('#dtlDataUpTime').html(),
  1898. // imgHvga: $('#imgHvga').val(),
  1899. shake_sec: $('#shakeTime').html()
  1900. }
  1901. } else {
  1902. var data = {
  1903. req: 'set',
  1904. id: $('#imei').val(),
  1905. timing: $('#dtlTiming').val(),
  1906. timingLength: $('#dtlTimingLength').html(),
  1907. begin: $('#begin').val(),
  1908. end: $('#end').val(),
  1909. dropTime: $('#dtlDropTime').html(),
  1910. calefactionTime: $('#dtlCalefactionTime').html(),
  1911. calefactionTemperature: $('#dtlCalefactionTemperature').html(),
  1912. highLimit: $('#dtlHighLimit').html(),
  1913. lowLimit: $('#dtlLowLimit').html(),
  1914. dataUpTime: $('#dtlDataUpTime').html(),
  1915. // imgHvga: $('#imgHvga').val(),
  1916. }
  1917. }
  1918. if ($('#dtlTiming').val() == 1) {
  1919. if ($('#begin').val() && $('#end').val()) {
  1920. saveOperationAjax('cbd_mqtt', data)
  1921. } else {
  1922. layer.msg("请将时控时间填写完整!");
  1923. }
  1924. } else {
  1925. saveOperationAjax('cbd_mqtt', data);
  1926. }
  1927. }
  1928. function saveOperationAjax(url, data) {
  1929. //判断当前的震动时间是否为0 0 == || undefined 调用震动关闭 / 0 != 调用震动开启
  1930. console.log(data.shake_sec == 0)
  1931. console.log(data.shake_sec)
  1932. if (data.shake_sec == '0' || data.shake_sec == undefined) {
  1933. // 震动关闭
  1934. handleFun('shake', '', '', '0');
  1935. } else if (data.shake_sec != '0' || data.shake_sec != undefined) {
  1936. // 震动开启
  1937. handleFun('shake', '', '', '1');
  1938. }
  1939. $.ajax({
  1940. url: url,
  1941. type: 'post',
  1942. data: data,
  1943. beforeSend: function () {
  1944. $('.loadingParent').show();
  1945. },
  1946. complete: function () {
  1947. setTimeout(function () {
  1948. $('.loadingParent').hide();
  1949. }, 3000)
  1950. },
  1951. success: function (data) {
  1952. if (data == "0") {
  1953. setTimeout(function () {
  1954. layer.msg("配置成功!");
  1955. $('#tph').html($('#dtlHighLimit').html() + '℃');
  1956. $('#tpl').html($('#dtlLowLimit').html() + '℃');
  1957. }, 3000)
  1958. }
  1959. }
  1960. })
  1961. }
  1962. // 取消配置
  1963. function cancelConfig() {
  1964. configFill(configData)
  1965. }
  1966. var popupIndex;
  1967. //operation配置弹框
  1968. function operation() {
  1969. //页面层
  1970. popupIndex = layer.open({
  1971. type: 1,
  1972. skin: 'layui-layer-rim', //加上边框
  1973. // area: ['420px', '240px'], //宽高
  1974. area: ["50%", '480px'],
  1975. content: $('#handleBtns').html()
  1976. });
  1977. }
  1978. // 查看和修改IMEI
  1979. function lookChangeImei(flag) {
  1980. var id = $('#imei').val();
  1981. if (flag == 'look') {
  1982. $.ajax({
  1983. type: "post",
  1984. url: 'cbd_old_imei',
  1985. data: {
  1986. "e_id": id,
  1987. },
  1988. dataType: "json",
  1989. beforeSend: function () {
  1990. $('#loadingParent').show();
  1991. },
  1992. complete: function () {
  1993. $('#loadingParent').hide();
  1994. },
  1995. success: function (data) {
  1996. var old_eid = data.old_eid || '暂无';
  1997. layer.open({
  1998. type: 1
  1999. , title: false //不显示标题栏
  2000. , closeBtn: false
  2001. , area: '300px;'
  2002. , shade: 0.8
  2003. , id: 'LAY_layuipro4' //设定一个id,防止重复弹出
  2004. , btn: ['我知道了']
  2005. , btnAlign: 'c'
  2006. , moveType: 1 //拖拽模式,0或者1
  2007. , content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">原始IMEI查询结果<br><br>现在IMEI:' + id + '<br>原始IMEI:' + old_eid + '</div>'
  2008. , success: function (layero) {
  2009. }
  2010. });
  2011. }
  2012. })
  2013. }
  2014. if (flag == 'change') {
  2015. //询问框
  2016. layer.confirm('确定修改IMEI吗?', {
  2017. icon: 3,
  2018. zIndex: 19991016,
  2019. btn: ['确定', '取消'] //按钮
  2020. }, function (index) {
  2021. layer.close(index);
  2022. layer.prompt({ title: '输入最新设备号', formType: 1 }, function (text, index) {
  2023. $.ajax({
  2024. type: "post",
  2025. url: 'cbd_mqtt',
  2026. data: {
  2027. "req": "setimei",//控制
  2028. "e_id": id,
  2029. "newimei": text,//升级 要修改成的设备号
  2030. },
  2031. dataType: "json",
  2032. beforeSend: function () {
  2033. $('#loadingParent').show();
  2034. },
  2035. complete: function () {
  2036. setTimeout(function () {
  2037. $('#loadingParent').hide();
  2038. }, 3000)
  2039. },
  2040. success: function (data) {
  2041. setTimeout(function () {
  2042. if (data == 0) {
  2043. layer.msg('设置成功')
  2044. }
  2045. }, 3000)
  2046. layer.close(popupIndex);
  2047. }
  2048. })
  2049. layer.close(index);
  2050. });
  2051. }, function () {
  2052. });
  2053. }
  2054. }
  2055. // var confogFlag = 1;
  2056. function popupFrame(str, cmd, type, data, ws) {
  2057. // if (cmd == 'workmode' && type.val()) {
  2058. if (cmd == 'workmode' || type || cmd) {
  2059. //询问框
  2060. layer.confirm('确定' + str + '?', {
  2061. icon: 3,
  2062. zIndex: 19991016,
  2063. btn: ['确定', '取消'] //按钮
  2064. }, function (index) {
  2065. if (cmd == 'config') {
  2066. layer.close(popupIndex)
  2067. // if(type == 1){
  2068. // confogFlag = 1;
  2069. // $('.coerceConfig .configTitle').html('配置板子地址');
  2070. // $('.coerceConfig .form-group').eq(0).show();
  2071. // $('.coerceConfig .form-group').eq(1).show();
  2072. // $('.coerceConfig .form-group').eq(2).hide();
  2073. // }else{
  2074. // confogFlag = 2;
  2075. // $('.coerceConfig .configTitle').html('配置图片上传地址');
  2076. // $('.coerceConfig .form-group').eq(0).hide();
  2077. // $('.coerceConfig .form-group').eq(1).hide();
  2078. // $('.coerceConfig .form-group').eq(2).show();
  2079. // }
  2080. $('.markimg').show();
  2081. $('.coerceConfig').show();
  2082. } else {
  2083. // if (cmd == 'workmode') {
  2084. // var newtype = type.val();
  2085. // handleFun(cmd, newtype, data);
  2086. // } else {
  2087. // handleFun(cmd, type, data);
  2088. // }
  2089. if (cmd == 'workmode') {
  2090. var newtype = type.val();
  2091. handleFun(cmd, newtype, data);
  2092. } else if (cmd == 'shake') {
  2093. handleFun(cmd, type, data, ws);
  2094. } else {
  2095. handleFun(cmd, type, data);
  2096. }
  2097. }
  2098. layer.close(index);
  2099. }, function () {
  2100. });
  2101. }
  2102. }
  2103. function handleFun(cmd, type, data, ws) {
  2104. var id = $('#imei').val();
  2105. //判断当前是否为震动功能ws是否为空
  2106. if (ws != undefined) {
  2107. $.ajax({
  2108. type: "post",
  2109. url: 'cbd_mqtt',
  2110. data: {
  2111. "req": "ctrl",//控制
  2112. "topicid": id,
  2113. "cmd": cmd,//升级 update
  2114. "type": type,
  2115. "data": data,
  2116. "ws": ws
  2117. },
  2118. dataType: "json",
  2119. beforeSend: function () {
  2120. $('#loadingParent').show();
  2121. },
  2122. complete: function () {
  2123. setTimeout(function () {
  2124. $('#loadingParent').hide();
  2125. }, 3000)
  2126. },
  2127. success: function (data) {
  2128. setTimeout(function () {
  2129. if (data == 0) {
  2130. layer.msg('下发成功')
  2131. }
  2132. }, 3000)
  2133. layer.close(popupIndex);
  2134. }
  2135. })
  2136. } else {
  2137. $.ajax({
  2138. type: "post",
  2139. url: 'cbd_mqtt',
  2140. data: {
  2141. "req": "ctrl",//控制
  2142. "topicid": id,
  2143. "cmd": cmd,//升级 update
  2144. "type": type,
  2145. "data": data
  2146. },
  2147. dataType: "json",
  2148. beforeSend: function () {
  2149. $('#loadingParent').show();
  2150. },
  2151. complete: function () {
  2152. setTimeout(function () {
  2153. $('#loadingParent').hide();
  2154. }, 3000)
  2155. },
  2156. success: function (data) {
  2157. setTimeout(function () {
  2158. if (data == 0) {
  2159. layer.msg('下发成功')
  2160. }
  2161. }, 3000)
  2162. layer.close(popupIndex);
  2163. }
  2164. })
  2165. }
  2166. }
  2167. function saveConfig() {
  2168. var id = $('#imei').val();
  2169. // if(confogFlag == 1){
  2170. // if(!($('#plankUrl').val() && $('#port').val())){
  2171. // layer.msg("请将信息填写完整!");
  2172. // return false;
  2173. // }
  2174. // }else{
  2175. // if(!$('#photoUrl').val()){
  2176. // layer.msg("请将信息填写完整!");
  2177. // return false;
  2178. // }
  2179. // }
  2180. if (!($('#plankUrl').val() && $('#port').val() && $('#pub').val() && $('#sub').val() && $('#photoUrl').val())) {
  2181. layer.msg("请将信息填写完整!");
  2182. return false;
  2183. }
  2184. // if(confogFlag == 1){
  2185. // var dat = {
  2186. // "req": "ip",//配置
  2187. // "topicid": id,
  2188. // "modifi_url": $('#plankUrl').val(),//升级 update
  2189. // "modifi_port":$('#port').val(),
  2190. // "photo_url": $('#plankUrl').val()//升级 update
  2191. // }
  2192. // }else{
  2193. // var dat = {
  2194. // "req": "ip",//配置
  2195. // "topicid": id,
  2196. // "photo_url": $('#photoUrl').val(),//升级 update
  2197. // }
  2198. // }
  2199. var dat = {
  2200. "req": "ip",//配置
  2201. "topicid": id,
  2202. "url": $('#plankUrl').val(),//升级 update
  2203. "port": $('#port').val(),
  2204. "pub": $('#pub').val(),
  2205. "sub": $('#sub').val(),
  2206. "photo_url": $('#photoUrl').val()//升级 update
  2207. }
  2208. console.log(dat)
  2209. $.ajax({
  2210. type: "post",
  2211. url: 'cbd_mqtt',
  2212. data: dat,
  2213. dataType: "json",
  2214. beforeSend: function () {
  2215. $('#loadingParent').show();
  2216. },
  2217. complete: function () {
  2218. setTimeout(function () {
  2219. $('#loadingParent').hide();
  2220. }, 3000)
  2221. },
  2222. success: function (data) {
  2223. closeConfig()
  2224. }
  2225. })
  2226. }
  2227. function closeConfig() {
  2228. $('.coerceConfig input').val('');
  2229. $('.markimg').hide();
  2230. $('.coerceConfig').hide();
  2231. }
  2232. // sim卡查询
  2233. function sendexamineSIM() {
  2234. var iccid = $('#iccid').val();
  2235. examineSIM(iccid)
  2236. }
  2237. function examineSIM(iccid) {
  2238. $.ajax({
  2239. url: 'siminfo',
  2240. type: 'post',
  2241. dataType: 'json',
  2242. data: {
  2243. simid: iccid,
  2244. },
  2245. beforeSend: function (XMLHttpRequest) {
  2246. //注意,layer.msg默认3秒自动关闭,如果数据加载耗时比较长,需要设置time
  2247. loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
  2248. },
  2249. success: function (data) {
  2250. console.log(data)
  2251. var dat = data.data;
  2252. if (data.code == 0) {
  2253. var status;
  2254. if (dat.account_status == "0") {
  2255. status = "未知";
  2256. } else if (dat.account_status == "1") {
  2257. status = "测试期";
  2258. } else if (dat.account_status == "2") {
  2259. status = "沉默期";
  2260. } else if (dat.account_status == "3") {
  2261. status = "使用中";
  2262. } else if (dat.account_status == "4") {
  2263. status = "停机";
  2264. } else if (dat.account_status == "5") {
  2265. status = "停机保号";
  2266. } else if (dat.account_status == "6") {
  2267. status = "预销号";
  2268. } else if (dat.account_status == "7") {
  2269. status = "销号";
  2270. }
  2271. var usage;
  2272. if (dat.iccid) {
  2273. usage = dat.data_usage;
  2274. } else {
  2275. usage.innerHTML = '--';
  2276. }
  2277. var balance;
  2278. if (dat.iccid) {
  2279. balance = dat.data_balance;
  2280. } else {
  2281. balance = '--';
  2282. }
  2283. var time;
  2284. if (dat.iccid) {
  2285. var timestamp4 = new Date(dat.expiry_date * 1000);//直接用 new Date(时间戳) 格式转化获得当前时间
  2286. time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
  2287. } else {
  2288. time = '--';
  2289. }
  2290. layer.close(loadingFlag);
  2291. layer.open({
  2292. type: 1
  2293. , title: false //不显示标题栏
  2294. , closeBtn: false
  2295. , area: '300px;'
  2296. , shade: 0.8
  2297. , id: 'LAY_layuipro' //设定一个id,防止重复弹出
  2298. , btn: ['我知道了']
  2299. , btnAlign: 'c'
  2300. , moveType: 1 //拖拽模式,0或者1
  2301. , content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
  2302. , success: function (layero) {
  2303. }
  2304. });
  2305. } else {
  2306. layer.msg('查询失败!');
  2307. }
  2308. }
  2309. })
  2310. }
  2311. // 设置rtu结构
  2312. function setRtuHtml(rtuInfo) {
  2313. if ((rtuInfo == null) || (rtuInfo.length < 2)) {
  2314. rtuInfo = {};
  2315. } else {
  2316. rtuInfo = eval('(' + rtuInfo + ')');
  2317. var index2 = layer.open({
  2318. type: 1
  2319. , title: false //不显示标题栏
  2320. , closeBtn: false
  2321. , area: '320px;'
  2322. , shade: 0.8
  2323. , id: 'LAY_layuipro1' //设定一个id,防止重复弹出
  2324. , btn: ['查看流量', '取消']
  2325. , yes: function (index, layero) {
  2326. //按钮【按钮一】的回调
  2327. layer.close(index2);
  2328. examineSIM(rtuInfo.iccid)
  2329. }
  2330. , btnAlign: 'c'
  2331. , moveType: 1 //拖拽模式,0或者1
  2332. , content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">RTU查询结果<br>IMEI:' + rtuInfo.imei + '<br>iccid:' + rtuInfo.iccid + '<br>信号强度:' + rtuInfo.csq + '<br>RTU版本号:' + rtuInfo.version + '</div>'
  2333. , success: function (layero) {
  2334. }
  2335. });
  2336. }
  2337. }
  2338. // function isIE() {
  2339. // return navigator.userAgent.toLowerCase().indexOf('trident') > -1 ? true : false;
  2340. // }
  2341. // if (isIE()) {
  2342. // $('#iframeDiv').remove();
  2343. // $('#showall').show();
  2344. // }
  2345. // if ($('#dverInp').val() == 4 || $('#dverInp').val() == 5) {
  2346. // $('#showall').hide();
  2347. // } else {
  2348. // $('#iframeDiv').remove();
  2349. // $('#showall').show();
  2350. // }
  2351. //模态框 关闭前事件
  2352. $('#myModal').on('hide.bs.modal', function () {
  2353. window.location.href = 'equipmanage_cbd_detail?id=' + $('#imei').val()
  2354. })
  2355. // 配置按钮
  2356. function setSimIccid(ele, id, iccid) {
  2357. if (!iccid) {
  2358. layui.use('layer', function () {
  2359. var layer = layui.layer;
  2360. layer.prompt({ title: 'SIM卡绑定', formType: 0 }, function (text, index) {
  2361. if (text.length == 20) {
  2362. // changeIccidFun(id, text, function () { })
  2363. readSim(id, text, 'save')
  2364. // layer.close(index);
  2365. } else {
  2366. layer.msg('请输入正确SIM卡号');
  2367. }
  2368. // layer.msg('演示完毕!您的口令: <br>您最后写下了:'+text);
  2369. });
  2370. })
  2371. } else {
  2372. readSim(id, iccid, '')
  2373. }
  2374. $(window).resize(function () {
  2375. // moveBar()
  2376. });
  2377. }
  2378. function readSim(id, iccid, save) {
  2379. $.ajax({
  2380. type: "post",
  2381. url: 'siminfo',
  2382. data: {
  2383. "simid": iccid,
  2384. },
  2385. dataType: "json",
  2386. beforeSend: function () {
  2387. $('#loadingParent').show();
  2388. },
  2389. complete: function () {
  2390. $('#loadingParent').hide();
  2391. },
  2392. success: function (data) {
  2393. $('#sppbId').html(id);
  2394. $('.currIccid').html(iccid);
  2395. if (data.code == 0) {
  2396. layer.closeAll();
  2397. if (data.data.account_status == 0) {
  2398. var status = '未知';
  2399. } else if (data.data.account_status == 1) {
  2400. var status = '测试期';
  2401. } else if (data.data.account_status == 2) {
  2402. var status = '沉默期';
  2403. } else if (data.data.account_status == 3) {
  2404. var status = '使用中';
  2405. } else if (data.data.account_status == 4) {
  2406. var status = '停机';
  2407. } else if (data.data.account_status == 5) {
  2408. var status = '停机保号';
  2409. } else if (data.data.account_status == 6) {
  2410. var status = '预销号';
  2411. } else if (data.data.account_status == 7) {
  2412. var status = '销号';
  2413. }
  2414. $('#account_status').html(status);
  2415. $('#data_plan').find('.progressVal').html((data.data.data_plan).toFixed(2) + 'MB');
  2416. $('#data_plan').find('.layui-progress-bar').attr('lay-percent', '10%');
  2417. $('#data_usage').find('.progressVal').html((data.data.data_usage).toFixed(2) + 'MB');
  2418. var data_usage = data.data.data_usage / data.data.data_plan * 100;
  2419. $('#data_usage').find('.layui-progress-bar').css('width', data_usage + '%');
  2420. $('#data_balance').find('.progressVal').html((data.data.data_balance).toFixed(2) + 'MB');
  2421. var data_usage = data.data.data_balance / data.data.data_plan * 100;
  2422. $('#data_balance').find('.layui-progress-bar').css('width', data_usage + '%');
  2423. var date = new Date(data.data.expiry_date * 1000);
  2424. $('.expiry_date').html(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds());
  2425. $('#myModal').modal('show')
  2426. } else {
  2427. $('#account_status').html('暂无');
  2428. $('#data_plan').find('.progressVal').html('--');
  2429. $('#data_plan').find('.layui-progress-bar').css('width', 0);
  2430. $('#data_usage').find('.progressVal').html('--');
  2431. $('#data_usage').find('.layui-progress-bar').css('width', 0 + '%');
  2432. $('#data_balance').find('.progressVal').html('--');
  2433. $('#data_balance').find('.layui-progress-bar').css('width', 0 + '%');
  2434. $('.expiry_date').html('--');
  2435. $('#myModal').modal('show')
  2436. }
  2437. if (save) {
  2438. saveIccid(id, iccid, data)
  2439. }
  2440. }
  2441. })
  2442. }
  2443. function saveIccid(id, iccid, data1) {
  2444. $.ajax({
  2445. type: "post",
  2446. url: 'equip_simiccid',
  2447. data: {
  2448. "e_id": id,
  2449. "iccid": iccid,
  2450. },
  2451. dataType: "json",
  2452. beforeSend: function () {
  2453. $('#loadingParent').show();
  2454. },
  2455. complete: function () {
  2456. $('#loadingParent').hide();
  2457. },
  2458. success: function (data) {
  2459. if (data == 0) {
  2460. $('#sppbId').html(id);
  2461. $('.currIccid').html(iccid);
  2462. if (data1.code != 5004) {
  2463. if (data1.data.account_status == 0) {
  2464. var status = '未知';
  2465. } else if (data1.data.account_status == 1) {
  2466. var status = '测试期';
  2467. } else if (data1.data.account_status == 2) {
  2468. var status = '沉默期';
  2469. } else if (data1.data.account_status == 3) {
  2470. var status = '使用中';
  2471. } else if (data1.data.account_status == 4) {
  2472. var status = '停机';
  2473. } else if (data1.data.account_status == 5) {
  2474. var status = '停机保号';
  2475. } else if (data1.data.account_status == 6) {
  2476. var status = '预销号';
  2477. } else if (data1.data.account_status == 7) {
  2478. var status = '销号';
  2479. }
  2480. $('#account_status').html(status);
  2481. $('#data_plan').find('.progressVal').html((data1.data.data_plan).toFixed(2) + 'MB');
  2482. $('#data_plan').find('.layui-progress-bar').attr('lay-percent', '10%');
  2483. $('#data_usage').find('.progressVal').html((data1.data.data_usage).toFixed(2) + 'MB');
  2484. var data_usage = data1.data.data_usage / data1.data.data_plan * 100;
  2485. $('#data_usage').find('.layui-progress-bar').css('width', data_usage + '%');
  2486. $('#data_balance').find('.progressVal').html((data1.data.data_balance).toFixed(2) + 'MB');
  2487. var data_usage = data1.data.data_balance / data1.data.data_plan * 100;
  2488. $('#data_balance').find('.layui-progress-bar').css('width', data_usage + '%');
  2489. var date = new Date(data1.data.expiry_date * 1000);
  2490. $('.expiry_date').html(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds());
  2491. } else {
  2492. $('#account_status').html('暂无');
  2493. $('#data_plan').find('.progressVal').html('--');
  2494. $('#data_plan').find('.layui-progress-bar').css('width', 0);
  2495. $('#data_usage').find('.progressVal').html('--');
  2496. $('#data_usage').find('.layui-progress-bar').css('width', 0 + '%');
  2497. $('#data_balance').find('.progressVal').html('--');
  2498. $('#data_balance').find('.layui-progress-bar').css('width', 0 + '%');
  2499. $('.expiry_date').html('--');
  2500. $('#myModal').modal('show')
  2501. }
  2502. $('#myModal').modal('show')
  2503. }
  2504. }
  2505. })
  2506. }
  2507. function saveChangeIccid() {
  2508. if ($('#changeIccid').val()) {
  2509. readSim($('#sppbId').html(), $('#changeIccid').val(), 'save');
  2510. $('#changeIccid').val('')
  2511. } else {
  2512. layer.msg('请先填写ICCID', { icon: 2 });
  2513. }
  2514. }
  2515. //测试测试
  2516. var popupIndexA;
  2517. function ceshiceshi() {
  2518. var id = $('#imei').val()
  2519. $.ajax({
  2520. type: "post",
  2521. url: 'cbd_csq',
  2522. data: {
  2523. "id": id,
  2524. },
  2525. dataType: "json",
  2526. beforeSend: function () {
  2527. $('#loadingParent').show();
  2528. },
  2529. complete: function () {
  2530. // $('#loadingParent').hide();
  2531. },
  2532. success: function (data) {
  2533. if (data.length == 0) {
  2534. nullData()
  2535. } else {
  2536. readyData(data) //处理数据
  2537. }
  2538. }
  2539. })
  2540. }
  2541. //暂无数据
  2542. function nullData() {
  2543. $('#signal').html('<h1 class="nullData">暂无信号强度变化趋势数据</h1>')
  2544. ceshixial()
  2545. }
  2546. //处理数据
  2547. function readyData(data) {
  2548. var lineData = [] //信号强度
  2549. var lineTime = [] //时间
  2550. var lineTimeA = [] //时间
  2551. var arrayAll = [];
  2552. console.log(data)
  2553. for (var i = 0; i < data.length; i++) {
  2554. lineData.push(data[i].csq)
  2555. lineTime.push(data[i].upl_time)
  2556. var thisTime = lineTime[i].replace(/-/g, '/');
  2557. var time = new Date(thisTime);
  2558. // var timestamp = time.getTime() * 1000 + 8 * 3600000;
  2559. var timestamp = time.getTime();
  2560. lineTimeA.push(timestamp)
  2561. arrayAll.push([lineTimeA[i], lineData[i]])
  2562. }
  2563. maskLayer(arrayAll)
  2564. }
  2565. //遮罩层和数据填充
  2566. function maskLayer(arrayAll) {
  2567. console.log(arrayAll);
  2568. var tickInterval = 3 * 30 * 24 * 3600 * 1000
  2569. var chart = null;
  2570. chart = Highcharts.chart('signal', {
  2571. chart: {
  2572. type: 'spline',
  2573. zoomType: 'x',
  2574. selectionMarkerFill: 'rgba(0,0,0, 0.2)',
  2575. resetZoomButton: {
  2576. // 按钮定位
  2577. position: {
  2578. align: 'right', // by default
  2579. verticalAlign: 'top', // by default
  2580. x: -20,
  2581. y: -50
  2582. },
  2583. }
  2584. },
  2585. title: {
  2586. text: '信号强度变化趋势'
  2587. },
  2588. subtitle: {
  2589. },
  2590. xAxis: {
  2591. crosshair: true, //十字基准线
  2592. type: 'datetime',
  2593. dateTimeLabelFormats: { //根据时间间距X轴自动显示哪种格式
  2594. millisecond: '%H:%M:%S.%L',
  2595. second: '%H:%M:%S',
  2596. minute: '%H:%M',
  2597. hour: '%H:%M',
  2598. day: '%m-%d',
  2599. week: '%m-%d',
  2600. month: '%Y-%m',
  2601. year: '%Y'
  2602. },
  2603. // tickInterval: 7 * 24 * 3600 * 1000
  2604. tickInterval: tickInterval
  2605. },
  2606. yAxis: {
  2607. title: {
  2608. text: '信号强度趋势'
  2609. },
  2610. },
  2611. credits: { //去掉默认的highcharts.com
  2612. enabled: false
  2613. },
  2614. tooltip: {
  2615. shared: true, //折线共享
  2616. headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>',
  2617. },
  2618. // legend: {
  2619. // layout: 'vertical',
  2620. // align: 'right',
  2621. // verticalAlign: 'middle'
  2622. // },
  2623. plotOptions: {
  2624. spline: {
  2625. marker: {
  2626. enabled: true,
  2627. radius: 3, //曲线点半径,默认是4
  2628. symbol: 'diamond' //曲线点类型:”circle”, “square”, “diamond”, “triangle”,”triangle-down”,默认是”circle”
  2629. }
  2630. }
  2631. },
  2632. series: [{
  2633. name: '信号强度',
  2634. data: arrayAll,
  2635. tooltip: {
  2636. valueSuffix: ''
  2637. }
  2638. }],
  2639. });
  2640. ceshixial()
  2641. }
  2642. Highcharts.setOptions({
  2643. // 所有语言文字相关配置都设置在 lang 里
  2644. lang: {
  2645. resetZoom: '刷新',
  2646. resetZoomTitle: '重置缩放比例'
  2647. }
  2648. });
  2649. function ceshixial() {
  2650. // 页面层
  2651. $('#loadingParent').hide();
  2652. popupIndexA = layer.open({
  2653. type: 1,
  2654. skin: 'layui-layer-rim', //加上边框
  2655. area: ["50%", '540px'],
  2656. content: $('#signal')
  2657. });
  2658. }
  2659. //设备开关
  2660. function sendOrder(ele, str, all) {
  2661. var id = $('#imei').val();
  2662. var obj = $(ele).prev();
  2663. console.log(obj)
  2664. var currStatus = obj.get(0).checked;
  2665. var hintTxt = '';
  2666. var currVal;
  2667. if (currStatus) {
  2668. hintTxt = '关闭';
  2669. cmd = 'screen1'
  2670. if (str == '设备') {
  2671. currVal = 'poweroff';
  2672. } else {
  2673. currVal = 'coldoff';
  2674. }
  2675. } else {
  2676. hintTxt = '开启';
  2677. cmd = 'screen0'
  2678. if (str == '设备') {
  2679. currVal = 'poweron';
  2680. } else {
  2681. currVal = 'coldon';
  2682. }
  2683. }
  2684. //询问框
  2685. layer.confirm('是否' + hintTxt + str + '?', {
  2686. icon: 3,
  2687. btn: ['确定', '取消'] //按钮
  2688. }, function (index) {
  2689. if (all) {
  2690. paramconf(obj);
  2691. } else {
  2692. $.ajax({
  2693. type: "post",
  2694. url: 'cbd_mqtt',
  2695. data: {
  2696. "req": "ctrl",//控制
  2697. "topicid": id,
  2698. "cmd": cmd,//升级 update
  2699. "type": '1',
  2700. "data": '',
  2701. "ws": ''
  2702. },
  2703. dataType: "json",
  2704. beforeSend: function () {
  2705. $('#loadingParent').show();
  2706. },
  2707. complete: function () {
  2708. setTimeout(function () {
  2709. $('#loadingParent').hide();
  2710. }, 3000)
  2711. },
  2712. success: function (data) {
  2713. setTimeout(function () {
  2714. if (data == 0) {
  2715. layer.msg('下发成功')
  2716. if (obj.get(0).checked) {
  2717. obj.prop('checked', false);
  2718. } else {
  2719. obj.prop('checked', true);
  2720. }
  2721. }
  2722. }, 3000)
  2723. layer.close(popupIndex);
  2724. }
  2725. })
  2726. }
  2727. layer.close(index);
  2728. }, function () {
  2729. });
  2730. }
  2731. </script>
  2732. </body>
  2733. </html>