无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<div id="html"></div>
<script>
var listInfos = new Array();
listInfos[0] = new Array();
listInfos[0][0] = {'name':'推荐页1','DayCount':666,'AvgTime':29872,'ErrCount':180663,'ErrorRate':'2873%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[0][1] = {'name':'推荐页2','DayCount':593896,'AvgTime':24946,'ErrCount':222,'ErrorRate':'2%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[0][2] = {'name':'推荐页3','DayCount':956,'AvgTime':27957,'ErrCount':111,'ErrorRate':'10%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[1] = new Array();
listInfos[1][0] = {'name':'推荐页4','DayCount':666,'AvgTime':116,'ErrCount':180663,'ErrorRate':'2873%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[1][1] = {'name':'推荐页5','DayCount':11,'AvgTime':222,'ErrCount':222,'ErrorRate':'2%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[1][2] = {'name':'推荐页6','DayCount':956,'AvgTime':956,'ErrCount':111,'ErrorRate':'10%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
function dateDesc(listInfos,field){
for( var i=0; i < listInfos.length ; i++ ){
for( var j = i+1 ; j < listInfos.length ; j++ ){
if( isCommaPercent(listInfos[i][field]) < isCommaPercent(listInfos[j][field]) ){
var arrayTemp = new Array();
arrayTemp = listInfos[i];
listInfos[i] = listInfos[j];
listInfos[j] = arrayTemp;
}
}
}
return listInfos;
}
function dataAsc(listInfos,field){
for( var i=0; i < listInfos.length ; i++ ){
for( var j = i+1 ; j < listInfos.length ; j++ ){
if( isCommaPercent(listInfos[i][field]) > isCommaPercent(listInfos[j][field]) ){
var arrayTemp = new Array();
arrayTemp = listInfos[i];
listInfos[i] = listInfos[j];
listInfos[j] = arrayTemp;
}
}
}
return listInfos;
}
function isCommaPercent(value){
var valueFloat;
value = value.toLocaleString();
valueFloat = ( value.indexOf(',') > 0 )? value.split(',').join(''):value;
valueFloat = (valueFloat.indexOf('%') > 0)?parseFloat(valueFloat.substr(0,valueFloat.indexOf('%'))): parseFloat(valueFloat);
return valueFloat;
}
function sortOperation(sortInfos,field,sort){
var listInfos = new Array();
if( sort == 'desc' ){
for(var i=0; i < sortInfos.length ; i++ ){
listInfos[i] = dateDesc(sortInfos[i],field);
}
}else if( sort == 'asc' ){
for(var i=0; i < sortInfos.length ; i++ ){
listInfos[i] = dataAsc(sortInfos[i],field);
}
}else{
alert('操作错误...');
return false;
}
var tableStrList ='';
for( var i=0; i < listInfos.length ; i++ ){
var tableStr='<h1>程序</h1>';
tableStr+= '<table width="100%" cellspacing="0" cellpadding="0" border="1" class="programTabble"><tbody><tr class="indexTableTr">';
tableStr +='<td width="16%">程序名称</td><td width="14%">当天访问量(次)</td><td width="14%">平均响应时间(us)</td><td width="14%">错误数(次)</td>';
tableStr +='<td width="14%">错误率(%)</td> <td width="14%">系统错误数(次)</td> <td width="14%">系统错误率(%)</td> </tr> ';
for( var j = 0 ; j < listInfos[i].length ; j++ ){
tableStr +='<tr>';
tableStr +='<td><a href="detail.php?type=programs&pid=1">'+listInfos[i][j]['name']+'</a></td>';
tableStr +='<td>'+listInfos[i][j]['DayCount']+'</td>';
tableStr +='<td>'+listInfos[i][j]['AvgTime']+'</td>';
tableStr +='<td>'+listInfos[i][j]['ErrCount']+'</td>';
tableStr +='<td>'+listInfos[i][j]['ErrorRate']+'</td>';
tableStr +='<td>'+listInfos[i][j]['DaySystemErrorCount']+'</td>';
tableStr +='<td>'+listInfos[i][j]['DaySystemrErrorRate']+'</td>';
tableStr +='</tr>';
}
tableStr +='</tbody></table>';
tableStrList += tableStr
}
document.getElementById("html").innerHTML=tableStrList;
}
sortOperation(listInfos,'DayCount','asc')
</script>
<div id="html"></div>
<script>
var listInfos = new Array();
listInfos[0] = new Array();
listInfos[0][0] = {'name':'推荐页1','DayCount':666,'AvgTime':29872,'ErrCount':180663,'ErrorRate':'2873%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[0][1] = {'name':'推荐页2','DayCount':593896,'AvgTime':24946,'ErrCount':222,'ErrorRate':'2%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[0][2] = {'name':'推荐页3','DayCount':956,'AvgTime':27957,'ErrCount':111,'ErrorRate':'10%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[1] = new Array();
listInfos[1][0] = {'name':'推荐页4','DayCount':666,'AvgTime':116,'ErrCount':180663,'ErrorRate':'2873%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[1][1] = {'name':'推荐页5','DayCount':11,'AvgTime':222,'ErrCount':222,'ErrorRate':'2%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
listInfos[1][2] = {'name':'推荐页6','DayCount':956,'AvgTime':956,'ErrCount':111,'ErrorRate':'10%','DaySystemErrorCount':0,'DaySystemrErrorRate':'0%'}
function dateDesc(listInfos,field){
for( var i=0; i < listInfos.length ; i++ ){
for( var j = i+1 ; j < listInfos.length ; j++ ){
if( isCommaPercent(listInfos[i][field]) < isCommaPercent(listInfos[j][field]) ){
var arrayTemp = new Array();
arrayTemp = listInfos[i];
listInfos[i] = listInfos[j];
listInfos[j] = arrayTemp;
}
}
}
return listInfos;
}
function dataAsc(listInfos,field){
for( var i=0; i < listInfos.length ; i++ ){
for( var j = i+1 ; j < listInfos.length ; j++ ){
if( isCommaPercent(listInfos[i][field]) > isCommaPercent(listInfos[j][field]) ){
var arrayTemp = new Array();
arrayTemp = listInfos[i];
listInfos[i] = listInfos[j];
listInfos[j] = arrayTemp;
}
}
}
return listInfos;
}
function isCommaPercent(value){
var valueFloat;
value = value.toLocaleString();
valueFloat = ( value.indexOf(',') > 0 )? value.split(',').join(''):value;
valueFloat = (valueFloat.indexOf('%') > 0)?parseFloat(valueFloat.substr(0,valueFloat.indexOf('%'))): parseFloat(valueFloat);
return valueFloat;
}
function sortOperation(sortInfos,field,sort){
var listInfos = new Array();
if( sort == 'desc' ){
for(var i=0; i < sortInfos.length ; i++ ){
listInfos[i] = dateDesc(sortInfos[i],field);
}
}else if( sort == 'asc' ){
for(var i=0; i < sortInfos.length ; i++ ){
listInfos[i] = dataAsc(sortInfos[i],field);
}
}else{
alert('操作错误...');
return false;
}
var tableStrList ='';
for( var i=0; i < listInfos.length ; i++ ){
var tableStr='<h1>程序</h1>';
tableStr+= '<table width="100%" cellspacing="0" cellpadding="0" border="1" class="programTabble"><tbody><tr class="indexTableTr">';
tableStr +='<td width="16%">程序名称</td><td width="14%">当天访问量(次)</td><td width="14%">平均响应时间(us)</td><td width="14%">错误数(次)</td>';
tableStr +='<td width="14%">错误率(%)</td> <td width="14%">系统错误数(次)</td> <td width="14%">系统错误率(%)</td> </tr> ';
for( var j = 0 ; j < listInfos[i].length ; j++ ){
tableStr +='<tr>';
tableStr +='<td><a href="detail.php?type=programs&pid=1">'+listInfos[i][j]['name']+'</a></td>';
tableStr +='<td>'+listInfos[i][j]['DayCount']+'</td>';
tableStr +='<td>'+listInfos[i][j]['AvgTime']+'</td>';
tableStr +='<td>'+listInfos[i][j]['ErrCount']+'</td>';
tableStr +='<td>'+listInfos[i][j]['ErrorRate']+'</td>';
tableStr +='<td>'+listInfos[i][j]['DaySystemErrorCount']+'</td>';
tableStr +='<td>'+listInfos[i][j]['DaySystemrErrorRate']+'</td>';
tableStr +='</tr>';
}
tableStr +='</tbody></table>';
tableStrList += tableStr
}
document.getElementById("html").innerHTML=tableStrList;
}
sortOperation(listInfos,'DayCount','asc')
</script>
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月30日
2024年09月30日
- 纪钧瀚《钢琴阅读时光 雨中书店聆听轻音乐》[FLAC/分轨][399.62MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[320K/MP3][87.4MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[FLAC/分轨][184.94MB]
- 陈慧娴.2018-Priscilla-Ism演唱会3CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 郑秀文.1999-我应该得到(国)【华纳】【WAV+CUE】
- 陈家慧.2011-钢琴酒吧2CD【龙吟唱片】【WAV+CUE】
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[320K/MP3][45.01MB]
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[FLAC/分轨][109.13MB]
- 赞多《序章》[320K/MP3][45.54MB]
- 许巍.2004-每一刻都是崭新的【步升大风】【WAV+CUE】
- 群星.2024-四方馆影视原声带【韶愔音乐】【FLAC分轨】
- 陈雷.1997-安锁咧【金圆唱片】【WAV+CUE】
- 关淑怡.2013-MY.FAVORITE.SK.3CD【环球】【WAV+CUE】
- Sweety.2006-花言乔语【丰华】【WAV+CUE】
- 李恕权.2003-回·20年全精选2CD【SONY】【WAV+CUE】