|
@@ -18,11 +18,11 @@ type Props = {
|
|
|
|
|
|
function A0Map({ type, sonChaneType }: Props) {
|
|
|
useEffect(() => {
|
|
|
- setSonPage(null);
|
|
|
- setCheckedData1(null);
|
|
|
-
|
|
|
- // if (type === 3) setMapSon(0);
|
|
|
- if (type !== 2) setMapSon(0);
|
|
|
+ if (type !== 2) {
|
|
|
+ setSonPage(null);
|
|
|
+ setCheckedData1(null);
|
|
|
+ setMapSon(0);
|
|
|
+ }
|
|
|
}, [type]);
|
|
|
|
|
|
// 控制二级地图的显示
|
|
@@ -55,6 +55,8 @@ function A0Map({ type, sonChaneType }: Props) {
|
|
|
onClick={() => {
|
|
|
setCheckedData1(v);
|
|
|
setSonPage(v.filename);
|
|
|
+
|
|
|
+ sonChaneType(2);
|
|
|
}}
|
|
|
key={v.id}
|
|
|
className="A0iconBox"
|
|
@@ -91,7 +93,9 @@ function A0Map({ type, sonChaneType }: Props) {
|
|
|
{maoData2.map((v) => (
|
|
|
<div
|
|
|
onClick={() => {
|
|
|
- window.open(v.link.startsWith('http') ? v.link : baseURL + v.link);
|
|
|
+ window.open(
|
|
|
+ v.link.startsWith("http") ? v.link : baseURL + v.link
|
|
|
+ );
|
|
|
// setMapSon(v.imgId);
|
|
|
sonChaneType(3);
|
|
|
}}
|
|
@@ -120,7 +124,11 @@ function A0Map({ type, sonChaneType }: Props) {
|
|
|
<div
|
|
|
className={classNames(
|
|
|
"ic2HoverBox",
|
|
|
- v.type === "right" ? "ic2HoverBox2" : v.type === "center" ? "ic2HoverBox3" : ""
|
|
|
+ v.type === "right"
|
|
|
+ ? "ic2HoverBox2"
|
|
|
+ : v.type === "center"
|
|
|
+ ? "ic2HoverBox3"
|
|
|
+ : ""
|
|
|
)}
|
|
|
>
|
|
|
<div className="ic2HoverBoxll">{v.name}</div>
|
|
@@ -142,7 +150,9 @@ function A0Map({ type, sonChaneType }: Props) {
|
|
|
</div>
|
|
|
|
|
|
{/* 二级地图 */}
|
|
|
- {(sonPage && checkedData1) ? <MapSon title={checkedData1.name} filename={sonPage} /> : null}
|
|
|
+ {sonPage && checkedData1 ? (
|
|
|
+ <MapSon title={checkedData1.name} filename={sonPage} />
|
|
|
+ ) : null}
|
|
|
|
|
|
{/* <div className="yunBox">
|
|
|
<div className="yunSon1"></div>
|