Просмотр исходного кода

Merge pull request #2201 from visuddhinanda/agile

🐛 文章channel进度无法显示
visuddhinanda 1 год назад
Родитель
Сommit
990da0c6fc

+ 9 - 0
dashboard/src/components/api/Article.ts

@@ -235,3 +235,12 @@ export interface ICSParaNavItem {
   start: number;
   start: number;
   content: string;
   content: string;
 }
 }
+
+export interface IArticleFtsListResponse {
+  ok: boolean;
+  message: string;
+  data: {
+    rows: IArticleDataResponse[];
+    page: { size: number; current: number; total: number };
+  };
+}

+ 11 - 6
dashboard/src/components/channel/ChannelMy.tsx

@@ -170,10 +170,13 @@ const ChannelMy = ({
       const id = articleId?.split("-");
       const id = articleId?.split("-");
       if (id?.length === 2) {
       if (id?.length === 2) {
         const url = `/v2/sentences-in-chapter?book=${id[0]}&para=${id[1]}`;
         const url = `/v2/sentences-in-chapter?book=${id[0]}&para=${id[1]}`;
-        console.info("ChannelMy url", url);
+        console.info("ChannelMy url api request", url);
         get<ISentInChapterListResponse>(url)
         get<ISentInChapterListResponse>(url)
           .then((res) => {
           .then((res) => {
-            console.debug("ChannelMy ISentInChapterListResponse", res);
+            console.debug(
+              "ChannelMy ISentInChapterListResponse api response",
+              res
+            );
             if (res && res.ok) {
             if (res && res.ok) {
               sentList = res.data.rows.map((item) => {
               sentList = res.data.rows.map((item) => {
                 return `${item.book}-${item.paragraph}-${item.word_begin}-${item.word_end}`;
                 return `${item.book}-${item.paragraph}-${item.word_begin}-${item.word_end}`;
@@ -189,7 +192,8 @@ const ChannelMy = ({
           });
           });
       }
       }
     } else {
     } else {
-      setSentencesId(getSentIdInArticle());
+      sentList = getSentIdInArticle();
+      setSentencesId(sentList);
       loadChannel(sentList);
       loadChannel(sentList);
     }
     }
   };
   };
@@ -199,14 +203,15 @@ const ChannelMy = ({
     console.debug("sentences", sentences);
     console.debug("sentences", sentences);
     const currOwner = "all";
     const currOwner = "all";
 
 
-    console.log("owner", currOwner);
+    const url = `/v2/channel-progress`;
+    console.info("api request", url);
     setLoading(true);
     setLoading(true);
-    post<IProgressRequest, IApiResponseChannelList>(`/v2/channel-progress`, {
+    post<IProgressRequest, IApiResponseChannelList>(url, {
       sentence: sentences,
       sentence: sentences,
       owner: currOwner,
       owner: currOwner,
     })
     })
       .then((res) => {
       .then((res) => {
-        console.debug("progress data", res.data.rows);
+        console.debug("progress data api response", res);
         const items: IItem[] = res.data.rows
         const items: IItem[] = res.data.rows
           .filter((value) => value.name.substring(0, 4) !== "_Sys")
           .filter((value) => value.name.substring(0, 4) !== "_Sys")
           .map((item, id) => {
           .map((item, id) => {

+ 1 - 1
dashboard/src/pages/library/article/show.tsx

@@ -326,7 +326,7 @@ const Widget = () => {
                 <ToolButtonTag type={type} articleId={id} />
                 <ToolButtonTag type={type} articleId={id} />
                 <ToolButtonPr type={type} articleId={id} />
                 <ToolButtonPr type={type} articleId={id} />
                 <ToolButtonDiscussion type={type} articleId={id} />
                 <ToolButtonDiscussion type={type} articleId={id} />
-                <ToolButtonSearch type={type} articleId={id} />
+                <ToolButtonSearch type={type as ArticleType} articleId={id} />
                 <ToolButtonSetting type={type} articleId={id} />
                 <ToolButtonSetting type={type} articleId={id} />
               </Space>
               </Space>
             </div>
             </div>