diff --git a/.gitignore b/.gitignore index c266a06ee..4d8788495 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +.vscode/launch.json + # dependencies node_modules .DS_Store diff --git a/packages/components/src/views/MainView/rightSiderBar/index.tsx b/packages/components/src/views/MainView/rightSiderBar/index.tsx index 0597da604..6f77f19b6 100644 --- a/packages/components/src/views/MainView/rightSiderBar/index.tsx +++ b/packages/components/src/views/MainView/rightSiderBar/index.tsx @@ -73,23 +73,22 @@ const RightSiderbar = () => { ); }, [result, tagConfigList]); + const labelToolLen = useMemo( + () => config?.tools?.filter((tool) => labelTool.includes(tool.tool as EToolName)).length, + [config?.tools], + ); const attributeTab = useMemo(() => { - const labelToolLen = config?.tools?.filter((tool) => labelTool.includes(tool.tool as EToolName)).length; const count = graphicResult?.reduce((acc, cur) => { return acc + cur.result.length; }, 0); - if (!labelToolLen) { - return null; - } - return (

标注结果

{count}件
); - }, [config?.tools, graphicResult]); + }, [graphicResult]); return (
@@ -102,9 +101,11 @@ const RightSiderbar = () => { )} - - - + {labelToolLen && ( + + + + )} {textConfig && textConfig.length > 0 && (