You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
help_user/src/my/MyDialog.tsx

52 lines
1.9 KiB

import React from "react";
import Dialog from "@material-ui/core/Dialog";
import Draggable from "react-draggable";
import {Paper, Tooltip} from "@material-ui/core";
import {MyDialogProps} from "../entity";
/**
* 我的弹窗
*/
export class MyDialog extends React.Component<MyDialogProps, any>{
render() {
return (
<Dialog
hideBackdrop={true}
open={this.props.open}
// onClose={handleClose}
PaperComponent={(props)=>
<Draggable handle="#draggable-dialog-title" cancel={'[class*="MuiDialogContent-root"]'}>
<Paper {...props} />
</Draggable>}
aria-labelledby="draggable-dialog-title"
classes={{paper:"w-100"}}
>
<div className="d-flex justify-content-between p-3" >
<span className="invisible"/>
<Tooltip title="按下光标拖放弹窗到其他位置" placement="left">
<h3 id="draggable-dialog-title" style={{cursor:"move"}}>{this.props.menuName}</h3>
</Tooltip>
<Tooltip title="关闭弹窗" placement="left">
<img src="close.svg" alt="关闭弹窗" className="closeIcon40" onClick={()=>this.props.onClose()}/>
</Tooltip>
</div>
<div className="p-3">
{this.props.content}
</div>
{/*<DialogActions>*/}
{/* <Button autoFocus color="primary">*/}
{/* Cancel*/}
{/* </Button>*/}
{/* <Button color="primary">*/}
{/* Subscribe*/}
{/* </Button>*/}
{/*</DialogActions>*/}
</Dialog>
);
}
}