|
@@ -72,7 +72,6 @@ function A1home() {
|
|
|
[]
|
|
|
)
|
|
|
|
|
|
-
|
|
|
const { list: listAll } = useSelector((state: RootState) => state.Martyr.tableInfo)
|
|
|
const martyrListByCity = useMemo(
|
|
|
() =>
|
|
@@ -186,6 +185,8 @@ function A1home() {
|
|
|
}
|
|
|
}, [])
|
|
|
|
|
|
+ // 添加“(数量)”到城市末尾
|
|
|
+
|
|
|
// 更改tooltip文本内容
|
|
|
const changeTooltipText = useCallback((cityId: string, text: string) => {
|
|
|
if (svgRef.current) {
|
|
@@ -202,7 +203,7 @@ function A1home() {
|
|
|
const target = e.target as SVGElement
|
|
|
const tooltip = svgRef.current?.querySelector(`#tap-${target.id}Tooltip`)
|
|
|
if (tooltip) {
|
|
|
- ; (tooltip as HTMLElement).style.opacity = '0'
|
|
|
+ ;(tooltip as HTMLElement).style.opacity = '0'
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -226,7 +227,8 @@ function A1home() {
|
|
|
console.log(martyrListByCity[item][0].cityId)
|
|
|
addTooltip(
|
|
|
`${martyrListByCity[item][0].cityId}`,
|
|
|
- `烈士 ${martyrListByCity[item].length} | 亲属 ${relativeList[item]?.length || 0
|
|
|
+ `烈士 ${martyrListByCity[item].length} | 亲属 ${
|
|
|
+ relativeList[item]?.length || 0
|
|
|
} | 线索 ${clueList[item]?.length || 0}`
|
|
|
)
|
|
|
})
|
|
@@ -240,14 +242,14 @@ function A1home() {
|
|
|
const target = e.target as SVGElement
|
|
|
const tooltip = svgRef.current?.querySelector(`#tap-${target.id}Tooltip`)
|
|
|
if (tooltip) {
|
|
|
- ; (tooltip as HTMLElement).style.opacity = '1'
|
|
|
+ ;(tooltip as HTMLElement).style.opacity = '1'
|
|
|
}
|
|
|
}, [])
|
|
|
const mouseLeave = useCallback((e: MouseEvent) => {
|
|
|
const target = e.target as SVGElement
|
|
|
const tooltip = svgRef.current?.querySelector(`#tap-${target.id}Tooltip`)
|
|
|
if (tooltip) {
|
|
|
- ; (tooltip as HTMLElement).style.opacity = '0'
|
|
|
+ ;(tooltip as HTMLElement).style.opacity = '0'
|
|
|
}
|
|
|
}, [])
|
|
|
const clickCity = useCallback(
|
|
@@ -266,7 +268,6 @@ function A1home() {
|
|
|
} else {
|
|
|
setCurCityId('')
|
|
|
}
|
|
|
-
|
|
|
}, 800)
|
|
|
},
|
|
|
[focusOnCity, isDragging, martyrListByCity]
|
|
@@ -348,7 +349,9 @@ function A1home() {
|
|
|
(cityId: string, name: string, martyrId: number) => {
|
|
|
getMartyrDetail(martyrId).then(res => {
|
|
|
setMartyrDetail(res.data)
|
|
|
- const arrowToCity = res.data.kinship.map((item: any) => nameToCityId[item.city]).filter((item: any) => item?.city !== res.data.nativeCity)
|
|
|
+ const arrowToCity = res.data.kinship
|
|
|
+ .map((item: any) => nameToCityId[item.city])
|
|
|
+ .filter((item: any) => item?.city !== res.data.nativeCity)
|
|
|
console.log(arrowToCity, 'arrowToCity')
|
|
|
drawArrows(cityId, arrowToCity)
|
|
|
})
|
|
@@ -359,7 +362,6 @@ function A1home() {
|
|
|
focusOnCity(cityId)
|
|
|
changeTooltipText(cityId, name)
|
|
|
setEnableTooltipEvents(false)
|
|
|
-
|
|
|
},
|
|
|
[changeTooltipText, drawArrows, focusOnCity, getMartyrDetail, getRelationList]
|
|
|
)
|
|
@@ -479,13 +481,20 @@ function A1home() {
|
|
|
classN={isAddClassName ? 'animatedR' : ''}
|
|
|
handleItemClick={handleItemClick}
|
|
|
/>
|
|
|
- <Detail relationList={relationList} martyrDetail={martyrDetail} classN={isAddClassName ? 'animatedD' : ''} />
|
|
|
+ <Detail
|
|
|
+ relationList={relationList}
|
|
|
+ martyrDetail={martyrDetail}
|
|
|
+ classN={isAddClassName ? 'animatedD' : ''}
|
|
|
+ />
|
|
|
<img
|
|
|
className={isAddClassName ? 'headLine animatedH' : 'headLine'}
|
|
|
src={require('@/assets/img/headLineBg.png')}
|
|
|
alt=''
|
|
|
/>
|
|
|
- <BottomSearch handleItemClick={handleItemClick} classN={isAddClassName ? 'animatedB' : ''} />
|
|
|
+ <BottomSearch
|
|
|
+ handleItemClick={handleItemClick}
|
|
|
+ classN={isAddClassName ? 'animatedB' : ''}
|
|
|
+ />
|
|
|
</div>
|
|
|
)
|
|
|
}
|