Commit 2052f602 authored by wenmo's avatar wenmo

解决双击任务树导致编辑器打开多个问题

parent c0e47d3b
......@@ -60,6 +60,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
const [catalogueFormValues, setCatalogueFormValues] = useState({});
const [taskFormValues, setTaskFormValues] = useState({});
const [rightClickNode, setRightClickNode] = useState<TreeDataNode>();
const [available, setAvailable] = useState<boolean>(true);
const getTreeData = async () => {
const result = await getCatalogueTreeData();
......@@ -116,6 +117,11 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
};
const toOpen=(node:TreeDataNode)=>{
if(!available){return}
setAvailable(false);
setTimeout(()=>{
setAvailable(true);
},200);
if(node.isLeaf&&node.taskId) {
for(let item of tabs.panes){
if(item.key==node.taskId){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment