预检测,正式检测,数据查询能处理只有录波的情况

This commit is contained in:
sjl
2025-09-22 15:51:58 +08:00
parent 44cdb3273c
commit 783e1c080b
7 changed files with 81 additions and 50 deletions

View File

@@ -14,6 +14,7 @@ export const getBigTestItem = (params: {
export const getScriptList = (params: { export const getScriptList = (params: {
devId:string, devId:string,
chnNum:number, chnNum:number,
num:number
}) => { }) => {
return http.post('/result/getCheckItem', params, {loading: false}) return http.post('/result/getCheckItem', params, {loading: false})
} }

View File

@@ -265,36 +265,32 @@ const open = async (row: any, chnNum: string, deviceId: string | null, source: n
} }
const initGetResult = async () => { const initGetResult = async () => {
// 查询表格数据 // 判断是否为录波数据
if(sourceKey.value == 1 && rowList.value.scriptName == "录波"){ const isLuoboData = (sourceKey.value == 1 && rowList.value.scriptName == "录波") ||
(sourceKey.value == 2 && scriptData.value[0]?.code == "wave_data");
if (isLuoboData) {
isWaveData.value = true isWaveData.value = true
// 设置录波数据相关的选项,与选中左侧录波树时保持一致 // 设置录波数据相关的选项
scriptNameOptions.value = selectScript.value scriptNameOptions.value = selectScript.value.map(item => ({
//.filter(item => item.code !== 'wave_data' && item.code !== 'FREQ')
.map(item => ({
label: item.scriptName, label: item.scriptName,
value: item.scriptName value: item.scriptName
})) }))
// 默认选中第一个选项 // 默认选中第一个选项
if (scriptNameOptions.value.length > 0) { if (scriptNameOptions.value.length > 0) {
selectedScriptName.value = scriptNameOptions.value[0].value selectedScriptName.value = scriptNameOptions.value[0].value
// 更新rowList以匹配选中的script // 更新rowList以匹配选中的script
const selectedItem = scriptData.value.find(item => item.scriptName === selectedScriptName.value) const selectedItem = selectScript.value.find(item => item.scriptName === selectedScriptName.value)
if (selectedItem) { if (selectedItem) {
rowList.value.scriptName = selectedScriptName.value rowList.value.scriptName = selectedScriptName.value
rowList.value.scriptType = selectedItem.id rowList.value.scriptType = selectedItem.id
} }
} }
await getResults('wave_data') await getResults('wave_data')
} else { } else {
await getResults('') await getResults('')
} }
} }
@@ -303,6 +299,7 @@ const initScriptData = async () => {
let response: any = await getScriptList({ let response: any = await getScriptList({
devId: formContent.deviceId, devId: formContent.deviceId,
chnNum: formContent.chnNum, chnNum: formContent.chnNum,
num: formContent.num
}) })
// 格式化脚本数据 // 格式化脚本数据
@@ -335,6 +332,7 @@ const initScriptData = async () => {
// 只有在sourceKey == 2时才设置rowList和tree相关属性 // 只有在sourceKey == 2时才设置rowList和tree相关属性
if (sourceKey.value === 2 && temp.length > 0) { if (sourceKey.value === 2 && temp.length > 0) {
rowList.value.scriptName = temp[0].scriptName rowList.value.scriptName = temp[0].scriptName
rowList.value.scriptType = temp[0].id rowList.value.scriptType = temp[0].id
selectedScriptName.value = temp[0].scriptName selectedScriptName.value = temp[0].scriptName
@@ -346,8 +344,6 @@ const initScriptData = async () => {
} }
// 获取基本信息 // 获取基本信息
const getBasicInformation = async (scriptType: any) => { const getBasicInformation = async (scriptType: any) => {
checkResultData.value = [] checkResultData.value = []
@@ -424,7 +420,6 @@ const handleCommonChange = async () => {
if (sourceKey.value === 2 && scriptData.value.length > 0) { if (sourceKey.value === 2 && scriptData.value.length > 0) {
// 查找当前选中的节点 // 查找当前选中的节点
const currentNode = scriptData.value.find((item: any) => item.id === rowList.value.scriptType) const currentNode = scriptData.value.find((item: any) => item.id === rowList.value.scriptType)
if (currentNode) { if (currentNode) {
// 如果找到了当前节点,则触发点击事件 // 如果找到了当前节点,则触发点击事件
handleNodeClick(currentNode) handleNodeClick(currentNode)
@@ -470,16 +465,19 @@ const handleNodeClick = (data: any) => {
// 每次选中录波数据时都重置为第一个选项并触发getResults // 每次选中录波数据时都重置为第一个选项并触发getResults
if (scriptNameOptions.value.length > 0) { if (scriptNameOptions.value.length > 0) {
selectedScriptName.value = scriptNameOptions.value[0].value selectedScriptName.value = scriptNameOptions.value[0].value
// 更新rowList并触发getResults // 更新rowList并触发getResults
rowList.value.scriptName = selectedScriptName.value rowList.value.scriptName = selectedScriptName.value
const selectedItem = scriptData.value.find(item => item.scriptName === selectedScriptName.value) const selectedItem = selectScript.value.find(item => item.scriptName === selectedScriptName.value)
if (selectedItem) { if (selectedItem) {
rowList.value.scriptType = selectedItem.id rowList.value.scriptType = selectedItem.id
getResults('wave_data') getResults('wave_data')
} }
} }
} else { } else {
isWaveData.value = false isWaveData.value = false
getResults(data.code) getResults(data.code)
} }
@@ -520,7 +518,7 @@ const handleScriptNameChange = (value: string) => {
selectedScriptName.value = value selectedScriptName.value = value
rowList.value.scriptName = value rowList.value.scriptName = value
// 查找选中项的scriptType // 查找选中项的scriptType
const selectedItem = scriptData.value.find(item => item.scriptName === value) const selectedItem = selectScript.value.find(item => item.scriptName === value)
if (selectedItem) { if (selectedItem) {
rowList.value.scriptType = selectedItem.id rowList.value.scriptType = selectedItem.id
getResults('wave_data') getResults('wave_data')
@@ -544,7 +542,6 @@ const close = async () => {
} }
const handleErrorSysChange = async () => { const handleErrorSysChange = async () => {
console.log("切换误差体系", formContent.errorSysId);
changeErrorSystem({ changeErrorSystem({
planId: checkStore.plan.id, planId: checkStore.plan.id,
scriptId: '', scriptId: '',

View File

@@ -15,7 +15,7 @@
finish-status="success"> finish-status="success">
<el-step :status="step1" title="设备通讯校验"/> <el-step :status="step1" title="设备通讯校验"/>
<el-step :status="step2" title="模型一致性校验"/> <el-step :status="step2" title="模型一致性校验"/>
<el-step :status="step3" title="实时数据对齐验证"/> <el-step :status="step3" title="实时数据对齐验证" v-if="!props.onlyWave"/>
<el-step :status="step4" title="相序校验"/> <el-step :status="step4" title="相序校验"/>
<!-- <el-step :status="step6" title="遥控录波功能验证"/> --> <!-- <el-step :status="step6" title="遥控录波功能验证"/> -->
<el-step :status="step5" :title="ts === 'error'? '检测失败':ts === 'process'? '检测中':ts === 'success'? '检测成功':'待检测'"/> <el-step :status="step5" :title="ts === 'error'? '检测失败':ts === 'process'? '检测中':ts === 'success'? '检测成功':'待检测'"/>
@@ -39,7 +39,7 @@
</p> </p>
</div> </div>
</el-collapse-item> </el-collapse-item>
<el-collapse-item name="3"> <el-collapse-item name="3" v-if="!props.onlyWave">
<template #title> <template #title>
实时数据对齐验证 实时数据对齐验证
<el-icon class="title-icon" @click="openDialog" v-if="isShowDialog"><InfoFilled/></el-icon> <el-icon class="title-icon" @click="openDialog" v-if="isShowDialog"><InfoFilled/></el-icon>
@@ -82,7 +82,7 @@
</template> </template>
<script lang="tsx" setup name="preTest"> <script lang="tsx" setup name="preTest">
import {ElMessage, ElMessageBox, StepProps} from "element-plus"; import {ElMessage, ElMessageBox, StepProps} from "element-plus";
import {defineExpose, PropType, ref, toRef, watch} from 'vue'; import {computed, defineExpose, PropType, ref, toRef, watch} from 'vue';
import RealTimeData from './realTimeDataAlign.vue' import RealTimeData from './realTimeDataAlign.vue'
const realTimeDataRef = ref() const realTimeDataRef = ref()
@@ -121,7 +121,13 @@ const step4InitLog = ref([
const isShowDialog = ref(false) const isShowDialog = ref(false)
const collapseActiveName = ref('1') const collapseActiveName = ref('1')
const activeIndex = ref(0) const activeIndex = ref(0)
const activeTotalNum = ref(5) const activeTotalNum = computed(() => {
let count = 4; // 基础步骤数:设备通讯校验、模型一致性校验、相序校验、最终状态
if (props.onlyWave) {
count++; // 添加实时数据对齐验证步骤
}
return count;
});
const step1 = ref<StepProps['status']>('wait') const step1 = ref<StepProps['status']>('wait')
const step2 = ref<StepProps['status']>('wait') const step2 = ref<StepProps['status']>('wait')
const step3 = ref<StepProps['status']>('wait') const step3 = ref<StepProps['status']>('wait')
@@ -167,6 +173,10 @@ const props = defineProps({
mapping: { mapping: {
type: Object as PropType<Record<string, Record<string, string>>>, type: Object as PropType<Record<string, Record<string, string>>>,
default: () => ({}) default: () => ({})
},
onlyWave: {
type: Boolean,
default: false
} }
}) })
@@ -201,6 +211,9 @@ interface DeviceData {
const testDataStructure = ref<Record<string, DeviceData>>({}); const testDataStructure = ref<Record<string, DeviceData>>({});
watch(webMsgSend, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) {
if(testStatus.value == 'success' || testStatus.value == 'error'){
return
}
if (testStatus.value !== 'waiting') { if (testStatus.value !== 'waiting') {
if(newValue.code == 25004){ if(newValue.code == 25004){
ElMessage.error('接收数据超时!') ElMessage.error('接收数据超时!')
@@ -454,11 +467,19 @@ watch(webMsgSend, function (newValue, oldValue) {
} }
}) })
// watch(activeIndex, function (newValue, oldValue) {
// if (newValue <= activeTotalNum.value - 2) {
// collapseActiveName.value = (newValue + 1).toString()
// } else {
// collapseActiveName.value = newValue.toString()
// }
// })
watch(activeIndex, function (newValue, oldValue) { watch(activeIndex, function (newValue, oldValue) {
if (newValue <= activeTotalNum.value - 2) { if (newValue <= activeTotalNum.value - 2) {
collapseActiveName.value = (newValue + 1).toString() collapseActiveName.value = (newValue + 1).toString()
} else { } else {
collapseActiveName.value = newValue.toString() collapseActiveName.value = (activeTotalNum.value - 1).toString()
} }
}) })
@@ -483,6 +504,7 @@ watch(testStatus, function (newValue, oldValue) {
} }
}) })
const emit = defineEmits(['update:testStatus']); const emit = defineEmits(['update:testStatus']);
//监听sn //监听sn
watch(ts, function (newValue, oldValue) { watch(ts, function (newValue, oldValue) {

View File

@@ -264,8 +264,6 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
}) })
return temp return temp
}) })
console.log('🚀 ~ result:', result)
return result return result
}) })
@@ -665,6 +663,7 @@ const initScriptData = async () => {
// 保存脚本数据并设置总数 // 保存脚本数据并设置总数
scriptData.push(...temp) scriptData.push(...temp)
checkTotal = scriptData.length checkTotal = scriptData.length
console.log('shul',checkTotal)
} }
// 初始化设备列表 // 初始化设备列表
const initDeviceList = () => { const initDeviceList = () => {
@@ -687,7 +686,7 @@ const initCheckResult = (defaultValue: CheckData.ChnCheckResultEnum) => {
let tempChnResult: CheckData.ChnCheckResultEnum[] = [] let tempChnResult: CheckData.ChnCheckResultEnum[] = []
for (let j = 0; j < checkStore.chnNumList.length; j++) { for (let j = 0; j < checkStore.chnNumList.length; j++) {
// 录波项目初始化为UNKNOWN状态其他项目使用传入的默认值 // 录波项目初始化为UNKNOWN状态其他项目使用传入的默认值
if (item.code === 'wave_data') { if (item.code === 'wave_data' && checkTotal > 1) {
tempChnResult.push(CheckData.ChnCheckResultEnum.UNKNOWN) tempChnResult.push(CheckData.ChnCheckResultEnum.UNKNOWN)
} else { } else {
tempChnResult.push(defaultValue) tempChnResult.push(defaultValue)

View File

@@ -55,6 +55,7 @@
v-model:testStatus="preTestStatus" v-model:testStatus="preTestStatus"
:webMsgSend="webMsgSend" :webMsgSend="webMsgSend"
:mapping="channelMapping" :mapping="channelMapping"
:onlyWave="onlyWave"
/> />
</keep-alive> </keep-alive>
<keep-alive> <keep-alive>
@@ -242,6 +243,7 @@ const pairs = ref<any>()
const testAgain = ref(false) //重新检测按钮是否显示 const testAgain = ref(false) //重新检测按钮是否显示
const checkNumber = ref(0) //检测次数 const checkNumber = ref(0) //检测次数
const deviceMonitor2= ref<Map<string, any[]>>(); const deviceMonitor2= ref<Map<string, any[]>>();
const onlyWave = ref(false);//计划数据源是否只有录波
const open = async ( const open = async (
title: string, title: string,
mapping: any, mapping: any,
@@ -250,13 +252,14 @@ const open = async (
devIdsArray: [], devIdsArray: [],
standardDevIdsArray: [], standardDevIdsArray: [],
pair: any, pair: any,
deviceMonitor:Map<string, any[]> deviceMonitor:Map<string, any[]>,
planIsOnlyWave: boolean
) => { ) => {
if (checkStore.selectTestItems.preTest && !checkStore.selectTestItems.test) { if (checkStore.selectTestItems.preTest && !checkStore.selectTestItems.test) {
testAgain.value = true testAgain.value = true
} }
deviceMonitor2.value = deviceMonitor; deviceMonitor2.value = deviceMonitor;
console.log('deviceMonitor:',deviceMonitor2.value) onlyWave.value = planIsOnlyWave;
checkStore.setNodesConnectable(true) checkStore.setNodesConnectable(true)
dialogTitle.value = title dialogTitle.value = title
channelMapping.value = mapping channelMapping.value = mapping

View File

@@ -62,6 +62,8 @@ import { ElMessage } from 'element-plus'
import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件 import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件
import { jwtUtil } from '@/utils/jwtUtil' import { jwtUtil } from '@/utils/jwtUtil'
import { useCheckStore } from '@/stores/modules/check' import { useCheckStore } from '@/stores/modules/check'
import { Plan } from '@/api/plan/interface'
import { fa } from 'element-plus/es/locale'
const checkStore = useCheckStore() const checkStore = useCheckStore()
const dialogVisible = ref(false) const dialogVisible = ref(false)
@@ -203,16 +205,18 @@ const devIdList = ref<Device.ResPqDev[]>([])
const pqStandardDevList = ref<StandardDevice.ResPqStandardDevice[]>([]) const pqStandardDevList = ref<StandardDevice.ResPqStandardDevice[]>([])
const planIdKey = ref<string>('') const planIdKey = ref<string>('')
const deviceMonitor = ref<Map<string, any[]>>(); const deviceMonitor = ref<Map<string, any[]>>();
const planIsOnlyWave = ref(false)
const open = async ( const open = async (
device: Device.ResPqDev[], device: Device.ResPqDev[],
standardDev: StandardDevice.ResPqStandardDevice[], standardDev: StandardDevice.ResPqStandardDevice[],
fatherPlanId: string, fatherPlanId: string,
DeviceMonitoringMap: Map<string, any[]>, DeviceMonitoringMap: Map<string, any[]>,
checkType: string checkType: string,
isOnlyWave:boolean
) => { ) => {
planIsOnlyWave.value = isOnlyWave
CompareTestVisible.value = false CompareTestVisible.value = false
devIdList.value = device devIdList.value = device
pqStandardDevList.value = standardDev pqStandardDevList.value = standardDev
planIdKey.value = fatherPlanId planIdKey.value = fatherPlanId
@@ -290,7 +294,8 @@ const openTestDialog = async () => {
devIds.value, devIds.value,
standardDevIds.value, standardDevIds.value,
connections, connections,
deviceMonitor.value deviceMonitor.value ,
planIsOnlyWave.value
) )
}, 100) }, 100)
} }

View File

@@ -829,7 +829,11 @@ const handleTest2 = async (val: string) => {
// 只传递有监测点的设备 // 只传递有监测点的设备
deviceConnectionPopupRef.value?.open(filteredChannelsSelection, pqStandardDevList.value, props.id,filteredDeviceMonitoringMap,val) const targetPlan = props.planTable.data.find((item: any) => item.id === props.plan.id);
// 检查数组长度是否为1且唯一元素是'wave_data'
const isOnlyWave = targetPlan.datasourceIds.length === 1 && targetPlan.datasourceIds[0] === 'wave_data';
deviceConnectionPopupRef.value?.open(filteredChannelsSelection, pqStandardDevList.value, props.id,filteredDeviceMonitoringMap,val,isOnlyWave)
} }
/** /**