monitorDetaile.html 3.5 KB

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