Explorar o código

2023-01-30 update

1. 调整首页右侧考试及格率图表的 数据排序
moccus %!s(int64=2) %!d(string=hai) anos
pai
achega
6e7b2c6457
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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);