console_group.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>智慧安全平台</title>
  8. <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
  9. <link rel="stylesheet" href="../../assets/module/admin.css?v=315"/>
  10. <!--[if lt IE 9]>
  11. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  12. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  13. <![endif]-->
  14. <style>
  15. /** 统计快捷方式样式 */
  16. .console-link-block {
  17. display: block;
  18. position: relative;
  19. color: #fff;
  20. font-size: 18px;
  21. padding: 25px 20px;
  22. border-radius: 4px;
  23. overflow: hidden;
  24. box-shadow: 0px 3px 5px rgba(0, 0, 0, .1);
  25. background-color: rgb(155, 197, 57);
  26. }
  27. .console-link-block .console-link-block-num {
  28. font-size: 40px;
  29. font-weight: bold;
  30. margin-bottom: 10px;
  31. }
  32. .console-link-block .console-link-block-icon {
  33. height: 70px;
  34. position: absolute;
  35. right: 20px;
  36. top: 50%;
  37. transform: translateY(-50%);
  38. }
  39. .console-link-block .console-link-block-band {
  40. background-color: rgb(227, 42, 22);
  41. font-size: 14px;
  42. position: absolute;
  43. width: 80px;
  44. padding: 2px 0;
  45. text-align: center;
  46. transform: rotate(45deg);
  47. right: -21px;
  48. top: 8px;
  49. color: rgba(255, 255, 255, .9);
  50. z-index: 1;
  51. }
  52. /** //统计快捷方式样式end */
  53. /** 小屏幕下样式 */
  54. @media screen and (max-width: 992px) {
  55. .console-link-block {
  56. font-size: 14px;
  57. padding: 15px 10px;
  58. }
  59. .console-link-block .console-link-block-num {
  60. font-size: 28px;
  61. margin-bottom: 0px;
  62. }
  63. .console-link-block .console-link-block-icon {
  64. height: 45px;
  65. right: 10px;
  66. }
  67. .console-link-block .console-link-block-band {
  68. font-size: 12px;
  69. right: -25px;
  70. top: 8px;
  71. }
  72. }
  73. /** 设置每个快捷块的颜色 */
  74. #consoleLink > div:first-child .console-link-block {
  75. background-color: rgb(155, 197, 57);
  76. }
  77. #consoleLink > div:nth-child(2) .console-link-block {
  78. background-color: rgb(85, 165, 234);
  79. }
  80. #consoleLink > div:nth-child(3) .console-link-block {
  81. background-color: rgb(157, 175, 291);
  82. }
  83. #consoleLink > div:nth-child(4) .console-link-block {
  84. background-color: rgb(245, 145, 162);
  85. }
  86. #consoleLink > div:nth-child(5) .console-link-block {
  87. background-color: rgb(254, 170, 79);
  88. }
  89. #consoleLink > div:last-child .console-link-block {
  90. background-color: rgb(64, 212, 176);
  91. }
  92. /** //设置每个快捷块的颜色end */
  93. </style>
  94. </head>
  95. <body>
  96. <!-- 正文开始 -->
  97. <div class="layui-fluid">
  98. <!-- 统计图表 -->
  99. <div class="layui-row layui-col-space15">
  100. <div class="layui-col-md12 layui-col-xs12">
  101. <div class="layui-card">
  102. <!-- <div class="layui-card-header">&#45;&#45;&#45;&#45;</div>-->
  103. <div class="layui-card-body">
  104. <table class="layui-hide" id="datatable" lay-filter="datatable"></table>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="layui-row layui-col-space15">
  110. <div class="layui-col-md3 layui-col-xs12">
  111. <div class="layui-card">
  112. <div class="layui-card-header">风险点总计(<span style="color:#E9474A" class="levelTotal">0</span>)</div>
  113. <div class="layui-card-body" style="height: 350px;overflow:auto">
  114. <div style="height: 300px;position: relative;">
  115. <div id="tjDivDay" style="height: 100%;"></div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="layui-col-md6 layui-col-xs12">
  121. <div class="layui-card">
  122. <div class="layui-card-header">隐患通报(待整改)</div>
  123. <div class="layui-card-body">
  124. <table class="layui-hide" id="datatable_" lay-filter="datatable_"></table>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="layui-col-md3 layui-col-xs12">
  129. <div class="layui-card">
  130. <div class="layui-card-header">隐患总计(<span style="color:#E9474A" class="hiddenDangerCount">0</span>)
  131. </div>
  132. <div class="layui-card-body">
  133. <div style="height: 255px;position: relative;" class="layui-row text-center">
  134. <div class="layui-col-xs6" id="dh1" style="display: ''">
  135. <div style="font-size: 18px;background-color: #FF4B28">重大</div>
  136. <div id="lv1Num" style="color: #28a6d6;font-size: 22px;padding: 10px 0 15px 0;">22</div>
  137. </div>
  138. <div class="layui-col-xs6" id="dh2" style="display: ''">
  139. <div style="font-size: 18px;background-color: #FF6C00">较大</div>
  140. <div id="lv2Num" style="color: #28a6d6;font-size: 22px;padding: 10px 0 15px 0;">38</div>
  141. </div>
  142. <div class="layui-col-xs6" id="dh3" style="display: ''">
  143. <div style="font-size: 18px;background-color: #FFDF0E">一般</div>
  144. <div id="lv3Num" style="color: #28a6d6;font-size: 22px;padding: 10px 0 15px 0;">22</div>
  145. </div>
  146. <div class="layui-col-xs6" id="dh4" style="display: ''">
  147. <div style="font-size: 18px;background-color: #00C0FF">较低</div>
  148. <div id="lv4Num" style="color: #28a6d6;font-size: 22px;padding: 10px 0 15px 0;">38</div>
  149. </div>
  150. </div>
  151. <hr>
  152. <div class="layui-row text-center">
  153. <div class="layui-col-xs6">
  154. <div style="font-size: 18px;padding: 10px 0 15px 0;">待整改</div>
  155. <div id="s2Num" style="color: #28a6d6;font-size: 22px;">22</div>
  156. </div>
  157. <div class="layui-col-xs6">
  158. <div style="font-size: 18px;padding: 10px 0 15px 0;">待验收</div>
  159. <div id="s3Num" style="color: #28a6d6;font-size: 22px;">38</div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <!-- 加载动画 -->
  168. <div class="page-loading">
  169. <div class="ball-loader">
  170. <span></span><span></span><span></span><span></span>
  171. </div>
  172. </div>
  173. <!-- js部分 -->
  174. <script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
  175. <script type="text/javascript" src="../../assets/js/common.js?v=315"></script>
  176. <script type="text/javascript" src="../../assets/libs/jsonpath/jsonpath.js"></script>
  177. <script type="text/javascript" src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
  178. <script type="text/javascript" src="../../assets/libs/leftTime/leftTime.js"></script>
  179. <script src="../../assets/libs/echarts/echarts.min.js"></script>
  180. <script src="../../assets/libs/echarts/echartsTheme.js"></script>
  181. <script type="text/html" id="lvTpl">
  182. {{# var imgs="../../assets/images/lv/blue.png",title="较低"; var lv=d.riskPointLevel;}}
  183. {{# if(lv==1){ imgs="../../assets/images/lv/red.png" ;title="重大" } }}
  184. {{# if(lv==2){ imgs="../../assets/images/lv/orange.png";title="较大"} }}
  185. {{# if(lv==3){ imgs="../../assets/images/lv/yellow.png";title="一般"} }}
  186. {{# if(lv==4){ imgs="../../assets/images/lv/blue.png";title="较低"} }}
  187. {{# if(lv==1){ }}
  188. <div class='notify'><span class='heartbit'></span><span>
  189. <img style="display: inline-block; width: 28px;height: 28px;" src={{ imgs }}>&nbsp;{{ title }}
  190. </span>
  191. </div>
  192. {{# }else{ }}
  193. <img style="display: inline-block; width: 28px;height: 28px;" src={{ imgs }}>&nbsp;{{ title }}
  194. {{# } }}
  195. </script>
  196. <script type="text/html" id="lvHdTpl">
  197. {{# var imgs="../../assets/images/hdangerLevel/iconHiddenDanger4.png",title="较低"; var lv=d.riskPointLevel;}}
  198. {{# if(lv==1){ imgs="../../assets/images/hdangerLevel/iconHiddenDanger1.png" ;title="重大" } }}
  199. {{# if(lv==2){ imgs="../../assets/images/hdangerLevel/iconHiddenDanger2.png";title="较大"} }}
  200. {{# if(lv==3){ imgs="../../assets/images/hdangerLevel/iconHiddenDanger3.png";title="一般"} }}
  201. {{# if(lv==4){ imgs="../../assets/images/hdangerLevel/iconHiddenDanger4.png";title="较低"} }}
  202. {{# if(lv==1){ }}
  203. <div class='notify'><span class='heartbit'></span><span>
  204. <img style="display: inline-block; width: 28px;height: 28px;" src={{ imgs }}>&nbsp;{{ title }}
  205. </span>
  206. </div>
  207. {{# }else{ }}
  208. <img style="display: inline-block; width: 28px;height: 28px;" src={{ imgs }}>&nbsp;{{ title }}
  209. {{# } }}
  210. </script>
  211. <script>
  212. layui.use(['layer', 'table', 'util', 'admin', 'uParas'], function () {
  213. var $ = layui.jquery;
  214. var layer = layui.layer;
  215. var util = layui.util;
  216. var table = layui.table;
  217. var admin = layui.admin;
  218. var uParas = layui.uParas;
  219. <!--风险点总计-->
  220. var myCharts1 = echarts.init(document.getElementById('tjDivDay'), myEchartsTheme);
  221. $.getJSON(uParas.baseUrl + "/gent/company/riskCount", {}, function (result) {
  222. if (result.code == 1) {
  223. var allCount = 0, lv1Count = 0, lv2Count = 0, lv3Count = 0, lv4Count = 0;
  224. // console.info(result.data.list);
  225. $.each(result.data.list, function (i, field) {
  226. if (field.riskLevel == 1) {
  227. lv1Count = field.ristCount;
  228. } else if (field.riskLevel == 2) {
  229. lv2Count = field.ristCount;
  230. } else if (field.riskLevel == 3) {
  231. lv3Count = field.ristCount;
  232. } else if (field.riskLevel == 4) {
  233. lv4Count = field.ristCount;
  234. }
  235. });
  236. drawNDGR(lv1Count, lv2Count, lv3Count, lv4Count, result.data.total);
  237. myCharts1.setOption(option);
  238. $(".levelTotal").html(result.data.total);
  239. }
  240. });
  241. function drawNDGR(level1, level2, level3, level4, levelTotal) {
  242. var data = new Array();
  243. var name = "";
  244. if (level1 != 0) {
  245. name = "重大";
  246. data.push({
  247. value: level1, name: name + "(" + level1 + ")", itemStyle: {
  248. color: "#EB0603"
  249. }
  250. })
  251. }
  252. if (level2 != 0) {
  253. name = "较大";
  254. data.push({
  255. name: name + "(" + level2 + ")", value: level2, itemStyle: {
  256. color: "#FF5C03"
  257. }
  258. })
  259. }
  260. if (level3 != 0) {
  261. name = "一般";
  262. data.push({
  263. value: level3, name: name + "(" + level3 + ")", itemStyle: {
  264. color: "#FFF001"
  265. }
  266. })
  267. }
  268. if (level4 != 0) {
  269. name = "低";
  270. data.push({
  271. value: level4, name: name + "(" + level4 + ")", itemStyle: {
  272. color: "#017CE8"
  273. }
  274. })
  275. }
  276. var fontSize;
  277. if (levelTotal == 0) {
  278. levelTotal = "暂无数据";
  279. fontSize = 16
  280. } else {
  281. fontSize = 36
  282. }
  283. option = {
  284. backgroundColor: '#fff',
  285. title: {
  286. text: levelTotal,
  287. textStyle: {
  288. fontSize: fontSize,
  289. fontWeight: 'normal',
  290. fontFamily: '华文细黑',
  291. },
  292. x: 'center',
  293. y: 'center',
  294. },
  295. tooltip: {
  296. trigger: 'item',
  297. formatter: "{a}数量:{c} 个 <br/>占总数的({d}%)"
  298. },
  299. series: [
  300. {
  301. name: '风险点',
  302. type: 'pie',
  303. radius: ['35%', '60%'],
  304. avoidLabelOverlap: false,
  305. label: {
  306. emphasis: {
  307. show: true,
  308. textStyle: {
  309. fontSize: '20',
  310. fontWeight: 'bold'
  311. }
  312. }
  313. },
  314. data: data
  315. }
  316. ]
  317. }
  318. }
  319. <!--风险点、隐患、分值统计-->
  320. var insTb = table.render({
  321. elem: '#datatable',
  322. url: uParas.baseUrl + '/gent/company/queryTotal',
  323. page: false,
  324. title: "风险点",
  325. height: 300,
  326. cellMinWidth: 60,
  327. limits: [100, 200, 300],
  328. limit: 100,
  329. cols: [[
  330. {field: 'qymc', title: '企业名称', rowspan: 2, align: 'center'},
  331. {title: '风险点', colspan: 2, align: 'center'},
  332. {title: '未整改隐患', colspan: 2, align: 'center'},
  333. {title: '已整改隐患', colspan: 2, align: 'center'},
  334. {title: '分值', colspan: 2, align: 'center'}
  335. ], [
  336. {field: 'riskCount1', sort: false, title: '重大风险点', align: 'center'},
  337. {field: 'riskCount2', sort: false, title: '较大风险点', align: 'center'},
  338. {field: 'hdCount1', sort: false, title: '重大隐患', align: 'center'},
  339. {field: 'hdCount2', sort: false, title: '一般隐患', align: 'center'},
  340. {field: 'hdCount3', sort: false, title: '重大隐患', align: 'center'},
  341. {field: 'hdCount4', sort: false, title: '一般隐患', align: 'center'},
  342. {field: 'riskPoint', sort: false, title: '风险指数', align: 'center'},
  343. {
  344. field: 'securityPoint', sort: false, title: '安全指数', align: 'center', templet: function (d) {
  345. return d.securityPoint == 0 ? 100 : d.securityPoint;
  346. }
  347. }
  348. ]],
  349. done: function (res, curr, count) {
  350. $(".iManageRiskCount").html(count);
  351. }
  352. });
  353. <!-- 隐患总计 -->
  354. $.ajax({
  355. url: uParas.baseUrl + '/gent/company/hdCount',
  356. type: 'get',
  357. dataType: 'json',
  358. success: function (resp) {
  359. if (resp && resp.data) {
  360. var data = resp.data;
  361. $(".hiddenDangerCount").html(data.total);
  362. if (data.biggest) {
  363. $("#lv1Num").html(data.biggest);
  364. } else {
  365. $("#dh1").hide();
  366. }
  367. if (data.bigger) {
  368. $("#lv2Num").html(data.bigger);
  369. } else {
  370. $("#dh2").hide();
  371. }
  372. if (data.third) {
  373. $("#lv3Num").html(data.third);
  374. } else {
  375. $("#dh3").hide();
  376. }
  377. if (data.fourth) {
  378. $("#lv4Num").html(data.fourth);
  379. } else {
  380. $("#dh4").hide();
  381. }
  382. $("#s2Num").html(data.status2);
  383. $("#s3Num").html(data.status3);
  384. }
  385. }
  386. });
  387. // $.getJSON(uParas.baseUrl + "/language/getHiddenDangerLevelList", {}, function (resultLv) {
  388. // if (resultLv.code == 1) {
  389. // //{id: "重大", value: "1"}
  390. // $.getJSON(uParas.baseUrl + "/ent/hiddenDangerCount/getCountAll", {}, function (result) {
  391. // if (result.code == 1) {
  392. // var allCount = 0, lv1Count = 0, lv2Count = 0, lv3Count = 0, lv4Count = 0;
  393. // lv1Count = jsonPath(result, "$.data[?(@.key=='lv1')]") ? jsonPath(result, "$.data[?(@.key=='lv1')]")[0].value : 0;
  394. // lv2Count = jsonPath(result, "$.data[?(@.key=='lv2')]") ? jsonPath(result, "$.data[?(@.key=='lv2')]")[0].value : 0;
  395. // lv3Count = jsonPath(result, "$.data[?(@.key=='lv3')]") ? jsonPath(result, "$.data[?(@.key=='lv3')]")[0].value : 0;
  396. // lv4Count = jsonPath(result, "$.data[?(@.key=='lv4')]") ? jsonPath(result, "$.data[?(@.key=='lv4')]")[0].value : 0;
  397. // if (jsonPath(resultLv, "$.data[?(@.value=='1')]")) {
  398. // $("#dh1").show();
  399. // allCount += parseInt(lv1Count);
  400. // }
  401. // if (jsonPath(resultLv, "$.data[?(@.value=='2')]")) {
  402. // $("#dh2").show();
  403. // allCount += parseInt(lv2Count);
  404. // }
  405. // if (jsonPath(resultLv, "$.data[?(@.value=='3')]")) {
  406. // $("#dh3").show();
  407. // allCount += parseInt(lv3Count);
  408. // }
  409. // if (jsonPath(resultLv, "$.data[?(@.value=='4')]")) {
  410. // $("#dh4").show();
  411. // allCount += parseInt(lv4Count);
  412. // }
  413. // $(".hiddenDangerCount").html(allCount);
  414. // $("#lv1Num").html(lv1Count);
  415. // $("#lv2Num").html(lv2Count);
  416. // $("#lv3Num").html(lv3Count);
  417. // $("#lv4Num").html(lv4Count);
  418. // var s2Count = 0, s3Count = 0, s5Count = 0;
  419. // s2Count = jsonPath(result, "$.data[?(@.key=='s2')]") ? jsonPath(result, "$.data[?(@.key=='s2')]")[0].value : 0;
  420. // s5Count = jsonPath(result, "$.data[?(@.key=='s5')]") ? jsonPath(result, "$.data[?(@.key=='s5')]")[0].value : 0;
  421. // s3Count = jsonPath(result, "$.data[?(@.key=='s3')]") ? jsonPath(result, "$.data[?(@.key=='s3')]")[0].value : 0;
  422. // $("#s2Num").html(parseInt(s5Count) + parseInt(s2Count));
  423. // $("#s3Num").html(s3Count);
  424. // }
  425. // });
  426. // }
  427. // });
  428. <!--预警信息查询-->
  429. $.getJSON(uParas.baseUrl + "/ent/riskPoint/controlRecord", {}, function (resultLv) {
  430. if (resultLv.code == 0) {
  431. var html = '';
  432. $.each(resultLv.data, function (i, field) {
  433. var riskPointLevel = field.riskPointLevel;
  434. var isOutOfControl = field.isOutOfControl;
  435. var hdangerLevel = field.hdangerLevel;
  436. var riskPointLevelImg = "";
  437. var isOutOfControlImg = '';
  438. var hdangerLevelImg = '';
  439. if (riskPointLevel == 1) {
  440. riskPointLevelImg = "<img src='../../assets/images/lv/red.png' style='width: 30px;height: 30px;'/>";
  441. } else if (riskPointLevel == 2) {
  442. riskPointLevelImg = "<img src='../../assets/images/lv/orange.png' style='width: 30px;height: 30px;'/>";
  443. } else if (riskPointLevel == 3) {
  444. riskPointLevelImg = "<img src='../../assets/images/lv/yellow.png' style='width: 30px;height: 30px;'/>";
  445. } else if (riskPointLevel == 4) {
  446. riskPointLevelImg = "<img src='../../assets/images/lv/blue.png' style='width: 30px;height: 30px;'/>";
  447. }
  448. if (isOutOfControl == 0) {
  449. isOutOfControlImg = "<img src='../../assets/images/icon/icon_shoukong@3x.png' style='width: 20px;height: 20px;'/>";
  450. } else if (isOutOfControl == 1) {
  451. isOutOfControlImg = "<img src='../../assets/images/icon/icon_shikong@3x.png' style='width: 20px;height: 20px;'/>";
  452. }
  453. if (hdangerLevel == 1) {
  454. hdangerLevelImg = "<img src='../../assets/images/hdangerLevel/iconHiddenDanger1.png' style='width: 30px;height: 30px;'/> 重大";
  455. } else if (hdangerLevel == 2) {
  456. hdangerLevelImg = "<img src='../../assets/images/hdangerLevel/iconHiddenDanger2.png' style='width: 30px;height: 30px;'/> 较大";
  457. } else if (hdangerLevel == 3) {
  458. hdangerLevelImg = "<img src='../../assets/images/hdangerLevel/iconHiddenDanger3.png' style='width: 30px;height: 30px;'/> 一般";
  459. } else if (hdangerLevel == 4) {
  460. hdangerLevelImg = "<img src='../../assets/images/hdangerLevel/iconHiddenDanger4.png' style='width: 30px;height: 30px;'/> 较低";
  461. }
  462. html += `<li class="layui-timeline-item">
  463. <i class="layui-icon layui-timeline-axis"></i>
  464. <div class="layui-timeline-content layui-text">
  465. <h3 class="layui-timeline-title">${riskPointLevelImg} ${isOutOfControlImg} ${field.riskPointName} </h3>
  466. <p>${field.causeCode} (${hdangerLevelImg})</p>
  467. <p>${field.createdTime},${field.causeDesc}</p>
  468. </div>
  469. </li>`;
  470. });
  471. $(".layui-timeline").append(html);
  472. }
  473. });
  474. <!--隐患通报列表-->
  475. var insTb = table.render({
  476. elem: '#datatable_',
  477. url: uParas.baseUrl + "/gent/company/hdList",
  478. page: false,
  479. title: "隐患列表",
  480. height: 350,
  481. cellMinWidth: 60,
  482. limits: [100, 200, 300],
  483. limit: 100,
  484. cols: [[
  485. {type: 'numbers', title: '序号'},
  486. {field: 'hdangerTitle', sort: false, title: '隐患标题'},
  487. {
  488. field: 'hdangerLevel', align: 'center', sort: false, title: '隐患等级', width: 90,
  489. templet: function (d) {
  490. return setHdangerLevel(d.hdangerLevel);
  491. }
  492. },
  493. // {
  494. // field: 'hdangerTitle', sort: false, title: '隐患名称', templet: function (d) {
  495. // var imgPath = '';
  496. // if (d.imgPath != null) {
  497. // imgPath = d.imgPath.split(",")[0];
  498. // imgPath = uParas.staticUrl + imgPath;
  499. // }
  500. // return "<img src='" + imgPath + "' width='30px'>" + d.hdangerTitle;
  501. // }
  502. // },
  503. {field: 'catName', sort: false, title: '隐患类型'},
  504. {field: 'groupName', sort: false, title: '隐患部门'},
  505. {field: 'name', sort: false, title: '整改人'},
  506. {
  507. field: 'hdangerRetifyDeadline', sort: false, title: '整改期限', templet: function (d) {
  508. // var out = "<span style='color: red'>整改超期</span>";
  509. // jQuery.leftTime(d.hdangerRetifyDeadline, function (lt) {
  510. // if (lt.status) {
  511. // out = lt.d + "<span style='color: red'>天</span>" + lt.h + "<span style='color: red'>时</span>" + lt.m;
  512. // }
  513. // });
  514. // return out;
  515. return '<div class="countDown" data-date="' + (d.hdangerRetifyDeadline || '') + '"></div>'
  516. }
  517. },
  518. ]], done: function (res, curr, count) {
  519. // $(".iManageRiskCount").html(count);
  520. // return '<div class="countDown" data-date="' + (d.countDown||'') + '">
  521. var elem = this.elem.next();
  522. var bodyElem = elem.find('.layui-table-main');
  523. layui.each(bodyElem.find('.countDown'), function (index, domElem) {
  524. domElem = $(domElem);
  525. if (!domElem.data('date')) {
  526. return;
  527. }
  528. var endTime = new Date(domElem.data('date')).getTime(),
  529. serverTime = new Date().getTime();
  530. util.countdown(endTime, serverTime, function (date, serverTime, timer) {
  531. var str = '<span style=\'color: red\'>' + date[0] + '</span>天' + '<span style=\'color: red\'>' + date[1] + '</span>时' + '<span style=\'color: red\'>' + date[2] + '</span>分';
  532. if (date[0] == 0 && date [1] == 0 && date[2] == 0) {
  533. str = "<span style='color: red'>整改超期</span>"
  534. }
  535. domElem.html(str);
  536. });
  537. });
  538. }
  539. });
  540. /*隐患等级*/
  541. function setHdangerLevel(hdangerLevel) {
  542. var imgSrc = '';
  543. var title = '';
  544. if (hdangerLevel == 1) {
  545. title = '重大';
  546. imgSrc = '../../assets/images/hdangerLevel/iconHiddenDanger1.png'
  547. } else if (hdangerLevel == 2) {
  548. title = '较大';
  549. imgSrc = '../../assets/images/hdangerLevel/iconHiddenDanger2.png'
  550. } else if (hdangerLevel == 3) {
  551. title = '一般';
  552. imgSrc = '../../assets/images/hdangerLevel/iconHiddenDanger3.png'
  553. } else if (hdangerLevel == 4) {
  554. title = '较低';
  555. imgSrc = '../../assets/images/hdangerLevel/iconHiddenDanger4.png'
  556. } else {
  557. return '未知';
  558. }
  559. return '<img style="display: inline-block;width: 28px;height: 28px;" src="' + imgSrc + '" >' + title
  560. }
  561. // -------------------------------------------------------------------------
  562. // 窗口大小改变事件
  563. window.onresize = function () {
  564. myCharts1.resize();
  565. // myCharts2.resize();
  566. // myCharts3.resize();
  567. };
  568. });
  569. </script>
  570. </body>
  571. </html>