Browse Source

[新增]增加文件下载链接

tangshan
邵佳豪 3 years ago
parent
commit
4d7f03dc4e
  1. 1
      src/app/statistic-analysis/home/home.component.ts
  2. 12
      src/app/tabbar/tabbar.component.html
  3. 10
      src/app/tabbar/tabbar.component.ts

1
src/app/statistic-analysis/home/home.component.ts

@ -52,7 +52,6 @@ export class HomeComponent implements OnInit {
this.planState.resize() this.planState.resize()
this.chartDwsjcj.resize() this.chartDwsjcj.resize()
this.chartZdgzqy.resize() this.chartZdgzqy.resize()
} */ } */
//获取数据 //获取数据
ordata ordata

12
src/app/tabbar/tabbar.component.html

@ -243,6 +243,18 @@
<mat-icon>save_alt</mat-icon> <mat-icon>save_alt</mat-icon>
<span>下载帮助文档</span> <span>下载帮助文档</span>
</button> </button>
<button mat-menu-item (click)="aFile('../../assets/helpword/plantemplate.zip','级卡片式预案模板')">
<mat-icon>save_alt</mat-icon>
<span>V级卡片式预案模板</span>
</button>
<button mat-menu-item (click)="aFile('../../assets/helpword/plancustom.zip','V级预案自定义')">
<mat-icon>save_alt</mat-icon>
<span>V级预案自定义</span>
</button>
<button mat-menu-item (click)="aFile('../../assets/helpword/planwebmake.zip','V级在线编制以及转在线导入')">
<mat-icon>save_alt</mat-icon>
<span>V级在线编制以及转在线导入</span>
</button>
</mat-menu> </mat-menu>
<!-- 全屏 --> <!-- 全屏 -->
<button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen"> <button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen">

10
src/app/tabbar/tabbar.component.ts

@ -102,6 +102,13 @@ export class TabbarComponent implements OnInit {
this.snackBar.open('下载失败', '确定', config); this.snackBar.open('下载失败', '确定', config);
}) })
} }
aFile(url, name) {
console.log('下载帮助文件')
let a = document.createElement("a");
a.href = url;
a.download = name;
a.click();
}
//提交单位审核 //提交单位审核
submitAudit() { submitAudit() {
let isTrue = confirm('您确定要审核该条信息吗') let isTrue = confirm('您确定要审核该条信息吗')
@ -184,7 +191,8 @@ export class TabbarComponent implements OnInit {
let result = await new Promise((result, reject) => { let result = await new Promise((result, reject) => {
this.http.get(`/api/Objects/help/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { this.http.get(`/api/Objects/help/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => {
result(data) }) result(data)
})
}) })
allFile.push(result) allFile.push(result)

Loading…
Cancel
Save