|
|
|
@ -5,9 +5,9 @@ import PropTypes from 'prop-types';
|
|
|
|
|
import NewHeader from './NewHeader'
|
|
|
|
|
import NewFooter from './NewFooter'
|
|
|
|
|
import SiderBar from './SiderBar'
|
|
|
|
|
import { getUrl } from 'educoder'
|
|
|
|
|
import { getUrl, downloadFile } from 'educoder'
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
import { Spin } from 'antd'
|
|
|
|
|
import './TPMIndex.css'
|
|
|
|
|
import LoginDialog from '../login/LoginDialog';
|
|
|
|
|
import AccountProfile from '../user/AccountProfile';
|
|
|
|
@ -79,7 +79,9 @@ export function TPMIndexHOC(WrappedComponent) {
|
|
|
|
|
coursedata: {},
|
|
|
|
|
|
|
|
|
|
isRender: false,
|
|
|
|
|
AccountProfiletype: false
|
|
|
|
|
AccountProfiletype: false,
|
|
|
|
|
|
|
|
|
|
slowDownloading: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -133,7 +135,18 @@ export function TPMIndexHOC(WrappedComponent) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
keyupListener = (e) => {
|
|
|
|
|
if (e.key === "Escape") {
|
|
|
|
|
this.setState({ slowDownloading: false })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
window.removeEventListener('keyup', this.keyupListener)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
window.addEventListener('keyup', this.keyupListener)
|
|
|
|
|
|
|
|
|
|
if(this.props.match.path==="/"){
|
|
|
|
|
document.title="创新源于实践";
|
|
|
|
|
}else if(this.props.match.path==="/403"){
|
|
|
|
@ -364,6 +377,22 @@ export function TPMIndexHOC(WrappedComponent) {
|
|
|
|
|
DownloadOpenPdf=(type,url)=>{
|
|
|
|
|
type===true?window.open(url):window.location.href=url;
|
|
|
|
|
}
|
|
|
|
|
slowDownload = (url, tip) => {
|
|
|
|
|
this._slowDownloadTip = tip || '正在生成文件,请稍后...';
|
|
|
|
|
this.setState({ slowDownloading: true })
|
|
|
|
|
const fileUrl = url;
|
|
|
|
|
downloadFile({
|
|
|
|
|
url: fileUrl,
|
|
|
|
|
successCallback: (url) => {
|
|
|
|
|
this.setState({ slowDownloading: false })
|
|
|
|
|
console.log('successCallback')
|
|
|
|
|
},
|
|
|
|
|
failCallback: (responseHtml, url) => {
|
|
|
|
|
this.setState({ slowDownloading: false })
|
|
|
|
|
console.log('failCallback')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state;
|
|
|
|
|
const common = {
|
|
|
|
@ -387,10 +416,12 @@ export function TPMIndexHOC(WrappedComponent) {
|
|
|
|
|
|
|
|
|
|
ShowOnlinePdf:(url)=>this.ShowOnlinePdf(url),
|
|
|
|
|
DownloadFileA:(title,url)=>this.DownloadFileA(title,url),
|
|
|
|
|
DownloadOpenPdf:(type,url)=>this.DownloadOpenPdf(type,url)
|
|
|
|
|
DownloadOpenPdf:(type,url)=>this.DownloadOpenPdf(type,url),
|
|
|
|
|
|
|
|
|
|
slowDownload: this.slowDownload
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div className="indexHOC">
|
|
|
|
|
{isRender===true ? <LoginDialog
|
|
|
|
|
Modifyloginvalue={()=>this.hideLoginDialog()}
|
|
|
|
|
{...this.props}
|
|
|
|
@ -423,8 +454,28 @@ export function TPMIndexHOC(WrappedComponent) {
|
|
|
|
|
-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1);
|
|
|
|
|
box-shadow: 0px 0px 12px rgba(0,0,0,0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.globalSpin {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.indexHOC > .ant-spin-nested-loading {
|
|
|
|
|
background: #000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.globalSpin .ant-spin-text {
|
|
|
|
|
text-shadow: none !important;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.globalSpin .ant-spin-dot-item {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}</style>
|
|
|
|
|
<Spin spinning={this.state.slowDownloading} delay={0} className="globalSpin"
|
|
|
|
|
size="large"
|
|
|
|
|
tip= {this._slowDownloadTip || "加载中..."}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<NewHeader {...this.state} {...this.props}></NewHeader>
|
|
|
|
|
<div className="newContainer newContainers">
|
|
|
|
|
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
|
|
|
|
@ -440,6 +491,7 @@ export function TPMIndexHOC(WrappedComponent) {
|
|
|
|
|
<NewFooter
|
|
|
|
|
Footerdown={Footerdown}
|
|
|
|
|
/>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|