This commit is contained in:
sjl
2025-10-16 15:05:44 +08:00
parent 13c5baa74f
commit c04be0264a
3 changed files with 53 additions and 25 deletions

View File

@@ -47,6 +47,7 @@
:devIdList="devIdList"
:pqStandardDevList="pqStandardDevList"
:planIdKey="planIdKey"
@quitClicked="quitClicked"
></CompareTestPopup>
</template>
@@ -82,6 +83,14 @@ const { edges, setViewport } = useVueFlow({
}
})
const emit = defineEmits<{
(e: 'childEvent'): void // 添加转发事件
}>()
// 处理子组件事件并转发给爷爷组件
const quitClicked = () => {
emit('childEvent')
}
// 初始化时锁定画布位置
const onPaneReady = () => {
setViewport({ x: 0, y: 0, zoom: 1 })

View File

@@ -82,7 +82,7 @@
type="primary"
icon="Clock"
@click="handleTest2('手动检测')"
v-if="modeStore.currentMode == '比对式'"
v-if="form.activeTabs === 0 && modeStore.currentMode == '比对式'"
>
手动检测
</el-button>
@@ -126,13 +126,16 @@
</template>
<!-- 表格行操作列根据不同模式显示不同的操作按钮 -->
<template #operation="scope">
<div v-if="form.activeTabs === 3"
style="overflow-x: auto; display: flex;justify-content: center; align-items: center"
>
<!-- 报告下载仅在报告已生成或已上传时显示 -->
<el-button
type="primary"
link
icon="Download"
@click="openDrawer('报告下载', scope.row)"
v-if="form.activeTabs === 3 && (scope.row.reportState === 1 || scope.row.reportState === 3)"
v-if="(scope.row.reportState === 1 || scope.row.reportState === 3)"
>
报告下载
</el-button>
@@ -142,10 +145,11 @@
link
icon="Postcard"
@click="openDrawer('报告生成', scope.row)"
v-if="form.activeTabs === 3"
>
报告生成
</el-button>
</div>
<!-- 设备归档模式下的单个归档操作 -->
<el-button
type="primary"
@@ -159,7 +163,7 @@
<!-- 数据操作模式下的功能 -->
<div
v-if="form.activeTabs === 5"
style="overflow-x: auto; width: 260px; display: flex; justify-content: center; align-items: center"
style="overflow-x: auto; display: flex; justify-content: center; align-items: center"
>
<el-button type="primary" link icon="PieChart" @click="openDrawer('检测数据查询', scope.row)">
检测数据查询
@@ -182,14 +186,14 @@
<!-- 省平台模式下的温度湿度填写弹窗 -->
<WriteTHPopup ref="writeTHPopupRef" @openTestDialog2="openTestDialog2"></WriteTHPopup>
<!-- 比对模式下的通道配对弹窗 -->
<DeviceConnectionPopup ref="deviceConnectionPopupRef"></DeviceConnectionPopup>
<DeviceConnectionPopup ref="deviceConnectionPopupRef" @child-event="handleGrandChildEvent"></DeviceConnectionPopup>
<!-- 检测数据查询弹窗 -->
<CompareDataCheckSingleChannelSingleTestPopup
ref="dataCheckSingleChannelSingleTestPopupRef"
:append-to-body="true"
/>
<!-- 报告生成弹框 -->
<ReportResultPopup ref="reportPopup"></ReportResultPopup>
<ReportResultPopup ref="reportPopup" @reportGenerated ="reportGenerated"></ReportResultPopup>
</div>
</template>
@@ -536,6 +540,18 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
])
let testType = 'test' // 检测类型:'test'-检测 'reTest'-复检
//比对单个报告生成
const reportGenerated = ()=>{
emit('batchGenerateClicked') // 触发事件
}
//比对检测完接收孙子组件页面更新
const handleGrandChildEvent = () => {
emit('batchGenerateClicked') // 触发事件
}
/**
* 表格行选择变化时的处理函数
* 更新全局统计信息,用于后续操作的校验和限制
@@ -1004,6 +1020,7 @@ const handleTest = async (val: string) => {
pageNum: 1,
pageSize: 999
})
emit('batchGenerateClicked') // 触发事件
ElMessage.success({ message: `报告生成成功!` })
}
}
@@ -1048,6 +1065,7 @@ const openDrawer = async (title: string, row: any) => {
emit('batchGenerateClicked') // 触发事件
ElMessage.success({ message: `报告生成成功!` })
}
}
if (title === '报告下载') {

View File

@@ -239,6 +239,7 @@ onMounted(async () => {
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id
const result = await getPlanList({ patternId: patternId })
tableData.value = buildTree(result.data as any[])
})
defineExpose({ getTreeData, clickTableToTree })