globalLoading

dev_aliyun_beta
hjm 5 years ago
parent 0f50aca4dc
commit 4ac7efaa66

@ -81,7 +81,7 @@ export function TPMIndexHOC(WrappedComponent) {
isRender: false, isRender: false,
AccountProfiletype: false, AccountProfiletype: false,
slowDownloading: false globalLoading: false
} }
} }
@ -137,7 +137,7 @@ export function TPMIndexHOC(WrappedComponent) {
keyupListener = (e) => { keyupListener = (e) => {
if (e.key === "Escape") { if (e.key === "Escape") {
this.setState({ slowDownloading: false }) this.setState({ globalLoading: false })
} }
} }
componentWillUnmount() { componentWillUnmount() {
@ -379,16 +379,16 @@ export function TPMIndexHOC(WrappedComponent) {
} }
slowDownload = (url, tip) => { slowDownload = (url, tip) => {
this._slowDownloadTip = tip || '正在生成文件,请稍后...'; this._slowDownloadTip = tip || '正在生成文件,请稍后...';
this.setState({ slowDownloading: true }) this.setState({ globalLoading: true })
const fileUrl = url; const fileUrl = url;
downloadFile({ downloadFile({
url: fileUrl, url: fileUrl,
successCallback: (url) => { successCallback: (url) => {
this.setState({ slowDownloading: false }) this.setState({ globalLoading: false })
console.log('successCallback') console.log('successCallback')
}, },
failCallback: (responseHtml, url) => { failCallback: (responseHtml, url) => {
this.setState({ slowDownloading: false }) this.setState({ globalLoading: false })
console.log('failCallback') console.log('failCallback')
} }
}) })
@ -456,7 +456,7 @@ export function TPMIndexHOC(WrappedComponent) {
} }
.globalSpin { .globalSpin {
max-height: 700px !important;
} }
.indexHOC > .ant-spin-nested-loading { .indexHOC > .ant-spin-nested-loading {
background: #000; background: #000;
@ -471,7 +471,7 @@ export function TPMIndexHOC(WrappedComponent) {
} }
` `
}</style> }</style>
<Spin spinning={this.state.slowDownloading} delay={0} className="globalSpin" <Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large" size="large"
tip= {this._slowDownloadTip || "加载中..."} tip= {this._slowDownloadTip || "加载中..."}
> >

Loading…
Cancel
Save