visuddhinanda 3 лет назад
Родитель
Сommit
55955dec72

+ 2 - 0
dashboard/src/components/api/Corpus.ts

@@ -19,6 +19,7 @@ export interface IApiPaliChapterList {
   parent: number;
   chapter_strlen: number;
   path: string;
+  progress_line?: number[];
 }
 
 export interface IApiResponsePaliChapterList {
@@ -218,6 +219,7 @@ export interface IChapterData {
   like: number;
   status?: number;
   progress: number;
+  progress_line?: number[];
   created_at: string;
   updated_at: string;
 }

+ 1 - 0
dashboard/src/components/corpus/ChapterCard.tsx

@@ -23,6 +23,7 @@ export interface ChapterData {
   channel: IChannelApiData;
   studio: IStudio;
   progress: number;
+  progressLine?: number[];
   createdAt: string;
   updatedAt: string;
   hit: number;

+ 13 - 6
dashboard/src/components/corpus/PaliChapterCard.tsx

@@ -1,7 +1,7 @@
 import { Row, Col } from "antd";
 import { Typography } from "antd";
 import { API_HOST } from "../../request";
-
+import { TinyLine } from "@ant-design/plots";
 import TocPath from "./TocPath";
 
 const { Title, Link } = Typography;
@@ -13,6 +13,7 @@ export interface IPaliChapterData {
   Path: string;
   Book: number;
   Paragraph: number;
+  progressLine?: number[];
 }
 
 interface IWidget {
@@ -54,11 +55,17 @@ const Widget = ({ data, onTitleClick }: IWidget) => {
               </Row>
             </Col>
             <Col span={8}>
-              <img
-                src={`${API_HOST}/storage/images/chapter_dynamic/${data.Book}/${data.Paragraph}/globle.svg`}
-                width={200}
-                alt="章节动态"
-              />
+              {data.progressLine ? (
+                <TinyLine
+                  height={60}
+                  width={200}
+                  autoFit={false}
+                  data={data.progressLine}
+                  smooth={true}
+                />
+              ) : (
+                <></>
+              )}
             </Col>
           </Row>
           <Row>

+ 1 - 0
dashboard/src/components/corpus/PaliChapterListByPara.tsx

@@ -26,6 +26,7 @@ const Widget = ({ chapter, onChapterClick }: IWidget) => {
           Path: item.path,
           Book: item.book,
           Paragraph: item.paragraph,
+          progressLine: item.progress_line,
         };
       });
       setTableData(newTree);

+ 1 - 0
dashboard/src/components/corpus/PaliChapterListByTag.tsx

@@ -26,6 +26,7 @@ const Widget = (prop: IWidgetPaliChapterListByTag) => {
           Path: item.path,
           Book: item.book,
           Paragraph: item.paragraph,
+          progressLine: item.progress_line,
         };
       });
       setTableData(newTree);