From 2fe250ece8de95b3f70172fe5b45793ab6a3084a Mon Sep 17 00:00:00 2001 From: D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore <chenjingjing@LAPTOP-E51P2139> Date: 星期五, 18 一月 2019 17:30:50 +0800 Subject: [PATCH] 未审批可更改 --- gx_tieta/WebRoot/eleMonomer.jsp | 250 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 174 insertions(+), 76 deletions(-) diff --git a/gx_tieta/WebRoot/eleMonomer.jsp b/gx_tieta/WebRoot/eleMonomer.jsp index 21478ba..f2cce9f 100644 --- a/gx_tieta/WebRoot/eleMonomer.jsp +++ b/gx_tieta/WebRoot/eleMonomer.jsp @@ -13,6 +13,7 @@ <title><s:text name="Batt_statistical_analysis_query"/></title> <link href="css/basic.css" type="text/css" rel="stylesheet"> <link href="css/monomer.css" type="text/css" rel="stylesheet"> + <link href="src/css/layui.css" type="text/css" rel="stylesheet"> <script type="text/javascript" src="js/eleMonomer.js"></script> <script type="text/javascript" src="js/echarts.js"></script> <script type="text/javascript" src="js/frame.js"></script> @@ -43,6 +44,7 @@ <tr class="fWeight"> <td>鐪�</td> <!-- 鐪� --> <td>甯�</td> <!-- 甯� --> + <td>鍖�/鍘�</td> <!-- 鍖�/鍘� --> <td><s:text name="Computer_site"/></td> <!-- 鏈烘埧绔欑偣锛堟垨鏈烘埧璁惧锛� --> <td><s:text name="Battery"/></td> <!-- 钃勭數姹犵粍 --> </tr> @@ -54,6 +56,11 @@ </td> <td> <select id="city" name="bmd.binf.StationName2"> + + </select> + </td> + <td> + <select id="county" name="bmd.binf.StationName5"> </select> </td> @@ -155,7 +162,7 @@ <!--椤佃剼鍐呭--> </body> <script type="text/javascript" src="js/createTab.js"></script> - +<script type="text/javascript" src="src/layui.all.js"></script> <script type="text/javascript"> var permits; <% Object obj=session.getAttribute("permits"); @@ -419,56 +426,17 @@ }); }); - //鐢熸垚宸︿晶鐨勭數姹犵紪鍙疯〃鏍� - function createMonTab(){ - $('#tabEchartCon .tbFixed').text(''); - $('#tabEchartCon .secCurve').text(''); - if(MonNumlist!=null && MonNumlist!=undefined && MonNumlist.length>0){ - ArrLineTd=new Array(); - for(var i=0,index=0;i<MonNumlist.length;i++){ - if(MonNumlist[i]!=undefined){ - ArrLineTd[index++]=[MonNumlist[i],"<input type='checkbox' checked='checked' value='"+MonNumlist[i]+"'>"]; - } - } - createCard($('#tabEchartCon .tbFixed'),ArrLineTh,ArrLineTd); - createCard($('#tabEchartCon .secCurve'),ArrLineTh,ArrLineTd); + //鐐瑰嚮鏇茬嚎琛ㄦ牸鐨勫ご閮ㄧ殑澶嶉�夋tbody鍐呯殑澶嶉�夋鍏ㄨ閫変腑鎴栧彇娑� + $('#tabEchartCon').on('click', ' .tbFixed thead input[type="checkbox"]', function(){ + if($(this).is(':checked')) + { + $('#tabEchartCon .secCurve tbody input[type="checkbox"]').prop('checked',true); }else{ - createCard($('#tabEchartCon .tbFixed'),ArrLineTh,[]); - createCard($('#tabEchartCon .secCurve'),ArrLineTh,[]); + $('#tabEchartCon .secCurve tbody input[type="checkbox"]').prop('checked',false); } - - - //鐐瑰嚮鏇茬嚎琛ㄦ牸鐨勫ご閮ㄧ殑澶嶉�夋tbody鍐呯殑澶嶉�夋鍏ㄨ閫変腑鎴栧彇娑� - $('#tabEchartCon .tbFixed thead input[type="checkbox"]').click(function(){ - if($(this).is(':checked')) - { - $('#tabEchartCon .secCurve tbody input[type="checkbox"]').prop('checked',true); - }else{ - $('#tabEchartCon .secCurve tbody input[type="checkbox"]').prop('checked',false); - } - }); - - //console.info(MonVollist); - - if(Radiostatus==0){ - getListByCheckbox(MonVollist); - }else if(Radiostatus==1){ - getListByCheckbox(RealCaplist); - }else if(Radiostatus==2){ - getListByCheckbox(Voltagelist); - }else if(Radiostatus==3){ - getListByCheckbox(Conductlist); - }else if(Radiostatus==4){ - getListByCheckbox(Conductpercentlist); - }else if(Radiostatus==5){ - getListByCheckbox(Resistancelist); - }else if(Radiostatus==6){ - getListByCheckbox(Templist); - }else if(Radiostatus==7){ - getListByCheckbox(ConnOhmlist); - } - - $('#tabEchartCon input[type="checkbox"]').click(function(){ + }); + + $('#tabEchartCon').on('click', 'input[type="checkbox"]', function(){ if(Radiostatus==0){ //鍏呮斁鐢垫祴璇� getListByCheckbox(MonVollist); @@ -488,7 +456,46 @@ getListByCheckbox(ConnOhmlist); } - }); + }); + + //鐢熸垚宸︿晶鐨勭數姹犵紪鍙疯〃鏍� + function createMonTab(){ + $('#tabEchartCon .tbFixed').text(''); + $('#tabEchartCon .secCurve').text(''); + if(MonNumlist!=null && MonNumlist!=undefined && MonNumlist.length>0){ + ArrLineTd=new Array(); + for(var i=0,index=0;i<MonNumlist.length;i++){ + if(MonNumlist[i]!=undefined){ + ArrLineTd[index++]=[MonNumlist[i],"<input type='checkbox' checked='checked' value='"+MonNumlist[i]+"'>"]; + } + } + createCard($('#tabEchartCon .tbFixed'),ArrLineTh,ArrLineTd); + createCard($('#tabEchartCon .secCurve'),ArrLineTh,ArrLineTd); + }else{ + createCard($('#tabEchartCon .tbFixed'),ArrLineTh,[]); + createCard($('#tabEchartCon .secCurve'),ArrLineTh,[]); + } + + setTblWidth($('#tabEchartCon .tbFixed'), $('#tabEchartCon .secCurve')); + + + if(Radiostatus==0){ + getListByCheckbox(MonVollist); + }else if(Radiostatus==1){ + getListByCheckbox(RealCaplist); + }else if(Radiostatus==2){ + getListByCheckbox(Voltagelist); + }else if(Radiostatus==3){ + getListByCheckbox(Conductlist); + }else if(Radiostatus==4){ + getListByCheckbox(Conductpercentlist); + }else if(Radiostatus==5){ + getListByCheckbox(Resistancelist); + }else if(Radiostatus==6){ + getListByCheckbox(Templist); + }else if(Radiostatus==7){ + getListByCheckbox(ConnOhmlist); + } } var OconEchart = document.getElementById('conEchart'); @@ -620,8 +627,12 @@ }); }); + var isNewLoad = true; // 鐪�-甯�-鏈烘埧-鐢垫睜缁� + var filterLoad; $(document).ready(function(){ + filterLoad = layer.load(); + var pre_province = getQueryString("province"); //椤甸潰鍔犺浇鏃舵煡璇㈢淮鎶ゅ尯涓殑鏋㈢航绫诲瀷 $.post("User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup",null,function(data){ data=data.result; @@ -637,7 +648,10 @@ $option.attr("value", ""); }else{ $option.text(data.data[i-1]); - $option.attr("value",data.data[i-1]); + $option.attr("value",data.data[i-1]); + if(pre_province == data.data[i-1] && isNewLoad){ + $option.attr('selected',true); + } } $select.append($option); } @@ -649,10 +663,15 @@ }); // 鏍规嵁缁存姢鍖虹殑鍐呭鏌ヨ甯� - function findCity() { + function findCity(isLoad) { var data = { StationName1: $("#station_name1").val() }; + // 鏄惁娣诲姞绛夊緟 + if(isLoad) { + filterLoad = layer.load(); + } + var pre_city = getQueryString("city"); // 璇锋眰鑾峰彇褰撳墠鐪佷笅鐨勫競 $.ajax({ type: "post", @@ -670,6 +689,9 @@ for(var i=0;i<_data.length;i++){ var __data = _data[i]; var tmp = getOptionsData(__data.StationName2, __data.StationName2, __data); + if(pre_city == __data.StationName2 && isNewLoad){ + tmp = getOptionsData(__data.StationName2, __data.StationName2, __data,{},true); + } optsList.push(tmp); } // 鏍规嵁鏁版嵁鐢熸垚涓嬫媺鍒楄〃 @@ -677,27 +699,85 @@ }else { $select.text('').html('<option>鏆傛棤鍙祴甯�</option>'); } - findStationNamebyStationname1(); + findCounty(); } }); } + // 鏌ヨ鍖�/鍘� + function findCounty(isLoad) { + var tmp = { + StationName1:$("#station_name1").val(), + StationName2:$("#city").val(), + }; + + // 鏄惁娣诲姞绛夊緟 + if(isLoad) { + filterLoad = layer.load(); + } + var pre_county = getQueryString("county"); + // 鏌ヨ鍖哄幙 + $.ajax({ + type: 'post', + async: true, + url: "BattInfAction!serchStationName5", + data: "json="+JSON.stringify(tmp), + success:function(data) { + var rs = JSON.parse(data.result); + var $select = $("#county"); + if(rs.code==1){ + var _data = rs.data; + // 鏍规嵁鏁版嵁鏋勯�犵敓鎴愪笅鎷夊垪琛ㄧ殑鏁版嵁 + var optsList = []; + for(var i=0;i<_data.length;i++){ + var __data = _data[i]; + var _attr = { + StationId: __data.StationId + }; + var tmp = getOptionsData(__data.StationName5, __data.StationName5, __data, _attr); + if(pre_county == __data.StationName5 && isNewLoad){ + tmp = getOptionsData(__data.StationName5, __data.StationName5, __data, _attr,{},true); + } + optsList.push(tmp); + } + + // 鏍规嵁鏁版嵁鐢熸垚涓嬫媺鍒楄〃 + createOptions($select, optsList, true); + }else{ + $select.text('').html('<option>鏆傛棤鍙祴鏈烘埧绔欑偣</option>'); + } + findStationNamebyStationname1(); + } + }); + } + //褰撶淮鎶ゅ尯鐨勫�煎彉鎹㈡椂鏇存柊甯� $('#station_name1').change(function(){ - findCity(); + findCity(true); }); //褰撶淮鎶ゅ尯鐨勫�煎彉鎹㈡椂鏇存柊鏈烘埧绔欑偣 $('#city').change(function(){ - findStationNamebyStationname1(); + findCounty(true); + }); + + //褰撳尯/鍘跨殑鍊煎彉鎹㈡椂鏇存柊鏈烘埧绔欑偣 + $('#county').change(function(){ + findStationNamebyStationname1(true); }); //鏍规嵁鐪侊紝甯傛煡璇㈢珯鐐� - function findStationNamebyStationname1(){ + function findStationNamebyStationname1(isLoad){ var tmp = { StationName1:$("#station_name1").val(), - StationName2:$("#city").val() + StationName2:$("#city").val(), + StationName5:$("#county").val() }; + // 鏄惁娣诲姞绛夊緟 + if(isLoad) { + filterLoad = layer.load(); + } + var pre_home = getQueryString('home'); //var selectvalue=$("#station_name1 option:selected").val(); //alert(selectvalue); $.post("BattInfAction!serchStationName3","json="+JSON.stringify(tmp),function(data){ @@ -713,6 +793,9 @@ StationId: __data.StationId }; var tmp = getOptionsData(__data.StationName3, __data.StationName, __data, _attr); + if(pre_home == __data.StationName && isNewLoad){ + tmp = getOptionsData(__data.StationName3, __data.StationName, __data, _attr,{},true); + } optsList.push(tmp); } @@ -727,20 +810,25 @@ // 鏍规嵁鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁� $('#station_name').change(function(){ - findserchByBattGroupNamebystationname(); + findserchByBattGroupNamebystationname(true); }); //鏍规嵁鐪侊紝甯傚拰鏈烘埧鏌ヨ钃勭數姹犵粍 - function findserchByBattGroupNamebystationname(){ + function findserchByBattGroupNamebystationname(isLoad){ var stationid = $("#station_name").find('option:selected').attr('stationid')?$("#station_name").find('option:selected').attr('stationid'):''; // 鏋勯�犳煡璇㈡潯浠� var tmp = { StationName1:$("#station_name1").val(), StationName2:$("#city").val(), + StationName5:$("#county").val(), StationName: $("#station_name").val(), StationId: stationid }; - + // 鏄惁娣诲姞绛夊緟 + if(isLoad) { + filterLoad = layer.load(); + } + var pre_battid = getQueryString("battid"); //var station_name1=$("#station_name1 option:selected").val(); //var station_name=$("#station_name option:selected").val(); @@ -762,6 +850,10 @@ }; var txt = _data.BattGroupName+'-'+_data.MonCount+"<s:text name='Section'/>"; var tmp = getOptionsData(txt, _data.BattGroupId, _data, _attr); + if(pre_battid == _data.BattGroupId && isNewLoad){ + tmp = getOptionsData(txt, _data.BattGroupId, _data, _attr,{},true); + } + optsList.push(tmp); } @@ -771,6 +863,7 @@ }else{ $("#battgroup_name").text('').html('<option>鏆傛棤鍙祴钃勭數姹犵粍</option>'); } + searchBattMonNum(); }); } @@ -789,11 +882,14 @@ $option.attr("value", 0); OSingle_number.text(''); OSingle_number.append($option); + layer.close(filterLoad); }else{ + var pre_monnum = getQueryString("monnum"); //console.info(battgroup_id); $.post("BattInfAction!serchByMonNum","bif.BattGroupId="+battgroup_id,function(data){ data=data.result; data=eval("("+data+")"); + //console.log(data); if(data.code==1 && data.data.length>0){ data=data.data[0]; OSingle_number.text(''); @@ -802,8 +898,9 @@ if(i!=0){ $option.html(i); $option.attr("value", i); - if(mon_num == i && isNewload){ - isNewload = false; + //console.info(pre_monnum +"==="+ i +"***"+isNewLoad); + if(pre_monnum == i && isNewLoad){ + $option.attr('selected','selectted'); } }else{ @@ -813,11 +910,12 @@ OSingle_number.append($option); } } - if(mon_num != undefined){ - searchMonomer(); - } + layer.close(filterLoad); + isNewLoad = false; + searchMonomer(); }); } + } $('#container .search').click(function(){ @@ -863,14 +961,16 @@ //鍒涘缓绛夊緟鐨勬妗� loading.showLoading($('#main')); - var battgroupid=$('#battgroup_name').attr('value'); + var monNum = $('#Single_number').val()?$('#Single_number').val():0; + //console.log($("#search_form").serialize()); var temp ={ binf:{ StationName1:$('#station_name1').val(), StationName2:$('#city').val(), + StationName5: $('#county').val(), StationName:$('#station_name').val(), BattGroupId:$('#battgroup_name').val(), - MonNum:$('#Single_number').val(), + MonNum: monNum, }, tdata:{ test_type:$('#test_type').val() @@ -884,7 +984,7 @@ data=data.result; var model = eval("("+data+")"); //alert(battgroupid); - console.info(model); + //console.info(model); var totalcount = 0; if(model.code==1 && model.data.length>0){ data = model.data; @@ -920,7 +1020,10 @@ arrChargeTd.push(testdata.sdata.test_cap.toFixed(1)); //娴嬭瘯瀹归噺 arrChargeTd.push(testdata.sdata.mon_num); //鍗曚綋缂栧彿 arrChargeTd.push(testdata.sdata.mon_vol.toFixed(3)); //鍗曚綋鐢靛帇 - var realCap=Math.round(GetMonomerCap(testdata.binf.MonCapStd,GetHourRate(testdata.binf.MonCapStd,testdata.sdata.test_curr),testdata.sdata.test_cap,testdata.tdata.max_monvol,testdata.sdata.mon_vol,testdata.binf.MonVolStd,CapType_Real)); //瀹為檯瀹归噺 + console.info(testdata.sdata.test_curr); + var avg_curr = testdata.sdata.test_timelong>0?testdata.sdata.test_cap*3600/testdata.sdata.test_timelong:testdata.sdata.test_curr; //璁$畻骞冲潎鐨勬斁鐢电數娴� + //console.info("avg="+avg_curr); + var realCap=Math.round(GetMonomerCap(testdata.binf.MonCapStd,GetHourRate(testdata.binf.MonCapStd,avg_curr),testdata.sdata.test_cap,testdata.tdata.max_monvol,testdata.sdata.mon_vol,testdata.binf.MonVolStd,CapType_Real)); //瀹為檯瀹归噺 //console.info(data[i].data.tdata.max_monvol); arrChargeTd.push(realCap); @@ -929,7 +1032,7 @@ RealCaplist[testdata.sdata.mon_num-1].push(realCap); - var rest=Math.round(GetMonomerCap(testdata.binf.MonCapStd,GetHourRate(testdata.binf.MonCapStd,testdata.sdata.test_curr),testdata.sdata.test_cap,testdata.tdata.max_monvol,testdata.sdata.mon_vol,testdata.binf.MonVolStd,CapType_Rest)); //鍓╀綑瀹归噺 + var rest=Math.round(GetMonomerCap(testdata.binf.MonCapStd,GetHourRate(testdata.binf.MonCapStd,avg_curr),testdata.sdata.test_cap,testdata.tdata.max_monvol,testdata.sdata.mon_vol,testdata.binf.MonVolStd,CapType_Rest)); //鍓╀綑瀹归噺 arrChargeTd.push(rest); arrChargeTd.push((realCap*100/testdata.binf.MonCapStd).toFixed(0)+"%"); //瀹归噺鐧惧垎姣� if(realCap >= testdata.binf.MonCapStd*lowCA){ @@ -1061,7 +1164,7 @@ }else{ noContent.showNoContent("鏆傛棤鏌ヨ鏁版嵁"); } - console.info(Conductpercentlist); + //console.info(Conductpercentlist); $('#total').text(totalcount); var tblScroll=$('#eleInforTab').scrollLeft(); $('#tbHead table').css('left',-tblScroll); @@ -1105,11 +1208,6 @@ //console.info(ArrTd); eleform.submit(); } - - //褰撻�夋嫨鐢垫睜缁勬椂涔熸煡璇� - $('#battgroup_name').change(function(){ - searchMonomer(); - }); //鎷栧姩婊戝潡鏀瑰彉瀹瑰櫒鐨勫ぇ灏� $(document).ready(function(){ -- Gitblit v1.9.1