- {item.name} + {item.name} {item.trend_type}
} diff --git a/src/forge/Branch/Select.jsx b/src/forge/Branch/Select.jsx index 073658d9..ff3dd829 100644 --- a/src/forge/Branch/Select.jsx +++ b/src/forge/Branch/Select.jsx @@ -1,32 +1,61 @@ -import React , { useState , useEffect } from 'react'; -import { Popover , Dropdown , Input , Spin } from 'antd'; +import React , { useState , useEffect , useRef } from 'react'; +import { Dropdown} from 'antd'; import './branch.scss'; -import { getBranch , getTag } from '../GetData/getData'; import SelectOverlay from './SelectOverlay'; - +import { findDOMNode } from 'react-dom'; export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{ const [ showValue , setShowValue ] = useState(branch); + const [ visible , setVisible ] = useState(false); + + const refFa = useRef(null); + const refBox = useRef(null); + + useEffect(() => { + document.addEventListener('click', clickMe , false); + }, []) + + const clickMe = ({ target }) => { + // 查找父组件 + const faComponent = findDOMNode(refFa.current); + const boxComponent = findDOMNode(refBox.current); + + if (faComponent && boxComponent) { + const isChild = faComponent.contains(target); + const isBox = boxComponent.contains(target); + if(!isChild && !isBox){ + setVisible(false); + } + } + } useEffect(()=>{ setShowValue(branch); },[branch]) + function ChangeB(params) { + setVisible(false); + changeBranch(params); + } + const menu = ( -暂无{inputValue}{nav === 0 ?"分支":"标签"}~
}{system_notification && system_notification.subject}
+{system_notification && system_notification.sub_subject}
+ {/*Gitlink运营团队
+2021年10月xx日
+- {item.name} +
+ {/* 如果是点击最新则发行版列表页只展示最新的一个 */} + {item.name} 最新
{item.created_at}
@@ -27,7 +27,8 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} }) :