修改现场测试问题

This commit is contained in:
GGJ
2025-01-03 12:45:54 +08:00
parent 6a06652532
commit 3094ac94c0
24 changed files with 249 additions and 97 deletions

View File

@@ -21,6 +21,7 @@ import { ElMessage } from 'element-plus'
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
import { analyseWave } from '@/api/common'
import { mainHeight } from '@/utils/layout'
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
const props = defineProps({
activeName: String,
activeColName: [Object, String]
@@ -141,13 +142,18 @@ const tableStore = new TableStore({
return !row.wavePath
},
click: row => {
row.loading2 = true
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
window.open(url, '_self')
setTimeout(() => {
ElMessage.success('波形下载成功!')
row.loading2 = false
}, 1500)
getFileZip({ eventId: row.id }).then(res => {
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link) //释放标签
})
}
}
]