diff --git a/src/app/pages/left-domain/left-domain.component.html b/src/app/pages/left-domain/left-domain.component.html index 80a3e8a..0b71f22 100644 --- a/src/app/pages/left-domain/left-domain.component.html +++ b/src/app/pages/left-domain/left-domain.component.html @@ -298,7 +298,7 @@
- +
diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index 6aa4a68..224006b 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -509,10 +509,28 @@ export class LeftDomainComponent implements OnInit { //导出Excel deriveExcel() { - this.originalData = sessionStorage.getItem('userdata') - let userdata = { organization: PlanComponent.instance.companyData, hideCloseBtn: true } - sessionStorage.setItem('userdata', JSON.stringify(userdata)) - this.isShowBaseDialog = true + // this.originalData = sessionStorage.getItem('userdata') + // let userdata = { organization: PlanComponent.instance.companyData, hideCloseBtn: true } + // sessionStorage.setItem('userdata', JSON.stringify(userdata)) + // this.isShowBaseDialog = true + let threeData = JSON.parse(sessionStorage.getItem('3dSceneData')); + const httpOptions = { + responseType: 'blob' as 'json' + }; + this.http.get(`/api/services/app/GasStation/ExportExcelFile?gasStationId=${threeData.id}`, httpOptions).subscribe((data: any) => { + // 文件名中有中文 则对文件名进行转码 + const link = document.createElement('a'); + const blob = new Blob([data], { type: 'application/vnd.ms-excel' }); + link.setAttribute('href', window.URL.createObjectURL(blob)); + link.setAttribute('download', threeData.stationName + '基本信息' + '.xls'); + link.style.visibility = 'hidden'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + this.message.create('success', '导出成功!'); + }, err => { + this.message.create('error', '导出失败!'); + }) } //关闭 编辑信息/导出Excel 弹窗