|
@@ -4,6 +4,7 @@ import { CommonCompModule } from '../../../../services/common.modules';
|
|
|
import { TextbookComponent } from '../../../../app/textbook/textbook.component';
|
|
|
|
|
|
import Parse from 'parse';
|
|
|
+import { textbookServer } from '../../../../services/textbook';
|
|
|
@Component({
|
|
|
selector: 'app-export-file',
|
|
|
templateUrl: './export-file.component.html',
|
|
@@ -26,7 +27,10 @@ export class ExportFileComponent implements OnInit {
|
|
|
btns: {},
|
|
|
};
|
|
|
|
|
|
- constructor(private router: Router, private activeRoute: ActivatedRoute) {}
|
|
|
+ constructor(
|
|
|
+ private router: Router, private activeRoute: ActivatedRoute,
|
|
|
+ public tbookSer: textbookServer,
|
|
|
+ ) {}
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.activeRoute.paramMap.subscribe(async (params) => {
|
|
@@ -56,18 +60,6 @@ export class ExportFileComponent implements OnInit {
|
|
|
this.change.emit('next');
|
|
|
}
|
|
|
onDownload() {
|
|
|
- Parse.Cloud.run('tbookExportReport', { processId: this.tbookId }).then(
|
|
|
- (data) => {
|
|
|
- console.log(data);
|
|
|
- let url = data.zipUrl;
|
|
|
- url = url.replaceAll("http://","https://");
|
|
|
- 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>元素
|
|
|
- }
|
|
|
- );
|
|
|
+ this.tbookSer.tbookExportReport({ processId: this.tbookId })
|
|
|
}
|
|
|
}
|