Parcourir la source

Merge pull request #2141 from visuddhinanda/agile

add log
visuddhinanda il y a 1 an
Parent
commit
8814b708e9

+ 1 - 1
dashboard/src/components/template/Wbw/WbwDetailParent2.tsx

@@ -64,7 +64,7 @@ const WbwParent2Widget = ({ data, onChange }: IWidget) => {
     setParentOptions(parentOptions);
     setParentOptions(parentOptions);
   }, [inlineDict, data]);
   }, [inlineDict, data]);
 
 
-  const grammar = ["prp", "pp", "fpp", "pass", "caus"];
+  const grammar = ["prp", "pp", "fpp", "pass", "caus", "vdn"];
   const options = grammar.map((item) => {
   const options = grammar.map((item) => {
     return {
     return {
       value: `.${item}.`,
       value: `.${item}.`,

+ 6 - 1
dashboard/src/components/template/Wbw/WbwDetailRelation.tsx

@@ -127,7 +127,7 @@ const WbwDetailRelationWidget = ({
     }
     }
 
 
     //找出符合条件的relation
     //找出符合条件的relation
-
+    console.debug("relation match data=", data);
     const filteredRelation = relations?.filter((value) => {
     const filteredRelation = relations?.filter((value) => {
       let caseMatch = true;
       let caseMatch = true;
       let spellMatch = true;
       let spellMatch = true;
@@ -152,8 +152,13 @@ const WbwDetailRelationWidget = ({
           spellMatch = false;
           spellMatch = false;
         }
         }
       }
       }
+
+      console.debug("relation match", value, caseMatch, spellMatch);
+
       return caseMatch && spellMatch;
       return caseMatch && spellMatch;
     });
     });
+    console.debug("relation match filteredRelation=", filteredRelation);
+
     setCurrRelation(filteredRelation);
     setCurrRelation(filteredRelation);
     setRelationOptions(filteredRelation);
     setRelationOptions(filteredRelation);
     let relationName = new Map<string, string>();
     let relationName = new Map<string, string>();

+ 16 - 15
dashboard/src/load.ts

@@ -134,22 +134,23 @@ const init = () => {
   );
   );
 
 
   //获取 relation 表
   //获取 relation 表
-  get<IRelationListResponse>(`/v2/relation?vocabulary=true&limit=1000`).then(
-    (json) => {
-      if (json.ok) {
-        const items: IRelation[] = json.data.rows.map((item, id) => {
-          return {
-            id: item.id,
-            name: item.name,
-            case: item.case,
-            from: item.from,
-            to: item.to,
-          };
-        });
-        store.dispatch(pushRelation(items));
-      }
+  const urlRelation = `/v2/relation?vocabulary=true&limit=1000`;
+  console.debug("relations api request", urlRelation);
+  get<IRelationListResponse>(urlRelation).then((json) => {
+    console.debug("relations api response", json);
+    if (json.ok) {
+      const items: IRelation[] = json.data.rows.map((item, id) => {
+        return {
+          id: item.id,
+          name: item.name,
+          case: item.case,
+          from: item.from,
+          to: item.to,
+        };
+      });
+      store.dispatch(pushRelation(items));
     }
     }
-  );
+  });
 
 
   //获取用户选择的主题
   //获取用户选择的主题
   const theme = localStorage.getItem("theme");
   const theme = localStorage.getItem("theme");