visuddhinanda 2 лет назад
Родитель
Сommit
892ebef036
1 измененных файлов с 15 добавлено и 1 удалено
  1. 15 1
      dashboard/src/components/corpus/TopChapter.tsx

+ 15 - 1
dashboard/src/components/corpus/TopChapter.tsx

@@ -3,6 +3,7 @@ import { ProList } from "@ant-design/pro-components";
 
 
 import { get } from "../../request";
 import { get } from "../../request";
 import { IChapterListResponse } from "../../components/api/Corpus";
 import { IChapterListResponse } from "../../components/api/Corpus";
+import { Link } from "react-router-dom";
 
 
 const { Paragraph } = Typography;
 const { Paragraph } = Typography;
 
 
@@ -14,6 +15,7 @@ interface IItem {
   book: number;
   book: number;
   paragraph: number;
   paragraph: number;
   path: string;
   path: string;
+  channelId: string;
   progress: number;
   progress: number;
   view: number;
   view: number;
   createdAt: number;
   createdAt: number;
@@ -26,8 +28,19 @@ const TopChapterWidget = ({ studioName }: IWidget) => {
   return (
   return (
     <ProList<IItem>
     <ProList<IItem>
       metas={{
       metas={{
-        title: { dataIndex: "title" },
+        title: {
+          render: (dom, entity, index, action, schema) => {
+            return (
+              <Link
+                to={`/article/chapter/${entity.book}-${entity.paragraph}?mode=read&channel=${entity.channelId}`}
+              >
+                {entity.title ? entity.title : entity.subTitle}
+              </Link>
+            );
+          },
+        },
         subTitle: {},
         subTitle: {},
+        description: { dataIndex: "path" },
         type: {},
         type: {},
         avatar: {},
         avatar: {},
         content: {
         content: {
@@ -66,6 +79,7 @@ const TopChapterWidget = ({ studioName }: IWidget) => {
             title: item.title,
             title: item.title,
             subTitle: item.toc,
             subTitle: item.toc,
             summary: item.summary,
             summary: item.summary,
+            channelId: item.channel_id,
             path: item.path,
             path: item.path,
             progress: item.progress,
             progress: item.progress,
             createdAt: createdAt.getTime(),
             createdAt: createdAt.getTime(),