|
|
|
@ -38,6 +38,9 @@ import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeli |
|
|
|
|
import {NzTableComponent, NzTableModule} from "ng-zorro-antd/table"; |
|
|
|
|
import {BusinessTypePipe} from "../../../pipes/file/business-type.pipe"; |
|
|
|
|
import {StatusPipe} from "../../../pipes/file/status.pipe"; |
|
|
|
|
import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm"; |
|
|
|
|
import {NzButtonComponent} from "ng-zorro-antd/button"; |
|
|
|
|
import {NzBadgeComponent} from "ng-zorro-antd/badge"; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-index', |
|
|
|
@ -85,7 +88,10 @@ import {StatusPipe} from "../../../pipes/file/status.pipe"; |
|
|
|
|
NzTableComponent, |
|
|
|
|
NzModalContentDirective, |
|
|
|
|
BusinessTypePipe, |
|
|
|
|
StatusPipe |
|
|
|
|
StatusPipe, |
|
|
|
|
NzPopconfirmDirective, |
|
|
|
|
NzButtonComponent, |
|
|
|
|
NzBadgeComponent |
|
|
|
|
], |
|
|
|
|
templateUrl: './index.component.html', |
|
|
|
|
styleUrl: './index.component.less', |
|
|
|
@ -111,6 +117,7 @@ export class IndexComponent { |
|
|
|
|
currentParentMenu: any = {}; |
|
|
|
|
downloadType = 1; |
|
|
|
|
interval: any; |
|
|
|
|
showComponent = false; |
|
|
|
|
constructor( |
|
|
|
|
private commonService: CommonService, |
|
|
|
|
private storage: BrowserStorageService, |
|
|
|
@ -124,6 +131,7 @@ export class IndexComponent { |
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
this.communicationService.currentMessage.subscribe(message => { |
|
|
|
|
this.showComponent = true; |
|
|
|
|
this.fileRecords(); |
|
|
|
|
this.findFileRecords(message.id); |
|
|
|
|
this.downloadType = 2; |
|
|
|
@ -212,13 +220,14 @@ export class IndexComponent { |
|
|
|
|
public findFileRecords(id: number) { |
|
|
|
|
this.interval = setInterval(() => this.fileService.findFileRecords(id, (data: any) => { |
|
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
|
if (data['return_data'].status == 1) { |
|
|
|
|
if (data['return_data'].status == 1 || data['return_data'].status == 3) { |
|
|
|
|
this.showComponent = false; |
|
|
|
|
clearTimeout(this.interval); |
|
|
|
|
console.log("完成"); |
|
|
|
|
this.downloadType = 1; |
|
|
|
|
this.fileRecords(); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
this.showComponent = false; |
|
|
|
|
clearTimeout(this.interval); |
|
|
|
|
this.fileRecords(); |
|
|
|
|
this.downloadType = 1; |
|
|
|
@ -233,10 +242,12 @@ export class IndexComponent { |
|
|
|
|
public getDownLoad(id: number) { |
|
|
|
|
this.fileService.getDownLoad(id, (data: any) => { |
|
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
|
window.location.href = data['return_data']; |
|
|
|
|
this.fileRecords(); |
|
|
|
|
window.open(data['return_data']); |
|
|
|
|
}else { |
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|