This commit is contained in:
王文华 2025-10-20 20:19:46 +08:00
parent 1cdeb42c17
commit 94bd55fc95

View File

@ -36,6 +36,7 @@
<a-menu :selectedKeys="[]" mode="horizontal" theme="dark">
<a-menu-item @click="handleOpenStatisticPage()"> 统计分析 </a-menu-item>
</a-menu>
<el-button type="primary" @click="downloadExcel1" >支援保障仿真效果统计表</el-button>
</div>
<div
ref="scene-cesium-container"
@ -312,6 +313,7 @@ export default {
this.scenarioName = this.$route.params.scenarioName
this.getBlbzTreeData()
this.getWeathers()
window.addEventListener('beforeunload', (e) => {
this.childWindow && this.childWindow.close()
return true // returnValue
@ -327,6 +329,26 @@ export default {
})
},
methods: {
downloadExcel1() {
this.$axios({
method: 'get',
url: '/scenario/battleConsume/statistic/downloadExcel1',
responseType: 'blob'
}).then(res => {
const blob = new Blob([res.data], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = '支援保障仿真效果统计表.xlsx'
link.click()
URL.revokeObjectURL(link.href)
this.loading = false
}).catch(() => {
this.loading = false
this.$message.error('下载失败')
})
},
getWeathers(){
this.$http({
url: `/baseData/weatherResource/list`,
@ -513,20 +535,15 @@ export default {
},
handleOpenStatisticPage() {
if (this.roomInfo.status === 3) {
this.childWindow = window.open(
`/roomStatistics?roomId=${this.roomId}&scenarioId=${this.scenarioId}`,
`/?roomId=${this.roomId}&scenarioId=${this.scenarioId}`,
'roomStatistics',
'height=' +
window.screen.height +
',width=600,' +
',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'
)
} else if (this.roomInfo.status === 0) {
this.$message.error('请完成推演后再进行操作!')
} else {
this.$message.error('推演进行中,请在推演结束后再进行操作!')
}
},
},
}