Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
17342c76
Commit
17342c76
authored
Jul 20, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除不必要的代码
parent
865e50bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
105 deletions
+0
-105
DeleteMyDialog.tsx
src/components/mui/DeleteMyDialog.tsx
+0
-105
No files found.
src/components/mui/DeleteMyDialog.tsx
deleted
100644 → 0
View file @
865e50bc
import
{
Button
,
Dialog
,
DialogActions
,
DialogContent
,
IconButton
,
DialogTitle
,
}
from
"@mui/material"
;
import
LoadingButton
from
"@mui/lab/LoadingButton"
;
import
CloseIcon
from
"@mui/icons-material/Close"
;
import
{
useState
}
from
"react"
;
import
{
useImperativeHandle
}
from
"react"
;
const
MyDialog
=
(
props
:
any
)
=>
{
const
[
open
,
setOpen
]
=
useState
(
false
);
const
{
title
,
handleSubmit
,
submitloading
,
submitStyle
=
{
backgroundColor
:
"#1370FF"
},
showCloseButton
=
true
,
submitText
=
"确定"
,
}
=
props
;
const
handleClickOpen
=
()
=>
{
setOpen
(
true
);
};
const
handleClose
=
(
event
:
any
=
{},
reason
:
any
=
"other"
)
=>
{
// 点击弹窗外不关闭弹窗
if
(
reason
===
"backdropClick"
)
{
return
;
}
setOpen
(
false
);
};
useImperativeHandle
(
props
.
onRef
,
()
=>
{
return
{
handleClickOpen
:
handleClickOpen
,
handleClose
:
handleClose
,
};
});
return
(
<
Dialog
open=
{
open
}
onClose=
{
handleClose
}
className=
"aaa"
aria
-
labelledby=
"form-dialog-title"
sx=
{
{
"& .MuiDialog-container"
:
{
"& .MuiPaper-root"
:
{
// 设置最大宽度, 实际宽度让子元素撑大
maxWidth
:
"1920px"
,
},
},
}
}
>
{
title
&&
(
<
DialogTitle
id=
"form-dialog-title"
sx=
{
{
fontWeight
:
"600"
}
}
>
{
title
}
</
DialogTitle
>
)
}
<
DialogContent
sx=
{
{
minWidth
:
"400px"
,
}
}
>
{
props
.
children
}
<
IconButton
aria
-
label=
"delete"
style=
{
{
position
:
"absolute"
,
top
:
"10px"
,
right
:
"12px"
}
}
onClick=
{
handleClose
}
>
<
CloseIcon
style=
{
{
color
:
"#C2C6CC"
}
}
/>
</
IconButton
>
</
DialogContent
>
<
DialogActions
style=
{
{
padding
:
"16px 24px"
}
}
>
{
showCloseButton
&&
(
<
Button
onClick=
{
handleClose
}
color=
"inherit"
variant=
"contained"
style=
{
{
color
:
"#1E2633"
,
backgroundColor
:
"#fff"
}
}
size=
"small"
>
取消
</
Button
>
)
}
<
LoadingButton
loading=
{
submitloading
}
onClick=
{
handleSubmit
}
color=
"primary"
variant=
"contained"
style=
{
submitStyle
}
size=
"small"
>
{
submitText
}
</
LoadingButton
>
</
DialogActions
>
</
Dialog
>
);
};
export
default
MyDialog
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment