Преглед на файлове

confidence <1 按100算

visuddhinanda преди 2 години
родител
ревизия
eee8c28090
променени са 1 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 5 3
      dashboard/src/components/dict/Community.tsx

+ 5 - 3
dashboard/src/components/dict/Community.tsx

@@ -64,9 +64,11 @@ const CommunityWidget = ({ word }: IWidget) => {
           let score: number | undefined;
           let score: number | undefined;
           if (it.exp) {
           if (it.exp) {
             //分数计算
             //分数计算
-            const currScore = Math.floor(
-              (it.exp / 3600) * (it.confidence / 100)
-            );
+            let conf = it.confidence / 100;
+            if (it.confidence <= 1) {
+              conf = 1;
+            }
+            const currScore = Math.floor((it.exp / 3600) * conf);
             if (it.mean) {
             if (it.mean) {
               score = meaning.get(it.mean);
               score = meaning.get(it.mean);
               meaning.set(it.mean, score ? score + currScore : currScore);
               meaning.set(it.mean, score ? score + currScore : currScore);