Bläddra i källkod

factors 去掉-

visuddhinanda 2 år sedan
förälder
incheckning
bc7df93911
1 ändrade filer med 6 tillägg och 3 borttagningar
  1. 6 3
      dashboard/src/components/dict/MyCreate.tsx

+ 6 - 3
dashboard/src/components/dict/MyCreate.tsx

@@ -59,15 +59,18 @@ export const UserWbwPost = (data: IDictRequest[], view: string) => {
       const factors: IDictRequest[] = value.factors
         .split("+")
         .map((item, id) => {
+          const currWord = item.replaceAll("-", "");
+          console.debug("currWord", currWord);
           return {
-            word: item,
+            word: currWord,
             type: ".part.",
             grammar: "",
-            mean: fm ? fm[id] ?? "" : "",
+            mean: fm ? fm[id].replaceAll("-", "") ?? "" : "",
             confidence: value.confidence,
             language: value.language,
           };
-        });
+        })
+        .filter((value) => value.mean !== "");
       wordData = [...wordData, ...factors];
     }
   });