Explorar el Código

Merge branch 'master' of http://192.168.0.115:3000/lanxin/Chengzhebei into master

shaogen1995 hace 3 semanas
padre
commit
983faf40b3

+ 1 - 1
public/myData/myData.js

@@ -1020,7 +1020,7 @@ const myDataTemp = {
         },
         {
           title: '菩萨像',
-          txt: '菩萨<span>头戴冠</span>,面相亦方圆,披帛交叉穿环和横于腹膝二道。'
+          txt: '菩萨<span>头戴冠面相亦方圆</span>,披帛交叉穿环和横于腹膝二道。'
         }
       ],
       imgItems: [

+ 6 - 0
src/pages/A6ybwx/A6_2_zxzgh/components/Bq/index.module.scss

@@ -167,6 +167,9 @@
                 width: 0px;
                 height: 0px;
               }
+              & > span {
+                color: rgb(169, 135, 99);
+              }
             }
           }
         }
@@ -446,6 +449,9 @@
               width: 0px;
               height: 0px;
             }
+            & > span {
+              color: rgb(169, 135, 99);
+            }
           }
         }
       }

+ 2 - 2
src/pages/A6ybwx/A6_2_zxzgh/components/Bq/index.tsx

@@ -58,14 +58,14 @@ function Bq({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearType)
           <div className='lInfo1'>
             <div className='item' key={index}>
               <div className='lTitle songFont'>{sItem.items[0].title}</div>
-              <div className='lText'>{sItem.items[0].txt}</div>
+              <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[0].txt }}></div>
             </div>
           </div>
           {/* 菩萨 */}
           <div className='lInfo2'>
             <div className='item' key={index}>
               <div className='lTitle songFont'>{sItem.items[1].title}</div>
-              <div className='lText'>{sItem.items[1].txt}</div>
+              <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[1].txt }}></div>
             </div>
           </div>
         </div>

+ 3 - 0
src/pages/A6ybwx/A6_2_zxzgh/components/Bwwq/index.module.scss

@@ -166,6 +166,9 @@
                 width: 0px;
                 height: 0px;
               }
+              & > span {
+                color: rgb(169, 135, 99);
+              }
             }
           }
         }

+ 6 - 0
src/pages/A6ybwx/A6_2_zxzgh/components/Bwzwq/index.module.scss

@@ -170,6 +170,9 @@
                 width: 0px;
                 height: 0px;
               }
+              & > span {
+                color: rgb(169, 135, 99);
+              }
             }
           }
         }
@@ -350,6 +353,9 @@
               width: 0px;
               height: 0px;
             }
+            & > span {
+              color: rgb(169, 135, 99);
+            }
           }
         }
       }

+ 2 - 2
src/pages/A6ybwx/A6_2_zxzgh/components/Bwzwq/index.tsx

@@ -16,7 +16,7 @@ function Bwzwq({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearTy
             <div className='lInfo'>
               <div className='item' key={index}>
                 <div className='lTitle songFont'>{sItem.items[0].title}</div>
-                <div className='lText'>{sItem.items[0].txt}</div>
+                <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[0].txt }}></div>
               </div>
             </div>
           </div>
@@ -57,7 +57,7 @@ function Bwzwq({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearTy
           <div className='lInfo'>
             <div className='item' key={index}>
               <div className='lTitle songFont'>{sItem.items[1].title}</div>
-              <div className='lText'>{sItem.items[1].txt}</div>
+              <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[1].txt }}></div>
             </div>
           </div>
         </div>

+ 3 - 0
src/pages/A6ybwx/A6_2_zxzgh/components/Bwzzq/index.module.scss

@@ -358,6 +358,9 @@
               width: 0px;
               height: 0px;
             }
+            & > span {
+              color: rgb(169, 135, 99);
+            }
           }
         }
       }

+ 6 - 0
src/pages/A6ybwx/A6_2_zxzgh/components/Bz/index.module.scss

@@ -166,6 +166,9 @@
                 width: 0px;
                 height: 0px;
               }
+              & > span {
+                color: rgb(169, 135, 99);
+              }
             }
           }
         }
@@ -357,6 +360,9 @@
               width: 0px;
               height: 0px;
             }
+            & > span {
+              color: rgb(169, 135, 99);
+            }
           }
         }
       }

+ 2 - 2
src/pages/A6ybwx/A6_2_zxzgh/components/Bz/index.tsx

@@ -23,7 +23,7 @@ function Bz({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearType)
             <div className='lInfo'>
               <div className='item' key={index}>
                 <div className='lTitle songFont'>{sItem.items[0].title}</div>
-                <div className='lText'>{sItem.items[0].txt}</div>
+                <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[0].txt }}></div>
               </div>
             </div>
           </div>
@@ -65,7 +65,7 @@ function Bz({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearType)
           <div className='lInfo2'>
             <div className='item' key={index}>
               <div className='lTitle songFont'>{sItem.items[1].title}</div>
-              <div className='lText'>{sItem.items[1].txt}</div>
+              <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[1].txt }}></div>
             </div>
           </div>
         </div>

+ 43 - 8
src/pages/A9knowlege/index.tsx

@@ -91,9 +91,18 @@ function A9knowlege() {
             max: 3
           },
           label: { position: 'right' },
-          emphasis: { focus: 'adjacency' },
+          focusNodeAdjacency: true,
+          emphasis: {
+            focus: 'adjacency',
+            lineStyle: {
+              width: 3,
+              opacity: 1
+            }
+          },
           force: { repulsion: 200, edgeLength: [50, 120] },
-          lineStyle: { color: 'source', curveness: 0.2 }
+          lineStyle: { color: 'source', curveness: 0.2 },
+          edgeLabel: { show: false },
+          edgeSymbol: ['none', 'none']
         }
       ]
     }
@@ -107,15 +116,41 @@ function A9knowlege() {
     myChart.on('click', function (params: any) {
       if (!params || !params.data) return
 
-      // 高亮相关节点连线
+      // 取消所有高亮
       myChart.dispatchAction({
-        type: 'highlight',
-        dataIndex: params.dataIndex
+        type: 'downplay'
       })
 
-      const node = params.data
-      if (node && node.raw && node.raw.type) {
-        setDetail(node.raw)
+      if (params.dataType === 'edge') {
+        const edge = params.data
+        const sourceIndex = graph.nodes.findIndex((n: any) => n.id === edge.source)
+        const targetIndex = graph.nodes.findIndex((n: any) => n.id === edge.target)
+
+        if (sourceIndex !== -1 && targetIndex !== -1) {
+          // 高亮源节点
+          myChart.dispatchAction({
+            type: 'highlight',
+            dataIndex: sourceIndex
+          })
+          // 高亮目标节点
+          setTimeout(() => {
+            myChart.dispatchAction({
+              type: 'highlight',
+              dataIndex: targetIndex
+            })
+          }, 10)
+        }
+      } else {
+        // 点击的是节点
+        myChart.dispatchAction({
+          type: 'highlight',
+          dataIndex: params.dataIndex
+        })
+
+        const node = params.data
+        if (node && node.raw && node.raw.type) {
+          setDetail(node.raw)
+        }
       }
     })
     const resizeHandler = () => myChart.resize()