|
@@ -1,5 +1,6 @@
|
|
|
-import { Drawer } from "antd";
|
|
|
|
|
|
|
+import { Button, Drawer, Space } from "antd";
|
|
|
import React, { useEffect, useState } from "react";
|
|
import React, { useEffect, useState } from "react";
|
|
|
|
|
+import { Link } from "react-router-dom";
|
|
|
|
|
|
|
|
import Article, { ArticleMode, ArticleType } from "./Article";
|
|
import Article, { ArticleMode, ArticleType } from "./Article";
|
|
|
|
|
|
|
@@ -44,6 +45,15 @@ const ArticleDrawerWidget = ({
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const getUrl = (openMode?: string): string => {
|
|
|
|
|
+ let url = `/article/${type}/${articleId}?mode=`;
|
|
|
|
|
+ url += openMode ? openMode : mode ? mode : "read";
|
|
|
|
|
+ url += channelId ? `&channel=${channelId}` : "";
|
|
|
|
|
+ url += book ? `&book=${book}` : "";
|
|
|
|
|
+ url += para ? `&par=${para}` : "";
|
|
|
|
|
+ return url;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<span onClick={() => showDrawer()}>{trigger}</span>
|
|
<span onClick={() => showDrawer()}>{trigger}</span>
|
|
@@ -54,6 +64,12 @@ const ArticleDrawerWidget = ({
|
|
|
onClose={onDrawerClose}
|
|
onClose={onDrawerClose}
|
|
|
open={openDrawer}
|
|
open={openDrawer}
|
|
|
destroyOnClose={true}
|
|
destroyOnClose={true}
|
|
|
|
|
+ extra={
|
|
|
|
|
+ <Space>
|
|
|
|
|
+ <Link to={getUrl()}>在单页面中打开</Link>
|
|
|
|
|
+ <Link to={getUrl("edit")}>翻译模式</Link>
|
|
|
|
|
+ </Space>
|
|
|
|
|
+ }
|
|
|
>
|
|
>
|
|
|
<Article
|
|
<Article
|
|
|
active={true}
|
|
active={true}
|