visuddhinanda 2 anni fa
parent
commit
a47f4b1dae

+ 3 - 0
dashboard/src/components/template/SentEdit.tsx

@@ -70,6 +70,7 @@ export interface IWidgetSentEditInner {
   simNum?: number;
   compact?: boolean;
   mode?: ArticleMode;
+  wbwProgress?: boolean;
 }
 export const SentEditInner = ({
   id,
@@ -89,6 +90,7 @@ export const SentEditInner = ({
   simNum,
   compact = false,
   mode,
+  wbwProgress = false,
 }: IWidgetSentEditInner) => {
   const [wbwData, setWbwData] = useState<IWbw[]>();
   const [magicDict, setMagicDict] = useState<string>();
@@ -175,6 +177,7 @@ export const SentEditInner = ({
         magicDict={magicDict}
         compact={isCompact}
         mode={articleMode}
+        wbwProgress={wbwProgress}
         onWbwChange={(data: IWbw[]) => {
           setWbwData(data);
         }}

+ 3 - 0
dashboard/src/components/template/SentEdit/SentContent.tsx

@@ -27,6 +27,7 @@ interface IWidgetSentContent {
   magicDict?: string;
   compact?: boolean;
   mode?: ArticleMode;
+  wbwProgress?: boolean;
   onWbwChange?: Function;
   onMagicDictDone?: Function;
 }
@@ -42,6 +43,7 @@ const SentContentWidget = ({
   compact = false,
   mode,
   magicDict,
+  wbwProgress = false,
   onWbwChange,
   onMagicDictDone,
 }: IWidgetSentContent) => {
@@ -134,6 +136,7 @@ const SentContentWidget = ({
                 channelId={item.channel.id}
                 data={JSON.parse(item.content ? item.content : "")}
                 mode={mode}
+                wbwProgress={wbwProgress}
                 onChange={(data: IWbw[]) => {
                   if (typeof onWbwChange !== "undefined") {
                     onWbwChange(data);

+ 3 - 1
dashboard/src/components/template/SentEdit/SentWbw.tsx

@@ -15,6 +15,7 @@ interface IWidget {
   wordEnd: number;
   channelsId?: string[];
   reload?: boolean;
+  wbwProgress?: boolean;
   onReload?: Function;
 }
 const SentWbwWidget = ({
@@ -24,6 +25,7 @@ const SentWbwWidget = ({
   wordEnd,
   channelsId,
   reload = false,
+  wbwProgress = false,
   onReload,
 }: IWidget) => {
   const [initLoading, setInitLoading] = useState(true);
@@ -85,7 +87,7 @@ const SentWbwWidget = ({
         dataSource={sentData}
         renderItem={(item, index) => (
           <List.Item key={index}>
-            <SentEditInner {...item} />
+            <SentEditInner {...item} wbwProgress={wbwProgress} />
           </List.Item>
         )}
       />

+ 4 - 0
dashboard/src/components/template/WbwSent.tsx

@@ -86,6 +86,7 @@ interface IWidget {
   magicDict?: string;
   refreshable?: boolean;
   mode?: ArticleMode;
+  wbwProgress?: boolean;
   onMagicDictDone?: Function;
   onChange?: Function;
 }
@@ -103,6 +104,7 @@ export const WbwSentCtl = ({
   mode,
   magicDict,
   refreshable = false,
+  wbwProgress = false,
   onChange,
   onMagicDictDone,
 }: IWidget) => {
@@ -116,6 +118,8 @@ export const WbwSentCtl = ({
   const [progress, setProgress] = useState(0);
   const [showProgress, setShowProgress] = useState(false);
 
+  useEffect(() => setShowProgress(wbwProgress), [wbwProgress]);
+
   const settings = useAppSelector(settingInfo);
   const sysGrammar = useAppSelector(getGrammar)?.filter(
     (value) => value.tag === ":collocation:"