mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-02-25 14:54:44 +08:00
file share
This commit is contained in:
parent
96ea225b59
commit
3bd44953d2
2 changed files with 25 additions and 1 deletions
|
@ -2278,6 +2278,7 @@ form {
|
|||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1099;
|
||||
z-index: 1050;
|
||||
background-color: rgba(0, 0, 0, 0.2)
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class RbPreview extends React.Component {
|
|||
<div className="preview-header">
|
||||
<div className="float-left"><h5>{fileName}</h5></div>
|
||||
<div className="float-right">
|
||||
<a><i className="zmdi zmdi-share fs-16"></i></a>
|
||||
<a onClick={this.share}><i className="zmdi zmdi-share fs-16"></i></a>
|
||||
<a target="_blank" rel="noopener noreferrer" href={downloadUrl}><i className="zmdi zmdi-download"></i></a>
|
||||
<a onClick={this.hide}><i className="zmdi zmdi-close"></i></a>
|
||||
</div>
|
||||
|
@ -166,6 +166,11 @@ class RbPreview extends React.Component {
|
|||
$unmount($(this._dlg).parent(), 1)
|
||||
}
|
||||
|
||||
share = () => {
|
||||
let currentUrl = this.props.urls[this.state.currentIndex]
|
||||
renderRbcomp(<FileShare file={currentUrl} />)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} urls string or array of URL
|
||||
* @param {*} index
|
||||
|
@ -175,4 +180,22 @@ class RbPreview extends React.Component {
|
|||
if (typeof urls === 'string') urls = [urls]
|
||||
renderRbcomp(<RbPreview urls={urls} currentIndex={index || 0} />)
|
||||
}
|
||||
}
|
||||
|
||||
// ~ 共享
|
||||
class FileShare extends RbModalHandler {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
render() {
|
||||
return <RbModal ref={(c) => this._dlg = c} title="共享文件" disposeOnHide="true">
|
||||
<div className="input-group input-group-sm">
|
||||
<input className="form-control" />
|
||||
<span className="input-group-append">
|
||||
<button className="btn btn-secondary">复制</button>
|
||||
</span>
|
||||
</div>
|
||||
</RbModal>
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue