Przeglądaj źródła

Merge pull request #2097 from visuddhinanda/agile

课程默认显示进度条
visuddhinanda 1 rok temu
rodzic
commit
ed242a6103

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

@@ -159,7 +159,7 @@ const SentWbwWidget = ({
               {...item}
               readonly={isCourse}
               answer={answer}
-              wbwProgress={wbwProgress}
+              wbwProgress={isCourse ?? wbwProgress}
             />
           </List.Item>
         )}

+ 4 - 0
dashboard/src/components/template/Wbw/WbwWord.tsx

@@ -20,6 +20,7 @@ import { ArticleMode } from "../../article/Article";
 import WbwReal from "./WbwReal";
 import WbwDetailFm from "./WbwDetailFm";
 import { IStudio } from "../../auth/Studio";
+import { IUser } from "../../auth/User";
 
 export type TFieldName =
   | "word"
@@ -91,6 +92,9 @@ export interface IWbw {
   hasComment?: boolean;
   grammarId?: string;
   bookName?: string;
+  editor?: IUser;
+  created_at?: string;
+  updated_at?: string;
 }
 export interface IWbwFields {
   real?: boolean;

+ 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 { MoreOutlined, ExclamationCircleOutlined } from "@ant-design/icons";
 
@@ -24,7 +24,10 @@ import { getGrammar } from "../../reducers/term-vocabulary";
 import modal from "antd/lib/modal";
 import { UserWbwPost } from "../dict/MyCreate";
 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[] => {
   //处理段落标记,支持点击段落引用弹窗
@@ -141,6 +144,7 @@ interface IWidget {
   para: number;
   wordStart: number;
   wordEnd: number;
+  channel?: IChannel;
   channelId: string;
   channelType?: TChannelType;
   channelLang?: string;
@@ -158,6 +162,7 @@ interface IWidget {
 export const WbwSentCtl = ({
   data,
   answer,
+  channel,
   channelId,
   channelType,
   channelLang,
@@ -675,13 +680,23 @@ export const WbwSentCtl = ({
     saveWbwAll(newData);
   };
 
+  let updatedAt = moment("1970-1-1");
+  data.forEach((value) => {
+    if (moment(value.updated_at).isAfter(updatedAt)) {
+      updatedAt = moment(value.updated_at);
+    }
+  });
+
   return (
     <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 className={`layout-${layoutDirection}`}>
         <Dropdown
@@ -754,7 +769,6 @@ export const WbwSentCtl = ({
                       resetWbw();
                     },
                   });
-
                   break;
               }
             },

+ 6 - 1
dashboard/src/pages/studio/course/list.tsx

@@ -121,7 +121,12 @@ const Widget = () => {
   const canCreate = !(activeKey !== "create" || user?.roles?.includes("basic"));
 
   const buttonEdit = (course: ICourseDataResponse, key: string | number) => {
-    const canManage: TCourseRole[] = ["owner", "teacher", "manager"];
+    const canManage: TCourseRole[] = [
+      "owner",
+      "teacher",
+      "manager",
+      "assistant",
+    ];
     if (course.my_role && canManage.includes(course.my_role)) {
       return (
         <Link