123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <title>隐患详情</title>
- <link rel="stylesheet" href="../../../assets/libs/layui/css/layui.css"/>
- <link rel="stylesheet" href="../../../assets/module/formSelects/formSelects-v4.css"/>
- <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
- <link rel="stylesheet" href="../../../assets/module/uParas.css?v=312"/>
- </head>
- <body>
- <style type="text/css">
- /*table th{*/
- /* color: #ffb800;*/
- /*}*/
- table tr th, td {
- text-align: center;
- }
- /*.one {*/
- /* border-bottom: 1px solid indianred;*/
- /* color: #FF0000;*/
- /*}*/
- /*.two {*/
- /* border-bottom: 1px solid #148ef1;*/
- /* color: #FFA500;*/
- /*}*/
- /*.three {*/
- /* border-bottom: 1px solid #FFDF0E;*/
- /* color: #FFFF00;*/
- /*}*/
- /*.four {*/
- /* border-bottom: 1px solid #00C0FF;*/
- /* color: #0000FF;*/
- /*}*/
- </style>
- <!-- 加载动画 -->
- <div class="page-loading">
- <div class="ball-loader">
- <span></span><span></span><span></span><span></span>
- </div>
- </div>
- <!-- 正文开始 -->
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-card-body">
- <form class="layui-form m-top10px m-bottom10px" lay-filter="filterForm" id="filterForm">
- <div class="layui-card-header">
- <div class="layui-inline layui-col-md2 text-left" style="margin-left: -40px;">
- <label class="layui-form-label">部门</label>
- <div class="layui-input-block">
- <input type="text" id="currentGroupName" class="layui-input" name="currentGroupName"
- value=""
- placeholder="全部部门"
- class="form-control" readonly>
- <input type="hidden" id="selectedGroup" name="selectedGroup" readonly>
- <div id="menuContent" class="menuContent">
- <ul id="groupTree" class="ztree" style="margin-top:0;"></ul>
- </div>
- </div>
- </div>
- <div class="layui-inline layui-col-md2 ">
- <label class="layui-form-label">日期</label>
- <div class="layui-input-block">
- <input type="text" name="hiddenYear" id="hidden_year"
- placeholder="选择年份" lay-verify="datetime" autocomplete="off"
- class="layui-input work-flow-review-hint">
- </div>
- </div>
- <!-- <div class="layui-inline layui-col-md2 ">-->
- <!-- <div class="layui-input-block" style="margin-left: 0px;margin-top: -3px;">-->
- <!-- <button id="formSubSearch" class="layui-btn icon-btn bg-c-add">-->
- <!-- <i class="layui-icon"></i>-->
- <!-- </button>-->
- <!-- </div>-->
- <!-- </div>-->
- </div>
- <div class="layui-card-body overflow-y-680px">
- <div class="layui-tab layui-tab-brief ">
- <!--统计图-->
- <div id="hdangerStatcs" class="m-top10px" style="height:350px;"></div>
- <!--隐患等级统计-->
- <div id="table_hidden ">
- <table class="layui-table text-center">
- <thead>
- <tr class="display-none hdanger-statcs4">
- <th colspan="4">总数</th>
- <th colspan="4">未处理</th>
- <th colspan="4">已处理</th>
- </tr>
- <tr class="display-none hdanger-statcs2">
- <th colspan="2">总数</th>
- <th colspan="2">未处理</th>
- <th colspan="2">已处理</th>
- </tr>
- <tr class="display-none hdanger-statcs4">
- <th class="one">重大</th>
- <th class="two">较大</th>
- <th class="three">一般</th>
- <th class="four">较低</th>
- <th class="one">重大</th>
- <th class="two">较大</th>
- <th class="three">一般</th>
- <th class="four">较低</th>
- <th class="one">重大</th>
- <th class="two">较大</th>
- <th class="three">一般</th>
- <th class="four">较低</th>
- </tr>
- <tr class="display-none hdanger-statcs2">
- <th class="one">重大</th>
- <th class="three">一般</th>
- <th class="one">重大</th>
- <th class="three">一般</th>
- <th class="one">重大</th>
- <th class="three">一般</th>
- </tr>
- </thead>
- <tbody>
- <tr class="hidden-tbody-list"></tr>
- </tbody>
- </table>
- </div>
- <!--隐患记录-->
- <table class="layui-table text-left" id="datatable" lay-filter="datatable"></table>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <!--状态TPL-->
- <script type="text/html" id="imgTpl">
- {{# if(d.imgUrl != null && d.imgUrl != ''){ }}
- <a target="_blank" href="{{d.imgUrl}}">
- <img class="media-object" width="40px" height="40px" src="{{d.imgUrl}}">
- </a>
- {{# } else { }}
- <img class="media-object" width="40px" height="40px" src="/assets/images/error.jpg">
- {{# } }}
- </script>
- <script type="text/html" id="hdLevel">
- {{# var imgs="",title=""; var lv=d.hdangerLevel;}}
- {{# if(lv==1){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger1.png" ;title="重大" } }}
- {{# if(lv==2){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger2.png";title="较大"} }}
- {{# if(lv==3){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger3.png";title="一般"} }}
- {{# if(lv==4){ imgs="../../../../assets/images/hdangerLevel/iconHiddenDanger4.png";title="较低"} }}
- <img style="display: inline-block; width: 28px;height: 28px;" src={{imgs}}> {{ title }}
- </script>
- <!-- js部分 -->
- <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
- <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
- <script type="text/javascript" src="../../../assets/libs/echarts/echarts.min.js?v=312"></script>
- <script type="text/javascript" src="../../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
- <script>
- layui.use(['layer', 'form', 'table', 'util', 'zTree', '_groupTree', 'laydate', 'admin', 'uParas', 'element', 'laytpl'], function () {
- var $ = layui.jquery;
- var layer = layui.layer;
- var form = layui.form;
- var util = layui.util;
- var table = layui.table;
- var admin = layui.admin;
- var uParas = layui.uParas;
- var element = layui.element, laytpl = layui.laytpl;
- var _groupTree = layui._groupTree;
- var laydate = layui.laydate;
- var insTb;
- var hdangerId = uParas.getUrlParam("hdangerId");
- var hdLevelSize = 2;
- var hiddenYear = new Date().getFullYear();
- // $("#hidden_year").val(new Data());
- /*日期*/
- laydate.render({
- elem: '#hidden_year',
- format: 'yyyy',
- type: 'year',
- value: new Date().getFullYear(), //初始化值
- btns: false, //隐藏按钮
- change: function (value, date) { //监听日期被切换
- $("#hidden_year").val(value);
- findByStatistics($("#selectedGroup").val(), $("#hidden_year").val());
- /*更新数据表*/
- var data = {
- "hiddenYear": $("#hidden_year").val(),
- "groupId": $("#selectedGroup").val(),
- "yearStatisticsRecord": 1
- };
- insTb.reload({where: data}, 'data');
- }
- });
- var dada = {"groupId": $("#selectedGroup").val(), "hiddenYear": hiddenYear, "yearStatisticsRecord": 1};
- initTable(dada);
- findByStatistics($("#selectedGroup").val(), hiddenYear);
- function initTable(data) {
- // 渲染表格
- insTb = table.render({
- elem: '#datatable',
- url: uParas.baseUrl + '/ent/hiddenDangerStatistics/queryHdangerRecordByPage',
- where: data,
- page: true,
- cellMinWidth: 100,
- cols: [[
- {type: 'numbers', title: '序号'},
- {field: 'imgUrl', sort: false, title: '图片', width: 70, templet: '#imgTpl'},
- {field: 'hdangerTitle', sort: false, title: '隐患标题'},
- {field: 'hdangerCatTitle', sort: false, title: '类型', width: 130},
- {field: 'disposeStatusStr', sort: false, title: '状态', width: 100},
- {field: 'hdangerLevel', sort: false, title: '隐患等级', templet: "#hdLevel", width: 100},
- {field: 'groupName', sort: false, title: '所属部门'},
- {field: 'executor', sort: false, title: '当前治理人员', width: 130},
- {field: 'bizCheckDefName', sort: false, title: '检查表名称'},
- {field: 'riskPointName', sort: false, title: '风险点'},
- {field: 'riskPointTypeName', sort: false, title: '风险点类型', width: 130},
- // {field: 'hdangerRetifyDeadline' , sort:false , title:'整改期限', width: 160,
- // templet: function (d) {
- // return leftTimeFunc(d.hdangerRetifyDeadline,d.status);
- // }
- // },
- ]]
- });
- }
- /**
- * 部门过滤
- * ztree 文本下拉
- */
- admin.req(uParas.baseUrl + '/admin/common/getGroupLists', null, function (res) {
- if (res.code == 1) {
- $.fn.zTree.init($('#groupTree'), settingMAP, res.data);
- $.fn.zTree.getZTreeObj("groupTree").expandAll(true);
- layer.closeAll('loading');
- hideMenuMap();
- }
- }, 'get');
- $("#currentGroupName").click(function () {
- $("#menuContent").slideDown("fast");
- $("body").bind("mousedown", onBodyDown);
- });
- function onBodyDown(event) {
- if (!(event.target.id === "selectedGroup" || event.target.id === "menuContent" || $(event.target).parents("#menuContentMap").length > 0)) {
- hideMenuMap();
- }
- }
- var settingMAP = {
- check: {
- enable: false,
- chkboxType: {"Y": "", "N": ""}
- },
- view: {
- dblClickExpand: false
- },
- data: {
- simpleData: {
- enable: true,
- idKey: "gId",
- pIdKey: "groupParent",
- rootPId: null
- },
- key: {
- name: "groupName"
- }
- },
- callback: {
- onClick: onClickMap
- }
- };
- function onClickMap(event, treeId, treeNode, clickFlag) {
- var zTree = $.fn.zTree.getZTreeObj("groupTree"),
- nodes = zTree.getSelectedNodes(),
- v = "", idlist = "";
- for (var i = 0, l = nodes.length; i < l; i++) {
- v += nodes[i].groupName + ",";
- idlist += nodes[i].gId + ",";
- }
- if (v.length > 0) {
- v = v.substring(0, v.length - 1);
- idlist = idlist.substring(0, idlist.length - 1);
- }
- var cityObj = $("#currentGroupName");
- if (cityObj.val() == v) {
- cityObj.attr("value", "");
- $("#gId").attr("value", "");
- } else {
- cityObj.attr("value", v);
- $("#gId").attr("value", idlist);
- }
- hideMenuMap();
- var groupId_ = idlist;
- if (groupId_ != "-1") {
- var Obj = new Object();
- Obj.gId = groupId_;
- }
- if (insTb != null && insTb != undefined && insTb != '') {
- /*更新数据表*/
- insTb.reload({where: Obj}, 'data');
- }
- /*更新统计*/
- findByStatistics(groupId_, $("#hidden_year").val());
- }
- function hideMenuMap() {
- $("#menuContent").fadeOut("fast");
- $("body").unbind("mousedown", onBodyDown);
- }
- /**结束*/
- /*搜索*/
- // $('#formSubSearch').click(function () {
- // var data = {"hiddenYear":$("#hidden_year").val(),"groupId":$("#selectedGroup").val()};
- // // insTb.reload({where: data}, 'data');
- // // initTable(data);
- // // insTb.reload({where: data}, 'data');
- // findByStatistics($("#selectedGroup").val(), $("#hidden_year").val());
- // });
- // $("#hidden_year").change(function () {
- // findByStatistics($("#selectedGroup").val(), $("#hidden_year").val());
- // });
- /*统计数据*/
- function findByStatistics(groupId, hiddenYear) {
- var dataMap = {"hiddenYear": hiddenYear, "gId": groupId};
- admin.req(uParas.baseUrl + '/ent/hiddenDangerStatistics/getHdangerYearStatistics', dataMap, function (res) {
- if (res.code == 1) {
- var hd = res.data;
- if (hd != null) {
- hdLevelSize = hd.hdangerLevel.length;
- // console.log(JSON.stringify(hd));
- $(".hidden-tbody-list").html("");
- /*绘制统计图*/
- initChartHdangerStatcs(hd.hiddenMonthCount1, hd.hiddenMonthCount2, hd.hiddenMonthCount3, hd.hiddenMonthCount4);
- if (hdLevelSize == 4) {
- $(".hdanger-statcs4").show();
- $(".hdanger-statcs2").hide();
- $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[0] + "</th>");
- $(".hidden-tbody-list").append("<th class='two'>" + hd.hiddenCount[1] + "</th>");
- $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[2] + "</th>");
- $(".hidden-tbody-list").append("<th class='four'>" + hd.hiddenCount[3] + "</th>");
- $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[4] + "</th>");
- $(".hidden-tbody-list").append("<th class='two'>" + hd.hiddenCount[5] + "</th>");
- $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[6] + "</th>");
- $(".hidden-tbody-list").append("<th class='four'>" + hd.hiddenCount[7] + "</th>");
- $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[8] + "</th>");
- $(".hidden-tbody-list").append("<th class='two'>" + hd.hiddenCount[9] + "</th>");
- $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[10] + "</th>");
- $(".hidden-tbody-list").append("<th class='four'>" + hd.hiddenCount[11] + "</th>");
- } else if (hdLevelSize == 2) {
- $(".hdanger-statcs2").show();
- $(".hdanger-statcs4").hide();
- $(".hidden-tbody-list").append("<th>" + hd.hiddenCount[0] + "</th>");
- $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[2] + "</th>");
- $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[4] + "</th>");
- $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[6] + "</th>");
- $(".hidden-tbody-list").append("<th class='one'>" + hd.hiddenCount[8] + "</th>");
- $(".hidden-tbody-list").append("<th class='three'>" + hd.hiddenCount[10] + "</th>");
- }
- }
- }
- }, 'get');
- }
- /*初始化统计图*/
- function initChartHdangerStatcs(hiddenMonthCount1, hiddenMonthCount2, hiddenMonthCount3, hiddenMonthCount4) {
- var dataArray = [];
- if (hdLevelSize == "4") {
- dataArray[0] = '重大';
- dataArray[1] = '较大';
- dataArray[2] = '一般';
- dataArray[3] = '较低';
- } else {
- dataArray[0] = '重大';
- dataArray[1] = '一般';
- }
- var seriesArray = [];
- if (hdLevelSize == 4) {
- seriesArray[0] = {
- name: '重大',
- barGap: 0,
- type: 'bar',
- label: {show: true, position: 'top'},
- data: hiddenMonthCount1
- };
- seriesArray[1] = {
- name: '较大',
- type: 'bar',
- barGap: 0,
- label: {show: true, position: 'top'}, //显示柱状数据,在柱状上部显示
- data: hiddenMonthCount2
- };
- seriesArray[2] = {
- name: '一般',
- barGap: 0,
- type: 'bar',
- label: {show: true, position: 'top'},
- data: hiddenMonthCount3
- };
- seriesArray[3] = {
- name: '较低',
- type: 'bar',
- barGap: 0,
- label: {show: true, position: 'top'},
- data: hiddenMonthCount4
- };
- } else {
- seriesArray[0] = {
- name: '重大',
- barGap: 0,
- type: 'bar',
- label: {show: true, position: 'top'},
- data: hiddenMonthCount1
- };
- seriesArray[1] = {
- name: '一般',
- barGap: 0,
- type: 'bar',
- label: {show: true, position: 'top'},
- data: hiddenMonthCount3
- };
- }
- var seriesLabel = [];
- var colorArray = [];
- //color: ['#FF4B28', '#FF6C00', '#FFDF0E', '#00C0FF'],
- if (hdLevelSize == "4") {
- seriesLabel[0] = {
- label: labelOption
- };
- seriesLabel[1] = {
- label: labelOption
- };
- seriesLabel[2] = {
- label: labelOption
- };
- seriesLabel[3] = {
- label: labelOption
- };
- colorArray[0] = uParas.lvColour(1);
- colorArray[1] = uParas.lvColour(2);
- colorArray[2] = uParas.lvColour(3);
- colorArray[3] = uParas.lvColour(4);
- } else {
- seriesLabel[0] = {
- label: labelOption
- };
- seriesLabel[1] = {
- label: labelOption
- };
- colorArray[0] = uParas.lvColour(1);
- colorArray[1] = uParas.lvColour(3);
- }
- var myChart = echarts.init(document.getElementById('hdangerStatcs'));
- echarts.config = {
- align: 'center',
- verticalAlign: 'middle',
- distance: 15,
- onChange: function () {
- myChart.setOption({
- series: seriesLabel
- // series: [{
- // label: labelOption
- // }, {
- // label: labelOption
- // }, {
- // label: labelOption
- // }, {
- // label: labelOption
- // }]
- });
- }
- };
- var labelOption = {
- normal: {
- show: true,
- position: 'top',
- distance: echarts.config.distance,
- align: echarts.config.align,
- verticalAlign: echarts.config.verticalAlign,
- rotate: echarts.config.rotate,
- formatter: '{c}',
- fontSize: 16,
- rich: {
- name: {
- textBorderColor: '#fff'
- }
- }
- }
- };
- option = {
- title: {
- left: "2%",
- text: $("#hidden_year").val() + '年-隐患数量月度统计',
- //subtext: 'eeee',
- x: 'left'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#999'
- }
- }
- },
- // color: ['#FF4B28', '#FF6C00', '#FFDF0E', '#00C0FF'],
- color: colorArray,
- toolbox: {
- itemSize: 18,
- itemGap: 15,
- right: '50',
- feature: {
- show: true,
- orient: 'vertical',
- mark: {
- show: true,
- },
- dataView: {
- show: false,
- optionToContent: function (opt) {
- // console.log(11111);
- var xaisName = opt.xAxis[0].name;
- var axisData = opt.xAxis[0].data;
- var series = opt.series;
- var tableDom = document.createElement("table");
- tableDom.setAttribute("id", "test");
- tableDom.setAttribute("class", "table-data-table");
- var table = '<table id="test" style="width:100%;height:200px; text-align:center;border: 3px solid;">';
- var table = '<thead><tr style="height: 40px;">'
- + '<td style="width: 200px;height: 30px;">' + xaisName + '</td>'
- + '<td class="one" style="width: 200px;height: 30px;">' + 重大 + '</td>'
- + '<td class="two" style="width: 200px;height: 30px;">' + series[1].name + '</td>'
- + '<td class="three" style="width: 200px;height: 30px;">' + series[2].name + '</td>'
- + '<td class="four" style="width: 200px;height: 30px;">' + series[3].name + '</td>'
- + '</tr></thead><tbody>';
- for (var i = 0, l = axisData.length; i < l; i++) {
- table += '<tr style="height: 35px;">'
- + '<td style="height: 30px;">' + axisData[i] + '</td>'
- + '<td class="one" style="height: 30px;">' + series[0].data[i] + '</td>'
- + '<td class="two" style="height: 30px;">' + series[1].data[i] + '</td>'
- + '<td class="three" style="height: 30px;">' + series[2].data[i] + '</td>'
- + '<td class="four" style="height: 30px;">' + series[3].data[i] + '</td>'
- + '</tr>';
- }
- table += '</tbody>';
- tableDom.innerHTML = table;
- return tableDom;
- },
- readOnly: true, //是否可以编辑
- lang: ['数据视图', '关闭', '刷新'],
- buttonColor: '#cccccc',
- buttonTextColor: '#000',
- },
- magicType: {show: true, type: ['line', 'bar']},
- restore: {show: false},
- saveAsImage: {show: true}
- }
- },
- legend: {
- left: 'center',
- // data: ['重大隐患总数', '较大隐患总数', '一般隐患总数', '较低隐患总数']
- data: dataArray
- },
- xAxis: [
- {
- name: $("#hidden_year").val() + ' 年',
- type: 'category',
- axisTick: {show: false},
- type: 'category',
- data: ['1月份', '2月份', '3月份', '4月份', '5月份', '6月份', '7月份', '8月份', '9月份', '10月份', '11月份', '12月份'],
- axisPointer: {
- type: 'shadow'
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- name: '数量',
- },
- ],
- grid: {
- // width:"50%",
- height: "80%",
- left: "2%",
- right: "6%",
- bottom: "40",
- top: "15%",
- containLabel: true
- },
- calculable: true,
- series: seriesArray
- // series: [
- // {
- // name: '重大隐患总数',
- // barGap: 0,
- // type: 'bar',
- // label: labelOption,
- // data: hiddenMonthCount1
- // },
- // {
- // name: '较大隐患总数',
- // type: 'bar',
- // barGap: 0,
- // label: labelOption,
- // data: hiddenMonthCount2
- // },
- // {
- // name: '一般隐患总数',
- // barGap: 0,
- // type: 'bar',
- // label: labelOption,
- // data: hiddenMonthCount3
- // },
- // {
- // name: '较低隐患总数',
- // type: 'bar',
- // barGap: 0,
- // label: labelOption,
- // data: hiddenMonthCount4
- // },
- //
- // ]
- };
- myChart.setOption(option);
- setTimeout(function () {
- window.onresize = function () {
- myChart.resize();
- }
- }, 200);
- }
- });
- </script>
- </body>
- </html>
|