Parcourir la source

标点符号不显示连接relation按钮

visuddhinanda il y a 2 ans
Parent
commit
7eaf373879

+ 1 - 1
dashboard/src/components/template/Wbw/RelaGraphic.tsx

@@ -30,7 +30,7 @@ const RelaGraphicWidget = ({ wbwData }: IWidget) => {
                   .replaceAll("{", "")
                   .replaceAll("{", "")
                   .replaceAll("}", "")
                   .replaceAll("}", "")
               : "";
               : "";
-            return `${relation.sour_id}(${relation.sour_spell}<br />${meaning}) --"${relation.relation}<br />${localName}"--> ${relation.dest_id}(${relation.dest_spell})\n`;
+            return `${relation.sour_id}(${relation.sour_spell}<br />${meaning}) --"${relation.relation}<br />${localName}"--> ${relation.dest_id}("${relation.dest_spell}")\n`;
           });
           });
           return graphic.join("");
           return graphic.join("");
         } else {
         } else {

+ 3 - 1
dashboard/src/components/template/Wbw/WbwWord.tsx

@@ -235,7 +235,9 @@ const WbwWordWidget = ({
           setShowRelationTool(false);
           setShowRelationTool(false);
         }}
         }}
       >
       >
-        {showRelationTool ? <WbwRelationAdd data={data} /> : undefined}
+        {showRelationTool && data.real.value ? (
+          <WbwRelationAdd data={data} />
+        ) : undefined}
         <WbwPali
         <WbwPali
           key="pali"
           key="pali"
           data={wordData}
           data={wordData}

+ 9 - 0
dashboard/src/utils.ts

@@ -1,6 +1,15 @@
 import { SortOrder } from "antd/lib/table/interface";
 import { SortOrder } from "antd/lib/table/interface";
 import lodash from "lodash";
 import lodash from "lodash";
 
 
+export function dashboardBasePath(): string {
+  if (process.env.PUBLIC_URL.includes("http")) {
+    //for CDN
+    return process.env.PUBLIC_URL;
+  } else {
+    return window.location.origin + process.env.PUBLIC_URL;
+  }
+}
+
 export function fullUrl(url: string): string {
 export function fullUrl(url: string): string {
   if (process.env.PUBLIC_URL.includes("http")) {
   if (process.env.PUBLIC_URL.includes("http")) {
     //for CDN
     //for CDN