|
@@ -16,12 +16,13 @@ export class ExportFileComponent implements OnInit {
|
|
|
starCount: number = 0;
|
|
|
otherCount: number = 0;
|
|
|
allCount: number = 0;
|
|
|
-
|
|
|
+ tbookId: any;
|
|
|
constructor(private router: Router, private activeRoute: ActivatedRoute) {}
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.activeRoute.paramMap.subscribe(async (params) => {
|
|
|
let id = params.get('id');
|
|
|
+ this.tbookId = id;
|
|
|
// let query = new Parse.Query('EduProcess');
|
|
|
// query.include('branch', 'department');
|
|
|
// query.equalTo('objectId', id);
|
|
@@ -40,10 +41,24 @@ export class ExportFileComponent implements OnInit {
|
|
|
this.otherCount = await query.count();
|
|
|
});
|
|
|
}
|
|
|
- close(){
|
|
|
- history.back()
|
|
|
+ close() {
|
|
|
+ history.back();
|
|
|
+ }
|
|
|
+ next() {
|
|
|
+ this.change.emit('next');
|
|
|
}
|
|
|
- next(){
|
|
|
- this.change.emit('next')
|
|
|
+ onDownload() {
|
|
|
+ Parse.Cloud.run('tbookExportReport', { processId: this.tbookId }).then(
|
|
|
+ (data) => {
|
|
|
+ console.log(data);
|
|
|
+ let url = data.zipUrl;
|
|
|
+ const a = document.createElement('a'); // 创建一个<a>元素
|
|
|
+ a.href = url; // 设置链接的href属性为要下载的文件的URL
|
|
|
+ a.download = '报送流程'; // 设置下载文件的名称
|
|
|
+ document.body.appendChild(a); // 将<a>元素添加到文档中
|
|
|
+ a.click(); // 模拟点击<a>元素
|
|
|
+ document.body.removeChild(a); // 下载后移除<a>元素
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}
|