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. 第
  633. <span id="currentpage">1</span>页
  634. <button class="btn btn-minier btn-yellow" id="addPage" onclick="changePage('add')">下一页</button>
  635. 共<span id="totelpage">4</span>页
  636. </div>
  637. <div class="equipPage">
  638. 跳转 <input type="text" id="jumpPage" value="1"
  639. style="width: 60px;height: 30px;text-align: center;"
  640. onkeypress="if (event.keyCode == 13) changePage('jump');"> 页
  641. <button class="btn btn-minier btn-yellow" id="jianPage" onclick="changePage('jump')">确定</button>
  642. </div>
  643. </div>
  644. <div class="">
  645. <div class="widget-box" style="margin-top: 20px;">
  646. <div class="widget-title">
  647. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  648. <h5>项目信息</h5>
  649. </div>
  650. </div>
  651. <div class="widget-content" style="padding: 0px;margin-top: 8px;">
  652. <div>
  653. <!-- <img src="www.yfzhwlw.com/qxz_photo/default.png" class="equip_photo" width="100%" height="100%" style=""> -->
  654. <form action="" method="post" id="userPhoto" class="form-horizontal"
  655. enctype="multipart/form-data">{% csrf_token %}
  656. <input type="hidden" value="" id="qxzPhotoId" name="id">
  657. <div class="personal-avatar">
  658. <div class="top-avatar" id="viewPhotoParent">
  659. <img id="viewPhoto" class="equip_photo" onclick="$('#uploadPhoto').click()"
  660. src="" width="100%" height="100%">
  661. </div>
  662. <a class="upload-avatar" href="javascript:;">
  663. <input class="upload-btn" name="upicture"
  664. onchange="previewImage(this,'viewPhotoParent','viewPhoto','uploadPhoto','100%',200)"
  665. type="file" id="uploadPhoto">
  666. </a>
  667. <!-- <input type="hidden" name="req" value="photo"> -->
  668. </div>
  669. </form>
  670. </div>
  671. <div class="todo" style="background: white;margin-top: 5px;" id="qxzInfoDiv">
  672. <ul>
  673. <li class="clearfix">
  674. <div class="txt equip_name">&nbsp;&nbsp;</div>
  675. </li>
  676. <li class="clearfix">
  677. <div class="txt equip_id">&nbsp;&nbsp;</div>
  678. </li>
  679. <li class="clearfix" id="isonline">
  680. <div class="txt">&nbsp;&nbsp;</div>
  681. </li>
  682. </ul>
  683. </div>
  684. </div>
  685. </div>
  686. </div>
  687. <!-- 右 -->
  688. <div class="col-xs-12 col-sm-9 col-md-10">
  689. <!-- 实时状态 -->
  690. <div class="currTimeStatus">
  691. <div class="widget-box" style="margin-top: 0px;">
  692. <div class="widget-title">
  693. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  694. <h5>实时状态</h5>
  695. <div class="equipInfo" id="equipInfo"> </div>
  696. <div class="span5" id="equipCtrlDiv" style="float: right;">
  697. <button class="btn btn-white btn-primary" id="newDataRefresh" onclick="newDataRefresh()"
  698. type="button">
  699. <i class="fa fa-refresh" aria-hidden="true"></i>
  700. </button>
  701. <button class="btn btn-white btn-primary" id="setEleName" onclick="setEleName()"
  702. type="button">
  703. <i class="fa fa-cog" aria-hidden="true"></i>
  704. </button>
  705. <button class="btn btn-white btn-primary" id="updataTime" type="button">2020-03-12
  706. 13:48:15</button>
  707. </div>
  708. <div style="float: right;margin-right:5px;" id="sinCodeInquire">
  709. <!-- <button class="btn btn-white btn-primary" onclick="inquireSim('89860403101970072488')" id="" type="button">流量查询</button> -->
  710. </div>
  711. </div>
  712. </div>
  713. </div>
  714. <!-- <div class="body-content clearfix row" id="newStatusBox"> -->
  715. <!-- <div class="dev col-xs-4 col-md-3 col-lg-2 bg_lb">
  716. <div class="left">
  717. <img class="img-dev" src="{% static '/img/switchBtnIcon.png' %}">
  718. </div>
  719. <div class="right">
  720. <div class="name">风速</div>
  721. <div class="data">
  722. <strong>
  723. <span style="font-size: 25px;">0.0</span>
  724. </strong>m/s</div>
  725. </div>
  726. </div> -->
  727. <!-- </div> -->
  728. <div style="position: relative;">
  729. <!-- Swiper -->
  730. <div class="swiper-container" style="width:95%;height:120px;">
  731. <div class="swiper-wrapper" id="newStatusBox">
  732. <div class="swiper-slide">
  733. <div class="elValBox">
  734. <p class="elNum">e1</p>
  735. <div class="elVal">33</div>
  736. </div>
  737. <div class="eLtxt">辐射累积辐射辐射累积辐射辐射累积辐射</div>
  738. <div class="elUnit">(m j / m ㎡)</div>
  739. </div>
  740. </div>
  741. </div>
  742. <div class="swiper-button-prev"></div>
  743. <div class="swiper-button-next"></div>
  744. </div>
  745. <!-- 设备手动控制 -->
  746. <div id="ctrlBoxParentDiv">
  747. <div class="currTimeStatus">
  748. <div class="widget-box">
  749. <div class="widget-title">
  750. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  751. <h5>设备手动控制</h5>
  752. <button class="btn btn-white btn-primary qxzDownCtrl" onclick="qxzDownCtrlFun()">
  753. <i class="fa fa-refresh" aria-hidden="true"></i>
  754. </button>
  755. </div>
  756. </div>
  757. </div>
  758. <div class="row handCtrlBox" id="ctrlBox">
  759. <!-- <div class="col-xs-2">
  760. <div class="equipCtrl">
  761. <input type="hidden" value="1">
  762. <div>
  763. <span class="isonlineicon active"></span>
  764. 控制1
  765. </div>
  766. <div class="equipCtrlInp">
  767. <label>
  768. <input name="switch-field-1" checked class="ace ace-switch ace-switch-4 btn-rotate" type="checkbox">
  769. <span class="lbl"></span>
  770. </label>
  771. </div>
  772. </div>
  773. </div> -->
  774. </div>
  775. </div>
  776. <!-- 设备阈值控制 -->
  777. <div id="getthresholdDivParentDiv">
  778. <div class="currTimeStatus">
  779. <div class="widget-box" style="margin-top: 0px;">
  780. <div class="widget-title">
  781. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  782. <h5>设备阈值控制</h5>
  783. <button class="btn btn-white btn-primary qxzDownCtrl" id="" onclick="" type="button">
  784. <i class="fa fa-refresh" aria-hidden="true"></i>
  785. </button>
  786. </div>
  787. </div>
  788. </div>
  789. <div class="row" id="getthresholdDiv">
  790. <!-- <div class="col-xs-2 col-sm-3">
  791. <div class="thresholdCtrl">
  792. <div class="setthresholdBtn" onclick="setthresholdFun(this)">
  793. <i class="fa fa-cog setName" aria-hidden="true"></i>
  794. </div>
  795. <input type="hidden" class="currVal" value='{"JK":1,"eKey":1,"upper":700,"lower":300,"method":1}'>
  796. <div class="thresholdCtrlName">
  797. <p>开关1(e1)</p>
  798. </div>
  799. <div class="thresholdCtrlShowDiv">
  800. <div class="qxys">
  801. <div>
  802. <img src="{% static '/img/dev/icon_110.png' %}" alt="">
  803. </div>
  804. <div>雨量累计</div>
  805. </div>
  806. <div class="maxminNum">
  807. <p>最大值:
  808. <span>30</span>
  809. </p>
  810. <p>最小值:
  811. <span>10</span>
  812. </p>
  813. </div>
  814. </div>
  815. <div class="equipCtrlInp">
  816. <label>
  817. <input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">
  818. <span class="lbl"></span>
  819. </label>
  820. </div>
  821. </div>
  822. </div> -->
  823. </div>
  824. </div>
  825. <!-- 设备定时控制 -->
  826. <div id="timingDivParentDiv">
  827. <div class="currTimeStatus">
  828. <div class="widget-box" style="margin-top: 0px;">
  829. <div class="widget-title">
  830. <!-- <span class="icon"> <i class="icon-th"></i> </span> -->
  831. <h5>设备定时控制</h5>
  832. <button class="btn btn-white btn-primary qxzDownCtrl" id="" onclick="" type="button">
  833. <i class="fa fa-refresh" aria-hidden="true"></i>
  834. </button>
  835. </div>
  836. </div>
  837. </div>
  838. <div class="row" id="gettimingDiv">
  839. <!-- <div class="col-xs-2 col-sm-3">
  840. <div class="thresholdCtrl">
  841. <div class="setthresholdBtn" onclick="timingOnOff(this)">
  842. <i class="fa fa-cog setName" aria-hidden="true"></i>
  843. </div>
  844. <input type="hidden" class="currVal" value='{"JK":1,"StartTime":12,"Duration":10}'>
  845. <div class="thresholdCtrlName">
  846. <p>开关1(e1)</p>
  847. </div>
  848. <div class="thresholdCtrlShowDiv">
  849. <div class="maxminNum">
  850. <p>起始时间:
  851. <span>12</span>
  852. 点
  853. </p>
  854. <p>工作时长:
  855. <span>10</span>
  856. 小时
  857. </p>
  858. </div>
  859. </div>
  860. <div class="equipCtrlInp">
  861. <label>
  862. <input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">
  863. <span class="lbl"></span>
  864. </label>
  865. </div>
  866. </div>
  867. </div> -->
  868. </div>
  869. </div>
  870. <!-- 24小时数据 -->
  871. <div id="data24Div">
  872. <div class="currTimeStatus">
  873. <div class="widget-box">
  874. <div class="widget-title">
  875. <h5>24小时数据</h5>
  876. <div class="span5" id="equipCtrlDiv" style="float: right;">
  877. <button class="btn btn-white btn-primary" onclick="historyData()">历史数据 >></button>
  878. </div>
  879. </div>
  880. </div>
  881. </div>
  882. <div class="row">
  883. <div class="col-xs-12 col-md-12 col-lg-9">
  884. <table id="newtable" class="table table-striped table-hover">
  885. <tr>
  886. <td>传感器通道</td>
  887. <td>通道名称</td>
  888. <td>最小值</td>
  889. <td>最小值时间</td>
  890. <td>最大值</td>
  891. <td>最大值时间</td>
  892. </tr>
  893. <tbody>
  894. </tbody>
  895. </table>
  896. </div>
  897. </div>
  898. </div>
  899. </div>
  900. </div>
  901. </div>
  902. <!-- Modal -->
  903. <div id="Modal" class="model" style="display:none">
  904. <div>
  905. <form class="layui-form" action="" id="modelForm" lay-filter="formModel">
  906. <input type="hidden" value="" name="JK">
  907. <input type="hidden" value="" name="eKey">
  908. <div class="layui-form-item">
  909. <label class="layui-form-label">最大值</label>
  910. <div class="layui-input-inline">
  911. <input type="text" name="upper" id="upper" required lay-verify="required" placeholder="请输入最大值"
  912. autocomplete="off" class="layui-input">
  913. </div>
  914. </div>
  915. <div class="layui-form-item">
  916. <label class="layui-form-label">最小值</label>
  917. <div class="layui-input-inline">
  918. <input type="text" name="lower" required lay-verify="required" placeholder="请输入最小值"
  919. autocomplete="off" class="layui-input">
  920. </div>
  921. </div>
  922. <div class="layui-form-item">
  923. <label class="layui-form-label">规 则</label>
  924. <div class="layui-input-inline">
  925. <input type="radio" name="method" lay-filter="radioSwitch" value="1" title="程序一" checked="">
  926. <input type="radio" name="method" lay-filter="radioSwitch" value="0" title="程序二">
  927. </div>
  928. <div class="layui-form-mid layui-word-aux" id="hintDiv">低于下限
  929. <span>开启</span>,高于上限
  930. <span>关闭</span>
  931. </div>
  932. </div>
  933. </form>
  934. </div>
  935. </div>
  936. <!-- Modal2 -->
  937. <div id="timingOnOffModal" class="model" style="display:none">
  938. <div>
  939. <form class="layui-form" action="" id="modelForm" lay-filter="formModel">
  940. <input type="hidden" value="" name="JK">
  941. <div class="layui-form-item">
  942. <label class="layui-form-label">起始时间:</label>
  943. <div class="layui-input-inline">
  944. <input type="number" name="StartTime" id="starttime" required
  945. lay-verify="required|starttimeRegex" placeholder="请输入起始时间" autocomplete="off"
  946. class="layui-input">
  947. <!-- <select name="city" lay-verify="">
  948. <option value="">请选择一个城市</option>
  949. <option value="010">北京</option>
  950. <option value="021">上海</option>
  951. <option value="0571">杭州</option>
  952. </select>
  953. <select name="city" lay-verify="required">
  954. <option value=""></option>
  955. <option value="0">北京</option>
  956. <option value="1">上海</option>
  957. <option value="2">广州</option>
  958. <option value="3">深圳</option>
  959. <option value="4">杭州</option>
  960. </select> -->
  961. </div>
  962. <div class="layui-form-mid layui-word-aux">时间范围(0-23)</div>
  963. </div>
  964. <div class="layui-form-item">
  965. <label class="layui-form-label">工作时长:</label>
  966. <div class="layui-input-inline">
  967. <input type="number" name="Duration" id="Duration" required lay-verify="required|durationRegex"
  968. placeholder="请输入工作时长" autocomplete="off" class="layui-input">
  969. </div>
  970. <div class="layui-form-mid layui-word-aux">工作时长(1-24)</div>
  971. </div>
  972. </form>
  973. </div>
  974. </div>
  975. <!-- setEleName -->
  976. <div id="eleName" style="width:800px;display:none">
  977. <div style="width:95%;margin:0 auto;">
  978. <table class="layui-hide" id="eleTable" lay-filter="eleTable"></table>
  979. </div>
  980. </div>
  981. <!-- 管理员查看设备电压历史记录 -->
  982. <div id="record" style="display: none;">
  983. <div style="padding: 20px;width: 500px;float: left;">
  984. <table id="recordTable" lay-filter="recordTableFilter"></table>
  985. <div id="recordPage"></div>
  986. </div>
  987. <div style="margin-left: 480px;padding: 20px;">
  988. <div id="recordEcharts" style="height: 450px;width: 500px;"></div>
  989. </div>
  990. </div>
  991. {% verbatim %}
  992. <script type="text/html" id="switchTpl">
  993. <!-- 这里的 checked 的状态只是演示 -->
  994. <input type="checkbox" name="equipType" value="{{d.type}}" lay-skin="switch" lay-text="大于|小于"
  995. lay-filter="equipTypeDemo" {{ d.type == 1 ? 'checked' : '' }}>
  996. </script>
  997. {% endverbatim %}
  998. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  999. <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
  1000. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  1001. <script src="{% static '/js/common.js' %}?versions=0.5.4"></script>
  1002. <script src="{% static '/lib/js/echarts.min.js' %}"></script>
  1003. <script src="{% static '/lib/js/swiper.min.js' %}"></script>
  1004. <script type="text/javascript">
  1005. $.ajaxSetup({
  1006. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  1007. });
  1008. </script>
  1009. <script>
  1010. var swiperWidth = $('.swiper-container').width();
  1011. var swiperCount = Math.floor(swiperWidth/130);
  1012. //默认加载设备列表
  1013. getEquipList(1, '');
  1014. // 搜索
  1015. $('#searchBtn').on('click', function () {
  1016. getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1017. });
  1018. $('#searchImei').on('keyup', function (event) {
  1019. if (event.keyCode == 13) {
  1020. getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1021. }
  1022. })
  1023. function getEquipList(page, filter, is_online, etype) {
  1024. if (etype == undefined && is_online == undefined) {
  1025. var etype = ''
  1026. var is_online = ''
  1027. }
  1028. $.ajax({
  1029. url: 'qxz_page',
  1030. type: 'get',
  1031. dataType: 'json',
  1032. data: {
  1033. page: page,
  1034. f_id: filter,
  1035. etype: etype, //所属公司
  1036. is_online: is_online, //设备状态
  1037. },
  1038. beforeSend: function (XMLHttpRequest) {
  1039. loadingFlag = layer.load();
  1040. },
  1041. success: function (data) {
  1042. layer.close(loadingFlag);
  1043. if (data.nums) {
  1044. var html = '';
  1045. var msg = data.ids
  1046. var pagecount = Math.ceil(data.nums / 10);
  1047. for (var i = 0; i < msg.length; i++) {
  1048. if (msg[i].equip_name) {
  1049. var equip_name = '设备:' + msg[i].equip_name;
  1050. } else if (msg[i].equip_id.length == 15) {
  1051. var equip_name = '设备:' + msg[i].equip_id.substring(msg[i].equip_id.length - 8);
  1052. } else {
  1053. var equip_name = '设备:' + msg[i].equip_id;
  1054. }
  1055. var offTime = msg[i].off_time || '';
  1056. if (msg[i].is_online == 1) {
  1057. var classStatic = 'bjgreen';
  1058. } else if (msg[i].is_online == 0) {
  1059. var classStatic = 'bjred';
  1060. } else {
  1061. var classStatic = '';
  1062. }
  1063. // var equip_name = msg[i].equip_name?'---设备名:'+msg[i].equip_name:'';
  1064. 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>'
  1065. }
  1066. $('#firstpane .menu_body').html(html);
  1067. $('.equipPage').show();
  1068. $('#totelpage').html(pagecount)
  1069. // 菜单栏
  1070. $("#firstpane .menu_body:eq(0) a:eq(0)").addClass('menu-active');
  1071. $('.widget-content .equip_id').html('设备ID:' + msg[0].equip_id);
  1072. $('.widget-content .equip_name').html('项目名称:' + (msg[0].equip_name || '设备' + msg[0].equip_id));
  1073. $(".menu_body a").click(function () {
  1074. $(".menu_head").removeClass("currAstive");
  1075. $(".menu_body a").removeClass("menu-active");
  1076. $(this).addClass("menu-active");
  1077. $(this).parent().prev().addClass('currAstive');
  1078. // 名称切换
  1079. $('.widget-content .equip_id').html('设备ID:' + $(this).attr('id'));
  1080. $('.widget-content .equip_name').html('项目名称:' + ($(this).attr('name') || '设备' + $(this).attr('id')));
  1081. var facId = $(this).attr("id");
  1082. var currisonline = $(this).attr("isonline");
  1083. var curroffTime = $(this).attr("offTime");
  1084. if (currisonline == 0) {
  1085. $('#isonline').show();
  1086. $('#isonline div').html('离线时间:' + curroffTime);
  1087. } else {
  1088. $('#isonline').hide();
  1089. }
  1090. if (facId && facId != null && facId != "") {
  1091. loadProject(facId);
  1092. $('#qxzPhotoId').val(facId);
  1093. }
  1094. });
  1095. loadProject(msg[0].equip_id);
  1096. if (msg[0].is_online == 0) {
  1097. $('#isonline').show();
  1098. $('#isonline div').html('离线时间:' + (msg[0].off_time || ''));
  1099. } else {
  1100. $('#isonline').hide();
  1101. }
  1102. $('#qxzPhotoId').val(msg[0].equip_id)
  1103. } else {
  1104. $('.equipPage').hide();
  1105. var html = '<a href="javascript:;" class="text-overflow nulldata" data-pid="322">暂未设备</a>'
  1106. $('#firstpane .menu_body').html(html);
  1107. scrollBar()
  1108. }
  1109. },
  1110. error: function (type) {
  1111. layer.close(loadingFlag);
  1112. }
  1113. })
  1114. }
  1115. var nowledinfo;
  1116. // 查询SIM卡
  1117. function inquireSim(iccid) {
  1118. $.ajax({
  1119. url: 'siminfo',
  1120. type: 'post',
  1121. dataType: 'json',
  1122. data: {
  1123. simid: iccid,
  1124. },
  1125. beforeSend: function (XMLHttpRequest) {
  1126. //注意,layer.msg默认3秒自动关闭,如果数据加载耗时比较长,需要设置time
  1127. loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
  1128. },
  1129. success: function (data) {
  1130. var dat = data.data;
  1131. if (data.code == 0) {
  1132. var status;
  1133. if (dat.account_status == "0") {
  1134. status = "未知";
  1135. } else if (dat.account_status == "1") {
  1136. status = "测试期";
  1137. } else if (dat.account_status == "2") {
  1138. status = "沉默期";
  1139. } else if (dat.account_status == "3") {
  1140. status = "使用中";
  1141. } else if (dat.account_status == "4") {
  1142. status = "停机";
  1143. } else if (dat.account_status == "5") {
  1144. status = "停机保号";
  1145. } else if (dat.account_status == "6") {
  1146. status = "预销号";
  1147. } else if (dat.account_status == "7") {
  1148. status = "销号";
  1149. }
  1150. var usage;
  1151. if (dat.iccid) {
  1152. usage = dat.data_usage;
  1153. } else {
  1154. usage.innerHTML = '--';
  1155. }
  1156. var balance;
  1157. if (dat.iccid) {
  1158. balance = dat.data_balance;
  1159. } else {
  1160. balance = '--';
  1161. }
  1162. var time;
  1163. if (dat.iccid) {
  1164. var timestamp4 = new Date(dat.expiry_date * 1000);//直接用 new Date(时间戳) 格式转化获得当前时间
  1165. time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
  1166. } else {
  1167. time = '--';
  1168. }
  1169. layer.close(loadingFlag);
  1170. layer.open({
  1171. type: 1
  1172. , title: false //不显示标题栏
  1173. , skin: 'layui-layer-simCode' //样式类名
  1174. , closeBtn: false
  1175. , area: '300px;'
  1176. , shade: 0.8
  1177. , id: 'simCode' //设定一个id,防止重复弹出
  1178. , btn: ['我知道了']
  1179. , btnAlign: 'c'
  1180. , moveType: 1 //拖拽模式,0或者1
  1181. , 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>'
  1182. , success: function (layero) {
  1183. }
  1184. });
  1185. } else {
  1186. layer.msg(data.msg);
  1187. }
  1188. }
  1189. })
  1190. }
  1191. //在线状态筛选
  1192. $('#selectId').on('change', function () {
  1193. getEquipList(1, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1194. })
  1195. //设备状态
  1196. function loadProject(facId) {
  1197. $.ajax({
  1198. url: 'qxz_status',
  1199. type: 'post',
  1200. dataType: 'json',
  1201. data: {
  1202. e_id: facId,
  1203. },
  1204. beforeSend: function (XMLHttpRequest) {
  1205. loadingFlag = layer.load();
  1206. },
  1207. success: function (data) {
  1208. layer.close(loadingFlag);
  1209. nowledinfo = data.ledinfo
  1210. // 实时状态
  1211. newStatus('newStatusBox', data, facId);
  1212. $('#updataTime').html(data.base.upl_time || '暂无上传数据');
  1213. if (data.base.qxz_picture) {
  1214. $('#viewPhoto').attr('src', 'http://120.27.222.26/' + data.base.qxz_picture);
  1215. } else {
  1216. $('#viewPhoto').attr('src', 'http://120.27.222.26/' + 'qxz_photo/default.jpg');
  1217. }
  1218. addCtrlBtn(data.qxz_switch, data.switch_name);
  1219. if (data.qxz_switch && (data.qxz_switch.length != 2)) {
  1220. $('#ctrlBoxParentDiv').show();
  1221. $('#getthresholdDivParentDiv').show();
  1222. $('#timingDivParentDiv').show();
  1223. $('#data24Div').hide();
  1224. gettimimgFun(data);
  1225. getthresholdFun(data);
  1226. scrollBar()
  1227. } else { // 无开关显示24小时数据
  1228. $('#ctrlBoxParentDiv').hide();
  1229. $('#getthresholdDivParentDiv').hide();
  1230. $('#timingDivParentDiv').hide();
  1231. $('#data24Div').show();
  1232. get24Data(facId)
  1233. scrollBar()
  1234. }
  1235. },
  1236. error: function (type) {
  1237. layer.close(loadingFlag);
  1238. }
  1239. })
  1240. }
  1241. // 阈值请求
  1242. function getthresholdFun(data) {
  1243. if (data.auto_list.length > 2) {
  1244. var switchData = eval('(' + data.auto_list + ')');
  1245. var qxz_switch = eval('(' + data.qxz_switch + ')');
  1246. // var qxz_list = data.new_data;
  1247. if (data.switch_name.length > 2) {
  1248. var switch_name = eval('(' + data.switch_name + ')');
  1249. } else {
  1250. var switch_name = [];
  1251. }
  1252. } else {
  1253. var switchData = [];
  1254. // var qxz_list = [];
  1255. var switch_name = [];
  1256. }
  1257. if (switchData.length) {
  1258. var html = '';
  1259. for (var i = 0; i < switchData.length; i++) {
  1260. if (switchData[i].JK != 255) {
  1261. if (switchData[i].upper == 32767 || switchData[i].lower == 32767) {
  1262. var check = false;
  1263. } else {
  1264. var check = true;
  1265. }
  1266. // 判断通道号
  1267. if (!isNaN(switchData[i].eKey)) {
  1268. var eknum = switchData[i].eKey + 1;
  1269. var ek = 'e' + eknum;
  1270. } else {
  1271. var ek = switchData[i].eKey;
  1272. }
  1273. // 开关名
  1274. if (switchData[i].JK == qxz_switch[i].JK) {
  1275. if (switch_name.length > 2) {
  1276. if (switch_name[i].name) {
  1277. var name = switch_name[i].name;
  1278. } else {
  1279. var name = '开关' + qxz_switch[i].JK;
  1280. }
  1281. } else {
  1282. var name = '开关' + qxz_switch[i].JK;
  1283. }
  1284. } else {
  1285. var name = timingData[i].JK;
  1286. }
  1287. if (data.dat[ek]) {
  1288. var eNum = data.dat[ek].split('#')[1];
  1289. var txt = data.conf[ek].split('#')[0];
  1290. html += '<div class="col-xs-6 col-sm-4"><div class="thresholdCtrl">' +
  1291. '<div class="setthresholdBtn" onclick="setthresholdFun(this)">' +
  1292. '<i class="fa fa-cog setName" aria-hidden="true"></i></div>' +
  1293. '<input type="hidden" class="currVal" value=\'' + JSON.stringify(switchData[i]) + '\'>' +
  1294. '<div class="thresholdCtrlName"><p>' + name + '(通道' + switchData[i].eKey + ')</p></div>' +
  1295. '<div class="thresholdCtrlShowDiv"><div class="qxys"><div>' +
  1296. '<img src="http://www.yfzhwlw.com/static/img/dev/icon_' + eNum + '.png" alt=""></div>' +
  1297. '<div>' + txt + data.conf[ek].split('#')[1] + '</div></div><div class="maxminNum"><p>最大值:<span>' + switchData[i].upper + '</span></p>' +
  1298. '<p>最小值:<span>' + switchData[i].lower + '</span></p></div></div><div class="equipCtrlInp">';
  1299. if (check) {
  1300. html += '<label><input name="switch-field-1" class="ace ace-switch ace-switch-6" checked="checked" type="checkbox">' +
  1301. '<span class="lbl"></span></label></div></div></div>';
  1302. } else {
  1303. html += '<label><input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">' +
  1304. '<span class="lbl"></span></label></div></div></div>';
  1305. }
  1306. }
  1307. }
  1308. if (i == switchData.length - 1) {
  1309. if (html) {
  1310. $('#getthresholdDiv').html(html)
  1311. } else {
  1312. $('#getthresholdDiv').html('<div style="text-align:center">空</div>')
  1313. }
  1314. }
  1315. }
  1316. } else {
  1317. $('#getthresholdDiv').html('<div style="text-align:center">空</div>')
  1318. }
  1319. }
  1320. // 定时请求
  1321. function gettimimgFun(data) {
  1322. var switch_name = data.switch_name;
  1323. var qxz_switch = data.qxz_switch;
  1324. if (data.timing_list.length) {
  1325. var timingData = eval('(' + data.timing_list + ')');
  1326. var qxz_switch = eval('(' + data.qxz_switch + ')');
  1327. var qxz_list = data.qxz_list;
  1328. if (switch_name.length > 2) {
  1329. var switch_name = eval('(' + switch_name + ')');
  1330. } else {
  1331. var switch_name = [];
  1332. }
  1333. } else {
  1334. var timingData = [];
  1335. var qxz_list = [];
  1336. var switch_name = [];
  1337. }
  1338. if (timingData.length) {
  1339. var html = '';
  1340. for (var i = 0; i < timingData.length; i++) {
  1341. if (timingData[i].JK != 255) {
  1342. if (timingData[i].Duration == 32767 || timingData[i].StartTime == 32767) {
  1343. var check = false;
  1344. var curCheckedVal = {
  1345. JK: timingData[i].JK,
  1346. StartTime: '--',
  1347. Duration: '--'
  1348. }
  1349. var startTime = '--';
  1350. var duration = '--';
  1351. } else {
  1352. var check = true;
  1353. var curCheckedVal = {
  1354. JK: timingData[i].JK,
  1355. StartTime: timingData[i].StartTime,
  1356. Duration: timingData[i].Duration
  1357. }
  1358. var startTime = timingData[i].StartTime;
  1359. var duration = timingData[i].Duration;
  1360. }
  1361. if (timingData[i].JK == qxz_switch[i].JK) {
  1362. if (switch_name.length > 2) {
  1363. if (switch_name[i].name) {
  1364. var name = switch_name[i].name;
  1365. } else {
  1366. var name = '开关' + qxz_switch[i].JK;
  1367. }
  1368. } else {
  1369. var name = '开关' + qxz_switch[i].JK;
  1370. }
  1371. } else {
  1372. var name = timingData[i].JK;
  1373. }
  1374. html += '<div class="col-xs-6 col-sm-4"><div class="thresholdCtrl">' +
  1375. '<div class="setthresholdBtn" onclick="timingOnOff(this)">' +
  1376. '<i class="fa fa-cog setName" aria-hidden="true"></i></div>' +
  1377. '<input type="hidden" class="currVal" value=\'' + JSON.stringify(curCheckedVal) + '\'>' +
  1378. '<div class="thresholdCtrlName"><p>' + name + '</p></div>' +
  1379. '<div class="thresholdCtrlShowDiv"><div class="maxminNum">' +
  1380. '<p>起始时间:<span>' + startTime + '</span>点</p><p>工作时长:<span>' + duration + '</span>小时</p>' +
  1381. '</div></div><div class="equipCtrlInp"><label>';
  1382. if (check) {
  1383. html += '<input name="switch-field-1" checked class="ace ace-switch ace-switch-6" type="checkbox">' +
  1384. '<span class="lbl"></span></label></div></div></div>';
  1385. } else {
  1386. html += '<input name="switch-field-1" class="ace ace-switch ace-switch-6" type="checkbox">' +
  1387. '<span class="lbl"></span></label></div></div></div>';
  1388. }
  1389. }
  1390. if (i == timingData.length - 1) {
  1391. if (html) {
  1392. $('#gettimingDiv').html(html)
  1393. } else {
  1394. $('#gettimingDiv').html('<div style="text-align:center">空</div>')
  1395. }
  1396. }
  1397. }
  1398. } else {
  1399. $('#gettimingDiv').html('<div style="text-align:center">空</div>')
  1400. }
  1401. }
  1402. // 控制按钮
  1403. function addCtrlBtn(data, switch_name) {
  1404. if (data && switch_name.length > 2) {
  1405. var data = eval('(' + data + ')');
  1406. var ctrl_name = eval('(' + switch_name + ')');
  1407. $('.qxzDownCtrl').show();
  1408. } else if (data) {
  1409. var data = eval('(' + data + ')');
  1410. var ctrl_name = [];
  1411. } else {
  1412. var data = []
  1413. $('.qxzDownCtrl').hide();
  1414. }
  1415. if (data.length) {
  1416. var html = '';
  1417. for (var i = 0; i < data.length; i++) {
  1418. if (data[i].status == 0) {
  1419. var curClass = '';
  1420. } else {
  1421. var curClass = 'active';
  1422. }
  1423. if (data[i].status == 0) {
  1424. var curChecked = ''; //关
  1425. } else {
  1426. var curChecked = 'checked';
  1427. }
  1428. if (ctrl_name.length) {
  1429. if (ctrl_name[i].name != '') {
  1430. var switch_name = ctrl_name[i].name;
  1431. } else {
  1432. var switch_name = '开关' + ctrl_name[i].JK;
  1433. }
  1434. } else {
  1435. var switch_name = '开关' + data[i].JK;
  1436. }
  1437. html += '<div class="col-xs-2"><div class="equipCtrl"><input type="hidden" class="currStutas" value="' + data[i].JK + '">' +
  1438. '<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">' +
  1439. '<label><input name="switch-field-1" ' + curChecked + ' class="ace ace-switch ace-switch-4 btn-rotate" type="checkbox">' +
  1440. '<span class="lbl"></span></label></div></div></div>';
  1441. if (i == data.length - 1) {
  1442. $('#ctrlBox').html(html);
  1443. }
  1444. }
  1445. } else {
  1446. $('#ctrlBox').html('<div style="text-align:center">空</div>');
  1447. }
  1448. }
  1449. $('#ctrlBox').on('click', '.btn-rotate', function () {
  1450. var _this = this;
  1451. $(this).parents('.equipCtrl').find('.ctrlLoading').remove()
  1452. $(this).attr('disabled', true);
  1453. $(this).parents('.equipCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  1454. var currWay = $(this).parents('.equipCtrl').find('.currStutas').val();
  1455. var imei = $('#qxzPhotoId').val();
  1456. if ($(this).is(":checked")) {
  1457. var oldStatus = 0;
  1458. var currStutas = 1;
  1459. } else {
  1460. var oldStatus = 1;
  1461. var currStutas = 0;
  1462. }
  1463. $.ajax({
  1464. url: 'qxz_switch',
  1465. type: 'post',
  1466. data: {
  1467. 'req': 'set',
  1468. 'imei': imei,
  1469. 'way': currWay,
  1470. 'switch': currStutas
  1471. },
  1472. success: function (data) {
  1473. setTimeout(function () {
  1474. var id = $('#firstpane .menu-active').attr('id')
  1475. loadProject(id);
  1476. }, 5000)
  1477. // $(_this).attr('disabled', false);
  1478. // $(_this).parents('.equipCtrl').find('.ctrlLoading').html('');
  1479. // if (currStutas) {
  1480. // $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
  1481. // } else {
  1482. // $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
  1483. // }
  1484. },
  1485. error: function (type) {
  1486. layer.close(loadingFlag);
  1487. $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1488. $(_this).attr('disabled', false);
  1489. if (oldStatus) {
  1490. $(_this).prop('checked', true);
  1491. $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
  1492. } else {
  1493. $(_this).prop('checked', '');
  1494. $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
  1495. }
  1496. }
  1497. })
  1498. })
  1499. // 下发控制名称
  1500. $('#ctrlBox').on('click', '.setName', function () {
  1501. var _this = this;
  1502. var ele = $(this).parents('.equipCtrl').find('.numName');
  1503. var currWay = $(this).parents('.equipCtrl').find('.currStutas').val();
  1504. layui.use('layer', function () {
  1505. var layer = layui.layer;
  1506. layer.prompt({ title: '自定义名称', offset: '300px', formType: 0, value: ele.html(), maxlength: 10 }, function (text, index) {
  1507. if (text == ele.html()) {
  1508. return false;
  1509. layer.close(index);
  1510. layer.msg('演示完毕!您的口令:' + text);
  1511. ele.html(text)
  1512. }
  1513. $.ajax({
  1514. url: 'qxz_switch_name',
  1515. type: 'post',
  1516. data: {
  1517. 'imei': $('#qxzPhotoId').val(),
  1518. 'way': currWay,
  1519. 'sw_name': text
  1520. },
  1521. success: function (data) {
  1522. if (data == 0) {
  1523. ele.html(text)
  1524. }
  1525. layer.close(index);
  1526. },
  1527. error: function (type) {
  1528. $(_this).parents('.equipCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1529. $(_this).attr('disabled', false);
  1530. if (oldStatus) {
  1531. $(_this).prop('checked', true);
  1532. $(_this).parents('.equipCtrl').find('.isonlineicon').addClass('active')
  1533. } else {
  1534. $(_this).prop('checked', '');
  1535. $(_this).parents('.equipCtrl').find('.isonlineicon').removeClass('active')
  1536. }
  1537. }
  1538. })
  1539. });
  1540. });
  1541. })
  1542. // 获取最新控制按钮状态
  1543. function qxzDownCtrlFun() {
  1544. $.ajax({
  1545. url: 'qxz_switch',
  1546. type: 'post',
  1547. data: {
  1548. 'req': 'conf', //
  1549. 'imei': $('#qxzPhotoId').val(),
  1550. },
  1551. beforeSend: function () {
  1552. loadFlage = layer.load();
  1553. },
  1554. complete: function () {
  1555. setTimeout(function () {
  1556. layer.close(loadFlage);
  1557. }, 5000)
  1558. },
  1559. success: function (data) {
  1560. setTimeout(function () {
  1561. loadProject($('#qxzPhotoId').val())
  1562. }, 5000)
  1563. }
  1564. })
  1565. }
  1566. // 获取最新数据
  1567. function newDataRefresh() {
  1568. $.ajax({
  1569. url: 'qxz_switch',
  1570. type: 'post',
  1571. data: {
  1572. 'req': 'read',
  1573. 'imei': $('#qxzPhotoId').val(),
  1574. },
  1575. beforeSend: function () {
  1576. loadFlage = layer.load();
  1577. },
  1578. complete: function () {
  1579. setTimeout(function () {
  1580. layer.close(loadFlage);
  1581. }, 5000)
  1582. },
  1583. success: function (data) {
  1584. setTimeout(function () {
  1585. loadProject($('#qxzPhotoId').val())
  1586. }, 5000)
  1587. }
  1588. })
  1589. }
  1590. // 设备列表
  1591. var currpage = 1;
  1592. function changePage(symbol) {
  1593. var totelpage = Number($('#totelpage').html());
  1594. if (symbol == 'add') {
  1595. if (currpage < totelpage) {
  1596. currpage++;
  1597. $('#currentpage').html(currpage);
  1598. $('#jumpPage').val(currpage);
  1599. $('addPage').attr('disable', 'false')
  1600. } else {
  1601. $('addPage').attr('disable', 'true')
  1602. return false;
  1603. }
  1604. } else if (symbol == 'jian') {
  1605. if (currpage > 1) {
  1606. currpage--;
  1607. $('#currentpage').html(currpage);
  1608. $('#jumpPage').val(currpage);
  1609. $('jianPage').attr('disable', 'false')
  1610. } else {
  1611. $('jianPage').attr('disable', 'true')
  1612. return false;
  1613. }
  1614. } else if (symbol == 'jump') {
  1615. var jumpPage = $('#jumpPage').val();
  1616. if (jumpPage <= totelpage && jumpPage > 0) {
  1617. currpage = jumpPage;
  1618. } else if (jumpPage > totelpage) {
  1619. currpage = totelpage;
  1620. } else if (jumpPage < 0) {
  1621. currpage = 1;
  1622. }
  1623. $('#jumpPage').val(currpage);
  1624. $('#currentpage').html(currpage);
  1625. }
  1626. getEquipList(currpage, $('#searchImei').val(), $('#selectId').val(), $('#selectIdA').val())
  1627. }
  1628. // 首页
  1629. function gotofirstpage() {
  1630. currpage = 1;
  1631. $('#currentpage').html(1);
  1632. $('#jumpPage').val(1);
  1633. getEquipList(1, $('#searchImei').val())
  1634. }
  1635. // 定时刷新
  1636. // msgInterval = setInterval(function () {
  1637. // var currid = $('#firstpane .menu-active').attr('id');
  1638. // loadProject(currid);
  1639. // }, 60000);
  1640. var waterTempId = [16062009, 16062010, 16062011, 16062012, 16062013, 16062014, 16062015, 16062016, 16062017, 16062018, 16062019, 16062020, 16062021, 16062022, 16062023, 16062024, 16062025];
  1641. // 实时状态
  1642. function newStatus(statusBox, data, facId) {
  1643. var dat = data.dat;
  1644. var html = '';
  1645. $(document.getElementById(statusBox)).html('');
  1646. var random = ['bg_blue', 'bg_yellow', 'bg_green', 'bg_red', 'bg_purpol', 'bg_darkblue']; //颜色随机
  1647. if (Object.keys(dat).length) {
  1648. for (var i = 1; i < 31; i++) {
  1649. var ekeyNum = 'e' + i;
  1650. if (dat[ekeyNum] != '' && (parseInt(dat[ekeyNum].split('#')[1]) != 163)) {
  1651. if (dat[ekeyNum].split('#')[0] == -99.99) {
  1652. var eVal = 'N/A';
  1653. } else {
  1654. if(dat[ekeyNum].split('#')[1] == 117){ //判断是否是雨雪天气
  1655. var eVal = dat[ekeyNum].split('#')[0]?'有':'无';
  1656. }else{
  1657. var eVal = dat[ekeyNum].split('#')[0];
  1658. }
  1659. }
  1660. var eNum = dat[ekeyNum].split('#')[1];
  1661. var ekey = dat[ekeyNum].split('#')[2];
  1662. var colorClass = eNum % 4;
  1663. // if(Object.keys(data.conf).length){
  1664. var eTxtUnit = data.conf[ekeyNum].split('#')[0];
  1665. var eUnit = data.conf[ekeyNum].split('#')[1];
  1666. // }
  1667. html += '<div class="swiper-slide"><div class="elValBox ' + random[colorClass] + '">'+
  1668. '<p class="elNum">'+ekey+'</p><div class="elVal">'+eVal+'</div></div>'+
  1669. '<div class="eLtxt">'+eTxtUnit+'</div><div class="elUnit">'+eUnit+'</div></div>';
  1670. }
  1671. }
  1672. }
  1673. if (html) {
  1674. $(document.getElementById(statusBox)).append(html);
  1675. var swiper = new Swiper('.swiper-container', {
  1676. slidesPerView: swiperCount,
  1677. spaceBetween: 30,
  1678. navigation: {
  1679. nextEl: '.swiper-button-next',
  1680. prevEl: '.swiper-button-prev',
  1681. },
  1682. });
  1683. } else {
  1684. html = '<div style="text-align:center">空</div>';
  1685. $(document.getElementById(statusBox)).append(html);
  1686. // $('.widget-content .equip_name').html('');
  1687. // var id = $('#firstpane .menu-active').attr('id')
  1688. // $('.widget-content .equip_id').html('设备ID:' + id);
  1689. // $('#viewPhoto').attr('src', 'qxz_photo/default.jpg');
  1690. // scrollBar()
  1691. }
  1692. scrollBar()
  1693. }
  1694. // 24小时数据
  1695. function get24Data(facId) {
  1696. $.ajax({
  1697. url: 'qxz_day_data',
  1698. type: 'post',
  1699. dataType: 'json',
  1700. data: {
  1701. e_id: facId,
  1702. },
  1703. beforeSend: function (XMLHttpRequest) {
  1704. loadingFlag = layer.load();
  1705. },
  1706. success: function (data) {
  1707. layer.close(loadingFlag);
  1708. $("#newtable tr:not(:first)").remove();
  1709. if (data.data.length) {
  1710. Fill_Table('newtable', data, facId)
  1711. } else {
  1712. Fill_null_Table('newtable', data, facId)
  1713. }
  1714. },
  1715. error: function (type) {
  1716. layer.close(loadingFlag);
  1717. layer.msg('请求失败');
  1718. $("#newtable tr:not(:first)").remove();
  1719. }
  1720. })
  1721. }
  1722. function Fill_Table(table_id, data, facId) {
  1723. var dat = data.data;
  1724. //js循环读取json数据
  1725. var table = document.getElementById(table_id).children[1];
  1726. for (var i = 0; i < dat.length; i++) {
  1727. var row = table.insertRow(table.rows.length);
  1728. var c1 = row.insertCell(0);
  1729. c1.innerHTML = dat[i].ekey;
  1730. var c2 = row.insertCell(1);
  1731. var eNum = dat[i].enum
  1732. var elementName = data.conf[dat[i].ekey].split('#');
  1733. c2.innerHTML = elementName[0] + '(' + elementName[1] + ')';
  1734. var c3 = row.insertCell(2);
  1735. if (dat[i].min == -99.99) {
  1736. c3.innerHTML = 'N/A';
  1737. } else {
  1738. if(eNum[0] == 117){
  1739. c3.innerHTML = dat[i].min?'有':'无';
  1740. }else{
  1741. c3.innerHTML = dat[i].min;
  1742. }
  1743. }
  1744. var c4 = row.insertCell(3);
  1745. var min_time = dat[i].mintime;
  1746. c4.innerHTML = min_time;
  1747. var c5 = row.insertCell(4);
  1748. if (dat[i].max == -99.99) {
  1749. c5.innerHTML = 'N/A';
  1750. } else {
  1751. if(eNum[0] == 117){
  1752. c5.innerHTML = dat[i].max?'有':'无';
  1753. }else{
  1754. c5.innerHTML = dat[i].max;
  1755. }
  1756. }
  1757. var c6 = row.insertCell(5);
  1758. var max_time = dat[i].maxtime;
  1759. c6.innerHTML = max_time;
  1760. if (i == dat.length - 1) {
  1761. scrollBar()
  1762. }
  1763. }
  1764. }
  1765. function Fill_null_Table(table_id) {
  1766. var table = document.getElementById(table_id).children[1];
  1767. var row = table.insertRow(table.rows.length);
  1768. var c1 = row.insertCell(0);
  1769. c1.setAttribute('colspan', '16');
  1770. c1.setAttribute('class', 'nullData');
  1771. c1.innerHTML = "暂无数据";
  1772. scrollBar()
  1773. }
  1774. window.onresize = function () {
  1775. swiperWidth = $('.swiper-container').width();
  1776. swiperCount = Math.floor(swiperWidth/130);
  1777. swiper = new Swiper('.swiper-container', {
  1778. slidesPerView: swiperCount,
  1779. spaceBetween: 30,
  1780. navigation: {
  1781. nextEl: '.swiper-button-next',
  1782. prevEl: '.swiper-button-prev',
  1783. },
  1784. });
  1785. scrollBar()
  1786. }
  1787. // file 文件
  1788. // divId div id
  1789. // imgId 图片id
  1790. // fileId 文件id
  1791. // width 图片宽
  1792. // height 图片高
  1793. function previewImage(file, divId, imgId, fileId, width, height) {
  1794. width = $('#viewPhotoParent').width();
  1795. var div = document.getElementById(divId);
  1796. if (file.files && file.files[0]) {
  1797. if (file.files[0].size / 1024 / 1024 < 4) {
  1798. sendUserPhoto();
  1799. div.innerHTML = '<img id=' + imgId + ' onclick=$("#' + fileId + '").click()>';
  1800. var img = document.getElementById(imgId);
  1801. img.onload = function () {
  1802. // var rect = clacImgZoomParam(width, height, img.offsetWidth, img.offsetHeight);
  1803. img.width = width;
  1804. img.height = height;
  1805. // img.style.marginTop = rect.top+'px';
  1806. }
  1807. var reader = new FileReader();
  1808. reader.onload = function (evt) {
  1809. img.src = evt.target.result;
  1810. // $(window.parent.document).find('.nav-user-photo').attr('src',evt.target.result);
  1811. }
  1812. reader.readAsDataURL(file.files[0]);
  1813. // $('#userPhoto').submit();
  1814. } else {
  1815. $(file).val('');
  1816. layer.alert("图片过大!");
  1817. }
  1818. } else {//兼容IE
  1819. var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
  1820. file.select();
  1821. if (document.selection != undefined) {
  1822. var src = document.selection.createRange().text;
  1823. div.innerHTML = '<img id=' + imgId + '>';
  1824. var img = document.getElementById(imgId);
  1825. img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
  1826. var rect = clacImgZoomParam(width, height, img.offsetWidth, img.offsetHeight);
  1827. status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
  1828. div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;" + sFilter + src + "\"'></div>";
  1829. }
  1830. }
  1831. }
  1832. function clacImgZoomParam(maxWidth, maxHeight, width, height) {
  1833. var param = { top: 0, left: 0, width: width, height: height };
  1834. if (width > maxWidth || height > maxHeight) {
  1835. var rateWidth = width / maxWidth;
  1836. var rateHeight = height / maxHeight;
  1837. if (rateWidth > rateHeight) {
  1838. param.width = maxWidth;
  1839. param.height = Math.round(height / rateWidth);
  1840. } else {
  1841. param.width = Math.round(width / rateHeight);
  1842. param.height = maxHeight;
  1843. }
  1844. }
  1845. param.left = Math.round((maxWidth - param.width) / 2);
  1846. param.top = Math.round((maxHeight - param.height) / 2);
  1847. return param;
  1848. }
  1849. // 上传图片
  1850. function sendUserPhoto() {
  1851. var formData = new FormData($("#userPhoto")[0]);
  1852. $.ajax({
  1853. url: 'qxz_photo',
  1854. type: 'POST',
  1855. data: formData,
  1856. contentType: false,
  1857. processData: false,
  1858. success: function (data) {
  1859. if (data == 0) {
  1860. $(window.parent.document).find('.nav-user-photo').attr('src', $('#viewPhoto').prop('src'));
  1861. $('#uploadPhoto').val('');
  1862. }
  1863. else { layer.msg("上传失败!"); return false; }
  1864. }
  1865. });
  1866. }
  1867. // 设置阈值
  1868. function setthresholdFun(ele) {
  1869. var obj = $(ele);
  1870. var currValstr = obj.next().val();
  1871. var currVal = eval('(' + currValstr + ')');
  1872. layui.use(['layer', 'form'], function () {
  1873. var rule0 = "低于下限<span>开启</span>,高于上限<span>关闭</span>";
  1874. var rule1 = "低于下限<span>关闭</span>,高于上限<span>开启</span>";
  1875. var layer = layui.layer;
  1876. var form = layui.form;
  1877. //给表单赋值
  1878. form.val("formModel", {
  1879. "JK": currVal.JK
  1880. , "eKey": currVal.eKey
  1881. , "upper": currVal.upper
  1882. , "lower": currVal.lower
  1883. , "method": currVal.method
  1884. });
  1885. if (currVal.method == 1) {
  1886. $('#hintDiv').html(rule1)
  1887. } else {
  1888. $('#hintDiv').html(rule0)
  1889. }
  1890. form.on('radio(radioSwitch)', function (data) {
  1891. if (data.value == 1) {
  1892. $('#hintDiv').html(rule1)
  1893. } else {
  1894. $('#hintDiv').html(rule0)
  1895. }
  1896. });
  1897. layer.open({
  1898. type: 1,
  1899. title: '阈值设置',
  1900. offset: '380px',
  1901. btn: ['确定', '取消'],
  1902. area: ['600px', '300px'], //宽高
  1903. content: $('#Modal'),
  1904. success: function (layero, index) { // 成功弹出后回调
  1905. // 添加form标识
  1906. layero.addClass('layui-form');
  1907. // 将保存按钮改变成提交按钮
  1908. layero.find('.layui-layer-btn0').attr({
  1909. 'lay-filter': 'setYuzhi',
  1910. 'lay-submit': ''
  1911. });
  1912. },
  1913. yes: function (index, layero) {
  1914. form.on('submit(setYuzhi)', function (data) {
  1915. var dat = data.field;
  1916. if (parseInt(data.field.upper) < parseInt(data.field.lower)) {
  1917. layer.tips('最大值不能小于最小值!', $('#upper'));
  1918. return false;
  1919. }
  1920. var hideVal = JSON.stringify(data.field)
  1921. var id = $('#firstpane .menu-active').attr('id')
  1922. data.field.equip_id = id;
  1923. var curinputBtn = obj.parent().find('.ace-switch');
  1924. if (curinputBtn.is(":checked")) {
  1925. var oldStatus = 0;
  1926. var currStutas = 1;
  1927. } else {
  1928. var oldStatus = 1;
  1929. var currStutas = 0;
  1930. }
  1931. obj.parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  1932. $.ajax({
  1933. url: 'qxz_value_mqtt',
  1934. type: 'post',
  1935. data: data.field,
  1936. success: function (data) {
  1937. setTimeout(function () {
  1938. curinputBtn.attr('disabled', false);
  1939. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('');
  1940. obj.parent().find('.maxminNum').find('p').eq(0).find('span').html(dat.upper)//最大值
  1941. obj.parent().find('.maxminNum').find('p').eq(1).find('span').html(dat.lower)//最小值
  1942. obj.parents('.thresholdCtrl').find('.ace-switch').prop('checked', 'checked');//开启阈值
  1943. var id = $('#firstpane .menu-active').attr('id')
  1944. loadProject(id);
  1945. }, 5000)
  1946. },
  1947. error: function (type) {
  1948. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1949. curinputBtn.attr('disabled', false);
  1950. }
  1951. })
  1952. // $('.maxminNum')
  1953. layer.closeAll(); //疯狂模式,关闭所有层
  1954. return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
  1955. });
  1956. }
  1957. , btn2: function (index, layero) {
  1958. $('#Modal').hide()
  1959. //return false 开启该代码可禁止点击该按钮关闭
  1960. }
  1961. });
  1962. });
  1963. }
  1964. // 下发阈值控制
  1965. $('#getthresholdDiv').on('click', '.ace-switch', function () {
  1966. var _this = this;
  1967. $(this).parents('.thresholdCtrl').find('.ctrlLoading').remove()
  1968. $(this).attr('disabled', true);
  1969. $(this).parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  1970. var currVal = $(this).parents('.thresholdCtrl').find('.currVal').val();
  1971. var currWayjson = JSON.parse(currVal);
  1972. var id = $('#firstpane .menu-active').attr('id')
  1973. currWayjson.equip_id = id;
  1974. if ($(this).is(":checked")) { //开启
  1975. var oldStatus = 0;
  1976. var currStutas = 1;
  1977. } else { //关闭
  1978. var oldStatus = 1;
  1979. var currStutas = 0;
  1980. currWayjson.upper = '32767';
  1981. currWayjson.lower = '32767';
  1982. }
  1983. $.ajax({
  1984. url: 'qxz_value_mqtt',
  1985. type: 'post',
  1986. data: currWayjson,
  1987. success: function (data) {
  1988. setTimeout(function () {
  1989. $(_this).attr('disabled', false);
  1990. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('');
  1991. var id = $('#firstpane .menu-active').attr('id')
  1992. loadProject(id);
  1993. }, 5000)
  1994. },
  1995. error: function (type) {
  1996. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  1997. $(_this).attr('disabled', false);
  1998. if (oldStatus) {
  1999. $(_this).prop('checked', true);
  2000. } else {
  2001. $(_this).prop('checked', '');
  2002. }
  2003. }
  2004. })
  2005. })
  2006. // 定时开关
  2007. function timingOnOff(ele) {
  2008. var obj = $(ele);
  2009. var currValstr = obj.next().val();
  2010. var currVal = eval('(' + currValstr + ')');
  2011. layui.use(['layer', 'form'], function () {
  2012. var layer = layui.layer;
  2013. var form = layui.form;
  2014. form.verify({
  2015. starttimeRegex: function (value, item) { //value:表单的值、item:表单的DOM对象
  2016. if (value < 0 || value > 23) {
  2017. return '请输入范围内数值';
  2018. }
  2019. },
  2020. durationRegex: function (value, item) { //value:表单的值、item:表单的DOM对象
  2021. if (value < 1 || value > 24) {
  2022. return '请输入范围内数值';
  2023. }
  2024. }
  2025. });
  2026. //给表单赋值
  2027. form.val("formModel", {
  2028. "JK": currVal.JK
  2029. , "StartTime": currVal.StartTime
  2030. , "Duration": currVal.Duration
  2031. });
  2032. layer.open({
  2033. type: 1,
  2034. title: '阈值设置',
  2035. offset: '380px',
  2036. btn: ['确定', '取消'],
  2037. area: ['600px', '300px'], //宽高
  2038. content: $('#timingOnOffModal'),
  2039. success: function (layero, index) { // 成功弹出后回调
  2040. // 添加form标识
  2041. layero.addClass('layui-form');
  2042. // 将保存按钮改变成提交按钮
  2043. layero.find('.layui-layer-btn0').attr({
  2044. 'lay-filter': 'setdingshi',
  2045. 'lay-submit': ''
  2046. });
  2047. },
  2048. yes: function (index, layero) {
  2049. form.on('submit(setdingshi)', function (data) {
  2050. var hideVal = JSON.stringify(data.field)
  2051. var dat = data.field;
  2052. var curinputBtn = obj.parent().find('.ace-switch');
  2053. if (curinputBtn.is(":checked")) {
  2054. var oldStatus = 0;
  2055. var currStutas = 1;
  2056. } else {
  2057. var oldStatus = 1;
  2058. var currStutas = 0;
  2059. }
  2060. var id = $('#firstpane .menu-active').attr('id')
  2061. dat.equip_id = id;
  2062. obj.parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  2063. $.ajax({
  2064. url: 'qxz_timing_mqtt',
  2065. type: 'post',
  2066. data: dat,
  2067. success: function (data) {
  2068. setTimeout(function () {
  2069. obj.next().val(hideVal)
  2070. curinputBtn.attr('disabled', false);
  2071. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('');
  2072. obj.parent().find('.maxminNum').find('p').eq(0).find('span').html(dat.StartTime)//最大值
  2073. obj.parent().find('.maxminNum').find('p').eq(1).find('span').html(dat.Duration)//最小值
  2074. obj.parents('.thresholdCtrl').find('.ace-switch').prop('checked', 'checked');//开启阈值
  2075. var id = $('#firstpane .menu-active').attr('id')
  2076. loadProject(id);
  2077. }, 5000)
  2078. },
  2079. error: function (type) {
  2080. curinputBtn.parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  2081. curinputBtn.attr('disabled', false);
  2082. }
  2083. })
  2084. // $('.maxminNum')
  2085. layer.closeAll(); //疯狂模式,关闭所有层
  2086. return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
  2087. });
  2088. }
  2089. , btn2: function (index, layero) {
  2090. $('#Modal').hide()
  2091. //return false 开启该代码可禁止点击该按钮关闭
  2092. }
  2093. });
  2094. });
  2095. }
  2096. $('#starttime').on('blur', function () {
  2097. $(this).val(parseInt($(this).val()))
  2098. })
  2099. $('#Duration').on('blur', function () {
  2100. $(this).val(parseInt($(this).val()))
  2101. })
  2102. // 下发定时开关
  2103. $('#gettimingDiv').on('click', '.ace-switch', function () {
  2104. var _this = this;
  2105. var currVal = $(this).parents('.thresholdCtrl').find('.currVal').val();
  2106. var currWayjson = JSON.parse(currVal);
  2107. var id = $('#firstpane .menu-active').attr('id')
  2108. currWayjson.equip_id = id;
  2109. if (currWayjson.StartTime == '--' || currWayjson.Duration == '--') {
  2110. $(this).parents('.thresholdCtrl').find('.setthresholdBtn').click();
  2111. layer.msg('请先设置定时时间', { icon: 2 })
  2112. return false;
  2113. }
  2114. $(this).parents('.thresholdCtrl').find('.ctrlLoading').remove()
  2115. $(this).attr('disabled', true);
  2116. $(this).parents('.thresholdCtrl').append('<div class="ctrlLoading"><img src="http://www.nyzhwlw.com/images/loading.gif" width="24">操作中...</div>');
  2117. if ($(this).is(":checked")) { //开启
  2118. var oldStatus = 0;
  2119. var currStutas = 1;
  2120. } else { //关闭
  2121. var oldStatus = 1;
  2122. var currStutas = 0;
  2123. currWayjson.StartTime = '255';
  2124. currWayjson.Duration = '32767';
  2125. }
  2126. $.ajax({
  2127. url: 'qxz_timing_mqtt',
  2128. type: 'post',
  2129. data: currWayjson,
  2130. success: function (data) {
  2131. setTimeout(function () {
  2132. $(_this).attr('disabled', false);
  2133. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('');
  2134. var id = $('#firstpane .menu-active').attr('id')
  2135. loadProject(id);
  2136. }, 5000)
  2137. },
  2138. error: function (type) {
  2139. $(_this).parents('.thresholdCtrl').find('.ctrlLoading').html('<span style="color:red">操作失败</span>');
  2140. $(_this).attr('disabled', false);
  2141. if (oldStatus) {
  2142. $(_this).prop('checked', true);
  2143. } else {
  2144. $(_this).prop('checked', '');
  2145. }
  2146. }
  2147. })
  2148. })
  2149. // 设置要素名称
  2150. function setEleName() {
  2151. var e_id = $('#firstpane .menu-active').attr('id')
  2152. $.ajax({
  2153. url: 'qxz_title_conf',
  2154. type: 'get',
  2155. data: {
  2156. e_id: e_id
  2157. },
  2158. dataType: 'json',
  2159. success: function (data) {
  2160. var dataa = [];
  2161. var len = Object.keys(data.default).length;
  2162. for (var i = 1; i <= len; i++) {
  2163. var key = 'e' + i;
  2164. if (data.default[key]) {
  2165. var detxt = data.default[key].split('#')[0];
  2166. var deunit = data.default[key].split('#')[1];
  2167. if (data.conf[key]) {
  2168. var conftxt = data.conf[key].split('#')[0];
  2169. } else {
  2170. var conftxt = '-';
  2171. }
  2172. dataa.push({
  2173. "ekey": key,
  2174. "name": conftxt,
  2175. "elementName": detxt,
  2176. "unit": deunit
  2177. })
  2178. }
  2179. if (i == len) {
  2180. // console.log(dataa)
  2181. //页面层
  2182. layer.open({
  2183. type: 1,
  2184. title: '修改要素名称',
  2185. area: ['800px', '540px'], //宽高
  2186. content: $('#eleName'),
  2187. skin: 'layui-layer-editName', //样式类名
  2188. success: function (layero, index) {
  2189. layui.use('table', function () {
  2190. var table = layui.table;
  2191. table.render({
  2192. elem: '#eleTable'
  2193. , data: dataa
  2194. , done: function (res, curr, count) {
  2195. $("table").css("width", "100%");
  2196. }
  2197. , limit: 30
  2198. , cols: [[
  2199. { field: 'ekey', width: '25%', align: 'center', title: '通道号' }
  2200. , { field: 'name', width: '35%', align: 'center', title: '<i class="layui-icon">&#xe642;</i>名称', event: 'cellClick' }
  2201. , { field: 'elementName', width: '40%', align: 'center', title: '要素' }
  2202. ]]
  2203. });
  2204. table.on('tool(eleTable)', function (obj) {
  2205. switch (obj.event) {
  2206. case 'cellClick':
  2207. CellClick(this, obj, e_id);
  2208. break;
  2209. };
  2210. });
  2211. });
  2212. },
  2213. cancel: function (index, layero) {
  2214. loadProject(e_id);
  2215. }
  2216. });
  2217. }
  2218. }
  2219. },
  2220. error: function (type) {
  2221. layer.msg('请求失败');
  2222. }
  2223. })
  2224. }
  2225. layui.use(['form'], function () {
  2226. var form = layui.form;
  2227. form.on('switch(equipTypeDemo)', function (obj) {
  2228. var state = obj.elem.checked ? 1 : 0;
  2229. //方法二取数据 (根据索引table.cache里面的行数据)
  2230. var index = obj.othis.parents('tr').attr("data-index");
  2231. datMsg[index].type = state;
  2232. });
  2233. })
  2234. function CellClick(that, obj, e_id) {
  2235. //当前点击字段
  2236. var field = $(that).data("field");
  2237. //判断是否需要添加编辑框
  2238. if (field == "edit") return true;
  2239. //当前行数据
  2240. var data = obj.data;
  2241. //当前单元格的值
  2242. var value = data[field];
  2243. //当前点击td的宽高
  2244. var height = $(that)[0].offsetHeight, width = $(that)[0].offsetWidth;
  2245. //当前点击td的坐标
  2246. var top = $(that).offset().top, left = $(that).offset().left;
  2247. //输入框 这里可以自定义表单内容
  2248. var input = '<input type="text" maxlength=10 class="layui-input" id="' + field + '_input" data-field="' + field + '" style="width:' + width + 'px;height:' + height + 'px">';
  2249. //弹出层
  2250. layer.open({
  2251. type: 1
  2252. , title: false
  2253. , page: true
  2254. , limit: 1
  2255. , closeBtn: 0
  2256. , area: [width + "px", height + "px"]
  2257. , shade: [0.01, '#fff']
  2258. , shadeClose: true
  2259. , content: input //这里content是一个普通的String
  2260. , offset: [top, left]
  2261. , success: function () {
  2262. //使弹出层相对定位
  2263. $(".layui-layer-page").css("position", "absolute")
  2264. //设置输入框的值
  2265. $("#" + field + "_input").val(value);
  2266. $("#" + field + "_input").blur(function () {
  2267. var dat = data;
  2268. var ekey = dat.ekey;
  2269. var conf = $(this).val();
  2270. var unit = data.unit;
  2271. $.ajax({
  2272. url: 'qxz_title_conf',
  2273. type: 'post',
  2274. data: {
  2275. e_id: e_id,
  2276. ekey: ekey,
  2277. conf: conf + '#' + unit
  2278. },
  2279. dataType: 'json',
  2280. success: function (data) {
  2281. if (data == 0) {
  2282. //同步更新缓存对应的值
  2283. dat[field] = conf;
  2284. obj.update(dat);
  2285. layer.msg('修改成功')
  2286. }
  2287. },
  2288. error: function (type) {
  2289. layer.msg('修改失败')
  2290. }
  2291. })
  2292. })
  2293. }
  2294. });
  2295. }
  2296. function thresholdClick(that, obj, e_id, form) {
  2297. //当前点击字段
  2298. var field = $(that).data("field");
  2299. // console.log(obj)
  2300. //判断是否需要添加编辑框
  2301. if (field == "edit") return true;
  2302. //当前行数据
  2303. var data = obj.data;
  2304. //当前单元格的值
  2305. var value = data[field];
  2306. //当前点击td的宽高
  2307. var height = $(that)[0].offsetHeight, width = $(that)[0].offsetWidth;
  2308. //当前点击td的坐标
  2309. var top = $(that).offset().top, left = $(that).offset().left;
  2310. //输入框 这里可以自定义表单内容
  2311. 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">';
  2312. //弹出层
  2313. layer.open({
  2314. type: 1
  2315. , title: false
  2316. , page: true
  2317. , limit: 1
  2318. , closeBtn: 0
  2319. , area: [width + "px", height + "px"]
  2320. , shade: [0.01, '#fff']
  2321. , shadeClose: true
  2322. , content: input //这里content是一个普通的String
  2323. , offset: [top, left]
  2324. , success: function () {
  2325. //使弹出层相对定位
  2326. $(".layui-layer-page").css("position", "absolute")
  2327. //设置输入框的值
  2328. $("#" + field + "_input").val(value);
  2329. $("#" + field + "_input").focus()
  2330. $("#" + field + "_input").blur(function () {
  2331. var dat = data;
  2332. var ekey = dat.ekey;
  2333. var conf = $(this).val();
  2334. var unit = data.unit;
  2335. dat[field] = conf || "";
  2336. obj.update(dat);
  2337. form.render()
  2338. })
  2339. }
  2340. });
  2341. }
  2342. // 查看详情
  2343. function historyData(){
  2344. var id = $('#firstpane .menu-active').attr('id')
  2345. window.location.href = 'qxz_report?id='+id
  2346. }
  2347. </script>
  2348. </body>
  2349. </html>