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

Merge pull request #1353 from visuddhinanda/agile

#1352 #1346
visuddhinanda 2 лет назад
Родитель
Сommit
44288c9e01

+ 7 - 5
dashboard/src/assets/icon/index.tsx

@@ -84,7 +84,7 @@ const HandOutlined = () => (
 
 const ColumnOutlined = () => (
   <svg
-    viewBox="0 0 1024 1024"
+    viewBox="150 150 874 874"
     version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     p-id="865"
@@ -93,11 +93,13 @@ const ColumnOutlined = () => (
     fill="currentColor"
   >
     <path
-      d="M176 177h672v672H176V177z m-56-64a8 8 0 0 0-8 8v760c0 17.673 14.327 32 32 32h736c17.673 0 32-14.327 32-32V121a8 8 0 0 0-8-8H120z"
-      p-id="866"
+      d="M824.888889 170.666667H199.111111a56.888889 56.888889 0 0 0-56.888889 56.888889v568.888888a56.888889 56.888889 0 0 0 56.888889 56.888889h625.777778a56.888889 56.888889 0 0 0 56.888889-56.888889V227.555556a56.888889 56.888889 0 0 0-56.888889-56.888889z m0 597.333333a28.444444 28.444444 0 0 1-28.444445 28.444444H227.555556a28.444444 28.444444 0 0 1-28.444445-28.444444V256a28.444444 28.444444 0 0 1 28.444445-28.444444h568.888888a28.444444 28.444444 0 0 1 28.444445 28.444444z"
+      p-id="1478"
+    ></path>
+    <path
+      d="M512 256m28.444444 0l227.555556 0q28.444444 0 28.444444 28.444444l0 455.111112q0 28.444444-28.444444 28.444444l-227.555556 0q-28.444444 0-28.444444-28.444444l0-455.111112q0-28.444444 28.444444-28.444444Z"
+      p-id="1479"
     ></path>
-    <path d="M164 159h700v82H164v-82z" p-id="867"></path>
-    <path d="M546 177v700h-64V177h64z" p-id="868"></path>
   </svg>
 );
 

+ 18 - 0
dashboard/src/components/template/WbwSent.tsx

@@ -526,6 +526,15 @@ export const WbwSentCtl = ({
               key: "wbw-dict-publish-all",
               label: "发布全部单词",
             },
+            {
+              type: "divider",
+            },
+            {
+              key: "copy-text",
+              label: intl.formatMessage({
+                id: "buttons.copy.pali.text",
+              }),
+            },
           ],
           onClick: ({ key }) => {
             console.log(`Click on item ${key}`);
@@ -537,6 +546,15 @@ export const WbwSentCtl = ({
               case "wbw-dict-publish-all":
                 wbwPublish(wordData);
                 break;
+              case "copy-text":
+                const paliText = wordData
+                  .filter((value) => value.type?.value !== ".ctl.")
+                  .map((item) => item.word.value)
+                  .join(" ");
+                navigator.clipboard.writeText(paliText).then(() => {
+                  message.success("已经拷贝到剪贴板");
+                });
+                break;
             }
           },
         }}

+ 2 - 0
dashboard/src/locales/zh-Hans/buttons.ts

@@ -26,6 +26,8 @@ const items = {
   "buttons.ok": "确定",
   "buttons.close": "关闭",
   "buttons.copy.to": "复制到",
+  "buttons.copy.text": "复制文本",
+  "buttons.copy.pali.text": "复制巴利语文本",
   "buttons.basic.information": "基本信息",
   "buttons.share": "分享",
   "buttons.yes": "是",

+ 4 - 0
dashboard/src/locales/zh-Hans/dict/index.ts

@@ -111,6 +111,8 @@ const items = {
   "dict.fields.type.pron.short.label": "代",
   "dict.fields.type.num.label": "数词",
   "dict.fields.type.num.short.label": "数",
+  "dict.fields.type.num:base.label": "数词词干",
+  "dict.fields.type.num:base.short.label": "数干",
   "dict.fields.type.adv.label": "副词",
   "dict.fields.type.adv.short.label": "副",
   "dict.fields.type.conj.label": "连词",
@@ -157,6 +159,8 @@ const items = {
   "dict.fields.type.vind.label": "动不变",
   "dict.fields.type.vdn.label": "衍生动名词",
   "dict.fields.type.vdn.short.label": "动名",
+  "dict.fields.type.comp.label": "复合词",
+  "dict.fields.type.comp.short.label": "合",
 };
 
 export default items;

+ 22 - 16
dashboard/src/pages/library/article/show.tsx

@@ -1,9 +1,9 @@
-import { Affix, Button, Divider, Space } from "antd";
+import { Affix, Button, Divider, Space, Tooltip } from "antd";
 import { Header } from "antd/lib/layout/layout";
 import { Key } from "antd/lib/table/interface";
 import { useEffect, useState } from "react";
 import { useNavigate, useParams, useSearchParams } from "react-router-dom";
-import { FieldTimeOutlined } from "@ant-design/icons";
+import { FieldTimeOutlined, UnorderedListOutlined } from "@ant-design/icons";
 
 import { ColumnOutlinedIcon } from "../../../assets/icon";
 import { IArticleDataResponse } from "../../../components/api/Article";
@@ -172,20 +172,26 @@ const Widget = () => {
               }}
             />
             <Divider type="vertical" />
-            <Button
-              style={{ display: "block", color: "white" }}
-              icon={<ColumnOutlinedIcon />}
-              type="text"
-              onClick={() => setAnchorNavOpen((value) => !value)}
-            />
-            <Button
-              style={{ display: "block", color: "white" }}
-              icon={<ColumnOutlinedIcon />}
-              type="text"
-              onClick={() =>
-                setRightPanel((value) => (value === "close" ? "open" : "close"))
-              }
-            />
+            <Tooltip title="文章目录" placement="bottomLeft">
+              <Button
+                style={{ display: "block", color: "white" }}
+                icon={<UnorderedListOutlined />}
+                type="text"
+                onClick={() => setAnchorNavOpen((value) => !value)}
+              />
+            </Tooltip>
+            <Tooltip title="侧边栏" placement="bottomLeft">
+              <Button
+                style={{ display: "block", color: "white" }}
+                icon={<ColumnOutlinedIcon />}
+                type="text"
+                onClick={() =>
+                  setRightPanel((value) =>
+                    value === "close" ? "open" : "close"
+                  )
+                }
+              />
+            </Tooltip>
           </Space>
         </Header>
       </Affix>