<%@ 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>
|
<base href="<%=basePath%>">
|
|
<meta charset="UTF-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
<title><s:text name="Battery_discharge_test"/></title> <!-- 蓄电池放电测试 -->
|
<link rel="stylesheet" type="text/css" href="css/basic.css">
|
<link rel="stylesheet" type="text/css" href="css/BrdwDeal.css">
|
<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/base.js"></script>
|
<style type="text/css">
|
/*定义被鼠标点击的背景色*/
|
.b8cfe5{
|
background-color:#b8cfe5;
|
}
|
/*右键菜单内容*/
|
#right-menu{
|
display:none;
|
_display:none;
|
position:absolute;
|
width:200px;
|
border:1px solid #b6c1fa;
|
background-color:#fff;
|
font-size: 12px;
|
top:0;
|
left:0;
|
z-index:99999999;
|
}
|
#right-menu a{
|
display:block;
|
_display:block;
|
padding:8px 16px;
|
color:#000;
|
text-decoration:none;
|
}
|
#right-menu a:hover{
|
background-color:#aae5f7;
|
}
|
#right-menu a:visited{
|
color:#000;
|
}
|
#right-menu .hide-menu{
|
border-bottom:1px solid #b6c1fa;
|
}
|
/*添加权限组*/
|
#addPwr{
|
display:none;
|
position:absolute;
|
width:260px;
|
background-color:#fff;
|
left:50%;
|
margin-left:-150px;
|
top:200px;
|
z-index: 99999990;
|
}
|
#addPwr span{
|
display: block;
|
width:100%;
|
height:30px;
|
text-indent:1.5em;
|
line-height:30px;
|
font-weight:bold;
|
background:url(image/table_th_bg.gif) repeat-x;
|
}
|
#addPwr .txt-con{
|
width:100%;
|
height:60px;
|
}
|
#addPwr .txt-con input[type="text"]{
|
width:180px;
|
height:30px;
|
line-height: 30px;
|
margin-top:20px;
|
margin-left:30px;
|
border:1px solid #b8cfe5;
|
}
|
#addPwr .btn-con{
|
width:100%;
|
margin-top:10px;
|
margin-bottom:20px;
|
}
|
#addPwr .btn-con input[type="button"]{
|
/*初始化按钮*/
|
font-size: 12px;
|
text-decoration: none!important;
|
font-family: Helvetica, Arial, sans serif;
|
padding: 6px 12px;
|
border-radius: 3px;
|
-moz-border-radius: 3px;
|
box-shadow: inset 0px 0px 2px #fff;
|
-o-box-shadow: inset 0px 0px 2px #fff;
|
-webkit-box-shadow: inset 0px 0px 2px #fff;
|
-moz-box-shadow: inset 0px 0px 2px #fff;
|
/*定义颜色和样式*/
|
color: #41788c;
|
border: 1px solid #6fb1c7;
|
background-image: -moz-linear-gradient(#aae5f7, #73d0f1);
|
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#73d0f1), to(#aae5f7));
|
background-image: -webkit-linear-gradient(#aae5f7, #73d0f1);
|
background-image: -o-linear-gradient(#aae5f7, #73d0f1);
|
text-shadow: 1px 1px 1px #bfeafb;
|
background-color: #73d0f1;
|
/*按钮的上右下左的距离*/
|
margin-left:40px;
|
}
|
#addPwr .btn-con input[type="button"]:hover{
|
border: 1px solid #4690ad;
|
background-image: -moz-linear-gradient(#73d0f1, #aae5f7);
|
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#aae5f7), to(#73d0f1));
|
background-image: -webkit-linear-gradient(#73d0f1, #aae5f7);
|
background-image: -o-linear-gradient(#73d0f1, #aae5f7);
|
background-color: #aae5f7;
|
}
|
/*重命名权限组*/
|
#rename{
|
display:none;
|
position:absolute;
|
width:260px;
|
background-color:#fff;
|
left:50%;
|
margin-left:-150px;
|
top:200px;
|
z-index: 99999990;
|
}
|
#rename span{
|
display: block;
|
width:100%;
|
height:30px;
|
line-height:30px;
|
text-indent:1.5em;
|
font-weight:bold;
|
background:url(image/table_th_bg.gif) repeat-x;
|
}
|
#rename .txt-con{
|
width:100%;
|
height:60px;
|
}
|
#rename .txt-con input[type="text"]{
|
width:180px;
|
height:30px;
|
line-height: 30px;
|
margin-top:20px;
|
margin-left:30px;
|
border:1px solid #b8cfe5;
|
}
|
#rename .btn-con{
|
width:100%;
|
margin-top:10px;
|
margin-bottom:20px;
|
}
|
#rename .btn-con input[type="button"]{
|
/*初始化按钮*/
|
font-size: 12px;
|
text-decoration: none!important;
|
font-family: Helvetica, Arial, sans serif;
|
padding: 6px 12px;
|
border-radius: 3px;
|
-moz-border-radius: 3px;
|
box-shadow: inset 0px 0px 2px #fff;
|
-o-box-shadow: inset 0px 0px 2px #fff;
|
-webkit-box-shadow: inset 0px 0px 2px #fff;
|
-moz-box-shadow: inset 0px 0px 2px #fff;
|
/*定义颜色和样式*/
|
color: #41788c;
|
border: 1px solid #6fb1c7;
|
background-image: -moz-linear-gradient(#aae5f7, #73d0f1);
|
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#73d0f1), to(#aae5f7));
|
background-image: -webkit-linear-gradient(#aae5f7, #73d0f1);
|
background-image: -o-linear-gradient(#aae5f7, #73d0f1);
|
text-shadow: 1px 1px 1px #bfeafb;
|
background-color: #73d0f1;
|
/*按钮的上右下左的距离*/
|
margin-left:40px;
|
}
|
#rename .btn-con input[type="button"]:hover{
|
border: 1px solid #4690ad;
|
background-image: -moz-linear-gradient(#73d0f1, #aae5f7);
|
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#aae5f7), to(#73d0f1));
|
background-image: -webkit-linear-gradient(#73d0f1, #aae5f7);
|
background-image: -o-linear-gradient(#73d0f1, #aae5f7);
|
background-color: #aae5f7;
|
}
|
|
#paging a{
|
margin-right:40px;
|
}
|
#paging .empty{
|
margin-left:50px;
|
}
|
</style>
|
</head>
|
<body>
|
<!--头部内容开始-->
|
<div id="top">
|
<div id="top_cont">
|
<img src="image/top_img01.jpg" alt="" title="福建福光有限公司" />
|
<!--用户登录后显示用户名鼠标经过显示下拉菜单-->
|
<div id="sign_out">
|
<a href="javascript:void(0)" id="user_name"></a><span class="triangle"></span>
|
<ul>
|
<!-- 密码修改 -->
|
|
<li><a href="pwdChange.jsp" target="_self"><s:text
|
name="Change_password"></s:text>
|
</a>
|
</li>
|
<!-- 安全退出 -->
|
<li><a href="javascript:exitUser()" id="li_a"><s:text
|
name="Logging_out"></s:text>
|
</a>
|
</li>
|
|
</ul>
|
</div>
|
</div>
|
</div>
|
<!--头部内容结束-->
|
<!-- 主体内容 -->
|
<div id="main">
|
<!--导航开始-->
|
<div id="nav"></div>
|
<!--导航结束-->
|
<div id="eleInfor">
|
<span class="summary">显示和隐藏查询条件</span>
|
<div class="checkCon">
|
<table>
|
<tr class="fWeight">
|
<td>维护区</td>
|
<td>机房站点(或机房设备)</td>
|
<td>蓄电池组</td>
|
</tr>
|
<tr>
|
<td>
|
<select name="" id="station_name1">
|
|
</select>
|
</td>
|
<td>
|
<select name="" id="station_name">
|
|
</select>
|
</td>
|
<td>
|
<select name="" id="battgroup_name">
|
|
</select>
|
</td>
|
</tr>
|
</table>
|
</div>
|
</div>
|
<!-- 表格固定的头部 -->
|
<div id="tbHead">
|
<!-- <table class="tbFixed">这里是表格固定头部的内容</table> -->
|
</div>
|
<!-- 表格滚动的部分 -->
|
<div id="tbBrdw">
|
<!-- <table class="tbScroll">这里是表格滚动的内容</table> -->
|
</div>
|
<!-- 分页内容 -->
|
<div id="paging">
|
<a href="javascript:" class="addsingle">添加单组电池组</a>
|
<a href="javascript:" class="addbatch">添加整个机房电池组</a>
|
<label>共</label><span id="total">0</span> <label>个电池组</label>
|
<a href="javascript:" class="empty">启动测试</a>
|
<a href="javascript:" class="upload">停止测试</a>
|
</div>
|
</div>
|
<!-- 主体内容结束 -->
|
<!-- 右键菜单内容 -->
|
<div id="right-menu">
|
<a href="javascript:;" class="re-current">批量修改测试电流</a>
|
<a href="javascript:;" class="re-test-time">批量修改测试时间</a>
|
<a href="javascript:;" class="remove-tr">移除被测电池组</a>
|
<a href="javascript:;" class="all-pitch">选择全部</a>
|
</div>
|
<!-- 批量修改测试电流 -->
|
<div id="addPwr">
|
<span>修改测试电流值(0-2000A)</span>
|
<div class="txt-con">
|
<input type="text" value="" placeholder="测试电流值">
|
</div>
|
<div class="btn-con">
|
<input type="button" class="enSure" value="确定">
|
<input type="button" class="outAdd" value="退出">
|
</div>
|
</div>
|
<!-- 批量修改测试时间 -->
|
<div id="rename">
|
<span>修改测试时间(1-2400分钟)</span>
|
<div class="txt-con">
|
<input type="text" value="" placeholder="测试时间">
|
</div>
|
<div class="btn-con">
|
<input type="button" class="enSure" value="确定">
|
<input type="button" class="out" value="退出">
|
</div>
|
</div>
|
<div id="allShade"></div>
|
<!--清除浮动-->
|
<div class="clear"></div>
|
</body>
|
<script type="text/javascript" src="js/buildNav.js"></script>
|
<script type="text/javascript" src="js/createTab.js"></script>
|
<script type="text/javascript" src="js/base.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);
|
<% } %>
|
|
//屏蔽浏览器右键菜单功能
|
$(document).ready(function(){
|
setUserName();
|
document.oncontextmenu=function(){
|
return false;
|
};
|
});
|
//初始化页面内容
|
$(document).ready(function(){
|
//定义页面高度
|
var srnHt=$(window).height(); //浏览器可以区域的高度
|
var bodyHt=$('body').height(); //body的高度
|
var tbHt=$('#tbBrdw').height(); //表格容器的高度
|
//对比浏览器和body高度
|
if(srnHt>bodyHt)
|
{
|
$('#tbBrdw').height(tbHt+srnHt-bodyHt);
|
}
|
$(window).resize(function(){
|
var newSrnHt=$(window).height(); //浏览器可以区域的高度
|
var newBodyHt=$('body').height(); //body的高度
|
var newTbHt=$('#tbBrdw').height(); //表格容器的高度
|
$('#tbBrdw').height(newTbHt+newSrnHt-newBodyHt);
|
});
|
//点击显示和隐藏,隐藏和显示查询条件
|
var flag=1; //判断查询条件是否被隐藏
|
var checkConHt=$('#eleInfor .checkCon').height(); //获取查询条件容器的高度
|
$('#eleInfor .summary').click(function(){
|
var tbHt=$('#tbBrdw').height(); //获取表格容器的高度
|
if(flag==1)
|
{
|
flag=0; //改变值表示为隐藏
|
$('#eleInfor .checkCon').slideUp(300);
|
//设置延时防止页面溢出,出现滚动条
|
setTimeout(function(){
|
$('#tbBrdw').height(tbHt+checkConHt);
|
},302);
|
}else{
|
flag=1; //显示
|
$('#tbBrdw').height(tbHt-checkConHt);
|
$('#eleInfor .checkCon').slideDown();
|
}
|
});
|
});
|
|
|
|
//生成表格并对表格进行操作
|
$(document).ready(function(){
|
//定义表格数据数组变量
|
var ArrTh=new Array();
|
var ArrTd=new Array();
|
//定义表格头部数据
|
ArrTh=['电池组ID','电池组名称','测试类型','测试电流(A)','测试时长(M)','测试状态','已测时间'];
|
//生成表格头部
|
createTable('tbHead','tbFixed',ArrTh.length,ArrTh,ArrTd);
|
createTable('tbBrdw','tbScroll',ArrTh.length,ArrTh,ArrTd);
|
// 让表格宽度自适应容器大小
|
var tbWidth=$('#tbHead').width(); //获取容器的大小
|
$('#tbHead table').width(tbWidth-20);
|
$('#tbBrdw table').width(tbWidth-20);
|
//上下滚动同步
|
$("#tbBrdw").scroll(function(){
|
var scrollX=$(this).scrollLeft();
|
$('#tbHead table').css('left',-scrollX);
|
});
|
function addTd(ele,len,__ArrTd){
|
//定义tr和td标签
|
var __ArrTagTr=new Array();
|
var __ArrTagTd=new Array();
|
var __TrLength=0;
|
__TrLength=Math.ceil(__ArrTd.length/len);
|
//创建tr
|
for(var i=0;i<__TrLength;i++)
|
{
|
__ArrTagTr[i]=$('<tr></tr>');
|
}
|
//给每个td添加文本
|
for(var i=0;i<__ArrTd.length;i++)
|
{
|
__ArrTagTd[i]=$('<td>'+__ArrTd[i]+'</td>');
|
}
|
var n=0;
|
//根据len将td添加到对应的行
|
for(var i=0;i<__TrLength;i++)
|
{
|
for(var k=0;k<len;k++)
|
{
|
__ArrTagTr[i].append(__ArrTagTd[n]);
|
n++;
|
}
|
}
|
for(var i=0;i<__TrLength;i++)
|
{
|
ele.append(__ArrTagTr[i]);
|
}
|
}
|
|
//向表格中添加数据
|
function addTable(model){
|
//alert(ArrTd);
|
ArrTd=new Array();
|
if(model!=undefined && model.code==1 && model.data.length>0){
|
var index=0;
|
var length=0;
|
var battgroupids=new Array();
|
$('#tbBrdw table tr .eleid').each(function(i){
|
battgroupids[i]=$(this).text();
|
});
|
//alert(battgroupids);
|
for(var i=0;i<model.data.length;i++){
|
var flag=true;
|
var data=model.data[i];
|
for(var j=0;j<battgroupids.length;j++){
|
//console.info(data);
|
if(battgroupids[j]==data.BattGroupId){
|
flag=false;
|
alert("蓄电池组:"+data.StationName+""+data.BattGroupName+"已经存在!");
|
break;
|
}
|
}
|
if(flag){
|
length++;
|
ArrTd[index++]=data.BattGroupId; //电池组id
|
ArrTd[index++]=data.StationName+""+data.BattGroupName; //电池组名称
|
ArrTd[index++]="拉闸放电"; //测试类型
|
ArrTd[index++]=100; //测试电流
|
ArrTd[index++]=60; //测试时长
|
ArrTd[index++]="已停止"; //测试状态
|
ArrTd[index++]="00:00:00"; //已测时间
|
}
|
}
|
var num=$('#total').text()
|
$('#total').text(parseInt(num)+length);
|
addTd($('#tbHead table tbody'),ArrTh.length,ArrTd);
|
addTd($('#tbBrdw table tbody'),ArrTh.length,ArrTd);
|
//遍历tr给tr的第三个单元格添加class="sel"和"ipt"
|
$('#tbBrdw table tbody tr').each(function(){
|
$(this).find('td').eq(0).addClass('eleid');
|
$(this).find('td').eq(2).addClass('sel');
|
$(this).find('td').eq(3).addClass('ipt');
|
$(this).find('td').eq(4).addClass('ipt');
|
});
|
|
// 表格隐藏部分做同样的事情
|
$('#tbHead table tbody tr').each(function(){
|
$(this).find('td').eq(2).addClass('sel');
|
$(this).find('td').eq(3).addClass('ipt');
|
$(this).find('td').eq(4).addClass('ipt');
|
});
|
}
|
}
|
|
//点击添加单个电池组
|
$('#paging .addsingle').click(function(){
|
var battgroupid=$('#battgroup_name').prop('value');
|
if(battgroupid!=undefined && battgroupid>0){
|
$.post("BattInfAction!searchBattBybattgroupid","bif.BattGroupId="+battgroupid,function(data){
|
model=eval("("+data.result+")");
|
//console.info(model);
|
addTable(model);
|
});
|
}else{
|
alert("请先选择一组电池");
|
}
|
});
|
|
//点击添加机房
|
$('#paging .addbatch').click(function(){
|
var stationname=$('#station_name').find(":selected").prop('value');
|
//alert(stationname);
|
if(stationname!=0 && stationname!=''){
|
$.post("BattInfAction!serchByBattGroupName","bif.StationName1=&bif.StationName="+stationname,function(data){
|
model=eval("("+data.result+")");
|
addTable(model);
|
});
|
}else{
|
alert("请先选择一个机房");
|
}
|
});
|
|
var trIndex=0; //获取当前行的下标
|
//点击表格变色(给点击的行添加class)
|
$('#tbBrdw').on('click','table tbody tr',function(){
|
trIndex=$(this).index();
|
//点击当前行的被境改变
|
$('#tbBrdw table tbody tr').removeClass('b8cfe5');
|
$(this).addClass('b8cfe5');
|
});
|
//点击表格当前行变色
|
$('#tbBrdw table tbody tr').live('mousedown',function(e){
|
//如果当前行不存在class="b8cfe5"
|
if($(this).hasClass('b8cfe5')==false)
|
{
|
//点击当前行的被境改变
|
$('#tbBrdw table tbody tr').removeClass('b8cfe5');
|
$(this).addClass('b8cfe5');
|
}
|
//利用jquery的方式获取当前点击的是否是右键
|
if(e.which==3)
|
{
|
trIndex=$(this).index(); //获取点击的是第几个tr
|
var disX=(e||event).clientX+10; //获取鼠标点击的横坐标
|
var disY=(e||event).clientY+10; //获取鼠标点击的纵坐标
|
var scrollY=$(document).scrollTop();
|
$('#right-menu').css('top',disY+scrollY+'px');
|
$('#right-menu').css('left',disX+'px');
|
$('#right-menu').show();
|
}
|
});
|
//点击移除被测电阻,移除当前带class="b8cfe5"的行
|
$('#right-menu .remove-tr').click(function(){
|
//移除选项
|
$('#tbBrdw table tbody .b8cfe5').remove();
|
});
|
//点击全部选中选中整个表格
|
$('#right-menu .all-pitch').click(function(){
|
//添加class
|
$('#tbBrdw table tbody tr').addClass('b8cfe5');
|
});
|
|
//点击批量修改测试电流按钮
|
$('#right-menu .re-current').click(function(){
|
//显示弹出框
|
$('#addPwr').show();
|
//生成遮罩层
|
createAllMask($('body'),0.5);
|
});
|
//点击批量修改电流窗口的确定
|
$('#addPwr .btn-con .enSure').click(function(){
|
var txtVal=$('#addPwr .txt-con input[type="text"]').val();
|
if(txtVal>=0 && txtVal<=2000){
|
//遍历每行第一个class='ipt'的单元格并给txtVal
|
$('#tbBrdw table tbody tr').each(function(){
|
$(this).children('.ipt').eq(0).text(txtVal);
|
});
|
//表格隐藏部分
|
$('#tbHead table tbody tr').each(function(){
|
$(this).children('.ipt').eq(0).text(txtVal);
|
});
|
}else{
|
alert("请输入正确的数值格式!!!");
|
}
|
//隐藏窗口
|
$('#addPwr').hide();
|
//删除遮罩层
|
$('body').children('.mask').hide();
|
|
});
|
//点击批量修改点测试电流窗口的退出
|
$('#addPwr .btn-con .outAdd').click(function(){
|
//隐藏窗口
|
$('#addPwr').hide();
|
//删除遮罩层
|
$('body').children('.mask').hide();
|
});
|
//点击批量修改测试电流按钮
|
$('#right-menu .re-test-time').click(function(){
|
//显示弹出框
|
$('#rename').show();
|
//生成遮罩层
|
createAllMask($('body'),0.5);
|
});
|
|
//点击批量修改电流窗口的确定
|
$('#rename .btn-con .enSure').click(function(){
|
var txtVal=$('#rename .txt-con input[type="text"]').val();
|
if(txtVal>=1 && txtVal<=2400){
|
//遍历每行第一个class='ipt'的单元格并给txtVal
|
$('#tbBrdw table tbody tr').each(function(){
|
$(this).children('.ipt').eq(1).text(txtVal);
|
});
|
//表格隐藏部分
|
$('#tbHead table tbody tr').each(function(){
|
$(this).children('.ipt').eq(1).text(txtVal);
|
});
|
}else{
|
alert("请输入正确的数值格式!!!");
|
}
|
//隐藏窗口
|
$('#rename').hide();
|
//删除遮罩层
|
$('body').children('.mask').hide();
|
});
|
//点击批量修改测试时长窗口的退出
|
$('#rename .btn-con .out').click(function(){
|
//隐藏窗口
|
$('#rename').hide();
|
//删除遮罩层
|
$('body').children('.mask').hide();
|
});
|
|
//点击页面的其他位置右键菜单消失
|
$('div:not("#tb-body")').click(function(){
|
$('#right-menu').hide();
|
});
|
//点击表格的测试类型列生成下拉框
|
$('#tbBrdw').on('click','table tbody tr .sel',function(){
|
//获取点击的是几个sel
|
var selIndex=$(this).index('#tbBrdw .sel');
|
//使选中标签为激活状态
|
$('#tbBrdw table tbody tr .sel').removeClass('sel-action');
|
$(this).addClass('sel-action');
|
//给隐藏的表格添加同样事件
|
$('#tbHead table tbody tr .sel').removeClass('sel-action');
|
$('#tbHead .sel').eq(selIndex).addClass('sel-action');
|
var optArr=new Array();
|
optArr=['拉闸放电','核对性放电','容量测试放电','充电'];
|
var txt=$(this).text();
|
if($(this).find('select').length==0)
|
{
|
//清除表格内容
|
$(this).text('');
|
$('#tbHead .sel').eq(selIndex).text('');
|
createSelect($(this),optArr,txt);
|
createSelect($('#tbHead .sel').eq(selIndex),optArr,txt);
|
}
|
});
|
//点击表格其他位置下拉消失
|
$('#tbBrdw').on('mousedown','table tbody tr td:not(".sel-action")',function(){
|
if($('#tbBrdw table tbody tr .sel-action').length>0)
|
{
|
var selTxt=$('#tbBrdw table tbody tr .sel-action').find(
|
'option:selected').text();
|
//清除select
|
$('#tbBrdw table tbody tr .sel select').remove();
|
$('#tbHead table tbody tr .sel select').remove();
|
//将被选值添加到表格内
|
$('#tbBrdw table tbody tr .sel-action').text(selTxt);
|
$('#tbHead table tbody tr .sel-action').text(selTxt);
|
//移除class="sel-action"
|
$('#tbBrdw table tbody tr .sel').removeClass('sel-action');
|
$('#tbHead table tbody tr .sel').removeClass('sel-action');
|
}
|
});
|
//双击页面特定列表格变为input
|
$('#tbBrdw').on('dblclick','table tbody tr .ipt',function(){
|
var txtIndex=$(this).index('#tbBrdw .ipt');
|
if($(this).find('input').length==0)
|
{
|
var txt=$(this).text();
|
//表格处在激活状态
|
$(this).addClass('ipt-action');
|
$('#tbHead .ipt').eq(txtIndex).addClass('ipt-action');
|
//清除表格内容
|
$(this).text('');
|
$('#tbHead .ipt').eq(txtIndex).text('');
|
var iptTag=$('<input type="text" value="'+txt+'" />');
|
var hideTag=$('<input type="text" value="'+txt+'" />');
|
$(this).append(iptTag);
|
$('#tbHead .ipt').eq(txtIndex).append(hideTag);
|
}
|
});
|
//点击表格其他位置文本框消失
|
$('#tbBrdw').on('click','table tbody tr td:not(".ipt-action")',function(){
|
if($('#tbBrdw table tbody tr .ipt-action').length>0)
|
{
|
var txtIpt=$('#tbBrdw table tbody tr .ipt-action input').val();
|
//清除input
|
$('#tbBrdw table tbody tr .ipt-action input').remove();
|
$('#tbHead table tbody tr .ipt-action input').remove();
|
//将值添加到表格中
|
$('#tbBrdw table tbody tr .ipt-action').text(txtIpt);
|
$('#tbHead table tbody tr .ipt-action').text(txtIpt);
|
// 移除class="ipt-action"
|
$('#tbBrdw table tbody tr .ipt').removeClass('ipt-action');
|
$('#tbHead table tbody tr .ipt').removeClass('ipt-action');
|
}
|
});
|
});
|
|
//页面加载时查询维护区中的枢纽类型
|
$.post("BattInfAction_serchByStation",null,function(data){
|
data=data.result;
|
data=eval("("+data+")");
|
//console.info(data);
|
if(data.code==1 && data.data.length>0){
|
var Ostation_name1=document.getElementById("station_name1");
|
Ostation_name1.innerHTML="";
|
for(var i=0;i<=data.data.length;i++){
|
option=createEle("option");
|
if(i==0){
|
option.innerHTML="全部(共"+data.sum+"种)";
|
option.setAttribute("value", "");
|
}else{
|
option.innerHTML=data.data[i-1].StationName1;
|
option.setAttribute("value",data.data[i-1].StationName1);
|
}
|
Ostation_name1.appendChild(option);
|
}
|
}
|
findStationNamebyStationname1();
|
});
|
|
//查询不重复的电池组
|
$.post("BattInfAction_serchByStationName1",null,function(data){
|
model=eval("("+data.result+")");
|
var Obattgroup_name = document.getElementById("battgroup_name");
|
Obattgroup_name.innerHTML="";
|
if(model.code==1 && model.data.length>0){
|
for(var i=0;i<model.data.length;i++){
|
data=model.data[i];
|
option=createEle("option");
|
if(i!=0){
|
option.innerHTML=data.BattGroupName+"-"+data.MonCount+"节";
|
option.setAttribute("value",data.BattGroupId);
|
option.setAttribute("oldvalue",data.StationName+""+data.BattGroupName);
|
}else{
|
option.innerHTML="全部蓄电池组(共"+model.sum+"组)";
|
option.setAttribute("value", "0");
|
}
|
Obattgroup_name.appendChild(option);
|
|
}
|
}
|
});
|
|
//当维护区的值变换时更新机房站点
|
$('#station_name1').change(function(){
|
findStationNamebyStationname1()
|
});
|
|
//根据维护区查询站点
|
function findStationNamebyStationname1(){
|
var selectvalue=$("#station_name1 option:selected").val();
|
//alert(selectvalue);
|
$.post("BattInfAction_serchByStationName","bif.StationName1="+selectvalue,function(data){
|
//console.info(data);
|
data=data.result;
|
data=eval("("+data+")");
|
if(data.code==1 && data.data.length>0){
|
|
var Ostttion_name = document.getElementById("station_name");
|
Ostttion_name.innerHTML="";
|
for(var i=0;i<=data.data.length;i++){
|
option=createEle("option");
|
if(i==0){
|
option.innerHTML="全部(共"+data.sum+"种)";
|
option.setAttribute("value", "");
|
}else{
|
option.innerHTML=data.data[i-1].StationName;
|
option.setAttribute("value",data.data[i-1].StationName);
|
}
|
Ostttion_name.appendChild(option);
|
}
|
}
|
findserchByBattGroupNamebystationname();
|
});
|
$('#station_name').change(function(){
|
findserchByBattGroupNamebystationname();
|
});
|
}
|
|
//根据维护区和机房查询蓄电池组
|
function findserchByBattGroupNamebystationname(){
|
var station_name1=$("#station_name1 option:selected").val();
|
var station_name=$("#station_name option:selected").val();
|
|
$.post("BattInfAction_serchByBattGroupName","bif.StationName1="+station_name1+"&bif.StationName="+station_name,function(data){
|
data=data.result;
|
//console.info(data);
|
data=eval("("+data+")");
|
//console.info(data.data);
|
if(data.code==1 && data.data.length>0){
|
//console.info(data.data);
|
var Obattgroup_name = document.getElementById("battgroup_name");
|
Obattgroup_name.innerHTML="";
|
|
for(var i=0;i<=data.data.length;i++){
|
option=createEle("option");
|
if(i!=0){
|
option.innerHTML=data.data[i-1].BattGroupName+"-"+data.data[i-1].MonCount+"节";
|
option.setAttribute("value",data.data[i-1].BattGroupId);
|
option.setAttribute("oldvalue",data.data[i-1].StationName+""+data.data[i-1].BattGroupName);
|
}else{
|
option.innerHTML="全部蓄电池组(共"+data.sum+"组)";
|
option.setAttribute("value", "0");
|
}
|
Obattgroup_name.appendChild(option);
|
}
|
}
|
});
|
}
|
</script>
|
</html>
|