瀏覽代碼

按 ctl 弹窗

visuddhinanda 2 年之前
父節點
當前提交
c4c697a8d7
共有 1 個文件被更改,包括 12 次插入6 次删除
  1. 12 6
      dashboard/src/pages/library/anthology/show.tsx

+ 12 - 6
dashboard/src/pages/library/anthology/show.tsx

@@ -2,6 +2,7 @@ import { useNavigate, useParams } from "react-router-dom";
 import { Col, Row } from "antd";
 
 import AnthologyDetail from "../../../components/article/AnthologyDetail";
+import { fullUrl } from "../../../utils";
 
 const Widget = () => {
   // TODO
@@ -15,14 +16,19 @@ const Widget = () => {
         <Col flex="auto"></Col>
         <Col flex={pageMaxWidth}>
           <AnthologyDetail
-            onArticleSelect={(anthologyId: string, keys: string[]) => {
-              if (keys[0]) {
-                navigate(
-                  `/article/article/${keys[0]}?mode=read&anthology=${anthologyId}`
-                );
+            aid={id}
+            onArticleClick={(
+              anthologyId: string,
+              articleId: string,
+              target: string
+            ) => {
+              let url = `/article/article/${articleId}?mode=read&anthology=${anthologyId}`;
+              if (target === "_blank") {
+                window.open(fullUrl(url), "_blank");
+              } else {
+                navigate(url);
               }
             }}
-            aid={id}
           />
         </Col>
         <Col flex="auto"></Col>