diff --git a/frontend/src/views/home/components/deviceConnectionPopup.vue b/frontend/src/views/home/components/deviceConnectionPopup.vue index 5307b53..c8e2bcb 100644 --- a/frontend/src/views/home/components/deviceConnectionPopup.vue +++ b/frontend/src/views/home/components/deviceConnectionPopup.vue @@ -47,6 +47,7 @@ :devIdList="devIdList" :pqStandardDevList="pqStandardDevList" :planIdKey="planIdKey" + @quitClicked="quitClicked" > @@ -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 }) diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 7640214..b077f35 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -82,7 +82,7 @@ type="primary" icon="Clock" @click="handleTest2('手动检测')" - v-if="modeStore.currentMode == '比对式'" + v-if="form.activeTabs === 0 && modeStore.currentMode == '比对式'" > 手动检测 @@ -126,26 +126,30 @@ - - - 报告下载 - - - - 报告生成 - + + + 报告下载 + + + + 报告生成 + + 检测数据查询 @@ -182,14 +186,14 @@ - + - + @@ -532,10 +536,22 @@ const columns = reactive[]>([ } } }, - { prop: 'operation', label: '操作', fixed: 'right', minWidth: 200, isShow: operationShow } + { prop: 'operation', label: '操作', fixed: 'right', minWidth :200,isShow: operationShow } ]) 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: `报告生成成功!` }) } } @@ -1045,9 +1062,10 @@ const openDrawer = async (title: string, row: any) => { pageNum: 1, pageSize: 999 }) - emit('batchGenerateClicked') // 触发事件 + emit('batchGenerateClicked') // 触发事件 ElMessage.success({ message: `报告生成成功!` }) } + } if (title === '报告下载') { diff --git a/frontend/src/views/home/components/tree.vue b/frontend/src/views/home/components/tree.vue index 622df27..da1fe5c 100644 --- a/frontend/src/views/home/components/tree.vue +++ b/frontend/src/views/home/components/tree.vue @@ -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 })