Browse Source

文本加复制按钮

visuddhinanda 2 years ago
parent
commit
291b1680cf
1 changed files with 10 additions and 2 deletions
  1. 10 2
      dashboard/src/components/corpus/SentHistory.tsx

+ 10 - 2
dashboard/src/components/corpus/SentHistory.tsx

@@ -1,11 +1,13 @@
 import { ProList } from "@ant-design/pro-components";
-import { Space } from "antd";
+import { Space, Typography } from "antd";
 
 import { get } from "../../request";
 import User from "../auth/User";
 import { IUser } from "../auth/UserName";
 import TimeShow from "../general/TimeShow";
 
+const { Paragraph } = Typography;
+
 export interface ISentHistoryData {
   id: string;
   sent_uid: string;
@@ -83,7 +85,13 @@ const SentHistoryWidget = ({ sentId }: IWidget) => {
       }}
       metas={{
         title: {
-          dataIndex: "content",
+          render: (text, row, index, action) => {
+            return (
+              <Paragraph copyable={{ text: row.content }}>
+                {row.content}
+              </Paragraph>
+            );
+          },
         },
         avatar: {
           dataIndex: "image",