| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983 |
- {% load staticfiles %}
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <link href="{% static '/lib/bootstrap-3.3.7/css/bootstrap.css' %}" rel="stylesheet">
- <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
- <link rel="stylesheet" href="{% static '/lib/css/ace.min.css' %}" />
- <link rel="stylesheet" href="{% static '/lib/css/ace-skins.min.css' %}">
- <link rel="stylesheet" href="{% static '/lib/css/ace-rtl.min.css' %}">
- <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
- <link rel="stylesheet" href="{% static '/lib/css/jquery-ui.css' %}" />
- <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.4" />
- <style type="text/css">
- body {
- overflow: hidden;
- background: #fff;
- }
- /* 返回 */
- .headerPlace {
- font-size: 22px;
- color: #418fbb;
- cursor: pointer;
- }
- .headerPlace img {
- vertical-align: middle;
- margin-right: 10px;
- margin-top: -4px;
- }
- /* */
- .userinfo .fa {
- font-size: 18px;
- color: #26b3ff;
- margin: 0px 5px;
- }
- .ui-slider .ui-slider-handle {
- width: 1.4em;
- height: 1.4em;
- border-radius: 50%;
- }
- .ui-slider {
- background: #fff;
- }
- .userinfoTitle {
- margin-right: 30px;
- font-size: 16px;
- }
- .refresh {
- text-align: right;
- }
- .refresh button {
- padding: 2px 5px;
- border-radius: 5px;
- }
- /* .userinfo{
- margin-bottom: 15px !important;
- } */
- /* */
- .row {
- margin: 0;
- }
- .equiptypeicon {
- float: left;
- width: 60px;
- margin-left: 20%;
- }
- .equipInfo {
- margin: 20px 0;
- }
- .equipInfo .row {
- margin: 0 13px;
- box-shadow: 0 0 40px #eee;
- padding: 30px;
- }
- .equipInfo .row>div {
- height: 52px;
- text-align: center;
- border-left: 1px solid #eee;
- }
- .equipInfo .row .txt {
- position: absolute;
- left: 105px;
- }
- .equipInfo .row>div:first-child {
- border-left: none;
- }
- .typeResult {
- font-size: 18px;
- line-height: 30px;
- }
- .typeTitle {
- color: #666;
- }
- @media (max-width: 1200px) {
- .col-xs-4.secondLine {
- border-left: none !important;
- }
- .col-xs-4 {
- margin-bottom: 10px;
- }
- }
- /* */
- .backStyle {
- background: #fff;
- box-shadow: 0 0 40px #eee;
- padding: 20px;
- }
- .backStyle h1 {
- font-size: 18px;
- margin-bottom: 15px;
- }
- .circle_bar {
- text-align: center;
- padding: 54px 18px;
- }
- /* */
- .areaicon {
- width: 40px;
- float: left;
- height: 50px;
- margin-right: 15px;
- }
- .area p {
- font-size: 16px;
- line-height: 30px;
- }
- /* 配置项 */
- .form-group>label {
- margin: 4px 0 0 0;
- text-align: right;
- }
- .form-group>.col-sm-9 {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .timePattern>.col-sm-9 {
- display: block;
- }
- .initVal {
- /* position: absolute;
- left: 8px;
- top: 5px; */
- /* margin-right: 20px; */
- width: 35px;
- }
- .sliderVal {
- width: 43px;
- text-align: right;
- /* margin-left: 20px; */
- /* position: absolute;
- right: 25px;
- top: 5px; */
- }
- .collocateBtn {
- text-align: center;
- }
- .collocateBtn button {
- margin: 10px 10px 20px 10px;
- }
- .form-group select {
- width: 200px;
- }
- .widget-body {
- margin-top: 20px;
- }
- .timePattern {
- display: none;
- }
- .hintTitle {
- text-align: center;
- display: inline-block;
- width: 100px;
- margin-right: 15px;
- color: #777;
- }
- .form-group select[name='begin'],
- .form-group select[name='end'] {
- padding: 0 37px 0 37px;
- width: initial;
- width: 103px;
- }
- .haloParent {
- position: absolute;
- width: 100px;
- height: 100px;
- float: left;
- margin-top: -23px;
- }
- .halo {
- position: absolute;
- width: 100px;
- height: 100px;
- border-radius: 50%;
- }
- .solidCircle {
- position: absolute;
- width: 50px;
- height: 50px;
- border-radius: 50%;
- left: 50%;
- top: 50%;
- margin-left: -25px;
- margin-top: -25%;
- }
- .solidCircle4 {
- background: #4ca1ff;
- }
- .solidCircle6 {
- background: #a597f8;
- }
- .solidCircle8 {
- background: #fc9558;
- }
- .halo4 {
- animation: haloFour 2s 3s infinite;
- }
- .halo6 {
- animation: haloSix 2s 3s infinite;
- }
- .halo8 {
- animation: haloEight 2s 3s infinite;
- }
- @keyframes haloFour {
- 0% {
- background: #4ca1ff;
- transform: scale(.3);
- opacity: 0
- }
- 20% {
- background: #1258a5;
- transform: scale(.5);
- opacity: .5
- }
- 100% {
- background: #1258a5;
- transform: scale(.8);
- opacity: 0
- }
- }
- @keyframes haloSix {
- 0% {
- background: #a597f8;
- transform: scale(.3);
- opacity: 0
- }
- 20% {
- background: #3d2aaf;
- transform: scale(.5);
- opacity: .5
- }
- 100% {
- background: #3d2aaf;
- transform: scale(.8);
- opacity: 0
- }
- }
- @keyframes haloEight {
- 0% {
- background: #f8bb97;
- transform: scale(.3);
- opacity: 0
- }
- 20% {
- background: #fa8845;
- transform: scale(.5);
- opacity: .5
- }
- 100% {
- background: #f27125;
- transform: scale(.8);
- opacity: 0
- }
- }
- .haloIcon {
- margin-top: 14px;
- }
- .widget-body {
- min-height: 440px;
- }
- /* 左边设备 */
- .equiptInfo {
- height: 655px;
- position: relative;
- background: url(../static/img/equipImg.png) no-repeat;
- background-size: 230px;
- background-position-x: 45%;
- background-position-y: 22px;
- }
- /*闪烁点*/
- #animatCover {
- position: absolute;
- left: 45%;
- top: 0;
- bottom: 0;
- width: 233px;
- margin-left: -107px;
- z-index: 99;
- }
- .flashDot {
- width: 50px;
- height: 50px;
- background-image: url(../static/img/flash.png);
- background-size: cover;
- background-position-y: 0 -143px;
- cursor: pointer;
- position: absolute;
- }
- .flashDot .line {
- position: absolute;
- left: 39px;
- bottom: 40px;
- z-index: 900;
- width: 0;
- height: 35px;
- transition: all .3s;
- background-image: url(../static/img/line.png);
- }
- .flashDot .lineleft {
- background-image: url(../static/img/line2.png);
- }
- .flashDot .bottomline {
- bottom: -20px;
- transform: scale(1) rotateX(180deg);
- }
- .flashDot .panelBox {
- position: absolute;
- left: 141px;
- bottom: 46px;
- width: 190px;
- height: 48px;
- background-color: transparent;
- -webkit-background-size: 100% 100%;
- background-size: 100% 100%;
- transform: scale(0);
- animation-fill-mode: forwards;
- }
- .bgimg {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background-image: url(../static/img/panel.png);
- background-size: 100% 100%;
- }
- .flashDot .bottompanel {
- bottom: -43px;
- }
- .flashDot .showPanel {
- animation: showPanel 1s .5s 1;
- animation-fill-mode: forwards;
- }
- .flashDot .text {
- position: absolute;
- left: 20px;
- top: 10px;
- width: 80%;
- height: 30px;
- line-height: 30px;
- color: #fff;
- font-size: 16px;
- }
- @keyframes showPanel {
- 0% {
- opacity: 1;
- transform: scale(0);
- }
- 80% {
- transform: scale(1.1);
- }
- 100% {
- opacity: 1;
- transform: scale(1);
- }
- }
- /* 闪烁点定位 */
- .flashDot1 {
- left: 150px;
- top: 60px;
- }
- .flashDot2 {
- left: 93px;
- top: 66px;
- }
- .flashDot3 {
- left: 100px;
- top: 226px;
- }
- .flashDot4 {
- left: 100px;
- top: 332px;
- }
- .flashDot5 {
- bottom: 225px;
- left: 112px;
- }
- .flashDot6 {
- bottom: 133px;
- left: 63px;
- }
- .flashDot7 {
- bottom: 141px;
- left: 126px;
- }
- .flashDot8 {
- bottom: 85px;
- left: 64px;
- }
- .flashDot9 {
- bottom: 90px;
- left: 122px;
- }
- /*温控开关 */
- .tempTitel,
- .switchbox {
- display: inline-block;
- vertical-align: middle;
- }
- .switchBj {
- width: 60px;
- height: 30px;
- background: #c8c8c8;
- border-radius: 20px;
- position: relative;
- }
- .switchBj:after {
- position: absolute;
- content: '关';
- left: 9px;
- line-height: 30px;
- color: #fff;
- }
- .switchBj:before {
- position: absolute;
- content: '开';
- left: 34px;
- line-height: 30px;
- color: #fff;
- }
- .switchBj span {
- display: inline-block;
- width: 26px;
- height: 26px;
- background: #fff;
- border-radius: 50%;
- box-shadow: 1px 1px 4px #515151;
- position: absolute;
- left: 30px;
- top: 2px;
- }
- .switchInp {
- display: none;
- }
- .switchInp:checked+.switchBj {
- background: #468FCC;
- border-color: #468FCC;
- }
- .switchInp:checked+.switchBj span {
- left: 2px;
- }
- /* 温度提示 */
- .weatherType {
- margin: 31px 0;
- }
- .font18 {
- font-size: 18px;
- }
- .tempTypeImg {
- width: 30%;
- float: left;
- height: 60px;
- line-height: 60px;
- }
- .tempTypeImg img {
- width: 100%;
- }
- .tempTypeValue {
- float: left;
- width: 70%;
- text-align: center;
- line-height: 28px;
- }
- /* 配置form */
- .coerceConfig {
- display: none;
- background: white;
- position: fixed;
- left: 25%;
- right: 25%;
- top: 20%;
- padding-bottom: 30px;
- z-index: 999999;
- }
- .configTitle {
- font-size: 22px;
- padding: 15px;
- text-indent: 8%;
- color: #10659d;
- }
- .markimg {
- display: none;
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- background: rgba(0, 0, 0, .5);
- z-index: 98;
- }
- #showall,
- #swfDiv {
- display: none;
- }
- /* 配置项 */
- .form-group>label {
- margin: 4px 0 0 0;
- text-align: right;
- }
- .collocateBtn {
- text-align: center;
- }
- .collocateBtn button {
- margin: 0;
- }
- .form-group select {
- width: 200px;
- }
- .widget-body {
- margin-top: 20px;
- }
- .timePattern {
- display: none;
- }
- .hintTitle {
- text-align: center;
- display: inline-block;
- width: 100px;
- margin-right: 15px;
- color: #777;
- }
- .form-group select[name='begin'],
- .form-group select[name='end'] {
- padding: 0 37px 0 37px;
- width: initial;
- }
- #desc {
- width: 100px;
- }
- .col-sm-9>div {
- /* margin: 4px 0; */
- width: 80%;
- }
- .progressParent {
- display: inline-block;
- width: 80%;
- }
- .progressVal {
- display: inline-block;
- text-align: right;
- width: 17%;
- }
- #changeIccid {
- width: 70%;
- }
- #rtuInfoBtn {
- display: none;
- }
- .nullData {
- color: #666;
- text-align: center;
- height: 480px;
- line-height: 480px;
- margin: 0 0 0 12px;
- }
- /* 设备开关 */
- .facilitySwitch {
- margin: 0 0 0 60px;
- }
- .facilitySwitch_tlt {
- font-size: 15px;
- }
- .dataNone {
- display: none;
- }
- .inmBox {
- padding: 20px 25px 45px 20px;
- }
- </style>
- </head>
- <body>
- <div class="content">
- <div class="page-header">
- <span class="headerPlace" onclick="goback('equipmanage_cbd')">
- <img src="{% static '/img/gobackIcon.png' %}" alt="">返回
- </span>
- </div>
- <div class="userinfocover">
- <div class="row ">
- <div class="col-xs-12 userinfo">
- <i class="fa fa-user-o" aria-hidden="true"></i>
- 设备ID:
- <span class="userinfoTitle">{{equip_id}}</span>
- 设备名称:
- <span class="userinfoTitle" id="equip_name"></span>
- 上报时间:
- <span class="userinfoTitle" id="upl_time"></span>
- 位置:
- <span class="userinfoTitle" id="curr_area"></span>
- </div>
- <div class="col-xs-12 refresh">
- {% if is_hk %}
- <button class="btn btn-sm btn-primary configurationBtn"
- onclick="setSimIccid($(this),'{{equip_id}}','{{iccid|default_if_none:""}}')" {% if iccid %}
- {% else %}style="display:none" {% endif %}>SIM卡更换</button>
- <button class="btn btn-sm btn-danger configurationBtn"
- onclick="setSimIccid($(this),'{{equip_id}}','{{iccid|default_if_none:""}}')" {% if iccid %}
- style="display:none" {% else %}{% endif %}>SIM卡绑定</button>
- {% else %} {% endif %}
- <button type="button" class="btn btn-sm btn-primary" id="rtuInfoBtn">
- <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
- RTU信息
- </button>
- <button type="button" class="btn btn-sm btn-primary" id="takephotoShowBtn"
- onclick="popupFrame('拍照','ctrl','takephoto','')">
- <i class="fa fa-camera" aria-hidden="true"></i>
- 拍照
- </button>
- <button type="button" class="btn btn-sm btn-primary" id="semaphore" onclick="ceshiceshi()">
- 查看信号质量曲线
- </button>
- <button class="btn btn-sm btn-info" onclick='sendexamineSIM()'>
- <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
- SIM卡查询
- </button>
- <button type="button" class="btn btn-sm btn-success" onclick="reloadPage()">刷新</button>
- <button type="button" class="btn btn-sm btn-primary" id="operationBtn"
- onclick="operation()">操作</button>
- </div>
- </div>
- <div id="handleBtns" style="display:none">
- <div style="padding: 20px; background-color: #F2F2F2;" id="">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md6">
- <div class="layui-card">
- <div class="layui-card-header">上仓门操作</div>
- <div class="layui-card-body">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-success"
- onclick="handleFun('ctrl','up','open')">打开上仓门</button>
- </div>
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-success"
- onclick="handleFun('ctrl','up','close')">关闭上仓门</button>
- </div>
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-success"
- onclick="handleFun('ctrl','up','force_open')">强制打开上仓门</button>
- </div>
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-success"
- onclick="handleFun('ctrl','up','force_close')">强制关闭上仓门</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-col-md6">
- <div class="layui-card">
- <div class="layui-card-header">下仓门操作</div>
- <div class="layui-card-body">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-yellow"
- onclick="handleFun('ctrl','down','open')">打开下仓门</button>
- <br />
- </div>
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-yellow"
- onclick="handleFun('ctrl','down','close')">关闭下仓门</button>
- <br />
- </div>
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-yellow"
- onclick="handleFun('ctrl','down','force_open')">强制打开下仓门</button>
- </div>
- <div class="layui-col-md6">
- <button type="button" class="btn btn-sm btn-yellow"
- onclick="handleFun('ctrl','down','force_close')">强制关闭下仓门</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">强制操作</div>
- <div class="layui-card-body">
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('拍照','ctrl','takephoto','')">拍照</button>
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('清虫','ctrl','turn','')">清虫</button>
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('升级','update','','')">升级</button>
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('重启','reboot','','')">重启</button>
- <!-- 测试 -->
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('震动开启','shake','','','1')">震动开启</button>
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('震动关闭','shake','','', '0')">震动关闭</button>
- <!-- 测试 -->
- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('配置','config','1','')">板子配置</button>
- <!-- <button type="button" class="btn btn-sm btn-danger"
- onclick="popupFrame('禁用屏幕','screen','1','')">屏幕禁用</button> -->
- <!-- <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('配置','config','2','')">图片上传路径</button> -->
- </div>
- </div>
- </div>
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">板子设置</div>
- <div class="layui-card-body">
- <button type="button" class="btn btn-sm btn-primary"
- onclick="lookChangeImei('look')">查看原始imei</button>
- <button type="button" class="btn btn-sm btn-danger"
- onclick="lookChangeImei('change')">更改imei</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <input type="hidden" value="{{dver}}" id="dverInp">
- <!-- 设备模型 -->
- <div class="col-xs-12 col-md-6">
- <div style="height:680px;overflow:hidden;margin: 20px 0;" id="swfDiv">
- <embed style="width:100%;height:100%" wmode="Opaque" src="{% static 'flash/cbdFlash.swf'%}" />
- </div>
- <div class="backStyle equipInfo equiptInfo" id="showall">
- <div id="animatCover">
- <div class="flashDot flashDot1">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg">
- <div class="text" id="csq"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot2" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="text" id="rps"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot3">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg">
- <div class="text">
- 诱虫灯管
- </div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot4" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="text" id="lps"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot5">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg">
- <div class="text" id="gs"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot6" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="text" id="hs"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot7">
- <div class="line"></div>
- <div class="panelBox">
- <div class="bgimg">
- <div class="text" id="upds"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot8" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="line bottomline"></div>
- <div class="panelBox bottompanel">
- <div class="bgimg" style=" transform:rotateY(180deg) rotateX(0deg);">
- <div class="text" id="hrt"></div>
- </div>
- </div>
- </div>
- <div class="flashDot flashDot9">
- <div class="line bottomline"></div>
- <div class="panelBox bottompanel">
- <div class="bgimg">
- <div class="text" id="dnds"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 右边 -->
- <div class="col-xs-12 col-md-6" style="padding-left: 0px;padding-right:0px">
- <!-- 信息条 -->
- <div class="equipInfo">
- <div class="row" style="margin-left: 0;">
- <div class="col-xs-4">
- <div class="haloParent">
- <div class="halo halo6"></div>
- <div class="solidCircle solidCircle6">
- <img class="haloIcon" src="{% static '/img/haloIcon4.png' %}" alt="">
- </div>
- </div>
- <div class="txt">
- <span class="typeResult" id="dver"></span>
- <p class="typeResult">设备版本</p>
- </div>
- </div>
- <div class="col-xs-4">
- <div class="haloParent">
- <div class="halo halo4"></div>
- <div class="solidCircle solidCircle4">
- <img class="haloIcon" src="{% static '/img/haloIcon8.png' %}" alt="">
- </div>
- </div>
- <div class="txt">
- <span class="typeResult" id="weather">经度:113.46655</span>
- <p class="" id="wind">纬度:48.121211</p>
- </div>
- </div>
- <div class="col-xs-4">
- <div class="haloParent">
- <div class="halo halo8"></div>
- <div class="solidCircle solidCircle8">
- <img class="haloIcon" src="{% static '/img/haloIcon9.png' %}" alt="">
- </div>
- </div>
- <div class="txt">
- <span class="typeResult" id="csqValue"></span>
- <p class="typeResult" id="lat">信号强度</p>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <!-- 温控状态 -->
- <div class="col-xs-4" style="padding-left: 0;">
- <!-- <div class="backStyle" style="margin-bottom:20px">
- <span class="typeResult tempTitel">设备开关:</span>
- <div class="switchbox">
- <input class="switchInp" id="onOff" type="checkbox">
- <div class="switchBj" onclick="sendOrder(this,'设备')">
- <span></span>
- </div>
- </div>
- </div> -->
- <div class="backStyle" style="margin-bottom:20px">
- <span class="typeResult tempTitel">温控状态:</span>
- <span class="typeResult tempTitel" id="tps"></span>
- <!-- <div class="switchbox">
- <input class="switchInp" id="tps" type="checkbox">
- <div class="switchBj">
- <span></span>
- </div>
- </div> -->
- </div>
- <div class="backStyle inmBox">
- <div class="temperatureKind">
- <div class="clearfix weatherType">
- <div class="tempTypeImg">
- <img src="{% static '/img/statusIcon1.png' %}" alt="">
- </div>
- <div class="tempTypeValue">
- <p class="font18" id="tpl">1℃</p>
- <p>低温限值</p>
- </div>
- </div>
- <div class="clearfix weatherType">
- <div class="tempTypeImg">
- <img src="{% static '/img/statusIcon2.png' %}" alt="">
- </div>
- <div class="tempTypeValue">
- <p class="font18" id="tph">70℃</p>
- <p>高温限值</p>
- </div>
- </div>
- <div class="clearfix weatherType">
- <div class="tempTypeImg">
- <img src="{% static '/img/statusIcon3.png' %}" alt="">
- </div>
- <div class="tempTypeValue">
- <p class="font18" id="at"></p>
- <p>环境温度</p>
- </div>
- </div>
- <div class="clearfix weatherType">
- <div class="tempTypeImg">
- <img src="{% static '/img/statusIcon4.png' %}" alt="">
- </div>
- <div class="tempTypeValue">
- <p class="font18" id="ah"></p>
- <p>环境湿度</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 配置 -->
- <div class="col-xs-8" style="padding-left: 0;">
- <div class="backStyle">
- <div style="text-align:right;position: absolute;right: 30px;">
- <button type="button" class="btn btn-sm btn-success"
- onclick="dtlconfigurationSwitch()">获取最新配置</button>
- </div>
- <div id="configParent" class="loadingParent">
- <div id="" class="loadCenter">
- <div class="skype-loader">
- <div class="dot">
- <div class="first"></div>
- </div>
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- </div>
- 配置更新中...
- </div>
- </div>
- <!-- <div class="backStyle" style="margin-bottom:20px"> -->
- <div class="facilitySwitch" style="margin-bottom:20px">
- <span class="typeResult tempTitel facilitySwitch_tlt">设备开关:</span>
- <div class="switchbox">
- <input class="switchInp" name="Pho" id="onOff" type="checkbox" checked>
- <div class="switchBj" onclick="sendOrder(this,'设备')">
- <span></span>
- </div>
- </div>
- </div>
- <div class="widget-body">
- <div class="row">
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 工作模式 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <select name="workPattern" id="workPattern"
- onchange="popupFrame('切换工作模式','workmode',$(this),'')">
- <option value="">请选择</option>
- <option value="0">节能</option>
- <option value="1">常规</option>
- <option value="2">加强</option>
- </select>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 定时模式 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <select name="timing" id="dtlTiming">
- <option value="0">光控</option>
- <option value="1">时控</option>
- </select>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 1结束 -->
- <div class="form-group lightPattern">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 定时时长 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">1</span>
- <div class="slider" id="dtlTimingLength-slider"></div>
- <span class="sliderVal" id="dtlTimingLength">1</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 2结束 -->
- <div class="form-group timePattern">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 开始结束时间 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div>
- <span class="hintTitle">开始时间</span>
- <span class="hintTitle">结束时间</span>
- </div>
- <select name="begin" id="begin">
- <option value="0">0</option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- <option value="11">11</option>
- <option value="12">12</option>
- <option value="13">13</option>
- <option value="14">14</option>
- <option value="15">15</option>
- <option value="16">16</option>
- <option value="17">17</option>
- <option value="18">18</option>
- <option value="19">19</option>
- <option value="20">20</option>
- <option value="21">21</option>
- <option value="22">22</option>
- <option value="23">23</option>
- </select>
- 至
- <select name="end" id="end">
- <option value="0">0</option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- <option value="11">11</option>
- <option value="12">12</option>
- <option value="13">13</option>
- <option value="14">14</option>
- <option value="15">15</option>
- <option value="16">16</option>
- <option value="17">17</option>
- <option value="18">18</option>
- <option value="19">19</option>
- <option value="20">20</option>
- <option value="21">21</option>
- <option value="22">22</option>
- <option value="23">23</option>
- </select>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 3结束 -->
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 落虫时间 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">1</span>
- <div class="slider" id="dtlDropTime-slider"></div>
- <span class="sliderVal" id="dtlDropTime">20</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 4结束 -->
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 加热时间 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">1</span>
- <div class="slider" id="dtlCalefactionTime-slider"></div>
- <span class="sliderVal" id="dtlCalefactionTime">20</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 5结束 -->
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 加热温度 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">75</span>
- <div class="slider" id="dtlCalefactionTemperature-slider"></div>
- <span class="sliderVal" id="dtlCalefactionTemperature">125</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 6结束 -->
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 高温保护阈值 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">50</span>
- <div class="slider" id="dtlHighLimit-slider"></div>
- <span class="sliderVal" id="dtlHighLimit">70</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 7结束 -->
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 低温保护阈值 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">1</span>
- <div class="slider" id="dtlLowLimit-slider"></div>
- <span class="sliderVal" id="dtlLowLimit">10</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 8结束 -->
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 数据上传间隔 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">10</span>
- <div class="slider" id="dtlDataUpTime-slider"></div>
- <span class="sliderVal" id="dtlDataUpTime">60</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 9结束 -->
- <div class="form-group" id="shakeID">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 震动时间(秒) </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">0</span>
- <div class="slider" id="shakeTime-slider"></div>
- <span class="sliderVal" id="shakeTime">1</span>
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 10结束 -->
- <!-- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 图片分辨率 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <select name="imgHvga" id="imgHvga">
- <option value="0">高</option>
- <option value="1">中</option>
- <option value="2">低</option>
- </select>
- </div>
- <div style="clear:both"></div>
- </div> -->
- <!-- 结束 -->
- </div>
- <div class="collocateBtn">
- <button class="btn btn-sm btn-info" onclick="saveOperation()">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;">确定</font>
- </font>
- </button>
- <button class="btn btn-sm" onclick="cancelConfig()">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;">取消</font>
- </font>
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 强制配置弹框 -->
- <div class="coerceConfig">
- <h1 class="configTitle">MQTT配置</h1>
- <form class="form-horizontal" role="form">
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right">MQTT地址</label>
- <div class="col-sm-9">
- <input type="text" id="plankUrl" class="col-sm-6" placeholder="xxxx.com">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right">端口</label>
- <div class="col-sm-9">
- <input type="text" id="port" class="col-sm-6" placeholder="1883">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right">上传地址</label>
- <div class="col-sm-9">
- <input type="text" id="pub" value="/yfkj/cbd/pub/" class="col-sm-6"
- placeholder="/yfkj/cbd/pub/">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right">下发地址</label>
- <div class="col-sm-9">
- <input type="text" id="sub" value="/yfkj/cbd/sub/" class="col-sm-6"
- placeholder="/yfkj/cbd/sub/">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right">图片上传地址</label>
- <div class="col-sm-9">
- <input type="text" id="photoUrl" class="col-sm-6" placeholder="http://xxxxx.com">
- </div>
- </div>
- <div class="clearfix">
- <div class="col-md-offset-3 col-md-9">
- <button class="btn btn-sm" type="reset" onclick="closeConfig()">
- <i class="ace-icon fa fa-undo bigger-110"></i>
- 取消
- </button>
-
- <button class="btn btn-sm btn-info" type="button" onclick="saveConfig()">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 确定
- </button>
- </div>
- </div>
- </form>
- </div>
- <div class="markimg"></div>
- <!-- 配置项 -->
- <div class="modal" id="myModal" tabindex="-1" data-backdrop="static" data-keyboard="false" role="dialog"
- aria-labelledby="myModalLabel" style="display: none;">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="widget-header">
- <h4 class="widget-title">
- SIM卡详情:
- <span id="sppbId"></span>
- <!-- <input type="hidden" value="" id="hideId" name="id"> -->
- </h4>
- <div class="widget-toolbar">
- <a href="#" data-dismiss="modal" aria-hidden="true">
- <i class="ace-icon fa fa-times"></i>
- </a>
- </div>
- </div>
- <div class="widget-body">
- <div class="row">
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> ICCID: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div class="currIccid"></div>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 状态: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div id="account_status"></div>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 套餐: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div id="data_plan">
- <div class="progressParent">
- <div class="layui-progress">
- <div class="layui-progress-bar layui-bg-blue" lay-percent="100%"></div>
- </div>
- </div>
- <div class="progressVal"></div>
- </div>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 已用流量: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div id="data_usage">
- <div class="progressParent">
- <div class="layui-progress">
- <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
- </div>
- </div>
- <div class="progressVal"></div>
- </div>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 剩余流量: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div id="data_balance">
- <div class="progressParent">
- <div class="layui-progress" lay-filter="demo">
- <div class="layui-progress-bar layui-bg-green" lay-percent="0%"></div>
- </div>
- </div>
- <div class="progressVal"></div>
- </div>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 到期时间: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <div class="expiry_date">2019-11-01 13:59:35</div>
- </div>
- <div style="clear:both"></div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 更换ICCID: </font>
- </font>
- </label>
- <div class="col-sm-9">
- <input type="text" id="changeIccid" autocomplete="off">
- </div>
- <div style="clear:both"></div>
- </div>
- <!-- 结束 -->
- </div>
- <div class="collocateBtn">
- <button class="btn btn-sm btn-info" onclick="saveChangeIccid()">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;">确定</font>
- </font>
- </button>
- <button class="btn btn-sm" data-dismiss="modal" aria-hidden="true">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;">取消</font>
- </font>
- </button>
- </div>
- </div>
- <div>
- </div>
- </div>
- </div>
- </div>
- <!-- 信号强度折线图 -->
- <div id="signal" style="max-width:800px;height:400px;display:none">
- </div>
- <!-- loading -->
- <div id="loadingParent">
- <div id="loadCenter">
- <div class="skype-loader">
- <div class="dot">
- <div class="first"></div>
- </div>
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- </div>
- 正在更新...
- </div>
- </div>
- <input type="hidden" value="{{equip_id}}" id="imei">
- <input type="hidden" value="" id="iccid">
- <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
- <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
- <script src="{% static '/lib/layui/layui.all.js' %}"></script>
- <script type="text/javascript"
- src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
- <script src="{% static '/js/common.js' %}?versions=0.5.4"></script>
- <!-- <script src="{% static '/assets/js/ace.min.js' %}"></script> -->
- <!-- <script src="{% static '/lib/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script> -->
- <!-- <script src="{% static '/lib/js/main.js' %}" type="text/javascript" charset="utf-8"></script> -->
- <script src="{% static '/lib/js/jquery-ui.min.js' %}"></script>
- <script src="{% static '/lib/js/highcharts.js'%}" type="text/javascript"></script>
- <script src="{% static '/lib/js/jquery.ui.touch-punch.min.js' %}"></script>
- <script src="{% static '/lib/js/detailsAnimat.js' %}"></script>
- <script src="{% static '/lib/js/coordOffset.js' %}"></script>
- <script type="text/javascript">
- $.ajaxSetup({
- data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
- });
- $(window).resize(function () {
- scrollBar()
- });
- var parentUserName = $('#parentUserName', parent.document).html();
- // if(!(parentUserName == '云飞展示账号')){
- // $('#takephotoShowBtn').remove();
- // }
- if (!(parentUserName == 'admin' || parentUserName == 'user')) {
- $('#operationBtn').remove();
- $('#handleBtns').remove();
- $('#semaphore').remove();
- }
- // 自定义动画
- animate.init();
- animate.showAll();
- $('#showall').on('click', function (e) {
- animate.showAll();
- e.stopPropagation();
- })
- // 获取位置
- var geoc = new BMap.Geocoder();
- // rtu信息
- var rtuInfo;
- var configData = '';//配置数据
- // 获取当前设备状态信息
- $.ajax({
- url: 'equipmanage_cbd_detail',
- type: 'post',
- dataType: 'json',
- data: {
- id: $('#imei').val()
- },
- success: function (data) {
- equipData(data);
- var stat = eval('(' + data[0].cbd_status + ')');
- var dver = stat.dver.split('.');
- if (dver[0] == 4 || dver[0] == 5) {
- $('#swfDiv').show()
- } else {
- $('#showall').show()
- }
- // rtu信息
- if ((data[0].rtu_info == null) || (data[0].rtu_info.length < 2)) {
- $('#rtuInfoBtn').hide();
- } else {
- $('#rtuInfoBtn').show();
- }
- $('#rtuInfoBtn').on('click', function () {
- setRtuHtml(data[0].rtu_info);
- })
- }
- })
- $.ajax({
- url: "equipmanage_cbd",
- type: 'post',
- data: {
- id: $('#imei').val(),
- req: "paramconf",
- },
- success: function (data) {
- configData = data;
- configFill(data);
- // var str = "5.9HK(verify)";
- // console.log(str)
- // if () {
- // }
- // console.log(str.indexOf("HK") != -1 ); // true
- }
- })
- var ab
- function equipData(dat) {
- var equipStatus = dat[0];
- var equipData = dat[1];
- $('#equip_name').html(equipStatus.equip_name || '无');
- $('#upl_time').html(equipStatus.upl_time);
- var stat = eval('(' + equipStatus.cbd_status + ')');
- var cbd_data = eval('(' + equipData.cbd_data + ')');;
- // $('#ts').html(stat.ts ? '时控' : '光控');//定时模式
- $('#gs').html('当前通道:' + (stat.gs ? '落虫' : '排水'));//通道模式
- $('#upds').html('上仓门:' + (stat.upds ? '打开' : '关闭'));//上仓门
- $('#dnds').html('下仓门:' + (stat.dnds ? '打开' : '关闭'));//下舱门
- $('#csq').html('信号强度:' + stat.csq);//信号强度
- $('#dver').html(stat.dver);//版本号
- //判断当前版本号是否为5.0版本再显示设备开关
- ab = stat.dver;
- var ab_str = ab.toString();
- var ab_num = parseInt(ab_str.substring(0, ab_str.indexOf('.')));
- if (ab_num == '5') {
- $('.facilitySwitch').removeClass('dataNone')
- } else {
- $('.facilitySwitch').addClass('dataNone')
- }
- //判断当前设备是否为海康
- var reg = RegExp(/HK/);
- if (ab_str.match(reg)) {
- // 包含
- $('#shakeID').removeClass('dataNone')
- } else {
- $('#shakeID').addClass('dataNone')
- }
- // console.log(stat.csq);
- // console.log(123);
- $('#csqValue').html(stat.csq);//维度
- if (stat.lng > 999) {
- var lng = Math.floor(stat.lng / 100) + ((stat.lng % 100) / 60);
- var lat = Math.floor(stat.lat / 100) + ((stat.lat % 100) / 60);
- } else {
- var lng = Number(stat.lng);
- var lat = Number(stat.lat);
- }
- var lng1 = wgs84togcj02(lng, lat);
- var lng2 = gcj02tobd09(lng1[0], lng1[1]);
- var pt = new BMap.Point(lng2[0], lng2[1]);
- geoc.getLocation(pt, function (rs) {
- var addComp = rs.addressComponents;
- // $('.area').html('位置:'+ addComp.province + ", " + addComp.city + ", " + addComp.district)
- $('#curr_area').html(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
- if (addComp.city) {
- $.ajax({ //高德地图天气请求
- type: 'get',
- url: 'https://restapi.amap.com/v3/weather/weatherInfo?city=' + addComp.city + '&key=50e3d228f679af99eee7dbdb4523d069',
- dataType: 'JSON',
- error: function () {
- alert('网络错误');
- },
- success: function (res) {
- console.log(res)
- if (res.info == 'OK' && res.lives.length) {
- var allmsg = res.lives[0];
- // $('#weather').append('<div>'+allmsg.city+','+allmsg.reporttime+','+allmsg.winddirection+'风'+allmsg.windpower+'级,'+allmsg.temperature+'C°,'+allmsg.weather+'</div>');
- $('#weather').html(allmsg.temperature + 'C°,' + allmsg.weather);
- $('#wind').html(allmsg.winddirection + '风' + allmsg.windpower + '级');
- }
- }
- });
- }
- });
- // $('#lat').html('纬度:' + lat.toFixed(5));//维度
- // $('#lng').html('经度:' + lng.toFixed(4));//经度
- $('#tps').html(stat.tps ? '异常' : '正常');
- // if (cbd_data.tps == 0) {//温控状态
- // $('#tps').attr('checked', 'checked');
- // } else {
- // $('#tps').attr('checked', false);
- // }
- $('#lps').html('光控检测:' + (stat.lps ? '有光照' : '无光照'));//光控状态
- $('#hs').html('加热开关:' + (stat.hs ? '开启' : '关闭'));//加热状态
- $('#rps').html('雨控状态:' + (stat.rps ? '下雨' : '正常'));//雨控状态
- $('#hrt').html('加热仓温度:' + cbd_data.hrt);//加热仓温度
- $('#at').html((cbd_data.at / 10).toFixed(1) + '℃');//环境温度
- $('#ah').html((cbd_data.ah / 10).toFixed(1) + '%RH');//环境湿度
- $('#iccid').val(stat.iccid);
- }
- $('#dtlTiming').on('change', function () {
- if ($(this).val() == 0) {
- $('.lightPattern').show();
- $('.timePattern').hide();
- } else {
- $('.lightPattern').hide();
- $('.timePattern').show();
- }
- })
- // $('.slider').slider({
- // disabled: true,
- // })
- // 1定时时长
- $("#dtlTimingLength-slider").css('width', '85%').slider({
- value: 1,
- range: "min",
- min: 1,
- max: 10,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlTimingLength').html(val);
- }
- });
- // 2落虫
- $("#dtlDropTime-slider").css('width', '85%').slider({
- value: 1,
- range: "min",
- min: 1,
- max: 20,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlDropTime').html(val);
- }
- });
- // 3加热时间
- $("#dtlCalefactionTime-slider").css('width', '85%').slider({
- value: 1,
- range: "min",
- min: 1,
- max: 20,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlCalefactionTime').html(val);
- }
- });
- // 4加热温度
- $("#dtlCalefactionTemperature-slider").css('width', '85%').slider({
- value: 75,
- range: "min",
- min: 75,
- max: 120,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlCalefactionTemperature').html(val);
- }
- });
- // 5高温保护阈值
- $("#dtlHighLimit-slider").css('width', '85%').slider({
- value: 50,
- range: "min",
- min: 50,
- max: 70,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlHighLimit').html(val);
- }
- });
- // 6低温保护阈值
- $("#dtlLowLimit-slider").css('width', '85%').slider({
- value: 1,
- range: "min",
- min: 1,
- max: 10,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlLowLimit').html(val);
- }
- });
- // 7数据上相间隔
- $("#dtlDataUpTime-slider").css('width', '85%').slider({
- value: 1,
- range: "min",
- min: 10,
- max: 60,
- step: 10,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#dtlDataUpTime').html(val);
- }
- });
- // 8震动时间
- $("#shakeTime-slider").css('width', '85%').slider({
- value: 0,
- range: "min",
- min: 0,
- max: 100,
- step: 1,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#shakeTime').html(val);
- }
- });
- //刷新:下发查询:
- function reloadPage() {
- var id = $('#imei').val();
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- async: false,
- data: {
- "req": "read",//读取
- "topicid": id,
- "kind": "status"//读取下位机状态
- },
- dataType: "json",
- success: function (data) {
- if (data == "0") {
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- async: false,
- data: {
- "req": "read",//读取
- "topicid": id,
- "kind": "data"//读取下位机状态
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 6000)
- },
- success: function (data) {
- if (data == "0") {
- layer.msg("下发查询发送成功!")
- setTimeout(function () {
- // 获取当前设备状态信息
- $.ajax({
- url: 'equipmanage_cbd_detail',
- type: 'post',
- dataType: 'json',
- data: {
- id: $('#imei').val()
- },
- success: function (data) {
- equipData(data);
- }
- })
- }, 6000)
- } else {
- layer.msg("发送失败!")
- }
- }
- })
- } else {
- layer.msg("发送失败!")
- }
- }
- })
- }
- // dtlconfigurationSwitch()
- // 配置按钮
- function dtlconfigurationSwitch() {
- var id = $('#imei').val();
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- data: {
- "req": "read",//读取
- "topicid": id,
- "kind": "paramconf"//读取下位机状态
- },
- dataType: "json",
- beforeSend: function () {
- $('#configParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#configParent').hide();
- }, 3000)
- },
- success: function (data) {
- if (data == "0") {
- // layer.msg("发送成功!", { time: 2000 })
- setTimeout(function () {
- $.ajax({
- url: "equipmanage_cbd",
- type: 'post',
- data: {
- id: id,
- req: "paramconf",
- },
- success: function (data) {
- configData = data;
- configFill(data);
- }
- })
- }, 3000)
- } else {
- layer.msg("发送失败!")
- }
- }
- })
- }
- // 填充函数
- function configFill(dat) {
- var data = $.parseJSON(dat);
- var para = eval("(" + data.paramconf + ")");
- if (para != '' && para != null) {
- // 定时模式
- $('#dtlTiming').val(para.ts);
- if (para.ts == 0) {
- $('.lightPattern').show();
- $('.timePattern').hide();
- } else {
- $('.lightPattern').hide();
- $('.timePattern').show();
- }
- //设备开关
- if (para.boot == 1) {
- $("#onOff").prop('checked', false)
- } else {
- $("#onOff").prop('checked', true)
- }
- // 滑块
- $("#dtlTimingLength-slider").slider('value', para.tt);
- $('#dtlTimingLength').html(para.tt);
- $("#dtlDropTime-slider").slider('value', para.collt);
- $('#dtlDropTime').html(para.collt);
- $("#dtlCalefactionTime-slider").slider('value', para.htim);
- $('#dtlCalefactionTime').html(para.htim);
- $("#dtlCalefactionTemperature-slider").slider('value', para.hst);
- $('#dtlCalefactionTemperature').html(para.hst);
- $("#dtlHighLimit-slider").slider('value', para.tph);
- $('#dtlHighLimit').html(para.tph);//高温
- $('#tph').html(para.tph + '℃');
- $("#dtlLowLimit-slider").slider('value', para.tpl);
- $('#dtlLowLimit').html(para.tpl);//低温
- $('#tpl').html(para.tpl + '℃');
- $("#dtlDataUpTime-slider").slider('value', para.datt);
- $('#dtlDataUpTime').html(para.datt);
- $("#shakeTime-slider").slider('value', para.shake_sec);
- $('#shakeTime').html(para.shake_sec);
- // 时间
- if ($('#dtlTiming').val() == 1) {
- $('#timSelectBox').val(Math.floor(para.st));
- $('#timSelectBox2').val(Math.floor(para.et));
- $('#begin').val(Math.floor(para.st));
- $('#end').val(Math.floor(para.et));
- }
- // $('#imgHvga').val(para.imgres);
- $('.slider').slider({
- disabled: false,
- })
- } else {
- // 定时模式
- $('#dtlTiming').val(0);
- $('.lightPattern').show();
- $('.timePattern').hide();
- // 滑块
- $("#dtlTimingLength-slider").slider('value', 1);
- $('#dtlTimingLength').html(1);
- $("#dtlDropTime-slider").slider('value', 1);
- $('#dtlDropTime').html(1);
- $("#dtlCalefactionTime-slider").slider('value', 1);
- $('#dtlCalefactionTime').html(1);
- $("#dtlCalefactionTemperature-slider").slider('value', 75);
- $('#dtlCalefactionTemperature').html(75);
- $("#dtlHighLimit-slider").slider('value', 50);
- $('#dtlHighLimit').html(50);
- $("#dtlLowLimit-slider").slider('value', 1);
- $('#dtlLowLimit').html(1);
- $("#dtlDataUpTime-slider").slider('value', 10);
- $('#dtlDataUpTime').html(10);
- $("#shakeTime-slider").slider('value', 10);
- $('#shakeTime').html(10);
- $('#begin').val(0);
- $('#end').val(0);
- // $('#imgHvga').val(0);
- $('#tph').html('70℃');
- $('#tpl').html('1℃');
- }
- }
- //保存
- function saveOperation() {
- //判断当前设备是否为海康
- var ab_str = ab.toString();
- var reg = RegExp(/HK/);
- if (ab_str.match(reg)) {
- // 包含
- var data = {
- req: 'set',
- id: $('#imei').val(),
- timing: $('#dtlTiming').val(),
- timingLength: $('#dtlTimingLength').html(),
- begin: $('#begin').val(),
- end: $('#end').val(),
- dropTime: $('#dtlDropTime').html(),
- calefactionTime: $('#dtlCalefactionTime').html(),
- calefactionTemperature: $('#dtlCalefactionTemperature').html(),
- highLimit: $('#dtlHighLimit').html(),
- lowLimit: $('#dtlLowLimit').html(),
- dataUpTime: $('#dtlDataUpTime').html(),
- // imgHvga: $('#imgHvga').val(),
- shake_sec: $('#shakeTime').html()
- }
- } else {
- var data = {
- req: 'set',
- id: $('#imei').val(),
- timing: $('#dtlTiming').val(),
- timingLength: $('#dtlTimingLength').html(),
- begin: $('#begin').val(),
- end: $('#end').val(),
- dropTime: $('#dtlDropTime').html(),
- calefactionTime: $('#dtlCalefactionTime').html(),
- calefactionTemperature: $('#dtlCalefactionTemperature').html(),
- highLimit: $('#dtlHighLimit').html(),
- lowLimit: $('#dtlLowLimit').html(),
- dataUpTime: $('#dtlDataUpTime').html(),
- // imgHvga: $('#imgHvga').val(),
- }
- }
- if ($('#dtlTiming').val() == 1) {
- if ($('#begin').val() && $('#end').val()) {
- saveOperationAjax('cbd_mqtt', data)
- } else {
- layer.msg("请将时控时间填写完整!");
- }
- } else {
- saveOperationAjax('cbd_mqtt', data);
- }
- }
- function saveOperationAjax(url, data) {
- //判断当前的震动时间是否为0 0 == || undefined 调用震动关闭 / 0 != 调用震动开启
- console.log(data.shake_sec == 0)
- console.log(data.shake_sec)
- if (data.shake_sec == '0' || data.shake_sec == undefined) {
- // 震动关闭
- handleFun('shake', '', '', '0');
- } else if (data.shake_sec != '0' || data.shake_sec != undefined) {
- // 震动开启
- handleFun('shake', '', '', '1');
- }
- $.ajax({
- url: url,
- type: 'post',
- data: data,
- beforeSend: function () {
- $('.loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('.loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- if (data == "0") {
- setTimeout(function () {
- layer.msg("配置成功!");
- $('#tph').html($('#dtlHighLimit').html() + '℃');
- $('#tpl').html($('#dtlLowLimit').html() + '℃');
- }, 3000)
- }
- }
- })
- }
- // 取消配置
- function cancelConfig() {
- configFill(configData)
- }
- var popupIndex;
- //operation配置弹框
- function operation() {
- //页面层
- popupIndex = layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- // area: ['420px', '240px'], //宽高
- area: ["50%", '480px'],
- content: $('#handleBtns').html()
- });
- }
- // 查看和修改IMEI
- function lookChangeImei(flag) {
- var id = $('#imei').val();
- if (flag == 'look') {
- $.ajax({
- type: "post",
- url: 'cbd_old_imei',
- data: {
- "e_id": id,
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- $('#loadingParent').hide();
- },
- success: function (data) {
- var old_eid = data.old_eid || '暂无';
- layer.open({
- type: 1
- , title: false //不显示标题栏
- , closeBtn: false
- , area: '300px;'
- , shade: 0.8
- , id: 'LAY_layuipro4' //设定一个id,防止重复弹出
- , btn: ['我知道了']
- , btnAlign: 'c'
- , moveType: 1 //拖拽模式,0或者1
- , 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>'
- , success: function (layero) {
- }
- });
- }
- })
- }
- if (flag == 'change') {
- //询问框
- layer.confirm('确定修改IMEI吗?', {
- icon: 3,
- zIndex: 19991016,
- btn: ['确定', '取消'] //按钮
- }, function (index) {
- layer.close(index);
- layer.prompt({ title: '输入最新设备号', formType: 1 }, function (text, index) {
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- data: {
- "req": "setimei",//控制
- "e_id": id,
- "newimei": text,//升级 要修改成的设备号
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- setTimeout(function () {
- if (data == 0) {
- layer.msg('设置成功')
- }
- }, 3000)
- layer.close(popupIndex);
- }
- })
- layer.close(index);
- });
- }, function () {
- });
- }
- }
- // var confogFlag = 1;
- function popupFrame(str, cmd, type, data, ws) {
- // if (cmd == 'workmode' && type.val()) {
- if (cmd == 'workmode' || type || cmd) {
- //询问框
- layer.confirm('确定' + str + '?', {
- icon: 3,
- zIndex: 19991016,
- btn: ['确定', '取消'] //按钮
- }, function (index) {
- if (cmd == 'config') {
- layer.close(popupIndex)
- // if(type == 1){
- // confogFlag = 1;
- // $('.coerceConfig .configTitle').html('配置板子地址');
- // $('.coerceConfig .form-group').eq(0).show();
- // $('.coerceConfig .form-group').eq(1).show();
- // $('.coerceConfig .form-group').eq(2).hide();
- // }else{
- // confogFlag = 2;
- // $('.coerceConfig .configTitle').html('配置图片上传地址');
- // $('.coerceConfig .form-group').eq(0).hide();
- // $('.coerceConfig .form-group').eq(1).hide();
- // $('.coerceConfig .form-group').eq(2).show();
- // }
- $('.markimg').show();
- $('.coerceConfig').show();
- } else {
- // if (cmd == 'workmode') {
- // var newtype = type.val();
- // handleFun(cmd, newtype, data);
- // } else {
- // handleFun(cmd, type, data);
- // }
- if (cmd == 'workmode') {
- var newtype = type.val();
- handleFun(cmd, newtype, data);
- } else if (cmd == 'shake') {
- handleFun(cmd, type, data, ws);
- } else {
- handleFun(cmd, type, data);
- }
- }
- layer.close(index);
- }, function () {
- });
- }
- }
- function handleFun(cmd, type, data, ws) {
- var id = $('#imei').val();
- //判断当前是否为震动功能ws是否为空
- if (ws != undefined) {
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- data: {
- "req": "ctrl",//控制
- "topicid": id,
- "cmd": cmd,//升级 update
- "type": type,
- "data": data,
- "ws": ws
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- setTimeout(function () {
- if (data == 0) {
- layer.msg('下发成功')
- }
- }, 3000)
- layer.close(popupIndex);
- }
- })
- } else {
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- data: {
- "req": "ctrl",//控制
- "topicid": id,
- "cmd": cmd,//升级 update
- "type": type,
- "data": data
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- setTimeout(function () {
- if (data == 0) {
- layer.msg('下发成功')
- }
- }, 3000)
- layer.close(popupIndex);
- }
- })
- }
- }
- function saveConfig() {
- var id = $('#imei').val();
- // if(confogFlag == 1){
- // if(!($('#plankUrl').val() && $('#port').val())){
- // layer.msg("请将信息填写完整!");
- // return false;
- // }
- // }else{
- // if(!$('#photoUrl').val()){
- // layer.msg("请将信息填写完整!");
- // return false;
- // }
- // }
- if (!($('#plankUrl').val() && $('#port').val() && $('#pub').val() && $('#sub').val() && $('#photoUrl').val())) {
- layer.msg("请将信息填写完整!");
- return false;
- }
- // if(confogFlag == 1){
- // var dat = {
- // "req": "ip",//配置
- // "topicid": id,
- // "modifi_url": $('#plankUrl').val(),//升级 update
- // "modifi_port":$('#port').val(),
- // "photo_url": $('#plankUrl').val()//升级 update
- // }
- // }else{
- // var dat = {
- // "req": "ip",//配置
- // "topicid": id,
- // "photo_url": $('#photoUrl').val(),//升级 update
- // }
- // }
- var dat = {
- "req": "ip",//配置
- "topicid": id,
- "url": $('#plankUrl').val(),//升级 update
- "port": $('#port').val(),
- "pub": $('#pub').val(),
- "sub": $('#sub').val(),
- "photo_url": $('#photoUrl').val()//升级 update
- }
- console.log(dat)
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- data: dat,
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- closeConfig()
- }
- })
- }
- function closeConfig() {
- $('.coerceConfig input').val('');
- $('.markimg').hide();
- $('.coerceConfig').hide();
- }
- // sim卡查询
- function sendexamineSIM() {
- var iccid = $('#iccid').val();
- examineSIM(iccid)
- }
- function examineSIM(iccid) {
- $.ajax({
- url: 'siminfo',
- type: 'post',
- dataType: 'json',
- data: {
- simid: iccid,
- },
- beforeSend: function (XMLHttpRequest) {
- //注意,layer.msg默认3秒自动关闭,如果数据加载耗时比较长,需要设置time
- loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
- },
- success: function (data) {
- console.log(data)
- var dat = data.data;
- if (data.code == 0) {
- var status;
- if (dat.account_status == "0") {
- status = "未知";
- } else if (dat.account_status == "1") {
- status = "测试期";
- } else if (dat.account_status == "2") {
- status = "沉默期";
- } else if (dat.account_status == "3") {
- status = "使用中";
- } else if (dat.account_status == "4") {
- status = "停机";
- } else if (dat.account_status == "5") {
- status = "停机保号";
- } else if (dat.account_status == "6") {
- status = "预销号";
- } else if (dat.account_status == "7") {
- status = "销号";
- }
- var usage;
- if (dat.iccid) {
- usage = dat.data_usage;
- } else {
- usage.innerHTML = '--';
- }
- var balance;
- if (dat.iccid) {
- balance = dat.data_balance;
- } else {
- balance = '--';
- }
- var time;
- if (dat.iccid) {
- var timestamp4 = new Date(dat.expiry_date * 1000);//直接用 new Date(时间戳) 格式转化获得当前时间
- time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
- } else {
- time = '--';
- }
- layer.close(loadingFlag);
- layer.open({
- type: 1
- , title: false //不显示标题栏
- , closeBtn: false
- , area: '300px;'
- , shade: 0.8
- , id: 'LAY_layuipro' //设定一个id,防止重复弹出
- , btn: ['我知道了']
- , btnAlign: 'c'
- , moveType: 1 //拖拽模式,0或者1
- , 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>'
- , success: function (layero) {
- }
- });
- } else {
- layer.msg('查询失败!');
- }
- }
- })
- }
- // 设置rtu结构
- function setRtuHtml(rtuInfo) {
- if ((rtuInfo == null) || (rtuInfo.length < 2)) {
- rtuInfo = {};
- } else {
- rtuInfo = eval('(' + rtuInfo + ')');
- var index2 = layer.open({
- type: 1
- , title: false //不显示标题栏
- , closeBtn: false
- , area: '320px;'
- , shade: 0.8
- , id: 'LAY_layuipro1' //设定一个id,防止重复弹出
- , btn: ['查看流量', '取消']
- , yes: function (index, layero) {
- //按钮【按钮一】的回调
- layer.close(index2);
- examineSIM(rtuInfo.iccid)
- }
- , btnAlign: 'c'
- , moveType: 1 //拖拽模式,0或者1
- , 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>'
- , success: function (layero) {
- }
- });
- }
- }
- // function isIE() {
- // return navigator.userAgent.toLowerCase().indexOf('trident') > -1 ? true : false;
- // }
- // if (isIE()) {
- // $('#iframeDiv').remove();
- // $('#showall').show();
- // }
- // if ($('#dverInp').val() == 4 || $('#dverInp').val() == 5) {
- // $('#showall').hide();
- // } else {
- // $('#iframeDiv').remove();
- // $('#showall').show();
- // }
- //模态框 关闭前事件
- $('#myModal').on('hide.bs.modal', function () {
- window.location.href = 'equipmanage_cbd_detail?id=' + $('#imei').val()
- })
- // 配置按钮
- function setSimIccid(ele, id, iccid) {
- if (!iccid) {
- layui.use('layer', function () {
- var layer = layui.layer;
- layer.prompt({ title: 'SIM卡绑定', formType: 0 }, function (text, index) {
- if (text.length == 20) {
- // changeIccidFun(id, text, function () { })
- readSim(id, text, 'save')
- // layer.close(index);
- } else {
- layer.msg('请输入正确SIM卡号');
- }
- // layer.msg('演示完毕!您的口令: <br>您最后写下了:'+text);
- });
- })
- } else {
- readSim(id, iccid, '')
- }
- $(window).resize(function () {
- // moveBar()
- });
- }
- function readSim(id, iccid, save) {
- $.ajax({
- type: "post",
- url: 'siminfo',
- data: {
- "simid": iccid,
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- $('#loadingParent').hide();
- },
- success: function (data) {
- $('#sppbId').html(id);
- $('.currIccid').html(iccid);
- if (data.code == 0) {
- layer.closeAll();
- if (data.data.account_status == 0) {
- var status = '未知';
- } else if (data.data.account_status == 1) {
- var status = '测试期';
- } else if (data.data.account_status == 2) {
- var status = '沉默期';
- } else if (data.data.account_status == 3) {
- var status = '使用中';
- } else if (data.data.account_status == 4) {
- var status = '停机';
- } else if (data.data.account_status == 5) {
- var status = '停机保号';
- } else if (data.data.account_status == 6) {
- var status = '预销号';
- } else if (data.data.account_status == 7) {
- var status = '销号';
- }
- $('#account_status').html(status);
- $('#data_plan').find('.progressVal').html((data.data.data_plan).toFixed(2) + 'MB');
- $('#data_plan').find('.layui-progress-bar').attr('lay-percent', '10%');
- $('#data_usage').find('.progressVal').html((data.data.data_usage).toFixed(2) + 'MB');
- var data_usage = data.data.data_usage / data.data.data_plan * 100;
- $('#data_usage').find('.layui-progress-bar').css('width', data_usage + '%');
- $('#data_balance').find('.progressVal').html((data.data.data_balance).toFixed(2) + 'MB');
- var data_usage = data.data.data_balance / data.data.data_plan * 100;
- $('#data_balance').find('.layui-progress-bar').css('width', data_usage + '%');
- var date = new Date(data.data.expiry_date * 1000);
- $('.expiry_date').html(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds());
- $('#myModal').modal('show')
- } else {
- $('#account_status').html('暂无');
- $('#data_plan').find('.progressVal').html('--');
- $('#data_plan').find('.layui-progress-bar').css('width', 0);
- $('#data_usage').find('.progressVal').html('--');
- $('#data_usage').find('.layui-progress-bar').css('width', 0 + '%');
- $('#data_balance').find('.progressVal').html('--');
- $('#data_balance').find('.layui-progress-bar').css('width', 0 + '%');
- $('.expiry_date').html('--');
- $('#myModal').modal('show')
- }
- if (save) {
- saveIccid(id, iccid, data)
- }
- }
- })
- }
- function saveIccid(id, iccid, data1) {
- $.ajax({
- type: "post",
- url: 'equip_simiccid',
- data: {
- "e_id": id,
- "iccid": iccid,
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- $('#loadingParent').hide();
- },
- success: function (data) {
- if (data == 0) {
- $('#sppbId').html(id);
- $('.currIccid').html(iccid);
- if (data1.code != 5004) {
- if (data1.data.account_status == 0) {
- var status = '未知';
- } else if (data1.data.account_status == 1) {
- var status = '测试期';
- } else if (data1.data.account_status == 2) {
- var status = '沉默期';
- } else if (data1.data.account_status == 3) {
- var status = '使用中';
- } else if (data1.data.account_status == 4) {
- var status = '停机';
- } else if (data1.data.account_status == 5) {
- var status = '停机保号';
- } else if (data1.data.account_status == 6) {
- var status = '预销号';
- } else if (data1.data.account_status == 7) {
- var status = '销号';
- }
- $('#account_status').html(status);
- $('#data_plan').find('.progressVal').html((data1.data.data_plan).toFixed(2) + 'MB');
- $('#data_plan').find('.layui-progress-bar').attr('lay-percent', '10%');
- $('#data_usage').find('.progressVal').html((data1.data.data_usage).toFixed(2) + 'MB');
- var data_usage = data1.data.data_usage / data1.data.data_plan * 100;
- $('#data_usage').find('.layui-progress-bar').css('width', data_usage + '%');
- $('#data_balance').find('.progressVal').html((data1.data.data_balance).toFixed(2) + 'MB');
- var data_usage = data1.data.data_balance / data1.data.data_plan * 100;
- $('#data_balance').find('.layui-progress-bar').css('width', data_usage + '%');
- var date = new Date(data1.data.expiry_date * 1000);
- $('.expiry_date').html(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds());
- } else {
- $('#account_status').html('暂无');
- $('#data_plan').find('.progressVal').html('--');
- $('#data_plan').find('.layui-progress-bar').css('width', 0);
- $('#data_usage').find('.progressVal').html('--');
- $('#data_usage').find('.layui-progress-bar').css('width', 0 + '%');
- $('#data_balance').find('.progressVal').html('--');
- $('#data_balance').find('.layui-progress-bar').css('width', 0 + '%');
- $('.expiry_date').html('--');
- $('#myModal').modal('show')
- }
- $('#myModal').modal('show')
- }
- }
- })
- }
- function saveChangeIccid() {
- if ($('#changeIccid').val()) {
- readSim($('#sppbId').html(), $('#changeIccid').val(), 'save');
- $('#changeIccid').val('')
- } else {
- layer.msg('请先填写ICCID', { icon: 2 });
- }
- }
- //测试测试
- var popupIndexA;
- function ceshiceshi() {
- var id = $('#imei').val()
- $.ajax({
- type: "post",
- url: 'cbd_csq',
- data: {
- "id": id,
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- // $('#loadingParent').hide();
- },
- success: function (data) {
- if (data.length == 0) {
- nullData()
- } else {
- readyData(data) //处理数据
- }
- }
- })
- }
- //暂无数据
- function nullData() {
- $('#signal').html('<h1 class="nullData">暂无信号强度变化趋势数据</h1>')
- ceshixial()
- }
- //处理数据
- function readyData(data) {
- var lineData = [] //信号强度
- var lineTime = [] //时间
- var lineTimeA = [] //时间
- var arrayAll = [];
- console.log(data)
- for (var i = 0; i < data.length; i++) {
- lineData.push(data[i].csq)
- lineTime.push(data[i].upl_time)
- var thisTime = lineTime[i].replace(/-/g, '/');
- var time = new Date(thisTime);
- // var timestamp = time.getTime() * 1000 + 8 * 3600000;
- var timestamp = time.getTime();
- lineTimeA.push(timestamp)
- arrayAll.push([lineTimeA[i], lineData[i]])
- }
- maskLayer(arrayAll)
- }
- //遮罩层和数据填充
- function maskLayer(arrayAll) {
- console.log(arrayAll);
- var tickInterval = 3 * 30 * 24 * 3600 * 1000
- var chart = null;
- chart = Highcharts.chart('signal', {
- chart: {
- type: 'spline',
- zoomType: 'x',
- selectionMarkerFill: 'rgba(0,0,0, 0.2)',
- resetZoomButton: {
- // 按钮定位
- position: {
- align: 'right', // by default
- verticalAlign: 'top', // by default
- x: -20,
- y: -50
- },
- }
- },
- title: {
- text: '信号强度变化趋势'
- },
- subtitle: {
- },
- xAxis: {
- crosshair: true, //十字基准线
- type: 'datetime',
- dateTimeLabelFormats: { //根据时间间距X轴自动显示哪种格式
- millisecond: '%H:%M:%S.%L',
- second: '%H:%M:%S',
- minute: '%H:%M',
- hour: '%H:%M',
- day: '%m-%d',
- week: '%m-%d',
- month: '%Y-%m',
- year: '%Y'
- },
- // tickInterval: 7 * 24 * 3600 * 1000
- tickInterval: tickInterval
- },
- yAxis: {
- title: {
- text: '信号强度趋势'
- },
- },
- credits: { //去掉默认的highcharts.com
- enabled: false
- },
- tooltip: {
- shared: true, //折线共享
- headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>',
- },
- // legend: {
- // layout: 'vertical',
- // align: 'right',
- // verticalAlign: 'middle'
- // },
- plotOptions: {
- spline: {
- marker: {
- enabled: true,
- radius: 3, //曲线点半径,默认是4
- symbol: 'diamond' //曲线点类型:”circle”, “square”, “diamond”, “triangle”,”triangle-down”,默认是”circle”
- }
- }
- },
- series: [{
- name: '信号强度',
- data: arrayAll,
- tooltip: {
- valueSuffix: ''
- }
- }],
- });
- ceshixial()
- }
- Highcharts.setOptions({
- // 所有语言文字相关配置都设置在 lang 里
- lang: {
- resetZoom: '刷新',
- resetZoomTitle: '重置缩放比例'
- }
- });
- function ceshixial() {
- // 页面层
- $('#loadingParent').hide();
- popupIndexA = layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ["50%", '540px'],
- content: $('#signal')
- });
- }
- //设备开关
- function sendOrder(ele, str, all) {
- var id = $('#imei').val();
- var obj = $(ele).prev();
- console.log(obj)
- var currStatus = obj.get(0).checked;
- var hintTxt = '';
- var currVal;
- if (currStatus) {
- hintTxt = '关闭';
- cmd = 'screen1'
- if (str == '设备') {
- currVal = 'poweroff';
- } else {
- currVal = 'coldoff';
- }
- } else {
- hintTxt = '开启';
- cmd = 'screen0'
- if (str == '设备') {
- currVal = 'poweron';
- } else {
- currVal = 'coldon';
- }
- }
- //询问框
- layer.confirm('是否' + hintTxt + str + '?', {
- icon: 3,
- btn: ['确定', '取消'] //按钮
- }, function (index) {
- if (all) {
- paramconf(obj);
- } else {
- $.ajax({
- type: "post",
- url: 'cbd_mqtt',
- data: {
- "req": "ctrl",//控制
- "topicid": id,
- "cmd": cmd,//升级 update
- "type": '1',
- "data": '',
- "ws": ''
- },
- dataType: "json",
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- setTimeout(function () {
- if (data == 0) {
- layer.msg('下发成功')
- if (obj.get(0).checked) {
- obj.prop('checked', false);
- } else {
- obj.prop('checked', true);
- }
- }
- }, 3000)
- layer.close(popupIndex);
- }
- })
- }
- layer.close(index);
- }, function () {
- });
- }
- </script>
- </body>
- </html>
|