<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://"
|
+ request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
<%@ taglib uri="/struts-tags" prefix="s"%>
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<!-- 默认使用最高内核 -->
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
|
<base href="<%=basePath%>">
|
<title><s:text name="Charge_discharge_data"></s:text>
|
</title>
|
|
<meta http-equiv="pragma" content="no-cache">
|
<meta http-equiv="cache-control" content="no-cache">
|
<meta http-equiv="expires" content="0">
|
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
<meta http-equiv="description" content="This is my page">
|
<link href="css/basic.css" type="text/css" rel="stylesheet" />
|
<link href="css/charge_test_style.css" type="text/css" rel="stylesheet" />
|
<link href="css/loading.css" type="text/css" rel="stylesheet" />
|
<link href="jqueryui/jquery-ui.css" type="text/css" rel="stylesheet" />
|
<link rel="stylesheet" href="src/css/layui.css">
|
<link href="css/collapse.css" type="text/css" rel="stylesheet" />
|
<link rel="stylesheet" type="text/css" href="css/confirm.css">
|
<link rel="stylesheet" href="css/common.css">
|
<link rel="stylesheet" type="text/css" href="css/popup-tbl.css">
|
<!-- font-awesome-4.7.0 -->
|
<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">
|
<script type="text/javascript" src="js/echarts2.js"></script>
|
<script type="text/javascript" src="js/frame.js"></script>
|
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
|
|
<script type="text/javascript" src="js/createTab.js"></script>
|
<script type="text/javascript" src="js/right-menu.js"></script>
|
<script type="text/javascript" src="js/Title.js"></script>
|
<script type="text/javascript" src="js/loading.js"></script>
|
<style type="text/css">
|
#allGraph {
|
position: absolute;
|
top: -1000px;
|
left: 0;
|
width: 600px;
|
height: 400px;
|
}
|
.chart-contain {
|
width: 100%;
|
height: 100%;
|
background-color: #FFFFFF;
|
}
|
.chart {
|
width: 100%;
|
height: 100%;
|
}
|
.graph-full-absolute {
|
top: 0;
|
left: 0;
|
position:absolute;
|
width: 100%;
|
height: 100%;
|
z-index: 99;
|
background-color: #FFFFFF;
|
}
|
.myconfirm {
|
z-index: 999998
|
}
|
</style>
|
</head>
|
|
<body>
|
<!--头部内容开始-->
|
<jsp:include page="Top.jsp" flush="true"/>
|
<!--头部内容结束-->
|
<!--导航开始-->
|
<jsp:include page="nav.jsp" flush="true"/>
|
<!--导航结束-->
|
<div id="main">
|
<table id="all_content">
|
<tr>
|
<td id="ele_content">
|
<div class="siderbar-tools">
|
<div class="siderbar-tools-right">
|
<i class="fa fa-file-text-o" title="机历卡" id="siderbarToolsCard"></i>
|
<i class="fa fa-search" title="查询机房" id="siderbarToolsSearch"></i>
|
<i class="fa fa-outdent" title="全部收缩" id="siderbarToolsHide"></i>
|
</div>
|
</div>
|
<!--电池组菜单栏-->
|
<div id="lside"></div>
|
<div class="batt-listen">
|
<div class="count-num">
|
放电数:<span>0</span>
|
充电数:<span>0</span>
|
</div>
|
<div class="batt-list"></div>
|
</div>
|
</td>
|
<td id="rside">
|
<div id="address_infor"></div>
|
<table id="content">
|
<tr>
|
<td><span><s:text name="Batte_state"></s:text></span>:<input type="text"
|
id="ele_state" readonly="readonly" />
|
</td>
|
<!-- 电池状态 -->
|
<td><span><s:text name="Terminal_vol"></s:text></span>:<span class="vis">隐</span><input
|
type="text" id="ele_tension" readonly="readonly" />
|
</td>
|
<!-- 组端电压 -->
|
<td><span><s:text name="Batt_current"></s:text></span>:<input type="text"
|
id="ele_current" readonly="readonly" />
|
</td>
|
<!-- 电池电流 -->
|
<td><span><s:text name="Test_date"></s:text></span>:<input type="text"
|
id="test_date" readonly="readonly" />
|
</td>
|
<!-- 测试日期 -->
|
</tr>
|
<tr>
|
<td><span><s:text name="Test_timeL"></s:text></span>:<input type="text"
|
id="test_time" readonly="readonly" />
|
</td>
|
<!-- 测试时长 -->
|
<td><span><s:text name="Test_capacity"></s:text></span>:<input
|
type="text" id="test_content" readonly="readonly" />
|
</td>
|
<!-- 测试容量 -->
|
<td><span><s:text name="Residual_capacity"></s:text></span>:<input
|
type="text" id="over_content" readonly="readonly" />
|
</td>
|
<!-- 剩余容量 -->
|
<td><span><s:text name="Endurance"/><s:text name="Time"/></span>:<input type="text"
|
id="reserve_time" readonly="readonly" />
|
</td>
|
<!-- 后备时间 -->
|
</tr>
|
</table>
|
<table>
|
<tr>
|
<td style="width: 300px !important;position: relative;">
|
<table id="charge_infor" style="width: 300px !important;">
|
<tr>
|
<td id="charge_sec">
|
<select id="charge_select_type">
|
<option value="charge-discharge" selected = "selected" ><s:text name="Charge_discharge_data"/></option> <!-- 充电/放电测试数据 -->
|
<option value="charge"><s:text name="Discharge_data"/></option> <!-- 充电测试数据 -->
|
<option value="discharge"><s:text name="Charge_test_data"/></option> <!-- 放电测试数据 -->
|
<option value="Resistance-conductivity"><s:text name="Conductivity_Resistivity_data"/></option> <!-- 电导电阻数据 -->
|
</select>
|
<div id="charge_sec_infor"></div>
|
</td>
|
</tr>
|
<tr>
|
<td id="charge_thr">
|
<div id="charge_thr_infor">
|
<!-- 真正的头部 -->
|
<table id="charge_thr_th">
|
<thead>
|
<tr>
|
<th style="width:30%;"><s:text name="Number"></s:text>
|
</th>
|
<!-- 编号 -->
|
<th style="width:40%"><s:text name="Voltage"></s:text>(V)</th>
|
<!-- 电压 -->
|
<th style="width:30%"><input type="checkbox">
|
</th>
|
</tr>
|
</thead>
|
<tbody id="t_top">
|
</tbody>
|
</table>
|
<table class="res">
|
<thead>
|
<tr>
|
<th><s:text name="Number"/></th> <!-- 编号 -->
|
<th><s:text name="Voltage"/></th> <!-- 电压 -->
|
<th><s:text name="Temperature"/>(℃)</th> <!-- 温度 -->
|
<th><s:text name="Internal_resistance"/>(mΩ)</th> <!-- 内阻 -->
|
<th><s:text name="Conductance"/></th> <!-- 电导 -->
|
<th><s:text name="Conductivity_percentage"/>(%)</th> <!-- 电导百分比 -->
|
<th><s:text name="Article_connection"/>(mΩ)</th> <!-- 连接条 -->
|
</tr>
|
</thead>
|
<tbody class="t_body">
|
|
</tbody>
|
</table>
|
</div>
|
</td>
|
</tr>
|
</table>
|
<!-- 定义特殊设备历史测试信息显示的容器 -->
|
<div id="special-charge-infor" class="special-mon-data">
|
<div class="mon-data-header"></div>
|
<div class="mon-data-content">
|
<div class="collapse">
|
<div class="collapse-header">
|
<div class="collapse-header-content">
|
<a href="javascript:;">放电数据<span class="badge default position-right">2</span></a>
|
</div>
|
</div>
|
<div class="collapse-content">
|
<div class="content">
|
<ul>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">1.2018-07-04 9:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);" class="active">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
<li>
|
<a href="javascript:void(0);" class="charge-time" onclick="collapseSecClick(this);">2.2018-07-04 19:09:12<i class="fa fa-caret-down"></i></a>
|
<ul>
|
<li><a href="javascript:void(0);">电池单体#1</a></li>
|
<li><a href="javascript:void(0);">电池单体#2</a></li>
|
<li><a href="javascript:void(0);">电池单体#3</a></li>
|
</ul>
|
</li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</td>
|
<td id="r_echarts">
|
<!-- 放大表的容器 -->
|
<div id="big_echarts">
|
<div id="big_echarts_container"></div>
|
</div>
|
<table id="table_echarts">
|
<tr>
|
<td>
|
<div class="graph"><div id="ltop"></div></div>
|
</td>
|
<td>
|
<div class="graph"><div id="lbottom"></div></div>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<div class="graph"><div id="rtop"></div></div>
|
</td>
|
<td>
|
<div class="graph"><div id="rbottom"></div></div>
|
</td>
|
</tr>
|
</table>
|
|
|
<form action="EchartPictureDowload.servlet" method="post" id="all_picture" enctype="multipart/form-data">
|
<input type="hidden" name="pageName" value="exportTbal" />
|
<input type="hidden" name="ltop_echart" id="ltop_echart" />
|
<input type="hidden" name="rtop_echart" id="rtop_echart" />
|
<input type="hidden" name="lbottom_echart" id="lbottom_echart" />
|
<input type="hidden" name="rbottom_echart" id="rbottom_echart" />
|
<input type="hidden" name="actucap_echart" id="actucap_echart"/>
|
<input type="hidden" name="restcap_echart" id="restcap_echart"/>
|
<input type="hidden" name="capperc_echart" id="capperc_echart"/>
|
<input type="hidden" name="tmp_echart" id="tmp_echart"> <!-- 单体温度折线图 -->
|
<input type="hidden" name="mon_res" id="mon_res"> <!-- 单体内阻 -->
|
<input type="hidden" name="last_vol" id="last_vol"> <!-- 终止电压柱状图 -->
|
<input type="hidden" name="last_tmp" id="last_tmp"> <!-- 终止温度柱状图 -->
|
<input type="hidden" name="obj-bmd" id="obj-bmd"/>
|
<input type="hidden" name="obj-title" id="obj-title"/> <!-- 落后单体阀值信息 -->
|
<input type="hidden" name="arr-data" id="arr-data"/> <!--存放单体的起始信息二维数组-->
|
<input type="hidden" name="mon-vol-list" id="mon-vol-list"/> <!-- 所有单体电压测试信息 -->
|
<input type="hidden" name="mon-tmp-list" id="mon-tmp-list"/> <!-- 所有单体温度测试信息 -->
|
<input type="hidden" name="mon-group-list" id="mon-group-list"/> <!-- 所有单体温度测试信息 -->
|
</form>
|
|
|
<form action="EchartPictureDowload.servlet" method="post" id="Big_picture">
|
<input type="hidden" name="pageName" value="charge-test" />
|
<input type="hidden" name="big_pic" id="big_pic" />
|
</form>
|
<div id="charge_bottom">
|
<!-- <div id="slide">
|
<div class="label">2012-12-06 00:00:00</div>
|
</div> -->
|
<div id="slider">
|
<div class="label">2012-12-06 00:00:00</div>
|
</div>
|
</div>
|
<!-- 定义特殊设备历史测试信息显示的容器 -->
|
<div class="special-mon-data special-line-graph">
|
<div class="mon-data-header"></div>
|
<div class="mon-data-content" style="position:relative">
|
<div class="special-graph-tools">
|
<div class="tools-item">
|
<a href="javascript:void(0);" class="whyc-btn whyc-btn-disabled" id="specialGraphExport">
|
<span class="whyc-btn-icon fa fa-file-excel-o"></span>
|
<span class="whyc-btn-txt">导出数据</span>
|
</a>
|
</div>
|
</div>
|
<div class="content-item mon-vol-line page-l-r">
|
<div class="page-left page-50">
|
<div class="graph"><div id="specialMonVolLine"></div></div>
|
</div>
|
<div class="page-left page-50">
|
<div class="graph"><div id="specialMonCapBar"></div></div>
|
</div>
|
</div>
|
<div class="content-item line-list page-l-r">
|
<div class="page-left page-50">
|
<div class="graph"><div id="specialGroupVolLine"></div></div>
|
</div>
|
<div class="page-left page-50">
|
<div class="graph"><div id="specialCurrLine"></div></div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</td>
|
</tr>
|
</table>
|
</td>
|
</tr>
|
</table>
|
</div>
|
<!-- 当在图片上右键时 显示菜单-->
|
|
<!-- 鼠标右键菜单显示 -->
|
<div id="right_menu">
|
<ul>
|
<li><a href="javascript:"><s:text name="Check_the_battery_card"></s:text></a></li> <!-- 查看电池组机历卡 -->
|
<li><a href="eleBrdwMaint.jsp" target="_blank"><s:text name="Batt_failure_maintenance_record_query" /></a></li> <!-- 电池故障维护记录查询 -->
|
<li><a href="javascript:targetBattReport();"><s:text name="Battery_statistical_analysis_queries"></s:text></a></li> <!-- 电池统计分析查询-->
|
<!-- <li><a href="eleMonomer.jsp"><s:text name="Batt_statistical_analysis_query"></s:text></a></li> 电池单体统计分析查询 -->
|
<!-- <li><a href="javascript:" class="more_menu"><s:text name="Add_battery_test"/><span class="angle">>></span></a> 添加到蓄电池组放电测试
|
<div class="child_menu">
|
<p><s:text name="Add_switch_check_test"/></p> 添加到拉闸动环核对性放电测试
|
<p><s:text name="Add_check_test"/></p> 添加到核对性放电测试
|
<p><s:text name="Add_capacity_test"/></p> 添加到容量实验放电测试
|
</div>
|
</li> -->
|
<li style="display:none;"><a href="javascript:"><s:text name="Search_engine_or_the_batt_group"></s:text></a></li> <!-- 搜索机房或电池组-->
|
<li><a href="javascript:" id="all_hide"><s:text name="Collapse_all"></s:text></a></li> <!-- 全部收缩 -->
|
</ul>
|
</div>
|
<!-- 电池组机历卡详细信息-->
|
<div id="card_infor">
|
<span class="title-log"><s:text name="The_battery_pack_machine_through_the_card"/></span> <!-- 电池组机历卡 -->
|
<div id="cardInfoTab" class="whyc-tab-card">
|
<ul class="whyc-tab-title">
|
<li class="whyc-tab-this">电池组信息</li>
|
<li class="">基站信息</li>
|
</ul>
|
</div>
|
<div class="con-list ele-infor con-show" style="height: 400px;overflow-y: auto">
|
<table>
|
<tr>
|
<th id="card_infor_left"><s:text name="Parameter_name"/></th> <!-- 参数名称 -->
|
<th><s:text name="Parameter_value"/></th> <!-- 参数值 -->
|
</tr>
|
<tr>
|
<td><s:text name="Computer_room_ID"/></td> <!-- 机房ID -->
|
<td id="StationId"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Computer_name"/></td> <!-- 机房名称 -->
|
<td id="StationName"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Computer_room_IP"/></td> <!-- 机房IP -->
|
<td id="StationIP"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Batt_group"/>ID</td> <!-- 电池组ID -->
|
<td id="batt_group_id"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Battery_name"/></td> <!-- 电池组名称 -->
|
<td id="BattGroupName"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Battery_number"/></td> <!-- 电池组序号 -->
|
<td id="BattGroupNum"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Battery_brand"/></td> <!-- 电池品牌 -->
|
<td id="BattProducer"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Battery_model"/></td> <!-- 电池型号 -->
|
<td id="BattModel"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Monomer"/><s:text name="Batt"/><s:text name="Property"/></td> <!-- 单体电池属性 -->
|
<td id="BattMonItem"><s:text name="Nominal_capacity"/>:<span id="MonCapStd"></span>AH;<s:text name="Nominal_voltage_monomer"/>:<span id="MonVolStd"></span>V;<s:text name="Nominal_resistance"/>:<span id="MonResStd"></span>mΩ;<s:text name="Nominal"/><s:text name="Temperature"/>:<span id="MonTmpStd"></span>℃;<s:text name="Monomer_All"/>:<span id="MonCount"></span><s:text name="Section"/></td>
|
</tr>
|
<!-- <tr>
|
<td><s:text name="Nominal_capacity"/>(AH)</td> 标称容量
|
<td id="MonCapStd"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Nomina_voltage_monomer"/>(V)</td> 标称单体电压
|
<td id="MonVolStd"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Monomer_All"/></td> 单体数量(节)
|
<td id="MonCount"></td>
|
</tr> -->
|
<tr>
|
<td><s:text name="Put_into_use_time"/>(y-M-d)</td> <!-- 投入使用时间(年-月-日) -->
|
<td id="BattInUseDate"></td>
|
</tr>
|
<!-- <tr>
|
<td><s:text name="Guarantee"/><s:text name="Time_limit"/>(<s:text name="Day"/>)</td> 保修期限(天)
|
<td id="BattGuarantDayCount"></td>
|
</tr> -->
|
<tr>
|
<td><s:text name="Battery_float_curr_charging_valve"/>(A)</td> <!-- 电池浮充电流阀值 -->
|
<td id="BattFloatCurrent"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Batt_charge_pressure_threshold"/>(V)</td> <!-- 电池均电电压阀值 -->
|
<td id="FloatVolLevel"></td>
|
</tr>
|
<tr>
|
<td><s:text name="Charge_discharge"/><s:text name="Equipment"/><s:text name="Message"/></td> <!-- 充放电设备信息 -->
|
<td><s:text name="Model"/>:<span id="FBSDeviceName"></span>;ID:<span id="FBSDeviceId"></span>;IP:<span id="FBSDeviceIp"></span>;BIndex:<span id="GroupIndexInFBSDevice"></span>;</td>
|
</tr>
|
<tr>
|
<td><s:text name="Head"/></td> <!-- 负责人 -->
|
<td></td>
|
</tr>
|
<tr>
|
<td>安装人员</td> <!-- 负责人 -->
|
<td id="installUser"></td>
|
</tr>
|
</table>
|
</div>
|
<div class="con-list ele-infor" style="height: 400px;overflow-y: auto">
|
<table>
|
<tr>
|
<th id="card_infor_left"><s:text name="Parameter_name"/></th> <!-- 参数名称 -->
|
<th><s:text name="Parameter_value"/></th> <!-- 参数值 -->
|
</tr>
|
<tr>
|
<td>站点ID</td>
|
<td id="station_stationid_ex"></td>
|
</tr>
|
<tr>
|
<td>站点名称</td>
|
<td id="station_stationname"></td>
|
</tr>
|
<tr>
|
<td>机房ID</td>
|
<td id="station_stationid"></td>
|
</tr>
|
<tr>
|
<td>所属组织</td>
|
<td id="station_affiliation"></td>
|
</tr>
|
<tr>
|
<td>数据来源</td>
|
<td id="station_dataSources"></td>
|
</tr>
|
<tr>
|
<td>站址类型</td>
|
<td id="station_stationType"></td>
|
</tr>
|
<tr>
|
<td>经纬度</td>
|
<td id="station_jinweidu"></td>
|
</tr>
|
<tr>
|
<td>所在地址</td>
|
<td id="station_stationAddr"></td>
|
</tr>
|
<tr>
|
<td>站址状态</td>
|
<td id="station_stationstate"></td>
|
</tr>
|
<tr>
|
<td>维护单位</td>
|
<td id="station_maintenanceCompany"></td>
|
</tr>
|
<tr>
|
<td>站址场景</td>
|
<td id="station_stationscenario"></td>
|
</tr>
|
<tr>
|
<td>站址产权</td>
|
<td id="station_stationproperty"></td>
|
</tr>
|
<tr>
|
<td>使用单位</td>
|
<td id="station_useUnit"></td>
|
</tr>
|
<tr>
|
<td>物理站址编码</td>
|
<td id="station_siteCode"></td>
|
</tr>
|
<tr>
|
<td>历史物理站址编码</td>
|
<td id="station_historySiteCode"></td>
|
</tr>
|
<tr>
|
<td>站址内部编号</td>
|
<td id="station_siteInternalNumber"></td>
|
</tr>
|
<tr>
|
<td>站址拼音简称</td>
|
<td id="station_sitePinyinReferred"></td>
|
</tr>
|
<tr>
|
<td>中文简称</td>
|
<td id="station_siteChineseReferred"></td>
|
</tr>
|
<tr>
|
<td>是否开通业务</td>
|
<td id="station_isOpenBusiness"></td>
|
</tr>
|
<tr>
|
<td>录入人员</td>
|
<td id="station_schoolPersonnel"></td>
|
</tr>
|
<tr>
|
<td>录入时间</td>
|
<td id="station_entryTime"></td>
|
</tr>
|
<tr>
|
<td>修改人</td>
|
<td id="station_modifyPeople"></td>
|
</tr>
|
<tr>
|
<td>修改时间</td>
|
<td id="station_modifyTime"></td>
|
</tr>
|
<tr>
|
<td>备注</td>
|
<td id="station_note"></td>
|
</tr>
|
<tr>
|
<td>站址接收标记及是否有效</td>
|
<td id="station_receiveorvalidity"></td>
|
</tr>
|
<tr>
|
<td>移动站址名称</td>
|
<td id="station_siteNameCMCC"></td>
|
</tr>
|
<tr>
|
<td>电信站址名称</td>
|
<td id="station_siteNameCTC"></td>
|
</tr>
|
<tr>
|
<td>联通站址名称</td>
|
<td id="station_siteNameCUCC"></td>
|
</tr>
|
<tr>
|
<td>品牌</td>
|
<td id="station_producer"></td>
|
</tr>
|
<tr>
|
<td>续航测算时长</td>
|
<td id="station_lastTimeLong"></td>
|
</tr>
|
<tr>
|
<td>续航测算类别</td>
|
<td id="station_lastTimeType"></td>
|
</tr>
|
<tr>
|
<td>续航发生时间</td>
|
<td id="station_lastTimeDate"></td>
|
</tr>
|
<tr>
|
<td>共享情况</td>
|
<td id="station_shareInfo"></td>
|
</tr>
|
<tr>
|
<td>运营商购买发电服务状况</td>
|
<td id="station_electPower"></td>
|
</tr>
|
<tr>
|
<td>是否具备发电条件</td>
|
<td id="station_isCanElectPower"></td>
|
</tr>
|
<tr>
|
<td>上站路程</td>
|
<td id="station_upperStationRoute"></td>
|
</tr>
|
<tr>
|
<td>上站难易程度</td>
|
<td id="station_upperStationDifficult"></td>
|
</tr>
|
<tr>
|
<td>客户问题库未完成蓄电池维修</td>
|
<td id="station_clienteleErrorService"></td>
|
</tr>
|
</table>
|
</div>
|
<input type="button" name="" id="out_card_infor" value="<s:text name='Return'/>">
|
</div>
|
|
<!-- 搜索机房或电池组 -->
|
<div id="search_room" >
|
<span><s:text name="Search_engine_or_the_battery_pac"/></span> <!-- 搜索机房或电池组 -->
|
<div id="input_container">
|
<input type="text" name="" id="search_input" placeholder="<s:text name='Please_enter_the_key_words'/>" autocomplete="off" value="">
|
<select id='search-type'>
|
<option value='1'>机房</option>
|
<option value='0'>电池组</option>
|
</select>
|
</div>
|
<p><s:text name="Computer_room_or_battery_name"/></p> <!-- 机房或电池组名称 -->
|
<div id="search_info">
|
|
</div>
|
<div class="btn_container">
|
<input type="button" name="" id="en_search" value="<s:text name='Determine'/>">
|
<input type="button" name="" id="out_search" value="<s:text name='Exit'/>">
|
</div>
|
</div>
|
<!-- 整体的遮罩层 -->
|
<div id="allShade"></div>
|
|
<!-- 导出当前图到Excel右键菜单 -->
|
<div id="echarts_menu">
|
<ul class="export-ul">
|
<li><a href="javascript:"><s:text name='Monomer_voltage'/></a></li>
|
<li><a href="javascript:">单体温度</a></li> <!-- 单体温度 -->
|
<li class="maybe-hide"><a href="javascript:"><s:text name='Monomer'/><s:text name='Actual_capacity'/></a></li> <!-- 单体实际容量 -->
|
<li class="maybe-hide"><a href="javascript:"><s:text name='Monomer'/><s:text name='Residual_capacity'/></a></li> <!-- 单体剩余容量 -->
|
<li class="maybe-hide"><a href="javascript:"><s:text name='Monomer'/><s:text name='Percent_total_capacity'/></a></li> <!-- 单体容量百分比 -->
|
</ul>
|
<ul>
|
<li><a href="javascript:" class="export-a"></a></li>
|
<li><a href="javascript:ExportAll()"><s:text name="Export"/><s:text name="Test_data"/><s:text name="Report"/></a></li> <!-- 导出测试数据报表-->
|
<li><a href="javascript:setNomCap();">设置标称容量</a></li> <!---->
|
</ul>
|
</div>
|
|
<!-- 导出放大之后的图到Excel中 -->
|
<div id="bigecharts_menu">
|
<ul><li><a href="javascript:ExportBigpic()"><s:text name="Export" /><s:text name="Bar_graph" />/<s:text name="Line_graph" /></a></li></ul>
|
</div>
|
|
<div id="bigEchartsCon"></div>
|
<!-- 导航定位 -->
|
<div class="popup w500 mr250" id="localNav">
|
<div class="popup-title"><span>机房查询</span><a href="javascript:;" class="close">X</a></div>
|
<div class="popup-content">
|
<div class="popup-tbl">
|
<table>
|
<tbody>
|
<tr>
|
<th>机房名称/机房id</th>
|
</tr>
|
<tr>
|
<td>
|
<input name="popupHomeName" id="popupHomeName" type="text">
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
|
<div class="popup-footer">
|
<input type="button" name="" id="localNav_en" class="status-change-btn" value="确定" > <!-- 确定 -->
|
<input type="button" name="" class="close" value="取消" > <!-- 取消 -->
|
</div>
|
</div>
|
<!-- 清除浮动 -->
|
<div class="clear"></div>
|
<div id="allGraph">
|
<div class="chart-contain">
|
<div class="chart"></div>
|
</div>
|
</div>
|
<input type="hidden" id="lineStatus" value="0">
|
<input type="hidden" id="testrecordcout" value="-1"/> <!-- 记录当前显示的数据是第几笔 -->
|
<!-- iframe数据临时存储位置 -->
|
<div id="homeInfoIframeData"></div>
|
</body>
|
<script type="text/javascript" src="jqueryui/jquery-ui.js"></script>
|
<!-- 引入layui框架 -->
|
<script type="text/javascript" src="src/layui.all.js"></script>
|
<script type="text/javascript" src="js/collapse.js"></script>
|
<script type="text/javascript" src="js/charge.js"></script>
|
<script type="text/javascript" src="js/myConfirm.js"></script> <!-- 确认框 -->
|
<script type="text/javascript" src="js/popup.js"></script>
|
<script type="text/javascript" src="pages/js/pages/homeInfo.js"></script>
|
<script type="text/javascript" src="pages/js/pages/siderbar.js"></script>
|
<script type="text/javascript">
|
var permits;
|
<% Object obj=session.getAttribute("permits");
|
if(obj != null){
|
String permits =obj.toString();%>
|
permits=<%=permits%>;
|
//console.info(json);
|
<% }%>
|
var showMonitorDis = getQueryString('monnum');
|
//console.info(permits);
|
var isCanExport = false;
|
|
var BattinfObj;
|
var Battimeinfo; //每个时刻电池的信息
|
var slide_index=0; //滑块停留的位置
|
var battinlist = []; //电池组信息数组
|
var Monnum_list; //声明电池编号数组
|
var Monvol_list; //声明电池电压数组
|
var SlideLength; //滑块距离左端的距离
|
var AllBataDate; //格式化之后的该电池组中所有电池的测试信息
|
var Mon_reacaplist=new Array(); //当前的实际容量数组
|
var Mon_overcaplist=new Array(); //当前的剩余容量数组
|
var Mon_percaplist=new Array(); //当前容量百分比数组
|
|
var BattData; //生成折线图的二维数组
|
var TestTime; //时间数组
|
var BattGroupVol = new Array(); //存放电池组组端电压的数组
|
//var BattOnlineVol; //存放电池组在线电压的数组
|
var BattGroupCurr; //存放电池组电流的数组
|
var AllTestData; //原始的测试数据
|
var thrname; //三张折线图的title
|
var tname; //条形图的title
|
var dbname; //鼠标双击的图名
|
|
var Restitle; //电阻条形图title
|
var Serpercenttitle; //电导百分比折线图title
|
var Montitle; //电压条形图title
|
var Sertitle; //电导条形图title
|
var li_index=0; //用于标记当前选中的是单体电压(0),单体实际容量(1),单体剩余容量(2),单体容量百分比(3)
|
var cPicker = new Object(); // 颜色设置
|
|
var oChargeBtm=document.getElementById("charge_bottom");
|
var Olside = document.getElementById("lside"); //电池组菜单栏
|
|
var allGraph = echarts.init($('#allGraph .chart-contain .chart').get(0));
|
//console.info(allGraph);
|
|
var Ocharge_sec_infor=document.getElementById("charge_sec_infor"); //测试记录显示
|
var lsideLength=Olside.offsetWidth;
|
//console.info(lsideLength);
|
|
var isFirLoadPage = 1; // 判断是否是第一次加载页面
|
|
//console.info(SlideLength);
|
var Ot_top = document.getElementById("t_top");
|
|
// 设置柱状图默认颜色
|
cPicker = {
|
'min': 'red',
|
'max': 'green',
|
'normal': '#5986BF',
|
'change': '#ff66cc',
|
'warn': '#ffff00'
|
};
|
searchUserColor();
|
|
loading.showLoading($('#lside'));
|
|
var localNav = new Popup($('#localNav'));
|
// 充放电弹出框设置
|
$(function() {
|
// 初始化localNav弹出框
|
$('#localNav').find('.close').bind('click', function() {
|
localNav.hidePopup(); // 隐藏localNav弹出框和遮罩层
|
});
|
|
// 窗口大小改变
|
$(window).resize(function() {
|
localNav.hidePopup();
|
});
|
});
|
|
|
// 设置echarts对象
|
var specialMonVolLine;
|
var specialGroupVolLine;
|
var specialCurrLine;
|
|
// 设置特殊设备图表配置项
|
var specailMonVolOpts = {
|
tname: '单体电压折线图',
|
unit: '(V)',
|
sdata: [],
|
group: 'specialGroup'
|
}; // 单体电压
|
|
var specailMonCapBarOpts = {
|
tname: '单体实际容量柱状图',
|
unit: '(AH)',
|
sdata: [],
|
}; // 单体电压
|
|
var specialGroupVolOpts = {
|
tname: '组端电压折线图',
|
unit: '(V)',
|
group: 'specialGroup'
|
};
|
|
var specialCurrOpts = {
|
tname: '单体测试电流折线图',
|
unit: '(A)',
|
group: 'specialGroup'
|
};
|
;(function(){
|
var eSpecialMonVolLine = document.getElementById("specialMonVolLine");
|
specialMonVolLine = echarts.init(eSpecialMonVolLine);
|
|
var eSpecialGroupVolLine = document.getElementById("specialGroupVolLine");
|
specialGroupVolLine = echarts.init(eSpecialGroupVolLine);
|
|
var eSpecialCurrLine = document.getElementById("specialCurrLine");
|
specialCurrLine = echarts.init(eSpecialCurrLine);
|
|
var eSpecialMonCapBar = document.getElementById("specialMonCapBar");
|
specialMonCapBar = echarts.init(eSpecialMonCapBar);
|
|
cSpecailGraphLine();
|
createSpecialGraphBar(specialMonCapBar, specailMonCapBarOpts);
|
})();
|
|
// 重置特殊图表的大小
|
function resizeSpecailGraph() {
|
specialMonVolLine.resize();
|
specialMonCapBar.resize();
|
specialGroupVolLine.resize();
|
specialCurrLine.resize();
|
}
|
|
// 生成特殊设备的折线图
|
function cSpecailGraphLine() {
|
createSpecialGraphLine(specialMonVolLine, specailMonVolOpts);
|
createSpecialGraphLine(specialGroupVolLine, specialGroupVolOpts);
|
createSpecialGraphLine(specialCurrLine, specialCurrOpts);
|
|
echarts.connect('specialGroup');
|
resizeSpecailGraph();
|
}
|
|
// 显示单体实际容量柱状图
|
function onlyShowBar(bool) {
|
if(bool) {
|
$('#specialMonCapBar').parent().addClass('graph-full-absolute');
|
specailMonCapBarOpts = $.extend({}, specailMonCapBarOpts, {
|
xdata: [],
|
sdata: [],
|
lname: []
|
});
|
createSpecialGraphBar(specialMonCapBar, specailMonCapBarOpts);
|
|
initSpecialGraphLine();
|
}else {
|
$('#specialMonCapBar').parent().removeClass('graph-full-absolute');
|
$('#specialGraphExport').removeClass('whyc-btn-disabled');
|
}
|
|
resizeSpecailGraph();
|
}
|
|
// 给页面添加等待内容
|
$(document).ready(function() {
|
// 给页面添加等待内容
|
searchAllBattNum($('#batt_group_num'));
|
loading.showLoading($('#charge_sec_infor'));
|
|
clearfourPicture();
|
});
|
|
function getQueryString(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null)
|
return unescape(r[2]);
|
return null;
|
}
|
|
//查询所有下拉菜单
|
function findBattin(){
|
$.post("BattInfAction_findMenu", null, function(data) {
|
//data = eval("(" + data + ")");
|
data = data.result;
|
data=eval("("+data+")");
|
//console.info(data);
|
if(data.code==1 && data.data.length>0){
|
data=data.data;
|
//battinlist = data;
|
//console.info(battinlist);
|
//alert(battinlist.length);
|
//createMenu();
|
}
|
});
|
}
|
|
function Inornot(arr,name,length){
|
var flag=false;
|
for(var i=0;i<length;i++){
|
//alert(arr[i]+"&&"+name);
|
if(arr[i]==name){
|
flag=true;
|
break;
|
}
|
}
|
return flag;
|
}
|
|
var Rtdatalist;
|
var BattGroupId=0;
|
var fir_index=0,sec_index=0;
|
var firarr=new Array();
|
var secarr=new Array();
|
//var time;
|
|
var MenuList=new Array();
|
var menu_index=0;
|
//生成下拉菜单
|
function createMenu() {
|
if (battinlist.length > 0) {
|
var Olside = document.getElementById("lside");
|
Olside.innerHTML = "";
|
var ul = createEle("ul");
|
//console.info(battinlist[0]);
|
for ( var i = 0; i < battinlist.length; i++) {
|
if(fir_index>0 && Inornot(firarr, battinlist[i].StationName,fir_index)){
|
continue;
|
}
|
|
//console.info(battinlist[i]);
|
var li1 = createEle("li");
|
var a1 = createEle("a");
|
//console.info(battinlist[i]);
|
a1.innerHTML ="<strong class='arrow down'></strong>"+battinlist[i].StationName;
|
a1.setAttribute("class", "fir");
|
//设置a标签的class改为class="fir"
|
a1.setAttribute("id",battinlist[i].StationName);
|
a1.setAttribute("name",battinlist[i].StationId);
|
|
firarr[fir_index++]=battinlist[i].StationName;
|
|
MenuList[menu_index]=new Array();
|
MenuList[menu_index][0]=battinlist[i].StationId;
|
MenuList[menu_index][1]=battinlist[i].StationName;
|
MenuList[menu_index++][2]=0;
|
|
ul1 = createEle("ul");
|
secarr=new Array();
|
for(var j=i;j<battinlist.length;j++){
|
if(battinlist[j].StationName!=battinlist[i].StationName){
|
continue;
|
}
|
if(sec_index>0 && Inornot(secarr, battinlist[j].BattGroupName1,sec_index)){
|
continue;
|
}
|
li2 = createEle("li");
|
a2 = createEle("a");
|
|
a2.innerHTML =$.trim(battinlist[j].BattGroupName1).length==0?"":"<strong class='mark'>+</strong>"+ battinlist[j].BattGroupName1;
|
secarr[sec_index++]=battinlist[j].BattGroupName1;
|
a2.setAttribute("class", "sec");
|
//设置a标签的class改为class="sec"
|
a2.setAttribute("id",battinlist[j].StationId);
|
a2.setAttribute("value",battinlist[j].StationName);
|
ul2 = createEle("ul");
|
|
if($.trim(battinlist[j].BattGroupName1).length == 0){
|
MenuList[menu_index]=new Array();
|
MenuList[menu_index][0]=battinlist[j].StationId;
|
MenuList[menu_index++][1]=battinlist[j].BattGroupName1;
|
|
//console.info(MenuList);
|
}
|
|
for ( var k = 0; k < battinlist.length; k++) {
|
if (battinlist[i].StationName == battinlist[k].StationName && battinlist[j].BattGroupName1 == battinlist[k].BattGroupName1) {
|
var li3 = createEle("li");
|
var a3 = createEle("a");
|
a3.innerHTML = battinlist[k].BattGroupName;
|
a3.setAttribute("class", "thr");
|
a3.setAttribute("id",battinlist[k].BattGroupId);
|
a3.setAttribute("value",battinlist[k].BattGroupName1);
|
|
MenuList[menu_index]=new Array();
|
MenuList[menu_index][0]=battinlist[k].StationId;
|
MenuList[menu_index][1]=battinlist[k].BattGroupName;
|
MenuList[menu_index][2]=battinlist[k].BattGroupName1;
|
MenuList[menu_index++][3]=battinlist[k].BattGroupId;
|
//设置a标签的class改为class="thr"
|
li3.appendChild(a3);
|
ul2.appendChild(li3);
|
}
|
}
|
|
li2.appendChild(a2);
|
li2.appendChild(ul2);
|
ul1.appendChild(li2);
|
}
|
li1.appendChild(a1);
|
li1.appendChild(ul1);
|
ul.appendChild(li1);
|
}
|
Olside.appendChild(ul);
|
clearSec();
|
}
|
|
// 对空白的二级导航进行清理
|
function clearSec() {
|
$('#lside').find('.sec').each(function(){
|
if($(this).text().trim().length == 0) {
|
$(this).hide();
|
}
|
});
|
}
|
|
//使拖拉的块(#r_b)一直处在div的可视区域
|
$(document).ready(function(){
|
$("#lside").scroll(function(){
|
var scrollHeight=$("#lside").scrollTop(); //获取滚动条滚动的高度
|
// console.info(scrollHeight);
|
var scrollWidth=$("#lside").scrollLeft(); //获取滚动条滚动的宽度
|
// console.log(scrollWidth);
|
$("#r_b").css("top",scrollHeight); //设置(上下)拖拉块的位置
|
$("#r_b").css("right",-scrollWidth);
|
});
|
});
|
|
|
|
//动态的设置左导航的高度
|
$(document).ready(function(){
|
var rHeight=$("#rside").height();
|
var batt_listen = $('#ele_content .batt-listen').height();
|
|
$("#lside").css("height",rHeight-30 -batt_listen+"px");
|
|
});
|
|
//初始化左导航
|
$(document).ready(function(){
|
//console.info(2222);
|
//根据域名中传递过来的battgroupid找到指定的电池组
|
var thr_id=getQueryString("battgroupId");
|
var thrEle = $('.thr:first');
|
if(thr_id!=undefined){
|
BattGroupId=thr_id;
|
//获得一级菜单并展示二级菜单
|
var secTag =$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().next();
|
var secTagA = $('#'+thr_id).parent().parent().siblings().first();
|
//console.info(secTagA.text()+'******');
|
if(secTagA.text().trim().length == 0) {
|
secTagA.hide();
|
}
|
secTag.show();
|
//$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().next().show();
|
//获得二级菜单并展示三级菜单
|
thrEle = $('#'+thr_id);
|
$('#'+thr_id).parent().parent().siblings().first().next().show();
|
$('#'+thr_id).css('background-color','#9bbaf3');
|
//一级菜单展开样式
|
$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').removeClass("down");
|
$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').addClass("up");
|
$('#'+thr_id).parent().parent().siblings().first().children('.mark').text('-');
|
$('#'+thr_id).parent().parent().siblings().first().children('.mark').addClass('black');
|
//alert($('#'+thr_id).parent().parent().siblings().first().text());
|
location.hash="#"+thr_id;
|
location.hash = '';
|
}else{
|
$('.fir:first').next().css('display','block');
|
$('.sec:first').next().css('display','block');
|
$('.thr:first').css('background-color','#9bbaf3');
|
$('#address_infor').text($('.fir:first').text()+"-"+$('.sec:first').text()+"-"+$('.thr:first').text());
|
|
//初始化内容
|
$(".arrow").eq(0).removeClass("down");
|
$(".arrow").eq(0).addClass("up");
|
$(".mark").eq(0).text("-");
|
$(".mark").eq(0).addClass("black");
|
BattGroupId=$('.thr:first').attr("id");
|
}
|
for(var i=0;i<$('.fir:first').next().children().length;i++)
|
{
|
if($('.fir:first').next().children().eq(i).children().eq(0).text()=='')
|
{
|
$('.fir:first').next().children().eq(i).children().eq(0).css('display','none');
|
}
|
}
|
|
var fbsId = thrEle.attr('fbs');
|
var isSpecial = regFbsId(fbsId);
|
if(isSpecial) {
|
$('.special-mon-data').addClass('show');
|
var temp = {
|
BattGroupId:$(this).attr("id")
|
};
|
//SearchLD9Maininfo(temp);
|
searchMonTestInfo(temp);
|
resizeSpecailGraph();
|
}else {
|
findBattinfObj();
|
AllBataDate=new Array();
|
clearfourPicture();
|
findBatttestdata_infByBattGroupId();
|
searchAll_lowAction(); //获取阀值
|
}
|
|
});
|
|
//屏蔽浏览器右键菜单功能
|
$(document).ready(function(){
|
document.oncontextmenu=function(){
|
return false;
|
};
|
});
|
// 菜单栏鼠标右键菜单显示
|
$(document).ready(function(){
|
$('.thr').mousedown(function(e){
|
//利用jquery的方式获取当前点击的是否是右键
|
if(e.which==3)
|
{
|
BattGroupId=$(this).attr("id");
|
var disX=(e||event).clientX+10; //得到鼠标点击X的位置
|
var disY=(e||event).clientY+10; //得到鼠标点击Y的位置
|
var scrollY=$(document).scrollTop(); //获取浏览器滚动的高度
|
|
var oRightMenu=document.getElementById("right_menu");
|
$(this).click();
|
|
//显示菜单内容
|
$("#right_menu").show();
|
$("#right_menu .more_menu").hide();
|
//使菜单跟随鼠标位置
|
oRightMenu.style.left=disX+'px';
|
oRightMenu.style.top=disY+scrollY+'px';
|
|
setPosition($("#right_menu"),disX, disY);
|
}
|
});
|
|
//利用not选中器使不是点击.thr时就隐藏菜单
|
$("body:not('.thr')").click(function(){
|
if($("#right_menu").is(':hidden') && $("#echarts_menu").is(':hidden') && $("#bigecharts_menu").is(':hidden'))
|
{ //屏蔽浏览器右键菜单功能
|
document.oncontextmenu=function(){
|
return false;
|
};
|
}else{
|
//隐藏右键菜单
|
$("#right_menu").hide();
|
$("#echarts_menu").hide();
|
$("#bigecharts_menu").hide();
|
}
|
});
|
});
|
//使遮罩层和弹出层一直处在页面内
|
$(document).ready(function(){
|
$(document).scroll(function(){
|
var scrollY=$(document).scrollTop();
|
$('#allShade').css('top',scrollY+"px");
|
});
|
});
|
|
|
//点击返回按钮显示主页面隐藏弹出
|
$(document).ready(function(){
|
//退出电池组机历卡
|
$('#out_card_infor').click(function(){
|
$('#card_infor').hide(); //隐藏电池组机利卡
|
$('#allShade').hide();
|
});
|
//退出上传FBO和IDE数据
|
$('#out_upload_fbo').click(function(){
|
$('#upload_fbo').hide(); //隐藏上传
|
$('#allShade').hide();
|
});
|
//退出搜索机房或电池组
|
$('#out_search').click(function(){
|
$('#search_room').hide();
|
$('#allShade').hide();
|
$('#search_input').val('');
|
document.getElementById("search_info").innerHTML="";
|
});
|
});
|
//显示和隐藏查询选项事件
|
$(document).ready(function(){
|
//点击上传FBO和IDE数据内的显示和隐藏
|
$("#upload_fbo p").click(function(){
|
$("#upload_fbo .show_hide_opt").slideToggle(1000);
|
});
|
});
|
|
}
|
|
//创建指定的小图
|
function createallpicture(){
|
if($('#big_echarts').css("display")=='block'){
|
showBigPicture();
|
}else{
|
var checkvalue=$("#charge_select_type option:selected").val();
|
if(checkvalue=='Resistance-conductivity'){
|
CreateResEchart('ResEchart',oLTop,Monnum_list,monres_list,Restitle);
|
CreateSerpercentChart("mySerpercentChart",oRTop,Monnum_list,percentage_list,Serpercenttitle);
|
CreateMonEchart('MonEchart',oLBottom,Monnum_list,mon_vol_list,Montitle);
|
CreateSerEchart('SerEchart',oRBottom,Monnum_list,monser_list,Sertitle);
|
}else{
|
createEchartBar(AllData,slide_index,li_index);
|
//var title=getTitle(allMonVol[allMonVol.length-1],"Voltage");
|
//CreateEchart(oLBottom,Voltage,Monnum_list,allMonVol[slide_index],title); //生成左下条形图
|
CreateLineEchartTop('myLineChartTop',oLTop,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname); //生成左上折线图
|
CreateRightLineEchart('myRightLineChart',rtop, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname); //生成右上折线图
|
UpdatamyLineChart(checkArray);
|
}
|
}
|
}
|
|
|
//根据当前选中的三级菜单查询其相关信息
|
function findBattinfObj(){
|
if(battinlist!=undefined && battinlist.length>0){
|
|
for(var i=0;i<battinlist.length;i++){
|
if(battinlist[i].BattGroupId==BattGroupId){
|
BattinfObj=battinlist[i];
|
break;
|
}
|
}
|
}else{
|
BattinfObj=undefined;
|
}
|
}
|
|
//根据当前放大的图表拉动页面后显示放大后的图片
|
function showBigPicture(){
|
//console.info(dbname);
|
var checkvalue=$("#charge_select_type option:selected").val();
|
if(dbname=="ltop"){
|
if(checkvalue=='Resistance-conductivity'){
|
CreateResEchart('BigResEchart',big_echarts_container,Monnum_list,monres_list,Sertitle);
|
}else{
|
CreateLineEchartTop('mybigLineChartTop',obig_echarts_container,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname); //生成左上折线图
|
}
|
}else if(dbname=="rtop"){
|
if(checkvalue=='Resistance-conductivity'){
|
CreateSerpercentChart('mybigSerpercentChart',obig_echarts_container,Monnum_list,percentage_list,Serpercenttitle);
|
}else{
|
CreateRightLineEchart('mybigRightLineChart',obig_echarts_container, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname); //生成右上折线图
|
}
|
}else if(dbname=="lbottom"){
|
if(checkvalue=='Resistance-conductivity'){
|
CreateMonEchart('BigMonEchart',obig_echarts_container,Monnum_list,mon_vol_list,Montitle);
|
}else{
|
//console.info(Monnum_list);
|
CreateBigEchart(obig_echarts_container,Voltage,Monnum_list,Monvol_list,Titleobj.getAllTile("Voltage")); //生成左下条形图
|
}
|
}else if(dbname=="rbottom"){
|
if(checkvalue=='Resistance-conductivity'){
|
CreateSerEchart('BigSerEchart',obig_echarts_container,Monnum_list,monser_list,Sertitle);
|
}else{
|
UpdatamyLineChart(checkArray);
|
}
|
}
|
}
|
|
//初始化页面解决页面的bug
|
$(document).ready(function(){
|
$("#lside").scrollTop(0); //初始化左导航上下滑动的位置
|
$("#lside").scrollLeft(0); //初始化左导航左右滑动的位置
|
});
|
|
// 点击右下折线图右键菜单切换单体温度和电压
|
$(function() {
|
// 单体电压
|
$('#echarts_menu .mon-vol-line').click(function() {
|
//alert('1234566777')
|
var max = getMaxFromArr(batt_test_voldata);
|
var min = getMinFromArr(batt_test_voldata);
|
var new_Monnum_list = getArrByStatus(Monnum_list);
|
var new_batt_test_voldata = getArrByStatus(batt_test_voldata);
|
CreateLineEchart('myLineChart',oRBottom,new_Monnum_list,TestTime,new_batt_test_voldata,max,min,thrname, 'V'); //生成右下折线图
|
var opt = myLineChart.getOption();
|
//console.info(opt.title);
|
opt.title[0].text = '单体电压折线图';
|
myLineChart.setOption(opt);
|
$('#lineStatus').val('0');
|
});
|
|
// 单体温度
|
$('#echarts_menu .mon-tmp-line').click(function() {
|
//alert('12345667');
|
var max = getMaxFromArr(batt_test_tmpdata);
|
var min = getMinFromArr(batt_test_tmpdata);
|
var new_Monnum_list = getArrByStatus(Monnum_list);
|
var new_batt_test_tmpdata = getArrByStatus(batt_test_tmpdata);
|
CreateLineEchart('myLineChart',oRBottom,new_Monnum_list,TestTime,new_batt_test_tmpdata,max,min,thrname, '℃'); //生成右下折线图
|
var opt = myLineChart.getOption();
|
//console.info(opt.title);
|
opt.title[0].text = '单体温度折线图';
|
opt.yAxis[0].name = 'y(℃)';
|
myLineChart.setOption(opt);
|
$('#lineStatus').val('1');
|
});
|
});
|
|
var batttext_type = ['核容放电','监测放电','核容充电','监测充电'];
|
//根据电池组id查询电池的测试信息
|
function findBatttestdata_infByBattGroupId(){
|
var batt = getBattinfById();
|
var temp = {
|
num:batt.FBSDeviceId,
|
BattGroupId:BattGroupId
|
};
|
//console.info(BattGroupId);
|
$ajax("post","Batttestdata_infAction_searchBattTestInfDataById","json="+JSON.stringify(temp),function(data){
|
data=eval("("+data+")");
|
//console.info(data.result);
|
data=data.result;
|
data=eval("("+data+")");
|
//console.info(data);
|
var Ocharge_sec_infor=document.getElementById("charge_sec_infor");
|
Ocharge_sec_infor.innerHTML="";
|
|
if(data.code==1 && data.data.length>0){
|
data=data.data;
|
var temp = checktestRecord(data);
|
collapse($('#charge_sec_infor'), temp);
|
if(showMonitorDis) {
|
// 遍历列表
|
$('#charge_sec_infor .monitor-discharge-content').find('a').each(function(i) {
|
var value = $(this).attr('value');
|
if(value == showMonitorDis) {
|
$('#charge_sec_infor .monitor-discharge').click();
|
$(this).dblclick();
|
var scrollTop = i*32+50; // 滚动指定的高度
|
setTimeout(function() { // 设置延时滚动
|
$('#charge_sec_infor').scrollTop(scrollTop);
|
}, 1000);
|
|
}
|
});
|
showMonitorDis = false;
|
}
|
// console.log(showMonitorDis);
|
/* collapse($('#special-charge-infor .mon-data-content'), temp); */
|
}else{
|
var temp = checktestRecord(new Array());
|
collapse($('#charge_sec_infor'), temp);
|
AllBataDate=undefined;
|
}
|
//setbackground();
|
});
|
}
|
|
function checktestRecord(list){
|
var temp = new Array();
|
//console.info(list);
|
var jienengDisCobj = {
|
title:'核容放电',
|
items:new Array()
|
};
|
var tingdianDisCobj = {
|
title:'监测放电',
|
items:new Array()
|
};
|
var jienengCobj = {
|
title:'核容充电',
|
items:new Array()
|
};
|
var tingdianCobj = {
|
title:'监测充电',
|
items:new Array()
|
};
|
|
for(var i =0 ;list!=undefined && i<list.length;i++){
|
if(list[i].test_type == 3){
|
if(list[i].test_starttype == 3){
|
//节能放电
|
jienengDisCobj.items.push({
|
txt:list[i].test_starttime,
|
cla: '',
|
val:list[i].test_record_count,
|
stop:list[i].test_stoptype_reason
|
});
|
}else{
|
//停电放电
|
tingdianDisCobj.items.push({
|
txt:list[i].test_starttime,
|
cla: 'monitor-discharge',
|
val:list[i].test_record_count,
|
stop:list[i].test_stoptype_reason
|
});
|
}
|
}else if(list[i].test_type == 2){
|
if(list[i].test_starttype == 3){
|
//节能充电
|
jienengCobj.items.push({
|
txt:list[i].test_starttime,
|
cla: '',
|
val:list[i].test_record_count,
|
stop:list[i].test_stoptype_reason
|
});
|
}else{
|
//停电充电
|
tingdianCobj.items.push({
|
txt:list[i].test_starttime,
|
cla: '',
|
val:list[i].test_record_count,
|
stop:list[i].test_stoptype_reason
|
});
|
}
|
}
|
}
|
if($('#charge_select_type').val() == 'charge-discharge'){
|
temp.push(jienengDisCobj);
|
temp.push(tingdianDisCobj);
|
temp.push(jienengCobj);
|
temp.push(tingdianCobj);
|
}else if($('#charge_select_type').val() == 'charge'){
|
temp.push(jienengCobj);
|
temp.push(tingdianCobj);
|
}else if($('#charge_select_type').val() == 'discharge'){
|
temp.push(jienengDisCobj);
|
temp.push(tingdianDisCobj);
|
}
|
//console.info(temp);
|
return temp;
|
}
|
|
$(document).ready(function(){
|
$("#charge_sec_infor").on('dblclick','li a',function(){
|
var AllCheck=$("#charge_thr_th input[type='checkbox']");
|
// 初始化echarts图表内容
|
$('#lineStatus').val('0');
|
li_index = 0;
|
AllCheck.checked="checked";
|
var selectvalue=$("#charge_select_type option:selected").val();
|
if(selectvalue=='Resistance-conductivity'){
|
findbattredata($(this).attr('value'));
|
}else{
|
if($(this).text().indexOf("放电")>=0){
|
$('#ele_state').attr('stop',$(this).attr('stop'));
|
}else if($(this).text().indexOf("充电")>=0){
|
$('#ele_state').attr('stop',"");
|
}
|
var batt = getBattinfById();
|
isCanExport = true;
|
loading.showLoading($('#r_echarts'));
|
createPicture($(this).attr('value'));
|
findtestdatastop($(this).attr('value'));
|
$('#slider').slider({
|
value: 100
|
});
|
|
// 设置当前的数据是第几笔
|
$('#testrecordcout').val($(this).attr('value'));
|
}
|
});
|
|
// 点击确定禁用
|
myConfirm.confirm.on('click', '.show-historydata', function() {
|
var moncapstd = myConfirm.confirm.find('.batt-moncapstd').val();
|
var batt_testrecordcout =$('#testrecordcout').val();
|
if(moncapstd > 0){
|
isCanExport = true;
|
//createWait($('#r_echarts'));
|
var batt = getBattinfById();
|
batt.MonCapStd = moncapstd;
|
|
// 根据当前是第几笔数据,更新图表
|
if(batt_testrecordcout != -1) {
|
// li_index=0; // 初始化右键下标
|
loading.showLoading($('#r_echarts'));
|
createPicture(batt_testrecordcout);
|
findtestdatastop(batt_testrecordcout);
|
$('#slider').slider({
|
value: 100
|
});
|
}
|
|
}
|
myConfirm.hide();
|
});
|
});
|
|
$("#charge_sec_infor").on("click","li",function(){
|
$("#charge_sec_infor li").css("background-color","");
|
$(this).css("background-color","#9bbaf3");
|
});
|
|
|
|
|
//查询指定的电池组id下指定测试次数的测试数据
|
/* function createPicture(record_count){
|
//alert(record_count);
|
$ajax("post","BatttestdataAction_findByInfo","btd.BattGroupId="+BattGroupId+"&btd.test_record_count="+record_count, function(data){
|
data=eval("("+data+")");
|
data=data.result;
|
data=eval("("+data+")");
|
if(data.code==1){
|
data=data.data;
|
AllTestData=data;
|
//console.info(AllTestData);
|
formatAlldata();
|
}
|
});
|
} */
|
//查询指定的电池组id下指定测试次数的测试数据
|
function createPicture(record_count){
|
$.ajax({
|
type: "post",
|
url: "BatttestdataAction!findhistory",
|
async:true,
|
dataType:'text',
|
data:"json="+JSON.stringify({
|
BattGroupId:BattGroupId,
|
test_record_count:record_count
|
}),
|
success: function(data){
|
data = eval("("+data+")");
|
var model = eval("("+data.result+")");
|
//console.info(model);
|
if(model.code==1){
|
data=model.data;
|
AllTestData = model.data;
|
//console.info("data:xx");
|
//console.info(data);
|
//console.info(AllTestData);
|
formatAlldata(); // 格式化数据并根据数据生成特定额内容
|
searchBattresdata();
|
}
|
loading.hideLoading($('#r_echarts'));
|
},
|
error:function(){
|
noContent.showNoContent("查询失败,请检查网络连接!");
|
loading.hideLoading($('#r_echarts'));
|
}
|
});
|
|
}
|
|
|
var batt_res_list = new Array();
|
//查询电池组的内阻
|
function searchBattresdata(){
|
batt_res_list = new Array();
|
$.ajax({
|
type: "post",
|
url: "Batt_rtdataAction!serchResById",
|
async:true,
|
dataType:'text',
|
data:"json="+JSON.stringify({
|
BattGroupId:BattGroupId,
|
}),
|
success: function(data){
|
data = eval("("+data+")");
|
var model = eval("("+data.result+")");
|
//console.info(model);
|
for(var i=0;i<model.data.length;i++){
|
batt_res_list.push(model.data[i].mon_res.toFixed(3));
|
}
|
},
|
error:function(){
|
|
}
|
});
|
}
|
|
|
//更新电池组状态栏
|
function reflushBattStatus(list){
|
//console.info(list);
|
var checkvalue=$("#charge_select_type option:selected").val();
|
var ele_state=document.getElementById("ele_state"); //电池状态 充电;放电;...
|
var ele_tension = document.getElementById("ele_tension"); //组端电压
|
var ele_current=document.getElementById("ele_current"); //电池电流
|
var test_date=document.getElementById("test_date"); //测试日期
|
var test_time=document.getElementById("test_time"); //测试时长
|
var test_content=document.getElementById("test_content"); //测试容量
|
var over_content=document.getElementById("over_content"); //剩余容量
|
var reserve_time=document.getElementById("reserve_time"); //后备时间
|
var top_cause = $('#ele_state').attr('stop');
|
if(list!=undefined && checkvalue!="Resistance-conductivity"){
|
//console.info(list);
|
//ele_state.value=list.test_type==3?discharging:list.test_type==2?charging:"else";
|
//console.info(list.test_type+"======"+top_cause);
|
ele_state.value = list.test_type==3?getStopCause('放电', top_cause):list.test_type==2?charging:"else";
|
ele_tension.value="在线:"+list.online_vol.toFixed(2)+"V;"+"组端:"+list.group_vol.toFixed(2)+"V";
|
ele_current.value=list.test_curr.toFixed(1)+"A";
|
test_date.value=list.test_starttime;
|
test_time.value=formatSeconds(list.test_timelong);
|
test_content.value=list.test_cap.toFixed(1)+"AH";
|
|
|
var battinf=getBattinfById();
|
var arr = batt_test_data[slide_index];
|
//console.info("MonCapStd:"+battinf.MonCapStd+";test_curr:"+list.test_curr+";test_cap:"+list.test_cap+";maxvol:"+Math.max.apply(null, Monvol_list)+";minvol:"+Math.min.apply(null, Monvol_list)+";monvolstd:"+battinf.MonVolStd);
|
//console.info(list);
|
var avg_curr = list.test_timelong>0?list.test_cap*3600/list.test_timelong:list.test_curr;
|
var over_cap=GetMonomerCap(battinf.MonCapStd,GetHourRate(battinf.MonCapStd,avg_curr),list.test_cap,Math.max.apply(null, arr),Math.min.apply(null, arr),battinf.MonVolStd,CapType_Rest);
|
//console.info(over_cap);
|
if(list.test_type == 2){
|
over_content.value="---";
|
}else{
|
over_content.value=over_cap.toFixed(1)+"AH";
|
}
|
reserve_time.value=formatTime1(GetRestTimeSecond(over_cap,list.test_curr).toFixed(0));
|
//alert(formatTime1(120));
|
}else if(list != undefined && checkvalue=="Resistance-conductivity"){
|
//当选中的是电阻电导数据时
|
//console.info(list);
|
ele_state.value=list.MonCount;
|
ele_tension.value=list.MonVolStd.toFixed(1)+"V";
|
ele_current.value=list.MonCapStd+"A";
|
test_date.value=list.MonResStd.toFixed(3)+"mΩ";
|
test_time.value=list.MonSerStd;
|
test_content.value=list.BattProducer;
|
over_content.value=list.BattInUseDate;
|
reserve_time.value="";
|
}else{
|
|
ele_state.value="";
|
ele_tension.value="";
|
ele_current.value="";
|
test_date.value="";
|
test_time.value="";
|
test_content.value="";
|
over_content.value="";
|
reserve_time.value="";
|
|
}
|
}
|
|
var oChargeThrInfor=document.getElementById("charge_thr_infor");
|
var batteststopDataList = new Array();
|
//根据指定的测试数据查询结束时的指定电池组的数据
|
function findtestdatastop(record_count){
|
Monnum_list = new Array(); //初始化电池编号数组
|
Monvol_list = new Array(); //初始化电池电压数组
|
checkArray = new Array();
|
var arr = new Array();
|
var batt = getBattinfById();
|
//console.info(batt);
|
for(var i=0;i<batt.MonCount;i++){
|
Monnum_list[i]="#"+(i+1);
|
Monvol_list[i]= (0).toFixed(3);
|
checkArray.push(1);
|
arr[i] = (0).toFixed(3);
|
}
|
$ajax("post","BatttestdatastopAction_findByInfo","btds.BattGroupId="+BattGroupId+"&btds.test_record_count="+record_count, function(data){
|
data=eval("("+data+")");
|
data=data.result;
|
data=eval("("+data+")");
|
//console.info(data);
|
if(data.code==1){
|
data=data.data;
|
batteststopDataList = data;
|
//console.info(batt);
|
var moncount = batt.MonCount;
|
for(var i=0;i<moncount;i++){
|
Monnum_list[i]="#"+(i+1);
|
if(data[i] != undefined){
|
Monvol_list[i]=data[i].mon_vol.toFixed(3);
|
}else{
|
Monvol_list[i]= (0).toFixed(3);
|
}
|
arr[i]=Monvol_list[i];
|
}
|
|
//console.info(arr);
|
//console.info(arrTh[li_index]);
|
$('#charge_thr_th').find('tr th').eq(1).text(arrTh[li_index]);
|
//updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
|
//reflushBattStatus(data[0]);
|
}else{
|
var obj = getBattinfById();
|
for(var i = 1;i<=obj.MonCount;i++){
|
Monnum_list[i-1] = "#"+i;
|
}
|
}
|
createBattVoltable(arr);
|
});
|
|
|
|
|
//选中th内的复选框表格内的复选框都选中
|
$(document).ready(function(){
|
var aInput=oChargeThrInfor.getElementsByTagName("input");
|
//初始化input
|
for(var i=0;i<aInput.length;i++)
|
{
|
aInput[i].checked=true;
|
}
|
//定义如果th内的复选框被选中则表格内的全部被选中否则全部取消
|
function CheckAll(){
|
if(aInput[0].checked==true)
|
{
|
for(var i=1;i<aInput.length;i++)
|
{
|
aInput[i].checked=true;
|
}
|
}else{
|
for(var i=1;i<aInput.length;i++)
|
{
|
aInput[i].checked=false;
|
}
|
}
|
}
|
aInput[0].onclick=CheckAll;
|
});
|
}
|
|
/* var arrTh=[
|
"单体电压(V)",
|
"实际容量(AH)",
|
"剩余容量(AH)",
|
"容量百分比(%)",
|
]; */
|
var arrTh=[
|
"<s:text name='Monomer_voltage'/>(V)",
|
"单体温度(℃)",
|
"<s:text name='Actual_capacity'/>(AH)",
|
"<s:text name='Residual_capacity'/>(AH)",
|
"<s:text name='Percent_total_capacity'/>(%)",
|
];
|
|
var checkArray; //复选框的选中数组
|
function createBattVoltable(data){
|
if(data!=undefined){
|
$('#charge_thr_infor tbody').text(" ");
|
Ot_top.innerHTML="";
|
for(var i=0;i<data.length;i++){
|
|
var tr=createEle("tr");
|
var td1=createEle("td");
|
var td2=createEle("td");
|
var td3=createEle("td");
|
|
td1.innerHTML=i+1;
|
td2.innerHTML=data[i];
|
if(checkArray[i]==1){
|
td3.innerHTML='<input type="checkbox" checked="checked"/>';
|
}else{
|
td3.innerHTML='<input type="checkbox"/>';
|
}
|
|
tr.appendChild(td1);
|
tr.appendChild(td2);
|
tr.appendChild(td3);
|
|
Ot_top.appendChild(tr);
|
}
|
|
|
|
//checkArray=new Array(); //根据数组内的值判断是否显示折线1为显示
|
//根据复选框更新图表内容
|
$(document).ready(function(){
|
var myCheckbox=$("#t_top input[type='checkbox']");
|
var AllCheck=$("#charge_thr_th th input[type='checkbox']");
|
// console.log(AllCheck.length);
|
|
myCheckbox.click(function(){
|
for(var i=0;i<myCheckbox.length;i++)
|
{
|
if(myCheckbox.eq(i).is(':checked'))
|
{
|
checkArray[i]=1;
|
}else{
|
checkArray[i]=0;
|
}
|
}
|
UpdatamyLineChart(checkArray);
|
});
|
AllCheck.click(function(){
|
myCheckbox=$("#t_top input[type='checkbox']");
|
if(myCheckbox.length == 0) {
|
return;
|
}
|
if(AllCheck.is(':checked'))
|
{
|
for(var i=0;i<myCheckbox.length;i++)
|
{
|
checkArray[i]=1;
|
}
|
}else{
|
for(var i=0;i<myCheckbox.length;i++)
|
{
|
checkArray[i]=0;
|
}
|
}
|
//console.info(456);
|
UpdatamyLineChart(checkArray);
|
});
|
});
|
|
var vol_max=Math.max.apply(Math,data);
|
var vol_min=Math.min.apply(Math,data);
|
var ele=$('#t_top>tr');
|
//console.info("max:"+vol_max);
|
//console.info("min:"+vol_min);
|
var maxflag=true,minflag=true;
|
for(var i=0;i<data.length;i++){
|
if(vol_max==data[i] && maxflag){
|
ele.eq(i).find("td").eq(1).css("background","green");
|
maxflag=false;
|
}else if(vol_min==data[i] &&minflag){
|
ele.eq(i).find("td").eq(1).css("background","red");
|
minflag=false;
|
}
|
}
|
|
}
|
}
|
|
//根据电压表中选中的电池组显示在右下折线图中
|
function UpdatamyLineChart(arr){
|
if(arr!=undefined){
|
var lname=new Array();
|
//var sdata=getArrByCheckBox(AllData);
|
var sdata;
|
var line_status = $('#lineStatus').val();
|
if(line_status == 0) {
|
sdata = getArrayByCheck(batt_test_voldata);
|
}else {
|
sdata = getArrayByCheck(batt_test_tmpdata);
|
}
|
var lname = getArrayByCheck(Monnum_list);
|
for(var i=0;i<arr.length;i++){
|
if(arr[i]==1){
|
lname.push(Monnum_list[i]);
|
}
|
}
|
|
|
|
if($('#bigEchartsCon').css('display')=='block' && dbname=="rbottom"){
|
var bigEchartsCon= $('#bigEchartsCon').get(0);
|
//console.info(sdata);
|
CreateLineEchart('mybigLineChart',bigEchartsCon,lname,TestTime,sdata,max,min,thrname); //生成右下折线图
|
$('#bigEchartsCon').css('background-color','#fff');
|
}else{
|
max = getMaxFromArr(sdata);
|
min = getMinFromArr(sdata);
|
CreateLineEchart('myLineChart',oRBottom,lname,TestTime,sdata,max,min,thrname);
|
if(line_status != 0) {
|
var opt = myLineChart.getOption();
|
//console.info(opt.title);
|
opt.title[0].text = '单体温度折线图';
|
opt.yAxis[0].name = 'y(℃)';
|
myLineChart.setOption(opt);
|
}
|
}
|
}else{
|
CreateLineEchart('myLineChart',oRBottom,[],[],[],100,50);
|
}
|
}
|
|
function findMonCount(battGroupId){
|
if(battGroupId>0){
|
for(var i=0;i<battinlist.length;i++){
|
//console.info(battinlist[i]);
|
if(battGroupId==battinlist[i].BattGroupId){
|
return battinlist[i].MonCount;
|
}
|
}
|
}
|
return -1;
|
}
|
|
window.onload = function() {
|
//findBattin();
|
|
};
|
|
//根据电池组编号和测试次数查询电导数据
|
function findbattredata(testcount){
|
loading.showLoading($('#r_echarts'));
|
//console.info(testcount);
|
if(testcount!=undefined && BattGroupId!=undefined){
|
$.post("BattresdataAction_serchByCondition","brd.BattGroupId="+BattGroupId+"&brd.test_record_count="+testcount,function(data){
|
data=data.result;
|
data=eval("("+data+")");
|
if(data.code==1 && data.data.length>0){
|
data=data.data;
|
//console.info(data);
|
getArray(data);
|
createRestab();
|
|
CreateResEchart('ResEchart',oLTop,Monnum_list,monres_list,Restitle);
|
CreateSerpercentChart('mySerpercentChart',oRTop,Monnum_list,percentage_list,Serpercenttitle);
|
CreateMonEchart('MonEchart',oLBottom,Monnum_list,mon_vol_list,Montitle);
|
CreateSerEchart('SerEchart',oRBottom,Monnum_list,monser_list,Sertitle);
|
}
|
});
|
}else{
|
loading.hideLoading($('#r_echarts'));
|
}
|
loading.hideLoading($('#r_echarts'));
|
}
|
|
//创建制定的电导记录生成表格
|
function createRestab(){
|
var tbody=$("#charge_thr_infor .t_body")[0];
|
tbody.innerHTML="";
|
for(var i=0;i<monres_list.length;i++){
|
var tr=createEle("tr");
|
|
var td1=createEle("td");
|
var td2=createEle("td");
|
var td3=createEle("td");
|
var td4=createEle("td");
|
var td5=createEle("td");
|
var td6=createEle("td");
|
var td7=createEle("td");
|
|
td1.innerHTML=i+1;
|
td2.innerHTML=mon_vol_list[i];
|
//td2.style.backgroundColor="red";
|
if(mon_vol_list[i]==Math.min.apply(Math,mon_vol_list)){
|
td2.style.backgroundColor="red";
|
}else if(mon_vol_list[i]==Math.max.apply(Math,mon_vol_list)){
|
td2.style.backgroundColor="green";
|
}
|
td3.innerHTML=montmp_list[i];
|
if(montmp_list[i]==Math.min.apply(Math,montmp_list)){
|
td3.style.backgroundColor="red";
|
}else if(montmp_list[i]==Math.max.apply(Math,montmp_list)){
|
td3.style.backgroundColor="green";
|
}
|
td4.innerHTML=monres_list[i];
|
if(monres_list[i]==Math.max.apply(Math,monres_list)){
|
td4.style.backgroundColor="red";
|
}else if(monres_list[i]==Math.min.apply(Math,monres_list)){
|
td4.style.backgroundColor="green";
|
}
|
td5.innerHTML=monser_list[i];
|
if(monser_list[i]==Math.min.apply(Math,monser_list)){
|
td5.style.backgroundColor="red";
|
}else if(monser_list[i]==Math.max.apply(Math,monser_list)){
|
td5.style.backgroundColor="green";
|
}
|
td6.innerHTML=percentage_list[i];
|
if(percentage_list[i]==Math.min.apply(Math,percentage_list)){
|
td6.style.backgroundColor="red";
|
}else if(percentage_list[i]==Math.max.apply(Math,percentage_list)){
|
td6.style.backgroundColor="green";
|
}
|
td7.innerHTML=conn_res_list[i];
|
if(conn_res_list[i]==Math.min.apply(Math,conn_res_list)){
|
td7.style.backgroundColor="red";
|
}else if(conn_res_list[i]==Math.max.apply(Math,conn_res_list)){
|
td7.style.backgroundColor="green";
|
}
|
|
tr.appendChild(td1);
|
tr.appendChild(td2);
|
tr.appendChild(td3);
|
tr.appendChild(td4);
|
tr.appendChild(td5);
|
tr.appendChild(td6);
|
tr.appendChild(td7);
|
|
tbody.appendChild(tr);
|
}
|
}
|
|
var monres_list; //电池单体电阻数组
|
var percentage_list; //电导百分比数组
|
var mon_vol_list; //电池单体电压数组
|
var monser_list; //电池单体电导数组
|
var montmp_list; //电池单体温度数组
|
var conn_res_list; //连接条数组
|
var ResTitleobj; //内阻标题对象
|
var VolTitleobj; //单体电压对象
|
var SerTitleobj; //电导标题对象
|
var SerPerTitleobj; //电导百分比对象
|
|
function getArray(list){
|
if(list!=undefined && list.length>0){
|
monres_list=new Array();
|
percentage_list=new Array();
|
mon_vol_list=new Array();
|
montmp_list=new Array();
|
monser_list=new Array();
|
conn_res_list=new Array();
|
Monnum_list=new Array();
|
ResTitleobj=new Title(); //内阻标题对象
|
VolTitleobj=new Title(); //单体电压对象
|
SerTitleobj=new Title(); //电导标题对象
|
SerPerTitleobj=new Title(); //电导百分比对象
|
|
var index;
|
var sum_ser=0,sum_res=0;sum_respercentage=0,sum_vol=0,sum_serpercent=0;
|
var batt=getBattinfById();
|
//console.info(batt);
|
for(var i=0;i<list.length;i++){
|
index = (list[i].mon_num/10).toFixed(0)-1;
|
//Monnum_list[index]="#"+(index+1);
|
console.info(index);
|
//percentage_list[index]=list[i].conn_res.toFixed(1);
|
monres_list[index]=list[i].mon_res.toFixed(3);
|
montmp_list[index]=list[i].mon_tmp.toFixed(1);
|
mon_vol_list[index]=list[i].mon_vol.toFixed(3);
|
conn_res_list[index]=list[i].conn_res.toFixed(3);
|
monser_list[index]=list[i].mon_ser.toFixed(0);
|
percentage_list[index]=(batt.MonSerStd==0?0:((list[i].mon_ser/batt.MonSerStd)*100)).toFixed(1);
|
|
sum_ser+=parseFloat(monser_list[index]);
|
sum_res+=parseFloat(monres_list[index]);
|
sum_respercentage+=parseFloat(percentage_list[index]),
|
sum_serpercent+=parseFloat(percentage_list[index]);
|
sum_vol+=parseFloat(mon_vol_list[index++]);
|
}
|
//console.info(Monnum_list);
|
|
ResTitleobj.setMax(Math.max.apply(Math, monres_list));
|
ResTitleobj.setMin(Math.min.apply(Math, monres_list));
|
ResTitleobj.setAvg(sum_res/monres_list.length.toFixed(3));
|
var low=getLow(3,2);
|
//console.info(batt);
|
if(low.low_method==0){
|
//根据标称值计算
|
ResTitleobj.setAlow(((2-low.low_value)*batt.MonResStd).toFixed(3));
|
low=getLow(3,3);
|
ResTitleobj.setClow(((2-low.low_value)*batt.MonResStd).toFixed(3));
|
}else{
|
//根据平均值计算
|
ResTitleobj.setAlow(((2-low.low_value)*ResTitleobj.getAvg()).toFixed(3));
|
low=getLow(3,3);
|
ResTitleobj.setClow(((2-low.low_value)*ResTitleobj.getAvg()).toFixed(3));
|
}
|
var count=0;
|
for(var i=0;i<monres_list.length;i++){
|
if(parseFloat(ResTitleobj.getAlow())<parseFloat(monres_list[i])){
|
//console.info(title.getAlow()+"<"+array[i]);
|
count++;
|
}
|
}
|
ResTitleobj.setLc(count);
|
ResTitleobj.setLp((count*100/monres_list.length).toFixed(1));
|
//设置电电阻数据的条形图title;
|
Restitle=ResTitleobj.getAllTile("Resistance");
|
//console.info(ResTitleobj);
|
|
|
SerPerTitleobj.setMax(Math.max.apply(Math, percentage_list).toFixed(1));
|
SerPerTitleobj.setMin(Math.min.apply(Math, percentage_list).toFixed(1));
|
SerPerTitleobj.setAvg((sum_respercentage/percentage_list.length).toFixed(1));
|
var low=getLow(3,2);
|
if(low.low_method==0){
|
//根据标称值计算
|
SerPerTitleobj.setAlow((low.low_value*batt.monSerStd).toFixed(0));
|
low=getLow(3,3);
|
SerPerTitleobj.setClow((low.low_value*batt.monSerStd).toFixed(0));
|
}else{
|
//根据平均值计算
|
SerPerTitleobj.setAlow((low.low_value*SerPerTitleobj.getAvg()).toFixed(0));
|
low=getLow(3,3);
|
SerPerTitleobj.setClow((low.low_value*SerPerTitleobj.getAvg()).toFixed(0));
|
}
|
getLpLc(percentage_list,SerPerTitleobj);
|
//console.info(SerPerTitleobj);
|
//设置电电导百分比数据的条形图title;
|
Serpercenttitle=SerPerTitleobj.getAllTile("Serpercent");
|
//console.info(Serpercenttitle);
|
//Serpercenttitle="MonSerPercent:MAX="+tmax+"%;MIN="+tmin+"%;AVG="+tavg+"%;Low=;LC=;LP=";
|
|
VolTitleobj.setMax(Math.max.apply(Math, mon_vol_list));
|
VolTitleobj.setMin(Math.min.apply(Math, mon_vol_list));
|
VolTitleobj.setAvg(sum_vol/mon_vol_list.length.toFixed(3));
|
var low=getLow(1,1);
|
if(low.low_method==0){
|
//根据标称值计算
|
VolTitleobj.setAlow((low.low_value*batt.monVolStd).toFixed(3));
|
low=getLow(1,0);
|
VolTitleobj.setClow((low.low_value*batt.monVolStd).toFixed(3));
|
}else{
|
//根据平均值计算
|
VolTitleobj.setAlow((low.low_value*VolTitleobj.getAvg()).toFixed(3));
|
low=getLow(1,0);
|
VolTitleobj.setClow((low.low_value*VolTitleobj.getAvg()).toFixed(3));
|
}
|
getLpLc(mon_vol_list,VolTitleobj);
|
//设置电电压数据的条形图title;
|
Montitle=VolTitleobj.getAllTile("Voltage");
|
|
SerTitleobj.setMax(Math.max.apply(Math, monser_list));
|
SerTitleobj.setMin(Math.min.apply(Math, monser_list));
|
SerTitleobj.setAvg((sum_ser/monser_list.length).toFixed(0));
|
var low=getLow(3,2);
|
if(low.low_method==0){
|
//根据标称值计算
|
SerTitleobj.setAlow((low.low_value*batt.monSerStd).toFixed(0));
|
low=getLow(3,3);
|
SerTitleobj.setClow((low.low_value*batt.monSerStd).toFixed(0));
|
}else{
|
//根据平均值计算
|
SerTitleobj.setAlow((low.low_value*SerTitleobj.getAvg()).toFixed(0));
|
low=getLow(3,3);
|
SerTitleobj.setClow((low.low_value*SerTitleobj.getAvg()).toFixed(0));
|
}
|
getLpLc(monser_list,SerTitleobj);
|
//console.info(SerTitleobj);
|
//设置电电导数据的条形图title;
|
Sertitle=SerTitleobj.getAllTile("Conductance");
|
|
}
|
}
|
|
//根据title对象和数组获取Lplc的
|
function getLpLc(array,titleobj){
|
var count=0;
|
for(var i=0;i<array.length;i++){
|
//console.info(titleobj.getAlow()+"+++"+array[i]);
|
if(parseFloat(titleobj.getAlow())>=parseFloat(array[i])){
|
count++;
|
}
|
}
|
titleobj.setLc(count);
|
titleobj.setLp((count*100/array.length).toFixed(1));
|
}
|
|
//根据当前选中的电池组id查询当前电池组的基本信息
|
function getBattinfById(){
|
/* if(battinlist!=undefined && BattGroupId!=undefined){
|
for(var i=0;i<battinlist.length;i++){
|
for(var k=0;k<battinlist[i].length;k++){
|
if(BattGroupId==battinlist[i][k].BattGroupId){
|
return battinlist[i][k];
|
}
|
}
|
}
|
}
|
return undefined; */
|
var activeFile = $('.whyc-sider-menu .sider-menu-file.active');
|
if(activeFile.length == 1) {
|
return activeFile.data('attr');
|
}else {
|
return undefined;
|
}
|
}
|
|
function clearfourPicture(){
|
createBattVoltable(new Array()); // 清空表格
|
var checkvalue=$("#charge_select_type option:selected").val();
|
//alert(123);
|
if(checkvalue=='Resistance-conductivity'){
|
//alert(123);
|
monres_list=[];
|
percentage_list=[];
|
Monvol_list=[];
|
monser_list=[];
|
CreateResEchart('ResEchart',oLTop,[],[],'');
|
CreateSerpercentChart("mySerpercentChart",oRTop,[],[],'');
|
CreateMonEchart('MonEchart',oLBottom,[],[],'');
|
CreateSerEchart('SerEchart',oRBottom,[],[],'');
|
|
}else{
|
//alert("不是电导");
|
//CreateResEchart(oLTop,Voltage,[],[],100,0);
|
allMonVol=[];
|
BattGroupVol=[];
|
BattGroupCurr=[];
|
AllBataDate=[];
|
Monvol_list=[];
|
|
CreateEchart(oLBottom,Voltage,[],[],"",cPicker); //生成条形图
|
CreateLineEchartTop('myLineChartTop',oLTop,[], [], [[],[]],100,50); //生成左上折线图
|
CreateRightLineEchart('myRightLineChart',rtop, batt_curr, [], [], 100,0); //生成右上折线图
|
CreateLineEchart('myLineChart',oRBottom,[],[],[],100,50);
|
|
}
|
}
|
|
var RL_max; //右下最大值
|
var RL_min; //右下最小值
|
var AllData;
|
|
var batt_test_data = new Array(); //左下条形图中的所有数组
|
var batt_test_voldata = new Array(); //右下折线图中的所有数组
|
var batt_test_tmpdata = new Array(); //右下折线图中的所有数组
|
var batt_test_evary_record = new Array(); //记录当前测试记录的每笔的组端测试值
|
var batt_tmp_data = new Array(); // 所有单体的每一笔温度数据
|
//格式化从数据库中查询出来的数据
|
function formatAlldata(){
|
BattData=new Array(); //右下折线图中的所有数组
|
TestTime=new Array(); //横坐标轴
|
BattGroupVol=new Array(); //组端电压
|
BattOnlineVol = new Array(); //在线电压
|
BattGroupCurr=new Array(); //测试电流
|
Battimeinfo=new Array();
|
AllBataDate=new Array();
|
|
batt_test_data = new Array(); //左下条形图中的所有数组
|
batt_test_voldata = new Array(); //右下折线图中的单体电压所有数组
|
batt_test_tmpdata = new Array(); //右下折线图中的单体温度所有数组
|
batt_test_evary_record = new Array(); //记录当前测试记录的每笔的组端测试值
|
batt_tmp_data = new Array();
|
//console.info(AllTestData);
|
var batt = getBattinfById();
|
if(AllTestData!=undefined && AllTestData.length>0){
|
if(Monnum_list != undefined && Monnum_list.length>0){
|
AllData=new Array();
|
//console.info(Monnum_list);
|
for(var i=0;i<batt.MonCount;i++){
|
batt_test_voldata[i] = new Array();
|
batt_test_tmpdata[i] = new Array();
|
}
|
max=Number.NEGATIVE_INFINITY; //无穷小值
|
min=Number.POSITIVE_INFINITY; //无穷大值
|
var test_record_num = 0;
|
var batt_index = -1;
|
|
//console.info(Monnum_list);
|
//console.info("***************");
|
|
var start_record_num = AllTestData[0].record_num;
|
BattGroupVol[0] = new Array();
|
BattGroupVol[1] = new Array();
|
for(var i=0;i<AllTestData.length;i++){
|
if(AllTestData[i].record_num != test_record_num){
|
//console.info(AllTestData[i]);
|
BattGroupVol[0].push(AllTestData[i].online_vol.toFixed(2)); //在线电压
|
BattGroupVol[1].push(AllTestData[i].group_vol.toFixed(2)); //组端电压
|
BattGroupCurr.push(AllTestData[i].test_curr.toFixed(1)); //组端电流
|
TestTime.push(formatSeconds(AllTestData[i].test_timelong));
|
batt_test_evary_record.push(AllTestData[i]);
|
|
batt_test_data[++batt_index] = new Array();
|
test_record_num = AllTestData[i].record_num;
|
if(test_record_num > start_record_num){
|
batt_test_data[batt_index]=batt_test_data[batt_index-1].slice(0);
|
setArrayvalue(batt_test_voldata,batt_index);
|
setArrayvalue(batt_test_tmpdata,batt_index);
|
}else{
|
//第一笔充放电数据
|
var batt = getBattinfById();
|
for(var k =0;k<batt.MonCount;k++){
|
batt_test_data[0][k] = 0;
|
batt_test_voldata[k][0] = 0;
|
batt_test_tmpdata[k][0] = 0;
|
}
|
}
|
}
|
/* if(max<AllTestData[i].mon_vol){
|
max = AllTestData[i].mon_vol;
|
}
|
if(min>AllTestData[i].mon_vol){
|
min = AllTestData[i].mon_vol;
|
} */
|
//console.info(AllTestData[i]);
|
batt_test_data[batt_index][AllTestData[i].mon_num-1] = AllTestData[i].mon_vol;
|
batt_test_voldata[AllTestData[i].mon_num-1][batt_index] = AllTestData[i].mon_vol;
|
batt_test_tmpdata[AllTestData[i].mon_num-1][batt_index] = AllTestData[i].mon_tmp.toFixed(1);
|
}
|
//console.info(batt_test_tmpdata);
|
//console.info(batt_test_voldata);
|
batt_tmp_data=changeArrColAndRow(batt_test_tmpdata);
|
//console.info(batt_tmp_data);
|
}
|
|
|
slide_index=batt_test_data.length-1;
|
Monvol_list = batt_test_data[batt_test_data.length-1];
|
|
thrname="PXA "+TestTime[TestTime.length-1];
|
var title=getTitle(Monvol_list,"Voltage");
|
reflushBattStatus(AllTestData[AllTestData.length-1]);
|
|
|
//console.info(Monvol_list);
|
var tempmin = Math.floor(getMinFromArr(Monvol_list)*0.9);
|
//var tempmax = (batt.MonVolStd*1.25).toFixed(3);
|
var tempmax = Math.ceil(Math.max(getMaxFromArr(Monvol_list),batt.MonVolStd)*1.15);
|
//console.info(Math.max(tempmax,(batt.MonVolStd*1.25).toFixed(1)));
|
//console.info("tempmax:"+tempmax+"\tempmin:"+tempmin);
|
setCapList();
|
//xxxxxx
|
//CreateEchart(oLBottom,Voltage,Monnum_list,Monvol_list,title,tempmax,tempmin, cPicker);
|
//console.log(slide_index+'****'+li_index);
|
createEchartBar(AllData,slide_index,li_index);
|
//生成左下条形图
|
CreateLineEchartTop('myLineChartTop',oLTop,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname); //生成左上折线图
|
CreateRightLineEchart('myRightLineChart',rtop, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname); //生成右上折线图
|
// 根据折线图的状态值生成对应的折线
|
var line_status = $('#lineStatus').val();
|
if(line_status == 0) { // 生成单体电压折线图
|
max = getMaxFromArr(batt_test_voldata);
|
min = getMinFromArr(batt_test_voldata);
|
CreateLineEchart('myLineChart',oRBottom,Monnum_list,TestTime,batt_test_voldata,max,min,thrname, 'V'); //生成右下折线图
|
}else { // 生成单体
|
max = getMaxFromArr(batt_test_tmpdata);
|
min = getMinFromArr(batt_test_tmpdata);
|
CreateLineEchart('myLineChart',oRBottom,Monnum_list,TestTime,batt_test_tmpdata,max+20,0,thrname, '℃'); //生成右下折线图
|
var opt = myLineChart.getOption();
|
//console.info(opt.title);
|
opt.title[0].text = '单体温度折线图';
|
opt.yAxis[0].name = 'y(℃)';
|
myLineChart.setOption(opt);
|
}
|
echarts.connect('group1');
|
}else{
|
clearfourPicture();
|
}
|
|
|
//removeWait($('#main'));
|
loading.hideLoading($('#r_echarts'));
|
}
|
|
var batt_actionCap_list = new Array(); //实际容量 数组
|
var batt_restCap_list = new Array(); //剩余容量数组
|
var batt_CapPercent_list = new Array(); //容量百分比数组
|
function setCapList(){
|
if(batt_test_data!=undefined && batt_test_evary_record!=undefined){
|
var batt = getBattinfById(BattGroupId);
|
for(var i=0;i<batt_test_data.length;i++){
|
batt_actionCap_list[i] = new Array(); //实际容量 数组
|
batt_restCap_list[i] = new Array(); //剩余容量数组
|
batt_CapPercent_list[i] = new Array(); //容量百分比数组
|
var vol_list = batt_test_data[i];
|
var max_vol = Math.max.apply(null, vol_list);
|
for(var j=0;j<vol_list.length;j++){
|
//console.info(batt_test_evary_record[i]);
|
var avg_curr = batt_test_evary_record[i].test_timelong>0?batt_test_evary_record[i].test_cap*3600/batt_test_evary_record[i].test_timelong:batt_test_evary_record[i].test_curr;
|
var actionvalue = GetMonomerCap(batt.MonCapStd,GetHourRate(batt.MonCapStd,avg_curr),batt_test_evary_record[i].test_cap,max_vol,vol_list[j],batt.MonVolStd,CapType_Real);
|
var restvalue = GetMonomerCap(batt.MonCapStd,GetHourRate(batt.MonCapStd,avg_curr),batt_test_evary_record[i].test_cap,max_vol,vol_list[j],batt.MonVolStd,CapType_Rest);
|
//console.info(vol_list);
|
batt_actionCap_list[i].push(actionvalue.toFixed(0)); //实际容量 数组
|
batt_restCap_list[i].push(restvalue.toFixed(0)); //剩余容量数组
|
batt_CapPercent_list[i].push((actionvalue*100/batt.MonCapStd).toFixed(0)); //容量百分比
|
}
|
}
|
}
|
//console.info(batt_CapPercent_list);
|
}
|
|
//设置数组index处的值和上一个值
|
function setArrayvalue(list,index){
|
if(list!=undefined && index > 0){
|
for(var i=0;i<list.length;i++){
|
list[i][index] = list[i][index-1];
|
}
|
}
|
}
|
|
//获取上下左右的图表的位置
|
var oLTop=document.getElementById("ltop");
|
var oRTop=document.getElementById("rtop");
|
var oLBottom=document.getElementById("lbottom");
|
var oRBottom=document.getElementById("rbottom");
|
|
|
|
|
//使测试内容和图表的高度一致
|
$(document).ready(function(){
|
var rHeight=$('#r_echarts').height();
|
$('#charge_thr_infor').css('height',rHeight-270+'px');
|
});
|
|
var oall_picture=document.getElementById("all_picture");
|
var oltop_echart=document.getElementById("ltop_echart");
|
var ortop_echart=document.getElementById("rtop_echart");
|
var olbottom_echart=document.getElementById("lbottom_echart");
|
var orbottom_echart=document.getElementById("rbottom_echart");
|
//导出电池组电压折线图
|
function ExportLtop(){
|
//if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
|
//oltop_echart.value=myLineChartTop.getDataURL("png");
|
//$('#big_pic').get(0).value=$("#ltop canvas")[0].toDataURL("image/png");
|
$('#big_pic').get(0).value = myLineChartTop.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
$('#Big_picture').get(0).submit();
|
//}
|
};
|
|
//导出右上折线图
|
function ExportRtop(){
|
//if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
|
//ortop_echart.value=myRightLineChart.getDataURL("png");
|
//$('#big_pic').get(0).value=$("#rtop canvas")[0].toDataURL("image/png");
|
$('#big_pic').get(0).value = myRightLineChart.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
$('#Big_picture').get(0).submit();
|
//}
|
};
|
|
//导出左下条形图
|
function ExportLbottom(){
|
//if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
|
//olbottom_echart.value=myChart.getDataURL("png");
|
//$('#big_pic').get(0).value=$("#lbottom canvas")[0].toDataURL("image/png");
|
$('#big_pic').get(0).value = myChart.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
$('#Big_picture').get(0).submit();
|
//}
|
};
|
|
//导出右下折线图
|
function ExportRbottom(){
|
//if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
|
//orbottom_echart.value=myLineChart.getDataURL("png");
|
//$('#big_pic').get(0).value=$("#rbottom canvas")[0].toDataURL("image/png");
|
$('#big_pic').get(0).value = myLineChart.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
$('#Big_picture').get(0).submit();
|
//}
|
};
|
|
//导出所有图
|
function ExportAll(){
|
if(isCanExport){
|
ExportTbl();
|
}else{
|
alert("请先选择一组测试记录");
|
}
|
};
|
|
|
//导出报表
|
function ExportTbl() {
|
var lastarray = new Array();
|
lastarray.push(Monnum_list);
|
|
|
//组端电压折线图
|
createGraphByOpt(allGraph, myLineChartTop.getOption());
|
var oltop = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
//console.info(oltop);
|
|
// 电池电流折线图
|
createGraphByOpt(allGraph, myRightLineChart.getOption());
|
var ortop = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
// 单体电压折线图
|
var vol_line_obj = new Object();
|
vol_line_obj.name = '单体电压折线图';
|
vol_line_obj.subname = thrname;
|
vol_line_obj.xdata = TestTime; // 测试时间x轴数据
|
vol_line_obj.ydata = getArrByStatus(batt_test_voldata); // 被筛选后的单体数据
|
vol_line_obj.lname = getArrByStatus(Monnum_list); // 被筛选后单体编号
|
var vol_line_opt = getGraphLineOpt(vol_line_obj);
|
createGraphByOpt(allGraph, vol_line_opt);
|
var vol_line = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
var temp = Titleobj;
|
|
lastarray.push(getListByindex(batt_test_data,0)); //获取起始单体电压
|
|
//单体电压柱状图
|
var arr1=getArrByIndex(slide_index,0);
|
var title=getTitle(arr1,"Voltage");
|
lastarray.push(arr1); //获取单体截止电压
|
|
var lowObj = Titleobj; //落后单体电压信息
|
|
var opt1 = getGraphOpt(Voltage,Monnum_list,arr1,title); //生成左下条形图
|
createGraphByOpt(allGraph, opt1);
|
var orbottom1 = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
//单体实际容量
|
var arr2=getArrByIndex(slide_index,2);
|
lastarray.push(arr2);
|
var title=getTitle(arr2,"Actual_capacity");
|
var opt2 = getGraphOpt(Actual_capacity,Monnum_list,arr2,title); //生成左下条形图
|
createGraphByOpt(allGraph, opt2);
|
var orbottom2 = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
//单体剩余容量
|
var arr3=getArrByIndex(slide_index,3);
|
lastarray.push(arr3);
|
var title=getTitle(arr3,"Residual_capacity");
|
var opt3 = getGraphOpt(Residual_capacity,Monnum_list,arr3,title); //生成左下条形图
|
createGraphByOpt(allGraph, opt3);
|
var orbottom3 = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
//单体容量百分比
|
var arr4=getArrByIndex(slide_index,4);
|
lastarray.push(arr4);
|
var title=getTitle(arr4,"Percent_total_capacity");
|
var opt4 = getGraphOpt(Percent_total_capacity,Monnum_list,arr4,title); //生成左下条形图
|
createGraphByOpt(allGraph, opt4);
|
var orbottom4 = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
// 单体温度折线图
|
var tmp_line_obj = new Object();
|
tmp_line_obj.name = '单体温度折线图';
|
tmp_line_obj.subname = thrname;
|
tmp_line_obj.xdata = TestTime; // 测试时间x轴数据
|
tmp_line_obj.ydata = getArrByStatus(batt_test_tmpdata); // 被筛选后的单体数据
|
tmp_line_obj.lname = getArrByStatus(Monnum_list); // 被筛选后单体编号
|
var tmp_line_opt = getGraphLineOpt(tmp_line_obj);
|
createGraphByOpt(allGraph, tmp_line_opt);
|
var tmp_line = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
// 单体内阻
|
var title = getTitle(batt_res_list,"Resistance");
|
var mon_res_opt = getGraphOpt('单体内阻', Monnum_list, batt_res_list, title);
|
createGraphByOpt(allGraph, mon_res_opt);
|
var mon_res = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
// 终止单体电压
|
var last_vol_arr = batt_test_data[batt_test_data.length-1];
|
var title = getTitle(last_vol_arr,"Voltage");
|
var last_vol_opt = getGraphOpt('单体电压', Monnum_list, last_vol_arr, title);
|
createGraphByOpt(allGraph, last_vol_opt);
|
var last_vol = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
// 终止单体温度
|
var last_tmp_arr = getLastData(batt_test_tmpdata);
|
var title = getTitle(last_tmp_arr,"Temperature");
|
var last_tmp_opt = getGraphOpt('温度', Monnum_list, last_tmp_arr, title);
|
last_tmp_opt.yAxis[0].min = 0; // 设置温度的起始值为0(ps:温度显示波动范围小是正确的)
|
last_tmp_opt.yAxis[0].max = (Math.max.apply( Math, last_tmp_arr)*1.25).toFixed(3); // 设置温度的起始值为0(ps:温度显示波动范围小是正确的)
|
createGraphByOpt(allGraph, last_tmp_opt);
|
var last_tmp = allGraph.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
Titleobj = temp;
|
|
lastarray.push(batt_res_list);
|
lastarray.push(getPointData(batt_test_tmpdata,0));
|
|
lastarray.push(getPointData(batt_test_tmpdata,(batt_test_tmpdata[0].length-1)));
|
var batt=getBattinfById();
|
var testdata = AllTestData[AllTestData.length-1];
|
|
oltop_echart.value = oltop; // 组端电压折线图
|
ortop_echart.value = ortop; // 电池电流折线图
|
olbottom_echart.value = vol_line; // 单体电压折线图
|
orbottom_echart.value = orbottom1; //单体电压柱状图
|
$('#actucap_echart').val(orbottom2); //单体实际容量
|
$('#restcap_echart').val(orbottom3); //单体剩余容量
|
$('#capperc_echart').val(orbottom4); //单体容量百分比
|
$('#tmp_echart').val(tmp_line); // 单体温度
|
$('#mon_res').val(mon_res); // 单体内阻
|
$('#last_vol').val(last_vol); // 终止单体电压柱状图
|
$('#last_tmp').val(last_tmp); // 终止单体温度柱状图
|
//console.info(batt);
|
var top_cause = $('#ele_state').attr('stop');
|
batt.StationIp = top_cause;
|
$('#obj-bmd').val(JSON.stringify({
|
binf:batt,
|
sdata:testdata
|
}));
|
|
$('#obj-title').val(JSON.stringify(lowObj));
|
$('#arr-data').val(JSON.stringify(lastarray));
|
$('#mon-vol-list').val(JSON.stringify(batt_test_data));
|
$('#mon-tmp-list').val(JSON.stringify(batt_test_tmpdata));
|
$('#mon-group-list').val(JSON.stringify(batt_test_evary_record));
|
|
//console.info(batt);
|
//console.info(testdata);
|
//console.info(lowObj);
|
//console.info(lastarray);
|
//alert("*********数据整合完成");
|
oall_picture.submit();
|
}
|
|
//从list集合中获取指定位置的数组
|
function getListByindex(list,index){
|
var arr = new Array();
|
if(list != undefined && list.length > index){
|
arr = list[index];
|
}
|
return arr;
|
}
|
|
function ExportBigpic(){
|
document.getElementById("big_pic").value=$("#bigEchartsCon canvas")[0].toDataURL("image/png");
|
document.getElementById("Big_picture").submit();
|
}
|
|
//当选中折线条形图是显示右键菜单
|
$('#table_echarts div').mousedown(function(e){
|
//利用jquery的方式获取当前点击的是否是右键
|
if(e.which==3){
|
var disX=(e||event).clientX+10; //得到鼠标点击X的位置
|
var disY=(e||event).clientY+10; //得到鼠标点击Y的位置
|
var scrollY=$(document).scrollTop(); //获取浏览器滚动的高度
|
var rHeight=disY+scrollY;
|
//console.info(disX+" "+rHeight);
|
$('#echarts_menu').css('top',rHeight+'px');
|
$('#echarts_menu').css('left',disX+'px');
|
var checkvalue=$("#charge_select_type option:selected").val();
|
if(this.id=="ltop"){
|
$("#echarts_menu ul.export-ul").hide();
|
if(checkvalue=='Resistance-conductivity'){
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Resistance+Bar_graph);
|
}else{
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Voltage+Line_graph);
|
}
|
$("#echarts_menu li a.export-a").eq(0).click(ExportLtop);
|
}else if(this.id=="rtop"){
|
$("#echarts_menu ul.export-ul").hide();
|
if(checkvalue=='Resistance-conductivity'){
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Conductivity_percentage+Line_graph);
|
}else{
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+batt_curr+Line_graph);
|
}
|
$("#echarts_menu li a.export-a").eq(0).click(ExportRtop);
|
}else if(this.id=="lbottom"){
|
if(checkvalue=='Resistance-conductivity'){
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Voltage+Bar_graph);
|
}else{
|
$("#echarts_menu ul.export-ul").show();
|
$("#echarts_menu .maybe-hide").show();
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Bar_graph);
|
}
|
$("#echarts_menu li a.export-a").eq(0).click(ExportLbottom);
|
}else if(this.id=="rbottom"){
|
$("#echarts_menu ul.export-ul").show();
|
$("#echarts_menu .maybe-hide").hide();
|
if(checkvalue=='Resistance-conductivity'){
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Conductance+Bar_graph);
|
}else{
|
var line_status = $('#lineStatus').val();
|
if(line_status == 0) {
|
$("#echarts_menu li a.export-a").eq(0).text(Export+Batt+Voltage+Line_graph);
|
}else {
|
$("#echarts_menu li a.export-a").eq(0).text('导出单体温度折线图');
|
}
|
|
}
|
$("#echarts_menu li a.export-a").eq(0).click(ExportRbottom);
|
}
|
$("#echarts_menu").show();
|
setPosition($("#echarts_menu"),disX, disY);
|
}
|
});
|
|
$('#bigEchartsCon').mousedown(function(e){
|
//利用jquery的方式获取当前点击的是否是右键
|
if(e.which==3){
|
var disX=(e||event).clientX+10; //得到鼠标点击X的位置
|
var disY=(e||event).clientY+10; //得到鼠标点击Y的位置
|
var scrollY=$(document).scrollTop(); //获取浏览器滚动的高度
|
var rHeight=disY+scrollY;
|
//console.info($('#big_echarts').css('display'));
|
if($('#bigEchartsCon').css('display') != 'none'){
|
$('#bigecharts_menu').css('top',rHeight+'px');
|
$('#bigecharts_menu').css('left',disX+'px');
|
$('#bigecharts_menu').show();
|
//console.info("设置菜单位置");
|
}
|
}
|
});
|
|
var obig_echarts_container=document.getElementById("big_echarts_container");
|
$('#table_echarts .graph>div').dblclick(function(){
|
var $bigEcharts=$('#bigEchartsCon').get(0);
|
var graph = $(this).parent();
|
var _n=0; //用于记录当前放大的是哪个图
|
var checkvalue=$("#charge_select_type option:selected").val();
|
//console.info(this.id);
|
if(this.id=="ltop"){
|
//双击的是左上折线图
|
dbname="ltop";
|
if(checkvalue=='Resistance-conductivity'){
|
if(Monnum_list!=undefined && monres_list!=undefined && monres_list.length>0){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
CreateResEchart('BigResEchart',$bigEcharts,Monnum_list,monres_list,Restitle);
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
toggleGraph(graph, BigResEchart);
|
_n=1;
|
}
|
}else{
|
if(TestTime!=undefined && BattGroupVol!=undefined && BattGroupVol.length>0){
|
//console.info($("#ltop canvas")[0].toDataURL("image/png"));
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
|
CreateLineEchartTop('mybigLineChartTop',$bigEcharts,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname); //生成左上折线图
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
toggleGraph(graph, myLineChartTop);
|
_n=2;
|
}
|
}
|
}else if(this.id=="rtop"){
|
//双击的是右上折线图
|
dbname="rtop";
|
if(checkvalue=='Resistance-conductivity'){
|
if(Monnum_list!=undefined && percentage_list!=undefined && percentage_list.length>0){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
CreateSerpercentChart('mybigSerpercentChart',$bigEcharts,Monnum_list,percentage_list,Serpercenttitle);
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
toggleGraph(graph, mybigSerpercentChart);
|
_n=3;
|
}
|
}else{
|
if(TestTime!=undefined && BattGroupCurr!=undefined && BattGroupCurr.length>0){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
CreateRightLineEchart('mybigRightLineChart',$bigEcharts, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname); //生成右上折线图
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
toggleGraph(graph, myRightLineChart);
|
_n=4;
|
}
|
}
|
}else if(this.id=="lbottom"){
|
dbname="lbottom";
|
//双击的是左下条形图
|
if(checkvalue=='Resistance-conductivity'){
|
if(Monnum_list!=undefined && mon_vol_list!=undefined && mon_vol_list.length>0){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
CreateMonEchart('BigMonEchart',$bigEcharts,Monnum_list,mon_vol_list,Montitle);
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
toggleGraph(graph, BigMonEchart);
|
_n=5;
|
}
|
}else{
|
if(Monnum_list!=undefined && Monvol_list!=undefined && Monvol_list.length>0){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
var arr=getArrByIndex(slide_index, li_index);
|
console.info(arr);
|
var title = "";
|
var text = "";
|
|
switch(li_index){
|
case 0:{
|
text = Voltage;
|
title = Titleobj.getAllTile("Voltage");
|
|
}break;
|
case 1:{
|
text = Actual_capacity;
|
title = Titleobj.getAllTile("Actual_capacity");
|
}break;
|
case 2:{
|
text = Residual_capacity;
|
title = Titleobj.getAllTile("Residual_capacity");
|
}break;
|
case 3:{
|
text = Percent_total_capacity;
|
title = Titleobj.getAllTile("Percent_total_capacity");
|
}break;
|
}
|
|
CreateBigEchart($bigEcharts,text,Monnum_list,arr,title); //生成左下条形图
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
maxflag=true;
|
minflag=true;
|
toggleGraph(graph, myChart);
|
_n=6;
|
}
|
}
|
}else if(this.id=="rbottom"){
|
//双击的是右下折线图
|
dbname="rbottom";
|
if(checkvalue=='Resistance-conductivity'){
|
if(Monnum_list!=undefined && mon_vol_list!=undefined){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
CreateSerEchart('BigSerEchart',$bigEcharts,Monnum_list,monser_list,Sertitle);
|
$('#bigEchartsCon').css('background-color','#fff'); */
|
toggleGraph(graph, BigSerEchart);
|
_n=7;
|
}
|
}else{
|
if(Monnum_list!=undefined && TestTime!=undefined){
|
/* $('#bigEchartsCon').show();
|
var scrollY=$(document).scrollTop();
|
$('#bigEchartsCon').css('top',scrollY+'px');
|
$('body').css('overflow-y','hidden');
|
//CreateLineEchart(obig_echarts_container,Monnum_list,TestTime, BattData,max,min,thrname); //生成右下折线图
|
|
UpdatamyLineChart(checkArray); */
|
toggleGraph(graph, myLineChart);
|
_n=8;
|
}
|
}
|
}else{
|
dbname=undefined;
|
}
|
|
/* //双击隐藏放大的图表
|
$('#bigEchartsCon').dblclick(function(){
|
switch(_n){
|
case 0:;break;
|
case 1:BigResEchart.clear();break;
|
case 2:mybigLineChartTop.clear();break;
|
case 3:mybigSerpercentChart.clear();break;
|
case 4:mybigRightLineChart.clear();break;
|
case 5:BigMonEchart.clear();break;
|
case 6:myBigChart.clear();break;
|
case 7:BigSerEchart.clear();break;
|
case 8:mybigLineChart.clear();break;
|
}
|
$('#bigEchartsCon').hide();
|
$('body').css('overflow-y', 'scroll');
|
//createallpicture();
|
}); */
|
});
|
|
//查询电池组电导的测试记录
|
function findBattresdata_infActiondata(){
|
//alert(BattGroupId);
|
if(BattGroupId!=undefined){
|
$.post("Battresdata_infAction_serchByCondition","brdi.BattGroupId="+BattGroupId,function(data){
|
//alert(data.result);
|
data=data.result;
|
data=eval("("+data+")");
|
if(data.code==1 && data.data.length>0){
|
data=data.data;
|
Ocharge_sec_infor.innerHTML="";
|
var ul=createEle("ul");
|
|
for(var i=0;i<data.length;i++){
|
var li=createEle("li");
|
li.innerHTML=i+1+":"+Conductance+"-"+data[i].test_starttime;
|
li.setAttribute("value", data[i].test_record_count);
|
li.setAttribute("class", data[i].test_type==3?"discharge":"charge");
|
ul.appendChild(li);
|
}
|
Ocharge_sec_infor.appendChild(ul);
|
}
|
//setbackground();
|
});
|
}
|
}
|
|
//下拉选择框选中事件
|
$('#charge_select_type').change(function(){
|
isCanExport = false;
|
var checkvalue=$("#charge_select_type option:selected").val();
|
clearfourPicture();
|
changeBattInfo(checkvalue);
|
document.getElementById("charge_sec_infor").innerHTML="";
|
if(checkvalue=='Resistance-conductivity'){
|
//选中电阻电导数据
|
findBattinfObj();
|
reflushBattStatus(BattinfObj);
|
$('#charge_thr_th').css('visibility','hidden');
|
$('#charge_thr_infor .res').css('display','block');
|
findBattresdata_infActiondata();
|
$('#charge_bottom').hide();
|
|
}else{
|
reflushBattStatus(undefined);
|
$('#charge_thr_th').css('visibility','visible');
|
$('#charge_thr_th #t_top').text('');
|
$('#charge_thr_infor .res').css('display','none');
|
findBatttestdata_infByBattGroupId();
|
$('#charge_bottom').show();
|
}
|
});
|
|
|
|
//根据下拉框改变页面上端的电池基本信息
|
function changeBattInfo(checkval){
|
if(checkval=='Resistance-conductivity'){
|
$("#content td span").eq(0).text("<s:text name='Monomer_All' />"); /* 单体数量 */
|
$("#content td span").eq(1).text("<s:text name='Monomer_voltage' />"); /* 单体电压 */
|
$("#content td span").eq(2).text("");
|
$("#content td span").eq(3).text("<s:text name='Nominal_capacity' />"); /* 标称容量 */
|
$("#content td span").eq(4).text("<s:text name='Nominal_resistance' />"); /* 标称内阻 */
|
$("#content td span").eq(5).text("<s:text name='Nominal_conductance' />"); /* 标称电导 */
|
$("#content td span").eq(6).text("<s:text name='Battery_brand' />"); /* 电池品牌 */
|
$("#content td span").eq(7).text("<s:text name='Installation_date' />"); /* 安装日期 */
|
$("#content td span").eq(8).text("<s:text name='Maintenance_advice' />"); /*维护建议 */
|
}else{
|
$("#content td span").eq(0).text("<s:text name='Batte_state' />"); /* 电池状态 */
|
$("#content td span").eq(1).text("<s:text name='Terminal_vol' />");
|
$("#content td span").eq(2).text("&n");
|
$("#content td span").eq(3).text("<s:text name='Batt_current' />"); /* 电池电流 */
|
$("#content td span").eq(4).text("<s:text name='Test_date' />"); /* 测试日期 */
|
$("#content td span").eq(5).text("<s:text name='Test_timeL' />"); /* 测试时长 */
|
$("#content td span").eq(6).text("<s:text name='Test_capacity' />"); /* 测试容量 */
|
$("#content td span").eq(7).text("<s:text name='Residual_capacity' />"); /* 剩余容量 */
|
$("#content td span").eq(8).text("<s:text name='Endurance' /><s:text name='Time'/>"); /* 续航时间 */
|
}
|
}
|
|
|
//格式化右下折线图的数组
|
function getAlldata(list){
|
max=0;
|
min=1000;
|
if(list!=undefined && list.length>0){
|
for(var i=0;i<list.length;i++){
|
for(var j=0;j<list[i].length;j++){
|
//console.info(list[i][j]);
|
if(list[i][j]==undefined || list[i][j]==''){
|
list[i][j]=list[i][j-1];
|
}
|
if(max<list[i][j]){
|
max=list[i][j];
|
}
|
if(min>list[i][j]){
|
min=list[i][j];
|
}
|
}
|
}
|
}
|
return list;
|
}
|
|
//格式化左下条形图中数组的电压
|
function getAllVol(list){
|
if(list!=undefined && list.length>0){
|
for(var i=0;i<list.length;i++){
|
for(var j=0;j<list[0].length;j++){
|
if(list[i][j]==undefined){
|
list[i][j]=list[i-1][j];
|
}
|
}
|
}
|
}
|
return list;
|
}
|
|
//格式化单个数组
|
function getAllBattGroupVol(list){
|
if(list!=undefined && list.length>0){
|
for(var i=0;i<list.length;i++){
|
if(list[i]==undefined || list[i]==''){
|
list[i]=list[i-1];
|
}
|
}
|
}
|
return list;
|
}
|
|
var Titleobj;
|
//获取左下条形图中的数组
|
function getTitle(array,units){
|
var title="";
|
//a=new Title();
|
//alert(Titleobj);
|
Titleobj = new Title();
|
var sum=0;
|
if(array != undefined && array.length>0){
|
Titleobj.setMax(Math.max.apply(null,array));
|
Titleobj.setMin(Math.min.apply(null,array));
|
for(var i=0;i<array.length;i++){
|
sum+=parseFloat(array[i]);
|
}
|
var batt=getBattinfById();
|
//console.info(batt);
|
if("Resistance"==units){
|
Titleobj.setAvg((sum/array.length).toFixed(3));
|
var low=getLow(3,2);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow(((2-low.low_value)*batt.MonResStd).toFixed(3));
|
low=getLow(3,3);
|
Titleobj.setClow(((2-low.low_value)*batt.MonResStd).toFixed(3));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow(((2-low.low_value)*Titleobj.getAvg()).toFixed(3));
|
low=getLow(3,3);
|
Titleobj.setClow(((2-low.low_value)*Titleobj.getAvg()).toFixed(3));
|
}
|
var count=0;
|
for(var i=0;i<array.length;i++){
|
if(parseFloat(Titleobj.getAlow())<parseFloat(array[i])){
|
//console.info(title.getAlow()+"<"+array[i]);
|
count++;
|
}
|
}
|
Titleobj.setLc(count);
|
Titleobj.setLp((count*100/array.length).toFixed(1));
|
//console.info(title);
|
}else{
|
if("Voltage"==units){
|
Titleobj.setAvg((sum/array.length).toFixed(3));
|
Titleobj.setSum(sum);
|
var low=getLow(1,1);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow((low.low_value*batt.MonVolStd).toFixed(3));
|
low=getLow(1,0);
|
Titleobj.setClow((low.low_value*batt.MonVolStd).toFixed(3));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(3));
|
low=getLow(1,0);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(3));
|
}
|
}else if("Temperature"==units){
|
Titleobj.setAvg((sum/array.length).toFixed(1));
|
var low=getLow(1,1);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow((low.low_value*batt.MonTmpStd).toFixed(1));
|
low=getLow(1,0);
|
Titleobj.setClow((low.low_value*batt.MonTmpStd).toFixed(1));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(1));
|
low=getLow(1,0);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(1));
|
}
|
}else if("Conductance"==units){
|
Titleobj.setAvg((sum/array.length).toFixed(0));
|
var low=getLow(3,2);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow((low.low_value*batt.MonSerStd).toFixed(0));
|
low=getLow(3,3);
|
Titleobj.setClow((low.low_value*batt.MonSerStd).toFixed(0));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
low=getLow(3,3);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
}
|
}else if("Actual_capacity"==units){
|
Titleobj.setAvg((sum/array.length).toFixed(0));
|
var low=getLow(2,2);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow((low.low_value*batt.MonCapStd).toFixed(0));
|
//console.info(batt);
|
low=getLow(2,3);
|
Titleobj.setClow((low.low_value*batt.MonCapStd).toFixed(0));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
low=getLow(2,3);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
}
|
}else if("Residual_capacity" == units){
|
Titleobj.setAvg((sum/array.length).toFixed(0));
|
var low=getLow(1,1);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
//console.info(batt);
|
low=getLow(1,0);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
//console.info(batt);
|
low=getLow(1,0);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));
|
}
|
|
}else if("Percent_total_capacity" == units){
|
Titleobj.setAvg((sum/array.length).toFixed(2));
|
var low=getLow(2,2);
|
if(low.low_method==0){
|
//根据标称值计算
|
Titleobj.setAlow((low.low_value*batt.MonCapStd).toFixed(2));
|
//console.info(batt);
|
low=getLow(2,3);
|
Titleobj.setClow((low.low_value*batt.MonCapStd).toFixed(2));
|
}else{
|
//根据平均值计算
|
Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(2));
|
low=getLow(2,3);
|
Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(2));
|
}
|
}
|
var count=0;
|
for(var i=0;i<array.length;i++){
|
if(parseFloat(Titleobj.getAlow())>parseFloat(array[i])){
|
count++;
|
}
|
}
|
Titleobj.setLc(count);
|
Titleobj.setLp((count*100/array.length).toFixed(1));
|
}
|
|
//console.info(Title);
|
title=Titleobj.getAllTile(units);
|
}
|
return title;
|
}
|
|
|
//查询对于国际化中所需要的值
|
var charging; //充电
|
var discharging; //放电
|
var Conductance; //电导
|
|
var Voltage; //电压
|
var Export; //导出
|
var Bar_graph; //条形图
|
var Line_graph; //折线图
|
var Batt_group; //电池组
|
var Batt; //电池
|
var Voltage; //电压
|
var Current; //电流
|
var Resistance; //电阻
|
var Conductivity_percentage; //电导百分比
|
|
|
$(document).ready(function(){
|
$.post("I18nAction_findValue","key=Conductance",function(data){
|
Conductance=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Resistance",function(data){
|
Resistance=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Charging",function(data){
|
charging=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Discharging",function(data){
|
discharging=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Voltage",function(data){
|
Voltage=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Export",function(data){
|
Export=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Bar_graph",function(data){
|
Bar_graph=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Line_graph",function(data){
|
Line_graph=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Batt_group",function(data){
|
Batt_group=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Batt",function(data){
|
Batt=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Voltage",function(data){
|
Voltage=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Current",function(data){
|
Current=data.value;
|
});
|
|
$.post("I18nAction_findValue","key=Conductivity_percentage",function(data){
|
Conductivity_percentage=data.value;
|
});
|
});
|
|
var low_list; //所有的阀值数组
|
//查询所有的阀值
|
function searchAll_lowAction(){
|
$.post("Batt_param_lowAction_searchAll",null,function(data){
|
model=eval("("+data.result+")");
|
if(model.code==1 && model.data.length>0){
|
low_list=model.data;
|
}else{
|
low_list=undefined;
|
}
|
//console.info(low_list);
|
});
|
}
|
|
//根据low_type,low_nametype获取阀值
|
function getLow(lowtype,lownametype){
|
if(lowtype!=undefined && low_list!=undefined && lownametype!=undefined){
|
for(var i=0;i<low_list.length;i++){
|
if(lowtype==low_list[i].low_type && lownametype==low_list[i].low_nametype){
|
return low_list[i];
|
}
|
}
|
}
|
}
|
|
//
|
function getArrByCheckBox(arr){
|
var temp=new Array();
|
if(arr != undefined && checkArray != undefined){
|
for(var i = 0; i < arr.length ;i++){
|
for(var j = 0;j<arr[i].length;j++){
|
if(checkArray[j]==1){
|
if(temp[j] == undefined){
|
temp[j] = new Array();
|
}
|
temp[j].push(arr[i][j].mon_vol.toFixed(3));
|
}
|
}
|
}
|
}
|
return temp;
|
}
|
|
function getArrayByCheck(list){
|
var temp = new Array();
|
if(list!=undefined && checkArray != undefined){
|
for(var i = 0;i<checkArray.length;i++){
|
if(checkArray[i]==1){
|
temp.push(list[i]);
|
}
|
}
|
}
|
return temp;
|
}
|
|
//从AllArr中取出指定位置的数组
|
function getArrByIndex(index,li_index){
|
switch(li_index){
|
case 0:return batt_test_data[index];break; //获取指定位置的电压值
|
case 1:return batt_tmp_data[index];break;
|
case 2:return batt_actionCap_list[index];break;
|
case 3:return batt_restCap_list[index];break;
|
case 4:return batt_CapPercent_list[index];break;
|
}
|
return arr;
|
}
|
|
//当切换单体电压/单体温度/实际容量/剩余容量/容量百分比菜单时
|
$('#echarts_menu').on('click','ul.export-ul li',function(){
|
var tmp = $(this).index();
|
if(tmp != li_index){
|
li_index=tmp;
|
//console.info(slide_index);
|
createEchartBar(AllData,slide_index,li_index);
|
}
|
});
|
|
//根据当前选中情况生成左下条形图
|
function createEchartBar(AllData,slide_index,li_index){
|
// 获取初始值
|
var initData = getArrByIndex(0, li_index);
|
var arr=getArrByIndex(slide_index,li_index);
|
//console.info(arr);
|
var max = getMaxFromArr(arr);
|
var min = getMinFromArr(arr);
|
switch(li_index){
|
case 0:{
|
Monvol_list=arr;
|
var title=getTitle(Monvol_list,"Voltage");
|
var batt = getBattinfById();
|
//console.info(batt);
|
max = Math.ceil(Math.max(batt.MonVolStd,max)*1.15);
|
min = Math.floor(min*0.9);
|
//console.info("max:"+max+" min:"+min);
|
// 构造初始数据
|
var initVal = {
|
lname: '初始'+Voltage,
|
data: initData
|
}
|
CreateEchart(oLBottom,Voltage,Monnum_list,Monvol_list,title,max,min,cPicker,initVal); //生成左下条形图
|
//console.info('huodongwei');
|
updataSecCol($('#charge_thr_th'), arrTh[li_index], Monvol_list);
|
|
// 更新右下方的折线图为单体电压折线图
|
var new_Monnum_list = getArrByStatus(Monnum_list);
|
var new_batt_test_voldata = getArrByStatus(batt_test_voldata);
|
|
// 获取全部单体电压数据的最值
|
var lineMax = getMaxFromArr(new_batt_test_voldata);
|
var lineMin = getMinFromArr(new_batt_test_voldata);
|
CreateLineEchart('myLineChart',oRBottom,new_Monnum_list,TestTime,new_batt_test_voldata,lineMax,lineMin,thrname, 'V'); //生成右下折线图
|
$('#lineStatus').val('0');
|
//console.info(Monvol_list);
|
};break;
|
case 1:{
|
var title=getTitle(arr,"Temperature");
|
// 构造初始数据
|
var initVal = {
|
lname: '初始单体温度',
|
data: initData
|
}
|
CreateEchart(oLBottom,"单体温度",Monnum_list,arr,title,(max*1.15).toFixed(3),0,cPicker, initVal); //生成左下条形图
|
updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
|
|
// 更新右下方的折线图为单体温度折线图
|
var new_Monnum_list = getArrByStatus(Monnum_list);
|
var new_batt_test_tmpdata = getArrByStatus(batt_test_tmpdata);
|
CreateLineEchart('myLineChart',oRBottom,new_Monnum_list,TestTime,new_batt_test_tmpdata,max+10,0,thrname, '℃'); //生成右下折线图
|
var opt = myLineChart.getOption();
|
//console.info(opt.title);
|
opt.title[0].text = '单体温度折线图';
|
opt.yAxis[0].name = 'y(℃)';
|
myLineChart.setOption(opt);
|
$('#lineStatus').val('1');
|
};break;
|
case 2:{
|
var title=getTitle(arr,"Actual_capacity");
|
// 构造初始数据
|
var initVal = {
|
lname: '初始'+Actual_capacity,
|
data: initData
|
}
|
CreateEchart(oLBottom,Actual_capacity,Monnum_list,arr,title,(max*1.15).toFixed(3),(min*0.9).toFixed(3),cPicker); //生成左下条形图
|
updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
|
};break;
|
case 3:{
|
//console.info(arr);
|
//console.info("max:"+max+" min:"+min);
|
var title=getTitle(arr,"Residual_capacity");
|
// 构造初始数据
|
var initVal = {
|
lname: '初始'+Residual_capacity,
|
data: initData
|
}
|
CreateEchart(oLBottom,Residual_capacity,Monnum_list,arr,title,(max*1.15).toFixed(3),(min*0.9).toFixed(3),cPicker, initVal); //生成左下条形图
|
updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
|
};break;
|
case 4:{
|
var title=getTitle(arr,"Percent_total_capacity");
|
// 构造初始数据
|
var initVal = {
|
lname: '初始'+Percent_total_capacity,
|
data: initData
|
}
|
CreateEchart(oLBottom,Percent_total_capacity,Monnum_list,arr,title,(max*1.115).toFixed(3),(min*0.9).toFixed(3),cPicker); //生成左下条形图
|
updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
|
};break;
|
}
|
}
|
|
var maxText = '<s:text name="Maxvalue" />'; //最大值 //最大值
|
var minText = '<s:text name="Minvalue" />'; //最小值
|
var avgText = '<s:text name="Average" />'; //平均值
|
var lowText = '<s:text name="Lowvalue" />'; //落后值
|
var lcText = '<s:text name="Lcvalue" />'; //落后数量
|
var lpText = '<s:text name="Lpvalue" />'; //落后数量比
|
var Residual_capacity = '<s:text name="Residual_capacity" />'; //剩余容量
|
var Actual_capacity = '<s:text name="Actual_capacity" />'; //实际容量
|
var Percent_total_capacity = '<s:text name="Percent_total_capacity" />'; //容量百分比
|
var group_vol = ['<s:text name="On-line_voltage"/>', '<s:text name="Group_voltage"/>']; // 在线电压, 组端电压
|
var batt_curr = '<s:text name="Batt_current"/>';
|
|
// 更新表格第二列
|
function updataSecCol(tbl, thTxt, tdData) {
|
tbl.find('tr th').eq(1).text(thTxt);
|
var max = getMaxFromArr(tdData);
|
var min = getMinFromArr(tdData);
|
var isMax=true, isMin=true;
|
tbl.find('tbody tr').each(function(i) {
|
$(this).find('td').eq(1).css('background', 'none');
|
//console.info(i+"=="+tdData[i]);
|
if(tdData[i] == max && isMax && max != min) {
|
$(this).find('td').eq(1).css('background', 'green');
|
isMax=false;
|
}
|
|
if(tdData[i] == min && isMin) {
|
$(this).find('td').eq(1).css('background', 'red');
|
isMin = false;
|
}
|
|
$(this).find('td').eq(1).text(tdData[i]);
|
});
|
}
|
|
/**
|
设置滑块的提示框
|
@param object ele jquery对象
|
@param string val 字符串日期格式
|
@param num left 滑块的left值
|
*/
|
function setSlideLabel(ele, val, left) {
|
var winWidth = $(window).width();
|
var label = ele.find('.label'); //
|
var slider = ele.width(); // 容器的宽度
|
label.text(val); // 给label添加值
|
|
var labelWidth = label.width(); // 获取label的长度
|
var marginLeft = slider*left/100 - labelWidth/2;
|
label.css('left', marginLeft).show();
|
var labelLeft = label.offset().left; // 获取label这屏幕中的位置
|
var shiftWidth = winWidth - labelLeft; // 获取label距离屏幕右侧的距离
|
|
if(shiftWidth < labelWidth) { // 判断label是否超出屏幕的右侧
|
label.offset(function(n, c) {
|
var newPos = new Object();
|
newPos.top = c.top; // 距离顶部的距离不变
|
newPos.left = winWidth - labelWidth-10; // 距离屏幕右侧的距离
|
return newPos; // 返回最新的位置
|
});
|
}
|
}
|
|
// 实时-历史切换定位到具体电池组
|
$(function() {
|
$('body').on('click', '#nav a[href="control.jsp"]', function() {
|
var batt = getBattinfById();
|
var province = batt.StationName1;
|
var city = batt.StationName2;
|
var county = batt.StationName5;
|
var home = batt.StationName;
|
var battid = batt.BattGroupId;
|
$(this).attr('href', 'control.jsp?province='+province+'&city='+city+'&county='+county+'&home='+home+'&battid='+battid);
|
});
|
});
|
|
// 图表
|
function createGraphByOpt (eChart, opt) {
|
eChart.clear();
|
opt.animation = false;
|
eChart.setOption(opt);
|
}
|
// 获取opt
|
function getGraphOpt(lname, xdata, sdata, tname) {
|
maxBigflag = true;
|
minBigflag = true;
|
var option={
|
tooltip:{
|
trigger: 'axis',
|
axisPointer : { // 坐标轴指示器,坐标轴触发有效
|
type : 'line', // 默认为直线,可选为:'line' | 'shadow'
|
color:"white"
|
}
|
},
|
title : {
|
text: tname,
|
x: "center", //标题水平方向位置
|
textStyle: {
|
fontSize:11
|
}
|
},
|
xAxis:{
|
data:xdata
|
},
|
grid: {
|
top:'12%',
|
left: '8%',
|
right: '5%',
|
bottom: '8%'
|
},
|
yAxis:[{
|
name:"y",
|
type:'value',
|
min:(Math.min.apply( Math, sdata )*0.99).toFixed(3),
|
max:(Math.max.apply( Math, sdata )*1.01).toFixed(3),
|
// max:Math.ceil(ymax),
|
// min:Math.floor(ymin-1.0),
|
axisLabel:{
|
formatter:function(value){
|
//解决原点处带符号问题
|
if(value==0)
|
{
|
return value;
|
}else{
|
return value;
|
}
|
}
|
}
|
}],
|
series:[{
|
type:'bar',
|
name:lname,
|
data:sdata,
|
|
//显示柱状的数值
|
itemStyle:{
|
width:0.5,
|
emphasis:{
|
color:'#54d3e6'
|
},
|
|
normal:{
|
label:{
|
show: true,
|
position: 'top',
|
textStyle:{
|
fontWeight: 'bolder',
|
color:"#000"
|
}
|
},
|
|
color: function(value) {
|
var max=Math.max.apply( Math, sdata );
|
var min=Math.min.apply( Math, sdata );
|
if(maxBigflag==true && value.value==max)
|
{
|
maxBigflag=false;
|
return 'green';
|
}
|
else if(minBigflag==true && value.value==min)
|
{
|
minBigflag=false;
|
return 'red';
|
}else
|
{
|
var clow=Titleobj.getClow();
|
var alow=Titleobj.getAlow();
|
if(parseFloat(value.value)<parseFloat(clow)){
|
return "#BFA0D1"; //设置更换颜色
|
}else if(parseFloat(value.value)<parseFloat(alow)){
|
return "#ffff00"; //设置告警颜色
|
}
|
//console.info(title.getClow());
|
return '#b4d3fa'; //设置为普通的颜色
|
}
|
max=0;
|
min=0;
|
}
|
}
|
},
|
//显示平均值
|
markLine:{
|
data:[
|
{
|
type:'average',
|
name:avg_string,
|
itemStyle:{
|
normal:{
|
color:'#54d3e6'
|
}
|
}
|
},
|
sdata!=undefined && sdata.length>0?[
|
{name: alarm_string, value: Titleobj.getAlow(),x:'8%',xAxis:xdata[0], yAxis:Titleobj.getAlow(),itemStyle:{ normal:{color:'#ffff00'} }},
|
{name: alarm_string,value: Titleobj.getAlow(),x:'95%',xAxis:xdata[xdata.length-1], yAxis: Titleobj.getAlow()}
|
]:[
|
{name: '', value:''},
|
{name: '', value:''}
|
],
|
sdata!=undefined && sdata.length>0?[
|
{name: change_string, value:Titleobj.getClow(),x:'8%',xAxis:xdata[0], yAxis: Titleobj.getClow(),itemStyle:{ normal:{color:'#ff66cc'} }},
|
{name: change_string, value:Titleobj.getClow(),x:'95%',xAxis:xdata[xdata.length-1], yAxis: Titleobj.getClow()}
|
]:[
|
{name: '', value:''},
|
{name: '', value:''}
|
]
|
]
|
}
|
}]
|
};
|
return option;
|
}
|
|
// 改变列表宽度
|
$(function() {
|
$('#ele_content').resizable({
|
minWidth: 240,
|
maxWidth: 600,
|
handles: 'e',
|
edge: 10,
|
start: function() {
|
maxflag = true;
|
minflag = true;
|
$('.graph>div').text('');
|
},
|
stop: function() {
|
var checkvalue=$("#charge_select_type option:selected").val();
|
//alert(123);
|
if(checkvalue=='Resistance-conductivity'){
|
ResEchart = setCanvas(ResEchart);
|
mySerpercentChart = setCanvas(mySerpercentChart);
|
MonEchart = setCanvas(MonEchart);
|
SerEchart = setCanvas(SerEchart);
|
}else {
|
myChart = setCanvas(myChart);
|
myLineChartTop = setCanvas(myLineChartTop);
|
myRightLineChart = setCanvas(myRightLineChart);
|
myLineChart = setCanvas(myLineChart);
|
myLineChartTop.group = 'group1';
|
myRightLineChart.group = 'group1';
|
myLineChart.group = 'group1';
|
echarts.connect('group1');
|
}
|
|
specialGroupVolLine = setCanvas(specialGroupVolLine);
|
specialMonCapBar = setCanvas(specialMonCapBar);
|
specialMonVolLine = setCanvas(specialMonVolLine);
|
specialCurrLine = setCanvas(specialCurrLine);
|
specialGroupVolLine.group = specialMonVolLine.group = specialCurrLine.group = 'specialGroup';
|
echarts.connect('specialGroup');
|
}
|
});
|
var lastslide = 0;
|
// 滑块定位
|
$('#slider').slider({
|
value: 100,
|
start: function(event, ui) {
|
//setSlideLabel($('#slider'), '2012-12-22 00:00:00', ui.value);
|
},
|
slide: function(event, ui) {
|
if(batt_test_evary_record!=undefined && batt_test_evary_record.length>0){
|
slide_index = Math.floor((batt_test_evary_record.length-1)*ui.value/100);
|
//console.info(slide_index+" === "+batt_test_evary_record.length);
|
setSlideLabel($('#slider'), formatSeconds(batt_test_evary_record[slide_index].test_timelong),ui.value);
|
}else{
|
setSlideLabel($('#slider'), '00:00:00',ui.value);
|
}
|
if(slide_index != lastslide){
|
//console.info(slide_index);
|
updateEchartAndTable();
|
lastslide = slide_index;
|
}
|
},
|
stop: function(event, ui) {
|
//console.info(ui.value);
|
upadateEchartsTitle();
|
$('#slider .label').hide();
|
}
|
});
|
});
|
|
|
//根据滑块更新数据
|
function UpdatedataBySlide(percentage){
|
if(batt_test_evary_record!=undefined && batt_test_evary_record.length>0){
|
slide_index = Math.floor(batt_test_evary_record.length*percentage);
|
//console.info(slide_index+"=="+batt_test_evary_record.length);
|
setSlideLabel($('#slide'), formatSeconds(batt_test_evary_record[slide_index].test_timelong));
|
//console.info(li_index);
|
}else{
|
setSlideLabel($('#slide'), '00:00:00');
|
}
|
}
|
|
function upadateEchartsTitle(){
|
if(batt_test_evary_record!=undefined && batt_test_evary_record.length>0){
|
thrname="PXA "+formatSeconds(batt_test_evary_record[slide_index].test_timelong);
|
reflushltop(thrname); //更新左上折线图中的title
|
reflushlrtop(thrname); //更新右上折线图的title
|
reflushlrLine(thrname); //更新右下折线图的title
|
}
|
}
|
|
function updateEchartAndTable(){
|
if(batt_test_data!=undefined && batt_test_data.length>0){
|
var initData = getArrByIndex(0, li_index);
|
list = getArrByIndex(slide_index,li_index);
|
//console.info(index);
|
if(list!=undefined && list.length>0){
|
//console.info(slide_index+"###");
|
tname=getTitle(list, li_index==0?"Voltage":li_index==1?"Actual_capacity":li_index==2?"Residual_capacity":"Percent_total_capacity");
|
//var d1 = new Date();
|
var max = getMaxFromArr(list);
|
var min = (getMinFromArr(list)*0.9).toFixed(3);
|
if(li_index == 0){
|
var batt = getBattinfById();
|
max = Math.ceil(Math.max(batt.MonVolStd,max)*1.15);
|
min = Math.floor(min);
|
}else{
|
if(li_index == 1){
|
//更新温度柱状图时最小值 从0开始
|
min = 0;
|
}
|
max = (max*1.15).toFixed(3);
|
}
|
|
reflush(list,tname,max,min,initData); //更新条形图
|
|
createBattVoltable(list);
|
//更新电池状态
|
reflushBattStatus(batt_test_evary_record[slide_index]);
|
if(dbname=="lbottom" && $('#big_echarts').css("display")=='block'){
|
reflushBig(list,tname);
|
}
|
}
|
}
|
}
|
|
// 设置已经生成的canvas
|
function setCanvas(graph) {
|
var opts = graph.getOption();
|
graph.group = 'group1';
|
graph = echarts.init(graph._dom);
|
graph.setOption(opts);
|
return graph;
|
}
|
|
// 放大和恢复echarts图表
|
function toggleGraph(ele, echarts) {
|
if(ele.hasClass('big')) {
|
ele.removeClass('big');
|
}else {
|
ele.addClass('big');
|
}
|
echarts.resize();
|
|
}
|
|
$(function(){
|
//启动查询电池充放电状态的线程
|
searchBattState();
|
window.setInterval(function(){
|
searchBattState();
|
}, 6000);
|
});
|
function searchBattState(){
|
$.ajax({
|
type: "post",
|
//url: "Batt_rtstateAction!serchDisOrChargr",
|
url:"Batt_rtstateAction!serchDisOrChargrNew", //查询当前用户管理的电池组中处于放电或充电的电池组记录
|
async:true,
|
dataType:'text',
|
data:null,
|
success: function(data){
|
data = eval('('+data+')');
|
var model = eval('('+data.result+')');
|
//console.info("************");
|
//console.info(model);
|
//console.info("************");
|
var arr = new Array();
|
if(model.code == 1){
|
//console.info(model.data);
|
for(var i = 0;i<model.data.length;i++){
|
var _data = model.data[i];
|
if(_data.batt_test_type == 3){
|
arr.push({
|
note:_data.note,
|
val:_data.BattGroupId,
|
province: _data.stationName1,
|
city: _data.stationName2,
|
county: _data.stationName5,
|
home: _data.stationName,
|
isCharge:0
|
});
|
}else if(_data.batt_test_type == 2){
|
arr.push({
|
note: _data.note,
|
val: _data.BattGroupId,
|
province: _data.stationName1,
|
city: _data.stationName2,
|
county: _data.stationName5,
|
home: _data.stationName,
|
isCharge:1
|
});
|
}
|
}
|
}
|
//console.info(arr);
|
var batt_list = $('#ele_content .batt-listen .batt-list');
|
createBattListen(batt_list, arr);
|
},
|
error:function(a){
|
|
}
|
});
|
}
|
|
//跳转到指定的电池组统计分析查询
|
function targetBattReport(){
|
var batt = getBattinfById();
|
var url = skipUrl("eleAnalyse.jsp",batt.StationName1,batt.StationName2,batt.StationName5,batt.StationName,batt.BattGroupId);
|
window.open(url);
|
}
|
|
// 使用jquery实现左导航的显示和隐藏
|
$(document).ready(function(){
|
//二级左菜单的显示和隐藏
|
$('#lside').on('click','.fir', function(){
|
$('.thr').css('background-color','');
|
$('.fir').css('background-color','');
|
$('.sec').css('background-color','');
|
$(this).css('background-color','#9bbaf3');
|
$(this).css('color','black');
|
// alert($(this).next().children().eq(0).children().eq(0).text());
|
if ($(this).next().length == 0) {
|
|
searchkBattByStationid($(this).attr('name'));
|
}else {
|
//修复二级为空时的bug
|
for(var i=0;i<$(this).next().children().length;i++)
|
{
|
if($(this).next().children().eq(i).children().eq(0).text()=='')
|
{
|
$(this).next().children().eq(i).children().eq(0).remove();
|
$(this).next().children().eq(i).children().eq(0).next().slideToggle();
|
}
|
}
|
$(this).next().slideToggle(function() {
|
//console.info($(this));
|
changeFirImg($(this));
|
});
|
}
|
});
|
//三级左菜单的显示和隐藏
|
$('#lside').on('click', '.sec', function(){
|
$('.thr').css('background-color','');
|
$('.fir').css('background-color','');
|
$('.sec').css('background-color','');
|
// alert($(this).parent().parent().siblings().get(0).tagName);
|
$(this).css('background-color','#9bbaf3');
|
$(this).next().slideToggle();
|
});
|
// 三级菜单背景色改变
|
$('#lside').on('click', '.thr', function(){
|
$('.thr').css('background-color','');
|
$('.fir').css('background-color','');
|
$('.sec').css('background-color','');
|
$(this).css('background-color','#9bbaf3');
|
|
// 初始化特殊设备的图标
|
initSpecialGraphLine();
|
|
//显示电池的详细信息
|
$('#address_infor').text($(this).parent().parent().parent().parent().siblings().first().text()+"-"+$(this).parent().parent().siblings().first().text()+"-"+$(this).text());
|
|
var fbsId = $(this).attr('fbs');
|
var isSpecial = regFbsId(fbsId);
|
$('.special-mon-data').removeClass('show');
|
BattGroupId=$(this).attr("id");
|
if(isSpecial) {
|
$('.special-mon-data').addClass('show');
|
var temp = {
|
BattGroupId:$(this).attr("id")
|
};
|
//SearchLD9Maininfo(temp);
|
searchMonTestInfo(temp);
|
resizeSpecailGraph();
|
}else {
|
getBattStr();
|
findBattinfObj();
|
AllBataDate=new Array();
|
clearfourPicture();
|
findBatttestdata_infByBattGroupId();
|
searchAll_lowAction(); //获取阀值
|
}
|
|
|
// 设置记录的笔数为-1
|
$('#testrecordcout').val('-1')
|
|
});
|
});
|
|
//特殊设备
|
function SearchLD9Maininfo(temp){
|
$.ajax({
|
type: "post",
|
url: "Ld9testdata_infAction_ld9action_serchByInfo",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
//console.info(model);
|
if(model.code == 1){
|
specialCollapse($('#special-charge-infor .mon-data-content'), model.data);
|
}else{
|
console.info("暂无核容测试的记录");
|
}
|
},
|
error:function(){
|
|
}
|
});
|
}
|
|
|
$(function() {
|
//全部展开
|
$('#all_show').click(function(){
|
$('#lside .fir').each(function() {
|
var nextLength = $(this).next('ul').length;
|
if(nextLength == 0) {
|
searchkBattByStationid($(this).attr('name'));
|
}else {
|
$(this).children('.arrow').removeClass('down').addClass('up');
|
$(this).next().slideDown();
|
}
|
|
});
|
});
|
});
|
|
// 点击屏幕隐藏图表右键菜单
|
$(function(){
|
$('body').click(function() {
|
$('#echarts_menu').hide();
|
});
|
});
|
searchAll_lowAction(); //获取阀值
|
//seachAllStation();
|
//查询所有机房
|
function seachAllStation(){
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchAllStation",
|
async:true,
|
dataType:'text',
|
data:null,
|
success: function(data){
|
data = eval('('+data+')');
|
var model = eval('('+data.result+')');
|
//console.info(model);
|
if(model.code == 1){
|
//console.info("查询成功");
|
createLsideFir($('#lside'), model.data); // 生成一级导航
|
searchAll_lowAction();
|
var stationId=getQueryString("stationId"); // 获取机房的ID
|
if(stationId != undefined && stationId>0) {
|
isFirLoadPage = 0;
|
searchkBattByStationid(stationId);
|
}else {
|
searchkBattByStationid(model.data[0].StationId);
|
}
|
|
}else{
|
$('#room_num').text(0);
|
noContent.showNoContent("暂无管理的机房");
|
//window.history.back(-1);
|
loading.hideLoading($('#lside'));
|
loading.hideLoading($('#charge_sec_infor'));
|
}
|
},
|
error:function(){
|
|
}
|
});
|
}
|
|
//根据机房id查询电池组
|
function searchkBattByStationid(stationid){
|
addLoadingToMenu(stationid);
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchBattByStation",
|
async:true,
|
dataType:'text',
|
data:"json = "+JSON.stringify({
|
StationId:stationid
|
}),
|
success: function(data){
|
data = eval('('+data+')');
|
var model = eval('('+data.result+')');
|
//console.info(model);
|
removeLoadingMenu(stationid); // 移除数据加载等待
|
if(model.code == 1){
|
battinlist.push(model.data);
|
createLsideSec(model.data);
|
}
|
},
|
error:function(){
|
|
}
|
});
|
}
|
|
/**
|
* 生成左侧一级导航
|
* @param array mList 一级导航的数据机房名称,机房ID
|
* [{StationName:string,StationId:string}...]
|
*/
|
function createLsideFir(contain,mList){
|
// 清除contain的内容
|
contain.text('');
|
var _ul = $('<ul></ul>');
|
// 遍历mList根据其数据生成页面中的内容
|
for (var i = 0; i < mList.length; i++) {
|
var _li = $('<li></li>');
|
var _a = $('<a href="javascript:;" id="'+mList[i].StationName+'" class="fir" name="'+mList[i].StationId+'"><strong class="arrow down"></strong><span></span>'+mList[i].StationName+'</a>');
|
_li.append(_a);
|
_ul.append(_li);
|
}
|
|
contain.append(_ul);
|
loading.hideLoading(contain);
|
// 在id为mach_num的div显示内容
|
var MachineRoom = $('.fir').length;
|
$('#room_num').text(MachineRoom);
|
}
|
/**
|
* 生成左侧二级导航
|
* @param array mList 一级导航的数据机房名称,机房ID
|
* [{StationName:string,StationId:string,BattGroupId:string,BattGroupName:string}...]
|
*/
|
function createLsideSec(mList, batterId){
|
var _stationId = mList[0].StationId;
|
//console.info(_stationId);
|
// 根据_stationId的值确定要生成二级导航的位置
|
var _fir = $('#lside .fir');
|
|
_fir.each(function() {
|
if($(this).attr('name') == _stationId) {
|
$(this).next('ul').remove();
|
$(this).children('strong.arrow').removeClass('down').addClass('up');
|
|
var _ul = $('<ul style="display:block"></ul>');
|
var _li = $('<li></li>');
|
var _a = $('<a href="javascript:;" class="sec" id="'+mList[0].StationId+'" value="'+mList[0].StationName+'" style="display:none"></a>');
|
_li.append(_a);
|
var __ul = $('<ul style="display: block"></ul>');
|
var tagStr = "";
|
// 遍历mList生成第二级内容
|
for(var _i = 0; _i < mList.length; _i++) {
|
var dev_id = mList[_i].FBSDeviceId;
|
tagStr += '<li><a href="javascript:;" class="thr" fbs="'+dev_id+'" id="'+mList[_i].BattGroupId+'">'+mList[_i].BattGroupName+'</a></li>';
|
|
}
|
var __li = $(tagStr);
|
__ul.append(__li);
|
_li.append(__ul);
|
_ul.append(_li);
|
$(this).after(_ul);
|
var battId = getQueryString('battgroupId');
|
if(isFirLoadPage) {
|
isFirLoadPage = 0;
|
//console.info(123);
|
var firTag = $('#lside .fir').eq(0).next().find('.thr').eq(0);
|
var firId = firTag.attr('id');
|
firTag.css('background-color', '#9bbaf3');
|
BattGroupId = firId;
|
}else if(battId != undefined && batterId == undefined){
|
$(this).next().find('.thr').each(function() {
|
if($(this).attr('id') == battId) {
|
$(this).css('background-color', '#9bbaf3');
|
BattGroupId = battId;
|
location.hash = '#'+battId;
|
location.hash = '';
|
}
|
});
|
}else if(batterId > 0){
|
$(this).next().find('.thr').each(function() {
|
if($(this).attr('id') == batterId) {
|
$('#lside a').css('background-color', "");
|
$(this).css('background-color', '#9bbaf3');
|
BattGroupId = batterId;
|
location.hash = '#'+batterId;
|
location.hash = '';
|
}
|
});
|
}
|
|
searchHistoryBattData(BattGroupId);
|
}
|
});
|
}
|
|
// 根据左导航的状态确定一级菜单的图表
|
function changeFirImg(ele) {
|
var _status = ele.get(0).style.display;
|
if(_status == 'block') {
|
ele.siblings('a').children('.arrow').removeClass('down').addClass('up');
|
}else {
|
ele.siblings('a').children('.arrow').removeClass('up').addClass('down');
|
}
|
}
|
|
// 根据机房id和电池组id定位
|
function locationBattPos(stationid, battId) {
|
var _firTag = $('#lside .fir[name="'+stationid+'"]');
|
|
if(_firTag.next('ul').length == 0) {
|
addLoadingToMenu(stationid);
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchBattByStation",
|
async:true,
|
dataType:'text',
|
data:"json = "+JSON.stringify({
|
StationId:stationid
|
}),
|
success: function(data){
|
data = eval('('+data+')');
|
var model = eval('('+data.result+')');
|
removeLoadingMenu(stationid); // 移除数据加载等待
|
if(model.code == 1){
|
battinlist.push(model.data);
|
createLsideSec(model.data, battId);
|
}
|
},
|
error:function(){
|
|
}
|
});
|
}else {
|
var _ul = _firTag.next();
|
_ul.slideDown();
|
_ul.find('.thr').each(function() {
|
if($(this).attr('id') == battId) {
|
$('#lside a').css('background-color', "");
|
$(this).css('background-color', '#9bbaf3');
|
BattGroupId = battId;
|
location.hash = '#'+battId;
|
location.hash = '';
|
}
|
});
|
|
searchHistoryBattData(BattGroupId);
|
}
|
}
|
|
$('#search_room').unbind('click').on('click','#en_search',function(){
|
//console.info('****');
|
var li_active = $("#search_info ul li.active");
|
if(li_active.attr('name') == 'batt'){
|
//点击的电池组
|
locationBattPos(li_active.attr('stationid'), li_active.attr('value'));
|
$('#search_room').hide();
|
$('#allShade').hide();
|
}else if(li_active.attr('name') == 'station'){
|
//点击的机房
|
locationBattPos(li_active.attr('stationid'));
|
$('#search_room').hide();
|
$('#allShade').hide();
|
}else{
|
alert("请选择一个机房或者电池组!");
|
}
|
|
|
});
|
|
// 向页面的左侧添加加载等待
|
function addLoadingToMenu(stationId) {
|
var ele = $('#lside .fir[name="'+stationId+'"]');
|
var marginLeft = $('#lside').width()/2 - 95; // 获取容器的高度
|
//console.info($('#lside').width());
|
var _div = $('<div class="loading-menu"></div>');
|
var _img = $('<img src="image/right-menu-loading.gif" alt="数据加载中..." />');
|
_div.append(_img);
|
_div.css({
|
'width': '100%',
|
'padding': '10px 0'
|
});
|
_img.css({
|
'margin-left':marginLeft+'px'
|
});
|
ele.after(_div);
|
}
|
|
// 清除左侧的数据等待
|
function removeLoadingMenu(stationId) {
|
var ele = $('#lside .fir[name="'+stationId+'"]');
|
ele.next('.loading-menu').remove();
|
}
|
|
// 根据电池组ID获取当前的机房+电池的字符串
|
function getBattStr() {
|
var battInfo = getBattinfById();
|
//console.info(battInfo);
|
var battStr = battInfo.StationName+'-'+battInfo.BattGroupName+'-标称容量'+battInfo.MonCapStd+'AH';
|
$('#address_infor').text(battStr);
|
}
|
|
/*
|
根据复选框的选中状态返回数据
|
*/
|
function getArrByStatus(arr) {
|
var rs = [];
|
|
// 遍历复选框的是否被选中并将arr的赋给rs
|
$('#charge_thr_th tbody input').each(function(i) {
|
if($(this).is(":checked")) {
|
rs.push(arr[i]);
|
}
|
});
|
|
return rs;
|
}
|
|
/**
|
获取充放电终止原因字符串
|
@param str c_type 充放电类型(充电|放电)
|
@param str s_cause 停止原因
|
@return str rs 需要的停止原因拼接后的字符串
|
*/
|
function getStopCause(c_type, s_cause) {
|
var rs = "";
|
rs = c_type+"(终止原因:"+s_cause+")";
|
return rs;
|
}
|
//查询用户的图表颜色参数
|
function searchUserColor(){
|
$.ajax({
|
type: "post",
|
url: "Chart_ColorAction!serchByCondition",
|
async:true,
|
dataType:'text',
|
data:null,
|
success: function(data){
|
//console.info(data);
|
data = eval('('+data+')');
|
var model = eval('('+data.result+')');
|
if(model.code == 1 && model.data.length>0){
|
cPicker.min = model.data[0].min_color; //最小值颜色
|
cPicker.max = model.data[0].max_color; //最大值颜色
|
cPicker.normal = model.data[0].normal_color; //普通颜色
|
cPicker.change = model.data[0].change_color; //更换颜色
|
cPicker.warn = model.data[0].warn_color; //告警颜色
|
}
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
// 验证是否为40190
|
function regFbsId(str) {
|
var rs = true;
|
var pattern = /^40190/;
|
rs = pattern.test(str);
|
|
return rs;
|
}
|
|
//特殊设备,查询单体的放电的记录
|
function searchMonTestInfo(temp){
|
onlyShowBar(true);
|
// 查询二级collapse的导航
|
$.ajax({
|
type:"post",
|
url: "Ld9testdata_infAction_ld9action_serchByCondition",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
//console.info(model)
|
if(model.code == 1 && model.data.length>0){
|
specialCollapse($('#special-charge-infor .mon-data-content'), model.data);
|
}else {
|
specialCollapse($('#special-charge-infor .mon-data-content'), []);
|
}
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
//特殊设备 ---查询单体的放电数据
|
function searchMonHistoryData(temp){
|
loading.showLoading($('.special-mon-data.special-line-graph.show .mon-data-content'));
|
$.ajax({
|
type:"post",
|
url: "Ld9testdataAction_ld9action_serchByCondition",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
//console.info(model);
|
if(model.code == 1 && model.data.length>0){
|
/* var test_time_arr = new Array();
|
var test_monvol_arr = new Array();
|
var test_groupvol_arr = new Array();
|
var test_onlinevol_arr = new Array();
|
var test_testcurr_arr = new Array(); */
|
//console.info(model.data);
|
var rsData = analyzeLD9SearchData(model.data);
|
|
//console.info(rsData);
|
/* for(var i=0;i<model.data.length;i++){
|
var obj = model.data[i];
|
//console.info(obj);
|
test_time_arr.push(obj.record_time);
|
test_monvol_arr.push(obj.mon_vol.toFixed(3));
|
test_groupvol_arr.push(obj.group_vol.toFixed(1));
|
test_onlinevol_arr.push(obj.online_vol.toFixed(1));
|
test_testcurr_arr.push(obj.test_curr.toFixed(1));
|
} */
|
|
//searchMonHistoryData.testDate = model.data;
|
|
specailMonVolOpts = $.extend(true, {}, specailMonVolOpts, {
|
xdata: rsData.time,
|
sdata: rsData.mon.monVol,
|
lname: rsData.mon.monNum
|
});
|
|
specialGroupVolOpts = $.extend(true, {}, specialGroupVolOpts, {
|
xdata: rsData.time,
|
sdata: [rsData.onlineVol, rsData.groupVol],
|
lname: ['在线电压', '组端电压']
|
});
|
|
specialCurrOpts = $.extend(true, {}, specialCurrOpts, {
|
xdata: rsData.time,
|
sdata: rsData.mon.monCurr,
|
lname: rsData.mon.monNum
|
});
|
|
cSpecailGraphLine();
|
loading.hideLoading($('.special-mon-data.special-line-graph.show .mon-data-content'));
|
}
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
var battstates = [
|
{testtype:0,txt:'测试停止'},
|
{testtype:1,txt:'放电'},
|
{testtype:2,txt:'充电'},
|
{testtype:3,txt:'等待充电'},
|
{testtype:4,txt:'测试完成'},
|
];
|
|
var stopreason = [
|
{sotp_type:0,txt:'无'},
|
{sotp_type:1,txt:'手动停止'},
|
{sotp_type:2,txt:'单体下限到'},
|
{sotp_type:3,txt:'充电完成停止'},
|
{sotp_type:4,txt:'测试完成停止'},
|
{sotp_type:5,txt:'远程停止'},
|
{sotp_type:6,txt:'在线电压低'},
|
];
|
|
|
|
|
// 特殊设备模块
|
$(function() {
|
// 点击二级collapse获取attr并生成三级内容
|
$('#special-charge-infor').on('click', '.collapse .charge-time', function() {
|
// 根据对象查询历史数据
|
var attr = $(this).data().attr;
|
var temp = {
|
BattGroupId:attr.BattGroupId,
|
test_record_count:attr.test_record_count
|
};
|
|
if(!$(this).hasClass('active-thir')) {
|
// 设置背景样式
|
var liList = $(this).parent().siblings();
|
liList.children('a').removeClass('active-thir');
|
$(this).addClass('active-thir');
|
|
onlyShowBar(true);
|
// 查询数据
|
searchLDStopData(temp); //容量柱状图数据
|
searchLD9MonData($(this), temp); //三级导航数据
|
}
|
|
});
|
|
// 点击三级collapse的三级导航
|
$('#special-charge-infor').on('click', '.collapse .ele-mon-item', function() {
|
$('#special-charge-infor .collapse .charge-time').removeClass('active-thir');
|
|
var attr = $(this).data().attr;
|
//console.info(attr);
|
var temp = {
|
BattGroupId:attr.BattGroupId,
|
test_record_count:attr.test_record_count,
|
record_num:attr.record_num,
|
test_monnum:attr.test_monnum
|
};
|
searchLD9MonTestData(temp);
|
searchLD9MonStopData(temp);
|
onlyShowBar(false);
|
});
|
// 双击图表
|
$('.special-line-graph .graph').dblclick(function() {
|
$('.special-line-graph').toggleClass('high-z-index');
|
$(this).toggleClass('big');
|
resizeSpecailGraph();
|
});
|
|
// 导出特殊设备的报表
|
$('#specialGraphExport').click(function() {
|
if($(this).hasClass('whyc-btn-disabled')) {
|
noContent.showNoContent('请选择单体放电测试数据!');
|
|
return false;
|
}
|
//alert('导出数据');
|
//createSpecialGraphLine(specialMonVolLine, specailMonVolOpts);
|
//createSpecialGraphLine(specialGroupVolLine, specialGroupVolOpts);
|
//createSpecialGraphLine(specialCurrLine, specialCurrOpts);
|
|
var monVolLinePng = specialMonVolLine.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
var groupVolLinePng = specialGroupVolLine.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
var currLinePng = specialCurrLine.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
var monCapBarPng = specialMonCapBar.getDataURL({
|
pixelRatio: 1,
|
backgroundColor: '#fff'
|
});
|
|
//console.info(monVolLinePng);
|
//console.info(groupVolLinePng);
|
//console.info(currLinePng);
|
var battInfo = getBattinfById();
|
var params = {
|
pageName:"charge-test-monData",
|
mon_vol_line:monVolLinePng,
|
group_vol_line:groupVolLinePng,
|
test_curr_line:currLinePng,
|
batt_real_cap:monCapBarPng,
|
battinf:JSON.stringify(battInfo),
|
testdatainfo:JSON.stringify(searchMonGroupData.testDatainfo),
|
mon_test_data:JSON.stringify(searchMonHistoryData.testDate),
|
};
|
//console.info(params);
|
var actionUrl = "EchartPictureDowload.servlet";
|
construtFormSubmit(actionUrl,params);
|
|
});
|
// 点击单体实际容量柱状图
|
specialMonCapBar.on('click', function(params) {
|
var _active = $('#special-charge-infor .collapse .charge-time.active-thir');
|
if(_active.length == 0) {
|
_active = $('#special-charge-infor .collapse .charge-time.show');
|
}
|
var monItems = _active.next('ul').find('.ele-mon-item');
|
|
var _secMenu = _active.parent().siblings('li').children('a');
|
_secMenu.removeClass('show');
|
|
_active.addClass('show');
|
// 遍历查询符合的电池单体
|
monItems.each(function(){
|
var _monNum = '#'+$(this).data().attr.test_monnum;
|
if(_monNum == params.name) {
|
$(this).click();
|
}
|
});
|
});
|
});
|
|
/**
|
* 构建form表单,以post方式提交
|
* @param actionUrl 提交路径
|
* @param parms 提交参数
|
* @returns {___form0}
|
*/
|
function construtFormSubmit(actionUrl,parms){
|
var form = document.createElement("form");
|
form.id ='specialGraph';
|
form.style.display='none';
|
form.action = actionUrl;
|
form.enctype="multipart/form-data";
|
form.method="post";
|
document.body.appendChild(form);
|
|
for(var key in parms){
|
var input = document.createElement("input");
|
input.type = "hidden";
|
input.name = key;
|
input.value = parms[key];
|
form.appendChild(input);
|
//console.log(key);
|
//console.log(parms[key]);
|
}
|
form.submit();
|
$('#specialGraph').remove();
|
}
|
|
// 初始化特殊设备的图标
|
function initSpecialGraphLine() {
|
/* specialMonVolLine.clear();
|
specialGroupVolLine.clear();
|
specialCurrLine.clear(); */
|
|
specailMonVolOpts = $.extend({}, specailMonVolOpts, {
|
tname: ['单体电压折线图'],
|
xdata: [],
|
sdata: [],
|
lname: []
|
});
|
|
specialGroupVolOpts = $.extend({}, specialGroupVolOpts, {
|
xdata: [],
|
sdata: [],
|
lname: []
|
});
|
|
specialCurrOpts = $.extend({}, specialCurrOpts, {
|
tname: ['单体测试电流折线图'],
|
xdata: [],
|
sdata: [],
|
lname: []
|
});
|
|
cSpecailGraphLine();
|
|
$('#specialGraphExport').addClass('whyc-btn-disabled')
|
}
|
|
// 分析LD9查询的数据
|
function analyzeLD9SearchData(data) {
|
var rs = {
|
time: [],
|
mon: {
|
monNum: [],
|
monVol: [],
|
monCurr: []
|
},
|
groupVol: [],
|
onlineVol: []
|
}
|
// 遍历查询结果
|
for(var i=0; i<data.length; i++) {
|
var checkRecordTime = checkStrIsExist(rs.time, data[i].record_time);
|
if(checkRecordTime == 'not exist') {
|
rs.time.push(data[i].record_time);
|
rs.groupVol.push(data[i].group_vol);
|
rs.onlineVol.push(data[i].online_vol);
|
}
|
|
var checkMonNum = checkStrIsExist(rs.mon.monNum, data[i].mon_num);
|
if(checkMonNum == 'not exist') {
|
rs.mon.monNum.push(data[i].mon_num);
|
rs.mon.monVol.push([data[i].mon_vol]);
|
rs.mon.monCurr.push([data[i].test_curr]);
|
}else {
|
rs.mon.monVol[checkMonNum].push(data[i].mon_vol);
|
rs.mon.monCurr[checkMonNum].push(data[i].test_curr);
|
}
|
}
|
//console.infor(data);
|
return rs;
|
}
|
|
// 获取当前数据是否已经存在在数组中若存在返回下标否则返回字符串'not exist'
|
function checkStrIsExist(arr, str) {
|
var rs = 'not exist';
|
|
// 遍历time列表查询是否已经存在
|
for(var i=0; i<arr.length; i++) {
|
if(arr[i] == str) {
|
rs = i;
|
}
|
}
|
|
// 返回结果
|
return rs;
|
}
|
|
//查询LD9单体数据(获取本次测试的生成容量数据)
|
function searchLDStopData(temp){
|
$.ajax({
|
type:"post",
|
url: "Ld9testdatastopAction_ld9action_serchByCondition",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
//console.info(model);
|
var sdata = new Array();
|
var xdata = new Array();
|
var batt = getBattinfById();
|
//console.info(batt);
|
for(var i=0;i<batt.MonCount;i++){
|
xdata.push("#"+(i+1));
|
sdata.push(0);
|
}
|
if(model.code == 1 && model.data.length>0){
|
for(var i = 0 ;i < model.data.length ; i++) {
|
var testdata = model.data[i];
|
//var actionvalue = GetMonomerCap(batt.MonCapStd,GetHourRate(batt.MonCapStd,testdata.test_curr),testdata.test_cap,testdata.max_monvol,testdata.mon_vol,batt.MonVolStd,CapType_Real);
|
sdata[testdata.mon_num-1] = testdata.test_cap;
|
}
|
}
|
//console.info(sdata);
|
//console.info(xdata);
|
specailMonCapBarOpts.sdata = sdata;
|
specailMonCapBarOpts.xdata = xdata;
|
specailMonCapBarOpts.lname = ['实际容量'];
|
createSpecialGraphBar(specialMonCapBar, specailMonCapBarOpts);
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
|
//查询LD9单体数据(生成中间的三级导航)
|
function searchLD9MonData(container, temp){
|
$.ajax({
|
type:"post",
|
url: "Ld9testdataAction_ld9action_serchByInfo",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
//console.info("三级导航数据");
|
//console.info(model);
|
if(model.code == 1 && model.data.length>0){
|
cSpecialCollapseThir(container, model.data);
|
}
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
//查询LD9单体的放电数据
|
function searchLD9MonTestData(temp){
|
$.ajax({
|
type:"post",
|
url: "Ld9testdataAction_ld9action_serchByCondition",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
var testtiem_arr = new Array(); //测试时间
|
var groupvol_arr = new Array(); //组端电压
|
var onlinevol_arr = new Array(); //在线电压
|
var testcurr_arr = new Array(); //测试电流
|
var mon_vol_arr = new Array(); //单体电压
|
|
if(model.code == 1 && model.data.length>0){
|
searchMonHistoryData.testDate = model.data;
|
for(var i = 0;i < model.data.length;i++){
|
var temp = model.data[i];
|
testtiem_arr.push(temp.record_time);
|
groupvol_arr.push(temp.group_vol);
|
onlinevol_arr.push(temp.online_vol);
|
testcurr_arr.push(temp.test_curr);
|
mon_vol_arr.push(temp.mon_vol);
|
}
|
|
specailMonVolOpts = $.extend({}, specailMonVolOpts, {
|
xdata: testtiem_arr,
|
sdata: [mon_vol_arr],
|
tname: ['单体#'+temp.test_monnum+'测试电压折线图'],
|
lname: ['#'+temp.test_monnum+'电压']
|
});
|
|
specialGroupVolOpts = $.extend({}, specialGroupVolOpts, {
|
xdata: testtiem_arr,
|
sdata: [ onlinevol_arr, groupvol_arr],
|
lname: ['在线电压', '组端电压']
|
});
|
|
specialCurrOpts = $.extend({}, specialCurrOpts, {
|
xdata: testtiem_arr,
|
sdata: [testcurr_arr],
|
tname: ['单体#'+temp.test_monnum+'测试电流折线图'],
|
lname: ['#'+temp.test_monnum+'电流']
|
});
|
|
cSpecailGraphLine();
|
}
|
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
//查询当次测试时的组端信息(当前测试的信息)
|
function searchLD9MonStopData(temp){
|
$.ajax({
|
type:"post",
|
url: "Ld9testdatastopAction_ld9action_serchByInfo",
|
async:true,
|
dataType:'json',
|
data:"json="+JSON.stringify(temp),
|
success: function(data){
|
var model = eval('('+data.result+')');
|
//console.info("页面头部数据");
|
//console.info(model);
|
if(model.code == 1 && model.data.length>0){
|
searchMonGroupData(model.data[0]);
|
}
|
},
|
error:function(){
|
console.info("查询失败,请检查网络连接");
|
}
|
});
|
}
|
|
//根据测试状态码获取测试的类型
|
function getBattStateByTestType(testtype){
|
for(var i =0;i<battstates.length;i++){
|
if(battstates[i].testtype == testtype){
|
return battstates[i].txt;
|
}
|
}
|
return "未知";
|
}
|
|
//获取单体放电的停止原因
|
function getTestStopReason(stoptype){
|
for(var i=0;i<stopreason.length;i++){
|
if(stopreason[i].sotp_type == stoptype){
|
return stopreason[i].txt;
|
}
|
}
|
return "未知";
|
}
|
|
//特殊设备 ---查询单体的放电数据
|
function searchMonGroupData(temp){
|
var obj = temp;
|
//console.info(obj);
|
$('#ele_state').val(getBattStateByTestType(obj.test_type)+"("+getTestStopReason(obj.test_stopreason)+")"); //电池状态
|
$('#ele_tension').val(obj.group_vol+"V"); //组端电压
|
$('#ele_current').val(obj.test_curr+"A"); //电池电流
|
$('#test_date').val(obj.test_starttime); //测试时间
|
$('#test_time').val(formatSeconds(obj.test_timelong)); //测试时长
|
$('#test_content').val(obj.test_cap+"AH"); //测试容量
|
$('#over_content').val(0); //剩余容量
|
$('#reserve_time').val(""); //续航时间
|
var batt = getBattinfById();
|
batt.BattGroupName6 = getTestStopReason(obj.test_stopreason); //测试停止原因
|
batt.BattGroupName5 = getBattStateByTestType(obj.test_type); //测试类型
|
|
searchMonGroupData.testDatainfo = temp;
|
|
}
|
|
// 根据BattGroupId查询电池组放电历史信息
|
function searchHistoryBattData(bid) {
|
var fbsId = $('#'+bid).attr('fbs');
|
var isSpecial = regFbsId(fbsId);
|
//console.info(isSpecial);
|
if(isSpecial) {
|
loading.hideLoading($('#charge_sec_infor'));
|
$('.special-mon-data').addClass('show');
|
var temp = {
|
BattGroupId:$('#'+bid).attr("id")
|
};
|
searchMonTestInfo(temp);
|
resizeSpecailGraph();
|
}else {
|
getBattStr();
|
findBattinfObj();
|
AllBataDate=new Array();
|
findBatttestdata_infByBattGroupId();
|
}
|
}
|
|
// 设置标称容量
|
function setNomCap() {
|
var batt = getBattinfById();
|
var cont = '当前电池组的标称容量:<input style="border: 1px solid #ccc;height: 24px;" type="text" value="'+batt.MonCapStd+'" class ="batt-moncapstd">AH';
|
myConfirm.show({content: cont, class: 'show-historydata'});
|
}
|
// siderbar模块
|
$(function() {
|
var TreeView = GLOBAL.pages.TreeView;
|
var first = GLOBAL.pages.siderbar.first; // 一级导航
|
var second = GLOBAL.pages.siderbar.second; // 二级导航
|
var third = GLOBAL.pages.siderbar.third; // 三级导航
|
var fourth = GLOBAL.pages.siderbar.fourth; // 四级导航
|
var fifth = GLOBAL.pages.siderbar.fifth; // 五级导航
|
var localSideBar = GLOBAL.pages.siderbar.localSideBar; // 定位机房
|
var treeView = new TreeView($('#lside'));
|
$('#lside').width($('#ele_content').width());
|
treeView.setContainer();
|
// 设置容器可拖动
|
$('#ele_content').resizable({
|
handles: 'e',
|
maxWidth: 520,
|
minWidth: 200,
|
alsoResize: $('#lside'),
|
resize:function() {
|
treeView.setContainer();
|
}
|
});
|
|
// 生成一级导航-省
|
first(treeView, treeView.container);
|
|
// 省->市
|
treeView.ele.on('click', '.province', function() {
|
var province = $(this).data('attr');
|
second(treeView, $(this).parent(), province);
|
});
|
|
// 市->区
|
treeView.ele.on('click', '.city', function() {
|
var city = $(this).data('attr');
|
third(treeView, $(this).parent(), city);
|
});
|
|
// 区->机房
|
treeView.ele.on('click', '.county', function() {
|
var county = $(this).data('attr');
|
fourth(treeView, $(this).parent(), county);
|
});
|
|
|
battinlist = [];
|
// 机房->电池组
|
treeView.ele.on('click', '.home', function() {
|
var home = $(this).data('attr');
|
var tmp = {
|
StationName1: home.StationName1,
|
StationName2: home.StationName2,
|
StationName5: home.StationName5,
|
StationName: home.StationName,
|
StationId: home.StationId
|
};
|
fifth(treeView, $(this).parent(), tmp);
|
});
|
|
// 电池组
|
treeView.ele.on('click', '.eleGroup', function() {
|
var eleGroup = $(this).data('attr');
|
|
// 初始化特殊设备的图标
|
initSpecialGraphLine();
|
|
//显示电池的详细信息
|
$('#address_infor').text($(this).parent().parent().parent().parent().siblings().first().text()+"-"+$(this).parent().parent().siblings().first().text()+"-"+$(this).text());
|
var fbsId = eleGroup.FBSDeviceId;
|
var isSpecial = regFbsId(fbsId);
|
$('.special-mon-data').removeClass('show');
|
BattGroupId=$(this).attr("id");
|
if(isSpecial) {
|
$('.special-mon-data').addClass('show');
|
var temp = {
|
BattGroupId:$(this).attr("id")
|
};
|
searchMonTestInfo(temp);
|
resizeSpecailGraph();
|
}else {
|
getBattStr();
|
findBattinfObj();
|
AllBataDate=new Array();
|
clearfourPicture();
|
findBatttestdata_infByBattGroupId();
|
searchAll_lowAction(); //获取阀值
|
}
|
|
// 设置记录的笔数为-1
|
$('#testrecordcout').val('-1');
|
});
|
|
// 右键菜单显示
|
treeView.ele.on('mousedown', '.eleGroup', function(e) {
|
//利用jquery的方式获取当前点击的是否是右键
|
if(e.which==3)
|
{
|
BattGroupId=$(this).attr("id");
|
var disX=(e||event).clientX+10; //得到鼠标点击X的位置
|
var disY=(e||event).clientY+10; //得到鼠标点击Y的位置
|
var scrollY=$(window).scrollTop(); //获取浏览器滚动的高度
|
//console.log(scrollY);
|
var oRightMenu=document.getElementById("right_menu");
|
|
$(this).click();
|
|
//显示菜单内容
|
$("#right_menu").show();
|
$("#right_menu .more_menu").hide();
|
$("#right_menu .angle").hide();
|
//console.log(disX+"***"+disY);
|
//使菜单跟随鼠标位置
|
oRightMenu.style.left= disX+'px';
|
oRightMenu.style.top= disY+scrollY+'px';
|
|
setPosition($("#right_menu"),disX, disY);
|
|
}
|
});
|
|
//全部收缩
|
$('#all_hide').click(function(){
|
treeView.ele.find('li').removeClass('sider-menu-open');
|
});
|
|
// 电池充放电数据监控
|
var batt_list = $('.batt-listen .batt-list');
|
batt_list.on('click', 'a', function(){
|
batt_list.find('a').removeClass('active');
|
$(this).addClass('active');
|
var battInfo = $(this).parent().data('attr');
|
|
var tmp = {
|
province: battInfo.province,
|
city: battInfo.city,
|
home: battInfo.home,
|
county: battInfo.county,
|
homeid: battInfo.note,
|
battid: battInfo.val
|
};
|
localSideBar(treeView, treeView.container, tmp);
|
});
|
|
// 工具条整体样式
|
$('.siderbar-tools').tooltip();
|
|
// 工具条-机历卡
|
$('#siderbarToolsCard').click(function(){
|
var batt = getBattinfById();
|
var tmp = {
|
province: batt.StationName1,
|
city: batt.StationName2,
|
home: batt.StationName,
|
county: batt.StationName5,
|
homeid: batt.StationId,
|
battid: batt.BattGroupId
|
};
|
// findBattinfByBattGroupId(batt.BattGroupId);
|
// findStationInfoByStation(batt);
|
// 显示基站机历卡
|
console.log(batt);
|
showHomeInfo(batt.StationId);
|
// 根据数据定位
|
localSideBar(treeView, treeView.container, tmp);
|
});
|
|
// 工具条-全部收缩
|
$('#siderbarToolsHide').click(function(){
|
treeView.ele.find('li').removeClass('sider-menu-open');
|
});
|
|
// 工具条-查询
|
$('#siderbarToolsSearch').click(function(){
|
localNav.homeInfo = undefined;
|
$('#popupHomeName').val('');
|
localNav.showPopup();
|
$('#popupHomeName').focus();
|
});
|
|
// 点击面板的确定按钮
|
$('#localNav_en').click(function() {
|
// 定位
|
if(localNav.homeInfo) {
|
localNav.hidePopup();
|
localSideBar(treeView, treeView.container, localNav.homeInfo);
|
}else {
|
|
}
|
});
|
|
|
// 查询机房并更新source
|
var homeSource = [];
|
findHome();
|
|
// 定义机房查询信息
|
$( "#popupHomeName" ).autocomplete({
|
source: homeSource,
|
select: function(event, ui) {
|
localNav.homeInfo = ui.item; // 设置机房信息内容
|
}
|
});
|
|
// 查询机房
|
function findHome() {
|
var tmp = {
|
StationName1:'',
|
StationName2: '',
|
StationName5: ''
|
};
|
|
// 查询将信息
|
$.post("BattInfAction!serchStationName3","json="+JSON.stringify(tmp),function(result){
|
var rs = JSON.parse(result.result);
|
if(rs.code==1){
|
homeSource = [];
|
var data = rs.data;
|
for(var i=0; i<data.length; i++) {
|
var _data = data[i];
|
var tmp = {
|
label: _data.StationName+'('+_data.StationId+')',
|
province: _data.StationName1,
|
city: _data.StationName2,
|
county: _data.StationName5,
|
home: _data.StationName,
|
homeid: _data.StationId,
|
battid: undefined
|
};
|
|
// 添加到资源
|
homeSource.push(tmp);
|
}
|
$( "#popupHomeName" ).autocomplete('option', 'source', homeSource);
|
}
|
});
|
}
|
});
|
|
// 机历卡模块
|
$(function() {
|
// 获取选项卡列表
|
var tabs = $('#cardInfoTab .whyc-tab-title li');
|
var tabContents = $('#card_infor .con-list');
|
// 点击tabs触发
|
tabs.click(function() {
|
var index = $(this).index();
|
// 移除特效
|
tabs.removeClass('whyc-tab-this');
|
tabContents.removeClass('con-show');
|
|
// 显示特效
|
$(this).addClass('whyc-tab-this');
|
tabContents.eq(index).addClass('con-show');
|
});
|
});
|
</script>
|
</html>
|