Browse Source

按 ctl 弹窗

visuddhinanda 2 years ago
parent
commit
c4c697a8d7
1 changed files with 12 additions and 6 deletions
  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>