提交详情页面-文件下拉框鼠标移入改点击

This commit is contained in:
谢思 2021-09-24 15:12:14 +08:00
parent a80a20ef6e
commit c70c3f9a7a
1 changed files with 5 additions and 4 deletions

View File

@ -10,6 +10,8 @@ const {Link} =Anchor;
function Files({data,history,owner,projectsId}){ function Files({data,history,owner,projectsId}){
const [ files , setFiles ] = useState(data && data.files); const [ files , setFiles ] = useState(data && data.files);
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径"); const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
const [ isOpen, setIsOpen] = useState(false);
console.log(isOpen);
useEffect(()=>{ useEffect(()=>{
if(data){ if(data){
@ -39,14 +41,13 @@ function Files({data,history,owner,projectsId}){
const folderOpen = ( const folderOpen = (
<Anchor showInkInFixed={false}> <Anchor showInkInFixed={false}>
<div className="folderList"> <div className={`folderList ${isOpen && "invisable"}`}>
{files && files.length>1 && files.map((item, key) => { {files && files.length>1 && files.map((item, key) => {
return ( return (
<Link href={`#value${key}`} title= <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> <AlignCenter>
<i className="iconfont icon-wenjianicon mr4"></i> <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> <span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
</AlignCenter> </AlignCenter>
<div className="see-file"> <div className="see-file">
@ -68,7 +69,7 @@ function Files({data,history,owner,projectsId}){
<div> <div>
<AlignCenter className="color-grey-9 pb10"> <AlignCenter className="color-grey-9 pb10">
<i className="iconfont icon-triangle mr5 font-16"></i> <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-6" style={{cursor:"pointer"}}>
共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改包括 共有<span className="color-grey-3"> {data && data.files_count} 个文件 </span>被更改包括
{ data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" } { data && data.total_addition ? <span className="color-green"> {data && data.total_addition} 次插入</span>:"" }