|
|
|
@ -1,29 +1,22 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import { WordsBtn,ActionBtn,getmyUrl,getUrl } from 'educoder';
|
|
|
|
|
import {Tooltip,message,Input, Button} from 'antd';
|
|
|
|
|
import { WordsBtn } from 'educoder';
|
|
|
|
|
import {Tooltip,message} from 'antd';
|
|
|
|
|
import {Link} from 'react-router-dom';
|
|
|
|
|
import {getImageUrl} from 'educoder';
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
import {getUrl} from 'educoder';
|
|
|
|
|
import moment from 'moment'
|
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
|
import Showoldfiles from "../coursesPublic/Showoldfiles";
|
|
|
|
|
import Modals from '../../modals/Modals';
|
|
|
|
|
import HeadlessModal from '../../user/usersInfo/common/HeadlessModal'
|
|
|
|
|
import ClipboardJS from 'clipboard'
|
|
|
|
|
import '../../user/usersInfo/video/InfosVideo.css'
|
|
|
|
|
let _clipboard = null;
|
|
|
|
|
|
|
|
|
|
class Fileslistitem extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
videoModalObj:false,
|
|
|
|
|
file_url:null,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setVisible=(bool)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
videoModalObj:bool
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
settingList=()=>{
|
|
|
|
|
let {discussMessage}=this.props
|
|
|
|
@ -35,9 +28,6 @@ class Fileslistitem extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showfiles=(list)=>{
|
|
|
|
|
// console.log("showfiles");
|
|
|
|
|
// console.log(list);
|
|
|
|
|
|
|
|
|
|
if(this.props.checkIfLogin()===false){
|
|
|
|
|
this.props.showLoginDialog()
|
|
|
|
|
return
|
|
|
|
@ -56,21 +46,7 @@ class Fileslistitem extends Component{
|
|
|
|
|
if(list.is_history_file===false){
|
|
|
|
|
// this.props.DownloadFileA(list.title,list.url)
|
|
|
|
|
//window.location.href=list.url;
|
|
|
|
|
if(list.content_type){
|
|
|
|
|
if(list.content_type==="video/mp4"){
|
|
|
|
|
this.setState({
|
|
|
|
|
videoModalObj:true,
|
|
|
|
|
file_url:"https://"+document.domain+list.url+'?file_name='+list.title+"&disposition=MP4",
|
|
|
|
|
// file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
window.open(list.url, '_blank');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
window.open(list.url, '_blank');
|
|
|
|
|
}
|
|
|
|
|
window.open(list.url, '_blank');
|
|
|
|
|
}else{
|
|
|
|
|
let {discussMessage,coursesId}=this.props
|
|
|
|
|
let file_id=discussMessage.id
|
|
|
|
@ -89,24 +65,7 @@ class Fileslistitem extends Component{
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// this.props.DownloadFileA(result.data.title,result.data.url)
|
|
|
|
|
if(list.content_type){
|
|
|
|
|
if(list.content_type==="video/mp4"){
|
|
|
|
|
this.setState({
|
|
|
|
|
videoModalObj:true,
|
|
|
|
|
file_url:"https://"+document.domain+list.url+'?file_name='+list.title+'&disposition=MP4',
|
|
|
|
|
// file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
window.open(list.url, '_blank');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
window.open(list.url, '_blank');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.open(list.url, '_blank');
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
Showoldfiles:true,
|
|
|
|
@ -128,17 +87,6 @@ class Fileslistitem extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Clicktobroadcastthevideo=(bool,url)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
videoModalObj:bool,
|
|
|
|
|
file_url:"https://"+document.domain+url+'&disposition=MP4',
|
|
|
|
|
// file_url:getUrl()+url+'&disposition=MP4',
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onDelete = (id) => {
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
@ -163,17 +111,6 @@ class Fileslistitem extends Component{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
copyurls =()=>{
|
|
|
|
|
//复制网络链接
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (!_clipboard) {
|
|
|
|
|
_clipboard = new ClipboardJS('.copybtn');
|
|
|
|
|
_clipboard.on('success', (e) => {
|
|
|
|
|
this.props.showNotification("复制成功");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 200)
|
|
|
|
|
}
|
|
|
|
|
savedelete=(id)=>{
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
@ -215,40 +152,13 @@ class Fileslistitem extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
const {videoModalObj,file_url}=this.state
|
|
|
|
|
|
|
|
|
|
const { checkBox,
|
|
|
|
|
discussMessage,index
|
|
|
|
|
} = this.props;
|
|
|
|
|
// console.log("Fileslistitem");
|
|
|
|
|
// console.log( document.domain);
|
|
|
|
|
// console.log(this.props.imhost);
|
|
|
|
|
// console.log( window.location.href);
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div className="graduateTopicList boardsList">
|
|
|
|
|
{
|
|
|
|
|
videoModalObj&&videoModalObj===true?
|
|
|
|
|
<HeadlessModal
|
|
|
|
|
visible={videoModalObj}
|
|
|
|
|
setVisible={(bool)=>this.setVisible(bool)}
|
|
|
|
|
className="showVideoModal"
|
|
|
|
|
width={800 - 1}
|
|
|
|
|
>
|
|
|
|
|
<video
|
|
|
|
|
preload="auto"
|
|
|
|
|
src={file_url} controls="true" >
|
|
|
|
|
您的浏览器不支持 video 标签。
|
|
|
|
|
</video>
|
|
|
|
|
<div className="df copyLine">
|
|
|
|
|
<Input value={file_url}
|
|
|
|
|
className="dark"
|
|
|
|
|
></Input>
|
|
|
|
|
<ActionBtn className="copybtn" data-clipboard-text={file_url} onClick={() =>this.copyurls()}>复制视频地址</ActionBtn>
|
|
|
|
|
</div>
|
|
|
|
|
</HeadlessModal>
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{/*提示*/}
|
|
|
|
|
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
|
|
|
|
@ -263,7 +173,6 @@ class Fileslistitem extends Component{
|
|
|
|
|
{...this.props}
|
|
|
|
|
visible={this.state.Showoldfiles}
|
|
|
|
|
allfiles={this.state.allfiles}
|
|
|
|
|
Clicktobroadcastthevideo={(bool,urls,index)=>this.Clicktobroadcastthevideo(bool,urls,index)}
|
|
|
|
|
closaoldfilesprops={this.closaoldfilesprops}
|
|
|
|
|
/>
|
|
|
|
|
<style>{`
|
|
|
|
@ -457,4 +366,3 @@ class Fileslistitem extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
export default Fileslistitem;
|
|
|
|
|
|
|
|
|
|