forked from Gitlink/forgeplus-react
提交详情页面-文件下拉框鼠标移入改点击
This commit is contained in:
parent
a80a20ef6e
commit
c70c3f9a7a
|
@ -10,6 +10,8 @@ const {Link} =Anchor;
|
|||
function Files({data,history,owner,projectsId}){
|
||||
const [ files , setFiles ] = useState(data && data.files);
|
||||
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
||||
const [ isOpen, setIsOpen] = useState(false);
|
||||
console.log(isOpen);
|
||||
|
||||
useEffect(()=>{
|
||||
if(data){
|
||||
|
@ -39,14 +41,13 @@ function Files({data,history,owner,projectsId}){
|
|||
|
||||
const folderOpen = (
|
||||
<Anchor showInkInFixed={false}>
|
||||
<div className="folderList">
|
||||
<div className={`folderList ${isOpen && "invisable"}`}>
|
||||
{files && files.length>1 && files.map((item, key) => {
|
||||
return (
|
||||
<Link href={`#value${key}`} title=
|
||||
{<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);}}>
|
||||
{<FlexAJ className="filesInfo" key={key} onClick={() => {item.flag && showDown(item.flag, key, item.isBin);setIsOpen(true);console.log("bbb")}}>
|
||||
<AlignCenter>
|
||||
<i className="iconfont icon-wenjianicon mr4"></i>
|
||||
{/* {!item.isBin ? <i className={!item.flag ? "iconfont icon-sanjiaoxing-down color-grey-9 mt4" : "iconfont icon-triangle font-15 color-grey-9 mt4"} onClick={() => showDown(item.flag, key, item.isBin)}></i> : ""} */}
|
||||
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
|
||||
</AlignCenter>
|
||||
<div className="see-file">
|
||||
|
@ -68,7 +69,7 @@ function Files({data,history,owner,projectsId}){
|
|||
<div>
|
||||
<AlignCenter className="color-grey-9 pb10">
|
||||
<i className="iconfont icon-triangle mr5 font-16"></i>
|
||||
<Popover content={folderOpen} placement="bottomLeft" className="popover-file">
|
||||
<Popover content={folderOpen} placement="bottomLeft" trigger="click" onClick={()=>{isOpen && setIsOpen(false);console.log("aaa")}}>
|
||||
<span className="color-grey-6" style={{cursor:"pointer"}}>
|
||||
共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改,包括
|
||||
{ data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" }
|
||||
|
|
Loading…
Reference in New Issue