Commit ef0601fd authored by chenshouchao's avatar chenshouchao

feat: 上传文件弹窗重构

parent 829ec90b
...@@ -83,6 +83,7 @@ const ProjectData = observer(() => { ...@@ -83,6 +83,7 @@ const ProjectData = observer(() => {
const [moveDialogOpen, setMoveDialogOpen] = useState(false); const [moveDialogOpen, setMoveDialogOpen] = useState(false);
// 文件删除弹窗控制 // 文件删除弹窗控制
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false); const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const [uploaderDialogOpen, setUploaderDialogOpen] = useState(false);
useEffect(() => { useEffect(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
...@@ -432,12 +433,6 @@ const ProjectData = observer(() => { ...@@ -432,12 +433,6 @@ const ProjectData = observer(() => {
); );
}; };
// 文件上传
let UpLoaderFileRef: any = React.createRef();
const hanleShowUpLoaderFileDialog = () => {
UpLoaderFileRef.current.showDialog();
};
// 下载文件 // 下载文件
const hanleDownloadFile = (item: any) => { const hanleDownloadFile = (item: any) => {
const downloadPath = const downloadPath =
...@@ -556,7 +551,7 @@ const ProjectData = observer(() => { ...@@ -556,7 +551,7 @@ const ProjectData = observer(() => {
variant="contained" variant="contained"
size="small" size="small"
style={{ marginRight: "12px" }} style={{ marginRight: "12px" }}
onClick={hanleShowUpLoaderFileDialog} onClick={() => setUploaderDialogOpen(true)}
disabled={ disabled={
selectIds.length !== 0 || selectIds.length !== 0 ||
!isPass("PROJECT_DATA_UPLOAD", "USER") !isPass("PROJECT_DATA_UPLOAD", "USER")
...@@ -685,11 +680,14 @@ const ProjectData = observer(() => { ...@@ -685,11 +680,14 @@ const ProjectData = observer(() => {
showList={showList} showList={showList}
></DeleteDialog> ></DeleteDialog>
)} )}
<UpLoaderFile {uploaderDialogOpen && (
onRef={UpLoaderFileRef} <UpLoaderFile
path={path} uploaderDialogOpen={uploaderDialogOpen}
list={allList} setUploaderDialogOpen={setUploaderDialogOpen}
></UpLoaderFile> path={path}
list={allList}
></UpLoaderFile>
)}
{moveDialogOpen && ( {moveDialogOpen && (
<MoveFile <MoveFile
moveDialogOpen={moveDialogOpen} moveDialogOpen={moveDialogOpen}
......
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