Browse Source

添加句子id 搜索用的div

visuddhinanda 3 years ago
parent
commit
ee14f52aeb

+ 1 - 0
dashboard/src/components/template/SentEdit.tsx

@@ -63,6 +63,7 @@ export const SentEditInner = ({
     <Card bodyStyle={{ paddingBottom: 0 }} size="small">
       <SentMenu>
         <SentContent
+          sid={id}
           origin={origin}
           translation={translation}
           layout={layout}

+ 7 - 0
dashboard/src/components/template/SentEdit/SentContent.tsx

@@ -13,11 +13,13 @@ interface ILayoutFlex {
 }
 type TDirection = "row" | "column";
 interface IWidgetSentContent {
+  sid?: string;
   origin?: ISentence[];
   translation?: ISentence[];
   layout?: TDirection;
 }
 const Widget = ({
+  sid,
   origin,
   translation,
   layout = "column",
@@ -63,6 +65,11 @@ const Widget = ({
         marginBottom: 10,
       }}
     >
+      <div
+        dangerouslySetInnerHTML={{
+          __html: `<div class="pcd_sent" id="sent_${sid}"></div>`,
+        }}
+      />
       <div style={{ flex: layoutFlex.left, color: "#9f3a01" }}>
         {origin?.map((item, id) => {
           if (item.channel.type === "wbw") {