|
|
@ -509,10 +509,28 @@ export class LeftDomainComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
//导出Excel
|
|
|
|
//导出Excel
|
|
|
|
deriveExcel() { |
|
|
|
deriveExcel() { |
|
|
|
this.originalData = sessionStorage.getItem('userdata') |
|
|
|
// this.originalData = sessionStorage.getItem('userdata')
|
|
|
|
let userdata = { organization: PlanComponent.instance.companyData, hideCloseBtn: true } |
|
|
|
// let userdata = { organization: PlanComponent.instance.companyData, hideCloseBtn: true }
|
|
|
|
sessionStorage.setItem('userdata', JSON.stringify(userdata)) |
|
|
|
// sessionStorage.setItem('userdata', JSON.stringify(userdata))
|
|
|
|
this.isShowBaseDialog = true |
|
|
|
// 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 弹窗
|
|
|
|
//关闭 编辑信息/导出Excel 弹窗
|
|
|
|