Browse Source

case 改变时改变type grammar

visuddhinanda 2 years ago
parent
commit
62c71e9fc8
1 changed files with 6 additions and 3 deletions
  1. 6 3
      dashboard/src/components/template/Wbw/WbwDetail.tsx

+ 6 - 3
dashboard/src/components/template/Wbw/WbwDetail.tsx

@@ -67,7 +67,10 @@ const WbwDetailWidget = ({
         mData.grammar2 = { value: value, status: 7 };
         mData.grammar2 = { value: value, status: 7 };
         break;
         break;
       case "case":
       case "case":
+        const arrCase = value.split("#");
         mData.case = { value: value, status: 7 };
         mData.case = { value: value, status: 7 };
+        mData.type = { value: arrCase[0] ? arrCase[0] : "", status: 7 };
+        mData.grammar = { value: arrCase[1] ? arrCase[1] : "", status: 7 };
         break;
         break;
       case "relation":
       case "relation":
         mData.relation = { value: value, status: 7 };
         mData.relation = { value: value, status: 7 };
@@ -164,8 +167,8 @@ const WbwDetailWidget = ({
             ),
             ),
           },
           },
           {
           {
-            label: intl.formatMessage({ id: "buttons.advance" }),
-            key: "advance",
+            label: intl.formatMessage({ id: "buttons.spell" }),
+            key: "spell",
             children: (
             children: (
               <div style={{ minHeight: 270 }}>
               <div style={{ minHeight: 270 }}>
                 <WbwDetailAdvance
                 <WbwDetailAdvance
@@ -214,7 +217,7 @@ const WbwDetailWidget = ({
         />
         />
         <Rate
         <Rate
           allowHalf
           allowHalf
-          defaultValue={5}
+          defaultValue={data.confidence * 5}
           onChange={(value: number) => {
           onChange={(value: number) => {
             fieldChanged("confidence", (value / 5).toString());
             fieldChanged("confidence", (value / 5).toString());
           }}
           }}