hdangerYearStatistics.html 28 KB

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