hdangerYearStatistics.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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/formSelects/formSelects-v4.css"/>
  10. <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
  11. <link rel="stylesheet" href="../../../assets/module/uParas.css?v=312"/>
  12. </head>
  13. <body>
  14. <style type="text/css">
  15. /*table th{*/
  16. /* color: #ffb800;*/
  17. /*}*/
  18. table tr th, td {
  19. text-align: center;
  20. }
  21. /*.one {*/
  22. /* border-bottom: 1px solid indianred;*/
  23. /* color: #FF0000;*/
  24. /*}*/
  25. /*.two {*/
  26. /* border-bottom: 1px solid #148ef1;*/
  27. /* color: #FFA500;*/
  28. /*}*/
  29. /*.three {*/
  30. /* border-bottom: 1px solid #FFDF0E;*/
  31. /* color: #FFFF00;*/
  32. /*}*/
  33. /*.four {*/
  34. /* border-bottom: 1px solid #00C0FF;*/
  35. /* color: #0000FF;*/
  36. /*}*/
  37. </style>
  38. <!-- 加载动画 -->
  39. <div class="page-loading">
  40. <div class="ball-loader">
  41. <span></span><span></span><span></span><span></span>
  42. </div>
  43. </div>
  44. <!-- 正文开始 -->
  45. <div class="layui-fluid">
  46. <div class="layui-card">
  47. <div class="layui-card-body">
  48. <form class="layui-form m-top10px m-bottom10px" lay-filter="filterForm" id="filterForm">
  49. <div class="layui-card-header">
  50. <div class="layui-inline layui-col-md2 text-left" style="margin-left: -40px;">
  51. <label class="layui-form-label">部门</label>
  52. <div class="layui-input-block">
  53. <input type="text" id="currentGroupName" class="layui-input" name="currentGroupName"
  54. value=""
  55. placeholder="全部部门"
  56. class="form-control" readonly>
  57. <input type="hidden" id="selectedGroup" name="selectedGroup" readonly>
  58. <div id="menuContent" class="menuContent">
  59. <ul id="groupTree" class="ztree" style="margin-top:0;"></ul>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="layui-inline layui-col-md2 ">
  64. <label class="layui-form-label">日期</label>
  65. <div class="layui-input-block">
  66. <input type="text" name="hiddenYear" id="hidden_year"
  67. placeholder="选择年份" lay-verify="datetime" autocomplete="off"
  68. class="layui-input work-flow-review-hint">
  69. </div>
  70. </div>
  71. <!-- <div class="layui-inline layui-col-md2 ">-->
  72. <!-- <div class="layui-input-block" style="margin-left: 0px;margin-top: -3px;">-->
  73. <!-- <button id="formSubSearch" class="layui-btn icon-btn bg-c-add">-->
  74. <!-- <i class="layui-icon">&#xe615;</i>-->
  75. <!-- </button>-->
  76. <!-- </div>-->
  77. <!-- </div>-->
  78. </div>
  79. <div class="layui-card-body overflow-y-680px">
  80. <div class="layui-tab layui-tab-brief ">
  81. <!--统计图-->
  82. <div id="hdangerStatcs" class="m-top10px" style="height:350px;"></div>
  83. <!--隐患等级统计-->
  84. <div id="table_hidden ">
  85. <table class="layui-table text-center">
  86. <thead>
  87. <tr class="display-none hdanger-statcs4">
  88. <th colspan="4">总数</th>
  89. <th colspan="4">未处理</th>
  90. <th colspan="4">已处理</th>
  91. </tr>
  92. <tr class="display-none hdanger-statcs2">
  93. <th colspan="2">总数</th>
  94. <th colspan="2">未处理</th>
  95. <th colspan="2">已处理</th>
  96. </tr>
  97. <tr class="display-none hdanger-statcs4">
  98. <th class="one">重大</th>
  99. <th class="two">较大</th>
  100. <th class="three">一般</th>
  101. <th class="four">较低</th>
  102. <th class="one">重大</th>
  103. <th class="two">较大</th>
  104. <th class="three">一般</th>
  105. <th class="four">较低</th>
  106. <th class="one">重大</th>
  107. <th class="two">较大</th>
  108. <th class="three">一般</th>
  109. <th class="four">较低</th>
  110. </tr>
  111. <tr class="display-none hdanger-statcs2">
  112. <th class="one">重大</th>
  113. <th class="three">一般</th>
  114. <th class="one">重大</th>
  115. <th class="three">一般</th>
  116. <th class="one">重大</th>
  117. <th class="three">一般</th>
  118. </tr>
  119. </thead>
  120. <tbody>
  121. <tr class="hidden-tbody-list"></tr>
  122. </tbody>
  123. </table>
  124. </div>
  125. <!--隐患记录-->
  126. <table class="layui-table text-left" id="datatable" lay-filter="datatable"></table>
  127. </div>
  128. </div>
  129. </form>
  130. </div>
  131. </div>
  132. </div>
  133. <!--状态TPL-->
  134. <script type="text/html" id="imgTpl">
  135. {{# if(d.imgUrl != null && d.imgUrl != ''){ }}
  136. <a target="_blank" href="{{d.imgUrl}}">
  137. <img class="media-object" width="40px" height="40px" src="{{d.imgUrl}}">
  138. </a>
  139. {{# } else { }}
  140. <img class="media-object" width="40px" height="40px" src="/assets/images/error.jpg">
  141. {{# } }}
  142. </script>
  143. <script type="text/html" id="hdLevel">
  144. {{# var imgs="",title=""; var lv=d.hdangerLevel;}}
  145. {{# if(lv==1){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger1.png" ;title="重大" } }}
  146. {{# if(lv==2){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger2.png";title="较大"} }}
  147. {{# if(lv==3){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger3.png";title="一般"} }}
  148. {{# if(lv==4){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger4.png";title="较低"} }}
  149. <img style="display: inline-block; width: 28px;height: 28px;" src={{imgs}}>&nbsp;{{ title }}
  150. </script>
  151. <!-- js部分 -->
  152. <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
  153. <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
  154. <script type="text/javascript" src="../../../assets/libs/echarts/echarts.min.js?v=312"></script>
  155. <script type="text/javascript" src="../../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
  156. <script>
  157. layui.use(['layer', 'form', 'table', 'util', 'zTree', '_groupTree', 'laydate', 'admin', 'uParas', 'element', 'laytpl'], function () {
  158. var $ = layui.jquery;
  159. var layer = layui.layer;
  160. var form = layui.form;
  161. var util = layui.util;
  162. var table = layui.table;
  163. var admin = layui.admin;
  164. var uParas = layui.uParas;
  165. var element = layui.element, laytpl = layui.laytpl;
  166. var _groupTree = layui._groupTree;
  167. var laydate = layui.laydate;
  168. var insTb;
  169. var hdangerId = uParas.getUrlParam("hdangerId");
  170. var hdLevelSize = 2;
  171. var hiddenYear = new Date().getFullYear();
  172. // $("#hidden_year").val(new Data());
  173. /*日期*/
  174. laydate.render({
  175. elem: '#hidden_year',
  176. format: 'yyyy',
  177. type: 'year',
  178. value: new Date().getFullYear(), //初始化值
  179. btns: false, //隐藏按钮
  180. change: function (value, date) { //监听日期被切换
  181. $("#hidden_year").val(value);
  182. findByStatistics($("#selectedGroup").val(), $("#hidden_year").val());
  183. /*更新数据表*/
  184. var data = {
  185. "hiddenYear": $("#hidden_year").val(),
  186. "groupId": $("#selectedGroup").val(),
  187. "yearStatisticsRecord": 1
  188. };
  189. insTb.reload({where: data}, 'data');
  190. }
  191. });
  192. var dada = {"groupId": $("#selectedGroup").val(), "hiddenYear": hiddenYear, "yearStatisticsRecord": 1};
  193. initTable(dada);
  194. findByStatistics($("#selectedGroup").val(), hiddenYear);
  195. function initTable(data) {
  196. // 渲染表格
  197. insTb = table.render({
  198. elem: '#datatable',
  199. url: uParas.baseUrl + '/ent/hiddenDangerStatistics/queryHdangerRecordByPage',
  200. where: data,
  201. page: true,
  202. cellMinWidth: 100,
  203. cols: [[
  204. {type: 'numbers', title: '序号'},
  205. {field: 'imgUrl', sort: false, title: '图片', width: 70, templet: '#imgTpl'},
  206. {field: 'hdangerTitle', sort: false, title: '隐患标题'},
  207. {field: 'hdangerCatTitle', sort: false, title: '类型', width: 130},
  208. {field: 'disposeStatusStr', sort: false, title: '状态', width: 100},
  209. {field: 'hdangerLevel', sort: false, title: '隐患等级', templet: "#hdLevel", width: 100},
  210. {field: 'groupName', sort: false, title: '所属部门'},
  211. {field: 'executor', sort: false, title: '当前治理人员', width: 130},
  212. {field: 'bizCheckDefName', sort: false, title: '检查表名称'},
  213. {field: 'riskPointName', sort: false, title: '风险点'},
  214. {field: 'riskPointTypeName', sort: false, title: '风险点类型', width: 130},
  215. // {field: 'hdangerRetifyDeadline' , sort:false , title:'整改期限', width: 160,
  216. // templet: function (d) {
  217. // return leftTimeFunc(d.hdangerRetifyDeadline,d.status);
  218. // }
  219. // },
  220. ]]
  221. });
  222. }
  223. /**
  224. * 部门过滤
  225. * ztree 文本下拉
  226. */
  227. admin.req(uParas.baseUrl + '/admin/common/getGroupLists', null, function (res) {
  228. if (res.code == 1) {
  229. $.fn.zTree.init($('#groupTree'), settingMAP, res.data);
  230. $.fn.zTree.getZTreeObj("groupTree").expandAll(true);
  231. layer.closeAll('loading');
  232. hideMenuMap();
  233. }
  234. }, 'get');
  235. $("#currentGroupName").click(function () {
  236. $("#menuContent").slideDown("fast");
  237. $("body").bind("mousedown", onBodyDown);
  238. });
  239. function onBodyDown(event) {
  240. if (!(event.target.id === "selectedGroup" || event.target.id === "menuContent" || $(event.target).parents("#menuContentMap").length > 0)) {
  241. hideMenuMap();
  242. }
  243. }
  244. var settingMAP = {
  245. check: {
  246. enable: false,
  247. chkboxType: {"Y": "", "N": ""}
  248. },
  249. view: {
  250. dblClickExpand: false
  251. },
  252. data: {
  253. simpleData: {
  254. enable: true,
  255. idKey: "gId",
  256. pIdKey: "groupParent",
  257. rootPId: null
  258. },
  259. key: {
  260. name: "groupName"
  261. }
  262. },
  263. callback: {
  264. onClick: onClickMap
  265. }
  266. };
  267. function onClickMap(event, treeId, treeNode, clickFlag) {
  268. var zTree = $.fn.zTree.getZTreeObj("groupTree"),
  269. nodes = zTree.getSelectedNodes(),
  270. v = "", idlist = "";
  271. for (var i = 0, l = nodes.length; i < l; i++) {
  272. v += nodes[i].groupName + ",";
  273. idlist += nodes[i].gId + ",";
  274. }
  275. if (v.length > 0) {
  276. v = v.substring(0, v.length - 1);
  277. idlist = idlist.substring(0, idlist.length - 1);
  278. }
  279. var cityObj = $("#currentGroupName");
  280. if (cityObj.val() == v) {
  281. cityObj.attr("value", "");
  282. $("#gId").attr("value", "");
  283. } else {
  284. cityObj.attr("value", v);
  285. $("#gId").attr("value", idlist);
  286. }
  287. hideMenuMap();
  288. var groupId_ = idlist;
  289. if (groupId_ != "-1") {
  290. var Obj = new Object();
  291. Obj.gId = groupId_;
  292. }
  293. if (insTb != null && insTb != undefined && insTb != '') {
  294. /*更新数据表*/
  295. insTb.reload({where: Obj}, 'data');
  296. }
  297. /*更新统计*/
  298. findByStatistics(groupId_, $("#hidden_year").val());
  299. }
  300. function hideMenuMap() {
  301. $("#menuContent").fadeOut("fast");
  302. $("body").unbind("mousedown", onBodyDown);
  303. }
  304. /**结束*/
  305. /*搜索*/
  306. // $('#formSubSearch').click(function () {
  307. // var data = {"hiddenYear":$("#hidden_year").val(),"groupId":$("#selectedGroup").val()};
  308. // // insTb.reload({where: data}, 'data');
  309. // // initTable(data);
  310. // // insTb.reload({where: data}, 'data');
  311. // findByStatistics($("#selectedGroup").val(), $("#hidden_year").val());
  312. // });
  313. // $("#hidden_year").change(function () {
  314. // findByStatistics($("#selectedGroup").val(), $("#hidden_year").val());
  315. // });
  316. /*统计数据*/
  317. function findByStatistics(groupId, hiddenYear) {
  318. var dataMap = {"hiddenYear": hiddenYear, "gId": groupId};
  319. admin.req(uParas.baseUrl + '/ent/hiddenDangerStatistics/getHdangerYearStatistics', dataMap, function (res) {
  320. if (res.code == 1) {
  321. var hd = res.data;
  322. if (hd != null) {
  323. hdLevelSize = hd.hdangerLevel.length;
  324. // console.log(JSON.stringify(hd));
  325. $(".hidden-tbody-list").html("");
  326. /*绘制统计图*/
  327. initChartHdangerStatcs(hd.hiddenMonthCount1, hd.hiddenMonthCount2, hd.hiddenMonthCount3, hd.hiddenMonthCount4);
  328. if (hdLevelSize == 4) {
  329. $(".hdanger-statcs4").show();
  330. $(".hdanger-statcs2").hide();
  331. $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[0] + "</th>");
  332. $(".hidden-tbody-list").append("<th class='two'>" + hd.hiddenCount[1] + "</th>");
  333. $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[2] + "</th>");
  334. $(".hidden-tbody-list").append("<th class='four'>" + hd.hiddenCount[3] + "</th>");
  335. $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[4] + "</th>");
  336. $(".hidden-tbody-list").append("<th class='two'>" + hd.hiddenCount[5] + "</th>");
  337. $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[6] + "</th>");
  338. $(".hidden-tbody-list").append("<th class='four'>" + hd.hiddenCount[7] + "</th>");
  339. $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[8] + "</th>");
  340. $(".hidden-tbody-list").append("<th class='two'>" + hd.hiddenCount[9] + "</th>");
  341. $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[10] + "</th>");
  342. $(".hidden-tbody-list").append("<th class='four'>" + hd.hiddenCount[11] + "</th>");
  343. } else if (hdLevelSize == 2) {
  344. $(".hdanger-statcs2").show();
  345. $(".hdanger-statcs4").hide();
  346. $(".hidden-tbody-list").append("<th>" + hd.hiddenCount[0] + "</th>");
  347. $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[2] + "</th>");
  348. $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[4] + "</th>");
  349. $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[6] + "</th>");
  350. $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[8] + "</th>");
  351. $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[10] + "</th>");
  352. }
  353. }
  354. }
  355. }, 'get');
  356. }
  357. /*初始化统计图*/
  358. function initChartHdangerStatcs(hiddenMonthCount1, hiddenMonthCount2, hiddenMonthCount3, hiddenMonthCount4) {
  359. var dataArray = [];
  360. if (hdLevelSize == "4") {
  361. dataArray[0] = '重大';
  362. dataArray[1] = '较大';
  363. dataArray[2] = '一般';
  364. dataArray[3] = '较低';
  365. } else {
  366. dataArray[0] = '重大';
  367. dataArray[1] = '一般';
  368. }
  369. var seriesArray = [];
  370. if (hdLevelSize == 4) {
  371. seriesArray[0] = {
  372. name: '重大',
  373. barGap: 0,
  374. type: 'bar',
  375. label: {show: true, position: 'top'},
  376. data: hiddenMonthCount1
  377. };
  378. seriesArray[1] = {
  379. name: '较大',
  380. type: 'bar',
  381. barGap: 0,
  382. label: {show: true, position: 'top'}, //显示柱状数据,在柱状上部显示
  383. data: hiddenMonthCount2
  384. };
  385. seriesArray[2] = {
  386. name: '一般',
  387. barGap: 0,
  388. type: 'bar',
  389. label: {show: true, position: 'top'},
  390. data: hiddenMonthCount3
  391. };
  392. seriesArray[3] = {
  393. name: '较低',
  394. type: 'bar',
  395. barGap: 0,
  396. label: {show: true, position: 'top'},
  397. data: hiddenMonthCount4
  398. };
  399. } else {
  400. seriesArray[0] = {
  401. name: '重大',
  402. barGap: 0,
  403. type: 'bar',
  404. label: {show: true, position: 'top'},
  405. data: hiddenMonthCount1
  406. };
  407. seriesArray[1] = {
  408. name: '一般',
  409. barGap: 0,
  410. type: 'bar',
  411. label: {show: true, position: 'top'},
  412. data: hiddenMonthCount3
  413. };
  414. }
  415. var seriesLabel = [];
  416. var colorArray = [];
  417. //color: ['#FF4B28', '#FF6C00', '#FFDF0E', '#00C0FF'],
  418. if (hdLevelSize == "4") {
  419. seriesLabel[0] = {
  420. label: labelOption
  421. };
  422. seriesLabel[1] = {
  423. label: labelOption
  424. };
  425. seriesLabel[2] = {
  426. label: labelOption
  427. };
  428. seriesLabel[3] = {
  429. label: labelOption
  430. };
  431. colorArray[0] = uParas.lvColour(1);
  432. colorArray[1] = uParas.lvColour(2);
  433. colorArray[2] = uParas.lvColour(3);
  434. colorArray[3] = uParas.lvColour(4);
  435. } else {
  436. seriesLabel[0] = {
  437. label: labelOption
  438. };
  439. seriesLabel[1] = {
  440. label: labelOption
  441. };
  442. colorArray[0] = uParas.lvColour(1);
  443. colorArray[1] = uParas.lvColour(3);
  444. }
  445. var myChart = echarts.init(document.getElementById('hdangerStatcs'));
  446. echarts.config = {
  447. align: 'center',
  448. verticalAlign: 'middle',
  449. distance: 15,
  450. onChange: function () {
  451. myChart.setOption({
  452. series: seriesLabel
  453. // series: [{
  454. // label: labelOption
  455. // }, {
  456. // label: labelOption
  457. // }, {
  458. // label: labelOption
  459. // }, {
  460. // label: labelOption
  461. // }]
  462. });
  463. }
  464. };
  465. var labelOption = {
  466. normal: {
  467. show: true,
  468. position: 'top',
  469. distance: echarts.config.distance,
  470. align: echarts.config.align,
  471. verticalAlign: echarts.config.verticalAlign,
  472. rotate: echarts.config.rotate,
  473. formatter: '{c}',
  474. fontSize: 16,
  475. rich: {
  476. name: {
  477. textBorderColor: '#fff'
  478. }
  479. }
  480. }
  481. };
  482. option = {
  483. title: {
  484. left: "2%",
  485. text: $("#hidden_year").val() + '年-隐患数量月度统计',
  486. //subtext: 'eeee',
  487. x: 'left'
  488. },
  489. tooltip: {
  490. trigger: 'axis',
  491. axisPointer: {
  492. type: 'cross',
  493. crossStyle: {
  494. color: '#999'
  495. }
  496. }
  497. },
  498. // color: ['#FF4B28', '#FF6C00', '#FFDF0E', '#00C0FF'],
  499. color: colorArray,
  500. toolbox: {
  501. itemSize: 18,
  502. itemGap: 15,
  503. right: '50',
  504. feature: {
  505. show: true,
  506. orient: 'vertical',
  507. mark: {
  508. show: true,
  509. },
  510. dataView: {
  511. show: false,
  512. optionToContent: function (opt) {
  513. // console.log(11111);
  514. var xaisName = opt.xAxis[0].name;
  515. var axisData = opt.xAxis[0].data;
  516. var series = opt.series;
  517. var tableDom = document.createElement("table");
  518. tableDom.setAttribute("id", "test");
  519. tableDom.setAttribute("class", "table-data-table");
  520. var table = '<table id="test" style="width:100%;height:200px; text-align:center;border: 3px solid;">';
  521. var table = '<thead><tr style="height: 40px;">'
  522. + '<td style="width: 200px;height: 30px;">' + xaisName + '</td>'
  523. + '<td class="one" style="width: 200px;height: 30px;">' + 重大 + '</td>'
  524. + '<td class="two" style="width: 200px;height: 30px;">' + series[1].name + '</td>'
  525. + '<td class="three" style="width: 200px;height: 30px;">' + series[2].name + '</td>'
  526. + '<td class="four" style="width: 200px;height: 30px;">' + series[3].name + '</td>'
  527. + '</tr></thead><tbody>';
  528. for (var i = 0, l = axisData.length; i < l; i++) {
  529. table += '<tr style="height: 35px;">'
  530. + '<td style="height: 30px;">' + axisData[i] + '</td>'
  531. + '<td class="one" style="height: 30px;">' + series[0].data[i] + '</td>'
  532. + '<td class="two" style="height: 30px;">' + series[1].data[i] + '</td>'
  533. + '<td class="three" style="height: 30px;">' + series[2].data[i] + '</td>'
  534. + '<td class="four" style="height: 30px;">' + series[3].data[i] + '</td>'
  535. + '</tr>';
  536. }
  537. table += '</tbody>';
  538. tableDom.innerHTML = table;
  539. return tableDom;
  540. },
  541. readOnly: true, //是否可以编辑
  542. lang: ['数据视图', '关闭', '刷新'],
  543. buttonColor: '#cccccc',
  544. buttonTextColor: '#000',
  545. },
  546. magicType: {show: true, type: ['line', 'bar']},
  547. restore: {show: false},
  548. saveAsImage: {show: true}
  549. }
  550. },
  551. legend: {
  552. left: 'center',
  553. // data: ['重大隐患总数', '较大隐患总数', '一般隐患总数', '较低隐患总数']
  554. data: dataArray
  555. },
  556. xAxis: [
  557. {
  558. name: $("#hidden_year").val() + ' 年',
  559. type: 'category',
  560. axisTick: {show: false},
  561. type: 'category',
  562. data: ['1月份', '2月份', '3月份', '4月份', '5月份', '6月份', '7月份', '8月份', '9月份', '10月份', '11月份', '12月份'],
  563. axisPointer: {
  564. type: 'shadow'
  565. }
  566. }
  567. ],
  568. yAxis: [
  569. {
  570. type: 'value',
  571. name: '数量',
  572. },
  573. ],
  574. grid: {
  575. // width:"50%",
  576. height: "80%",
  577. left: "2%",
  578. right: "6%",
  579. bottom: "40",
  580. top: "15%",
  581. containLabel: true
  582. },
  583. calculable: true,
  584. series: seriesArray
  585. // series: [
  586. // {
  587. // name: '重大隐患总数',
  588. // barGap: 0,
  589. // type: 'bar',
  590. // label: labelOption,
  591. // data: hiddenMonthCount1
  592. // },
  593. // {
  594. // name: '较大隐患总数',
  595. // type: 'bar',
  596. // barGap: 0,
  597. // label: labelOption,
  598. // data: hiddenMonthCount2
  599. // },
  600. // {
  601. // name: '一般隐患总数',
  602. // barGap: 0,
  603. // type: 'bar',
  604. // label: labelOption,
  605. // data: hiddenMonthCount3
  606. // },
  607. // {
  608. // name: '较低隐患总数',
  609. // type: 'bar',
  610. // barGap: 0,
  611. // label: labelOption,
  612. // data: hiddenMonthCount4
  613. // },
  614. //
  615. // ]
  616. };
  617. myChart.setOption(option);
  618. setTimeout(function () {
  619. window.onresize = function () {
  620. myChart.resize();
  621. }
  622. }, 200);
  623. }
  624. });
  625. </script>
  626. </body>
  627. </html>