Эх сурвалжийг харах

应用中心top5显示调整

mork 2 долоо хоног өмнө
parent
commit
b3cd7f1afa

+ 7 - 5
src/views/yygl/monitor/index.vue

@@ -257,12 +257,14 @@ export default {
       topApp(param.num,param.start,param.end).then((res) => {
         let maxv = 100;
         res.forEach((item,index) => {
-          if(index === 0){
-            maxv = item.count;
+          if(index < 5){
+            if(index === 0){
+              maxv = item.count;
+            }
+            item.percentage = (item.count/maxv*100).toFixed(1);
+            let str = { name: item.name.trim() == '' ? '其他' : item.name, count: item.count, percentage: item.percentage }
+            that.hotApps.push(str);
           }
-          item.percentage = (item.count/maxv*100).toFixed(1);
-          let str = { name: item.name.trim() == '' ? '其他' : item.name, count: item.count, percentage: item.percentage }
-          that.hotApps.push(str);
         });
         //  console.log(that.hotApps);
       });