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

View File

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

View File

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