|
@@ -9,6 +9,29 @@ function countAndPercent(year){
|
|
|
$.post("/visualization/countAndPercent",{
|
|
|
year:year
|
|
|
},function (res) {
|
|
|
+ // let res = new Object();
|
|
|
+ // let count = new Array();
|
|
|
+ // let percent = new Array();
|
|
|
+ // res.count = count;
|
|
|
+ // res.percent = percent;
|
|
|
+ // count.push({'shareType': '市共享', 'count': 0, 'percent': 0});
|
|
|
+ // count.push({'shareType': '市归集', 'count': 0, 'percent': 0});
|
|
|
+ // count.push({'shareType': '省上报', 'count': 0, 'percent': 0});
|
|
|
+ // count.push({'shareType': '省共享', 'count': 0, 'percent': 0});
|
|
|
+ // percent.push({'shareType': '市共享', 'count': 0, 'percent': 0});
|
|
|
+ // percent.push({'shareType': '市归集', 'count': 0, 'percent': 0});
|
|
|
+ // percent.push({'shareType': '省上报', 'count': 0, 'percent': 0});
|
|
|
+ // percent.push({'shareType': '省共享', 'count': 0, 'percent': 0});
|
|
|
+ // for(let i = 0; i < count.length; i++){
|
|
|
+ // for(let j = 0; j < response.count.length; j++){
|
|
|
+ // if(count[i].shareType == response.count[j].shareType){
|
|
|
+ // count[i].count = parseInt(response.count[j].count);
|
|
|
+ // count[i].percent = parseInt(response.count[j].percent);
|
|
|
+ // percent[i].count = parseInt(response.count[j].count);
|
|
|
+ // percent[i].percent = parseInt(response.count[j].percent);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
//渲染接口数量
|
|
|
if(res.count.length > 0){
|
|
|
$(".data1").remove();
|
|
@@ -81,7 +104,20 @@ function getFaultInterfaceCount() {
|
|
|
}
|
|
|
|
|
|
// 接口占比
|
|
|
-function jkzb(percent) {
|
|
|
+function jkzb(data) {
|
|
|
+ let percent = new Array();
|
|
|
+ percent.push({'shareType': '市共享', 'count': 0, 'percent': 0});
|
|
|
+ percent.push({'shareType': '市归集', 'count': 0, 'percent': 0});
|
|
|
+ percent.push({'shareType': '省上报', 'count': 0, 'percent': 0});
|
|
|
+ percent.push({'shareType': '省共享', 'count': 0, 'percent': 0});
|
|
|
+ for(let i = 0; i < percent.length; i++){
|
|
|
+ for(let j = 0; j < data.length; j++){
|
|
|
+ if(percent[i].shareType == data[j].shareType){
|
|
|
+ percent[i].count = parseInt(data[j].count);
|
|
|
+ percent[i].percent = parseInt(data[j].percent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
let trafficWay = [];
|
|
|
let jsArr = [];
|
|
|
let html = "";
|