//js部分 其中shijian all chaoshi为表中没有数据,单独添加的,表现样式如下
showTable:function(){
var _t=this;
$.post(this.URL+'?showTable',{
act:'showTable',},function(v){
if(v=='') return false;
_t.tableDate=[];
var arr=JSON.parse(v);
var obj={};
for(var i=0;i<arr.length;i++){
if(!arr[i].area_code) continue;
if(!obj[arr[i].area_code]){
obj[arr[i].area_code]=[];
}
obj[arr[i].area_code].push(arr[i]);
}
for(var p in obj){
var a=(all:0,shijian:0,chaoshi:0,zhenggailv:0,diqu:''};
a.diqu=imw_region_fn({act:'getName',city_code:p});
var brr=obj[p];
for(var i=0;i<brr.length;++i){
switch(brr[i].type){
case 'all':
a.all=brr[i].num;
break;
case 'shijian':
a.shijian=brr[i].num;
break;
case 'chaoshi':
a.chaoshi=brr[i].num;
break;
}
if(a.shijian &&a.all){
a.zhenggailv=((+a.all/+a.shijian)*100).toFixed(2)+'%';
}
}
//改变其中时区为市直属
a.diqu=='枣庄市'?a.diqu='市直属':'';
_t.tableData.push(a);
}
})
},