فهرست منبع

添加分数间隔

Michael Wang 3 سال پیش
والد
کامیت
083c46293d
1فایلهای تغییر یافته به همراه12 افزوده شده و 2 حذف شده
  1. 12 2
      src/features/allAnalysis/ScoreRate.vue

+ 12 - 2
src/features/allAnalysis/ScoreRate.vue

@@ -2,6 +2,15 @@
   <div>
     <div class="tw-bg-white tw-rounded-xl">
       <div class="tw-mt-4"></div>
+      分数间隔
+      <a-select v-model:value="scoreGap">
+        <a-select-option :value="1">1</a-select-option>
+        <a-select-option :value="5">5</a-select-option>
+        <a-select-option :value="10">10</a-select-option>
+        <a-select-option :value="20">20</a-select-option>
+        <a-select-option :value="50">50</a-select-option>
+      </a-select>
+      <div class="tw-mt-4"></div>
 
       <a-collapse v-model:activeKey="activeKey">
         <a-collapse-panel
@@ -23,7 +32,7 @@
               <th>累计频数(%)</th>
             </tr>
             <tr
-              v-for="(item2, index) in item.totalScore / scoreGap"
+              v-for="(item2, index) in Math.round(item.totalScore / scoreGap)"
               :key="index"
             >
               <td>{{ (item2 - 1) * scoreGap }}-</td>
@@ -202,6 +211,7 @@ async function fetchData() {
     v.scoreRangeTotal = acc;
     return v;
   });
+  console.log(res.data);
   data = res.data;
 }
 
@@ -210,7 +220,7 @@ onMounted(async () => {
   await fetchData();
 });
 
-let scoreGap = 10;
+let scoreGap = $ref(10);
 
 // let scores = [];
 // const scoreComputed = computed(() => {