equipmanage_qxz.html 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559
  1. {% load staticfiles %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <link href="{% static '/lib/bootstrap-3.3.7/css/bootstrap.css' %}" rel="stylesheet">
  7. <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
  8. <link rel="stylesheet" href="{% static '/lib/css/ace.min.css' %}" />
  9. <link rel="stylesheet" href="{% static '/lib/css/ace-skins.min.css' %}">
  10. <link rel="stylesheet" href="{% static '/lib/css/ace-rtl.min.css' %}">
  11. <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
  12. <link rel="stylesheet" href="{% static '/lib/css/jquery-ui.css' %}" />
  13. <link rel="stylesheet" href="{% static '/lib/css/swiper.min.css' %}" />
  14. <style type="text/css">
  15. .swiper-slide {
  16. text-align: center;
  17. font-size: 14px;
  18. -webkit-box-pack: center;
  19. -ms-flex-pack: center;
  20. -webkit-justify-content: center;
  21. justify-content: center;
  22. -webkit-box-align: center;
  23. -ms-flex-align: center;
  24. -webkit-align-items: center;
  25. align-items: center;
  26. }
  27. .swiper-button-next, .swiper-button-prev{
  28. background-size: 50%;
  29. }
  30. .swiper-slide .elValBox{
  31. position: relative;
  32. width: 80px;
  33. height: 80px;
  34. margin: 0 auto;
  35. color: #fff;
  36. font-size: 20px;
  37. line-height: 80px;
  38. border-radius: 5px;
  39. }
  40. .swiper-slide .elValBox.bg_blue{
  41. background-image: url(../static/img/qxzBj/1.png);
  42. }
  43. .swiper-slide .elValBox.bg_yellow{
  44. background-image: url(../static/img/qxzBj/2.png);
  45. }
  46. .swiper-slide .elValBox.bg_green{
  47. background-image: url(../static/img/qxzBj/3.png);
  48. }
  49. .swiper-slide .elValBox.bg_red{
  50. background-image: url(../static/img/qxzBj/4.png);
  51. }
  52. .swiper-slide .elValBox.bg_purpol{
  53. background-image: url(../static/img/qxzBj/5.png);
  54. }
  55. .swiper-slide .elValBox.bg_darkblue{
  56. background-image: url(../static/img/qxzBj/6.png);
  57. }
  58. .swiper-slide .elValBox .elNum{
  59. position: absolute;
  60. left: 5px;
  61. top: 5px;
  62. font-size: 14px;
  63. line-height: 12px;
  64. }
  65. .swiper-slide .eLtxt{
  66. white-space: nowrap;
  67. overflow: hidden;
  68. text-overflow: ellipsis;
  69. }
  70. body {
  71. background: #fff;
  72. }
  73. .row {
  74. margin: 0;
  75. }
  76. /* 菜单 */
  77. .menu_body .nulldata {
  78. line-height: 80px;
  79. text-align: center;
  80. height: 80px;
  81. background: #eee;
  82. }
  83. .menu_list {
  84. margin-top: 10px;
  85. }
  86. .menu_head {
  87. height: 30px;
  88. line-height: 30px;
  89. padding-left: 10px;
  90. font-size: 12px;
  91. color: #313131;
  92. cursor: pointer;
  93. border: 1px solid #e1e1e1;
  94. border-top: 0px solid #e1e1e1;
  95. position: relative;
  96. background: #f1f1f1 url(../static/img/jia.png) center right 5px no-repeat;
  97. margin: 0;
  98. word-break: keep-all;
  99. white-space: nowrap;
  100. overflow: hidden;
  101. text-overflow: ellipsis;
  102. }
  103. .menu_body {
  104. height: auto;
  105. overflow: hidden;
  106. line-height: 38px;
  107. border-left: 1px solid #e1e1e1;
  108. border-right: 1px solid #e1e1e1;
  109. }
  110. .menu_body a {
  111. display: block;
  112. height: 32px;
  113. line-height: 32px;
  114. padding-left: 10px;
  115. color: #525252;
  116. background: #fff;
  117. text-decoration: none;
  118. border-bottom: 1px solid #e1e1e1;
  119. overflow: hidden;
  120. text-overflow: ellipsis;
  121. white-space: nowrap;
  122. }
  123. .menu_body a span {
  124. display: inline-block;
  125. width: 8px;
  126. height: 8px;
  127. border-radius: 50%;
  128. margin-right: 6px;
  129. }
  130. .bjred {
  131. background: red;
  132. }
  133. .bjgreen {
  134. background: green;
  135. }
  136. .menu_list .current {
  137. background: #f1f1f1 url(../static/img/jian.png) center right 5px no-repeat;
  138. font-weight: bold;
  139. color: #313131;
  140. }
  141. .menu_body .menu-active {
  142. color: #00bcd4;
  143. border-left: solid 3px #00bcd4;
  144. }
  145. .currAstive {
  146. background-color: #00bcd4;
  147. color: #fff;
  148. }
  149. /* 主题标题 */
  150. .widget-box {
  151. background: none repeat scroll 0 0 #F9F9F9;
  152. clear: both;
  153. margin-top: 16px;
  154. margin-bottom: 16px;
  155. position: relative;
  156. border: none;
  157. }
  158. .widget-title {
  159. height: 36px;
  160. line-height: 36px;
  161. border-bottom: solid 1px #e5e5e5;
  162. padding-bottom: 1px;
  163. /* text-align: center; */
  164. }
  165. .widget-title .equipInfo {
  166. float: left;
  167. }
  168. .widget-title h5 {
  169. color: #666;
  170. float: left;
  171. font-size: 12px;
  172. font-weight: bold;
  173. padding: 12px;
  174. line-height: 12px;
  175. margin: 0;
  176. margin-bottom: 3px;
  177. border-bottom: solid 2px #38b0ec;
  178. }
  179. /*状态 */
  180. .dev:HOVER {
  181. background: #2E363F;
  182. }
  183. .dev {
  184. display: flex;
  185. justify-content: space-around;
  186. /* width: 215px;
  187. height: 88px;
  188. float: left; */
  189. /* margin: 0px; */
  190. color: #f2f2f2;
  191. margin-bottom: 15px;
  192. cursor: pointer;
  193. position: relative;
  194. }
  195. .bg_lb {
  196. background:
  197. /* #27a9e3 */
  198. #4ab8e8;
  199. }
  200. .dev .left {
  201. width: 80px;
  202. padding-top: 10px;
  203. /* float: left; */
  204. }
  205. .dev .left .img-dev {
  206. width: 45px;
  207. margin-left: 12px;
  208. /* margin-top: 8px; */
  209. }
  210. .dev .right {
  211. width: 120px;
  212. padding-top: 3px;
  213. /* float: left; */
  214. font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;
  215. }
  216. .dev .right .name {
  217. font-size: 20px;
  218. line-height: 20px;
  219. text-align: left;
  220. padding-top: 10px;
  221. overflow: hidden;
  222. white-space: nowrap;
  223. text-overflow: ellipsis;
  224. }
  225. .dev .right .data {
  226. font-size: 14px;
  227. text-align: left;
  228. padding-top: 15px;
  229. }
  230. /* 项目 */
  231. .todo li {
  232. border-bottom: 1px solid #EBEBEB;
  233. margin-bottom: 0;
  234. padding: 10px 0;
  235. }
  236. .equipPage {
  237. line-height: 34px;
  238. text-align: center;
  239. }
  240. table tr td.nullData {
  241. text-align: center;
  242. line-height: 250px;
  243. }
  244. /* 状态块颜色 */
  245. .bg_lb {
  246. background:
  247. /* #27a9e3 */
  248. #4ab8e8;
  249. }
  250. .bg_ly {
  251. background:
  252. /* #ffb848 */
  253. #f5b761;
  254. }
  255. .bg_lg {
  256. background:
  257. /* #28b779 */
  258. #3eb984;
  259. }
  260. .bg_ls {
  261. background:
  262. /* #2255a4 */
  263. #4978c1;
  264. }
  265. .bg_lo {
  266. background:
  267. /* #da542e */
  268. #dc6442;
  269. }
  270. .bg_lr {
  271. background:
  272. /* #f74d4d */
  273. #f77979;
  274. }
  275. .aisle {
  276. position: absolute;
  277. left: 6px;
  278. bottom: 1px;
  279. font-size: 12px;
  280. }
  281. #uploadPhoto {
  282. display: none;
  283. }
  284. #viewPhoto {
  285. cursor: pointer;
  286. }
  287. /* 设备控制 */
  288. #ctrlBox>div {
  289. margin-bottom: 20px;
  290. }
  291. .handCtrlBox {
  292. margin-bottom: 20px;
  293. }
  294. input[type="checkbox"].ace.ace-switch.ace-switch-4+.lbl::before,
  295. input[type="checkbox"].ace.ace-switch.ace-switch-5+.lbl::before {
  296. text-indent: -39px;
  297. }
  298. .equipCtrl {
  299. border: 1px solid #cecece;
  300. padding: 15px 10px;
  301. background: #f5f5f5;
  302. box-shadow: 1px 1px 4px 1px #cecece;
  303. border-radius: 3px;
  304. cursor: pointer;
  305. }
  306. .equipCtrl:hover {
  307. border-color: #468fcd;
  308. box-shadow: 1px 2px 4px 0px #468fcd;
  309. }
  310. .equipCtrlInp {
  311. margin-top: 20px;
  312. text-align: right;
  313. }
  314. .isonlineicon {
  315. display: inline-block;
  316. width: 8px;
  317. height: 8px;
  318. border-radius: 50%;
  319. margin-right: 7px;
  320. }
  321. .isonlineicon.active {
  322. background: green;
  323. animation: 1s ease 0s infinite normal none running myfirst01;
  324. }
  325. .isonlineicon {
  326. background: #909090;
  327. animation: 1s ease 0s infinite normal none running myfirst02;
  328. }
  329. @keyframes myfirst01 {
  330. 0% {
  331. -moz-box-shadow: 0px 0px 6px 1px green;
  332. box-shadow: 0px 0px 6px 1px green;
  333. }
  334. 100% {
  335. -moz-box-shadow: 0px 0px 6px 1px green;
  336. box-shadow: 0px 0px 6px 1px green;
  337. }
  338. }
  339. @keyframes myfirst02 {
  340. 0% {
  341. -moz-box-shadow: 0px 0px 6px 1px #909090;
  342. box-shadow: 0px 0px 6px 1px #909090;
  343. }
  344. 100% {
  345. -moz-box-shadow: 0px 0px 6px 1px #909090;
  346. box-shadow: 0px 0px 6px 1px #909090;
  347. }
  348. }
  349. .ctrlLoading {
  350. position: absolute;
  351. bottom: 6px;
  352. }
  353. .equipCtrl .fa-cog {
  354. position: absolute;
  355. right: 26px;
  356. font-size: 20px;
  357. color: #3eb983;
  358. top: 11px;
  359. }
  360. .qxzDownCtrl {
  361. display: none;
  362. float: right;
  363. width: 53px;
  364. background: white;
  365. border: 1px solid #8aafce;
  366. color: #6688a6 !important;
  367. }
  368. .numName {
  369. display: inline-block;
  370. width: 70%;
  371. overflow: hidden;
  372. text-overflow: ellipsis;
  373. white-space: nowrap;
  374. vertical-align: middle;
  375. }
  376. /* 阈值控制 */
  377. #getthresholdDiv>div,
  378. #gettimingDiv>div {
  379. padding-bottom: 20px;
  380. }
  381. .thresholdCtrl {
  382. background: #4ab8e8;
  383. border-radius: 5px;
  384. color: #fff;
  385. box-shadow: 1px 1px 4px 1px #98dbf8;
  386. border: 1px solid #98dbf8;
  387. padding: 5px 10px;
  388. cursor: pointer;
  389. position: relative;
  390. }
  391. #gettimingDiv .thresholdCtrl {
  392. background: #65b83b;
  393. box-shadow: 1px 1px 4px 1px #d1ffba;
  394. border: 1px solid #65b83b;
  395. }
  396. .setthresholdBtn {
  397. position: absolute;
  398. right: 13px;
  399. top: 12px;
  400. font-size: 20px;
  401. }
  402. .setthresholdBtn:hover {
  403. color: #08ff46;
  404. }
  405. .thresholdCtrl::before {
  406. position: absolute;
  407. content: '';
  408. bottom: 0;
  409. left: 0;
  410. right: 0;
  411. height: 30%;
  412. background: rgba(255, 255, 255, 0.5);
  413. }
  414. .thresholdCtrlName {
  415. line-height: 30px;
  416. font-size: 16px;
  417. }
  418. .thresholdCtrlShowDiv {
  419. overflow: hidden;
  420. }
  421. .thresholdCtrlShowDiv>div {
  422. float: left;
  423. }
  424. .qxys img {
  425. width: 47px;
  426. }
  427. .maxminNum {
  428. font-size: 18px;
  429. line-height: 30px;
  430. margin-top: 11px;
  431. padding-left: 7%;
  432. }
  433. /* 色值阈值框 */
  434. .layui-form-item .layui-input-inline {
  435. width: 44%;
  436. }
  437. #Modal>div,
  438. #timingOnOffModal>div {
  439. margin-top: 20px;
  440. }
  441. .layui-form-mid.layui-word-aux span {
  442. color: red;
  443. }
  444. /* 定时设置 */
  445. #timingOnOffModal .layui-form-label {
  446. width: 100px;
  447. }
  448. /* .layui-body{overflow-y: scroll;} */
  449. .layui-layer-editName.layui-layer-page .layui-layer-content {
  450. overflow: hidden !important;
  451. overflow-y: scroll !important;
  452. }
  453. /* LED大屏样式 */
  454. .layui-layer-demo.layui-layer {
  455. background: transparent;
  456. box-shadow: none;
  457. color: #ff0000;
  458. }
  459. .layui-layer-demo .layui-layer-content {
  460. overflow-y: hidden !important;
  461. }
  462. .layui-layer-demo .qxzLedBj {
  463. padding-top: 115px;
  464. /* width: 684px;
  465. height: 781px; */
  466. width: 525px;
  467. height: 619px;
  468. background: url(../static/img/ledBj.png) no-repeat;
  469. background-size: 100% 100%;
  470. }
  471. .layui-layer-demo .qxzLedInfo {
  472. width: 95%;
  473. }
  474. .layui-layer-demo .qxzLedTitle {
  475. position: relative;
  476. height: 47px;
  477. /* white-space: nowrap; */
  478. overflow: hidden;
  479. width: 92%;
  480. margin: 16px auto;
  481. font-size: 36px;
  482. letter-spacing: 7px;
  483. 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);
  484. box-sizing: border-box;
  485. word-break: break-all;
  486. }
  487. .layui-layer-demo .qxzLedTitle p {
  488. white-space: nowrap;
  489. /*position: absolute;
  490. left: -865px;
  491. top: 0; */
  492. /* display: inline-block; */
  493. text-align: center;
  494. }
  495. .layui-layer-demo .qxzLedTitle .qxzLedTitleLong {
  496. /* text-align: right; */
  497. padding-left: 100%;
  498. /* 从右至左开始滚动 */
  499. display: inline-block;
  500. animation: marqueeTransform 16s linear infinite;
  501. }
  502. @keyframes marqueeTransform {
  503. 0% {
  504. transform: translate(0, 0);
  505. }
  506. 100% {
  507. transform: translate(-100%, 0);
  508. }
  509. }
  510. .layui-layer-demo .eleContent {
  511. width: 82%;
  512. margin: 0 auto 0;
  513. height: 157px;
  514. overflow: hidden;
  515. }
  516. .layui-layer-demo .scrollUl {
  517. animation: scrollUlTransform 8s linear infinite;
  518. }
  519. @keyframes scrollUlTransform {
  520. 0% {
  521. transform: translate(0, 0);
  522. }
  523. 50% {
  524. transform: translate(0, 0);
  525. }
  526. 51% {
  527. transform: translate(0, -50%);
  528. }
  529. 100% {
  530. transform: translate(0, -50%);
  531. }
  532. }
  533. .layui-layer-demo .scrollUl li {
  534. line-height: 51px;
  535. font-size: 30px;
  536. 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);
  537. }
  538. /* led标题更改 */
  539. .layui-layer.layui-layer-led {
  540. border-radius: 20px;
  541. overflow: hidden;
  542. }
  543. .layui-layer-led .layui-layer-content {
  544. overflow: hidden !important;
  545. box-sizing: border-box;
  546. /* padding: 10px 15px; */
  547. }
  548. .layui-layer-led .LEDTitle {
  549. line-height: 45px;
  550. background: #ececec;
  551. border-bottom: 1px solid #d1d1d1;
  552. padding: 0 15px;
  553. color: #797979;
  554. }
  555. .layui-layer-led .LEDContent {
  556. padding: 15px;
  557. }
  558. .layui-layer-led .LEDContent>div {
  559. margin-bottom: 20px;
  560. }
  561. .layui-layer-led .LEDBtns {
  562. text-align: center;
  563. }
  564. .layui-layer-led .LEDBtns button {
  565. margin: 0 20px;
  566. }
  567. textarea {
  568. resize: none;
  569. }
  570. /* 短信阈值下发 */
  571. .layui-form-switch {
  572. background-color: #00abf8;
  573. border-color: #00abf8;
  574. }
  575. .layui-form-switch em {
  576. color: #fff !important;
  577. }
  578. .layui-form-switch i {
  579. background-color: #fff;
  580. }
  581. .layui-form-onswitch {
  582. border-color: #5FB878;
  583. background-color: #5FB878;
  584. }
  585. .authInp {
  586. width: 100%;
  587. }
  588. /* 在线、所属公司筛选框 */
  589. .iptScreen {
  590. width: 75%;
  591. }
  592. .layui-input-block {
  593. margin-left: 0;
  594. }
  595. .input-group-btnA {
  596. display: inline-block;
  597. }
  598. </style>
  599. <body>
  600. <div class="content">
  601. <div class="row">
  602. <!-- 左菜单 -->
  603. <div class="col-xs-12 col-sm-3 col-md-2">
  604. <div class="input-group">
  605. <input type="text" class="form-control" id="searchImei" name="searchImei" placeholder="输入编号或名称查询">
  606. <div class="input-group-btn">
  607. <button type="button" id="searchBtn" class="btn btn-default no-border btn-sm">
  608. <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
  609. </button>
  610. </div>
  611. </div>
  612. <!-- 下拉框 -->
  613. <!-- 在线状态 -->
  614. <div class="layui-input-block">
  615. <p class="">在线状态:</p>
  616. <select name="status" lay-verify="required" id="selectId" class="iptScreen">
  617. <option value="" selected>全部</option>
  618. <option value="0">离线</option>
  619. <option value="1">在线</option>
  620. </select>
  621. </div>
  622. <div id="firstpane" class="menu_list">
  623. <p class="menu_head current" id="area_322">设备列表</p>
  624. <div class="menu_body">
  625. <!-- <a href="javascript:;" title="设备15112501" class="text-overflow" id="15112501" data-pid="322">设备15112501</a> -->
  626. </div>
  627. <div class="equipPage">
  628. <!-- <button class="btn btn-minier btn-yellow"><i class="fa fa-sort-up" aria-hidden="true"></i></button> -->
  629. <input type="button" class="btn btn-minier btn-yellow" onclick="gotofirstpage()" value="首页">
  630. <button class="btn btn-minier btn-yellow" id="jianPage"
  631. onclick="changePage('jian')">上一页</button>
  632. <span id="currentpage">1</span>页
  633. <button class="btn btn-minier btn-yellow" id="addPage" onclick="changePage('add')">下一页</button>
  634. 共<span id="totelpage">4</span>页
  635. </div>
  636. <div class="equipPage">
  637. 跳转 <input type="text" id="jumpPage" value="1"
  638. style="width: 60px;height: 30px;text-align: center;"
  639. onkeypress="if (event.keyCode == 13) changePage('jump');"> 页
  640. <button class="btn btn-minier btn-yellow" id="jianPage" onclick="changePage('jump')">确定</button>
  641. </div>
  642. </div>
  643. <div class="">
  644. <div class="widget-box" style="margin-top: 20px;">
  645. <div class="widget-title">
  646. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  647. <h5>项目信息</h5>
  648. </div>
  649. </div>
  650. <div class="widget-content" style="padding: 0px;margin-top: 8px;">
  651. <div>
  652. <!-- <img src="www.yfzhwlw.com/qxz_photo/default.png" class="equip_photo" width="100%" height="100%" style=""> -->
  653. <form action="" method="post" id="userPhoto" class="form-horizontal"
  654. enctype="multipart/form-data">{% csrf_token %}
  655. <input type="hidden" value="" id="qxzPhotoId" name="id">
  656. <div class="personal-avatar">
  657. <div class="top-avatar" id="viewPhotoParent">
  658. <img id="viewPhoto" class="equip_photo" onclick="$('#uploadPhoto').click()"
  659. src="" width="100%" height="100%">
  660. </div>
  661. <a class="upload-avatar" href="javascript:;">
  662. <input class="upload-btn" name="upicture"
  663. onchange="previewImage(this,'viewPhotoParent','viewPhoto','uploadPhoto','100%',200)"
  664. type="file" id="uploadPhoto">
  665. </a>
  666. <!-- <input type="hidden" name="req" value="photo"> -->
  667. </div>
  668. </form>
  669. </div>
  670. <div class="todo" style="background: white;margin-top: 5px;" id="qxzInfoDiv">
  671. <ul>
  672. <li class="clearfix">
  673. <div class="txt equip_name">&nbsp;&nbsp;</div>
  674. </li>
  675. <li class="clearfix">
  676. <div class="txt equip_id">&nbsp;&nbsp;</div>
  677. </li>
  678. <li class="clearfix" id="isonline">
  679. <div class="txt">&nbsp;&nbsp;</div>
  680. </li>
  681. </ul>
  682. </div>
  683. </div>
  684. </div>
  685. </div>
  686. <!-- 右 -->
  687. <div class="col-xs-12 col-sm-9 col-md-10">
  688. <!-- 实时状态 -->
  689. <div class="currTimeStatus">
  690. <div class="widget-box" style="margin-top: 0px;">
  691. <div class="widget-title">
  692. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  693. <h5>实时状态</h5>
  694. <div class="equipInfo" id="equipInfo"> </div>
  695. <div class="span5" id="equipCtrlDiv" style="float: right;">
  696. <button class="btn btn-white btn-primary" id="newDataRefresh" onclick="newDataRefresh()"
  697. type="button">
  698. <i class="fa fa-refresh" aria-hidden="true"></i>
  699. </button>
  700. <button class="btn btn-white btn-primary" id="setEleName" onclick="setEleName()"
  701. type="button">
  702. <i class="fa fa-cog" aria-hidden="true"></i>
  703. </button>
  704. <button class="btn btn-white btn-primary" id="updataTime" type="button">2020-03-12
  705. 13:48:15</button>
  706. </div>
  707. <div style="float: right;margin-right:5px;" id="sinCodeInquire">
  708. <!-- <button class="btn btn-white btn-primary" onclick="inquireSim('89860403101970072488')" id="" type="button">流量查询</button> -->
  709. </div>
  710. </div>
  711. </div>
  712. </div>
  713. <!-- <div class="body-content clearfix row" id="newStatusBox"> -->
  714. <!-- <div class="dev col-xs-4 col-md-3 col-lg-2 bg_lb">
  715. <div class="left">
  716. <img class="img-dev" src="{% static '/img/switchBtnIcon.png' %}">
  717. </div>
  718. <div class="right">
  719. <div class="name">风速</div>
  720. <div class="data">
  721. <strong>
  722. <span style="font-size: 25px;">0.0</span>
  723. </strong>m/s</div>
  724. </div>
  725. </div> -->
  726. <!-- </div> -->
  727. <div style="position: relative;">
  728. <!-- Swiper -->
  729. <div class="swiper-container" style="width:95%;height:120px;">
  730. <div class="swiper-wrapper" id="newStatusBox">
  731. <div class="swiper-slide">
  732. <div class="elValBox">
  733. <p class="elNum">e1</p>
  734. <div class="elVal">33</div>
  735. </div>
  736. <div class="eLtxt">辐射累积辐射辐射累积辐射辐射累积辐射</div>
  737. <div class="elUnit">(m j / m ㎡)</div>
  738. </div>
  739. </div>
  740. </div>
  741. <div class="swiper-button-prev"></div>
  742. <div class="swiper-button-next"></div>
  743. </div>
  744. <!-- 设备手动控制 -->
  745. <div id="ctrlBoxParentDiv">
  746. <div class="currTimeStatus">
  747. <div class="widget-box">
  748. <div class="widget-title">
  749. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  750. <h5>设备手动控制</h5>
  751. <button class="btn btn-white btn-primary qxzDownCtrl" onclick="qxzDownCtrlFun()">
  752. <i class="fa fa-refresh" aria-hidden="true"></i>
  753. </button>
  754. </div>
  755. </div>
  756. </div>
  757. <div class="row handCtrlBox" id="ctrlBox">
  758. <!-- <div class="col-xs-2">
  759. <div class="equipCtrl">
  760. <input type="hidden" value="1">
  761. <div>
  762. <span class="isonlineicon active"></span>
  763. 控制1
  764. </div>
  765. <div class="equipCtrlInp">
  766. <label>
  767. <input name="switch-field-1" checked class="ace ace-switch ace-switch-4 btn-rotate" type="checkbox">
  768. <span class="lbl"></span>
  769. </label>
  770. </div>
  771. </div>
  772. </div> -->
  773. </div>
  774. </div>
  775. <!-- 设备阈值控制 -->
  776. <div id="getthresholdDivParentDiv">
  777. <div class="currTimeStatus">
  778. <div class="widget-box" style="margin-top: 0px;">
  779. <div class="widget-title">
  780. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  781. <h5>设备阈值控制</h5>
  782. <button class="btn btn-white btn-primary qxzDownCtrl" id="" onclick="" type="button">
  783. <i class="fa fa-refresh" aria-hidden="true"></i>
  784. </button>
  785. </div>
  786. </div>
  787. </div>
  788. <div class="row" id="getthresholdDiv">
  789. <!-- <div class="col-xs-2 col-sm-3">
  790. <div class="thresholdCtrl">
  791. <div class="setthresholdBtn" onclick="setthresholdFun(this)">
  792. <i class="fa fa-cog setName" aria-hidden="true"></i>
  793. </div>
  794. <input type="hidden" class="currVal" value='{"JK":1,"eKey":1,"upper":700,"lower":300,"method":1}'>
  795. <div class="thresholdCtrlName">
  796. <p>开关1(e1)</p>
  797. </div>
  798. <div class="thresholdCtrlShowDiv">
  799. <div class="qxys">
  800. <div>
  801. <img src="{% static '/img/dev/icon_110.png' %}" alt="">
  802. </div>
  803. <div>雨量累计</div>
  804. </div>
  805. <div class="maxminNum">
  806. <p>最大值:
  807. <span>30</span>
  808. </p>
  809. <p>最小值:
  810. <span>10</span>
  811. </p>
  812. </div>
  813. </div>
  814. <div class="equipCtrlInp">
  815. <label>
  816. <input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">
  817. <span class="lbl"></span>
  818. </label>
  819. </div>
  820. </div>
  821. </div> -->
  822. </div>
  823. </div>
  824. <!-- 设备定时控制 -->
  825. <div id="timingDivParentDiv">
  826. <div class="currTimeStatus">
  827. <div class="widget-box" style="margin-top: 0px;">
  828. <div class="widget-title">
  829. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  830. <h5>设备定时控制</h5>
  831. <button class="btn btn-white btn-primary qxzDownCtrl" id="" onclick="" type="button">
  832. <i class="fa fa-refresh" aria-hidden="true"></i>
  833. </button>
  834. </div>
  835. </div>
  836. </div>
  837. <div class="row" id="gettimingDiv">
  838. <!-- <div class="col-xs-2 col-sm-3">
  839. <div class="thresholdCtrl">
  840. <div class="setthresholdBtn" onclick="timingOnOff(this)">
  841. <i class="fa fa-cog setName" aria-hidden="true"></i>
  842. </div>
  843. <input type="hidden" class="currVal" value='{"JK":1,"StartTime":12,"Duration":10}'>
  844. <div class="thresholdCtrlName">
  845. <p>开关1(e1)</p>
  846. </div>
  847. <div class="thresholdCtrlShowDiv">
  848. <div class="maxminNum">
  849. <p>起始时间:
  850. <span>12</span>
  851. </p>
  852. <p>工作时长:
  853. <span>10</span>
  854. 小时
  855. </p>
  856. </div>
  857. </div>
  858. <div class="equipCtrlInp">
  859. <label>
  860. <input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">
  861. <span class="lbl"></span>
  862. </label>
  863. </div>
  864. </div>
  865. </div> -->
  866. </div>
  867. </div>
  868. <!-- 24小时数据 -->
  869. <div id="data24Div">
  870. <div class="currTimeStatus">
  871. <div class="widget-box">
  872. <div class="widget-title">
  873. <h5>24小时数据</h5>
  874. <div class="span5" id="equipCtrlDiv" style="float: right;">
  875. <button class="btn btn-white btn-primary" onclick="historyData()">历史数据 >></button>
  876. </div>
  877. </div>
  878. </div>
  879. </div>
  880. <div class="row">
  881. <div class="col-xs-12 col-md-12 col-lg-9">
  882. <table id="newtable" class="table table-striped table-hover">
  883. <tr>
  884. <td>传感器通道</td>
  885. <td>通道名称</td>
  886. <td>最小值</td>
  887. <td>最小值时间</td>
  888. <td>最大值</td>
  889. <td>最大值时间</td>
  890. </tr>
  891. <tbody>
  892. </tbody>
  893. </table>
  894. </div>
  895. </div>
  896. </div>
  897. </div>
  898. </div>
  899. </div>
  900. <!-- Modal -->
  901. <div id="Modal" class="model" style="display:none">
  902. <div>
  903. <form class="layui-form" action="" id="modelForm" lay-filter="formModel">
  904. <input type="hidden" value="" name="JK">
  905. <input type="hidden" value="" name="eKey">
  906. <div class="layui-form-item">
  907. <label class="layui-form-label">最大值</label>
  908. <div class="layui-input-inline">
  909. <input type="text" name="upper" id="upper" required lay-verify="required" placeholder="请输入最大值"
  910. autocomplete="off" class="layui-input">
  911. </div>
  912. </div>
  913. <div class="layui-form-item">
  914. <label class="layui-form-label">最小值</label>
  915. <div class="layui-input-inline">
  916. <input type="text" name="lower" required lay-verify="required" placeholder="请输入最小值"
  917. autocomplete="off" class="layui-input">
  918. </div>
  919. </div>
  920. <div class="layui-form-item">
  921. <label class="layui-form-label">规 则</label>
  922. <div class="layui-input-inline">
  923. <input type="radio" name="method" lay-filter="radioSwitch" value="1" title="程序一" checked="">
  924. <input type="radio" name="method" lay-filter="radioSwitch" value="0" title="程序二">
  925. </div>
  926. <div class="layui-form-mid layui-word-aux" id="hintDiv">低于下限
  927. <span>开启</span>,高于上限
  928. <span>关闭</span>
  929. </div>
  930. </div>
  931. </form>
  932. </div>
  933. </div>
  934. <!-- Modal2 -->
  935. <div id="timingOnOffModal" class="model" style="display:none">
  936. <div>
  937. <form class="layui-form" action="" id="modelForm" lay-filter="formModel">
  938. <input type="hidden" value="" name="JK">
  939. <div class="layui-form-item">
  940. <label class="layui-form-label">起始时间:</label>
  941. <div class="layui-input-inline">
  942. <input type="number" name="StartTime" id="starttime" required
  943. lay-verify="required|starttimeRegex" placeholder="请输入起始时间" autocomplete="off"
  944. class="layui-input">
  945. <!-- <select name="city" lay-verify="">
  946. <option value="">请选择一个城市</option>
  947. <option value="010">北京</option>
  948. <option value="021">上海</option>
  949. <option value="0571">杭州</option>
  950. </select>
  951. <select name="city" lay-verify="required">
  952. <option value=""></option>
  953. <option value="0">北京</option>
  954. <option value="1">上海</option>
  955. <option value="2">广州</option>
  956. <option value="3">深圳</option>
  957. <option value="4">杭州</option>
  958. </select> -->
  959. </div>
  960. <div class="layui-form-mid layui-word-aux">时间范围(0-23)</div>
  961. </div>
  962. <div class="layui-form-item">
  963. <label class="layui-form-label">工作时长:</label>
  964. <div class="layui-input-inline">
  965. <input type="number" name="Duration" id="Duration" required lay-verify="required|durationRegex"
  966. placeholder="请输入工作时长" autocomplete="off" class="layui-input">
  967. </div>
  968. <div class="layui-form-mid layui-word-aux">工作时长(1-24)</div>
  969. </div>
  970. </form>
  971. </div>
  972. </div>
  973. <!-- setEleName -->
  974. <div id="eleName" style="width:800px;display:none">
  975. <div style="width:95%;margin:0 auto;">
  976. <table class="layui-hide" id="eleTable" lay-filter="eleTable"></table>
  977. </div>
  978. </div>
  979. <!-- 管理员查看设备电压历史记录 -->
  980. <div id="record" style="display: none;">
  981. <div style="padding: 20px;width: 500px;float: left;">
  982. <table id="recordTable" lay-filter="recordTableFilter"></table>
  983. <div id="recordPage"></div>
  984. </div>
  985. <div style="margin-left: 480px;padding: 20px;">
  986. <div id="recordEcharts" style="height: 450px;width: 500px;"></div>
  987. </div>
  988. </div>
  989. {% verbatim %}
  990. <script type="text/html" id="switchTpl">
  991. <!-- 这里的 checked 的状态只是演示 -->
  992. <input type="checkbox" name="equipType" value="{{d.type}}" lay-skin="switch" lay-text="大于|小于"
  993. lay-filter="equipTypeDemo" {{ d.type == 1 ? 'checked' : '' }}>
  994. </script>
  995. {% endverbatim %}
  996. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  997. <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
  998. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  999. <script src="{% static '/js/common.js' %}?versions=0.5.4"></script>
  1000. <script src="{% static '/lib/js/echarts.min.js' %}"></script>
  1001. <script src="{% static '/lib/js/swiper.min.js' %}"></script>
  1002. <script type="text/javascript">
  1003. $.ajaxSetup({
  1004. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  1005. });
  1006. </script>
  1007. <script>
  1008. var swiperWidth = $('.swiper-container').width();
  1009. var swiperCount = Math.floor(swiperWidth/130);
  1010. //默认加载设备列表
  1011. getEquipList(1, '');
  1012. // 搜索
  1013. $('#searchBtn').on('click', function () {
  1014. getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1015. });
  1016. $('#searchImei').on('keyup', function (event) {
  1017. if (event.keyCode == 13) {
  1018. getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1019. }
  1020. })
  1021. function getEquipList(page, filter, is_online, etype) {
  1022. if (etype == undefined && is_online == undefined) {
  1023. var etype = ''
  1024. var is_online = ''
  1025. }
  1026. $.ajax({
  1027. url: 'qxz_page',
  1028. type: 'get',
  1029. dataType: 'json',
  1030. data: {
  1031. page: page,
  1032. f_id: filter,
  1033. etype: etype, //所属公司
  1034. is_online: is_online, //设备状态
  1035. },
  1036. beforeSend: function (XMLHttpRequest) {
  1037. loadingFlag = layer.load();
  1038. },
  1039. success: function (data) {
  1040. layer.close(loadingFlag);
  1041. if (data.nums) {
  1042. var html = '';
  1043. var msg = data.ids
  1044. var pagecount = Math.ceil(data.nums / 10);
  1045. for (var i = 0; i < msg.length; i++) {
  1046. if (msg[i].equip_name) {
  1047. var equip_name = '设备:' + msg[i].equip_name;
  1048. } else if (msg[i].equip_id.length == 15) {
  1049. var equip_name = '设备:' + msg[i].equip_id.substring(msg[i].equip_id.length - 8);
  1050. } else {
  1051. var equip_name = '设备:' + msg[i].equip_id;
  1052. }
  1053. var offTime = msg[i].off_time || '';
  1054. if (msg[i].is_online == 1) {
  1055. var classStatic = 'bjgreen';
  1056. } else if (msg[i].is_online == 0) {
  1057. var classStatic = 'bjred';
  1058. } else {
  1059. var classStatic = '';
  1060. }
  1061. // var equip_name = msg[i].equip_name?'---设备名:'+msg[i].equip_name:'';
  1062. 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>'
  1063. }
  1064. $('#firstpane .menu_body').html(html);
  1065. $('.equipPage').show();
  1066. $('#totelpage').html(pagecount)
  1067. // 菜单栏
  1068. $("#firstpane .menu_body:eq(0) a:eq(0)").addClass('menu-active');
  1069. $('.widget-content .equip_id').html('设备ID:' + msg[0].equip_id);
  1070. $('.widget-content .equip_name').html('项目名称:' + (msg[0].equip_name || '设备' + msg[0].equip_id));
  1071. $(".menu_body a").click(function () {
  1072. $(".menu_head").removeClass("currAstive");
  1073. $(".menu_body a").removeClass("menu-active");
  1074. $(this).addClass("menu-active");
  1075. $(this).parent().prev().addClass('currAstive');
  1076. // 名称切换
  1077. $('.widget-content .equip_id').html('设备ID:' + $(this).attr('id'));
  1078. $('.widget-content .equip_name').html('项目名称:' + ($(this).attr('name') || '设备' + $(this).attr('id')));
  1079. var facId = $(this).attr("id");
  1080. var currisonline = $(this).attr("isonline");
  1081. var curroffTime = $(this).attr("offTime");
  1082. if (currisonline == 0) {
  1083. $('#isonline').show();
  1084. $('#isonline div').html('离线时间:' + curroffTime);
  1085. } else {
  1086. $('#isonline').hide();
  1087. }
  1088. if (facId && facId != null && facId != "") {
  1089. loadProject(facId);
  1090. $('#qxzPhotoId').val(facId);
  1091. }
  1092. });
  1093. loadProject(msg[0].equip_id);
  1094. if (msg[0].is_online == 0) {
  1095. $('#isonline').show();
  1096. $('#isonline div').html('离线时间:' + (msg[0].off_time || ''));
  1097. } else {
  1098. $('#isonline').hide();
  1099. }
  1100. $('#qxzPhotoId').val(msg[0].equip_id)
  1101. } else {
  1102. $('.equipPage').hide();
  1103. var html = '<a href="javascript:;" class="text-overflow nulldata" data-pid="322">暂未设备</a>'
  1104. $('#firstpane .menu_body').html(html);
  1105. scrollBar()
  1106. }
  1107. },
  1108. error: function (type) {
  1109. layer.close(loadingFlag);
  1110. }
  1111. })
  1112. }
  1113. var nowledinfo;
  1114. // 查询SIM卡
  1115. function inquireSim(iccid) {
  1116. $.ajax({
  1117. url: 'siminfo',
  1118. type: 'post',
  1119. dataType: 'json',
  1120. data: {
  1121. simid: iccid,
  1122. },
  1123. beforeSend: function (XMLHttpRequest) {
  1124. //注意,layer.msg默认3秒自动关闭,如果数据加载耗时比较长,需要设置time
  1125. loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
  1126. },
  1127. success: function (data) {
  1128. var dat = data.data;
  1129. if (data.code == 0) {
  1130. var status;
  1131. if (dat.account_status == "0") {
  1132. status = "未知";
  1133. } else if (dat.account_status == "1") {
  1134. status = "测试期";
  1135. } else if (dat.account_status == "2") {
  1136. status = "沉默期";
  1137. } else if (dat.account_status == "3") {
  1138. status = "使用中";
  1139. } else if (dat.account_status == "4") {
  1140. status = "停机";
  1141. } else if (dat.account_status == "5") {
  1142. status = "停机保号";
  1143. } else if (dat.account_status == "6") {
  1144. status = "预销号";
  1145. } else if (dat.account_status == "7") {
  1146. status = "销号";
  1147. }
  1148. var usage;
  1149. if (dat.iccid) {
  1150. usage = dat.data_usage;
  1151. } else {
  1152. usage.innerHTML = '--';
  1153. }
  1154. var balance;
  1155. if (dat.iccid) {
  1156. balance = dat.data_balance;
  1157. } else {
  1158. balance = '--';
  1159. }
  1160. var time;
  1161. if (dat.iccid) {
  1162. var timestamp4 = new Date(dat.expiry_date * 1000);//直接用 new Date(时间戳) 格式转化获得当前时间
  1163. time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
  1164. } else {
  1165. time = '--';
  1166. }
  1167. layer.close(loadingFlag);
  1168. layer.open({
  1169. type: 1
  1170. , title: false //不显示标题栏
  1171. , skin: 'layui-layer-simCode' //样式类名
  1172. , closeBtn: false
  1173. , area: '300px;'
  1174. , shade: 0.8
  1175. , id: 'simCode' //设定一个id,防止重复弹出
  1176. , btn: ['我知道了']
  1177. , btnAlign: 'c'
  1178. , moveType: 1 //拖拽模式,0或者1
  1179. , 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>'
  1180. , success: function (layero) {
  1181. }
  1182. });
  1183. } else {
  1184. layer.msg(data.msg);
  1185. }
  1186. }
  1187. })
  1188. }
  1189. //在线状态筛选
  1190. $('#selectId').on('change', function () {
  1191. getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1192. })
  1193. //设备状态
  1194. function loadProject(facId) {
  1195. $.ajax({
  1196. url: 'qxz_status',
  1197. type: 'post',
  1198. dataType: 'json',
  1199. data: {
  1200. e_id: facId,
  1201. },
  1202. beforeSend: function (XMLHttpRequest) {
  1203. loadingFlag = layer.load();
  1204. },
  1205. success: function (data) {
  1206. layer.close(loadingFlag);
  1207. nowledinfo = data.ledinfo
  1208. // 实时状态
  1209. newStatus('newStatusBox', data, facId);
  1210. $('#updataTime').html(data.base.upl_time || '暂无上传数据');
  1211. if (data.base.qxz_picture) {
  1212. $('#viewPhoto').attr('src', 'http://120.27.222.26/' + data.base.qxz_picture);
  1213. } else {
  1214. $('#viewPhoto').attr('src', 'http://120.27.222.26/' + 'qxz_photo/default.jpg');
  1215. }
  1216. addCtrlBtn(data.qxz_switch, data.switch_name);
  1217. if (data.qxz_switch && (data.qxz_switch.length != 2)) {
  1218. $('#ctrlBoxParentDiv').show();
  1219. $('#getthresholdDivParentDiv').show();
  1220. $('#timingDivParentDiv').show();
  1221. $('#data24Div').hide();
  1222. gettimimgFun(data);
  1223. getthresholdFun(data);
  1224. scrollBar()
  1225. } else { // 无开关显示24小时数据
  1226. $('#ctrlBoxParentDiv').hide();
  1227. $('#getthresholdDivParentDiv').hide();
  1228. $('#timingDivParentDiv').hide();
  1229. $('#data24Div').show();
  1230. get24Data(facId)
  1231. scrollBar()
  1232. }
  1233. },
  1234. error: function (type) {
  1235. layer.close(loadingFlag);
  1236. }
  1237. })
  1238. }
  1239. // 阈值请求
  1240. function getthresholdFun(data) {
  1241. if (data.auto_list.length > 2) {
  1242. var switchData = eval('(' + data.auto_list + ')');
  1243. var qxz_switch = eval('(' + data.qxz_switch + ')');
  1244. // var qxz_list = data.new_data;
  1245. if (data.switch_name.length > 2) {
  1246. var switch_name = eval('(' + data.switch_name + ')');
  1247. } else {
  1248. var switch_name = [];
  1249. }
  1250. } else {
  1251. var switchData = [];
  1252. // var qxz_list = [];
  1253. var switch_name = [];
  1254. }
  1255. if (switchData.length) {
  1256. var html = '';
  1257. for (var i = 0; i < switchData.length; i++) {
  1258. if (switchData[i].JK != 255) {
  1259. if (switchData[i].upper == 32767 || switchData[i].lower == 32767) {
  1260. var check = false;
  1261. } else {
  1262. var check = true;
  1263. }
  1264. // 判断通道号
  1265. if (!isNaN(switchData[i].eKey)) {
  1266. var eknum = switchData[i].eKey + 1;
  1267. var ek = 'e' + eknum;
  1268. } else {
  1269. var ek = switchData[i].eKey;
  1270. }
  1271. // 开关名
  1272. if (switchData[i].JK == qxz_switch[i].JK) {
  1273. if (switch_name.length > 2) {
  1274. if (switch_name[i].name) {
  1275. var name = switch_name[i].name;
  1276. } else {
  1277. var name = '开关' + qxz_switch[i].JK;
  1278. }
  1279. } else {
  1280. var name = '开关' + qxz_switch[i].JK;
  1281. }
  1282. } else {
  1283. var name = timingData[i].JK;
  1284. }
  1285. if (data.dat[ek]) {
  1286. var eNum = data.dat[ek].split('#')[1];
  1287. var txt = data.conf[ek].split('#')[0];
  1288. html += '<div class="col-xs-6 col-sm-4"><div class="thresholdCtrl">' +
  1289. '<div class="setthresholdBtn" onclick="setthresholdFun(this)">' +
  1290. '<i class="fa fa-cog setName" aria-hidden="true"></i></div>' +
  1291. '<input type="hidden" class="currVal" value=\'' + JSON.stringify(switchData[i]) + '\'>' +
  1292. '<div class="thresholdCtrlName"><p>' + name + '(通道' + switchData[i].eKey + ')</p></div>' +
  1293. '<div class="thresholdCtrlShowDiv"><div class="qxys"><div>' +
  1294. '<img src="http://www.yfzhwlw.com/static/img/dev/icon_' + eNum + '.png" alt=""></div>' +
  1295. '<div>' + txt + data.conf[ek].split('#')[1] + '</div></div><div class="maxminNum"><p>最大值:<span>' + switchData[i].upper + '</span></p>' +
  1296. '<p>最小值:<span>' + switchData[i].lower + '</span></p></div></div><div class="equipCtrlInp">';
  1297. if (check) {
  1298. html += '<label><input name="switch-field-1" class="ace ace-switch ace-switch-6" checked="checked" type="checkbox">' +
  1299. '<span class="lbl"></span></label></div></div></div>';
  1300. } else {
  1301. html += '<label><input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">' +
  1302. '<span class="lbl"></span></label></div></div></div>';
  1303. }
  1304. }
  1305. }
  1306. if (i == switchData.length - 1) {
  1307. if (html) {
  1308. $('#getthresholdDiv').html(html)
  1309. } else {
  1310. $('#getthresholdDiv').html('<div style="text-align:center">空</div>')
  1311. }
  1312. }
  1313. }
  1314. } else {
  1315. $('#getthresholdDiv').html('<div style="text-align:center">空</div>')
  1316. }
  1317. }
  1318. // 定时请求
  1319. function gettimimgFun(data) {
  1320. var switch_name = data.switch_name;
  1321. var qxz_switch = data.qxz_switch;
  1322. if (data.timing_list.length) {
  1323. var timingData = eval('(' + data.timing_list + ')');
  1324. var qxz_switch = eval('(' + data.qxz_switch + ')');
  1325. var qxz_list = data.qxz_list;
  1326. if (switch_name.length > 2) {
  1327. var switch_name = eval('(' + switch_name + ')');
  1328. } else {
  1329. var switch_name = [];
  1330. }
  1331. } else {
  1332. var timingData = [];
  1333. var qxz_list = [];
  1334. var switch_name = [];
  1335. }
  1336. if (timingData.length) {
  1337. var html = '';
  1338. for (var i = 0; i < timingData.length; i++) {
  1339. if (timingData[i].JK != 255) {
  1340. if (timingData[i].Duration == 32767 || timingData[i].StartTime == 32767) {
  1341. var check = false;
  1342. var curCheckedVal = {
  1343. JK: timingData[i].JK,
  1344. StartTime: '--',
  1345. Duration: '--'
  1346. }
  1347. var startTime = '--';
  1348. var duration = '--';
  1349. } else {
  1350. var check = true;
  1351. var curCheckedVal = {
  1352. JK: timingData[i].JK,
  1353. StartTime: timingData[i].StartTime,
  1354. Duration: timingData[i].Duration
  1355. }
  1356. var startTime = timingData[i].StartTime;
  1357. var duration = timingData[i].Duration;
  1358. }
  1359. if (timingData[i].JK == qxz_switch[i].JK) {
  1360. if (switch_name.length > 2) {
  1361. if (switch_name[i].name) {
  1362. var name = switch_name[i].name;
  1363. } else {
  1364. var name = '开关' + qxz_switch[i].JK;
  1365. }
  1366. } else {
  1367. var name = '开关' + qxz_switch[i].JK;
  1368. }
  1369. } else {
  1370. var name = timingData[i].JK;
  1371. }
  1372. html += '<div class="col-xs-6 col-sm-4"><div class="thresholdCtrl">' +
  1373. '<div class="setthresholdBtn" onclick="timingOnOff(this)">' +
  1374. '<i class="fa fa-cog setName" aria-hidden="true"></i></div>' +
  1375. '<input type="hidden" class="currVal" value=\'' + JSON.stringify(curCheckedVal) + '\'>' +
  1376. '<div class="thresholdCtrlName"><p>' + name + '</p></div>' +
  1377. '<div class="thresholdCtrlShowDiv"><div class="maxminNum">' +
  1378. '<p>起始时间:<span>' + startTime + '</span>点</p><p>工作时长:<span>' + duration + '</span>小时</p>' +
  1379. '</div></div><div class="equipCtrlInp"><label>';
  1380. if (check) {
  1381. html += '<input name="switch-field-1" checked class="ace ace-switch ace-switch-6" type="checkbox">' +
  1382. '<span class="lbl"></span></label></div></div></div>';
  1383. } else {
  1384. html += '<input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">' +
  1385. '<span class="lbl"></span></label></div></div></div>';
  1386. }
  1387. }
  1388. if (i == timingData.length - 1) {
  1389. if (html) {
  1390. $('#gettimingDiv').html(html)
  1391. } else {
  1392. $('#gettimingDiv').html('<div style="text-align:center">空</div>')
  1393. }
  1394. }
  1395. }
  1396. } else {
  1397. $('#gettimingDiv').html('<div style="text-align:center">空</div>')
  1398. }
  1399. }
  1400. // 控制按钮
  1401. function addCtrlBtn(data, switch_name) {
  1402. if (data && switch_name.length > 2) {
  1403. var data = eval('(' + data + ')');
  1404. var ctrl_name = eval('(' + switch_name + ')');
  1405. $('.qxzDownCtrl').show();
  1406. } else if (data) {
  1407. var data = eval('(' + data + ')');
  1408. var ctrl_name = [];
  1409. } else {
  1410. var data = []
  1411. $('.qxzDownCtrl').hide();
  1412. }
  1413. if (data.length) {
  1414. var html = '';
  1415. for (var i = 0; i < data.length; i++) {
  1416. if (data[i].status == 0) {
  1417. var curClass = '';
  1418. } else {
  1419. var curClass = 'active';
  1420. }
  1421. if (data[i].status == 0) {
  1422. var curChecked = ''; //关
  1423. } else {
  1424. var curChecked = 'checked';
  1425. }
  1426. if (ctrl_name.length) {
  1427. if (ctrl_name[i].name != '') {
  1428. var switch_name = ctrl_name[i].name;
  1429. } else {
  1430. var switch_name = '开关' + ctrl_name[i].JK;
  1431. }
  1432. } else {
  1433. var switch_name = '开关' + data[i].JK;
  1434. }
  1435. html += '<div class="col-xs-2"><div class="equipCtrl"><input type="hidden" class="currStutas" value="' + data[i].JK + '">' +
  1436. '<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">' +
  1437. '<label><input name="switch-field-1" ' + curChecked + ' class="ace ace-switch ace-switch-4 btn-rotate" type="checkbox">' +
  1438. '<span class="lbl"></span></label></div></div></div>';
  1439. if (i == data.length - 1) {
  1440. $('#ctrlBox').html(html);
  1441. }
  1442. }
  1443. } else {
  1444. $('#ctrlBox').html('<div style="text-align:center">空</div>');
  1445. }
  1446. }
  1447. $('#ctrlBox').on('click', '.btn-rotate', function () {
  1448. var _this = this;
  1449. $(this).parents('.equipCtrl').find('.ctrlLoading').remove()
  1450. $(this).attr('disabled', true);
  1451. $(this).parents('.equipCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  1452. var currWay = $(this).parents('.equipCtrl').find('.currStutas').val();
  1453. var imei = $('#qxzPhotoId').val();
  1454. if ($(this).is(":checked")) {
  1455. var oldStatus = 0;
  1456. var currStutas = 1;
  1457. } else {
  1458. var oldStatus = 1;
  1459. var currStutas = 0;
  1460. }
  1461. $.ajax({
  1462. url: 'qxz_switch',
  1463. type: 'post',
  1464. data: {
  1465. 'req': 'set',
  1466. 'imei': imei,
  1467. 'way': currWay,
  1468. 'switch': currStutas
  1469. },
  1470. success: function (data) {
  1471. setTimeout(function () {
  1472. var id = $('#firstpane .menu-active').attr('id')
  1473. loadProject(id);
  1474. }, 5000)
  1475. // $(_this).attr('disabled', false);
  1476. // $(_this).parents('.equipCtrl').find('.ctrlLoading').html('');
  1477. // if (currStutas) {
  1478. // $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
  1479. // } else {
  1480. // $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
  1481. // }
  1482. },
  1483. error: function (type) {
  1484. layer.close(loadingFlag);
  1485. $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1486. $(_this).attr('disabled', false);
  1487. if (oldStatus) {
  1488. $(_this).prop('checked', true);
  1489. $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
  1490. } else {
  1491. $(_this).prop('checked', '');
  1492. $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
  1493. }
  1494. }
  1495. })
  1496. })
  1497. // 下发控制名称
  1498. $('#ctrlBox').on('click', '.setName', function () {
  1499. var _this = this;
  1500. var ele = $(this).parents('.equipCtrl').find('.numName');
  1501. var currWay = $(this).parents('.equipCtrl').find('.currStutas').val();
  1502. layui.use('layer', function () {
  1503. var layer = layui.layer;
  1504. layer.prompt({ title: '自定义名称', offset: '300px', formType: 0, value: ele.html(), maxlength: 10 }, function (text, index) {
  1505. if (text == ele.html()) {
  1506. return false;
  1507. layer.close(index);
  1508. layer.msg('演示完毕!您的口令:' + text);
  1509. ele.html(text)
  1510. }
  1511. $.ajax({
  1512. url: 'qxz_switch_name',
  1513. type: 'post',
  1514. data: {
  1515. 'imei': $('#qxzPhotoId').val(),
  1516. 'way': currWay,
  1517. 'sw_name': text
  1518. },
  1519. success: function (data) {
  1520. if (data == 0) {
  1521. ele.html(text)
  1522. }
  1523. layer.close(index);
  1524. },
  1525. error: function (type) {
  1526. $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1527. $(_this).attr('disabled', false);
  1528. if (oldStatus) {
  1529. $(_this).prop('checked', true);
  1530. $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
  1531. } else {
  1532. $(_this).prop('checked', '');
  1533. $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
  1534. }
  1535. }
  1536. })
  1537. });
  1538. });
  1539. })
  1540. // 获取最新控制按钮状态
  1541. function qxzDownCtrlFun() {
  1542. $.ajax({
  1543. url: 'qxz_switch',
  1544. type: 'post',
  1545. data: {
  1546. 'req': 'conf', //
  1547. 'imei': $('#qxzPhotoId').val(),
  1548. },
  1549. beforeSend: function () {
  1550. loadFlage = layer.load();
  1551. },
  1552. complete: function () {
  1553. setTimeout(function () {
  1554. layer.close(loadFlage);
  1555. }, 5000)
  1556. },
  1557. success: function (data) {
  1558. setTimeout(function () {
  1559. loadProject($('#qxzPhotoId').val())
  1560. }, 5000)
  1561. }
  1562. })
  1563. }
  1564. // 获取最新数据
  1565. function newDataRefresh() {
  1566. $.ajax({
  1567. url: 'qxz_switch',
  1568. type: 'post',
  1569. data: {
  1570. 'req': 'read',
  1571. 'imei': $('#qxzPhotoId').val(),
  1572. },
  1573. beforeSend: function () {
  1574. loadFlage = layer.load();
  1575. },
  1576. complete: function () {
  1577. setTimeout(function () {
  1578. layer.close(loadFlage);
  1579. }, 5000)
  1580. },
  1581. success: function (data) {
  1582. setTimeout(function () {
  1583. loadProject($('#qxzPhotoId').val())
  1584. }, 5000)
  1585. }
  1586. })
  1587. }
  1588. // 设备列表
  1589. var currpage = 1;
  1590. function changePage(symbol) {
  1591. var totelpage = Number($('#totelpage').html());
  1592. if (symbol == 'add') {
  1593. if (currpage < totelpage) {
  1594. currpage++;
  1595. $('#currentpage').html(currpage);
  1596. $('#jumpPage').val(currpage);
  1597. $('addPage').attr('disable', 'false')
  1598. } else {
  1599. $('addPage').attr('disable', 'true')
  1600. return false;
  1601. }
  1602. } else if (symbol == 'jian') {
  1603. if (currpage > 1) {
  1604. currpage--;
  1605. $('#currentpage').html(currpage);
  1606. $('#jumpPage').val(currpage);
  1607. $('jianPage').attr('disable', 'false')
  1608. } else {
  1609. $('jianPage').attr('disable', 'true')
  1610. return false;
  1611. }
  1612. } else if (symbol == 'jump') {
  1613. var jumpPage = $('#jumpPage').val();
  1614. if (jumpPage <= totelpage && jumpPage > 0) {
  1615. currpage = jumpPage;
  1616. } else if (jumpPage > totelpage) {
  1617. currpage = totelpage;
  1618. } else if (jumpPage < 0) {
  1619. currpage = 1;
  1620. }
  1621. $('#jumpPage').val(currpage);
  1622. $('#currentpage').html(currpage);
  1623. }
  1624. getEquipList(currpage, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1625. }
  1626. // 首页
  1627. function gotofirstpage() {
  1628. currpage = 1;
  1629. $('#currentpage').html(1);
  1630. $('#jumpPage').val(1);
  1631. getEquipList(1, $('#searchImei').val())
  1632. }
  1633. // 定时刷新
  1634. // msgInterval = setInterval(function () {
  1635. // var currid = $('#firstpane .menu-active').attr('id');
  1636. // loadProject(currid);
  1637. // }, 60000);
  1638. var waterTempId = [16062009, 16062010, 16062011, 16062012, 16062013, 16062014, 16062015, 16062016, 16062017, 16062018, 16062019, 16062020, 16062021, 16062022, 16062023, 16062024, 16062025];
  1639. // 实时状态
  1640. function newStatus(statusBox, data, facId) {
  1641. var dat = data.dat;
  1642. var html = '';
  1643. $(document.getElementById(statusBox)).html('');
  1644. var random = ['bg_blue', 'bg_yellow', 'bg_green', 'bg_red', 'bg_purpol', 'bg_darkblue']; //颜色随机
  1645. if (Object.keys(dat).length) {
  1646. for (var i = 1; i < 31; i++) {
  1647. var ekeyNum = 'e' + i;
  1648. if (dat[ekeyNum] != '' && (parseInt(dat[ekeyNum].split('#')[1]) != 163)) {
  1649. if (dat[ekeyNum].split('#')[0] == -99.99) {
  1650. var eVal = 'N/A';
  1651. } else {
  1652. if(dat[ekeyNum].split('#')[1] == 117){ //判断是否是雨雪天气
  1653. var eVal = dat[ekeyNum].split('#')[0]?'有':'无';
  1654. }else{
  1655. var eVal = dat[ekeyNum].split('#')[0];
  1656. }
  1657. }
  1658. var eNum = dat[ekeyNum].split('#')[1];
  1659. var ekey = dat[ekeyNum].split('#')[2];
  1660. var colorClass = eNum % 4;
  1661. // if(Object.keys(data.conf).length){
  1662. var eTxtUnit = data.conf[ekeyNum].split('#')[0];
  1663. var eUnit = data.conf[ekeyNum].split('#')[1];
  1664. // }
  1665. html += '<div class="swiper-slide"><div class="elValBox ' + random[colorClass] + '">'+
  1666. '<p class="elNum">'+ekey+'</p><div class="elVal">'+eVal+'</div></div>'+
  1667. '<div class="eLtxt">'+eTxtUnit+'</div><div class="elUnit">'+eUnit+'</div></div>';
  1668. }
  1669. }
  1670. }
  1671. if (html) {
  1672. $(document.getElementById(statusBox)).append(html);
  1673. var swiper = new Swiper('.swiper-container', {
  1674. slidesPerView: swiperCount,
  1675. spaceBetween: 30,
  1676. navigation: {
  1677. nextEl: '.swiper-button-next',
  1678. prevEl: '.swiper-button-prev',
  1679. },
  1680. });
  1681. } else {
  1682. html = '<div style="text-align:center">空</div>';
  1683. $(document.getElementById(statusBox)).append(html);
  1684. // $('.widget-content .equip_name').html('');
  1685. // var id = $('#firstpane .menu-active').attr('id')
  1686. // $('.widget-content .equip_id').html('设备ID:' + id);
  1687. // $('#viewPhoto').attr('src', 'qxz_photo/default.jpg');
  1688. // scrollBar()
  1689. }
  1690. scrollBar()
  1691. }
  1692. // 24小时数据
  1693. function get24Data(facId) {
  1694. $.ajax({
  1695. url: 'qxz_day_data',
  1696. type: 'post',
  1697. dataType: 'json',
  1698. data: {
  1699. e_id: facId,
  1700. },
  1701. beforeSend: function (XMLHttpRequest) {
  1702. loadingFlag = layer.load();
  1703. },
  1704. success: function (data) {
  1705. layer.close(loadingFlag);
  1706. $("#newtable tr:not(:first)").remove();
  1707. if (data.data.length) {
  1708. Fill_Table('newtable', data, facId)
  1709. } else {
  1710. Fill_null_Table('newtable', data, facId)
  1711. }
  1712. },
  1713. error: function (type) {
  1714. layer.close(loadingFlag);
  1715. layer.msg('请求失败');
  1716. $("#newtable tr:not(:first)").remove();
  1717. }
  1718. })
  1719. }
  1720. function Fill_Table(table_id, data, facId) {
  1721. var dat = data.data;
  1722. //js循环读取json数据
  1723. var table = document.getElementById(table_id).children[1];
  1724. for (var i = 0; i < dat.length; i++) {
  1725. var row = table.insertRow(table.rows.length);
  1726. var c1 = row.insertCell(0);
  1727. c1.innerHTML = dat[i].ekey;
  1728. var c2 = row.insertCell(1);
  1729. var eNum = dat[i].enum
  1730. var elementName = data.conf[dat[i].ekey].split('#');
  1731. c2.innerHTML = elementName[0] + '(' + elementName[1] + ')';
  1732. var c3 = row.insertCell(2);
  1733. if (dat[i].min == -99.99) {
  1734. c3.innerHTML = 'N/A';
  1735. } else {
  1736. if(eNum[0] == 117){
  1737. c3.innerHTML = dat[i].min?'有':'无';
  1738. }else{
  1739. c3.innerHTML = dat[i].min;
  1740. }
  1741. }
  1742. var c4 = row.insertCell(3);
  1743. var min_time = dat[i].mintime;
  1744. c4.innerHTML = min_time;
  1745. var c5 = row.insertCell(4);
  1746. if (dat[i].max == -99.99) {
  1747. c5.innerHTML = 'N/A';
  1748. } else {
  1749. if(eNum[0] == 117){
  1750. c5.innerHTML = dat[i].max?'有':'无';
  1751. }else{
  1752. c5.innerHTML = dat[i].max;
  1753. }
  1754. }
  1755. var c6 = row.insertCell(5);
  1756. var max_time = dat[i].maxtime;
  1757. c6.innerHTML = max_time;
  1758. if (i == dat.length - 1) {
  1759. scrollBar()
  1760. }
  1761. }
  1762. }
  1763. function Fill_null_Table(table_id) {
  1764. var table = document.getElementById(table_id).children[1];
  1765. var row = table.insertRow(table.rows.length);
  1766. var c1 = row.insertCell(0);
  1767. c1.setAttribute('colspan', '16');
  1768. c1.setAttribute('class', 'nullData');
  1769. c1.innerHTML = "暂无数据";
  1770. scrollBar()
  1771. }
  1772. window.onresize = function () {
  1773. swiperWidth = $('.swiper-container').width();
  1774. swiperCount = Math.floor(swiperWidth/130);
  1775. swiper = new Swiper('.swiper-container', {
  1776. slidesPerView: swiperCount,
  1777. spaceBetween: 30,
  1778. navigation: {
  1779. nextEl: '.swiper-button-next',
  1780. prevEl: '.swiper-button-prev',
  1781. },
  1782. });
  1783. scrollBar()
  1784. }
  1785. // file 文件
  1786. // divId div id
  1787. // imgId 图片id
  1788. // fileId 文件id
  1789. // width 图片宽
  1790. // height 图片高
  1791. function previewImage(file, divId, imgId, fileId, width, height) {
  1792. width = $('#viewPhotoParent').width();
  1793. var div = document.getElementById(divId);
  1794. if (file.files && file.files[0]) {
  1795. if (file.files[0].size / 1024 / 1024 < 4) {
  1796. sendUserPhoto();
  1797. div.innerHTML = '<img id=' + imgId + ' onclick=$("#' + fileId + '").click()>';
  1798. var img = document.getElementById(imgId);
  1799. img.onload = function () {
  1800. // var rect = clacImgZoomParam(width, height, img.offsetWidth, img.offsetHeight);
  1801. img.width = width;
  1802. img.height = height;
  1803. // img.style.marginTop = rect.top+'px';
  1804. }
  1805. var reader = new FileReader();
  1806. reader.onload = function (evt) {
  1807. img.src = evt.target.result;
  1808. // $(window.parent.document).find('.nav-user-photo').attr('src',evt.target.result);
  1809. }
  1810. reader.readAsDataURL(file.files[0]);
  1811. // $('#userPhoto').submit();
  1812. } else {
  1813. $(file).val('');
  1814. layer.alert("图片过大!");
  1815. }
  1816. } else {//兼容IE
  1817. var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
  1818. file.select();
  1819. if (document.selection != undefined) {
  1820. var src = document.selection.createRange().text;
  1821. div.innerHTML = '<img id=' + imgId + '>';
  1822. var img = document.getElementById(imgId);
  1823. img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
  1824. var rect = clacImgZoomParam(width, height, img.offsetWidth, img.offsetHeight);
  1825. status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
  1826. div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;" + sFilter + src + "\"'></div>";
  1827. }
  1828. }
  1829. }
  1830. function clacImgZoomParam(maxWidth, maxHeight, width, height) {
  1831. var param = { top: 0, left: 0, width: width, height: height };
  1832. if (width > maxWidth || height > maxHeight) {
  1833. var rateWidth = width / maxWidth;
  1834. var rateHeight = height / maxHeight;
  1835. if (rateWidth > rateHeight) {
  1836. param.width = maxWidth;
  1837. param.height = Math.round(height / rateWidth);
  1838. } else {
  1839. param.width = Math.round(width / rateHeight);
  1840. param.height = maxHeight;
  1841. }
  1842. }
  1843. param.left = Math.round((maxWidth - param.width) / 2);
  1844. param.top = Math.round((maxHeight - param.height) / 2);
  1845. return param;
  1846. }
  1847. // 上传图片
  1848. function sendUserPhoto() {
  1849. var formData = new FormData($("#userPhoto")[0]);
  1850. $.ajax({
  1851. url: 'qxz_photo',
  1852. type: 'POST',
  1853. data: formData,
  1854. contentType: false,
  1855. processData: false,
  1856. success: function (data) {
  1857. if (data == 0) {
  1858. $(window.parent.document).find('.nav-user-photo').attr('src', $('#viewPhoto').prop('src'));
  1859. $('#uploadPhoto').val('');
  1860. }
  1861. else { layer.msg("上传失败!"); return false; }
  1862. }
  1863. });
  1864. }
  1865. // 设置阈值
  1866. function setthresholdFun(ele) {
  1867. var obj = $(ele);
  1868. var currValstr = obj.next().val();
  1869. var currVal = eval('(' + currValstr + ')');
  1870. layui.use(['layer', 'form'], function () {
  1871. var rule0 = "低于下限<span>开启</span>,高于上限<span>关闭</span>";
  1872. var rule1 = "低于下限<span>关闭</span>,高于上限<span>开启</span>";
  1873. var layer = layui.layer;
  1874. var form = layui.form;
  1875. //给表单赋值
  1876. form.val("formModel", {
  1877. "JK": currVal.JK
  1878. , "eKey": currVal.eKey
  1879. , "upper": currVal.upper
  1880. , "lower": currVal.lower
  1881. , "method": currVal.method
  1882. });
  1883. if (currVal.method == 1) {
  1884. $('#hintDiv').html(rule1)
  1885. } else {
  1886. $('#hintDiv').html(rule0)
  1887. }
  1888. form.on('radio(radioSwitch)', function (data) {
  1889. if (data.value == 1) {
  1890. $('#hintDiv').html(rule1)
  1891. } else {
  1892. $('#hintDiv').html(rule0)
  1893. }
  1894. });
  1895. layer.open({
  1896. type: 1,
  1897. title: '阈值设置',
  1898. offset: '380px',
  1899. btn: ['确定', '取消'],
  1900. area: ['600px', '300px'], //宽高
  1901. content: $('#Modal'),
  1902. success: function (layero, index) { // 成功弹出后回调
  1903. // 添加form标识
  1904. layero.addClass('layui-form');
  1905. // 将保存按钮改变成提交按钮
  1906. layero.find('.layui-layer-btn0').attr({
  1907. 'lay-filter': 'setYuzhi',
  1908. 'lay-submit': ''
  1909. });
  1910. },
  1911. yes: function (index, layero) {
  1912. form.on('submit(setYuzhi)', function (data) {
  1913. var dat = data.field;
  1914. if (parseInt(data.field.upper) < parseInt(data.field.lower)) {
  1915. layer.tips('最大值不能小于最小值!', $('#upper'));
  1916. return false;
  1917. }
  1918. var hideVal = JSON.stringify(data.field)
  1919. var id = $('#firstpane .menu-active').attr('id')
  1920. data.field.equip_id = id;
  1921. var curinputBtn = obj.parent().find('.ace-switch');
  1922. if (curinputBtn.is(":checked")) {
  1923. var oldStatus = 0;
  1924. var currStutas = 1;
  1925. } else {
  1926. var oldStatus = 1;
  1927. var currStutas = 0;
  1928. }
  1929. obj.parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  1930. $.ajax({
  1931. url: 'qxz_value_mqtt',
  1932. type: 'post',
  1933. data: data.field,
  1934. success: function (data) {
  1935. setTimeout(function () {
  1936. curinputBtn.attr('disabled', false);
  1937. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('');
  1938. obj.parent().find('.maxminNum').find('p').eq(0).find('span').html(dat.upper)//最大值
  1939. obj.parent().find('.maxminNum').find('p').eq(1).find('span').html(dat.lower)//最小值
  1940. obj.parents('.thresholdCtrl').find('.ace-switch').prop('checked', 'checked');//开启阈值
  1941. var id = $('#firstpane .menu-active').attr('id')
  1942. loadProject(id);
  1943. }, 5000)
  1944. },
  1945. error: function (type) {
  1946. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1947. curinputBtn.attr('disabled', false);
  1948. }
  1949. })
  1950. // $('.maxminNum')
  1951. layer.closeAll(); //疯狂模式,关闭所有层
  1952. return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
  1953. });
  1954. }
  1955. , btn2: function (index, layero) {
  1956. $('#Modal').hide()
  1957. //return false 开启该代码可禁止点击该按钮关闭
  1958. }
  1959. });
  1960. });
  1961. }
  1962. // 下发阈值控制
  1963. $('#getthresholdDiv').on('click', '.ace-switch', function () {
  1964. var _this = this;
  1965. $(this).parents('.thresholdCtrl').find('.ctrlLoading').remove()
  1966. $(this).attr('disabled', true);
  1967. $(this).parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  1968. var currVal = $(this).parents('.thresholdCtrl').find('.currVal').val();
  1969. var currWayjson = JSON.parse(currVal);
  1970. var id = $('#firstpane .menu-active').attr('id')
  1971. currWayjson.equip_id = id;
  1972. if ($(this).is(":checked")) { //开启
  1973. var oldStatus = 0;
  1974. var currStutas = 1;
  1975. } else { //关闭
  1976. var oldStatus = 1;
  1977. var currStutas = 0;
  1978. currWayjson.upper = '32767';
  1979. currWayjson.lower = '32767';
  1980. }
  1981. $.ajax({
  1982. url: 'qxz_value_mqtt',
  1983. type: 'post',
  1984. data: currWayjson,
  1985. success: function (data) {
  1986. setTimeout(function () {
  1987. $(_this).attr('disabled', false);
  1988. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('');
  1989. var id = $('#firstpane .menu-active').attr('id')
  1990. loadProject(id);
  1991. }, 5000)
  1992. },
  1993. error: function (type) {
  1994. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1995. $(_this).attr('disabled', false);
  1996. if (oldStatus) {
  1997. $(_this).prop('checked', true);
  1998. } else {
  1999. $(_this).prop('checked', '');
  2000. }
  2001. }
  2002. })
  2003. })
  2004. // 定时开关
  2005. function timingOnOff(ele) {
  2006. var obj = $(ele);
  2007. var currValstr = obj.next().val();
  2008. var currVal = eval('(' + currValstr + ')');
  2009. layui.use(['layer', 'form'], function () {
  2010. var layer = layui.layer;
  2011. var form = layui.form;
  2012. form.verify({
  2013. starttimeRegex: function (value, item) { //value:表单的值、item:表单的DOM对象
  2014. if (value < 0 || value > 23) {
  2015. return '请输入范围内数值';
  2016. }
  2017. },
  2018. durationRegex: function (value, item) { //value:表单的值、item:表单的DOM对象
  2019. if (value < 1 || value > 24) {
  2020. return '请输入范围内数值';
  2021. }
  2022. }
  2023. });
  2024. //给表单赋值
  2025. form.val("formModel", {
  2026. "JK": currVal.JK
  2027. , "StartTime": currVal.StartTime
  2028. , "Duration": currVal.Duration
  2029. });
  2030. layer.open({
  2031. type: 1,
  2032. title: '阈值设置',
  2033. offset: '380px',
  2034. btn: ['确定', '取消'],
  2035. area: ['600px', '300px'], //宽高
  2036. content: $('#timingOnOffModal'),
  2037. success: function (layero, index) { // 成功弹出后回调
  2038. // 添加form标识
  2039. layero.addClass('layui-form');
  2040. // 将保存按钮改变成提交按钮
  2041. layero.find('.layui-layer-btn0').attr({
  2042. 'lay-filter': 'setdingshi',
  2043. 'lay-submit': ''
  2044. });
  2045. },
  2046. yes: function (index, layero) {
  2047. form.on('submit(setdingshi)', function (data) {
  2048. var hideVal = JSON.stringify(data.field)
  2049. var dat = data.field;
  2050. var curinputBtn = obj.parent().find('.ace-switch');
  2051. if (curinputBtn.is(":checked")) {
  2052. var oldStatus = 0;
  2053. var currStutas = 1;
  2054. } else {
  2055. var oldStatus = 1;
  2056. var currStutas = 0;
  2057. }
  2058. var id = $('#firstpane .menu-active').attr('id')
  2059. dat.equip_id = id;
  2060. obj.parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  2061. $.ajax({
  2062. url: 'qxz_timing_mqtt',
  2063. type: 'post',
  2064. data: dat,
  2065. success: function (data) {
  2066. setTimeout(function () {
  2067. obj.next().val(hideVal)
  2068. curinputBtn.attr('disabled', false);
  2069. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('');
  2070. obj.parent().find('.maxminNum').find('p').eq(0).find('span').html(dat.StartTime)//最大值
  2071. obj.parent().find('.maxminNum').find('p').eq(1).find('span').html(dat.Duration)//最小值
  2072. obj.parents('.thresholdCtrl').find('.ace-switch').prop('checked', 'checked');//开启阈值
  2073. var id = $('#firstpane .menu-active').attr('id')
  2074. loadProject(id);
  2075. }, 5000)
  2076. },
  2077. error: function (type) {
  2078. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  2079. curinputBtn.attr('disabled', false);
  2080. }
  2081. })
  2082. // $('.maxminNum')
  2083. layer.closeAll(); //疯狂模式,关闭所有层
  2084. return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
  2085. });
  2086. }
  2087. , btn2: function (index, layero) {
  2088. $('#Modal').hide()
  2089. //return false 开启该代码可禁止点击该按钮关闭
  2090. }
  2091. });
  2092. });
  2093. }
  2094. $('#starttime').on('blur', function () {
  2095. $(this).val(parseInt($(this).val()))
  2096. })
  2097. $('#Duration').on('blur', function () {
  2098. $(this).val(parseInt($(this).val()))
  2099. })
  2100. // 下发定时开关
  2101. $('#gettimingDiv').on('click', '.ace-switch', function () {
  2102. var _this = this;
  2103. var currVal = $(this).parents('.thresholdCtrl').find('.currVal').val();
  2104. var currWayjson = JSON.parse(currVal);
  2105. var id = $('#firstpane .menu-active').attr('id')
  2106. currWayjson.equip_id = id;
  2107. if (currWayjson.StartTime == '--' || currWayjson.Duration == '--') {
  2108. $(this).parents('.thresholdCtrl').find('.setthresholdBtn').click();
  2109. layer.msg('请先设置定时时间', { icon: 2 })
  2110. return false;
  2111. }
  2112. $(this).parents('.thresholdCtrl').find('.ctrlLoading').remove()
  2113. $(this).attr('disabled', true);
  2114. $(this).parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  2115. if ($(this).is(":checked")) { //开启
  2116. var oldStatus = 0;
  2117. var currStutas = 1;
  2118. } else { //关闭
  2119. var oldStatus = 1;
  2120. var currStutas = 0;
  2121. currWayjson.StartTime = '255';
  2122. currWayjson.Duration = '32767';
  2123. }
  2124. $.ajax({
  2125. url: 'qxz_timing_mqtt',
  2126. type: 'post',
  2127. data: currWayjson,
  2128. success: function (data) {
  2129. setTimeout(function () {
  2130. $(_this).attr('disabled', false);
  2131. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('');
  2132. var id = $('#firstpane .menu-active').attr('id')
  2133. loadProject(id);
  2134. }, 5000)
  2135. },
  2136. error: function (type) {
  2137. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  2138. $(_this).attr('disabled', false);
  2139. if (oldStatus) {
  2140. $(_this).prop('checked', true);
  2141. } else {
  2142. $(_this).prop('checked', '');
  2143. }
  2144. }
  2145. })
  2146. })
  2147. // 设置要素名称
  2148. function setEleName() {
  2149. var e_id = $('#firstpane .menu-active').attr('id')
  2150. $.ajax({
  2151. url: 'qxz_title_conf',
  2152. type: 'get',
  2153. data: {
  2154. e_id: e_id
  2155. },
  2156. dataType: 'json',
  2157. success: function (data) {
  2158. var dataa = [];
  2159. var len = Object.keys(data.default).length;
  2160. for (var i = 1; i <= len; i++) {
  2161. var key = 'e' + i;
  2162. if (data.default[key]) {
  2163. var detxt = data.default[key].split('#')[0];
  2164. var deunit = data.default[key].split('#')[1];
  2165. if (data.conf[key]) {
  2166. var conftxt = data.conf[key].split('#')[0];
  2167. } else {
  2168. var conftxt = '-';
  2169. }
  2170. dataa.push({
  2171. "ekey": key,
  2172. "name": conftxt,
  2173. "elementName": detxt,
  2174. "unit": deunit
  2175. })
  2176. }
  2177. if (i == len) {
  2178. // console.log(dataa)
  2179. //页面层
  2180. layer.open({
  2181. type: 1,
  2182. title: '修改要素名称',
  2183. area: ['800px', '540px'], //宽高
  2184. content: $('#eleName'),
  2185. skin: 'layui-layer-editName', //样式类名
  2186. success: function (layero, index) {
  2187. layui.use('table', function () {
  2188. var table = layui.table;
  2189. table.render({
  2190. elem: '#eleTable'
  2191. , data: dataa
  2192. , done: function (res, curr, count) {
  2193. $("table").css("width", "100%");
  2194. }
  2195. , limit: 30
  2196. , cols: [[
  2197. { field: 'ekey', width: '25%', align: 'center', title: '通道号' }
  2198. , { field: 'name', width: '35%', align: 'center', title: '<i class="layui-icon">&#xe642;</i>名称', event: 'cellClick' }
  2199. , { field: 'elementName', width: '40%', align: 'center', title: '要素' }
  2200. ]]
  2201. });
  2202. table.on('tool(eleTable)', function (obj) {
  2203. switch (obj.event) {
  2204. case 'cellClick':
  2205. CellClick(this, obj, e_id);
  2206. break;
  2207. };
  2208. });
  2209. });
  2210. },
  2211. cancel: function (index, layero) {
  2212. loadProject(e_id);
  2213. }
  2214. });
  2215. }
  2216. }
  2217. },
  2218. error: function (type) {
  2219. layer.msg('请求失败');
  2220. }
  2221. })
  2222. }
  2223. layui.use(['form'], function () {
  2224. var form = layui.form;
  2225. form.on('switch(equipTypeDemo)', function (obj) {
  2226. var state = obj.elem.checked ? 1 : 0;
  2227. //方法二取数据 (根据索引table.cache里面的行数据)
  2228. var index = obj.othis.parents('tr').attr("data-index");
  2229. datMsg[index].type = state;
  2230. });
  2231. })
  2232. function CellClick(that, obj, e_id) {
  2233. //当前点击字段
  2234. var field = $(that).data("field");
  2235. //判断是否需要添加编辑框
  2236. if (field == "edit") return true;
  2237. //当前行数据
  2238. var data = obj.data;
  2239. //当前单元格的值
  2240. var value = data[field];
  2241. //当前点击td的宽高
  2242. var height = $(that)[0].offsetHeight, width = $(that)[0].offsetWidth;
  2243. //当前点击td的坐标
  2244. var top = $(that).offset().top, left = $(that).offset().left;
  2245. //输入框 这里可以自定义表单内容
  2246. var input = '<input type="text" maxlength=10 class="layui-input" id="' + field + '_input" data-field="' + field + '" style="width:' + width + 'px;height:' + height + 'px">';
  2247. //弹出层
  2248. layer.open({
  2249. type: 1
  2250. , title: false
  2251. , page: true
  2252. , limit: 1
  2253. , closeBtn: 0
  2254. , area: [width + "px", height + "px"]
  2255. , shade: [0.01, '#fff']
  2256. , shadeClose: true
  2257. , content: input //这里content是一个普通的String
  2258. , offset: [top, left]
  2259. , success: function () {
  2260. //使弹出层相对定位
  2261. $(".layui-layer-page").css("position", "absolute")
  2262. //设置输入框的值
  2263. $("#" + field + "_input").val(value);
  2264. $("#" + field + "_input").blur(function () {
  2265. var dat = data;
  2266. var ekey = dat.ekey;
  2267. var conf = $(this).val();
  2268. var unit = data.unit;
  2269. $.ajax({
  2270. url: 'qxz_title_conf',
  2271. type: 'post',
  2272. data: {
  2273. e_id: e_id,
  2274. ekey: ekey,
  2275. conf: conf + '#' + unit
  2276. },
  2277. dataType: 'json',
  2278. success: function (data) {
  2279. if (data == 0) {
  2280. //同步更新缓存对应的值
  2281. dat[field] = conf;
  2282. obj.update(dat);
  2283. layer.msg('修改成功')
  2284. }
  2285. },
  2286. error: function (type) {
  2287. layer.msg('修改失败')
  2288. }
  2289. })
  2290. })
  2291. }
  2292. });
  2293. }
  2294. function thresholdClick(that, obj, e_id, form) {
  2295. //当前点击字段
  2296. var field = $(that).data("field");
  2297. // console.log(obj)
  2298. //判断是否需要添加编辑框
  2299. if (field == "edit") return true;
  2300. //当前行数据
  2301. var data = obj.data;
  2302. //当前单元格的值
  2303. var value = data[field];
  2304. //当前点击td的宽高
  2305. var height = $(that)[0].offsetHeight, width = $(that)[0].offsetWidth;
  2306. //当前点击td的坐标
  2307. var top = $(that).offset().top, left = $(that).offset().left;
  2308. //输入框 这里可以自定义表单内容
  2309. 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">';
  2310. //弹出层
  2311. layer.open({
  2312. type: 1
  2313. , title: false
  2314. , page: true
  2315. , limit: 1
  2316. , closeBtn: 0
  2317. , area: [width + "px", height + "px"]
  2318. , shade: [0.01, '#fff']
  2319. , shadeClose: true
  2320. , content: input //这里content是一个普通的String
  2321. , offset: [top, left]
  2322. , success: function () {
  2323. //使弹出层相对定位
  2324. $(".layui-layer-page").css("position", "absolute")
  2325. //设置输入框的值
  2326. $("#" + field + "_input").val(value);
  2327. $("#" + field + "_input").focus()
  2328. $("#" + field + "_input").blur(function () {
  2329. var dat = data;
  2330. var ekey = dat.ekey;
  2331. var conf = $(this).val();
  2332. var unit = data.unit;
  2333. dat[field] = conf || "";
  2334. obj.update(dat);
  2335. form.render()
  2336. })
  2337. }
  2338. });
  2339. }
  2340. // 查看详情
  2341. function historyData(){
  2342. var id = $('#firstpane .menu-active').attr('id')
  2343. window.location.href = 'qxz_report?id='+id
  2344. }
  2345. </script>
  2346. </body>
  2347. </html>