monitorDetaile.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css">
  9. <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
  10. <link rel="stylesheet" href="../../css/aui.css">
  11. <link rel="stylesheet" href="../../css/projeck.css">
  12. <style>
  13. body{
  14. background: #fff;
  15. }
  16. .row_content{
  17. padding: 0 5px;
  18. }
  19. .row_content li{
  20. text-align: center;
  21. font-size: 13px;
  22. padding: 12px 0;
  23. align-items: center;
  24. }
  25. .row_content li span:nth-child(1){
  26. width: 20%;
  27. }
  28. .row_content li span:nth-child(2){
  29. width: 60%;
  30. }
  31. .row_content li span:nth-child(3){
  32. width: 20%;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <div class="api_layout">
  38. <div class="row_contents">
  39. <ul class="row_content" id="row_content">
  40. </ul>
  41. </div>
  42. </div>
  43. <div class="noText hide" id="nocode">
  44. <img src="../../image/noText.png" alt="">
  45. </div>
  46. <script type="text/template" id="templateMonitor">
  47. {{~it:value}}
  48. <li class="flex-space after-border relative {{=value.status}}">
  49. <span>{{=value.id}}</span>
  50. <span>{{=value.position}}</span>
  51. <span>{{=value.value}}{{=value.unit}}</span>
  52. </li>
  53. {{~}}
  54. </script>
  55. <script src="../../script/api.js"></script>
  56. <script src="../../script/doT.min.js"></script>
  57. <script src="../../script/config.js"></script>
  58. <script>
  59. var toast = new auiToast(),title,statusType;
  60. apiready = function () {
  61. title = api.pageParam.title;
  62. statusType = api.pageParam.statusType;
  63. monitorDataFun(api.pageParam.title,api.pageParam.statusType);
  64. // 监听返回按钮
  65. api.addEventListener({
  66. name: 'navbackbtn'
  67. }, function(ret, err) {
  68. api.closeWin();
  69. });
  70. };
  71. function monitorDataFun(title,sType) {
  72. var data = {
  73. name:title,
  74. status:sType,
  75. }
  76. toast.loading({
  77. title: "加载中",
  78. duration: 2000
  79. });
  80. $http.fnReuestDataNologing(UrlRouter.safetyDetaile,'','post',data,function(ret,err){
  81. toast.hide();
  82. if (ret && ret.code === 0) {
  83. var totals = JSON.stringify(ret.total);
  84. $api.setStorage('totals',totals);
  85. api.execScript({
  86. name: 'monitorDetaileWin',
  87. script : 'monitorDatas();'
  88. })
  89. if (ret.data.length > 0) {
  90. $apis.html(row_content,'#templateMonitor',ret.data);
  91. $api.addCls($api.dom('.noText'), 'hide')
  92. }else {
  93. $api.removeCls($api.dom('.noText'), 'hide')
  94. $apis.html(row_content,'#templateMonitor',ret.data);
  95. }
  96. }else{
  97. api.toast({
  98. msg: '网络请求超时,请稍后重试',
  99. duration: 2000,
  100. location: 'bottom'
  101. });
  102. }
  103. })
  104. }
  105. </script>
  106. </body>
  107. </html>