123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784 |
- <!DOCTYPE html>
- <!--[if IE 8]>
- <html lang="en" class="ie8 no-js"> <![endif]-->
- <!--[if IE 9]>
- <html lang="en" class="ie9 no-js"> <![endif]-->
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>SCD文档管理系统</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <link rel="stylesheet" type="text/css" href="/static/css/sub_bureau.css">
- <link rel="stylesheet" type="text/css" href="/static/css/common.css"/>
- <link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css"/>
- <link rel="stylesheet" type="text/css" href="/static/layui_2/css/layui.css" media="all"/>
- <link rel="stylesheet" type="text/css" href="/static/css/kmsjsmap.css"/>
- <script src="/static/js/jquery.min.js" type="text/javascript"></script>
- <script src="/static/js/echarts.min.js" type="text/javascript"></script>
- <script src="/static/js/template.js" type="text/javascript"></script>
- <script src="/static/js/police_o.js" type="text/javascript"></script>
- <script src="/static/layui_2/layui.js" type="text/javascript"></script>
- <script src="/static/js/global.js" type="text/javascript"></script>
- <script src="/static/js/jquery.slimscroll.min.js" type="text/javascript"></script>
- <script src="/static/js/TweenMax.js" type="text/javascript"></script>
- <script src="/static/js/mqtt.min.js" type="text/javascript"></script>
- <script src="/static/js/kmsjsmap.js" type="text/javascript"></script>
- <style type="text/css">
- .inout_list{}
- .inout_list thead{font-weight: bold;}
- .inout_list table{border: 0px solid #4a3c6a;}
- .inout_list tbody{font-size: 1.2rem;}
- .inout_list tbody>tr:nth-child(odd){background-color: #F6FAFF;}
- .inout_list .scdin_tag{border-radius: 0.5rem;background-color: #F3F5FA;padding: 0.5rem;text-align: center;border: 1px solid #134BEA;color: #134BEA;}
- .inout_list .scdout_tag{border-radius: 0.5rem;background-color: #FFFACC;padding: 0.5rem;text-align: center;border: 1px solid #FFCB11;color: #FFCB11;}
- .doctype_list{
- width: 18rem;
- padding: 1rem;
- height: 17rem;
- margin-top: 1rem;
- }
- .doctype_list .doctype_card_header{
- text-align: center;
- font-size: 1.4rem;
- border: 1px solid #C8D4E2;
- border-radius: 3px;
- background-color: #F3F5FA;
- float: left;
- width: 100%;
- padding: 0.5rem;
- color: #09162C;
- }
- .doctype_list.active .doctype_card_header{background-color: #134BEA;color: #fff;}
- .doctype_list .doctype_card_header>span{
- float: left;
- }
- .doctype_list .doctype_card_header .ok{
- width: 15%;font-size: 1.2rem;padding: 0 0.5rem;border-radius: 1rem;background-color: #eee1e1;border: 1px solid #fff;
- }
- .doctype_list .doctype_card_header .not{
- width: 15%;font-size: 1.2rem;padding: 0 0.5rem;border-radius: 1rem;background-color: #ec7575;border: 1px solid red;color: #fff;
- }
- .doc_detail_list{width: 100%;font-size: 1.2rem;float: left;border: 1px solid #C8D4E2;border-radius: 3px;background-color: #F3F5FA;padding: 0.5rem;color: #43526B;height: 14rem;}
- .doctype_list_item{float: left;width: 100%;height: 2.4rem;line-height: 2.4rem;}
- .doctype_list_item .doctype{float: left;width: 75%}
- .doctype_list_item .rate{float: left;width: 20%;color: #134BEA;}
- .doctype_list_item .unit{float: right;width: 5%;color: #134BEA;}
- .stat_caption{
- background-color: #fff;
- color: #1E293B;
- font-weight: bold;
- font-size: 1.5rem;
- border-bottom: 1px solid #C8D4E2;
- }
- .stat_caption>span{
- border-left: 2px solid #134BEA;
- padding: 0px 1rem;
- }
- </style>
- </head>
- <body>
- <div class="monitor_center" style="width:100%;height: 100%;">
- <div class="header">
- <div class="header_logo">
- <img src="/static/images/logo.jpg">
- </div>
- <div class="system_middle_title">
- <span class="system_big_title">SCD文档管理系统</span>
- <span class="orgname f_l text_overflow" id="orgname"></span><span class="stationname hidden" id="stationname"></span>
- <div class="scd_info f_l hidden" id="scd_info">
- <span class="scd_name text_overflow"></span>
- <span style="margin-left: 1rem;margin-right: 1rem;font-size: 1.5rem;float: left;"><i class="fa fa-caret-up"></i></span>
- </div>
- </div>
- <div class="header_background">
- <div>
- <div class="main_bar" id="main_bar" style="float: left;margin-right: 2rem;">
- <div class="app_default accessControl" mark="screen" access-code="pl_menu_screen" onclick="window.location.href='scd_network.html'">
- <i class="app_icon fa fa-fw fa-gg"></i>
- <span>网络结构图</span>
- </div>
- <div class="app_default accessControl" mark="screen" access-code="pl_menu_screen" onclick="window.location.href='scd_o.html'">
- <i class="app_icon fa fa-fw fa-file-image-o"></i>
- <span>SCD可视化</span>
- </div>
- <div class="app_default accessControl" mark="outin" access-code="pl_menu_outin" onclick="window.location.href='scd_inout.html'">
- <i class="app_icon fa fa-fw fa-exchange fa-rotate-90"></i>
- <span>签入签出</span>
- </div>
- <div class="app_default accessControl" mark="scdtools" access-code="pl_menu_scdtools" onclick="window.location.href='scd_files.html'">
- <i class="app_icon fa fa-fw fa-file-code-o"></i>
- <span>配置文件</span>
- </div>
- <div class="app_default accessControl app_active" mark="stat" access-code="pl_menu_stat" onclick="window.location.href='scd_stat.html'">
- <i class="app_icon fa fa-fw fa-pie-chart"></i>
- <span>统计分析</span>
- </div>
- <div class="app_default accessControl" mark="admin" access-code="pl_menu_admin" onclick="window.location.href='police_o_admin.html'" style="margin-right: 0;">
- <i class="app_icon fa fa-fw fa-laptop"></i>
- <span>管理后台</span>
- </div>
- </div>
- <div class="app_default" style="color: #7A13E1;">|</div>
- <div class="app_default">
- <span class="yyyymmdd f_l" style="cursor:default;font-size: 1.4rem;font-family:electronicFont;width: 8rem;"> </span>
- <span class="week f_l" style="cursor:default;font-size: 1.4rem;width: 5rem;"> </span>
- <span class="hour_minute f_l" style="cursor:default;letter-spacing: 0.3rem;font-size: 1.4rem;color: #516380;font-family:electronicFont;width: 8rem;"> </span>
- </div>
- <div class="app_default" style="color: #7A13E1;">/</div>
- <div class="app_default" style="border-bottom: 0px solid #7A13E1;height: 93%;">
- <a style="font-size: 1.4rem;cursor: pointer;" href="/" title="当前登录人员"><i class="fa fa-user" style="color: #00CEFB;font-size: 1.8rem;margin-right: 0.5rem;"></i><span id="login_user_name"></span></a>
- </div>
- <div class="app_default" style="color: #7A13E1;">/</div>
- <div class="app_default" style="border-bottom: 0px solid #7A13E1;height: 93%;">
- <a style="font-size: 1.6rem;cursor: pointer;" href="/" title="退出"><i class="layui-icon layui-icon-logout" style="background-color: transparent !important;color: #00CEFB;"></i></a>
- </div>
- </div>
- </div>
- <div class="user_role hidden" id="login_user_role"></div>
- </div>
- <div class="body_content">
- <!--中间地图-->
- <div class="body_center home_center" id="container_map" style="display:block;background-color: #F3F5FA;">
- <div id="container_map_ied" style="position: absolute;z-index: 1;height: 100%;width: 100%;left: 0;top:0;">
- <!--各站文档统计-->
- <div class="f_l" style="width: 30%;height: 95%;">
- <div class="f_l" style="width: 96%;height: 47%;padding: 2%;padding-top: 0;">
- <div class="f_l stat_caption" style="width: 100%;height: 4rem;line-height: 4rem;"><span>资料分类统计</span></div>
- <div class="f_l" style="width: 100%;height: 90%;background-color: #fff;" id="doc_stat_type"></div>
- </div>
- <div class="f_l" style="width: 96%;height: 48%;padding: 2%;">
- <div class="f_l stat_caption" style="width: 100%;height: 4rem;line-height: 4rem;"><span>装置分类统计</span></div>
- <div class="f_l" style="width: 100%;height: 90%;background-color: #fff;" id="ied_stat_type"></div>
- </div>
- </div>
- <!-- -->
- <div class="f_l" style="width: 38%;height: 100%;">
- <div class="f_l " style="width: 100%;height: 4rem;line-height: 4rem;margin-bottom: 2rem;background-color: #fff;">
- <div class="f_l" style="width: 50%;text-align: center;background-color: #fff;" id="station_count">
- <span style="font-size: 1.6rem;color: #000000;">站点总数:<b style="font-family: electronicFont;font-size: 3rem;color: #FFCB11;border-bottom: 2px solid #8770f2;cursor: pointer;" title="查看所有站点统计">-</b></span>
- </div>
- <div class="f_l" style="width: 50%;text-align: center;background-color: #fff;" id="scd_stat2">
- <div class="f_l" style="width: 100%;"></div>
- </div>
- </div>
- <div class="f_l stat_caption" style="width: 100%;height: 4rem;line-height: 4rem;background-color: #fff;"><span>资料完整度分析</span></div>
- <div class="f_l" style="width: 100%;height: 80%;overflow: hidden;background-color: #fff;" id="scd_stat1">
- <div class="f_l" style="width: 100%;"></div>
- </div>
- </div>
- <!--签入签出实时监测 -->
- <div class="f_l" style="width: 30%;height: 100%;margin-left: 1%;">
- <div class="f_l stat_caption" style="width: 100%;height: 4rem;line-height: 4rem;"><span>SCD签入签出实时监测</span></div>
- <div class="f_l" style="width: 92%;height: 88%;overflow: hidden;background-color: #fff;padding: 1%;" id="scd_chekout_monitor">
- <div class="datalist f_l inout_list" style="width: 100%;">
- <table style="width: 100%;text-align: left;line-height: 4rem;">
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="dialog_public" class="site_device_list dialog_public">
- <span class="text_overflow caption"><b></b><i class="fa fa-times" title="关闭窗口" style="font-size: 2rem;"></i></span>
- <div class="dataitemlist">
- <div id="ln_strcut_detail" style="position: absolute;left: 0;top:0;z-index: 0;height:100%;width: 100%;"></div>
- </div>
- </div>
- <script type="text/html" id="station_list_item_tpl">
- {{each data}}
- <div class="station_list_item" stationid="{{$value.id}}">{{$value.area_name}}</div>
- {{/each}}
- </script>
- <script type="text/html" id="flow_monitor_item_tpl">
- {{each data}}
- <tr>
- <td class="text_overflow" style="width: 20%"> {{$value.statin_name}}</td>
- <td class="text_overflow" style="width: 25%">{{$value.CREATED_TIME}}</td>
- <td class="text_overflow" style="width: 15%"><span class="{{if $value.flow_type=='scdout'}}scdout_tag{{else}}scdin_tag{{/if}}">{{$value.flow_name}}</span></td>
- <td class="text_overflow" style="width: 30%" title="{{$value.scd_name}}">{{$value.scd_name}}</td>
- <td class="text_overflow" style="width: 10%">{{$value.created_name}}</td>
- </tr>
- {{/each}}
- </script>
- <script type="text/html" id="station_doctype_list_item_tpl">
- {{each data}}
- <div class="f_l doctype_list" stationid="{{$value.id}}">
- <div class="doctype_card_header">
- <span class="stationname text_overflow f_l" style="width: 68%;text-align: left;">{{$value.area_name}}</span>
- <span class="f_l {{if $value.rate>=95}}ok{{else}}not{{/if}}">{{$value.rate||0}}</span>
- <span class="f_l" style="width: 10%">%</span>
- </div>
- <div class="doc_detail_list"></div>
- </div>
- {{/each}}
- </script>
- <script type="text/html" id="station_doc_item_tpl">
- {{each data}}
- <div class="doctype_list_item" filetype_id="{{$value.id}}">
- <span class="doctype text_overflow">{{$value.name}}</span><span class="rate"><b>{{$value.rate||"0"}}</b></span><span class="unit">%</span>
- </div>
- {{/each}}
- </script>
- <script type="text/javascript">
- template.helper("FullImgPath",function(imgsrc){
- if(imgsrc==null||imgsrc=="") return Global.AccessUrl+ "/static/images/userhead.png";
- if (imgsrc.substr(0, 4) != "http") {
- var _index = imgsrc.indexOf("static/");
- if (_index > -1) return Global.AccessUrl + imgsrc.substr(_index);
- }
- return imgsrc;
- })
- template.helper("ts2datetime",function(timestamp){
- if(timestamp==null||timestamp=="") return "";
- if(timestamp.indexOf("-")>-1 || timestamp.indexOf(":")>-1) return timestamp;
- if(timestamp.length>13) timestamp=timestamp.substring(0,13);
- else if( timestamp.length==10) timestamp=timestamp*1000;
- return new Date(timestamp).Format("yyyy-MM-dd hh:mm:ss");
- })
- template.helper("replaceStr",function(str,oldstr,newstr){
- if($.trim(str)=="") return "";
- var reg=new RegExp(oldstr);
- return str.replace(reg,newstr);
- })
- var myChart = null;
- $(document).ready(function () {
- var token = $.trim(localStorage.getItem("sessionid"));
- if (token == "") {
- window.location.href = "/";
- return false;
- }
- Global.accessControl();
- $("body").on('click',function(){
- if($(this).attr("id")!="scd_info" && $(this).parent().attr("id")!="scd_info"){
- $("#scd_list").addClass("hidden");
- $("#scd_info").find("i").attr("class","fa fa-angle-up");
- }
- if($(this).attr("id")!="stationname" && $(this).parent().attr("id")!="stationname"){
- $("#station_list").addClass("hidden").find("i").attr("class","fa fa-angle-up");
- }
- });
- //获取配置的单位名称
- $.getJSON(Global.AccessUrl+"/api/getSysParamList",{"param_name":"orgname"},function(r){
- if(r.code!=0 || r.data==null) return;
- $("#orgname").html(r.data[0].param_value);
- });
- PoliceObject.AlwaysTimer();
- PoliceObject.init();
- var canvasW=1300;
- var isdrag=false;
- var data=[];
- scd_chekout_monitor();
- doc_stat_type();
- ied_stat_type();
- //资料完整度分析
- scd_stat1();
- //SCD正确率统计
- scd_stat2();
- });
- var flowlastid="";
- //签入签出监测
- function scd_chekout_monitor(){
- var $scd_chekout_monitor=$("#scd_chekout_monitor .datalist>table:first>tbody").html(Tools.LoadingText("正在加载数据..."));
- //默认获取最新20条
- $.getJSON(Global.AccessUrl+ "/api/flow/stat/list",{"pageno":1,"pagesize":20},function(r){
- if(r.code!=0){
- layer.msg("加载签入签出信息失败:"+r.msg);
- return;
- }
- if(r.data==null || r.data.length==0){
- $scd_chekout_monitor.html(Tools.HintText("没有数据记录"));
- setTimeout(function(){
- scd_chekout_monitor();
- },60*1000);
- return;
- }
- var h=template('flow_monitor_item_tpl',r);
- $scd_chekout_monitor.html(h);
- flowlastid=r.data[0]["id"];
- $("#scd_chekout_monitor").slimScroll({
- height: $("#scd_chekout_monitor").height() + "px",
- width: "100%",
- alwaysVisible: false,
- wheelStep: 10,
- size: "6px",
- color: "#03aee7"
- });
- })
- //获取最新的签入签出
- setTimeout(function(){
- scd_chekout_monitor_new();
- },60*1000);
- }
- function scd_chekout_monitor_new(){
- if(flowlastid!="") {
- $.getJSON(Global.AccessUrl+ "/api/flow/stat/list",{"lastid":flowlastid},function(r){
- if(r.code!=0){
- return;
- }
- if(r.data!=null && r.data.length>0){
- var h=template('flow_monitor_item_tpl',r);
- $(h).insertBefore($("#scd_chekout_monitor .datalist>table:first>tbody>tr:first"));
- }
- })
- }
- setTimeout(function(){
- scd_chekout_monitor_new();
- },60*1000);
- }
- //文档分类统计
- function doc_stat_type(){
- var callback = function(result) {
- var XData = new Array(),
- YData = new Array();
- var Ytitle = "总数";
- var TypeColor = "#134BEA";
- var statData={};
- for (var i = 0; i < result.data.length; i++) {
- var item=result.data[i];
- if($.trim(item.file_type)=="") continue;
- statData[item.file_type] = item.cnt;
- }
- for (var k=0;k< result.comments.length;k++) {
- XData.push(result.comments[k].name);
- var tid=result.comments[k].id;
- YData.push({
- "value": statData[tid]==null?0:statData[tid],
- "name": result.comments[k].name
- });
- }
- var chartDom = document.getElementById("doc_stat_type");
- echarts.init(chartDom).dispose();
- var myChart = echarts.init(chartDom);
- var option = {
- grid: {
- top: '15%',
- left: '13%',
- right: '10%',
- bottom: '20%',
- },
- xAxis: [{
- type: 'category',
- boundaryGap: true, //柱子是否不从0开始
- axisLine: { //坐标轴轴线相关设置。数学上的x轴
- show: true,
- lineStyle: {
- color: '#000'
- },
- },
- axisLabel: { //坐标轴刻度标签的相关设置
- interval: 0, //显示全部标签
- rotate: -30,
- textStyle: {
- color: '#000',
- padding: 0,
- fontSize: 12 * wRate
- }
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false,
- },
- data: XData
- }],
- yAxis: [{
- name: Ytitle,
- nameTextStyle: {
- color: "#000",
- fontSize: 10 * wRate,
- padding: 0
- },
- min: 0,
- splitLine: {
- show: true,
- lineStyle: {
- type: "dashed",
- color: '#000'
- }
- },
- axisLine: {
- show: false,
- lineStyle: {
- color: "#F3F5FA"
- }
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#000',
- fontSize: 10 * wRate,
- padding: 0
- }
- },
- axisTick: {
- show: false,
- },
- }],
- series: [{
- type: 'bar',
- barWidth: 5,
- label: {
- show: true,
- position: 'top',
- textStyle: {
- color: TypeColor,
- }
- },
- itemStyle: {
- color: TypeColor,
- //borderColor: TypeColor,
- //borderWidth: 2,
- barBorderRadius: [10, 10, 0, 0]
- },
- tooltip: {
- show: false
- },
- data: YData
- }]
- };
- option && myChart.setOption(option);
- myChart.off().on('click', function(para) {
- var dialog_public = $("#dialog_public");
- DialogObject.Open(dialog_public, {
- "callback": function(win, para) {
- //win.find(".layout_caption .layout_title").html("生产网络");
- //win.find(".layout_content").height(win.height() - win.find(".layout_caption").height());
- },
- "para": option,
- "size": ["90rem", "48rem"]
- });
- });
- }
- var doc_stat_type=$("#doc_stat_type");
- var stationid=$.trim($("#scd_stat1 .active").attr("stationid"));
- $.getJSON(Global.AccessUrl+"/api/attachment/stat",{"station_id":stationid},function(c){
- if(c.code!=0){
- layer.msg("文档分类统计错误:"+c.msg)
- return;
- }
- if(c.data==null || c.data.length==0){
- doc_stat_type.html(Tools.HtmlText("当前无任何文档"));
- return;
- }
- callback(c.data);
- })
- }
- //装置分类统计
- function ied_stat_type(){
- var callback = function(result) {
- var XData = new Array(),
- YData = new Array();
- var Ytitle = "总数";
- var TypeColor = "#FFCB11";
- var statData={};
- for (var c = 0; c < result.comments.length; c++) {
- var code=result.comments[c].code;
- var cnt=0;
- for (var i = 0; i < result.data.length; i++) {
- var item=result.data[i];
- if($.trim(item.ied_type)=="") continue;
- if(item.ied_type.indexOf(code)==0){
- cnt += item.cnt*1;
- }
- }
- statData[result.comments[c].id] = cnt;
- }
- for (var k=0;k< result.comments.length;k++) {
- var tid=result.comments[k].id;
- if(statData[tid]==null || statData[tid]==0) continue;
- XData.push(result.comments[k].name);
- YData.push({
- "value": statData[tid]==null?0:statData[tid],
- "name": result.comments[k].name
- });
- }
- var chartDom = document.getElementById("ied_stat_type");
- echarts.init(chartDom).dispose();
- var myChart = echarts.init(chartDom);
- var option = {
- grid: {
- top: '12%',
- left: '13%',
- right: '10%',
- bottom: '17%',
- },
- xAxis: [{
- type: 'category',
- boundaryGap: true, //柱子是否不从0开始
- axisLine: { //坐标轴轴线相关设置。数学上的x轴
- show: true,
- lineStyle: {
- color: '#000'
- },
- },
- axisLabel: { //坐标轴刻度标签的相关设置
- interval: 0, //显示全部标签
- rotate: -30,
- textStyle: {
- color: '#000',
- padding: 0,
- fontSize: 12 * wRate
- }
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false,
- },
- data: XData
- }],
- yAxis: [{
- name: Ytitle,
- nameTextStyle: {
- color: "#000",
- fontSize: 10 * wRate,
- padding: 0
- },
- min: 0,
- splitLine: {
- show: true,
- lineStyle: {
- type: "dashed",
- color: '#000'
- }
- },
- axisLine: {
- show: false,
- lineStyle: {
- color: "#F3F5FA"
- }
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#000',
- fontSize: 10 * wRate,
- padding: 0
- }
- },
- axisTick: {
- show: false,
- },
- }],
- series: [{
- type: 'bar',
- barWidth: 5,
- label: {
- show: true,
- position: 'top',
- textStyle: {
- color: "#134BEA",
- }
- },
- itemStyle: {
- color: TypeColor,
- //borderColor: TypeColor,
- //borderWidth: 2,
- barBorderRadius: [10, 10, 0, 0]
- },
- tooltip: {
- show: false
- },
- data: YData
- }]
- };
- option && myChart.setOption(option);
- myChart.off().on('click', function(para) {
- //原始柱子单击时仅做柱状图放大处理
- var dialog_public = $("#dialog_public");
- DialogObject.Open(dialog_public, {
- "callback": function(win, para) {
- //win.find(".layout_caption .layout_title").html("生产网络");
- //win.find(".layout_content").height(win.height() - win.find(".layout_caption").height());
- },
- "para": option,
- "size": ["90rem", "48rem"]
- });
- });
- }
- var doc_stat_type=$("#ied_stat_type");
- var stationid=$.trim($("#scd_stat1 .active").attr("stationid"));
- $.getJSON(Global.AccessUrl+"/api/ied/stat",{"station_id":stationid},function(c){
- if(c.code!=0){
- layer.msg("装置分类统计错误:"+c.msg)
- return;
- }
- if(c.data==null || c.data.length==0){
- doc_stat_type.html(Tools.HtmlText("当前无任何装置"));
- return;
- }
- callback(c.data);
- })
- }
- var scd_stat1_autoUp=null;
- //资料完整度分析
- function scd_stat1(){
- var $scd_stat1=$("#scd_stat1>div:first");
- $.getJSON(Global.AccessUrl+"/api/doc/stat/1",{},function(c){
- if(c.code!=0){
- layer.msg("资料完整度统计错误:"+c.msg)
- return;
- }
- if(c.data==null || c.data.length==0){
- $scd_stat1.html(Tools.HtmlText("当前无任何资料"));
- return;
- }
- $("#station_count b").html(c.data.length).off().on('click',function(){
- $scd_stat1.find(".doctype_list.active").removeClass("active");
- doc_stat_type();
- ied_stat_type();
- scd_stat2();
- });
- callback(c.data);
- })
- var callback=function(result){
- /*
- for (var i = 0; i < 50; i++) {
- result.push(result[0]);
- }*/
-
- for (var i1 = 0; i1 < result.length; i1++) {
- var ied_cnt= result[i1]==null ? 0 : $.trim(result[i1].ied_cnt);
- if(ied_cnt==0 || ied_cnt==""){
- //未上传SCD
- continue;
- }
- var comments=result[i1].doc.comments;
- var doclist=result[i1].doc.data;
- var totalrate=0;
- for (var i = 0; i < comments.length; i++) {
- if(comments[i].code=="file_a_scd"){
- comments[i]["cnt"] = 1;
- comments[i]["rate"] = 100;
- totalrate += 100;
- continue;
- }
- for (var k = 0; k < doclist.length; k++) {
- if(doclist[k].file_type==null){
- continue;
- }
- if(doclist[k].file_type==comments[i].id){
- var docCnt=$.trim(doclist[k].cnt);
- if (docCnt=='') docCnt="0"
- comments[i]["cnt"] = docCnt*1;
- comments[i]["rate"] = (docCnt/ied_cnt*100).toFixed(1);
- totalrate += comments[i]["rate"]*1;
- break;
- }
- }
- }
- result[i1]["rate"]=(totalrate/comments.length).toFixed(1); //总比例
- }
- var h=template('station_doctype_list_item_tpl',{data:result});
- $scd_stat1.html(h);
- //console.log(result)
- for (var i1 = 0; i1 < result.length; i1++) {
- var tmpEle=$scd_stat1.find(".doctype_list[stationid='"+result[i1].id+"'] .doc_detail_list");
- var ied_cnt= result[i1]==null ? 0 : $.trim(result[i1].ied_cnt);
- if(ied_cnt==0 || ied_cnt==""){
- //未上传SCD
- tmpEle.html(Tools.HintText("未签入SCD"));
- continue;
- }
- tmpEle.html(template('station_doc_item_tpl',{data:result[i1].doc.comments}));
- }
- $("#scd_stat1 .doctype_list").off().on("click",function(){
- if($(this).find(".doctype_list_item").length==0){
- return;
- }
- $scd_stat1.find(".doctype_list.active").removeClass("active");
- $(this).addClass("active");
- doc_stat_type();
- ied_stat_type();
- scd_stat2();
- });
- var ph=$("#scd_stat1").height();
- if($scd_stat1.height()>ph){
- $("#scd_stat1").slimScroll({
- height: ph + "px",
- width: "100%",
- alwaysVisible: false,
- wheelStep: 10,
- size: "6px",
- color: "#03aee7"
- });
- }
- //自动滚动
- /*
- var ph=$("#scd_stat1").height();
- if($scd_stat1.height()>ph){
- if(scd_stat1_autoUp!=null){
- clearTimeout(scd_stat1_autoUp);
- }
- var autoUp=function(){
- var oldTop=$scd_stat1.css("margin-top").replace("px","")*1;
- if(($scd_stat1.height()+oldTop)<ph){
- $scd_stat1.css("margin-top","0px");
- }else{
- $scd_stat1.css("margin-top",oldTop-ph+"px");
- }
- setTimeout(function(){
- autoUp();
- },10*1000);
- }
- scd_stat1_autoUp=setTimeout(function(){
- autoUp();
- },10*1000);
- } */
- }
- }
- var scd_stat2_autoUp=null;
- //SCD正确性分析
- function scd_stat2(){
- if(scd_stat2_autoUp!=null){
- clearTimeout(scd_stat2_autoUp);
- }
- var $scd_stat2=$("#scd_stat2>div:first");
- var stationid=$.trim($("#scd_stat1 .active").attr("stationid"));
- $scd_stat2.html("<div station_id='' class='hidden scd_right_rate' style='text-align: center;font-size: 1.6rem;color: #000000;'>SCD正确率:<b style='font-family: electronicFont;font-size: 3rem;color: #FFCB11;'>—</b></div>");
- $.getJSON(Global.AccessUrl+"/api/scd/stat/right",{"station_id":stationid},function(r){
- if(r.code!=0){
- layer.msg("SCD正确性统计失败!")
- console.log(r);
- return;
- }
- if (r.data==null){
- return;
- }
- var hs=[];
- for (var k in r.data) {
- var item=r.data[k];
- if (item==null || item.scd_id==null){
- continue;
- }
- var rate=(((item.nodetotal-item.cnt)/item.nodetotal)*100).toFixed(1);
- if(item.nodetotal*1<=item.cnt*1) rate=100;
- hs.push("<div station_id='"+item.station_id+"' class='hidden scd_right_rate' style='text-align: center;font-size: 1.6rem;color: #000000;'>"+item.station_name+"-SCD正确率:<b style='font-family: electronicFont;font-size: 3rem;color: #FFCB11;'>"+rate+"%</b></div>");
- }
- $scd_stat2.html(hs.join("")).find(".scd_right_rate:first").removeClass("hidden").attr("isshow","1");
- if($scd_stat2.find(".scd_right_rate").length>1){
- var autoUp2=function(){
- var cur=$scd_stat2.find(".scd_right_rate[isshow='1']").addClass("hidden").attr("isshow","0").next();
- if(cur.length==0) cur = $scd_stat2.find(".scd_right_rate:first");
- cur.removeClass("hidden").attr("isshow","1");
- scd_stat2_autoUp=setTimeout(function(){
- autoUp2();
- },20*1000);
- }
- scd_stat2_autoUp=setTimeout(function(){
- autoUp2();
- },20*1000);
- }
- });
- }
- </script>
|