reprotManage_bzy_detail.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
  8. <link href="../css/mui.min.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../css/reset.css" />
  10. <link rel="stylesheet" href="../css/iconfont.css" />
  11. <link href="../css/common.css" rel="stylesheet" />
  12. <style type="text/css">
  13. @media(max-width: 400px) {
  14. .mui-col-sm-6 {
  15. width: 50%;
  16. }
  17. }
  18. .topBorder{
  19. border-top: 2px solid #eee;
  20. }
  21. #detial .mui-navigate-right {
  22. line-height: 80px;
  23. }
  24. .clearfix:after {
  25. content: " ";
  26. display: block;
  27. clear: both;
  28. visibility: hidden;
  29. line-height: 0;
  30. height: 0;
  31. font-size: 0;
  32. }
  33. .clearfix{
  34. *zoom:1;
  35. }
  36. .fl{
  37. float: left;
  38. }
  39. body,.mui-content{
  40. background: #fff;
  41. }
  42. .msgTop{
  43. background: #24b2e7;
  44. background: url(../images/bluesky.jpg) no-repeat;
  45. background-size: 100% 120%;
  46. position: relative;
  47. height: 150px;
  48. }
  49. .currEquip{
  50. color: #fff;
  51. font-size: 14px;
  52. position: absolute;
  53. bottom: 15px;
  54. left: 35px;
  55. }
  56. .currEquipId{
  57. font-size: 18px;
  58. line-height: 34px;
  59. color: #fffac9;
  60. font-weight: 700;
  61. }
  62. .equipImg{
  63. position: absolute;
  64. right: 37px;
  65. bottom: 0px;
  66. }
  67. /*统计图*/
  68. .progressBarBox{
  69. /*margin-left: 5%;*/
  70. }
  71. .progressBarBox >li{
  72. width: 33%;
  73. text-align: center;
  74. }
  75. .progressBartitle{
  76. text-align: center;
  77. font-size: 14px;
  78. margin: 15px 0 7px;
  79. color: #333;
  80. }
  81. .circleChart_text{
  82. color: #13a1e2;
  83. font-size: 20px !important;
  84. }
  85. /*分界线*/
  86. .boundaryline{
  87. width: 100%;
  88. height: 10px;
  89. background: #F3F3F3;
  90. }
  91. /*状态*/
  92. .equipFun{
  93. font-size: 12px;
  94. }
  95. .equipState {
  96. font-size: 14px;
  97. color: #333;
  98. overflow: hidden;
  99. }
  100. #detial >div{
  101. text-align: center;
  102. padding: 10px 0;
  103. }
  104. #detial >div:nth-child(1):before,#detial >div:nth-child(2):before,#detial >div:nth-child(4):before,#detial >div:nth-child(5):before,#detial >div:nth-child(7):before,#detial >div:nth-child(8):before{
  105. content: '';
  106. position: absolute;
  107. right: 0;
  108. border-right: 1px solid #9c9c9c;
  109. width: 1px;
  110. height: 15px;
  111. top: 40%;
  112. }
  113. /*数据*/
  114. .dataShowBox >h1{
  115. /*padding-left: 30px;*/
  116. margin: 10px 0 10px 15px;
  117. /*background: url(../images/statusTag.png) no-repeat 0 2px;*/
  118. line-height: 25px;
  119. font-weight: 700;
  120. }
  121. .dataShowBox hr{
  122. margin: 0 12px 10px 12px;
  123. border: 1px dashed #e7f3fc;
  124. }
  125. .dataShowBox >.equipStatus{
  126. background: url(../images/statusTag.png) no-repeat 0 -26px;
  127. }
  128. /*配置设备操作*/
  129. .mui-table-view:before{
  130. background-color:transparent;
  131. }
  132. /*查看详情*/
  133. .lookDetialBox{
  134. text-align: center;
  135. margin: 20px 0;
  136. }
  137. .lookDetialBox button{
  138. width: 80%;
  139. border-radius: 15px;
  140. }
  141. /*查看详情*/
  142. .areaTitle {
  143. color: #424242;
  144. padding-left: 7px;
  145. /*border-left: 14px solid #ff6e00;*/
  146. font-weight: bold;
  147. font-size: 16px;
  148. position: relative;
  149. border-left: 5px solid #24b2e7;
  150. /*background: url(../images/statusTag.png) no-repeat 0 -52px;*/
  151. }
  152. .detialBox .fa{
  153. padding-right: 5px;
  154. /*color: #3bb9e7;*/
  155. color: #f74b16;
  156. }
  157. </style>
  158. </head>
  159. <body>
  160. <header class="mui-bar mui-bar-nav">
  161. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  162. <h1 class="mui-title" id="title">孢子仪数据详情</h1>
  163. <!--<a class="headRightIcon fa fa-search mui-pull-right" id="reloadEquip">查询</a>-->
  164. </header>
  165. <div class="mui-content">
  166. <div class="msgTop">
  167. <div class="currEquip">
  168. <div id="currEquipId" class="currEquipId"></div>
  169. <div id="upl_time"></div>
  170. </div>
  171. <img class="equipImg" src="../images/bzyequipImg.png" width="70"/>
  172. </div>
  173. <!--<div class="boundaryline"></div>-->
  174. <div class="dataShowBox">
  175. <h1 class="areaTitle">设备数据</h1>
  176. <hr />
  177. <div>
  178. <ul class="progressBarBox clearfix">
  179. <li class="fl">
  180. <!--<div class="circleChart" id="circleChart1"></div>-->
  181. <canvas id="circleChart1" width="95%" height="95%"></canvas>
  182. <div class="progressBartitle">环境湿度(%)</div>
  183. </li>
  184. <li class="fl">
  185. <!--<div class="circleChart" id="c1"></div>-->
  186. <canvas id="circleChart2" width="95%" height="95%"></canvas>
  187. <div class="progressBartitle">环境温度(℃)</div>
  188. </li>
  189. <li class="fl">
  190. <!--<div class="circleChart" id="c2"></div>-->
  191. <canvas id="circleChart3" width="95%" height="95%"></canvas>
  192. <div class="progressBartitle">保温仓当前温度(℃)</div>
  193. </li>
  194. </ul>
  195. </div>
  196. <!--状态-->
  197. <div class="boundaryline"></div>
  198. <h1 class="areaTitle">设备状态</h1>
  199. <hr style="margin-bottom: 0;" />
  200. <div class="mui-row" id="detial">
  201. <div class="mui-col-xs-4">
  202. <p class="equipFun">电池状态</p>
  203. <p class="equipState" id="bat_sta"></p>
  204. </div>
  205. <div class="mui-col-xs-4">
  206. <p class="equipFun">摄像头状态</p>
  207. <p class="equipState" id="usb_sta"></p>
  208. </div>
  209. <div class="mui-col-xs-4">
  210. <p class="equipFun">雨控状态</p>
  211. <p class="equipState" id="rps"></p>
  212. </div>
  213. <div class="mui-col-xs-4">
  214. <p class="equipFun">电压(V)</p>
  215. <p class="equipState" id="v_bat"></p>
  216. </div>
  217. <div class="mui-col-xs-4">
  218. <p class="equipFun">海拔高度</p>
  219. <p class="equipState" id="alti"></p>
  220. </div>
  221. <div class="mui-col-xs-4">
  222. <p class="equipFun">信号强度</p>
  223. <p class="equipState" id="csq"></p>
  224. </div>
  225. <div class="mui-col-xs-4">
  226. <!--<p class="equipFun">保温仓</p>-->
  227. <p class="equipFun">保温仓设定温度</p>
  228. <p class="equipState" id="set_temp"></p>
  229. </div>
  230. <div class="mui-col-xs-4">
  231. <p class="equipFun">设备版本</p>
  232. <p class="equipState" id="dver"></p>
  233. </div>
  234. <div class="mui-col-xs-4">
  235. <p class="equipFun">设备开关</p>
  236. <p class="equipState" id="on_off"></p>
  237. </div>
  238. </div>
  239. </div>
  240. <div class="boundaryline"></div>
  241. <ul class="mui-table-view detialBox">
  242. <li class="mui-table-view-cell">
  243. <h1 class="areaTitle">配置设备操作</h1>
  244. </li>
  245. <li class="mui-table-view-cell" id="lookImg">
  246. <a class="mui-navigate-right">
  247. <i class="fa fa-file-image-o" aria-hidden="true"></i>
  248. 查看图片
  249. </a>
  250. </li>
  251. <li class="mui-table-view-cell" id="lookEchart">
  252. <a class="mui-navigate-right">
  253. <i class="fa fa-line-chart" aria-hidden="true"></i>
  254. 查询统计详情
  255. </a>
  256. </li>
  257. <li class="mui-table-view-cell" id="lookDetial">
  258. <a class="mui-navigate-right">
  259. <i class="fa fa-list" aria-hidden="true"></i>
  260. 查看列表详情
  261. </a>
  262. </li>
  263. <li class="mui-table-view-cell" id="reloadEquip">
  264. <a class="mui-navigate-right">
  265. <i class="fa fa-refresh" aria-hidden="true"></i>
  266. 查询最新状态
  267. </a>
  268. </li>
  269. </ul>
  270. </div>
  271. <script src="../js/jquery-2.1.0.js"></script>
  272. <script src="../js/mui.min.js"></script>
  273. <script src="../js/echarts.js"></script>
  274. <script src="../js/progress.js"></script>
  275. <script type="text/javascript">
  276. mui.init();
  277. var equipId;
  278. mui.plusReady(function() {
  279. var self = plus.webview.currentWebview();
  280. equipId = self.equipId;
  281. $('#currEquipId').html('ID:'+equipId);
  282. //详情
  283. requestData();
  284. //查看图片
  285. document.getElementById('lookImg').addEventListener('tap', function() {
  286. mui.openWindow({
  287. url: 'bzy_lookImage.html',
  288. id: 'bzy_lookImage',
  289. extras: {
  290. equipId: equipId
  291. }
  292. })
  293. })
  294. //查看统计图
  295. document.getElementById('lookEchart').addEventListener('tap', function() {
  296. mui.openWindow({
  297. url: 'bzy_detail_echart.html',
  298. id: 'bzy_detail_echart',
  299. extras: {
  300. equipId: equipId
  301. }
  302. })
  303. })
  304. //查看详情
  305. document.getElementById('lookDetial').addEventListener('tap', function() {
  306. mui.openWindow({
  307. url: 'bzy_detail_list.html',
  308. id: 'bzy_detail_list',
  309. extras: {
  310. equipId: equipId,
  311. }
  312. })
  313. })
  314. //查询
  315. document.getElementById('reloadEquip').addEventListener('tap',function(){
  316. mui.ajax('http://120.27.222.26/bzy_mqtt',{
  317. data:{
  318. 'req': 'read',
  319. 'topicid': equipId,
  320. 'kind': 'data'
  321. },
  322. dataType:'json',//服务器返回json格式数据
  323. type:'post',//HTTP请求类型
  324. timeout: 10000,//超时时间设置为10秒;
  325. beforeSend: function() {
  326. plus.nativeUI.showWaiting('请求中...');
  327. },
  328. complete: function() {
  329. setTimeout(function() {
  330. plus.nativeUI.closeWaiting();
  331. }, 4000);
  332. },
  333. success:function(data){
  334. setTimeout(function() {
  335. mui.toast('查询成功')
  336. window.location.reload();
  337. }, 4000);
  338. },
  339. error:function(xhr,type,errorThrown){
  340. mui.toast('查询失败')
  341. }
  342. });
  343. })
  344. })
  345. function requestData() {
  346. mui.ajax('http://120.27.222.26/app_reportmanage_unflod', {
  347. data: {
  348. 'etype': 'bzy',
  349. 'equip_id': equipId,
  350. },
  351. dataType: 'json', //服务器返回json格式数据
  352. type: 'post', //HTTP请求类型
  353. timeout: 10000, //超时时间设置为10秒;
  354. beforeSend: function() {
  355. plus.nativeUI.showWaiting('请求中...');
  356. },
  357. complete: function() {
  358. plus.nativeUI.closeWaiting();
  359. },
  360. success: function(data) {
  361. console.log(JSON.stringify(data));
  362. $('#upl_time').html(data.upl_time)
  363. var dat = eval('('+data.bzy_data+')');
  364. var p1 = new Progress({
  365. el: 'circleChart1', //canvas元素id
  366. deg: dat.ah, //填入你的数据 如data
  367. currtype:'%',
  368. timer: 10, //绘制时间
  369. lineWidth: 10, //线宽
  370. lineBgColor: '#f4f3f3', //底圆颜色
  371. lineColor: '#1f8aff', //动态圆颜色
  372. textColor: '#1f8aff', //文本颜色
  373. fontSize: 20, //字体大小
  374. circleRadius: 100 //圆半径
  375. });
  376. var p2 = new Progress({
  377. el: 'circleChart2', //canvas元素id
  378. deg: dat.at, //填入你的数据 如data
  379. currtype:'℃',
  380. timer: 10, //绘制时间
  381. lineWidth: 10, //线宽
  382. lineBgColor: '#f4f3f3', //底圆颜色
  383. lineColor: '#1f8aff', //动态圆颜色
  384. textColor: '#1f8aff', //文本颜色
  385. fontSize: 20, //字体大小
  386. circleRadius: 100 //圆半径
  387. });
  388. var p3 = new Progress({
  389. el: 'circleChart3', //canvas元素id
  390. deg: dat.pre_temp, //填入你的数据 如data
  391. currtype:'℃',
  392. timer: 10, //绘制时间
  393. lineWidth: 10, //线宽
  394. lineBgColor: '#f4f3f3', //底圆颜色
  395. lineColor: '#1f8aff', //动态圆颜色
  396. textColor: '#1f8aff', //文本颜色
  397. fontSize: 20, //字体大小
  398. circleRadius: 100 //圆半径
  399. });
  400. $('#bat_sta').html(dat.bat_sta?'电量过低':'正常');
  401. $('#usb_sta').html(dat.usb_sta?'异常':'正常');
  402. $('#rps').html(dat.rps?'雨控':'正常');
  403. $('#v_bat').html(dat.v_bat);
  404. $('#alti').html(dat.alti || 0);
  405. $('#csq').html(dat.csq);
  406. $('#set_temp').html(dat.set_temp);
  407. $('#dver').html(dat.dver);
  408. $('#on_off').html(dat.on_off?'开启':'关闭');
  409. },
  410. error: function(xhr, type, errorThrown) {
  411. mui.toast('数据请求失败');
  412. }
  413. })
  414. }
  415. </script>
  416. </body>
  417. </html>