| | |
| | | btn: ['确认升级', '取消'],
|
| | | yes: function(index, layero) {
|
| | | var goodUpdateData = $('#updateIframeData').data('update'); // 获取可升级设备的信息
|
| | | // console.log(goodUpdateData);
|
| | | // 判断是否选中了要升级的机房
|
| | | if(goodUpdateData.length == 0) {
|
| | | layer.msg("请选择要升级的机房!");
|
| | | }else {
|
| | | // 关闭弹出面板
|
| | | layer.close(index);
|
| | | }
|
| | | |
| | | return;
|
| | | // 根据可升级设备的信息构造查询条件
|
| | | var updateList = [];
|
| | | for(var i=0; i<goodUpdateData.length; i++) {
|
| | |
| | | dev_id: _data.fbsid
|
| | | ,dfu_file: _data.filename
|
| | | };
|
| | | console.log(_data);
|
| | | // console.log(_data);
|
| | | // 添加到设备升级列表中
|
| | | if(_data.filename && _data.filename.length != 0) {
|
| | | updateList.push(_tmp);
|
| | | }
|
| | |
|
| | | }
|
| | | //console.log(updateList);
|
| | | //return;
|
| | | // 关闭弹出面板
|
| | | layer.close(index);
|
| | | // console.log(updateList);
|
| | | // 升级设备
|
| | | updateBTSDevice(updateList);
|
| | | //console.log(updateList);
|
| | | }
|
| | | });
|
| | | }else {
|
| | |
| | | var percent = (restvalue*100/moncapstd).toFixed(1);
|
| | | var restTime = test_curr==0?formartTime(0):formartTime(restvalue*60/test_curr);
|
| | | var temp = getObjByStationName(alldata, data[i].binf.StationName);
|
| | | console.info(actionvalue+"=="+restvalue);
|
| | | //console.info(actionvalue+"=="+restvalue);
|
| | | if(temp == undefined){
|
| | | alldata.push({
|
| | | StationName1:data[i].binf.StationName1,
|
| | |
| | | </div>
|
| | | </div>
|
| | | <script type="text/html" id="updateTpl">
|
| | | <table class="hdw-tbl">
|
| | | <table class="layui-table" id="updateTbl" lay-filter="update">
|
| | | <thead>
|
| | | <tr>
|
| | | <th style="width:120px">设备ID</th>
|
| | | <th>机房名称</th>
|
| | | <th>版本号</th>
|
| | | <th>升级文件名</th>
|
| | | <th lay-data="{type:'checkbox', LAY_CHECKED:true}">
|
| | | <th lay-data="{field:'fbsid', width:120, align:'center'}">设备ID</th>
|
| | | <th lay-data="{field:'stationname', align:'center'}">机房名称</th>
|
| | | <th lay-data="{field:'version', width:180, align:'center'}">版本号</th>
|
| | | <th lay-data="{field:'filename', width:180, align:'center'}">升级文件名</th>
|
| | | </tr>
|
| | | </thead>
|
| | | <tbody>
|
| | | {{# layui.each(d, function(index, item){ }}
|
| | | <tr>
|
| | | <td></td>
|
| | | <td>{{ item.fbsid }}</td>
|
| | | <td>{{ item.stationname }}</td>
|
| | | <td>{{ item.version }}</td>
|
| | |
| | | <script src="../js/jquery-1.8.3.js"></script>
|
| | | <script src="../src/layui.js"></script>
|
| | | <script>
|
| | | layui.use(['element', 'laytpl'], function() {
|
| | | layui.use(['element', 'laytpl', 'table'], function() {
|
| | | var element = layui.element;
|
| | | var laytpl = layui.laytpl;
|
| | | var table = layui.table;
|
| | |
|
| | | var updateTpl = $('#updateTpl').html();
|
| | | var errorUpdateTpl = $('#errorUpdateTpl').html();
|
| | |
| | | // 渲染可升级设备的表格
|
| | | laytpl(updateTpl).render(updateData, function(html) {
|
| | | $('#update').html(html);
|
| | | table.init('update',{
|
| | | height: "full-45" //设置高度
|
| | | ,limit: updateData.length+1
|
| | | });
|
| | | |
| | | });
|
| | |
|
| | | // 渲染不可升级设备的表格
|
| | | laytpl(errorUpdateTpl).render(errorUpdateData, function(html) {
|
| | | $('#errorUpdate').html(html);
|
| | | });
|
| | | |
| | | // 点击复选框触发选中需要升级的内容
|
| | | table.on('checkbox(update)', function(obj){
|
| | | var checkStatus = table.checkStatus('updateTbl'); //update
|
| | | parent.$('#updateIframeData').data('update', checkStatus.data);
|
| | | });
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | |
| | | Page page=bendurance.getPage();
|
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct tb_batt_endurance.num,tb_batt_endurance.deviceid,tb_batt_endurance.stationid,real_cap,tb_batt_endurance.moncapstd,real_curr,endurance_theory_timelong,endurance_actual_timelong,endurance_actual_timelong_max,endurance_actual_timelong_min,is_out_stand " +
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct tb_batt_endurance.num,tb_batt_endurance.deviceid,tb_batt_endurance.stationid,real_cap,tb_batt_endurance.moncapstd,real_curr,endurance_theory_timelong,endurance_actual_timelong,endurance_actual_timelong_max,endurance_actual_timelong_min,is_out_stand,batts_moncapstd " +
|
| | | ",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2,db_battinf.tb_battinf.StationName5 " +
|
| | | " from web_site.tb_batt_endurance,db_battinf.tb_battinf " +
|
| | | " where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid "+
|
| | |
| | | b.setReal_cap(rs.getFloat("real_cap"));
|
| | | b.setMoncapstd(rs.getFloat("moncapstd"));
|
| | | b.setReal_curr(rs.getFloat("real_curr"));
|
| | | b.setBatts_moncapstd(rs.getString("batts_moncapstd"));
|
| | | b.setEndurance_theory_timelong(rs.getFloat("endurance_theory_timelong"));
|
| | | b.setEndurance_actual_timelong(rs.getFloat("endurance_actual_timelong"));
|
| | | b.setEndurance_actual_timelong_max(rs.getFloat("endurance_actual_timelong_max"));
|
| | |
| | | private float endurance_actual_timelong_max;//实际最大
|
| | | private float endurance_actual_timelong_min;//实际最小
|
| | | private int is_out_stand;
|
| | | private String batts_moncapstd;//机房电池组的标称容量
|
| | | private String note;
|
| | | private String stationName;
|
| | | private String stationName1;//省级
|
| | |
| | | public void setMonvolstd(int monvolstd) {
|
| | | this.monvolstd = monvolstd;
|
| | | }
|
| | | public String getBatts_moncapstd() {
|
| | | return batts_moncapstd;
|
| | | }
|
| | | public void setBatts_moncapstd(String batts_moncapstd) {
|
| | | this.batts_moncapstd = batts_moncapstd;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Batt_endurance [num=" + num + ", deviceId=" + deviceId + ", stationid=" + stationid + ", real_cap="
|
| | |
| | | + endurance_theory_timelong + ", endurance_actual_timelong=" + endurance_actual_timelong
|
| | | + ", endurance_actual_timelong_max=" + endurance_actual_timelong_max
|
| | | + ", endurance_actual_timelong_min=" + endurance_actual_timelong_min + ", is_out_stand=" + is_out_stand
|
| | | + ", note=" + note + ", stationName=" + stationName + ", stationName1=" + stationName1
|
| | | + ", stationName2=" + stationName2 + ", stationName5=" + stationName5 + ", monvolstd=" + monvolstd
|
| | | + ", page=" + page + "]";
|
| | | + ", batts_moncapstd=" + batts_moncapstd + ", note=" + note + ", stationName=" + stationName
|
| | | + ", stationName1=" + stationName1 + ", stationName2=" + stationName2 + ", stationName5=" + stationName5
|
| | | + ", monvolstd=" + monvolstd + ", page=" + page + "]";
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | }
|