realTimeAlarm.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>实时告警</title>
  5. <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
  6. <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
  7. <meta content="width=device-width, initial-scale=1" name="viewport"/>
  8. <link href="favicon.ico" rel="icon" type="image/x-icon"/>
  9. <link href="css/theme-dark-blue.css" id='theme' rel="stylesheet" type="text/css"/>
  10. </head>
  11. <body>
  12. <div class="main_dsm_page">
  13. <div class="container-fluid">
  14. <div class="panel_box">
  15. <div class="panel_title">
  16. <div class="col-md-12">
  17. <h4>告警类别统计表</h4>
  18. </div>
  19. </div>
  20. <div class="iPanel clearfix" style="padding-top:0px; padding-bottom:0px;">
  21. <div class="col-md-6 right-border">
  22. <div class="content">
  23. <div class="chart-wrap">
  24. <div id="rose1"></div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="col-md-6">
  29. <div class="content">
  30. <div class="chart-wrap">
  31. <div id="rose2"></div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="panel_box">
  38. <div class="table_title blue">
  39. <p>未处理告警</p>
  40. </div>
  41. <table data-height="405" data-mobile-responsive="true" id="TContact" style="table-layout:fixed;">
  42. <thead>
  43. <tr class="hidden-em">
  44. <th data-field="upload_date_value">告警时间</th>
  45. <th data-field="warn_type_value" data-formatter="formatterColT">告警类别</th>
  46. <th data-field="areaName">市县区</th>
  47. <th data-field="park_id_name">园区</th>
  48. <th data-field="org_name">企业</th>
  49. <th data-align="center" data-field="solveStatusName" data-formatter="formatterColS">处理状态</th>
  50. <th data-align="center" data-field="operate" data-formatter="OperatingFomatterO">操作</th>
  51. </tr>
  52. </thead>
  53. </table>
  54. </div>
  55. </div>
  56. </div>
  57. </body>
  58. <script src="js/import.js" type='text/javascript'></script>
  59. <script src="js/pages/common.js" type='text/javascript'></script>
  60. <script src="js/pages/CURDTable.js" type='text/javascript'></script>
  61. <script src="js/charts/echart_yarn.min.js" type='text/javascript'></script>
  62. <script>
  63. var urlparams = new cur({}).parserUrl(location.href, 'obj').params;
  64. var cid = urlparams.auth_cid;
  65. $("body").append('<script src="/system/lang/desktop/config.json?script=1&auth_cid=' + cid + '"><\/script>');
  66. window.document.domain = AUTH.site.domain || 'shvber.com';
  67. var host = "http://" + eval("(" + AUTH.site.config + ")").platform["01200014"] + "." + AUTH.site.domain;
  68. function OperatingFomatterO(value, row, index) {
  69. var uuid = 'id';
  70. return '<span class="operate"><a href="javascript:void(0);" onclick="operate(' + '\'' + row['terminal_id'] + '\'' + ',' + row['upload_date'] + ',' + '\'' + row['warn_type'] + '\'' + ')">处理</a> | <a href="javascript:void(0);" onclick="viewDetail(' + '\'' + row['terminal_id'] + '\'' + ',' + row['upload_date'] + ',' + '\'' + row['warn_type'] + '\'' + ',' + '\'' + row['org_id'] + '\'' + ')">查看详情</a></span>';
  71. }
  72. function formatterColT(value, row, index) {
  73. switch (value) {
  74. case '减产':
  75. return `<span class="circle-icon circle-icon06"></span>${value}`
  76. break;
  77. case '停产':
  78. return `<span class="circle-icon circle-icon07"></span>${value}`
  79. break;
  80. case '离线':
  81. default:
  82. return `<span class="circle-icon circle-icon08"></span>${value}`
  83. break;
  84. }
  85. }
  86. function formatterColS(value, row, index) {
  87. switch (value) {
  88. case '已经处理':
  89. return `<span class="circle-icon circle-icon09"></span>${value}`
  90. break;
  91. case '未处理':
  92. default:
  93. return `<span class="circle-icon circle-icon10"></span>${value}`
  94. break;
  95. }
  96. }
  97. function operate(terminal_id, upload_date, warn_type) {
  98. var url = host + '/alarmOperate.html?auth_aid=' + urlparams.auth_aid + '&auth_mid=' + urlparams.auth_mid + '&auth_cid=' + urlparams.auth_cid + '&terminal_id=' + terminal_id + '&upload_date=' + upload_date + '&warn_type=' + warn_type;
  99. // if (window.top.$('#tab').tabs('exists', '告警处理')) {
  100. // window.top.$('#tab').tabs('select', '告警处理')
  101. // window.top.updateTab('告警处理', url)
  102. // }else{
  103. // window.top.addTab('告警处理', url);
  104. // }
  105. window.top.updateTab('告警处理', url);
  106. }
  107. function viewDetail(terminal_id, upload_date, warn_type, org_id) {
  108. var url = host + '/enterpriseRealtimeAlarm.html?auth_aid=' + urlparams.auth_aid + '&auth_mid=' + urlparams.auth_mid + '&auth_cid=' + urlparams.auth_cid + '&terminal_id=' + terminal_id + '&upload_date=' + upload_date + '&warn_type=' + warn_type + '&org_id=' + org_id;
  109. if (window.top.$('#tab').tabs('exists', '企业实时告警')) {
  110. window.top.$('#tab').tabs('select', '企业实时告警')
  111. window.top.updateTab('企业实时告警', url)
  112. } else {
  113. window.top.addTab('企业实时告警', url);
  114. }
  115. }
  116. function initPage() {
  117. new yarn({
  118. charts: [{
  119. el: 'rose1',
  120. type: 'pie',
  121. theme: 'pie-color1',
  122. url: "/web/onlineWarn/queryPie1?auth_aid=" + urlparams.auth_aid + '&auth_mid=' + urlparams.auth_mid + '&auth_cid=' + urlparams.auth_cid,
  123. // url:'js/charts/demos/dsm/realTimeAlarm_pie1.json',
  124. theme_obj: {
  125. showLabel: false,
  126. radius: ['0%', '50%'],
  127. center: ['35%', '50%'],
  128. label: {
  129. showPercent: false,
  130. Unit: '家'
  131. },
  132. legend: {
  133. show: true,
  134. showPercent: true,
  135. type: 'plain',
  136. selectedMode: true,
  137. left: '60%',
  138. top: 'middle'
  139. }
  140. },
  141. h: 400
  142. }]
  143. }).init();
  144. new yarn({
  145. charts: [{
  146. el: 'rose2',
  147. type: 'pie',
  148. theme: 'pie-color2',
  149. url: "/web/onlineWarn/queryPie2?auth_aid=" + urlparams.auth_aid + '&auth_mid=' + urlparams.auth_mid + '&auth_cid=' + urlparams.auth_cid,
  150. // url:'js/charts/demos/dsm/realTimeAlarm_pie2.json',
  151. theme_obj: {
  152. showLabel: false,
  153. radius: ['0%', '50%'],
  154. center: ['35%', '50%'],
  155. label: {
  156. showPercent: false,
  157. Unit: '家'
  158. },
  159. legend: {
  160. show: true,
  161. showPercent: true,
  162. type: 'plain',
  163. selectedMode: true,
  164. left: '60%',
  165. top: 'middle'
  166. }
  167. },
  168. h: 400
  169. }]
  170. }).init();
  171. var c = new cur({
  172. t: "#TContact",
  173. m: "#modal",
  174. pageSize: 15,
  175. height: 610,
  176. // dataSourceType:'local',
  177. queryUrl: "/web/onlineWarn/queryTable?auth_aid=" + urlparams.auth_aid + "&auth_mid=" + urlparams.auth_mid + "&auth_cid=" + urlparams.auth_cid,
  178. // queryUrl:'js/charts/demos/dsm/realTimeAlarm_table.json',
  179. addUrl: "/sysbase/process/add",
  180. editUrl: "/sysbase/process/update",
  181. // columns: [{
  182. // title: '告警时间',
  183. // align: "left",
  184. // valign: "middle",
  185. // field: 'upload_date_value'
  186. // }, {
  187. // title: '告警类别',
  188. // align: "left",
  189. // valign: "middle",
  190. // field: 'warn_type_value',
  191. // formatter:formatterColT
  192. // }, {
  193. // title: '市县区',
  194. // align: "left",
  195. // valign: "middle",
  196. // field: 'areaName'
  197. // }, {
  198. // title: '园区',
  199. // align: "left",
  200. // valign: "middle",
  201. // field: 'park_id_name'
  202. // }, {
  203. // title: '企业',
  204. // align: "left",
  205. // valign: "middle",
  206. // field: 'org_name'
  207. // }, {
  208. // title: '处理状态',
  209. // align: "center",
  210. // valign: "middle",
  211. // field: 'solveStatusName',
  212. // formatter:formatterColS
  213. // }, {
  214. // title: '操作',
  215. // align: "center",
  216. // valign: "middle",
  217. // field: 'operate',
  218. // formatter:OperatingFomatterO
  219. // }]
  220. });
  221. c.init();
  222. setTimeout(function () {
  223. $('#TContact').bootstrapTable('resetView');
  224. }, 500);
  225. }
  226. initPage();
  227. </script>
  228. </html>