比对模式的检测报告生成和下载
This commit is contained in:
@@ -195,7 +195,7 @@
|
||||
:append-to-body="true"
|
||||
/>
|
||||
<!-- 报告生成弹框 -->
|
||||
<ReportResultPopup ref="reportPopup"></ReportResultPopup>
|
||||
<ReportResultPopup ref="reportPopup" @reportGenerated="handleReportGenerated"></ReportResultPopup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -214,13 +214,13 @@ import { type Device } from '@/api/device/interface/device'
|
||||
import { type ColumnProps, type ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { type Plan } from '@/api/plan/interface'
|
||||
import { type StandardDevice } from '@/api/device/interface/standardDevice'
|
||||
import { downloadDevData, generateDevReport, getBoundPqDevList } from '@/api/plan/plan'
|
||||
import { downloadDevData, downloadDevDataWithHeaders, generateDevReport, getBoundPqDevList } from '@/api/plan/plan'
|
||||
import { getPqDev } from '@/api/device/device'
|
||||
import { useAppSceneStore, useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { useCheckStore } from '@/stores/modules/check'
|
||||
import { CheckData } from '@/api/check/interface'
|
||||
import { useAuthStore } from '@/stores/modules/auth'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import { useDownload, useDownloadWithServerFileName } from '@/hooks/useDownload'
|
||||
import { documentedPqDev } from '@/api/device/report'
|
||||
import { ResultEnum } from '@/enums/httpEnum'
|
||||
import { getPqMonList } from '@/api/device/monitor/index.ts'
|
||||
@@ -1033,6 +1033,7 @@ const openDrawer = async (title: string, row: any) => {
|
||||
// 单个设备报告生成
|
||||
if (title === '报告生成') {
|
||||
if (modeStore.currentMode == '比对式'){
|
||||
console.log(row)
|
||||
reportPopup.value?.open(row)
|
||||
}else{
|
||||
await generateDevReport({
|
||||
@@ -1049,9 +1050,9 @@ const openDrawer = async (title: string, row: any) => {
|
||||
}
|
||||
|
||||
if (title === '报告下载') {
|
||||
await useDownload(
|
||||
downloadDevData,
|
||||
row.createId,
|
||||
await useDownloadWithServerFileName(
|
||||
downloadDevDataWithHeaders,
|
||||
row.createId, // 备用文件名
|
||||
{
|
||||
planId: checkStore.plan.id,
|
||||
devId: row.id
|
||||
@@ -1121,6 +1122,11 @@ const handleQuitClicked = () => {
|
||||
emit('batchGenerateClicked') // 触发事件
|
||||
}
|
||||
|
||||
// 处理报告生成完成事件
|
||||
const handleReportGenerated = () => {
|
||||
emit('batchGenerateClicked') // 触发事件通知父组件刷新数据
|
||||
}
|
||||
|
||||
defineExpose({ changeActiveTabs })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user