Commit ef0601fd authored by chenshouchao's avatar chenshouchao

feat: 上传文件弹窗重构

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