Parcourir la source

进度条边上显示用户名和时间

visuddhinanda il y a 1 an
Parent
commit
fbcfd11e90
1 fichiers modifiés avec 22 ajouts et 8 suppressions
  1. 22 8
      dashboard/src/components/template/WbwSent.tsx

+ 22 - 8
dashboard/src/components/template/WbwSent.tsx

@@ -1,4 +1,4 @@
-import { Button, Dropdown, message, Progress, Tree } from "antd";
+import { Button, Dropdown, message, Progress, Space, Tree } from "antd";
 import { useEffect, useState } from "react";
 import { useEffect, useState } from "react";
 import { MoreOutlined, ExclamationCircleOutlined } from "@ant-design/icons";
 import { MoreOutlined, ExclamationCircleOutlined } from "@ant-design/icons";
 
 
@@ -24,7 +24,10 @@ import { getGrammar } from "../../reducers/term-vocabulary";
 import modal from "antd/lib/modal";
 import modal from "antd/lib/modal";
 import { UserWbwPost } from "../dict/MyCreate";
 import { UserWbwPost } from "../dict/MyCreate";
 import { currentUser } from "../../reducers/current-user";
 import { currentUser } from "../../reducers/current-user";
-import { IStudio } from "../auth/Studio";
+import Studio, { IStudio } from "../auth/Studio";
+import { IChannel } from "../channel/Channel";
+import TimeShow from "../general/TimeShow";
+import moment from "moment";
 
 
 export const paraMark = (wbwData: IWbw[]): IWbw[] => {
 export const paraMark = (wbwData: IWbw[]): IWbw[] => {
   //处理段落标记,支持点击段落引用弹窗
   //处理段落标记,支持点击段落引用弹窗
@@ -141,6 +144,7 @@ interface IWidget {
   para: number;
   para: number;
   wordStart: number;
   wordStart: number;
   wordEnd: number;
   wordEnd: number;
+  channel?: IChannel;
   channelId: string;
   channelId: string;
   channelType?: TChannelType;
   channelType?: TChannelType;
   channelLang?: string;
   channelLang?: string;
@@ -158,6 +162,7 @@ interface IWidget {
 export const WbwSentCtl = ({
 export const WbwSentCtl = ({
   data,
   data,
   answer,
   answer,
+  channel,
   channelId,
   channelId,
   channelType,
   channelType,
   channelLang,
   channelLang,
@@ -675,13 +680,23 @@ export const WbwSentCtl = ({
     saveWbwAll(newData);
     saveWbwAll(newData);
   };
   };
 
 
+  let updatedAt = moment("1970-1-1");
+  data.forEach((value) => {
+    if (moment(value.updated_at).isAfter(updatedAt)) {
+      updatedAt = moment(value.updated_at);
+    }
+  });
+
   return (
   return (
     <div style={{ width: "100%" }}>
     <div style={{ width: "100%" }}>
-      <div
-        className="progress"
-        style={{ display: showProgress ? "block" : "none" }}
-      >
-        <Progress percent={progress} size="small" />
+      <div style={{ display: showProgress ? "flex" : "none" }}>
+        <div className="progress" style={{ width: 400 }}>
+          <Progress percent={progress} size="small" />
+        </div>
+        <Space>
+          <Studio data={studio} hideAvatar />
+          {<TimeShow updatedAt={updatedAt.toString()} />}
+        </Space>
       </div>
       </div>
       <div className={`layout-${layoutDirection}`}>
       <div className={`layout-${layoutDirection}`}>
         <Dropdown
         <Dropdown
@@ -754,7 +769,6 @@ export const WbwSentCtl = ({
                       resetWbw();
                       resetWbw();
                     },
                     },
                   });
                   });
-
                   break;
                   break;
               }
               }
             },
             },