| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017 |
- {% 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' %}" />
- <style type="text/css">
- body {
- background: #fff;
- }
- .row {
- margin: 0;
- }
- /* 菜单 */
- .menu_body .nulldata {
- line-height: 80px;
- text-align: center;
- height: 80px;
- background: #eee;
- }
- .menu_list {
- margin-top: 10px;
- }
- .menu_head {
- height: 30px;
- line-height: 30px;
- padding-left: 10px;
- font-size: 12px;
- color: #313131;
- cursor: pointer;
- border: 1px solid #e1e1e1;
- border-top: 0px solid #e1e1e1;
- position: relative;
- background: #f1f1f1 url(../static/img/jia.png) center right 5px no-repeat;
- margin: 0;
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .menu_body {
- height: auto;
- overflow: hidden;
- line-height: 38px;
- border-left: 1px solid #e1e1e1;
- border-right: 1px solid #e1e1e1;
- }
- .menu_body a {
- display: block;
- height: 32px;
- line-height: 32px;
- padding-left: 10px;
- color: #525252;
- background: #fff;
- text-decoration: none;
- border-bottom: 1px solid #e1e1e1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .menu_body a span {
- display: inline-block;
- width: 8px;
- height: 8px;
- border-radius: 50%;
- margin-right: 6px;
- }
- .bjred {
- background: red;
- }
- .bjgreen {
- background: green;
- }
- .menu_list .current {
- background: #f1f1f1 url(../static/img/jian.png) center right 5px no-repeat;
- font-weight: bold;
- color: #313131;
- }
- .menu_body .menu-active {
- color: #00bcd4;
- border-left: solid 3px #00bcd4;
- }
- .currAstive {
- background-color: #00bcd4;
- color: #fff;
- }
- /* 主题标题 */
- .widget-box {
- background: none repeat scroll 0 0 #F9F9F9;
- clear: both;
- margin-top: 16px;
- margin-bottom: 16px;
- position: relative;
- border: none;
- }
- .widget-title {
- height: 36px;
- line-height: 36px;
- border-bottom: solid 1px #e5e5e5;
- padding-bottom: 1px;
- /* text-align: center; */
- }
- .widget-title .equipInfo {
- float: left;
- }
- .widget-title h5 {
- color: #666;
- float: left;
- font-size: 12px;
- font-weight: bold;
- padding: 12px;
- line-height: 12px;
- margin: 0;
- margin-bottom: 3px;
- border-bottom: solid 2px #38b0ec;
- }
- /*状态 */
- .dev:HOVER {
- background: #2E363F;
- }
- .dev {
- display: flex;
- justify-content: space-around;
- /* width: 215px;
- height: 88px;
- float: left; */
- /* margin: 0px; */
- color: #f2f2f2;
- margin-bottom: 15px;
- cursor: pointer;
- position: relative;
- }
- .bg_lb {
- background:
- /* #27a9e3 */
- #4ab8e8;
- }
- .dev .left {
- width: 80px;
- padding-top: 10px;
- /* float: left; */
- }
- .dev .left .img-dev {
- width: 45px;
- margin-left: 12px;
- /* margin-top: 8px; */
- }
- .dev .right {
- width: 120px;
- padding-top: 3px;
- /* float: left; */
- font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;
- }
- .dev .right .name {
- font-size: 20px;
- line-height: 20px;
- text-align: left;
- padding-top: 10px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .dev .right .data {
- font-size: 14px;
- text-align: left;
- padding-top: 15px;
- }
- /* 项目 */
- .todo li {
- border-bottom: 1px solid #EBEBEB;
- margin-bottom: 0;
- padding: 10px 0;
- }
- .equipPage {
- line-height: 34px;
- text-align: center;
- }
- table tr td.nullData {
- text-align: center;
- line-height: 250px;
- }
- /* 状态块颜色 */
- .bg_lb {
- background:
- /* #27a9e3 */
- #4ab8e8;
- }
- .bg_ly {
- background:
- /* #ffb848 */
- #f5b761;
- }
- .bg_lg {
- background:
- /* #28b779 */
- #3eb984;
- }
- .bg_ls {
- background:
- /* #2255a4 */
- #4978c1;
- }
- .bg_lo {
- background:
- /* #da542e */
- #dc6442;
- }
- .bg_lr {
- background:
- /* #f74d4d */
- #f77979;
- }
- .aisle {
- position: absolute;
- left: 6px;
- bottom: 1px;
- font-size: 12px;
- }
- #uploadPhoto {
- display: none;
- }
- #viewPhoto {
- cursor: pointer;
- }
- /* 设备控制 */
- #ctrlBox>div {
- margin-bottom: 20px;
- }
- .handCtrlBox {
- margin-bottom: 20px;
- }
- input[type="checkbox"].ace.ace-switch.ace-switch-4+.lbl::before,
- input[type="checkbox"].ace.ace-switch.ace-switch-5+.lbl::before {
- text-indent: -39px;
- }
- .equipCtrl {
- border: 1px solid #cecece;
- padding: 15px 10px;
- background: #f5f5f5;
- box-shadow: 1px 1px 4px 1px #cecece;
- border-radius: 3px;
- cursor: pointer;
- }
- .equipCtrl:hover {
- border-color: #468fcd;
- box-shadow: 1px 2px 4px 0px #468fcd;
- }
- .equipCtrlInp {
- margin-top: 20px;
- text-align: right;
- }
- .isonlineicon {
- display: inline-block;
- width: 8px;
- height: 8px;
- border-radius: 50%;
- margin-right: 7px;
- }
- .isonlineicon.active {
- background: green;
- animation: 1s ease 0s infinite normal none running myfirst01;
- }
- .isonlineicon {
- background: #909090;
- animation: 1s ease 0s infinite normal none running myfirst02;
- }
- @keyframes myfirst01 {
- 0% {
- -moz-box-shadow: 0px 0px 6px 1px green;
- box-shadow: 0px 0px 6px 1px green;
- }
- 100% {
- -moz-box-shadow: 0px 0px 6px 1px green;
- box-shadow: 0px 0px 6px 1px green;
- }
- }
- @keyframes myfirst02 {
- 0% {
- -moz-box-shadow: 0px 0px 6px 1px #909090;
- box-shadow: 0px 0px 6px 1px #909090;
- }
- 100% {
- -moz-box-shadow: 0px 0px 6px 1px #909090;
- box-shadow: 0px 0px 6px 1px #909090;
- }
- }
- .ctrlLoading {
- position: absolute;
- bottom: 6px;
- }
- .equipCtrl .fa-cog {
- position: absolute;
- right: 26px;
- font-size: 20px;
- color: #3eb983;
- top: 11px;
- }
- .qxzDownCtrl {
- display: none;
- float: right;
- width: 53px;
- background: white;
- border: 1px solid #8aafce;
- color: #6688a6 !important;
- }
- .numName {
- display: inline-block;
- width: 70%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- vertical-align: middle;
- }
- /* 阈值控制 */
- #getthresholdDiv>div,
- #gettimingDiv>div {
- padding-bottom: 20px;
- }
- .thresholdCtrl {
- background: #4ab8e8;
- border-radius: 5px;
- color: #fff;
- box-shadow: 1px 1px 4px 1px #98dbf8;
- border: 1px solid #98dbf8;
- padding: 5px 10px;
- cursor: pointer;
- position: relative;
- }
- #gettimingDiv .thresholdCtrl {
- background: #65b83b;
- box-shadow: 1px 1px 4px 1px #d1ffba;
- border: 1px solid #65b83b;
- }
- .setthresholdBtn {
- position: absolute;
- right: 13px;
- top: 12px;
- font-size: 20px;
- }
- .setthresholdBtn:hover {
- color: #08ff46;
- }
- .thresholdCtrl::before {
- position: absolute;
- content: '';
- bottom: 0;
- left: 0;
- right: 0;
- height: 30%;
- background: rgba(255, 255, 255, 0.5);
- }
- .thresholdCtrlName {
- line-height: 30px;
- font-size: 16px;
- }
- .thresholdCtrlShowDiv {
- overflow: hidden;
- }
- .thresholdCtrlShowDiv>div {
- float: left;
- }
- .qxys img {
- width: 47px;
- }
- .maxminNum {
- font-size: 18px;
- line-height: 30px;
- margin-top: 11px;
- padding-left: 7%;
- }
- /* 色值阈值框 */
- .layui-form-item .layui-input-inline {
- width: 44%;
- }
- #Modal>div,
- #timingOnOffModal>div {
- margin-top: 20px;
- }
- .layui-form-mid.layui-word-aux span {
- color: red;
- }
- /* 定时设置 */
- #timingOnOffModal .layui-form-label {
- width: 100px;
- }
- /* .layui-body{overflow-y: scroll;} */
- .layui-layer-editName.layui-layer-page .layui-layer-content {
- overflow: hidden !important;
- overflow-y: scroll !important;
- }
- /* LED大屏样式 */
- .layui-layer-demo.layui-layer {
- background: transparent;
- box-shadow: none;
- color: #ff0000;
- }
- .layui-layer-demo .layui-layer-content {
- overflow-y: hidden !important;
- }
- .layui-layer-demo .qxzLedBj {
- padding-top: 115px;
- /* width: 684px;
- height: 781px; */
- width: 525px;
- height: 619px;
- background: url(../static/img/ledBj.png) no-repeat;
- background-size: 100% 100%;
- }
- .layui-layer-demo .qxzLedInfo {
- width: 95%;
- }
- .layui-layer-demo .qxzLedTitle {
- position: relative;
- height: 47px;
- /* white-space: nowrap; */
- overflow: hidden;
- width: 92%;
- margin: 16px auto;
- font-size: 36px;
- letter-spacing: 7px;
- text-shadow: 0rem 0rem 0.2rem rgba(240, 27, 27, 0.5), 0rem 0rem 0.15rem rgba(240, 27, 27, 0.5), 0rem 0rem 0.2rem rgba(240, 27, 27, 0.5), 0rem 0rem 0.2rem rgba(240, 27, 27, 0.5);
- box-sizing: border-box;
- word-break: break-all;
- }
- .layui-layer-demo .qxzLedTitle p {
- white-space: nowrap;
- /*position: absolute;
- left: -865px;
- top: 0; */
- /* display: inline-block; */
- text-align: center;
- }
- .layui-layer-demo .qxzLedTitle .qxzLedTitleLong {
- /* text-align: right; */
- padding-left: 100%;
- /* 从右至左开始滚动 */
- display: inline-block;
- animation: marqueeTransform 16s linear infinite;
- }
- @keyframes marqueeTransform {
- 0% {
- transform: translate(0, 0);
- }
- 100% {
- transform: translate(-100%, 0);
- }
- }
- .layui-layer-demo .eleContent {
- width: 82%;
- margin: 0 auto 0;
- height: 157px;
- overflow: hidden;
- }
- .layui-layer-demo .scrollUl {
- animation: scrollUlTransform 8s linear infinite;
- }
- @keyframes scrollUlTransform {
- 0% {
- transform: translate(0, 0);
- }
- 50% {
- transform: translate(0, 0);
- }
- 51% {
- transform: translate(0, -50%);
- }
- 100% {
- transform: translate(0, -50%);
- }
- }
- .layui-layer-demo .scrollUl li {
- line-height: 51px;
- font-size: 30px;
- text-shadow: 0rem 0rem 0.2rem rgba(240, 27, 27, 0.5), 0rem 0rem 0.15rem rgba(240, 27, 27, 0.5), 0rem 0rem 0.2rem rgba(240, 27, 27, 0.5), 0rem 0rem 0.2rem rgba(240, 27, 27, 0.5);
- }
- /* led标题更改 */
- .layui-layer.layui-layer-led {
- border-radius: 20px;
- overflow: hidden;
- }
- .layui-layer-led .layui-layer-content {
- overflow: hidden !important;
- box-sizing: border-box;
- /* padding: 10px 15px; */
- }
- .layui-layer-led .LEDTitle {
- line-height: 45px;
- background: #ececec;
- border-bottom: 1px solid #d1d1d1;
- padding: 0 15px;
- color: #797979;
- }
- .layui-layer-led .LEDContent {
- padding: 15px;
- }
- .layui-layer-led .LEDContent>div {
- margin-bottom: 20px;
- }
- .layui-layer-led .LEDBtns {
- text-align: center;
- }
- .layui-layer-led .LEDBtns button {
- margin: 0 20px;
- }
- textarea {
- resize: none;
- }
- /* 短信阈值下发 */
- .layui-form-switch {
- background-color: #00abf8;
- border-color: #00abf8;
- }
- .layui-form-switch em {
- color: #fff !important;
- }
- .layui-form-switch i {
- background-color: #fff;
- }
- .layui-form-onswitch {
- border-color: #5FB878;
- background-color: #5FB878;
- }
- .authInp {
- width: 100%;
- }
- /* 在线、所属公司筛选框 */
- .iptScreen {
- width: 75%;
- }
- .layui-input-block {
- margin-left: 0;
- }
- .input-group-btnA {
- display: inline-block;
- }
- </style>
- <body>
- <div class="content">
- <div class="row">
- <!-- 左菜单 -->
- <div class="col-xs-12 col-sm-3 col-md-2">
- <div class="input-group">
- <input type="text" class="form-control" id="searchImei" name="searchImei" placeholder="输入编号或名称查询">
- <div class="input-group-btn">
- <button type="button" id="searchBtn" class="btn btn-default no-border btn-sm">
- <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
- </button>
- </div>
- </div>
- <!-- 下拉框 -->
- <!-- 在线状态 -->
- {% if role == "superuser" %}
- <div class="layui-input-block">
- <p class="">在线状态:</p>
- <select name="status" lay-verify="required" id="selectId" class="iptScreen">
- <option value="" selected>全部</option>
- <option value="0">离线</option>
- <option value="1">在线</option>
- </select>
- <div class="input-group-btnA">
- <button type="button" id="searchBtnA" class="btn btn-default no-border btn-sm">
- <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
- </button>
- </div>
- </div>
- <!-- 所属公司 -->
- <div class="layui-input-block">
- <p class="">所属公司:</p>
- <select name="company" lay-verify="required" id="selectIdA" class="iptScreen">
- <option value="" selected>全部</option>
- <option value="15">云飞</option>
- <option value="8">新普惠</option>
- </select>
- <div class="input-group-btnA">
- <button type="button" id="searchBtnB" class="btn btn-default no-border btn-sm">
- <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
- </button>
- </div>
- </div>
- {% endif %}
- <div id="firstpane" class="menu_list">
- <p class="menu_head current" id="area_322">设备列表</p>
- <div class="menu_body">
- <!-- <a href="javascript:;" title="设备15112501" class="text-overflow" id="15112501" data-pid="322">设备15112501</a> -->
- </div>
- <div class="equipPage">
- <!-- <button class="btn btn-minier btn-yellow"><i class="fa fa-sort-up" aria-hidden="true"></i></button> -->
- <input type="button" class="btn btn-minier btn-yellow" onclick="gotofirstpage()" value="首页">
- <button class="btn btn-minier btn-yellow" id="jianPage"
- onclick="changePage('jian')">上一页</button>
- 第
- <span id="currentpage">1</span>页
- <button class="btn btn-minier btn-yellow" id="addPage" onclick="changePage('add')">下一页</button>
- 共<span id="totelpage">4</span>页
- </div>
- <div class="equipPage">
- 跳转 <input type="text" id="jumpPage" value="1"
- style="width: 60px;height: 30px;text-align: center;"
- onkeypress="if (event.keyCode == 13) changePage('jump');"> 页
- <button class="btn btn-minier btn-yellow" id="jianPage" onclick="changePage('jump')">确定</button>
- </div>
- </div>
- <div class="">
- <div class="widget-box" style="margin-top: 20px;">
- <div class="widget-title">
- <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
- <h5>项目信息</h5>
- </div>
- </div>
- <div class="widget-content" style="padding: 0px;margin-top: 8px;">
- <div>
- <!-- <img src="www.yfzhwlw.com/qxz_photo/default.png" class="equip_photo" width="100%" height="100%" style=""> -->
- <form action="" method="post" id="userPhoto" class="form-horizontal"
- enctype="multipart/form-data">{% csrf_token %}
- <input type="hidden" value="" id="qxzPhotoId" name="id">
- <div class="personal-avatar">
- <div class="top-avatar" id="viewPhotoParent">
- <img id="viewPhoto" class="equip_photo" onclick="$('#uploadPhoto').click()"
- src="" width="100%" height="100%">
- </div>
- <a class="upload-avatar" href="javascript:;">
- <input class="upload-btn" name="upicture"
- onchange="previewImage(this,'viewPhotoParent','viewPhoto','uploadPhoto','100%',200)"
- type="file" id="uploadPhoto">
- </a>
- <!-- <input type="hidden" name="req" value="photo"> -->
- </div>
- </form>
- </div>
- <div class="todo" style="background: white;margin-top: 5px;" id="qxzInfoDiv">
- <ul>
- <li class="clearfix">
- <div class="txt equip_name"> 项目名称:设备15112501</div>
- </li>
- <li class="clearfix">
- <div class="txt equip_id"> 设备ID:15112501</div>
- </li>
- <li class="clearfix" id="isonline">
- <div class="txt"> 离线时间:15112501</div>
- </li>
- {% if role == "superuser" %}
- <li class="clearfix" id="dverData">
- <div class="txt"> 版本号:123456</div>
- </li>
- {% endif %}
- </ul>
- </div>
- </div>
- </div>
- </div>
- <!-- 右 -->
- <div class="col-xs-12 col-sm-9 col-md-10">
- <!-- 实时状态 -->
- <div class="currTimeStatus">
- <div class="widget-box" style="margin-top: 0px;">
- <div class="widget-title">
- <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
- <h5>实时状态</h5>
- <div class="equipInfo" id="equipInfo"> </div>
- {% if role == "superuser"%}
- <button class="btn btn-white btn-primary" id="lookHistory" onclick="lookHistory()"
- type="button">
- <i class="fa fa-history" aria-hidden="true"></i>
- </button>
- {% endif %}
- <div class="span5" id="equipCtrlDiv" style="float: right;">
- <button class="btn btn-white btn-primary" id="newDataRefresh" onclick="newDataRefresh()"
- type="button">
- <i class="fa fa-refresh" aria-hidden="true"></i>
- </button>
- <button class="btn btn-white btn-primary" id="setEleName" onclick="setEleName()"
- type="button">
- <i class="fa fa-cog" aria-hidden="true"></i>
- </button>
- <button class="btn btn-white btn-primary" id="setNotewarn" onclick="setNotewarn()"
- type="button">
- <i class="fa fa-envelope-o" aria-hidden="true"></i>
- </button>
- <button class="btn btn-white btn-primary" id="updataTime" type="button">2020-03-12
- 13:48:15</button>
- </div>
- <div style="float: right;margin-right:5px;" id="sinCodeInquire">
- <!-- <button class="btn btn-white btn-primary" onclick="inquireSim('89860403101970072488')" id="" type="button">流量查询</button> -->
- </div>
- {% if role == "superuser"%}
- <div style="float: right;margin-right:5px;" id="sinCodeInquire">
- <button class="btn btn-white btn-primary" onclick="delEquip()" id=""
- type="button">一键删除</button>
- </div>
- <div style="float: right;margin-right:5px;" id="sinCodeInquire">
- <button class="btn btn-white btn-primary" onclick="changeEquip()" id=""
- type="button">更换IP</button>
- </div>
- <div style="float: right;margin-right:5px;" id="sinCodeInquire">
- <button class="btn btn-white btn-primary" onclick="upgradeEquip()" id=""
- type="button">升级</button>
- </div>
- {% endif %}
- </div>
- </div>
- </div>
- <div class="body-content clearfix row" id="newStatusBox">
- <!-- <div class="dev col-xs-4 col-md-3 col-lg-2 bg_lb">
- <div class="left">
- <img class="img-dev" src="{% static '/img/switchBtnIcon.png' %}">
- </div>
- <div class="right">
- <div class="name">风速</div>
- <div class="data">
- <strong>
- <span style="font-size: 25px;">0.0</span>
- </strong>m/s</div>
- </div>
- </div> -->
- </div>
- <!-- 设备手动控制 -->
- <div id="ctrlBoxParentDiv">
- <div class="currTimeStatus">
- <div class="widget-box">
- <div class="widget-title">
- <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
- <h5>设备手动控制</h5>
- <button class="btn btn-white btn-primary qxzDownCtrl" onclick="qxzDownCtrlFun()">
- <i class="fa fa-refresh" aria-hidden="true"></i>
- </button>
- </div>
- </div>
- </div>
- <div class="row handCtrlBox" id="ctrlBox">
- <!-- <div class="col-xs-2">
- <div class="equipCtrl">
- <input type="hidden" value="1">
- <div>
- <span class="isonlineicon active"></span>
- 控制1
- </div>
- <div class="equipCtrlInp">
- <label>
- <input name="switch-field-1" checked class="ace ace-switch ace-switch-4 btn-rotate" type="checkbox">
- <span class="lbl"></span>
- </label>
- </div>
- </div>
- </div> -->
- </div>
- </div>
- <!-- 设备阈值控制 -->
- <div id="getthresholdDivParentDiv">
- <div class="currTimeStatus">
- <div class="widget-box" style="margin-top: 0px;">
- <div class="widget-title">
- <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
- <h5>设备阈值控制</h5>
- <button class="btn btn-white btn-primary qxzDownCtrl" id="" onclick="" type="button">
- <i class="fa fa-refresh" aria-hidden="true"></i>
- </button>
- </div>
- </div>
- </div>
- <div class="row" id="getthresholdDiv">
- <!-- <div class="col-xs-2 col-sm-3">
- <div class="thresholdCtrl">
- <div class="setthresholdBtn" onclick="setthresholdFun(this)">
- <i class="fa fa-cog setName" aria-hidden="true"></i>
- </div>
- <input type="hidden" class="currVal" value='{"JK":1,"eKey":1,"upper":700,"lower":300,"method":1}'>
- <div class="thresholdCtrlName">
- <p>开关1(e1)</p>
- </div>
- <div class="thresholdCtrlShowDiv">
- <div class="qxys">
- <div>
- <img src="{% static '/img/dev/icon_110.png' %}" alt="">
- </div>
- <div>雨量累计</div>
- </div>
- <div class="maxminNum">
- <p>最大值:
- <span>30</span>
- </p>
- <p>最小值:
- <span>10</span>
- </p>
- </div>
- </div>
- <div class="equipCtrlInp">
- <label>
- <input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">
- <span class="lbl"></span>
- </label>
- </div>
- </div>
- </div> -->
- </div>
- </div>
- <!-- 设备定时控制 -->
- <div id="timingDivParentDiv">
- <div class="currTimeStatus">
- <div class="widget-box" style="margin-top: 0px;">
- <div class="widget-title">
- <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
- <h5>设备定时控制</h5>
- <button class="btn btn-white btn-primary qxzDownCtrl" id="" onclick="" type="button">
- <i class="fa fa-refresh" aria-hidden="true"></i>
- </button>
- </div>
- </div>
- </div>
- <div class="row" id="gettimingDiv">
- <!-- <div class="col-xs-2 col-sm-3">
- <div class="thresholdCtrl">
- <div class="setthresholdBtn" onclick="timingOnOff(this)">
- <i class="fa fa-cog setName" aria-hidden="true"></i>
- </div>
- <input type="hidden" class="currVal" value='{"JK":1,"StartTime":12,"Duration":10}'>
- <div class="thresholdCtrlName">
- <p>开关1(e1)</p>
- </div>
- <div class="thresholdCtrlShowDiv">
- <div class="maxminNum">
- <p>起始时间:
- <span>12</span>
- 点
- </p>
- <p>工作时长:
- <span>10</span>
- 小时
- </p>
- </div>
- </div>
- <div class="equipCtrlInp">
- <label>
- <input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">
- <span class="lbl"></span>
- </label>
- </div>
- </div>
- </div> -->
- </div>
- </div>
- <!-- 24小时数据 -->
- <div id="data24Div">
- <div class="currTimeStatus">
- <div class="widget-box">
- <div class="widget-title">
- <h5>24小时数据</h5>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12 col-md-12 col-lg-9">
- <table id="newtable" class="table table-striped table-hover">
- <tr>
- <td>传感器通道</td>
- <td>通道名称</td>
- <td>最小值</td>
- <td>最小值时间</td>
- <td>最大值</td>
- <td>最大值时间</td>
- </tr>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- Modal -->
- <div id="Modal" class="model" style="display:none">
- <div>
- <form class="layui-form" action="" id="modelForm" lay-filter="formModel">
- <input type="hidden" value="" name="JK">
- <input type="hidden" value="" name="eKey">
- <div class="layui-form-item">
- <label class="layui-form-label">最大值</label>
- <div class="layui-input-inline">
- <input type="text" name="upper" id="upper" required lay-verify="required" placeholder="请输入最大值"
- autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">最小值</label>
- <div class="layui-input-inline">
- <input type="text" name="lower" required lay-verify="required" placeholder="请输入最小值"
- autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">规 则</label>
- <div class="layui-input-inline">
- <input type="radio" name="method" lay-filter="radioSwitch" value="1" title="程序一" checked="">
- <input type="radio" name="method" lay-filter="radioSwitch" value="0" title="程序二">
- </div>
- <div class="layui-form-mid layui-word-aux" id="hintDiv">低于下限
- <span>开启</span>,高于上限
- <span>关闭</span>
- </div>
- </div>
- </form>
- </div>
- </div>
- <!-- Modal2 -->
- <div id="timingOnOffModal" class="model" style="display:none">
- <div>
- <form class="layui-form" action="" id="modelForm" lay-filter="formModel">
- <input type="hidden" value="" name="JK">
- <div class="layui-form-item">
- <label class="layui-form-label">起始时间:</label>
- <div class="layui-input-inline">
- <input type="number" name="StartTime" id="starttime" required
- lay-verify="required|starttimeRegex" placeholder="请输入起始时间" autocomplete="off"
- class="layui-input">
- <!-- <select name="city" lay-verify="">
- <option value="">请选择一个城市</option>
- <option value="010">北京</option>
- <option value="021">上海</option>
- <option value="0571">杭州</option>
- </select>
- <select name="city" lay-verify="required">
- <option value=""></option>
- <option value="0">北京</option>
- <option value="1">上海</option>
- <option value="2">广州</option>
- <option value="3">深圳</option>
- <option value="4">杭州</option>
- </select> -->
- </div>
- <div class="layui-form-mid layui-word-aux">时间范围(0-23)</div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">工作时长:</label>
- <div class="layui-input-inline">
- <input type="number" name="Duration" id="Duration" required lay-verify="required|durationRegex"
- placeholder="请输入工作时长" autocomplete="off" class="layui-input">
- </div>
- <div class="layui-form-mid layui-word-aux">工作时长(1-24)</div>
- </div>
- </form>
- </div>
- </div>
- <!-- setEleName -->
- <div id="eleName" style="width:800px;display:none">
- <div style="width:95%;margin:0 auto;">
- <table class="layui-hide" id="eleTable" lay-filter="eleTable"></table>
- </div>
- </div>
- <!-- setNotewarn -->
- <div id="Notewarn" style="width:800px;display:none">
- <div style="width:95%;margin:10px auto;">
- <div>
- <span>预警手机号:<input type="text" name="" id="alarmPhone"></span>
- <button class="btn btn-sm btn-primary" onclick="sendNoteMsg()">确定</button>
- </div>
- <table class="layui-hide" id="NotewarnTable" lay-filter="NotewarnTable"></table>
- </div>
- </div>
- <!-- 管理员查看设备电压历史记录 -->
- <div id="record" style="display: none;">
- <div style="padding: 20px;width: 500px;">
- <table id="recordTable" lay-filter="recordTableFilter"></table>
- <div id="recordPage"></div>
- </div>
- </div>
- {% verbatim %}
- <script type="text/html" id="switchTpl">
- <!-- 这里的 checked 的状态只是演示 -->
- <input type="checkbox" name="equipType" value="{{d.type}}" lay-skin="switch" lay-text="大于|小于"
- lay-filter="equipTypeDemo" {{ d.type == 1 ? 'checked' : '' }}>
- </script>
- {% endverbatim %}
- <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 src="{% static '/js/common.js' %}?versions=0.5.0"></script>
- <script type="text/javascript"
- src="http://api.map.baidu.com/api?v=2.0&ak=TcRPmrsiZUqdUBWoELrUArRkCRC36KMx"></script>
- <script type="text/javascript">
- $.ajaxSetup({
- data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
- });
- </script>
- <script>
- //默认加载设备列表
- getEquipList(1, '');
- // 搜索
- $('#searchBtn').on('click', function () {
- getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- });
- $('#searchImei').on('keyup', function (event) {
- if (event.keyCode == 13) {
- getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- }
- })
- function getEquipList(page, filter, is_online, etype) {
- if (etype == undefined && is_online == undefined) {
- var etype = ''
- var is_online = ''
- }
- $.ajax({
- url: 'qxz_page',
- type: 'get',
- dataType: 'json',
- data: {
- page: page,
- f_id: filter,
- etype: etype, //所属公司
- is_online: is_online, //设备状态
- },
- beforeSend: function (XMLHttpRequest) {
- loadingFlag = layer.load();
- },
- success: function (data) {
- layer.close(loadingFlag);
- if (data.nums) {
- var html = '';
- var msg = data.ids
- var pagecount = Math.ceil(data.nums / 10);
- for (var i = 0; i < msg.length; i++) {
- if (msg[i].equip_name) {
- var equip_name = '设备:' + msg[i].equip_name;
- } else if (msg[i].equip_id.length == 15) {
- var equip_name = '设备:' + msg[i].equip_id.substring(msg[i].equip_id.length - 8);
- } else {
- var equip_name = '设备:' + msg[i].equip_id;
- }
- var offTime = msg[i].off_time || '';
- if (msg[i].is_online == 1) {
- var classStatic = 'bjgreen';
- } else if (msg[i].is_online == 0) {
- var classStatic = 'bjred';
- } else {
- var classStatic = '';
- }
- // var equip_name = msg[i].equip_name?'---设备名:'+msg[i].equip_name:'';
- html += '<a href="javascript:;" isonline="' + msg[i].is_online + '" offTime="' + offTime + '" title="设备' + msg[i].equip_id + '" class="text-overflow" id="' + msg[i].equip_id + '" name="' + msg[i].equip_name + '" data-pid="322"><span class="' + classStatic + '"></span>' + equip_name + '</a>'
- }
- $('#firstpane .menu_body').html(html);
- $('.equipPage').show();
- $('#totelpage').html(pagecount)
- // 菜单栏
- $("#firstpane .menu_body:eq(0) a:eq(0)").addClass('menu-active');
- $('.widget-content .equip_id').html('设备ID:' + msg[0].equip_id);
- $('.widget-content .equip_name').html('项目名称:' + (msg[0].equip_name || '设备' + msg[0].equip_id));
- $(".menu_body a").click(function () {
- $(".menu_head").removeClass("currAstive");
- $(".menu_body a").removeClass("menu-active");
- $(this).addClass("menu-active");
- $(this).parent().prev().addClass('currAstive');
- // 名称切换
- $('.widget-content .equip_id').html('设备ID:' + $(this).attr('id'));
- $('.widget-content .equip_name').html('项目名称:' + ($(this).attr('name') || '设备' + $(this).attr('id')));
- var facId = $(this).attr("id");
- var currisonline = $(this).attr("isonline");
- var curroffTime = $(this).attr("offTime");
- if (currisonline == 0) {
- $('#isonline').show();
- $('#isonline div').html('离线时间:' + curroffTime);
- } else {
- $('#isonline').hide();
- }
- if (facId && facId != null && facId != "") {
- loadProject(facId);
- loadQxzInfo(facId)
- // loadLEDScreen(facId);
- $('#qxzPhotoId').val(facId);
- }
- });
- loadProject(msg[0].equip_id);
- loadQxzInfo(msg[0].equip_id);
- if (msg[0].is_online == 0) {
- $('#isonline').show();
- $('#isonline div').html('离线时间:' + (msg[0].off_time || ''));
- } else {
- $('#isonline').hide();
- }
- // loadLEDScreen(msg[0].equip_id);
- $('#qxzPhotoId').val(msg[0].equip_id)
- } else {
- $('.equipPage').hide();
- var html = '<a href="javascript:;" class="text-overflow nulldata" data-pid="322">暂未设备</a>'
- $('#firstpane .menu_body').html(html);
- scrollBar()
- }
- },
- error: function (type) {
- layer.close(loadingFlag);
- }
- })
- }
- var nowledinfo;
- // 设备信息
- function loadQxzInfo(facId) {
- $.ajax({
- url: 'qxz_base_view',
- type: 'post',
- dataType: 'json',
- data: {
- imei: facId,
- },
- beforeSend: function (XMLHttpRequest) {
- loadingFlag = layer.load();
- },
- success: function (data) {
- layer.close(loadingFlag);
- if (data != "null") {
- renderQxzInfo(data);
- } else {
- $('#equipInfo').html("");
- $('#sinCodeInquire').html("");
- }
- if (data.dver == null) {
- $('#dverData').html('版本号: 暂无版本号')
- } else {
- $('#dverData').html(data.dver)
- }
- },
- error: function (type) {
- layer.close(loadingFlag);
- }
- })
- }
- // 获取位置
- var geoc = new BMap.Geocoder();
- function renderQxzInfo(data) {
- var pt = new BMap.Point(data.lng, data.lat);
- geoc.getLocation(pt, function (rs) {
- var addComp = rs.addressComponents;
- var area = '';
- if (addComp.province) {
- area += addComp.province;
- }
- if (addComp.city) {
- area += ',' + addComp.city;
- }
- if (addComp.district) {
- area += ',' + addComp.district;
- }
- if (addComp.street) {
- area += ',' + addComp.street;
- }
- if (addComp.streetNumber) {
- area += ',' + addComp.streetNumber;
- }
- $('#qxzArea').html(area);
- var html = "电压:" + data.volt + " 信号强度:" + data.rssi + " 地址:" + area;
- $('#equipInfo').html(html);
- $('#sinCodeInquire').html("");
- var btn = '<button class="btn btn-white btn-primary" onclick="inquireSim(\'' + data.iccid + '\')" id="" type="button">流量查询</button>';
- $('#sinCodeInquire').html(btn);
- });
- }
- // 查询SIM卡
- function inquireSim(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) {
- 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 //不显示标题栏
- , skin: 'layui-layer-simCode' //样式类名
- , closeBtn: false
- , area: '300px;'
- , shade: 0.8
- , id: 'simCode' //设定一个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(data.msg);
- }
- }
- })
- }
- //删除设备
- function delEquip() {
- var id = $('#firstpane .menu-active').attr('id');
- layer.confirm('<strong style="color:red">是否删除此设备?<span style="font-size:18px">此操作不可逆</span></strong>', { icon: 3, title: '警告' }, function (index) {
- $.ajax({
- url: 'qxz_delete',
- type: 'post',
- data: {
- imei: id
- },
- dataType: 'json',
- success: function (data) {
- if (data == 0) {
- layer.msg('删除成功', { icon: 1 })
- window.location.reload();
- } else {
- } layer.msg('删除失败', { icon: 2 })
- }
- })
- layer.close(index);
- });
- }
- //更换设备IP
- function changeEquip() {
- var _this = this
- var id = $('#firstpane .menu-active').attr('id');
- layer.confirm('<span>IP更换: </span> <input id="authInp" class="authInp" type="text" placeholder="必填"> <span>端口更换: </span> <input id="authInpA" class="authInp" type="text" placeholder="1883">', { title: '更换设备IP' }, function (index) {
- var data = $('#authInp').val() //IP值
- var dataA = $('#authInpA').val() //端口值
- if (data == '') {
- layer.msg('不能为空')
- } else {
- //port
- if (dataA == '') {
- var port = '1883'
- } else {
- var port = dataA
- }
- loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 15000 });
- var url = data
- $.ajax({
- url: 'qxz_switch',
- type: 'post',
- data: {
- 'req': 'ip',
- 'imei': id,
- 'url': url,
- 'port': port
- },
- success: function (data) {
- setTimeout(function () {
- layer.close(loadingFlag);
- layer.msg('更改成功')
- }, 3000)
- layer.close(index);
- },
- error: function (type) {
- layer.close(loadingFlag);
- $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- $(_this).attr('disabled', false);
- }
- })
- }
- });
- }
- //升级
- function upgradeEquip() {
- var _this = this
- var id = $('#firstpane .menu-active').attr('id');
- loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 15000 });
- $.ajax({
- url: 'qxz_switch',
- type: 'post',
- data: {
- 'req': 'update',
- 'imei': id,
- },
- success: function (data) {
- if (data == 0) {
- //成功
- layer.msg('升级成功', { icon: 1, shade: 0.01, shadeClose: false, time: 5000 })
- } else if (data == 1) {
- //失败
- layer.msg('升级失败', { icon: 2, shade: 0.01, shadeClose: false, time: 5000 })
- }
- },
- error: function (type) {
- layer.msg('升级失败', { icon: 2, shade: 0.01, shadeClose: false, time: 5000 })
- }
- })
- }
- //在线状态筛选
- $('#searchBtnA').on('click', function () {
- getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- })
- $('#status').on('keyup', function (event) {
- if (event.keyCode == 13) {
- getEquipList(1, 1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- }
- })
- //设备所属公司筛选
- $('#searchBtnB').on('click', function () {
- getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- })
- $('#status').on('keyup', function (event) {
- if (event.keyCode == 13) {
- getEquipList(1, 1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- }
- })
- // 查看历史状态信息
- function lookHistory(page) {
- var id = $('#firstpane .menu-active').attr('id');
- $.ajax({
- url: 'qxz_record',
- type: 'post',
- data: {
- 'imei': $('#qxzPhotoId').val(),
- 'page': 1,
- },
- dataType: "json",
- beforeSend: function () {
- loadFlage = layer.load();
- },
- complete: function () {
- // setTimeout(function () {
- layer.close(loadFlage);
- // }, 5000)
- },
- success: function (data) {
- layui.use(['laypage', 'layer', 'table'], function () {
- var laypage = layui.laypage;
- var layer = layui.layer;
- var table = layui.table;
- layer.open({
- title: '历史状态'
- , type: 1
- , offset: '100px'
- , area: "500px"
- , content: $('#record')
- , success: function (layero, index) {
- table.render({
- elem: '#recordTable'
- // ,height: 312
- , skin: 'line' //行边框风格
- , data: data.dat //数据接口
- , page: false //开启分页
- , cols: [[ //表头
- { field: 'volt', align: 'center', title: '电压' }
- , { field: 'rssi', align: 'center', title: '信号强度' }
- , { field: 'upl_time', align: 'center', title: '上报时间', minWidth: 200 }
- ]]
- });
- //执行一个laypage实例
- laypage.render({
- elem: 'recordPage' //注意,这里的 test1 是 ID,不用加 # 号
- , layout: ['prev', 'page', 'next', 'count', 'skip']
- , count: data.nums //数据总数,从服务端得到
- , jump: function (obj, first) {
- if (!first) {
- $.ajax({
- url: 'qxz_record',
- type: 'post',
- data: {
- 'imei': $('#qxzPhotoId').val(),
- 'page': obj.curr,
- },
- dataType: "json",
- beforeSend: function () {
- loadFlage = layer.load();
- },
- complete: function () {
- // setTimeout(function () {
- layer.close(loadFlage);
- // }, 5000)
- },
- success: function (data) {
- //首次不执行
- table.render({
- elem: '#recordTable'
- // ,height: 312
- , skin: 'line' //行边框风格
- , data: data.dat //数据接口
- , page: false //开启分页
- , cols: [[ //表头
- { field: 'volt', align: 'center', title: '电压' }
- , { field: 'rssi', align: 'center', title: '信号强度' }
- , { field: 'upl_time', align: 'center', title: '上报时间', minWidth: 200 }
- ]]
- });
- }
- })
- }
- }
- });
- }
- });
- });
- }
- })
- }
- //设备状态
- function loadProject(facId) {
- $.ajax({
- url: 'qxz_status',
- type: 'post',
- dataType: 'json',
- data: {
- e_id: facId,
- },
- beforeSend: function (XMLHttpRequest) {
- loadingFlag = layer.load();
- },
- success: function (data) {
- layer.close(loadingFlag);
- loadLEDScreen(data.led);
- nowledinfo = data.ledinfo
- // 实时状态
- newStatus('newStatusBox', data, facId);
- $('#updataTime').html(data.base.upl_time || '暂无上传数据');
- if (data.base.qxz_picture) {
- $('#viewPhoto').attr('src', 'http://120.27.222.26/' + data.base.qxz_picture);
- } else {
- $('#viewPhoto').attr('src', 'http://120.27.222.26/' + 'qxz_photo/default.jpg');
- }
- addCtrlBtn(data.qxz_switch, data.switch_name);
- if (data.qxz_switch && (data.qxz_switch.length != 2)) {
- $('#ctrlBoxParentDiv').show();
- $('#getthresholdDivParentDiv').show();
- $('#timingDivParentDiv').show();
- $('#data24Div').hide();
- gettimimgFun(data);
- getthresholdFun(data);
- scrollBar()
- } else { // 无开关显示24小时数据
- $('#ctrlBoxParentDiv').hide();
- $('#getthresholdDivParentDiv').hide();
- $('#timingDivParentDiv').hide();
- $('#data24Div').show();
- get24Data(facId)
- scrollBar()
- }
- },
- error: function (type) {
- layer.close(loadingFlag);
- }
- })
- }
- // 阈值请求
- function getthresholdFun(data) {
- if (data.auto_list.length > 2) {
- var switchData = eval('(' + data.auto_list + ')');
- var qxz_switch = eval('(' + data.qxz_switch + ')');
- // var qxz_list = data.new_data;
- if (data.switch_name.length > 2) {
- var switch_name = eval('(' + data.switch_name + ')');
- } else {
- var switch_name = [];
- }
- } else {
- var switchData = [];
- // var qxz_list = [];
- var switch_name = [];
- }
- if (switchData.length) {
- var html = '';
- for (var i = 0; i < switchData.length; i++) {
- if (switchData[i].JK != 255) {
- if (switchData[i].upper == 32767 || switchData[i].lower == 32767) {
- var check = false;
- } else {
- var check = true;
- }
- // 判断通道号
- if (!isNaN(switchData[i].eKey)) {
- var eknum = switchData[i].eKey + 1;
- var ek = 'e' + eknum;
- } else {
- var ek = switchData[i].eKey;
- }
- // 开关名
- if (switchData[i].JK == qxz_switch[i].JK) {
- if (switch_name.length > 2) {
- if (switch_name[i].name) {
- var name = switch_name[i].name;
- } else {
- var name = '开关' + qxz_switch[i].JK;
- }
- } else {
- var name = '开关' + qxz_switch[i].JK;
- }
- } else {
- var name = timingData[i].JK;
- }
- if (data.dat[ek]) {
- var eNum = data.dat[ek].split('#')[1];
- var txt = data.conf[ek].split('#')[0];
- html += '<div class="col-xs-6 col-sm-4"><div class="thresholdCtrl">' +
- '<div class="setthresholdBtn" onclick="setthresholdFun(this)">' +
- '<i class="fa fa-cog setName" aria-hidden="true"></i></div>' +
- '<input type="hidden" class="currVal" value=\'' + JSON.stringify(switchData[i]) + '\'>' +
- '<div class="thresholdCtrlName"><p>' + name + '(通道' + switchData[i].eKey + ')</p></div>' +
- '<div class="thresholdCtrlShowDiv"><div class="qxys"><div>' +
- '<img src="http://www.yfzhwlw.com/static/img/dev/icon_' + eNum + '.png" alt=""></div>' +
- '<div>' + txt + data.conf[ek].split('#')[1] + '</div></div><div class="maxminNum"><p>最大值:<span>' + switchData[i].upper + '</span></p>' +
- '<p>最小值:<span>' + switchData[i].lower + '</span></p></div></div><div class="equipCtrlInp">';
- if (check) {
- html += '<label><input name="switch-field-1" class="ace ace-switch ace-switch-6" checked="checked" type="checkbox">' +
- '<span class="lbl"></span></label></div></div></div>';
- } else {
- html += '<label><input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">' +
- '<span class="lbl"></span></label></div></div></div>';
- }
- }
- }
- if (i == switchData.length - 1) {
- if (html) {
- $('#getthresholdDiv').html(html)
- } else {
- $('#getthresholdDiv').html('<div style="text-align:center">空</div>')
- }
- }
- }
- } else {
- $('#getthresholdDiv').html('<div style="text-align:center">空</div>')
- }
- }
- // 定时请求
- function gettimimgFun(data) {
- var switch_name = data.switch_name;
- var qxz_switch = data.qxz_switch;
- if (data.timing_list.length) {
- var timingData = eval('(' + data.timing_list + ')');
- var qxz_switch = eval('(' + data.qxz_switch + ')');
- var qxz_list = data.qxz_list;
- if (switch_name.length > 2) {
- var switch_name = eval('(' + switch_name + ')');
- } else {
- var switch_name = [];
- }
- } else {
- var timingData = [];
- var qxz_list = [];
- var switch_name = [];
- }
- if (timingData.length) {
- var html = '';
- for (var i = 0; i < timingData.length; i++) {
- if (timingData[i].JK != 255) {
- if (timingData[i].Duration == 32767 || timingData[i].StartTime == 32767) {
- var check = false;
- var curCheckedVal = {
- JK: timingData[i].JK,
- StartTime: '--',
- Duration: '--'
- }
- var startTime = '--';
- var duration = '--';
- } else {
- var check = true;
- var curCheckedVal = {
- JK: timingData[i].JK,
- StartTime: timingData[i].StartTime,
- Duration: timingData[i].Duration
- }
- var startTime = timingData[i].StartTime;
- var duration = timingData[i].Duration;
- }
- if (timingData[i].JK == qxz_switch[i].JK) {
- if (switch_name.length > 2) {
- if (switch_name[i].name) {
- var name = switch_name[i].name;
- } else {
- var name = '开关' + qxz_switch[i].JK;
- }
- } else {
- var name = '开关' + qxz_switch[i].JK;
- }
- } else {
- var name = timingData[i].JK;
- }
- html += '<div class="col-xs-6 col-sm-4"><div class="thresholdCtrl">' +
- '<div class="setthresholdBtn" onclick="timingOnOff(this)">' +
- '<i class="fa fa-cog setName" aria-hidden="true"></i></div>' +
- '<input type="hidden" class="currVal" value=\'' + JSON.stringify(curCheckedVal) + '\'>' +
- '<div class="thresholdCtrlName"><p>' + name + '</p></div>' +
- '<div class="thresholdCtrlShowDiv"><div class="maxminNum">' +
- '<p>起始时间:<span>' + startTime + '</span>点</p><p>工作时长:<span>' + duration + '</span>小时</p>' +
- '</div></div><div class="equipCtrlInp"><label>';
- if (check) {
- html += '<input name="switch-field-1" checked class="ace ace-switch ace-switch-6" type="checkbox">' +
- '<span class="lbl"></span></label></div></div></div>';
- } else {
- html += '<input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">' +
- '<span class="lbl"></span></label></div></div></div>';
- }
- }
- if (i == timingData.length - 1) {
- if (html) {
- $('#gettimingDiv').html(html)
- } else {
- $('#gettimingDiv').html('<div style="text-align:center">空</div>')
- }
- }
- }
- } else {
- $('#gettimingDiv').html('<div style="text-align:center">空</div>')
- }
- }
- // 控制按钮
- function addCtrlBtn(data, switch_name) {
- if (data && switch_name.length > 2) {
- var data = eval('(' + data + ')');
- var ctrl_name = eval('(' + switch_name + ')');
- $('.qxzDownCtrl').show();
- } else if (data) {
- var data = eval('(' + data + ')');
- var ctrl_name = [];
- } else {
- var data = []
- $('.qxzDownCtrl').hide();
- }
- if (data.length) {
- var html = '';
- for (var i = 0; i < data.length; i++) {
- if (data[i].status == 0) {
- var curClass = '';
- } else {
- var curClass = 'active';
- }
- if (data[i].status == 0) {
- var curChecked = ''; //关
- } else {
- var curChecked = 'checked';
- }
- if (ctrl_name.length) {
- if (ctrl_name[i].name != '') {
- var switch_name = ctrl_name[i].name;
- } else {
- var switch_name = '开关' + ctrl_name[i].JK;
- }
- } else {
- var switch_name = '开关' + data[i].JK;
- }
- html += '<div class="col-xs-2"><div class="equipCtrl"><input type="hidden" class="currStutas" value="' + data[i].JK + '">' +
- '<i class="fa fa-cog setName" aria-hidden="true"></i><div><span class="isonlineicon ' + curClass + '"></span><span class="numName">' + switch_name + '</span></div><div class="equipCtrlInp">' +
- '<label><input name="switch-field-1" ' + curChecked + ' class="ace ace-switch ace-switch-4 btn-rotate" type="checkbox">' +
- '<span class="lbl"></span></label></div></div></div>';
- if (i == data.length - 1) {
- $('#ctrlBox').html(html);
- }
- }
- } else {
- $('#ctrlBox').html('<div style="text-align:center">空</div>');
- }
- }
- $('#ctrlBox').on('click', '.btn-rotate', function () {
- var _this = this;
- $(this).parents('.equipCtrl').find('.ctrlLoading').remove()
- $(this).attr('disabled', true);
- $(this).parents('.equipCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
- var currWay = $(this).parents('.equipCtrl').find('.currStutas').val();
- var imei = $('#qxzPhotoId').val();
- if ($(this).is(":checked")) {
- var oldStatus = 0;
- var currStutas = 1;
- } else {
- var oldStatus = 1;
- var currStutas = 0;
- }
- $.ajax({
- url: 'qxz_switch',
- type: 'post',
- data: {
- 'req': 'set',
- 'imei': imei,
- 'way': currWay,
- 'switch': currStutas
- },
- success: function (data) {
- setTimeout(function () {
- var id = $('#firstpane .menu-active').attr('id')
- loadProject(id);
- }, 5000)
- // $(_this).attr('disabled', false);
- // $(_this).parents('.equipCtrl').find('.ctrlLoading').html('');
- // if (currStutas) {
- // $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
- // } else {
- // $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
- // }
- },
- error: function (type) {
- layer.close(loadingFlag);
- $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- $(_this).attr('disabled', false);
- if (oldStatus) {
- $(_this).prop('checked', true);
- $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
- } else {
- $(_this).prop('checked', '');
- $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
- }
- }
- })
- })
- // 下发控制名称
- $('#ctrlBox').on('click', '.setName', function () {
- var _this = this;
- var ele = $(this).parents('.equipCtrl').find('.numName');
- var currWay = $(this).parents('.equipCtrl').find('.currStutas').val();
- layui.use('layer', function () {
- var layer = layui.layer;
- layer.prompt({ title: '自定义名称', offset: '300px', formType: 0, value: ele.html(), maxlength: 10 }, function (text, index) {
- if (text == ele.html()) {
- return false;
- layer.close(index);
- layer.msg('演示完毕!您的口令:' + text);
- ele.html(text)
- }
- $.ajax({
- url: 'qxz_switch_name',
- type: 'post',
- data: {
- 'imei': $('#qxzPhotoId').val(),
- 'way': currWay,
- 'sw_name': text
- },
- success: function (data) {
- if (data == 0) {
- ele.html(text)
- }
- layer.close(index);
- },
- error: function (type) {
- $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- $(_this).attr('disabled', false);
- if (oldStatus) {
- $(_this).prop('checked', true);
- $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
- } else {
- $(_this).prop('checked', '');
- $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
- }
- }
- })
- });
- });
- })
- // 获取最新控制按钮状态
- function qxzDownCtrlFun() {
- $.ajax({
- url: 'qxz_switch',
- type: 'post',
- data: {
- 'req': 'conf', //
- 'imei': $('#qxzPhotoId').val(),
- },
- beforeSend: function () {
- loadFlage = layer.load();
- },
- complete: function () {
- setTimeout(function () {
- layer.close(loadFlage);
- }, 5000)
- },
- success: function (data) {
- setTimeout(function () {
- loadProject($('#qxzPhotoId').val())
- }, 5000)
- }
- })
- }
- // 获取最新数据
- function newDataRefresh() {
- $.ajax({
- url: 'qxz_switch',
- type: 'post',
- data: {
- 'req': 'read',
- 'imei': $('#qxzPhotoId').val(),
- },
- beforeSend: function () {
- loadFlage = layer.load();
- },
- complete: function () {
- setTimeout(function () {
- layer.close(loadFlage);
- }, 5000)
- },
- success: function (data) {
- setTimeout(function () {
- loadProject($('#qxzPhotoId').val())
- }, 5000)
- }
- })
- }
- // 设备列表
- var currpage = 1;
- function changePage(symbol) {
- var totelpage = Number($('#totelpage').html());
- if (symbol == 'add') {
- if (currpage < totelpage) {
- currpage++;
- $('#currentpage').html(currpage);
- $('#jumpPage').val(currpage);
- $('addPage').attr('disable', 'false')
- } else {
- $('addPage').attr('disable', 'true')
- return false;
- }
- } else if (symbol == 'jian') {
- if (currpage > 1) {
- currpage--;
- $('#currentpage').html(currpage);
- $('#jumpPage').val(currpage);
- $('jianPage').attr('disable', 'false')
- } else {
- $('jianPage').attr('disable', 'true')
- return false;
- }
- } else if (symbol == 'jump') {
- var jumpPage = $('#jumpPage').val();
- if (jumpPage <= totelpage && jumpPage > 0) {
- currpage = jumpPage;
- } else if (jumpPage > totelpage) {
- currpage = totelpage;
- } else if (jumpPage < 0) {
- currpage = 1;
- }
- $('#jumpPage').val(currpage);
- $('#currentpage').html(currpage);
- }
- getEquipList(currpage, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
- }
- // 首页
- function gotofirstpage() {
- currpage = 1;
- $('#currentpage').html(1);
- $('#jumpPage').val(1);
- getEquipList(1, $('#searchImei').val())
- }
- // 定时刷新
- // msgInterval = setInterval(function () {
- // var currid = $('#firstpane .menu-active').attr('id');
- // loadProject(currid);
- // }, 60000);
- var waterTempId = [16062009, 16062010, 16062011, 16062012, 16062013, 16062014, 16062015, 16062016, 16062017, 16062018, 16062019, 16062020, 16062021, 16062022, 16062023, 16062024, 16062025];
- // 实时状态
- function newStatus(statusBox, data, facId) {
- var dat = data.dat;
- var html = '';
- $(document.getElementById(statusBox)).html('');
- var random = ['bg_lb', 'bg_ly', 'bg_ls', 'bg_lg', 'bg_lo', 'bg_lr']; //颜色随机
- if (Object.keys(dat).length) {
- for (var i = 1; i < 31; i++) {
- var ekeyNum = 'e' + i;
- if (dat[ekeyNum] != '' && (parseInt(dat[ekeyNum].split('#')[1]) != 163)) {
- if (dat[ekeyNum].split('#')[0] == -99.99) {
- var eVal = 'N/A';
- } else {
- var eVal = dat[ekeyNum].split('#')[0];
- }
- var eNum = dat[ekeyNum].split('#')[1];
- var ekey = dat[ekeyNum].split('#')[2];
- var colorClass = eNum % 4;
- // if(Object.keys(data.conf).length){
- var eTxtUnit = data.conf[ekeyNum].split('#')[0];
- var eUnit = data.conf[ekeyNum].split('#')[1];
- // }
- html += '<div class=" col-xs-4 col-md-3 col-lg-2"><div class="dev ' + random[colorClass] + '"><div class="left">' +
- '<img class="img-dev" src="/static/img/dev/icon_' + eNum + '.png">' +
- '</div><div class="right"><div class="name">' + eTxtUnit + '</div>' +
- '<div class="data"><strong><span style="font-size: 25px;">' + eVal + '</span>' +
- '</strong>' + eUnit + '</div></div><div class="aisle">通道' + ekey.substr(1) + '</div></div></div>';
- }
- }
- }
- if (html) {
- $(document.getElementById(statusBox)).append(html);
- } else {
- html = '<div style="text-align:center">空</div>';
- $(document.getElementById(statusBox)).append(html);
- // $('.widget-content .equip_name').html('');
- // var id = $('#firstpane .menu-active').attr('id')
- // $('.widget-content .equip_id').html('设备ID:' + id);
- // $('#viewPhoto').attr('src', 'qxz_photo/default.jpg');
- // scrollBar()
- }
- scrollBar()
- }
- // 24小时数据
- function get24Data(facId) {
- $.ajax({
- url: 'qxz_day_data',
- type: 'post',
- dataType: 'json',
- data: {
- e_id: facId,
- },
- beforeSend: function (XMLHttpRequest) {
- loadingFlag = layer.load();
- },
- success: function (data) {
- layer.close(loadingFlag);
- $("#newtable tr:not(:first)").remove();
- if (data.data.length) {
- Fill_Table('newtable', data, facId)
- } else {
- Fill_null_Table('newtable', data, facId)
- }
- },
- error: function (type) {
- layer.close(loadingFlag);
- layer.msg('请求失败');
- $("#newtable tr:not(:first)").remove();
- }
- })
- }
- function Fill_Table(table_id, data, facId) {
- var dat = data.data;
- //js循环读取json数据
- var table = document.getElementById(table_id).children[1];
- for (var i = 0; i < dat.length; i++) {
- var row = table.insertRow(table.rows.length);
- var c1 = row.insertCell(0);
- c1.innerHTML = dat[i].ekey;
- var c2 = row.insertCell(1);
- var eNum = dat[i].enum
- var elementName = data.conf[dat[i].ekey].split('#');
- c2.innerHTML = elementName[0] + '(' + elementName[1] + ')';
- var c3 = row.insertCell(2);
- if (dat[i].min == -99.99) {
- c3.innerHTML = 'N/A';
- } else {
- c3.innerHTML = dat[i].min;
- }
- var c4 = row.insertCell(3);
- var min_time = dat[i].mintime;
- c4.innerHTML = min_time;
- var c5 = row.insertCell(4);
- if (dat[i].max == -99.99) {
- c5.innerHTML = 'N/A';
- } else {
- c5.innerHTML = dat[i].max;
- }
- var c6 = row.insertCell(5);
- var max_time = dat[i].maxtime;
- c6.innerHTML = max_time;
- if (i == dat.length - 1) {
- scrollBar()
- }
- }
- }
- function Fill_null_Table(table_id) {
- var table = document.getElementById(table_id).children[1];
- var row = table.insertRow(table.rows.length);
- var c1 = row.insertCell(0);
- c1.setAttribute('colspan', '16');
- c1.setAttribute('class', 'nullData');
- c1.innerHTML = "暂无数据";
- scrollBar()
- }
- window.onresize = function () {
- scrollBar()
- }
- // file 文件
- // divId div id
- // imgId 图片id
- // fileId 文件id
- // width 图片宽
- // height 图片高
- function previewImage(file, divId, imgId, fileId, width, height) {
- width = $('#viewPhotoParent').width();
- var div = document.getElementById(divId);
- if (file.files && file.files[0]) {
- if (file.files[0].size / 1024 / 1024 < 4) {
- sendUserPhoto();
- div.innerHTML = '<img id=' + imgId + ' onclick=$("#' + fileId + '").click()>';
- var img = document.getElementById(imgId);
- img.onload = function () {
- // var rect = clacImgZoomParam(width, height, img.offsetWidth, img.offsetHeight);
- img.width = width;
- img.height = height;
- // img.style.marginTop = rect.top+'px';
- }
- var reader = new FileReader();
- reader.onload = function (evt) {
- img.src = evt.target.result;
- // $(window.parent.document).find('.nav-user-photo').attr('src',evt.target.result);
- }
- reader.readAsDataURL(file.files[0]);
- // $('#userPhoto').submit();
- } else {
- $(file).val('');
- layer.alert("图片过大!");
- }
- } else {//兼容IE
- var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
- file.select();
- if (document.selection != undefined) {
- var src = document.selection.createRange().text;
- div.innerHTML = '<img id=' + imgId + '>';
- var img = document.getElementById(imgId);
- img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
- var rect = clacImgZoomParam(width, height, img.offsetWidth, img.offsetHeight);
- status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
- div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;" + sFilter + src + "\"'></div>";
- }
- }
- }
- function clacImgZoomParam(maxWidth, maxHeight, width, height) {
- var param = { top: 0, left: 0, width: width, height: height };
- if (width > maxWidth || height > maxHeight) {
- var rateWidth = width / maxWidth;
- var rateHeight = height / maxHeight;
- if (rateWidth > rateHeight) {
- param.width = maxWidth;
- param.height = Math.round(height / rateWidth);
- } else {
- param.width = Math.round(width / rateHeight);
- param.height = maxHeight;
- }
- }
- param.left = Math.round((maxWidth - param.width) / 2);
- param.top = Math.round((maxHeight - param.height) / 2);
- return param;
- }
- // 上传图片
- function sendUserPhoto() {
- var formData = new FormData($("#userPhoto")[0]);
- $.ajax({
- url: 'qxz_photo',
- type: 'POST',
- data: formData,
- contentType: false,
- processData: false,
- success: function (data) {
- if (data == 0) {
- $(window.parent.document).find('.nav-user-photo').attr('src', $('#viewPhoto').prop('src'));
- $('#uploadPhoto').val('');
- }
- else { layer.msg("上传失败!"); return false; }
- }
- });
- }
- // 设置阈值
- function setthresholdFun(ele) {
- var obj = $(ele);
- var currValstr = obj.next().val();
- var currVal = eval('(' + currValstr + ')');
- layui.use(['layer', 'form'], function () {
- var rule0 = "低于下限<span>开启</span>,高于上限<span>关闭</span>";
- var rule1 = "低于下限<span>关闭</span>,高于上限<span>开启</span>";
- var layer = layui.layer;
- var form = layui.form;
- //给表单赋值
- form.val("formModel", {
- "JK": currVal.JK
- , "eKey": currVal.eKey
- , "upper": currVal.upper
- , "lower": currVal.lower
- , "method": currVal.method
- });
- if (currVal.method == 1) {
- $('#hintDiv').html(rule1)
- } else {
- $('#hintDiv').html(rule0)
- }
- form.on('radio(radioSwitch)', function (data) {
- if (data.value == 1) {
- $('#hintDiv').html(rule1)
- } else {
- $('#hintDiv').html(rule0)
- }
- });
- layer.open({
- type: 1,
- title: '阈值设置',
- offset: '380px',
- btn: ['确定', '取消'],
- area: ['600px', '300px'], //宽高
- content: $('#Modal'),
- success: function (layero, index) { // 成功弹出后回调
- // 添加form标识
- layero.addClass('layui-form');
- // 将保存按钮改变成提交按钮
- layero.find('.layui-layer-btn0').attr({
- 'lay-filter': 'setYuzhi',
- 'lay-submit': ''
- });
- },
- yes: function (index, layero) {
- form.on('submit(setYuzhi)', function (data) {
- var dat = data.field;
- if (parseInt(data.field.upper) < parseInt(data.field.lower)) {
- layer.tips('最大值不能小于最小值!', $('#upper'));
- return false;
- }
- var hideVal = JSON.stringify(data.field)
- var id = $('#firstpane .menu-active').attr('id')
- data.field.equip_id = id;
- var curinputBtn = obj.parent().find('.ace-switch');
- if (curinputBtn.is(":checked")) {
- var oldStatus = 0;
- var currStutas = 1;
- } else {
- var oldStatus = 1;
- var currStutas = 0;
- }
- obj.parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
- $.ajax({
- url: 'qxz_value_mqtt',
- type: 'post',
- data: data.field,
- success: function (data) {
- setTimeout(function () {
- curinputBtn.attr('disabled', false);
- curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('');
- obj.parent().find('.maxminNum').find('p').eq(0).find('span').html(dat.upper)//最大值
- obj.parent().find('.maxminNum').find('p').eq(1).find('span').html(dat.lower)//最小值
- obj.parents('.thresholdCtrl').find('.ace-switch').prop('checked', 'checked');//开启阈值
- var id = $('#firstpane .menu-active').attr('id')
- loadProject(id);
- }, 5000)
- },
- error: function (type) {
- curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- curinputBtn.attr('disabled', false);
- }
- })
- // $('.maxminNum')
- layer.closeAll(); //疯狂模式,关闭所有层
- return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
- });
- }
- , btn2: function (index, layero) {
- $('#Modal').hide()
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- });
- }
- // 下发阈值控制
- $('#getthresholdDiv').on('click', '.ace-switch', function () {
- var _this = this;
- $(this).parents('.thresholdCtrl').find('.ctrlLoading').remove()
- $(this).attr('disabled', true);
- $(this).parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
- var currVal = $(this).parents('.thresholdCtrl').find('.currVal').val();
- var currWayjson = JSON.parse(currVal);
- var id = $('#firstpane .menu-active').attr('id')
- currWayjson.equip_id = id;
- if ($(this).is(":checked")) { //开启
- var oldStatus = 0;
- var currStutas = 1;
- } else { //关闭
- var oldStatus = 1;
- var currStutas = 0;
- currWayjson.upper = '32767';
- currWayjson.lower = '32767';
- }
- $.ajax({
- url: 'qxz_value_mqtt',
- type: 'post',
- data: currWayjson,
- success: function (data) {
- setTimeout(function () {
- $(_this).attr('disabled', false);
- $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('');
- var id = $('#firstpane .menu-active').attr('id')
- loadProject(id);
- }, 5000)
- },
- error: function (type) {
- $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- $(_this).attr('disabled', false);
- if (oldStatus) {
- $(_this).prop('checked', true);
- } else {
- $(_this).prop('checked', '');
- }
- }
- })
- })
- // 定时开关
- function timingOnOff(ele) {
- var obj = $(ele);
- var currValstr = obj.next().val();
- var currVal = eval('(' + currValstr + ')');
- layui.use(['layer', 'form'], function () {
- var layer = layui.layer;
- var form = layui.form;
- form.verify({
- starttimeRegex: function (value, item) { //value:表单的值、item:表单的DOM对象
- if (value < 0 || value > 23) {
- return '请输入范围内数值';
- }
- },
- durationRegex: function (value, item) { //value:表单的值、item:表单的DOM对象
- if (value < 1 || value > 24) {
- return '请输入范围内数值';
- }
- }
- });
- //给表单赋值
- form.val("formModel", {
- "JK": currVal.JK
- , "StartTime": currVal.StartTime
- , "Duration": currVal.Duration
- });
- layer.open({
- type: 1,
- title: '阈值设置',
- offset: '380px',
- btn: ['确定', '取消'],
- area: ['600px', '300px'], //宽高
- content: $('#timingOnOffModal'),
- success: function (layero, index) { // 成功弹出后回调
- // 添加form标识
- layero.addClass('layui-form');
- // 将保存按钮改变成提交按钮
- layero.find('.layui-layer-btn0').attr({
- 'lay-filter': 'setdingshi',
- 'lay-submit': ''
- });
- },
- yes: function (index, layero) {
- form.on('submit(setdingshi)', function (data) {
- var hideVal = JSON.stringify(data.field)
- var dat = data.field;
- var curinputBtn = obj.parent().find('.ace-switch');
- if (curinputBtn.is(":checked")) {
- var oldStatus = 0;
- var currStutas = 1;
- } else {
- var oldStatus = 1;
- var currStutas = 0;
- }
- var id = $('#firstpane .menu-active').attr('id')
- dat.equip_id = id;
- obj.parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
- $.ajax({
- url: 'qxz_timing_mqtt',
- type: 'post',
- data: dat,
- success: function (data) {
- setTimeout(function () {
- obj.next().val(hideVal)
- curinputBtn.attr('disabled', false);
- curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('');
- obj.parent().find('.maxminNum').find('p').eq(0).find('span').html(dat.StartTime)//最大值
- obj.parent().find('.maxminNum').find('p').eq(1).find('span').html(dat.Duration)//最小值
- obj.parents('.thresholdCtrl').find('.ace-switch').prop('checked', 'checked');//开启阈值
- var id = $('#firstpane .menu-active').attr('id')
- loadProject(id);
- }, 5000)
- },
- error: function (type) {
- curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- curinputBtn.attr('disabled', false);
- }
- })
- // $('.maxminNum')
- layer.closeAll(); //疯狂模式,关闭所有层
- return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
- });
- }
- , btn2: function (index, layero) {
- $('#Modal').hide()
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- });
- }
- $('#starttime').on('blur', function () {
- $(this).val(parseInt($(this).val()))
- })
- $('#Duration').on('blur', function () {
- $(this).val(parseInt($(this).val()))
- })
- // 下发定时开关
- $('#gettimingDiv').on('click', '.ace-switch', function () {
- var _this = this;
- var currVal = $(this).parents('.thresholdCtrl').find('.currVal').val();
- var currWayjson = JSON.parse(currVal);
- var id = $('#firstpane .menu-active').attr('id')
- currWayjson.equip_id = id;
- if (currWayjson.StartTime == '--' || currWayjson.Duration == '--') {
- $(this).parents('.thresholdCtrl').find('.setthresholdBtn').click();
- layer.msg('请先设置定时时间', { icon: 2 })
- return false;
- }
- $(this).parents('.thresholdCtrl').find('.ctrlLoading').remove()
- $(this).attr('disabled', true);
- $(this).parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
- if ($(this).is(":checked")) { //开启
- var oldStatus = 0;
- var currStutas = 1;
- } else { //关闭
- var oldStatus = 1;
- var currStutas = 0;
- currWayjson.StartTime = '255';
- currWayjson.Duration = '32767';
- }
- $.ajax({
- url: 'qxz_timing_mqtt',
- type: 'post',
- data: currWayjson,
- success: function (data) {
- setTimeout(function () {
- $(_this).attr('disabled', false);
- $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('');
- var id = $('#firstpane .menu-active').attr('id')
- loadProject(id);
- }, 5000)
- },
- error: function (type) {
- $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
- $(_this).attr('disabled', false);
- if (oldStatus) {
- $(_this).prop('checked', true);
- } else {
- $(_this).prop('checked', '');
- }
- }
- })
- })
- // 设置要素名称
- function setEleName() {
- var e_id = $('#firstpane .menu-active').attr('id')
- $.ajax({
- url: 'qxz_title_conf',
- type: 'get',
- data: {
- e_id: e_id
- },
- dataType: 'json',
- success: function (data) {
- var dataa = [];
- var len = Object.keys(data.default).length;
- for (var i = 1; i <= len; i++) {
- var key = 'e' + i;
- if (data.default[key]) {
- var detxt = data.default[key].split('#')[0];
- var deunit = data.default[key].split('#')[1];
- if (data.conf[key]) {
- var conftxt = data.conf[key].split('#')[0];
- } else {
- var conftxt = '-';
- }
- dataa.push({
- "ekey": key,
- "name": conftxt,
- "elementName": detxt,
- "unit": deunit
- })
- }
- if (i == len) {
- // console.log(dataa)
- //页面层
- layer.open({
- type: 1,
- title: '修改要素名称',
- area: ['800px', '540px'], //宽高
- content: $('#eleName'),
- skin: 'layui-layer-editName', //样式类名
- success: function (layero, index) {
- layui.use('table', function () {
- var table = layui.table;
- table.render({
- elem: '#eleTable'
- , data: dataa
- , done: function (res, curr, count) {
- $("table").css("width", "100%");
- }
- , limit: 30
- , cols: [[
- { field: 'ekey', width: '25%', align: 'center', title: '通道号' }
- , { field: 'name', width: '35%', align: 'center', title: '<i class="layui-icon"></i>名称', event: 'cellClick' }
- , { field: 'elementName', width: '40%', align: 'center', title: '要素' }
- ]]
- });
- table.on('tool(eleTable)', function (obj) {
- switch (obj.event) {
- case 'cellClick':
- CellClick(this, obj, e_id);
- break;
- };
- });
- });
- },
- cancel: function (index, layero) {
- loadProject(e_id);
- }
- });
- }
- }
- },
- error: function (type) {
- layer.msg('请求失败');
- }
- })
- }
- // 设置要素短信预警
- var datMsg, editNum = 0;
- function setNotewarn() {
- var e_id = $('#firstpane .menu-active').attr('id')
- $.ajax({
- url: 'qxz_alarm',
- type: 'post',
- data: {
- imei: e_id
- },
- dataType: 'json',
- success: function (data) {
- var dataa = [];
- var len = Object.keys(data.conf).length;
- if (data.alarm) {
- var alarmJson = eval('(' + data.alarm + ')');
- $('#alarmPhone').val(alarmJson.tel)
- } else {
- var alarmJson = {}
- $('#alarmPhone').val('')
- }
- for (var i = 1; i <= len; i++) {
- var key = 'e' + i;
- if (data.conf[key]) {
- var conftxt = data.conf[key].split('#')[0];
- if (alarmJson.dat) {
- if (alarmJson.dat[key]) {
- var type = alarmJson.dat[key].split('#')[0];
- var alarmVal = alarmJson.dat[key].split('#')[1];
- } else {
- var type = 0;
- var alarmVal = '';
- }
- }
- dataa.push({
- "ekey": key,
- "name": conftxt,
- "type": type,
- "alarmVal": alarmVal
- })
- }
- if (i == len) {
- // console.log(dataa)
- //页面层
- layer.open({
- type: 1,
- title: '修改要素名称',
- area: ['800px', '540px'], //宽高
- content: $('#Notewarn'),
- skin: 'layui-layer-editName', //样式类名
- success: function (layero, index) {
- layui.use(['table', 'form'], function () {
- var table = layui.table;
- var form = layui.form;
- datMsg = dataa;
- table.render({
- elem: '#NotewarnTable'
- , data: dataa
- , done: function (res, curr, count) {
- $("table").css("width", "100%");
- }
- , limit: 30
- , cols: [[
- { field: 'ekey', width: '15%', align: 'center', title: '通道号' }
- , { field: 'name', width: '30%', align: 'center', title: '要素' }
- , { field: 'type', title: '类型', width: '20%', align: 'center', templet: '#switchTpl', unresize: true }
- , { field: 'alarmVal', width: '35%', align: 'center', title: '<i class="layui-icon"></i>阈值', event: 'cellClick' }
- ]]
- });
- table.on('tool(NotewarnTable)', function (obj) {
- switch (obj.event) {
- case 'cellClick':
- thresholdClick(this, obj, e_id, form);
- break;
- };
- });
- });
- },
- cancel: function (index, layero) {
- loadProject(e_id);
- }
- });
- }
- }
- },
- error: function (type) {
- layer.msg('请求失败');
- }
- })
- }
- layui.use(['form'], function () {
- var form = layui.form;
- form.on('switch(equipTypeDemo)', function (obj) {
- var state = obj.elem.checked ? 1 : 0;
- //方法二取数据 (根据索引table.cache里面的行数据)
- var index = obj.othis.parents('tr').attr("data-index");
- datMsg[index].type = state;
- });
- })
- function CellClick(that, obj, e_id) {
- //当前点击字段
- var field = $(that).data("field");
- //判断是否需要添加编辑框
- if (field == "edit") return true;
- //当前行数据
- var data = obj.data;
- //当前单元格的值
- var value = data[field];
- //当前点击td的宽高
- var height = $(that)[0].offsetHeight, width = $(that)[0].offsetWidth;
- //当前点击td的坐标
- var top = $(that).offset().top, left = $(that).offset().left;
- //输入框 这里可以自定义表单内容
- var input = '<input type="text" maxlength=10 class="layui-input" id="' + field + '_input" data-field="' + field + '" style="width:' + width + 'px;height:' + height + 'px">';
- //弹出层
- layer.open({
- type: 1
- , title: false
- , page: true
- , limit: 1
- , closeBtn: 0
- , area: [width + "px", height + "px"]
- , shade: [0.01, '#fff']
- , shadeClose: true
- , content: input //这里content是一个普通的String
- , offset: [top, left]
- , success: function () {
- //使弹出层相对定位
- $(".layui-layer-page").css("position", "absolute")
- //设置输入框的值
- $("#" + field + "_input").val(value);
- $("#" + field + "_input").blur(function () {
- var dat = data;
- var ekey = dat.ekey;
- var conf = $(this).val();
- var unit = data.unit;
- $.ajax({
- url: 'qxz_title_conf',
- type: 'post',
- data: {
- e_id: e_id,
- ekey: ekey,
- conf: conf + '#' + unit
- },
- dataType: 'json',
- success: function (data) {
- if (data == 0) {
- //同步更新缓存对应的值
- dat[field] = conf;
- obj.update(dat);
- layer.msg('修改成功')
- }
- },
- error: function (type) {
- layer.msg('修改失败')
- }
- })
- })
- }
- });
- }
- function thresholdClick(that, obj, e_id, form) {
- //当前点击字段
- var field = $(that).data("field");
- // console.log(obj)
- //判断是否需要添加编辑框
- if (field == "edit") return true;
- //当前行数据
- var data = obj.data;
- //当前单元格的值
- var value = data[field];
- //当前点击td的宽高
- var height = $(that)[0].offsetHeight, width = $(that)[0].offsetWidth;
- //当前点击td的坐标
- var top = $(that).offset().top, left = $(that).offset().left;
- //输入框 这里可以自定义表单内容
- var input = '<input type="number" maxlength=10 autofocus="autofocus" class="layui-input" id="' + field + '_input" data-field="' + field + '" style="width:' + width + 'px;height:' + height + 'px">';
- //弹出层
- layer.open({
- type: 1
- , title: false
- , page: true
- , limit: 1
- , closeBtn: 0
- , area: [width + "px", height + "px"]
- , shade: [0.01, '#fff']
- , shadeClose: true
- , content: input //这里content是一个普通的String
- , offset: [top, left]
- , success: function () {
- //使弹出层相对定位
- $(".layui-layer-page").css("position", "absolute")
- //设置输入框的值
- $("#" + field + "_input").val(value);
- $("#" + field + "_input").focus()
- $("#" + field + "_input").blur(function () {
- var dat = data;
- var ekey = dat.ekey;
- var conf = $(this).val();
- var unit = data.unit;
- dat[field] = conf || "";
- obj.update(dat);
- form.render()
- })
- }
- });
- }
- // 下发要素短信预警
- function sendNoteMsg() {
- var tel = $('#alarmPhone').val();
- var e_id = $('#firstpane .menu-active').attr('id')
- if (tel) {
- if (!(/^1(3|4|5|7|8)\d{9}$/.test(tel))) {
- $('#alarmPhone').focus();
- return false;
- }
- }
- // if(!(/^1(3|4|5|7|8)\d{9}$/.test(tel))){
- // $('#alarmPhone').focus();
- // }else{
- var val = {
- "dat": {},
- "tel": tel,
- "equip_id": e_id
- }
- for (var i = 0; i < datMsg.length; i++) {
- var key = 'e' + (i + 1);
- var type = datMsg[i].type || 0;
- var alarmVal = datMsg[i].alarmVal || "";
- val.dat[key] = type + '#' + alarmVal;
- if (i == datMsg.length - 1) {
- $.ajax({
- url: 'qxz_alarm_recv',
- type: 'post',
- data: {
- alarm: JSON.stringify(val)
- },
- dataType: 'json',
- success: function (data) {
- if (data == 0) {
- layer.msg('修改成功')
- }
- },
- error: function (type) {
- layer.msg('修改失败')
- }
- })
- }
- }
- // }
- }
- // 请求LED大屏功能
- function loadLEDScreen(falg) {
- if ($('#LEDBtn').length) {
- $('#LEDBtn').remove();
- }
- // 判断是否为云飞气象站
- if (falg == 1) {
- var html = '<li class="clearfix" id="LEDBtn">' +
- '<button class="btn btn-sm btn-primary" onclick="setLedTitle(id)">显示屏设置</button> ' +
- '<button class="btn btn-sm btn-primary" onclick="ledPreview(id)"> 预览 </button></li>';
- $('#qxzInfoDiv ul').append(html)
- }
- }
- // 设置大屏标题
- function setLedTitle() {
- var html = '<div class="LEDTitle">LED滚动屏设置</div><div class="LEDContent">' +
- '<div>标题文字设置:<textarea maxlength="30" id="ledtitleInp" type="text" style="vertical-align: top; margin: 0px; width: 181px; height: 64px;">' + nowledinfo + '</textarea>(30字符)</div>' +
- '<div>显示时间设置:<input id="ledScrollTime" type="number"/><span>(小时)</span></div>' +
- '<div class="LEDBtns"><button onclick="sendLedTitle()" class="btn btn-sm btn-primary"> 确定 </button>' +
- '<button onclick="cancelLedBox()" class="btn btn-sm"> 取消 </button></div></div>'
- layer.open({
- type: 1,
- // title:'LED滚动屏设置',
- title: '',
- skin: 'layui-layer-led', //样式类名
- closeBtn: 0,
- area: ['420px', '280px'], //宽高
- content: html
- });
- }
- function cancelLedBox() {
- layer.closeAll();
- }
- function sendLedTitle() {
- var e_id = $('#firstpane .menu-active').attr('id')
- var cont = $('#ledtitleInp').val();
- var tim = $('#ledScrollTime').val();
- if (!cont) {
- layer.tips('请输入展示标题', '#ledtitleInp');
- return false;
- }
- if (!tim) {
- layer.tips('请输入展示时间', '#ledScrollTime');
- return false;
- }
- $.ajax({
- url: 'qxz_led',
- type: 'post',
- data: {
- equip_id: e_id,
- cont: cont,
- tim: tim
- },
- dataType: 'json',
- success: function (data) {
- if (data == 0) {
- layer.closeAll();
- layer.msg('修改成功')
- nowledinfo = cont;
- }
- },
- error: function (type) {
- layer.msg('修改失败')
- }
- })
- }
- // 预览大屏
- function ledPreview() {
- var qxzTtile = nowledinfo || '环境监测基地欢迎您';
- if (qxzTtile.length > 9) {
- var titleCalss = 'qxzLedTitleLong';
- } else {
- var titleCalss = ''
- }
- var html = '<div class="qxzLedBj">' +
- '<div class="qxzLedInfo">' +
- '<div class="qxzLedTitle"><p class="' + titleCalss + '">' + qxzTtile + '</p></div>' +
- '<div class="eleContent"><ul class="scrollUl">' +
- '<li>大气温度:16.5 °C</li><li>大气温度:16.5 °C</li><li>二氧化碳:800 PPM</li><li>照度:600 LUX</li><li>模拟气压:1005.9 hpa</li><li>光合有效辐射:9 W/m2</li>' +
- '</ul></div>' +
- '</div>' +
- '</div>'
- layer.open({
- type: 1,
- title: '',
- skin: 'layui-layer-demo', //样式类名
- closeBtn: 0, //不显示关闭按钮
- anim: 2,
- // area:['684px','770px'],
- area: ['525px', '619px'],
- offset: 'b',
- resize: false,
- shadeClose: true, //开启遮罩关闭
- content: html
- });
- }
- </script>
- </body>
- </html>
|