Sfoglia il codice sorgente

2023-01-30 update

1. 调整首页右侧考试及格率图表的 数据排序
moccus 2 anni fa
parent
commit
6e7b2c6457
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      exam-06173-vue/src/views/dashboard/index.vue

+ 3 - 1
exam-06173-vue/src/views/dashboard/index.vue

@@ -459,7 +459,9 @@ export default {
 
         let xAxisData = [];
         let pxSeriesData = [];
-
+        res.data.sort((a,b) => {
+          return (b.total > 0 ? ((b.passed / b.total) * 100).toFixed(0) : 0) - (a.total > 0 ? ((a.passed / a.total) * 100).toFixed(0) : 0)
+        })
         res.data.forEach((ele) => {
           xAxisData.push(tabActive === "bm" ? ele.deptName : ele.realName);
           pxSeriesData.push(ele.total > 0 ? ((ele.passed / ele.total) * 100).toFixed(0) : 0);