Просмотр исходного кода

Merge pull request #2167 from visuddhinanda/agile

type 按照 : 切分
visuddhinanda 1 год назад
Родитель
Сommit
a2ff588fef

+ 1 - 5
dashboard/src/components/template/Wbw/WbwDetail.tsx

@@ -211,11 +211,7 @@ const WbwDetailWidget = ({
                   console.debug("WbwDetailBasic onchange", e);
                   fieldChanged(e.field, e.value);
                 }}
-                onRelationAdd={() => {
-                  if (typeof onClose !== "undefined") {
-                    onClose();
-                  }
-                }}
+                onRelationAdd={onClose}
               />
             ),
           },

+ 1 - 5
dashboard/src/components/template/Wbw/WbwDetailBasic.tsx

@@ -267,11 +267,7 @@ const WbwDetailBasicWidget = ({
               onChange(e);
             }
           }}
-          onRelationAdd={() => {
-            if (typeof onRelationAdd !== "undefined") {
-              onRelationAdd();
-            }
-          }}
+          onRelationAdd={onRelationAdd}
         />
       </Form>
     </>

+ 1 - 5
dashboard/src/components/template/Wbw/WbwDetailBasicRelation.tsx

@@ -67,11 +67,7 @@ const WbwDetailBasicRelationWidget = ({
               onChange(e);
             }
           }}
-          onAdd={() => {
-            if (typeof onRelationAdd !== "undefined") {
-              onRelationAdd();
-            }
-          }}
+          onAdd={onRelationAdd}
           onFromList={(value: string[]) => setFromList(value)}
         />
       </Collapse.Panel>

+ 2 - 0
dashboard/src/components/template/Wbw/WbwDetailRelation.tsx

@@ -112,6 +112,7 @@ const WbwDetailRelationWidget = ({
   useEffect(() => {
     let grammar = data.case?.value
       ?.replace("#", "$")
+      .replace(":", "$")
       .replaceAll(".", "")
       .split("$");
     if (data.grammar2?.value) {
@@ -268,6 +269,7 @@ const WbwDetailRelationWidget = ({
                 const currSelect = relationOptions?.filter(
                   (rl) => rl.name === value
                 );
+                console.log("filteredRelation", currSelect);
                 setCurrRelation(currSelect);
                 console.log(`selected ${value}`);
                 setRelation((origin) => {

+ 7 - 2
dashboard/src/components/template/Wbw/WbwPali.tsx

@@ -108,8 +108,11 @@ const WbwPaliWidget = ({
    * 高亮可能的单词
    */
   useEffect(() => {
+    console.debug("relation match data=", data);
+
     let grammar = data.case?.value
       ?.replace("#", "$")
+      .replace(":", "$")
       .replaceAll(".", "")
       .split("$");
     if (data.grammar2?.value) {
@@ -141,11 +144,13 @@ const WbwPaliWidget = ({
           caseMatch = false;
         }
       }
-      if (value.from?.spell) {
-        if (data.real.value !== value.from?.spell) {
+      if (value.to?.spell) {
+        if (data.real.value !== value.to?.spell) {
           spellMatch = false;
         }
       }
+      console.debug("relation match", value, caseMatch, spellMatch);
+
       return caseMatch && spellMatch;
     });
     if (match && match.length > 0) {